/* Style pour le bouton reset (même couleur que le titre) */
.reset-btn, button.reset-btn {
    background: #10817D !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    padding: 8px 24px;
    font-size: 1em;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 12px #10817d22;
    transition: background 0.18s, box-shadow 0.18s;
}
.reset-btn:hover, button.reset-btn:hover {
    background: #0c6a65 !important;
    box-shadow: 0 4px 24px #10817d33;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    /* background: #f6f7fa; */
    font-family: sans-serif;
}
#launch-screen {
    position: fixed;
    left: 0; top: 0;
    width: 100vw;
    height: 100vh;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    flex-direction: column;
}
#launch-screen img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    position: absolute;
    left: 0;
    top: 0;
}
#launching-text {
    position: absolute;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    color: #fff;
    font-family: sans-serif;
    font-size: 1.5em;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 8px #000a;
    z-index: 100001;
    background: rgba(34,34,34,0.5);
    padding: 8px 28px;
    border-radius: 16px;
    pointer-events: none;
    user-select: none;
}
#container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* background: #10817D; */
    padding: 80px 2vw 4vh 2vw;
    box-sizing: border-box;
}
#welcome-title {
    font-size: clamp(1.7em, 4.5vw, 2.7em);
    font-weight: bold;
    margin: 0;
    color: #10817D;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    letter-spacing: 0.06em;
    text-shadow: 0 4px 24px #0001;
    text-align: center;
}

/* Grille des mondes - Layout adaptatif automatique */
#world-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    justify-items: center;
    /* Grid adaptatif : colonnes automatiques selon l'espace disponible */
    /* Minimum 150px par colonne, maximum 200px */
    grid-template-columns: repeat(auto-fit, minmax(150px, 200px));
    justify-content: center;
}

/* Ajustements pour mobile */
@media (max-width: 600px) {
    /* Ces règles sont maintenant gérées dans la section "FORCER MOBILE RESPONSIVE" à la fin */
}

/* Très petits mobiles */
@media (max-width: 400px) {
    #container {
        padding: 2vh 0.5vw 1vh 0.5vw;
        gap: 1.5vh;
    }
    
    #welcome-title {
        font-size: clamp(1.6em, 7vw, 2em);
        padding: 0 10px;
    }
    
    #world-grid {
        gap: 15px;
        padding: 0 5px;
        /* Très petit mobile : forcer 2 colonnes exactement */
        grid-template-columns: repeat(2, 1fr);
    }
    
    .world-btn {
        min-height: 200px;
    }
    
    .world-btn img {
        width: 80%;
        max-width: 160px;
    }
    
    .world-btn > div:first-of-type {
        font-size: 1.2em;
        margin-top: 6px;
    }
    
    .world-btn .score {
        font-size: 1.1em;
        margin-top: 4px;
    }
}

/* Boutons de monde - Style adaptatif simple */
.world-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* Prend toute la place disponible dans la cellule du grid */
    width: 100%;
    min-height: 180px;
}

.world-btn img {
    width: 85%;
    max-width: 160px;
    aspect-ratio: 1;
    border-radius: 16px;
    object-fit: contain;
    transition: box-shadow 0.2s, background 0.2s;
    border: none;
    background: transparent;
}

.world-btn:hover img,
.world-btn:focus img,
.world-btn:active img {
    box-shadow: 0 4px 24px #10817d33;
    background: rgba(16,129,125,0.10);
}

/* Textes des boutons de monde */
.world-btn div {
    color: #10817D;
}

.world-btn > div:first-of-type {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    margin-top: 8px;
    line-height: 1.2;
}

.world-btn .score {
    font-size: 1.1em;
    text-align: center;
    margin-top: 4px;
}



#mail-icon {
    position: fixed;
    bottom: 24px;
    right: 32px;
    z-index: 2000;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: none;
    padding: 0;
    transition: box-shadow 0.2s;
    display: none; /* Masqué car remplacé par le menu */
}
#mail-icon img {
    width: 64px;
    height: 64px;
    display: block;
}
#mail-icon:hover {
    box-shadow: none;
}
#mail-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0007;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
#mail-popup-content {
    background: #fff;
    border-radius: 18px;
    padding: 32px 24px 24px 24px;
    min-width: 260px;
    box-shadow: 0 4px 32px #0004;
    position: relative;
    font-family: sans-serif;
}
#mail-popup-close {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    user-select: none;
}
/* Mondes verrouillés : grisés tant que le code n'a pas été saisi */
.world-btn.locked img {
    filter: grayscale(1);
    opacity: 0.35;
}
.world-btn.locked div {
    color: #999;
}

