/* === TRÈS PETITS ÉCRANS (≤ 480 px — téléphones en portrait) === */

@media (max-width: 480px) {

    body {
        font-size: 15px;
    }

    .panel {
        padding: 1rem;
    }

    /* Titre de l'écran titre */
    h1 {
        font-size: 2.2rem;
    }

    /* Stats panel encore plus compact */
    #stats-panel {
        padding: 0.35rem 0.5rem;
        gap: 0;
    }

    .char-header {
        min-width: 100px;
        padding-right: 0.5rem;
        margin-right: 0.5rem;
    }

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

    .gold-badge {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .stats-grid {
        gap: 0.35rem;
    }

    .stat-item {
        min-width: 40px;
    }

    .stat-item:first-child {
        min-width: 75px;
    }

    /* Boutons de choix */
    .choice-btn {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    /* Modal combat plus serré */
    .combat-modal-content {
        padding: 0.7rem 0.6rem 0.8rem;
    }

    .combat-log {
        max-height: 72px;
        font-size: 0.74rem;
    }

    .btn-small {
        padding: 4px 6px;
        font-size: 0.74rem;
    }

    /* Dé : plus petit */
    .dice {
        width: 72px;
        height: 72px;
        font-size: 2rem;
    }

    /* Sélection de classe : une colonne sur très petit écran */
    .class-selection {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   VIEWPORT COURT — laptop 15" (≤ 820 px de hauteur)
   Compacte la modal de combat pour qu'elle tienne à l'écran
   ============================================================ */

@media (max-height: 820px) {

    /* Modal overlay : moins de padding vertical */
    .modal.active {
        padding: 0.5rem;
    }

    /* Combat : réduit les marges et espacements internes */
    .combat-modal-content {
        padding: 0.9rem 1.4rem 1rem;
    }

    .combat-enemy-area {
        padding-bottom: 0.5rem;
        margin-bottom: 0.45rem;
    }

    .combat-enemy-icon {
        font-size: 2rem;
        margin-bottom: 0.1rem;
    }

    .combat-enemy-area h3 {
        font-size: 1rem;
    }

    .combat-enemy-flavor {
        margin: 0.05rem 0 0.3rem;
    }

    .combat-player-status {
        margin-bottom: 0.35rem;
        padding: 0.3rem 0.6rem;
        gap: 0.2rem;
    }

    .combat-log {
        min-height: 70px;
        max-height: 110px;
        margin-bottom: 0.5rem;
    }

    .combat-action-tracker {
        margin-bottom: 0.3rem;
    }

    .combat-actions {
        gap: 0.25rem;
    }

    .combat-row-label {
        margin-bottom: -0.2rem;
    }

    .combat-bonus-row {
        padding-top: 0.25rem;
        min-height: 1.6rem;
    }

    /* Modal de dé : moins d'espace autour du dé */
    .dice-container {
        margin: 0.8rem 0;
    }

    .dice {
        width: 80px;
        height: 80px;
        font-size: 2.2rem;
    }
}

@media (max-height: 680px) {

    .combat-modal-content {
        padding: 0.6rem 1rem 0.7rem;
    }

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

    .combat-enemy-flavor {
        display: none;
    }

    .combat-log {
        min-height: 50px;
        max-height: 75px;
        font-size: 0.8rem;
    }

    .combat-conditions-row {
        margin-bottom: 0.2rem;
    }

    .combat-actions {
        gap: 0.18rem;
    }

    .dice-container {
        margin: 0.5rem 0;
    }

    .dice {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }
}
