/* ============================================================
   GameHub — Animations & Keyframes
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes flash-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.2); }
}

@keyframes neon-pulse {
    0%, 100% {
        text-shadow:
            0 0  7px var(--neon-cyan),
            0 0 15px var(--neon-cyan);
    }
    50% {
        text-shadow:
            0 0 10px var(--neon-cyan),
            0 0 30px var(--neon-cyan),
            0 0 60px rgba(0, 245, 255, 0.4);
    }
}

@keyframes glow-border {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 245, 255, 0.2); }
    50%       { box-shadow: 0 0 20px rgba(0, 245, 255, 0.4), 0 0 40px rgba(0, 245, 255, 0.15); }
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes bounce-in {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.05); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

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

/* ── Utility animation classes ───────────────────────────── */

/* Applied on page load to main content sections */
.animate-fade-in   { animation: fade-in  300ms ease forwards; }
.animate-slide-up  { animation: slide-up 300ms ease forwards; }
.animate-scale-in  { animation: scale-in 200ms ease forwards; }
.animate-float     { animation: float 4s ease-in-out infinite; }

/* Stagger delay helpers */
.delay-1 { animation-delay: 60ms; }
.delay-2 { animation-delay: 120ms; }
.delay-3 { animation-delay: 180ms; }
.delay-4 { animation-delay: 240ms; }
.delay-5 { animation-delay: 300ms; }
.delay-6 { animation-delay: 360ms; }

/* Neon pulse on logo / hero text */
.neon-pulse { animation: neon-pulse 3s ease-in-out infinite; }

/* Glowing border on active/highlighted card */
.glow-border { animation: glow-border 2.5s ease-in-out infinite; }

/* Achievement unlock bounce */
.bounce-in { animation: bounce-in 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* ── Game card entrance (applied via JS on scroll) ──────── */
.card-hidden {
    opacity: 0;
    transform: translateY(20px);
}

.card-visible {
    animation: slide-up 400ms ease forwards;
}

/* ── Hero title stagger ──────────────────────────────────── */
.hero-title { animation: slide-up 500ms ease; }
.hero-sub   { animation: slide-up 500ms 100ms ease both; }
.hero-actions { animation: slide-up 500ms 200ms ease both; }

/* ── Sidebar loading state ───────────────────────────────── */
.lb-loading {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-2);
}

/* ── Achievement earned notification ────────────────────── */
.achievement-toast {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--neon-cyan-dim);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    box-shadow: var(--shadow-lg), var(--glow-cyan);
    animation: slide-up 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.achievement-toast-icon { font-size: 2rem; line-height: 1; }
.achievement-toast-title {
    font-size: var(--fs-xs);
    color: var(--neon-cyan);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.achievement-toast-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}
.achievement-toast-points {
    font-size: var(--fs-xs);
    color: var(--neon-yellow);
}

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