*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.loader-body {
  min-height: var(--app-vh, 100dvh);
  height: var(--app-vh, 100dvh);
  color: rgba(255, 255, 255, 0.88);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  background: linear-gradient(160deg, #010201 0%, #030504 28%, #051008 52%, #030504 78%, #010201 100%);
  background-size: 320% 320%;
  animation: bg-gradient-flow 20s ease-in-out infinite;
}

@keyframes bg-gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  33% { background-position: 100% 0%; }
  66% { background-position: 50% 100%; }
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  will-change: transform;
}

.bg-orb--1 {
  width: min(70vw, 320px);
  height: min(70vw, 320px);
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, #0b2e22 0%, #041610 55%, transparent 72%);
  animation: orb-drift-1 20s ease-in-out infinite;
}

.bg-orb--2 {
  width: min(80vw, 380px);
  height: min(80vw, 380px);
  bottom: -20%;
  right: -20%;
  background: radial-gradient(circle, #082218 0%, #031008 50%, transparent 72%);
  animation: orb-drift-2 24s ease-in-out infinite;
}

.bg-orb--3 {
  width: min(55vw, 260px);
  height: min(55vw, 260px);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #0f3528 0%, #051810 45%, transparent 68%);
  animation: orb-drift-3 18s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.14; }
  50% { transform: translate(10vw, 12vh) scale(1.08); opacity: 0.18; }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.12; }
  50% { transform: translate(-12vw, -10vh) scale(1.06); opacity: 0.16; }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.15; }
}

.loader {
  width: min(92vw, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fade-in 0.35s ease-out;
  position: relative;
  z-index: 1;
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.gift-scene {
  width: 100%;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.gift-tile {
  aspect-ratio: 1;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: visible;
  position: relative;
}

.gift-tile::before {
  display: none;
}

.gift-tile::after {
  display: none;
}

.gift-lottie {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gift-lottie--active {
  opacity: 1;
}

.gift-preview {
  width: 92%;
  height: 92%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.gift-preview--hidden {
  opacity: 0;
  visibility: hidden;
}

.gift-lottie svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.progress-wrap {
  width: 100%;
  text-align: center;
}

.loader--preparing .progress-fill {
  width: 0%;
}

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0a3d2a, #145a3a, #1a6b48);
  border-radius: 3px;
  transition: width 0.08s linear;
}

.progress-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
}

.loader--exit {
  animation: loader-out 0.4s ease-in forwards;
}

@keyframes loader-out {
  to {
    opacity: 0;
    transform: scale(1.02) translateZ(30px);
  }
}

@media (pointer: coarse) {
  .bg-orbs {
    display: none;
  }

  .loader-body {
    animation: none;
    background-position: 50% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-body,
  .bg-orb {
    animation: none !important;
  }
}
