@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -48px); } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes shine { 0% { transform: translateX(-140%) rotate(25deg); } 30%, 100% { transform: translateX(140%) rotate(25deg); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(198,244,50,.9); } 100% { box-shadow: 0 0 0 14px rgba(198,244,50,0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rays { to { transform: rotate(360deg); } }

/* backwards (no both/forwards): una animación de transform que persiste convierte la pantalla
   en bloque contenedor de los position:fixed (scrims, hojas, diálogos) y los descentra con el scroll. */
.screen-enter { animation: screen-in 180ms ease-out backwards; }
.check.pop { animation: pop 250ms var(--ease-pop); }
.pulse { animation: pulse 500ms var(--ease-pop); }
.sheet { animation: sheet-up 220ms ease-out; }
.scrim { animation: fade-in 160ms ease-out; }
.dialog { animation: dialog-in 180ms ease-out; }
.toast { animation: toast-in 200ms ease-out; }
.flash { animation: flash 500ms ease-out; }

.xp-float {
  position: fixed; z-index: 90; pointer-events: none; font-family: var(--font-display); font-weight: 700;
  color: var(--accent-text); font-size: 16px; transform: translate(-50%, 0); animation: float-up 600ms ease-out forwards;
  text-shadow: 0 1px 0 var(--card);
}

/* Brillo de insignias oro/diamante */
.badge-art.shiny { overflow: hidden; border-radius: 30%; }
.badge-art.shiny::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 30%; left: 35%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shine 4s ease-in-out infinite; pointer-events: none;
}
.sparkle { position: absolute; width: 14px; height: 14px; animation: twinkle 1.6s ease-in-out infinite; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .badge-art.shiny::after, .sparkle { display: none; }
  .xp-float { display: none; }
}
