/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

/* Fog Drift */
@keyframes fogDrift {
    0% { transform: translateX(-25%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(-25%); }
}

/* Moon Pulse */
@keyframes moonPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Pulse */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.98); }
}

/* Bat Fly */
@keyframes batFly {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
    25% { transform: translate(100px, -30px) rotate(5deg); opacity: 0.3; }
    50% { transform: translate(200px, 10px) rotate(-5deg); opacity: 0.15; }
    75% { transform: translate(300px, -20px) rotate(3deg); opacity: 0.25; }
    100% { transform: translate(400px, 0) rotate(0deg); opacity: 0.2; }
}

/* Scroll Pulse */
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* Reward Pulse */
@keyframes rewardPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Toast */
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Fade In Up */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fade In Right */
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   INTERSECTION OBSERVER ANIMATIONS
   ============================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered children */
.fade-in-up.visible .game-card:nth-child(1),
.fade-in-up.visible .step-card:nth-child(1),
.fade-in-up.visible .promo-card:nth-child(1),
.fade-in-up.visible .testimonial-card:nth-child(1) {
    transition-delay: 0s;
}

.fade-in-up.visible .game-card:nth-child(2),
.fade-in-up.visible .step-card:nth-child(2),
.fade-in-up.visible .promo-card:nth-child(2),
.fade-in-up.visible .testimonial-card:nth-child(2) {
    transition-delay: 0.1s;
}

.fade-in-up.visible .game-card:nth-child(3),
.fade-in-up.visible .step-card:nth-child(3),
.fade-in-up.visible .promo-card:nth-child(3),
.fade-in-up.visible .testimonial-card:nth-child(3) {
    transition-delay: 0.2s;
}

.fade-in-up.visible .game-card:nth-child(4) {
    transition-delay: 0.3s;
}

/* Smooth scrollbar (optional) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(127,29,29,0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(127,29,29,0.6);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-in-up, .fade-in-right {
        opacity: 1;
        transform: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}