:root {
    --bg-pink: #FFB6C1;
    --main-blue: #2B7FFF;
    --accent-yellow: #FFF200;
    --black: #1A1A1A;
    --white: #FFFFFF;
    --border: 4px solid #1A1A1A;
}

/* --- RESET & BASICS --- */
html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: linear-gradient(45deg, #FFB6C1, #ff9aa2, #ffb7b2, #FFB6C1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Lexend', sans-serif;
    color: var(--black);
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- NUAGES CARTOON SOFT (FOND ANIMÉ) --- */
#clouds-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: white;
    width: 100px; height: 100px;
    border-radius: 50%;
    box-shadow: 
        25px 10px 0 -5px white,
        -25px 10px 0 -5px white,
        0 35px 0 -5px white;
    opacity: 0.6;
    animation: driftLeft infinite linear;
}

.cloud-1  { top: 10%; left: 110%; animation-duration: 90s; transform: scale(1.5); }
.cloud-2  { top: 25%; left: 120%; animation-duration: 70s; animation-delay: -15s; transform: scale(0.8); }
.cloud-3  { top: 45%; left: 115%; animation-duration: 110s; animation-delay: -40s; transform: scale(1.2); }
.cloud-4  { top: 65%; left: 130%; animation-duration: 85s; animation-delay: -5s; }
.cloud-5  { top: 80%; left: 105%; animation-duration: 100s; animation-delay: -25s; transform: scale(0.9); }
.cloud-6  { top: 15%; left: 140%; animation-duration: 120s; transform: scale(1.3); }
.cloud-7  { top: 35%; left: 110%; animation-duration: 95s; animation-delay: -50s; }
.cloud-8  { top: 55%; left: 125%; animation-duration: 80s; transform: scale(1.1); }
.cloud-9  { top: 75%; left: 115%; animation-duration: 130s; animation-delay: -10s; }
.cloud-10 { top: 5%;  left: 150%; animation-duration: 105s; transform: scale(0.7); }

@keyframes driftLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-180vw); }
}

/* --- OVERLAY D'ACCUEIL --- */
#welcome-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--main-blue);
    display: flex;
    justify-content: center; align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s;
}
#welcome-overlay.fade-out { opacity: 0; visibility: hidden; }
/* Centrage complet de l'accueil */
.overlay-content {
    display: flex;
    flex-direction: column; /* Aligne les éléments l'un sous l'autre */
    align-items: center;    /* Centre horizontalement */
    justify-content: center; /* Centre verticalement */
    text-align: center;
}

/* On ajuste un peu le titre pour qu'il ne soit pas collé au bouton */
.overlay-content h1 {
    font-family: 'Fredoka One';
    color: white;
    font-size: 4rem;
    margin-bottom: 30px; /* Espace entre le texte et le bouton */
    text-shadow: 4px 4px 0px var(--black);
    text-transform: none; /* Empêche le passage auto en majuscules si besoin */
}

/* Le bouton reste dans ton style Neobrutalisme */
#start-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* --- HEADER & NAVIGATION --- */
header { 
    background: var(--main-blue); 
    padding: 20px 60px;
    border-bottom: var(--border); 
    color: white;
    position: sticky; top: 0; z-index: 998;
}
.header-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 20px;
}
.hero-title { font-family: 'Fredoka One'; text-shadow: 4px 4px 0px var(--black); margin: 0; }
.header-nav { display: flex; gap: 10px; }

/* --- BOUTONS : ARC-EN-CIEL --- */
.nav-btn, .btn-pop, .btn-spotify {
    background: var(--accent-yellow);
    border: 3px solid var(--black);
    color: var(--black);
    text-decoration: none;
    font-family: 'Fredoka One';
    padding: 8px 15px;
    box-shadow: 4px 4px 0px var(--black);
    transition: transform 0.1s;
    cursor: pointer;
    text-align: center;
}
.nav-btn:hover, .btn-pop:hover, .btn-spotify:hover {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    background-size: 200% auto;
    animation: rainbowShift 1.5s linear infinite;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--black);
}
@keyframes rainbowShift { to { background-position: 200% center; } }