#lock-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0007;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
#lock-popup-content {
    background: #fff;
    border-radius: 18px;
    padding: 32px 38px 24px 38px;
    width: 420px;
    max-width: 86vw;
    box-sizing: border-box;
    box-shadow: 0 4px 32px #0004;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    color: #444;
}
#lock-popup-close {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    user-select: none;
}
#lock-popup-title {
    margin: 0 0 12px 0;
    color: #10817D;
}
#lock-form {
    display: flex;
    gap: 8px;
    margin: 18px 0 8px 0;
}
#lock-code {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 1em;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-transform: uppercase;
}
#lock-code:focus {
    outline: none;
    border-color: #10817D;
}
#lock-submit {
    padding: 10px 16px;
    font-family: inherit;
    font-size: 1em;
    color: #fff;
    background: #10817D;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
#lock-submit:disabled {
    opacity: 0.6;
    cursor: default;
}
#lock-error {
    min-height: 1.3em;
    color: #c0392b;
    font-size: 0.9em;
}
.lock-hint {
    margin: 16px 0 0 0;
    padding: 14px 16px;
    font-size: 1.05em;
    line-height: 1.45;
    color: #222;
    background: #e7f3f2;
    border-radius: 10px;
}

.lock-hint a {
    color: #10817D;
    font-weight: bold;
}

#block-mobile-popup {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}



/* Bouton menu burger - maintenant dans le header */
.menu-burger {
    width: 28px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-burger span {
    width: 100%;
    height: 3px;
    background: #10817D;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation du menu burger quand ouvert */
.menu-burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-burger.open span:nth-child(2) {
    opacity: 0;
}

.menu-burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Page de menu overlay */
#menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 4000;
    align-items: center;
    justify-content: center;
}

/* Contenu de la page de menu */
#menu-content {
    background: #fff;
    border-radius: 24px;
    padding: 48px 32px;
    /* min-width: 320px; */
    max-width: 450px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

/* Boutons du menu */
.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #10817D;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 1em;
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(16, 129, 125, 0.2);
    text-align: left;
}

.menu-item:hover {
    background: #0c6a65;
    box-shadow: 0 4px 24px rgba(16, 129, 125, 0.3);
}

.menu-item:last-child {
    margin-bottom: 0;
}

/* Icônes SVG dans les boutons */
.menu-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Titre du menu */
#menu-title {
    color: #10817D;
    font-size: 1.8em;
    font-weight: 700;
    margin: 4px 0 24px 0;
    text-align: center;
}

/* Bouton fermer */
#menu-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

/* Header container pour aligner Ko-fi, titre et menu */
#header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(16, 129, 125, 0.1);
    pointer-events: none;
}

/* Repositionnement des éléments dans le header */
#header-container .kofi-cookie-container {
    position: static;
    top: auto;
    left: auto;
    flex-shrink: 0;
    pointer-events: auto;
}

#header-container .kofi-cookie {
    width: 36px !important;
    height: 32px !important;
    animation: bounce 2s infinite;
    cursor: pointer;
    display: block;
    position: relative;
    border: none;
    background: transparent;
}

#header-container #welcome-title {
    position: static;
    margin: 0;
    text-align: center;
    font-size: clamp(1.2em, 4vw, 2em);
    pointer-events: none;
    width: auto;
    z-index: 6001;
    padding: 0.5rem 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#header-container #menu-btn {
    position: static;
    top: auto;
    right: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    /* width: 48px;J4ai oubJ4ai  */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* Animation bounce pour le Ko-fi */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Ajustement du container principal */

/* FORCER MOBILE RESPONSIVE - 2 COLONNES */
@media screen and (max-width: 600px) {
    #header-container {
        padding: 0.5rem 1rem;
        height: 50px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(16, 129, 125, 0.1);
    }
    
    #header-container #welcome-title {
        font-size: clamp(1.1em, 5vw, 1.6em);
        padding: 0.25rem 0;
    }
    
    #header-container .kofi-cookie {
        width: 28px !important;
        height: 24px !important;
        animation: bounce 2s infinite;
    }
    
    #world-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 0 !important;
        margin: 0 auto !important;
        justify-items: center !important;
    }
    
    .world-btn {
        width: 100% !important;
        min-height: 200px !important;
        max-width: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .world-btn img {
        width: 80% !important;
        max-width: 150px !important;
        height: auto !important;
    }
    
    .world-btn > div:first-of-type {
        font-size: 1.2em !important;
        margin-top: 8px !important;
        text-align: center !important;
    }
    
    .world-btn .score {
        font-size: 1.1em !important;
        margin-top: 6px !important;
        text-align: center !important;
    }
    
    /* Ajustements du conteneur principal sur mobile */
    #container {
        padding: 70px 1vw 2rem 1vw !important;
        align-items: center !important;
    }
}


