/* =========================================
   GAME PORTAL — ANIMATIONS
   ========================================= */

/* ── FADE IN ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── PULSE GLOW ── */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(14,165,233,0.2); }
  50%       { box-shadow: 0 0 28px rgba(14,165,233,0.5); }
}

/* ── SHIMMER (skeleton) ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

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

/* ── FLOAT ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ── BOUNCE IN ── */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.7); }
  60%  { opacity: 1; transform: scale(1.06); }
  80%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* ── SLIDE IN FROM LEFT ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── STAGGER CHILDREN ── */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.50s; }

/* ── CONTENT ENTRANCE ── */
.hero { animation: fadeInDown 0.5s ease both; }
.controls-bar { animation: fadeIn 0.5s ease 0.15s both; }
.category-section { animation: fadeInUp 0.5s ease both; }

.category-section:nth-child(1) { animation-delay: 0.1s; }
.category-section:nth-child(2) { animation-delay: 0.2s; }
.category-section:nth-child(3) { animation-delay: 0.3s; }

/* ── CARD FLOAT EFFECT ── */
.game-card.focused {
  animation: pulseGlow 2s ease infinite;
}

/* ── OVERLAY ENTRANCE ── */
.game-overlay .overlay-topbar {
  animation: none;
}

.game-overlay.open .overlay-body {
  animation: fadeIn 0.3s ease 0.1s both;
}

/* ── SKELETON LOADER ── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.1ms !important;
  }
}
