@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
  animation: pop 0.3s ease-out;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(60vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 2.5s ease-in forwards;
}

/* Staggered entrance for game grid children */
.stagger-grid > * {
  animation: slideUpStagger 0.35s ease-out both;
}
.stagger-grid > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-grid > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-grid > *:nth-child(8) { animation-delay: 0.24s; }
.stagger-grid > *:nth-child(9) { animation-delay: 0.27s; }
.stagger-grid > *:nth-child(10) { animation-delay: 0.30s; }
.stagger-grid > *:nth-child(11) { animation-delay: 0.33s; }
.stagger-grid > *:nth-child(12) { animation-delay: 0.36s; }
.stagger-grid > *:nth-child(13) { animation-delay: 0.39s; }
.stagger-grid > *:nth-child(14) { animation-delay: 0.42s; }
.stagger-grid > *:nth-child(15) { animation-delay: 0.45s; }
.stagger-grid > *:nth-child(16) { animation-delay: 0.48s; }

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

/* Equal-size choice buttons (button_to wraps in a form) */
.choice-grid > form,
.choice-grid > form > button {
  width: 100%;
  height: 100%;
}

/* Button press effect */
.btn-press:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}
