@keyframes pop-in {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.pop { animation: pop-in 0.4s ease; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}
.mode-card:hover .mode-emoji { animation: wiggle 0.6s ease; }

@keyframes hint-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 224, 102, 0)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(255, 224, 102, 0.95)); transform: scale(1.08); }
}
.hint-glow { animation: hint-pulse 1s ease-in-out infinite; border-radius: 12px; }

@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.hint-arrow { animation: arrow-bounce 0.7s ease-in-out infinite; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.shake { animation: shake 0.4s ease; }

@keyframes star-pop {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  70% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.big-star.earned { animation: star-pop 0.5s ease backwards; }

@keyframes float-in {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.screen { animation: float-in 0.3s ease; }

@keyframes build-glow {
  0%, 100% { box-shadow: inset 0 0 0 3px rgba(127, 214, 127, 0.4); }
  50% { box-shadow: inset 0 0 30px rgba(127, 214, 127, 0.7); }
}
.build-complete { animation: build-glow 1s ease; }

/* Reduced motion: strip all non-essential animation. */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
}
body.reduced-motion .memory-card-inner { transition: none; }
body.reduced-motion .hint-glow { animation: none; outline: 4px solid var(--sun); }

@media (prefers-reduced-motion: reduce) {
  .screen, .pop, .big-star.earned { animation: none; }
}