/* --- SECTIONS --- */
.neo-card {
    max-width: 1000px; margin: 40px auto;
    background: white; border: var(--border);
    padding: 30px; box-shadow: 10px 10px 0px var(--black);
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
h2 { font-family: 'Fredoka One'; background: var(--accent-yellow); padding: 5px 15px; border: 3px solid var(--black); display: inline-block; margin-bottom: 20px; }

/* --- IMAGES : HOVER ADOUCI (MODIFIÉ) --- */
img.anim-img { 
    width: 100%; border: var(--border); 
    transition: all 0.2s ease-in-out; 
    cursor: pointer;
}

/* Plus de rotation, zoom léger (1.02) et ombre simple */
img.anim-img:hover { 
    transform: scale(1.02); 
    box-shadow: 8px 8px 0px var(--black); 
}

.ref-small { width: 120px !important; height: 120px !important; object-fit: cover; }
.grid-refs { display: flex; gap: 15px; margin: 20px 0; justify-content: flex-start; }
.steam-img { max-width: 600px; width: 100%; margin: 0 auto; display: block; }

/* --- GRILLES & MUSIQUE --- */
.grid, .grid-4 { display: grid; gap: 20px; margin-top: 15px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.music-item { text-align: center; display: flex; flex-direction: column; gap: 15px; }
.music-item span { font-family: 'Fredoka One'; font-size: 0.85rem; min-height: 40px; display: flex; align-items: center; justify-content: center; }

/* --- PLAYER --- */
#music-player {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--accent-yellow); border: var(--border);
    padding: 15px; box-shadow: 6px 6px 0px var(--black);
    z-index: 999; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.visualizer-mini { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.bar { width: 4px; background: var(--black); animation: bounce 0.5s ease infinite alternate; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce { from { height: 4px; } to { height: 20px; } }

.video-container { width: 100%; border: var(--border); background: #000; box-shadow: 6px 6px 0px var(--black); }
video { width: 100%; display: block; }
footer { background: var(--black); color: white; padding: 60px; text-align: center; margin-top: 60px; }
footer a { color: var(--accent-yellow); text-decoration: none; }
.hidden { display: none !important; }

/* DÉVELOPPEMENT WEB */
#web .grid img {
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* OVERLAY FOCUS (GROS PLAN) */
#overlay-focus {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center; align-items: center;
    z-index: 99999;
    cursor: pointer;
}

#overlay-focus img {
    max-width: 90%;
    max-height: 90%;
    border: 5px solid white;
    box-shadow: 15px 15px 0px var(--black);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#overlay-focus.active { display: flex; }
#overlay-focus.active img { transform: scale(1); }

/* --- ADAPTATION MOBILE (RESPONSIVE) --- */

@media (max-width: 768px) {
    /* Ajustement de l'overlay d'accueil */
    #welcome-overlay .overlay-content h1 {
        font-size: 2rem; /* Plus petit pour ne pas déborder */
        padding: 0 20px;
    }

    /* Header et Navigation mobile */
    header {
        padding: 15px 20px;
    }

    .header-content {
        flex-direction: column; /* Titre au-dessus du menu */
        gap: 15px;
    }

    .header-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* Menu sur 3 colonnes */
        gap: 8px;
        width: 100%;
    }

    .nav-btn {
        font-size: 0.7rem;
        padding: 6px 4px;
        white-space: nowrap;
    }

    /* Sections et Grilles */
    .neo-card {
        margin: 20px 10px;
        padding: 15px;
    }

    h2 {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
    }

    /* Passage des grilles de 4 à 2 colonnes sur mobile */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Ajustement des images de référence 3D */
    .ref-small {
        width: 80px !important;
        height: 80px !important;
    }

    /* Le lecteur de musique en bas */
    #music-player {
        bottom: 10px;
        right: 10px;
        left: 10px; /* Prend presque toute la largeur */
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
    }

    .player-status {
        font-size: 0.6rem;
        max-width: 50%;
    }

    /* Footer */
    footer {
        padding: 40px 20px;
        font-size: 0.8rem;
    }
}

/* Correction pour les très petits écrans (iPhone SE, etc.) */
@media (max-width: 480px) {
    .header-nav {
        grid-template-columns: repeat(2, 1fr); /* Menu sur 2 colonnes seulement */
    }
    
    .pixel-title {
        font-size: 1.5rem;
    }
}