
        :root {
            --bg-color: #2c3e50;
            --panel-color: #34495e;
            --text-color: #ecf0f1;
            --accent-color: #e67e22;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: var(--bg-color);
            background-image: radial-gradient(circle at center, #34495e 0%, #2c3e50 100%);
            color: var(--text-color);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            height: 100vh;
            height: 100dvh; 
            user-select: none;
        }

        /* --- En-tête --- */
        header {
            background-color: var(--panel-color);
            padding: 10px 15px; /* Marges réduites pour mobile */
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.5);
            z-index: 1000;
            position: relative;
            flex-shrink: 0;
            font-size: 0.9rem; /* Texte un peu plus petit pour tout faire tenir */
        }

        /* NOUVEAU : Score de Biodiversité avec Infobulle */
        .score-box {
            font-weight: bold;
            color: #2ecc71; /* Vert nature */
            background: rgba(0,0,0,0.2);
            padding: 5px 10px;
            border-radius: 15px;
            display: flex;
            align-items: center;
            gap: 5px;
            min-width: 60px; /* Pour éviter que ça bouge trop */
            justify-content: center;
            position: relative; /* Pour positionner l'infobulle */
            cursor: help; /* Indique qu'il y a de l'info */
        }

        .tooltip-content {
            visibility: hidden;
            width: 180px;
            background-color: rgba(44, 62, 80, 0.95);
            color: #fff;
            text-align: left;
            border-radius: 8px;
            padding: 10px;
            position: absolute;
            z-index: 3000;
            top: 120%; /* En dessous de la boite */
            left: 0;
            opacity: 0;
            transition: opacity 0.2s;
            font-size: 0.75rem;
            font-weight: normal;
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 4px 15px rgba(0,0,0,0.5);
            pointer-events: none;
        }

        /* Affichage au survol ou au clic (active) */
        .score-box:hover .tooltip-content, .score-box:active .tooltip-content {
            visibility: visible;
            opacity: 1;
        }

        .tooltip-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding-bottom: 2px;
        }
        .tooltip-row:last-child {
            border-bottom: none;
            margin-bottom: 0;
        }

        .title-box {
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #bdc3c7;
        }

        .credits-box {
            font-weight: bold;
            color: #f1c40f; /* Or */
            background: rgba(0,0,0,0.2);
            padding: 5px 10px;
            border-radius: 15px;
            display: flex;
            align-items: center;
            gap: 5px;
            min-width: 60px;
            justify-content: center;
        }

        /* --- Plateau Isométrique --- */
        #game-container {
            flex: 1;
            overflow: auto;
            position: relative;
            background-color: #1a1a1a;
            display: block; 
            padding: 20px;
        }

        #iso-world {
            position: relative;
            margin: 0 auto;
        }

        .tile {
            position: absolute;
            width: 64px;
            height: 64px;
            pointer-events: none; 
            transition: filter 0.2s;
        }

        .tile.hovered {
            filter: brightness(1.4);
            z-index: 20000 !important;
        }

        .tile img {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
            left: 0;
            top: 0;
            transition: transform 0.3s ease; 
        }

        /* CORRECTION LISSAGE AVEC REGLAGE Y */
        .tile .ground-img { 
            z-index: 1; 
            /* On garde le petit agrandissement pour la sécurité */
            width: 102%;
            height: 102%;
            left: -1%;
            top: -1%;
        }
        
        .tile .item-img, 
        .tile .flora-img, 
        .tile .attach-img, 
        .tile .fauna-img {
            /* On remonte les objets pour qu'ils soient posés sur l'herbe et pas dedans */
            top: -6px; 
            width: 100%;
            height: 100%;
            left: 0;
        }

        .tile .item-img { z-index: 2; }
        .tile .flora-img { z-index: 5; }
        .tile .attach-img { z-index: 6; }
        .tile .fauna-img { z-index: 10; }

        .hitbox {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 50; 
            pointer-events: auto; 
            cursor: pointer;
            clip-path: polygon(50% 25%, 100% 50%, 50% 75%, 0% 50%);
        }

        /* --- Barre d'outils --- */
        footer {
            background-color: var(--panel-color);
            padding: 10px;
            display: flex;
            justify-content: space-around;
            box-shadow: 0 -5px 20px rgba(0,0,0,0.4);
            overflow-x: auto;
            z-index: 1000;
            flex-shrink: 0;
        }

        .tool-btn {
            background: linear-gradient(145deg, #2c3e50, #34495e);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 8px;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 55px;
            transition: all 0.2s;
            margin: 0 4px;
            box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
        }

        .tool-btn span {
            font-size: 0.65rem;
            margin-top: 5px;
            font-weight: 600;
            color: #bdc3c7;
        }

        .tool-btn.active {
            border-color: var(--accent-color);
            background: #4a6fa5;
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(74, 111, 165, 0.4);
        }

        .float-text {
            position: absolute;
            color: #f1c40f;
            font-weight: 900;
            font-size: 1.5rem;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
            z-index: 20000;
            text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
            white-space: nowrap;
        }

        @keyframes floatUp {
            0% { transform: translateY(0) scale(1); opacity: 1; }
            100% { transform: translateY(-50px) scale(1.2); opacity: 0; }
        }
        
        .danger-text { color: #e74c3c !important; }
        .life-text { color: #2ecc71 !important; }
        .bonus-text { color: #9b59b6 !important; }
        .water-text { color: #3498db !important; }


        .income-text {
            font-size: 0.8rem;
            color: #2ecc71; /* Vert */
            margin-left: 5px;
            font-weight: normal;
        }

        .system-box {
            display: flex;
            gap: 5px;
            background: rgba(0,0,0,0.2);
            padding: 5px;
            border-radius: 10px;
        }

        .sys-btn {
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 1.2rem;
            padding: 0 5px;
            transition: transform 0.2s;
            color: white; /* Pour être sûr */
        }

        .sys-btn:hover {
            transform: scale(1.2);
        }

        .sys-btn:active {
            transform: scale(0.9);
        }

/* --- MODAL D'AIDE (POP-UP) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999; /* Au-dessus de tout */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2c3e50;
    width: 90%;
    max-width: 600px;
    height: 80%; /* Hauteur fixe relative pour permettre le scroll */
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 15px 20px;
    background: #34495e;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #f1c40f;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.close-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

/* Corps scrollable */
.modal-body {
    padding: 20px;
    overflow-y: auto; /* C'est ici que le scroll se fait */
    flex: 1;
}

/* --- CONTENU DE L'AIDE --- */
.help-section {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.help-card {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.help-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.help-icon { font-size: 1.5rem; margin-right: 10px; }
.help-title { font-weight: bold; color: #2ecc71; flex: 1; }
.help-cost { font-weight: bold; color: #f1c40f; font-size: 0.9rem; }

.help-stats {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    font-size: 0.85rem;
    color: #bdc3c7;
}

.help-stats li { margin-bottom: 4px; }
.help-stats strong { color: #ecf0f1; }

/* --- MENU DÉROULANT --- */
.dropdown-content {
    display: none; /* Caché par défaut */
    position: absolute;
    right: 0;
    top: 100%; /* Juste en dessous du bouton */
    background-color: #34495e;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    border-radius: 0 0 10px 10px;
    z-index: 5000; /* Très haut pour passer au-dessus de tout */
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Quand on ajoute la classe 'show', le menu s'affiche */
.dropdown-content.show {
    display: flex;
}

/* Style des boutons DANS le menu (plus larges) */
.dropdown-content .sys-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px; /* Espace entre icône et texte */
}

.dropdown-content .sys-btn:hover {
    background-color: rgba(255,255,255,0.1);
    transform: none; /* On désactive l'effet de zoom du header standard */
}

/* Ajustement pour le bouton principal du menu */
#menu-toggle-btn {
    font-size: 1.4rem;
    padding: 0 10px;
}