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

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

/* Pulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pulse { animation: pulse 1s ease-in-out infinite; }

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.bounce { animation: bounce 0.6s ease-in-out; }

/* Scale In */
@keyframes scale-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.scale-in { animation: scale-in 300ms var(--transition-spring) forwards; }

/* Fade In */
.fade-in { animation: fade-in 250ms ease forwards; }

/* Flip card (for Alias) */
@keyframes flip-out {
  from { transform: perspective(600px) rotateY(0deg); opacity: 1; }
  to { transform: perspective(600px) rotateY(-90deg); opacity: 0; }
}
@keyframes flip-in {
  from { transform: perspective(600px) rotateY(90deg); opacity: 0; }
  to { transform: perspective(600px) rotateY(0deg); opacity: 1; }
}
.flip-out { animation: flip-out 150ms ease forwards; }
.flip-in { animation: flip-in 150ms ease forwards; }

/* Slide right/left */
@keyframes slide-right {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}
@keyframes slide-left {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-120%); opacity: 0; }
}
.slide-right { animation: slide-right 300ms ease forwards; }
.slide-left { animation: slide-left 300ms ease forwards; }

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 300;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Score counter animation */
@keyframes score-up {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-20px); opacity: 0; }
}
.score-up { animation: score-up 0.5s ease forwards; }

/* Glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: var(--glow-primary); }
  50% { box-shadow: 0 0 30px rgba(124, 106, 239, 0.5); }
}
.glow-pulse { animation: glow-pulse 2s ease-in-out infinite; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
