/* Fond animé style KOF Ultimate Online */
/* À inclure dans toutes les pages */

body {
    position: relative;
    overflow-x: hidden;
}

/* Canvas de fond pour les particules */
#animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: linear-gradient(135deg,
        #0a0a1a 0%,
        #1a1a2e 25%,
        #16213e 50%,
        #0f0f23 75%,
        #0a0a1a 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

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

/* Overlay de particules */
#animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 90%, rgba(33, 150, 243, 0.06) 0%, transparent 50%);
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.6;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.7;
    }
}

/* Étoiles scintillantes */
#animated-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 85%, white, transparent),
        radial-gradient(1px 1px at 15% 60%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: starsMove 30s linear infinite, starsTwinkle 2s ease-in-out infinite alternate;
    opacity: 0.6;
}

@keyframes starsMove {
    from { background-position: 0% 0%; }
    to { background-position: 100% 100%; }
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Vagues lumineuses */
.light-wave {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    z-index: -1;
    opacity: 0.15;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(138, 43, 226, 0.3) 50%,
        rgba(138, 43, 226, 0.5) 100%
    );
    transform: translateY(0);
    animation: waveFlow 8s ease-in-out infinite;
}

@keyframes waveFlow {
    0%, 100% {
        transform: translateY(0) scaleY(1);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px) scaleY(1.1);
        opacity: 0.25;
    }
}

/* Ensure content is above background */
.container, main, article, section {
    position: relative;
    z-index: 1;
}

/* Lueur douce sur les bords */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(138, 43, 226, 0.03) 40%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: -1;
    pointer-events: none;
    animation: glowPulse 10s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}
