:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef5ff;
  color: #101c3b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background:
    radial-gradient(circle at 15% 8%, rgba(0, 91, 255, .22), transparent 24rem),
    radial-gradient(circle at 95% 88%, rgba(33, 174, 255, .18), transparent 24rem),
    linear-gradient(150deg, #f7faff 0%, #eaf3ff 52%, #edf8ff 100%);
}

.page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.video-card {
  position: relative;
  width: min(100%, 440px);
  overflow: hidden;
  text-align: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 32px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 26px 76px rgba(21, 112, 219, .24), 0 0 42px rgba(76, 183, 255, .14), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
}

.video-loader {
  position: relative;
  z-index: 1;
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #526987;
  font-size: .9rem;
  font-weight: 700;
}

.video-loader[hidden],
#giftVideo[hidden],
.video-error[hidden] {
  display: none;
}

#giftVideo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: min(78svh, 720px);
  border-radius: 20px;
  background: #0c1628;
  box-shadow: 0 14px 34px rgba(28, 61, 121, .16);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(0, 91, 255, .15);
  border-top-color: #176cff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.video-error {
  position: relative;
  z-index: 1;
  min-height: 220px;
  margin: 0;
  display: grid;
  place-items: center;
  color: #60718c;
  font-weight: 700;
}

.spark {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  filter: blur(3px);
  opacity: .23;
}
.spark-one { top: -95px; left: -50px; background: #2c7fff; }
.spark-two { right: -70px; bottom: -90px; background: #35b8ff; }

@media (max-width: 380px) {
  .video-card { padding: 12px; border-radius: 26px; }
  #giftVideo { border-radius: 17px; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.8s; }
}
