/* ═══════════════════════════════════════════
   POKIT — animations.css
   Keyframes · Transitions · Room Entrances
   ═══════════════════════════════════════════ */

/* ── Room Entrance (staggered children) ── */
.screen.active {
  animation: roomFadeIn 0.35s ease both;
}
.screen.active > *:nth-child(1) { animation: roomEnter 0.45s ease both; animation-delay: 0.05s; }
.screen.active > *:nth-child(2) { animation: roomEnter 0.45s ease both; animation-delay: 0.1s; }
.screen.active > *:nth-child(3) { animation: roomEnter 0.45s ease both; animation-delay: 0.15s; }
.screen.active > *:nth-child(4) { animation: roomEnter 0.45s ease both; animation-delay: 0.2s; }
.screen.active > *:nth-child(5) { animation: roomEnter 0.45s ease both; animation-delay: 0.25s; }
.screen.active > *:nth-child(6) { animation: roomEnter 0.45s ease both; animation-delay: 0.3s; }
.screen.active > *:nth-child(7) { animation: roomEnter 0.45s ease both; animation-delay: 0.35s; }
.screen.active > *:nth-child(8) { animation: roomEnter 0.45s ease both; animation-delay: 0.4s; }

@keyframes roomFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes roomEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Modal Slide Up ── */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ── General Fade In ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Sync Pulse ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Crystal Ball Glow ── */
@keyframes crystalGlow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(212,120,142,0.3), 0 0 60px rgba(212,120,142,0.15),
                inset 0 0 40px rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.3);
  }
  50% {
    box-shadow: 0 0 50px rgba(212,120,142,0.5), 0 0 100px rgba(212,120,142,0.25),
                inset 0 0 50px rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.3);
  }
}
.crystal-ball { animation: crystalGlow 4s ease-in-out infinite; }

/* ── Tarot Card Shake ── */
@keyframes cardShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg) scale(1.02); }
  50% { transform: rotate(2deg) scale(0.98); }
  75% { transform: rotate(-1deg) scale(1.01); }
}

/* ── Gift Bounce (Wrap locked) ── */
@keyframes giftBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
.wrap-gift { animation: giftBounce 2s ease-in-out infinite; }

/* ── Badge Unlock ── */
@keyframes badgeUnlock {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  80% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.badge-unlocking {
  animation: badgeUnlock 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Number Count Pulse ── */
@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ── Toast Notifications ── */
@keyframes toastIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

/* ── Confetti Fall ── */
@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Wobble (tapped items) ── */
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(2deg); }
  60% { transform: rotate(-1.5deg); }
  80% { transform: rotate(0.5deg); }
}
.wobble { animation: wobble 0.5s ease; }

/* ── Bounce In (new items appearing) ── */
@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.12); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}
.bounce-in { animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ── Heartbeat (attention items) ── */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.08); }
  30% { transform: scale(1); }
  45% { transform: scale(1.04); }
}
.heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* ── Shimmer Loading ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    var(--card) 0%, var(--primary-100) 50%, var(--card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Jar Pour (liquid filling) ── */
@keyframes pourIn {
  from { height: 0; }
}

/* ── Float Up (jar bubbles) ── */
@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0.5; }
  100% { transform: translateY(-50px) scale(0.3); opacity: 0; }
}

/* ── Gentle Bob (floating items) ── */
@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.gentle-bob { animation: gentleBob 3s ease-in-out infinite; }

/* ── Shake (error feedback) ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* ── Stars Twinkle (Oracle) ── */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .screen.active > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
