/* === RESPONSIVE === */
@media (max-width: 768px) {

    /* === BASE === */

    body {
        font-size: 16px;
    }

    /* === ÉCRANS — laisse le scroll vertical se faire dans .screen.active === */

    .game-layout {
        flex-direction: column;
        height: auto;
        min-height: 100%;
        overflow: visible;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    /* === STATS PANEL — barre compacte à défilement horizontal === */

    #stats-panel {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: none;
        overflow-y: hidden;
        overflow-x: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        padding: 0.5rem 0.75rem;
    }

    /* Entête nom/classe/or : bloc gauche fixe */
    .char-header {
        width: auto;
        min-width: 120px;
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid rgba(201, 168, 76, 0.2);
        padding-bottom: 0;
        padding-right: 0.75rem;
        margin-right: 0.75rem;
        align-items: flex-start;
    }

    .char-header h3 {
        font-size: 0.95rem;
    }

    /* Grille de stats : rangée horizontale à défilement */
    .stats-grid {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        align-items: center;
        flex-shrink: 0;
    }

    /* Chaque stat : bloc vertical compact */
    .stat-item {
        width: auto;
        min-width: 46px;
        flex-shrink: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2px 4px;
        gap: 0;
    }

    /* La barre PV prend un peu plus de place */
    .stat-item:first-child {
        min-width: 90px;
    }

    .hp-bar-container {
        max-width: 80px;
        height: 16px;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-mod {
        font-size: 0.7rem;
        min-width: auto;
    }

    .stat-value-group {
        flex-direction: column;
        align-items: center;
        gap: 0;
        line-height: 1.1;
    }

    /* Masquer les sections secondaires du panel */
    .inventory,
    .quest-log,
    .ability-panel {
        display: none;
    }

    /* === ZONE NARRATIVE — défilement naturel === */

    .narrative-area {
        min-height: 0;
        overflow: visible;
    }

    .narrative-panel {
        overflow: visible;
        flex: none;
    }

    /* === BOUTONS DE CHOIX — cibles tactiles confortables (≥ 48 px) === */

    .choice-btn {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 1rem;
    }

    /* === MODAL GÉNÉRAL === */

    .modal-content {
        padding: 1.5rem 1.2rem;
        width: 95%;
        max-width: none;
    }

    /* === MODAL DE COMBAT === */

    .combat-modal-content {
        width: 96%;
        max-width: none;
        padding: 0.9rem 0.75rem 1rem;
    }

    .combat-enemy-icon {
        font-size: 1.8rem;
    }

    .combat-log {
        max-height: 90px;
        font-size: 0.78rem;
    }

    .combat-actions {
        gap: 0.3rem;
    }

    .combat-action-row {
        gap: 0.3rem;
    }

    .combat-bonus-row {
        gap: 0.3rem;
        padding-top: 0.3rem;
    }

    /* === BOUTONS PETITS === */

    .btn-small {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    /* === HUD ACTIONS (bas de l'écran de jeu) === */

    .hud-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-top: 0.6rem;
    }

    /* === SÉLECTION DE CLASSE === */

    .class-selection {
        grid-template-columns: 1fr 1fr;
    }
}

