/* ============================================================
   ZUNQIO · Animaciones
   ============================================================ */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(28px) scale(0.96); }
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: none; }
}

@keyframes shimmer {
  to { translate: 100% 0; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--brand-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes gradient-pan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes score-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: var(--accent-amber); }
  100% { transform: scale(1); }
}

@keyframes shake-x {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

@keyframes confetti-fall {
  from { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@keyframes ring-expand {
  from { transform: scale(0.6); opacity: 0.8; }
  to { transform: scale(1.9); opacity: 0; }
}

/* ---------- Clases utilitarias ---------- */
.anim-fade-up { animation: fade-up var(--dur-slow) var(--ease-out) both; }
.anim-fade-in { animation: fade-in var(--dur-base) var(--ease-out) both; }
.anim-pop { animation: pop-in var(--dur-base) var(--ease-spring) both; }
.anim-float { animation: float-y 4s var(--ease-in-out) infinite; }
.anim-shake { animation: shake-x 0.5s var(--ease-in-out); }
.anim-score { animation: score-pop 0.4s var(--ease-spring); }

/* Entrada escalonada para rejillas */
.stagger > * { animation: fade-up var(--dur-slow) var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }
.stagger > *:nth-child(9) { animation-delay: 320ms; }
.stagger > *:nth-child(10) { animation-delay: 360ms; }
.stagger > *:nth-child(n + 11) { animation-delay: 400ms; }

/* Revelado al hacer scroll (IntersectionObserver añade .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slower) var(--ease-out), transform var(--dur-slower) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Transición entre vistas del router */
.view-enter { animation: fade-up var(--dur-slow) var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .stagger > * { animation: none; }
}
