/* =========================================================
   ECHOES OF THE ABYSS
   HUB DE DÉBUT DE RUN
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {

    --bg-main: #05060a;
    --bg-dark: #080910;

    --text-main: #eee7dc;
    --text-soft: #aaa5a0;
    --text-muted: #706d6a;

    --gold: #c7a76a;
    --gold-light: #ead09a;

    --violet: #8c55ff;
    --violet-light: #c39cff;

    --border-dark: rgba(255, 255, 255, 0.12);

    --panel-bg: rgba(9, 10, 16, 0.88);

    --transition-fast: 0.18s ease;
    --transition-normal: 0.3s ease;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {

    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(92, 46, 151, 0.18),
            transparent 40%
        ),
        radial-gradient(
            circle at 20% 70%,
            rgba(100, 45, 20, 0.10),
            transparent 35%
        ),
        #030407;

    color: var(--text-main);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    overflow-x: hidden;
}


/* =========================================================
   GAME ROOT
   ========================================================= */

#game {

    width: 100%;
    min-height: 100vh;

    position: relative;
}


/* =========================================================
   BARRE DE STATUT DE RUN (PV / Mana / Or)
   ========================================================= */
/*
   Affichée sur les écrans hors combat (carte, marchand, feu
   de camp, événement, pierre de rituel) — voir
   showRunStatusBar()/hideRunStatusBar() dans Game.js.
*/

.run-status-bar {

    /*
       Élément normal dans le flux (pas de position: fixed) :
       quand il est visible, il pousse simplement le contenu
       de l'écran actif en dessous de lui, sans jamais le
       recouvrir.
    */

    width: 100%;

    box-sizing: border-box;

    /* CORRECTIF — BUILD/STATS INCLIQUABLES SUR L'ÉCRAN DE
       RÉCOMPENSE (ET TOUT AUTRE ÉCRAN PLEIN ÉCRAN)
       ==================================================
       z-index n'a AUCUN effet sur un élément position:static
       (valeur par défaut) : cette barre restait donc peinte
       EN DESSOUS de #rewards-screen/#shop-screen/etc (tous
       position:fixed, donc peints au-dessus de tout contenu
       non positionné quel que soit son z-index déclaré) —
       visuellement visible à travers leur fond translucide,
       mais tous les clics sur "Build"/"Stats" étaient
       interceptés par l'écran plein écran par-dessus, jamais
       reçus par les boutons. position: relative active enfin
       le z-index déjà déclaré ci-dessous, sans sortir la barre
       du flux normal (elle continue de pousser le contenu en
       dessous d'elle, comme prévu). */
    position: relative;

    z-index: 500;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 18px;

    /* CORRECTIF — 3e bouton (Codex) poussé hors de l'écran
       sur mobile : cette barre n'avait jamais de flex-wrap,
       contrairement à .combat-topbar-right qui gère déjà ce
       même cas (3 boutons + reste des infos). Passe à la
       ligne au lieu de déborder hors du viewport. */
    flex-wrap: wrap;

    row-gap: 6px;

    padding: 8px 14px;

    background:
        rgba(10, 8, 16, 0.92);

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08);

    backdrop-filter:
        blur(6px);

    font-size: 12px;

    font-weight: 700;

    color:
        rgba(255, 255, 255, 0.88);
}


.run-status-item {

    display: flex;

    align-items: center;

    gap: 5px;

    white-space: nowrap;
}


.run-status-hp {
    color: rgba(255, 110, 110, 0.95);
}


.run-status-mana {
    color: rgba(110, 170, 255, 0.95);
}


.run-status-gold {
    color: rgba(255, 200, 90, 0.95);
}


.run-status-biome {
    color: rgba(120, 200, 190, 0.95);
}


.run-status-icon {
    font-size: 13px;
}


/* =========================================================
   BOUTON "MON BUILD" DE LA BARRE DE STATUT
   =========================================================
   Seul élément CLIQUABLE de la barre (un <button>, contrairement
   aux <div> PV/Mana/Or) : réinitialise le chrome par défaut du
   navigateur pour ne garder que ce que .run-status-item impose
   déjà, et ajoute une légère pastille pour signaler l'interaction.
   ========================================================= */

.run-status-build-button {

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.05);

    padding: 3px 10px 3px 8px;

    color: var(--text-soft);

    font: inherit;

    cursor: pointer;

    transition: background var(--transition-fast);
}

.run-status-build-button:hover {

    background: rgba(255, 255, 255, 0.11);
}


@media (max-width: 480px) {

    .run-status-bar {

        gap: 10px;

        padding: 6px 8px;

        font-size: 10px;
    }

}


/* =========================================================
   UTILITAIRE
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   HUB
   ========================================================= */

#hub-screen {

    min-height: 100vh;

    position: relative;

    display: flex;
    flex-direction: column;

    padding:
        26px
        34px
        28px;

    overflow: hidden;

    background:

        radial-gradient(
            ellipse at 50% 18%,
            rgba(86, 47, 144, 0.18),
            transparent 38%
        ),

        radial-gradient(
            ellipse at 10% 55%,
            rgba(130, 58, 25, 0.10),
            transparent 30%
        ),

        linear-gradient(
            180deg,
            rgba(5, 6, 10, 0.45),
            rgba(3, 4, 7, 0.95)
        );
}


/* =========================================================
   ATMOSPHÈRE
   ========================================================= */

#hub-screen::before {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:

        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.45),
            transparent 22%,
            transparent 78%,
            rgba(0, 0, 0, 0.5)
        );

    z-index: 0;
}


#hub-screen::after {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:

        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.012) 0px,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: 0.22;

    z-index: 0;
}


.hub-background-glow {

    position: absolute;

    width: 700px;
    height: 700px;

    left: 50%;
    top: 38%;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(105, 56, 190, 0.12),
            transparent 68%
        );

    filter: blur(25px);

    pointer-events: none;

    z-index: 0;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.hub-topbar {

    width: 100%;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    position: relative;

    z-index: 5;
}


/* =========================================================
   LOGO
   ========================================================= */

.brand-block {

    display: flex;

    align-items: center;

    gap: 13px;
}


.brand-mark {

    width: 36px;
    height: 36px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--violet-light);

    font-size: 27px;

    text-shadow:
        0 0 12px rgba(150, 90, 255, 0.7);

    transform: rotate(45deg);
}


.game-title {

    font-size: clamp(22px, 2.2vw, 32px);

    letter-spacing: 5px;

    line-height: 0.9;

    font-weight: 400;

    color: #e5dfd5;

    text-shadow:
        0 2px 10px rgba(0,0,0,0.8);
}


.game-subtitle {

    margin-top: 6px;

    font-size: 11px;

    letter-spacing: 6px;

    color: #88827c;
}


/* =========================================================
   ÂMES
   ========================================================= */

.souls-counter {

    min-width: 190px;

    padding:
        12px
        17px;

    display: flex;

    align-items: center;

    gap: 12px;

    background:

        linear-gradient(
            135deg,
            rgba(21, 16, 37, 0.96),
            rgba(8, 9, 15, 0.96)
        );

    border: 1px solid rgba(145, 94, 255, 0.35);

    box-shadow:

        inset 0 0 20px rgba(104, 51, 190, 0.08),

        0 0 25px rgba(50, 25, 90, 0.18);
}


.souls-icon {

    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 25px;

    color: #9c63ff;

    text-shadow:
        0 0 12px #8b4cff,
        0 0 30px rgba(135, 65, 255, 0.7);

    animation:
        soulsPulse 3s ease-in-out infinite;
}


@keyframes soulsPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}


.souls-label {

    display: block;

    font-size: 11px;

    letter-spacing: 1px;

    text-transform: uppercase;

    color: #8c8782;

    margin-bottom: 2px;
}


#souls-counter {

    display: block;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 26px;

    font-weight: 400;

    letter-spacing: 2px;

    color: #eee8ff;
}


/* =========================================================
   BOUTON CODEX DU HUB
   =========================================================
   AJOUT — regroupe le compteur d'âmes et le nouveau bouton Codex à
   droite de la barre du hub, pour garder .hub-topbar en layout à
   deux blocs (space-between) malgré ce 3e élément.
   ========================================================= */

.hub-topbar-right {

    display: flex;

    align-items: center;

    gap: 12px;
}


.hub-codex-button {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 12px 17px;

    background:

        linear-gradient(
            135deg,
            rgba(21, 16, 37, 0.96),
            rgba(8, 9, 15, 0.96)
        );

    border: 1px solid rgba(145, 94, 255, 0.35);

    border-radius: 10px;

    color: #e5dfd5;

    font-size: 13px;

    letter-spacing: 0.5px;

    cursor: pointer;

    box-shadow:

        inset 0 0 20px rgba(104, 51, 190, 0.08),

        0 0 25px rgba(50, 25, 90, 0.18);
}


.hub-codex-button:hover {

    border-color: rgba(145, 94, 255, 0.6);
}


.hub-codex-button-icon {

    font-size: 18px;
}


/* =========================================================
   TITRE DU HUB
   ========================================================= */

.hub-heading-block {

    width: 100%;

    max-width: 1100px;

    margin:
        26px
        auto
        20px;

    text-align: center;

    position: relative;

    z-index: 2;
}


.heading-decoration {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 14px;

    margin-bottom: 8px;
}


.heading-line {

    width: min(180px, 18vw);

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(196, 161, 101, 0.7)
        );
}


.heading-line:last-child {

    background:
        linear-gradient(
            90deg,
            rgba(196, 161, 101, 0.7),
            transparent
        );
}


.heading-diamond {

    color: var(--gold);

    font-size: 11px;

    transform: rotate(45deg);

    text-shadow:
        0 0 8px rgba(220, 180, 100, 0.4);
}


.hub-heading {

    font-size: clamp(34px, 4vw, 58px);

    font-weight: 400;

    letter-spacing: 6px;

    text-transform: uppercase;

    color: #e8ddc9;

    text-shadow:
        0 4px 20px rgba(0,0,0,0.9);
}


.hub-subtitle {

    margin-top: 8px;

    font-size: 13px;

    letter-spacing: 7px;

    text-transform: uppercase;

    color: #77716b;
}


/* =========================================================
   CARTES DES VOIES
   ========================================================= */

.path-cards {

    width: 100%;

    max-width: 1450px;

    margin:
        0
        auto;

    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 12px;

    flex: 1;

    position: relative;

    z-index: 2;
}


/* =========================================================
   CARTE
   ========================================================= */

.path-card {

    --path-color: #8c55ff;

    position: relative;

    min-height: 380px;

    padding:
        23px
        15px
        18px;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    cursor: pointer;

    user-select: none;

    background:

        linear-gradient(
            180deg,
            rgba(16, 17, 23, 0.96),
            rgba(6, 7, 11, 0.98)
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--path-color) 38%,
            transparent
        );

    box-shadow:

        inset 0 0 35px
        color-mix(
            in srgb,
            var(--path-color) 6%,
            transparent
        ),

        0 12px 25px rgba(0,0,0,0.35);

    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        background var(--transition-normal);

    overflow: hidden;
}


/* coins décoratifs */

.path-card::before,
.path-card::after {

    content: "";

    position: absolute;

    width: 22px;
    height: 22px;

    border-color:
        color-mix(
            in srgb,
            var(--path-color) 65%,
            transparent
        );

    pointer-events: none;
}


.path-card::before {

    top: 7px;
    left: 7px;

    border-top: 1px solid;
    border-left: 1px solid;
}


.path-card::after {

    right: 7px;
    bottom: 7px;

    border-right: 1px solid;
    border-bottom: 1px solid;
}


/* =========================================================
   HOVER
   ========================================================= */

.path-card:hover {

    transform:
        translateY(-8px);

    border-color:
        color-mix(
            in srgb,
            var(--path-color) 78%,
            transparent
        );

    background:

        linear-gradient(
            180deg,
            color-mix(
                in srgb,
                var(--path-color) 9%,
                #101117
            ),
            rgba(6,7,11,0.98)
        );

    box-shadow:

        inset 0 0 45px
        color-mix(
            in srgb,
            var(--path-color) 10%,
            transparent
        ),

        0 16px 35px rgba(0,0,0,0.55),

        0 0 22px
        color-mix(
            in srgb,
            var(--path-color) 16%,
            transparent
        );
}


/* =========================================================
   CARTE SÉLECTIONNÉE
   ========================================================= */

.path-card.selected {

    transform:
        translateY(-10px);

    border-color:
        color-mix(
            in srgb,
            var(--path-color) 100%,
            white 15%
        );

    box-shadow:

        inset 0 0 55px
        color-mix(
            in srgb,
            var(--path-color) 15%,
            transparent
        ),

        0 18px 40px rgba(0,0,0,0.6),

        0 0 35px
        color-mix(
            in srgb,
            var(--path-color) 30%,
            transparent
        );
}


.path-card.selected::before,
.path-card.selected::after {

    width: 30px;
    height: 30px;

    border-color:
        var(--path-color);
}


/* =========================================================
   CONTENU DE LA CARTE
   =========================================================
   CORRECTIF — .path-card-icon / -content / -name /
   -description / -gift N'AVAIENT AUCUN STYLE
   =========================================================
   La carte (.path-card) a toujours été bien habillée (bordure
   et lueur teintées par voie, coins décoratifs, hover), mais
   tout son CONTENU reposait uniquement sur les styles de
   bouton par défaut du navigateur : l'icône n'était qu'un
   caractère brut sans badge, le nom et la description
   n'avaient aucune hiérarchie typographique, et surtout, la
   moitié inférieure de la carte (min-height: 380px, largement
   plus haute que son contenu) restait un vide total.
   ========================================================= */

.path-card-watermark {

    position: absolute;

    top: 50%;
    left: 50%;

    transform:
        translate(-50%, -50%);

    font-size: 130px;

    line-height: 1;

    opacity: 0.06;

    filter:
        grayscale(0.2);

    pointer-events: none;

    z-index: 0;
}


.path-card-icon {

    position: relative;
    z-index: 1;

    width: 52px;
    height: 52px;

    margin-bottom: 14px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 24px;

    background:
        color-mix(
            in srgb,
            var(--path-color) 14%,
            transparent
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--path-color) 45%,
            transparent
        );

    box-shadow:
        0 0 18px
        color-mix(
            in srgb,
            var(--path-color) 20%,
            transparent
        );
}


.path-card-content {

    position: relative;
    z-index: 1;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 10px;
}


.path-card-name {

    font-size: 19px;

    font-weight: 700;

    letter-spacing:
        0.03em;

    color:
        var(--text-main);
}


.path-card-description {

    font-size: 12px;

    line-height: 1.55;

    color:
        var(--text-soft);
}


.path-card-gift {

    margin-top: 6px;

    padding:
        6px
        12px;

    border-radius: 999px;

    font-size: 10px;

    letter-spacing:
        0.04em;

    color:
        color-mix(
            in srgb,
            var(--path-color) 80%,
            white 20%
        );

    background:
        color-mix(
            in srgb,
            var(--path-color) 12%,
            transparent
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--path-color) 30%,
            transparent
        );
}


/* =========================================================
   DESCRIPTION CHIFFRÉE DU DON DE DÉPART
   =========================================================
   La pastille .path-card-gift ci-dessus ne montre que le NOM
   du don ("Don : Toucher venimeux") : aucun chiffre, alors
   que path.gift.description les contient déjà ("Vos attaques
   appliquent 2 Poison. 10 % des dégâts de Poison infligés
   vous soignent."). Sans ce bloc, le joueur choisissait une
   voie sans savoir ce que son don de départ fait réellement.
   ========================================================= */

.path-card-gift-description {

    margin-top: 6px;

    font-size: 11px;

    line-height: 1.5;

    color:
        var(--text-soft);
}


/* =========================================================
   ICÔNE
   ========================================================= */

.path-icon-wrapper {

    width: 92px;
    height: 92px;

    margin-bottom: 15px;

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--path-color) 55%,
            transparent
        );

    box-shadow:
        inset 0 0 22px
        color-mix(
            in srgb,
            var(--path-color) 12%,
            transparent
        );
}


.path-icon-wrapper::before {

    content: "";

    position: absolute;

    inset: 7px;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--path-color) 28%,
            transparent
        );

    border-radius: 50%;
}


.path-icon {

    position: relative;

    z-index: 1;

    font-size: 47px;

    line-height: 1;

    filter:
        drop-shadow(
            0 0 10px
            color-mix(
                in srgb,
                var(--path-color) 75%,
                transparent
            )
        );
}


/* =========================================================
   NOM
   ========================================================= */

.path-name {

    font-size: 21px;

    font-weight: 400;

    letter-spacing: 2px;

    text-transform: uppercase;

    color: var(--path-color);

    margin-bottom: 10px;

    text-shadow:
        0 0 12px
        color-mix(
            in srgb,
            var(--path-color) 30%,
            transparent
        );
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.path-description {

    min-height: 58px;

    max-width: 190px;

    color: #c0bbb5;

    font-size: 13px;

    line-height: 1.55;

    margin-bottom: auto;
}


/* =========================================================
   SÉPARATEUR
   ========================================================= */

.path-divider {

    width: 65%;

    height: 1px;

    margin:
        16px
        auto
        12px;

    background:
        linear-gradient(
            90deg,
            transparent,
            color-mix(
                in srgb,
                var(--path-color) 75%,
                transparent
            ),
            transparent
        );

    position: relative;
}


.path-divider::after {

    content: "◆";

    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);

    font-size: 8px;

    color: var(--path-color);

    background: #090a0e;

    padding: 0 5px;
}


/* =========================================================
   DON DE VOIE
   ========================================================= */

.path-gift-name {

    font-size: 13px;

    text-transform: uppercase;

    letter-spacing: 1.5px;

    color: #ddd4c5;

    margin-bottom: 5px;
}


.path-gift-description {

    min-height: 42px;

    font-size: 11px;

    line-height: 1.4;

    color: #85807b;

}


/* =========================================================
   INDICATEUR SÉLECTION
   ========================================================= */

.path-selected-label {

    margin-top: 11px;

    min-height: 16px;

    font-size: 10px;

    letter-spacing: 2px;

    text-transform: uppercase;

    color: var(--path-color);

    opacity: 0;

    transition:
        opacity var(--transition-fast);
}


.path-card.selected
.path-selected-label {

    opacity: 1;
}


/* =========================================================
   ZONE ACTION
   ========================================================= */

.hub-action-area {

    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    position: relative;

    z-index: 3;

    margin-top: 17px;
}


.selected-path-info {

    min-height: 17px;

    margin-bottom: 8px;

    font-size: 12px;

    letter-spacing: 1.5px;

    color: #918b83;

    text-align: center;
}


/* =========================================================
   BOUTON COMMENCER
   ========================================================= */

.start-run-button {

    width: min(470px, 90vw);

    min-height: 62px;

    padding:
        10px
        25px;

    position: relative;

    cursor: pointer;

    border:
        1px solid
        rgba(153, 108, 255, 0.55);

    background:

        linear-gradient(
            180deg,
            rgba(36, 23, 61, 0.95),
            rgba(12, 9, 20, 0.98)
        );

    color: #eee5ff;

    box-shadow:

        inset 0 0 25px rgba(115, 57, 200, 0.14),

        0 8px 25px rgba(0,0,0,0.45);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
}


.start-run-button:not(:disabled):hover {

    transform:
        translateY(-3px);

    border-color:
        rgba(184, 144, 255, 0.95);

    box-shadow:

        inset 0 0 35px rgba(115, 57, 200, 0.2),

        0 10px 35px rgba(0,0,0,0.55),

        0 0 25px rgba(127, 67, 220, 0.22);
}


.start-run-button:not(:disabled):active {

    transform:
        translateY(0);
}


.start-run-button:disabled {

    cursor: not-allowed;

    opacity: 0.35;
}


.start-run-main {

    display: block;

    font-size: 20px;

    letter-spacing: 2px;

    text-transform: uppercase;
}


.start-run-sub {

    display: block;

    margin-top: 3px;

    font-size: 10px;

    letter-spacing: 3px;

    text-transform: uppercase;

    color: #77707f;
}


/* =========================================================
   CITATION / PHRASE
   ========================================================= */

.hub-quote {

    margin-top: 8px;

    font-size: 10px;

    letter-spacing: 4px;

    text-transform: uppercase;

    color: #66615d;
}


/* =========================================================
   FOOTER
   ========================================================= */

.hub-footer {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-top: 12px;

    position: relative;

    z-index: 4;
}


.footer-button {

    padding:
        9px
        14px;

    background:
        rgba(7, 8, 12, 0.85);

    border:
        1px solid
        rgba(255,255,255,0.12);

    color: #8d8882;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 11px;

    cursor: pointer;

    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}


.footer-button:hover {

    color: #d5cec4;

    border-color:
        rgba(205, 170, 110, 0.4);

    background:
        rgba(20, 18, 22, 0.9);
}


/* =========================================================
   ÉCRAN DE RUN
   ========================================================= */

#run-screen {

    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background:

        radial-gradient(
            circle at center,
            rgba(81, 43, 142, 0.2),
            transparent 50%
        ),

        #04050a;
}


.run-panel {

    width: min(700px, 92vw);

    padding: 50px;

    text-align: center;

    background:
        rgba(9, 10, 16, 0.95);

    border:
        1px solid
        rgba(143, 91, 255, 0.45);

    box-shadow:
        0 0 50px rgba(70, 35, 120, 0.18);
}


.run-panel .eyebrow {

    color: var(--violet-light);

    font-size: 11px;

    letter-spacing: 4px;

    margin-bottom: 15px;
}


.run-panel h2 {

    font-size: 36px;

    font-weight: 400;

    color: #e7dece;

    margin-bottom: 20px;
}


.run-panel p {

    color: #a29c95;

    line-height: 1.6;

    margin-bottom: 15px;
}


.run-divider {

    width: 70%;

    height: 1px;

    margin: 25px auto;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(190,150,90,0.6),
            transparent
        );
}


.run-next-note {

    font-size: 12px;

    color: #77716c !important;
}


#back-to-hub-button {

    margin-top: 20px;

    padding:
        12px
        30px;

    border:
        1px solid
        rgba(143,91,255,0.5);

    background:
        rgba(20,14,30,0.9);

    color: #d7c9ef;

    cursor: pointer;

    font-family:
        Georgia,
        serif;
}


/* =========================================================
   RESPONSIVE — TABLETTE
   ========================================================= */

@media (max-width: 1200px) {

    #hub-screen {

        padding:
            20px
            22px
            22px;
    }


    .path-cards {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 12px;

        max-width: 900px;
    }


    .path-card {

        min-height: 350px;
    }


    .hub-heading-block {

        margin-top: 20px;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 700px) {

    #hub-screen {

        padding:
            16px
            14px
            18px;

        overflow-y: auto;
    }


    .hub-topbar {

        align-items: center;

        gap: 15px;
    }


    .game-title {

        font-size: 19px;

        letter-spacing: 3px;
    }


    .game-subtitle {

        font-size: 8px;

        letter-spacing: 4px;
    }


    .brand-mark {

        font-size: 20px;

        width: 25px;
        height: 25px;
    }


    .souls-counter {

        min-width: auto;

        padding:
            8px
            10px;
    }


    .hub-topbar-right {

        gap: 8px;
    }


    .hub-codex-button {

        padding: 8px 10px;

        font-size: 11px;
    }


    .hub-codex-button-icon {

        font-size: 15px;
    }


    .souls-icon {

        width: 28px;
        height: 28px;

        font-size: 18px;
    }


    .souls-label {

        font-size: 8px;
    }


    #souls-counter {

        font-size: 20px;
    }


    .hub-heading-block {

        margin:
            22px
            auto
            17px;
    }


    .hub-heading {

        font-size: 29px;

        letter-spacing: 3px;
    }


    .hub-subtitle {

        font-size: 9px;

        letter-spacing: 4px;
    }


    .path-cards {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 9px;
    }


    .path-card {

        min-height: 310px;

        padding:
            17px
            10px
            12px;
    }


    .path-icon-wrapper {

        width: 66px;
        height: 66px;

        margin-bottom: 10px;
    }


    .path-icon {

        font-size: 34px;
    }


    .path-name {

        font-size: 16px;

        letter-spacing: 1px;
    }


    .path-description {

        min-height: 68px;

        font-size: 11px;

        line-height: 1.4;
    }


    .path-gift-name {

        font-size: 10px;
    }


    .path-gift-description {

        font-size: 9px;
    }


    .start-run-button {

        min-height: 55px;
    }


    .start-run-main {

        font-size: 16px;
    }


    .start-run-sub {

        font-size: 8px;

        letter-spacing: 2px;
    }


    .hub-quote {

        font-size: 7px;

        letter-spacing: 2px;
    }


    .footer-button {

        font-size: 9px;

        padding:
            8px
            10px;
    }
}


/*
=========================================================
   PETITS ÉCRANS
   ========================================================= */

@media (max-width: 420px) {

    .path-cards {

        grid-template-columns:
            1fr;
    }


    .path-card {

        min-height: 270px;
    }


    .path-description {

        min-height: auto;

        margin-bottom: 10px;
    }


    .path-gift-description {

        min-height: auto;
    }


    .path-selected-label {

        display: none;
    }
}


/* =========================================================
   ACCESSIBILITÉ
   ========================================================= */

button:focus-visible,
.path-card:focus-visible {

    outline:
        2px solid
        rgba(193, 150, 255, 0.9);

    outline-offset: 3px;
}


/* =========================================================
   RÉDUCTION DES ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   CARTE DE RUN
   ========================================================= */

#map-screen {

    min-height: 100vh;

    position: relative;

    display: flex;
    flex-direction: column;

    padding:
        22px
        18px
        28px;

    overflow-x: hidden;

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(86, 47, 144, 0.20),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(95, 50, 25, 0.12),
            transparent 35%
        ),

        linear-gradient(
            180deg,
            #05060a 0%,
            #08070d 50%,
            #030407 100%
        );

}


/* =========================================================
   ATMOSPHÈRE DE LA CARTE
   ========================================================= */

#map-screen::before {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(111, 61, 185, 0.08),
            transparent 45%
        );

    z-index: 0;

}


#map-screen::after {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:

        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.012) 0px,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: 0.20;

    z-index: 0;

}


/* =========================================================
   AMBIANCE PAR BIOME (CARTE)
   =========================================================
   #game[data-biome] posé par applyBiomeTheme() (Game.js) à
   chaque rendu de la carte/du combat. Sans biome actif (hub,
   marchand, etc.), le dégradé violet/brun par défaut ci-dessus
   reste inchangé.
   ========================================================= */

#game[data-biome="forest"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(50, 140, 80, 0.22),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(25, 90, 50, 0.16),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(6, 10, 7, 0.62) 0%,
            rgba(8, 13, 9, 0.62) 50%,
            rgba(3, 5, 3, 0.62) 100%
        ),

        url('Assets/Backgrounds/forest.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="forest"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(60, 170, 90, 0.09),
            transparent 45%
        );

}


#game[data-biome="volcano"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(210, 80, 30, 0.24),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 75%,
            rgba(255, 130, 40, 0.14),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(10, 7, 5, 0.62) 0%,
            rgba(13, 8, 6, 0.62) 50%,
            rgba(5, 3, 2, 0.62) 100%
        ),

        url('Assets/Backgrounds/volcano.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="volcano"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(255, 110, 40, 0.10),
            transparent 45%
        );

}


#game[data-biome="graveyard"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(95, 60, 145, 0.22),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(55, 120, 100, 0.13),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(7, 6, 10, 0.62) 0%,
            rgba(8, 7, 12, 0.62) 50%,
            rgba(3, 3, 4, 0.62) 100%
        ),

        url('Assets/Backgrounds/graveyard.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="graveyard"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(110, 160, 140, 0.08),
            transparent 45%
        );

}


#game[data-biome="toundra"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(120, 190, 230, 0.20),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(180, 220, 240, 0.10),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(6, 10, 16, 0.62) 0%,
            rgba(7, 12, 18, 0.62) 50%,
            rgba(3, 5, 10, 0.62) 100%
        ),

        url('Assets/Backgrounds/toundra.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="toundra"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(190, 225, 245, 0.09),
            transparent 45%
        );

}


#game[data-biome="dragonCave"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(200, 140, 60, 0.20),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(150, 90, 40, 0.12),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(12, 8, 5, 0.62) 0%,
            rgba(10, 7, 4, 0.62) 50%,
            rgba(5, 3, 2, 0.62) 100%
        ),

        url('Assets/Backgrounds/dragonCave.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="dragonCave"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(220, 165, 90, 0.09),
            transparent 45%
        );

}


#game[data-biome="skyCastle"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(200, 180, 255, 0.20),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(255, 215, 140, 0.10),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(10, 10, 20, 0.62) 0%,
            rgba(10, 9, 18, 0.62) 50%,
            rgba(5, 4, 8, 0.62) 100%
        ),

        url('Assets/Backgrounds/skyCastle.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="skyCastle"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(220, 200, 255, 0.10),
            transparent 45%
        );

}


#game[data-biome="vampireCrypt"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 20%,
            rgba(160, 20, 35, 0.22),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 15% 70%,
            rgba(90, 10, 25, 0.14),
            transparent 38%
        ),

        linear-gradient(
            180deg,
            rgba(10, 5, 5, 0.62) 0%,
            rgba(9, 4, 4, 0.62) 50%,
            rgba(3, 1, 1, 0.62) 100%
        ),

        url('Assets/Backgrounds/vampireCrypt.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="vampireCrypt"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(200, 40, 55, 0.09),
            transparent 45%
        );

}


#game[data-biome="samuraiLand"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 15%,
            rgba(194, 59, 59, 0.20),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 80% 75%,
            rgba(202, 161, 90, 0.10),
            transparent 40%
        ),

        linear-gradient(
            180deg,
            rgba(16, 10, 18, 0.62) 0%,
            rgba(11, 7, 12, 0.62) 50%,
            rgba(6, 4, 6, 0.62) 100%
        ),

        url('Assets/Backgrounds/samuraiLand.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="samuraiLand"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(217, 138, 158, 0.08),
            transparent 45%
        );

}


#game[data-biome="factory"] #map-screen {

    background:

        radial-gradient(
            ellipse at 50% 15%,
            rgba(219, 154, 45, 0.16),
            transparent 42%
        ),

        radial-gradient(
            ellipse at 20% 75%,
            rgba(90, 110, 120, 0.14),
            transparent 40%
        ),

        linear-gradient(
            180deg,
            rgba(12, 15, 16, 0.62) 0%,
            rgba(8, 9, 10, 0.62) 50%,
            rgba(5, 6, 6, 0.62) 100%
        ),

        url('Assets/Backgrounds/factory.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="factory"] #map-screen::before {

    background:

        radial-gradient(
            circle at 50% 48%,
            rgba(219, 154, 45, 0.07),
            transparent 45%
        );

}


/* =========================================================
   TOPBAR
   ========================================================= */

.map-topbar {

    position: relative;

    z-index: 2;

    width: 100%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding:
        5px
        2px
        18px;

    border-bottom:
        1px solid
        rgba(199, 167, 106, 0.18);

}


/* =========================================================
   MARQUE
   ========================================================= */

.map-brand {

    display: flex;

    align-items: center;

    gap: 10px;

}


.map-brand-icon {

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--violet-light);

    font-size: 20px;

    text-shadow:
        0 0 12px
        rgba(140, 85, 255, 0.8);

}


.map-brand-title {

    font-size: 11px;

    letter-spacing:
        0.20em;

    color:
        var(--text-main);

}


.map-brand-run {

    margin-top: 4px;

    font-size: 8px;

    letter-spacing:
        0.28em;

    color:
        var(--text-muted);

}


/* =========================================================
   ÂMES
   ========================================================= */

.map-souls {

    display: flex;

    align-items: center;

    gap: 7px;

    padding:
        7px
        11px;

    border:
        1px solid
        rgba(140, 85, 255, 0.40);

    background:
        rgba(12, 8, 22, 0.75);

}


.map-souls-icon {

    color:
        var(--violet-light);

    font-size: 16px;

}


.map-souls-value {

    color:
        var(--text-main);

    font-size: 16px;

    font-weight: bold;

}


/* =========================================================
   TITRE BIOME
   ========================================================= */

.map-heading {

    position: relative;

    z-index: 2;

    text-align: center;

    padding:
        28px
        10px
        22px;

}


.map-eyebrow {

    margin-bottom: 7px;

    color:
        var(--violet-light);

    font-size: 9px;

    letter-spacing:
        0.42em;

}


.map-biome-name {

    color:
        var(--text-main);

    font-size: 36px;

    font-weight: normal;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;

    text-shadow:
        0 0 25px
        rgba(140, 85, 255, 0.25);

}


.map-biome-description {

    max-width: 400px;

    margin:
        8px
        auto
        15px;

    color:
        var(--text-soft);

    font-size: 14px;

    line-height: 1.5;

}


.map-progress {

    display: inline-block;

    padding:
        6px
        15px;

    border-top:
        1px solid
        rgba(199, 167, 106, 0.30);

    border-bottom:
        1px solid
        rgba(199, 167, 106, 0.30);

    color:
        var(--gold-light);

    font-size: 10px;

    letter-spacing:
        0.22em;

    text-transform:
        uppercase;

}


/* =========================================================
   CONTENEUR DE LA CARTE
   ========================================================= */

.map-content {

    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 620px;

    margin:
        0
        auto;

    padding:
        4px
        4px
        20px;

}


/* =========================================================
   ÉTAGE
   ========================================================= */

.map-floor {

    position: relative;

    width: 100%;

    padding:
        12px
        0
        28px;

}


.map-floor:not(:last-child)::after {

    content: "";

    position: absolute;

    left: 50%;

    bottom: 0;

    width: 1px;

    height: 28px;

    transform:
        translateX(-50%);

    background:
        linear-gradient(
            180deg,
            rgba(140, 85, 255, 0.45),
            rgba(140, 85, 255, 0.03)
        );

}


/* =========================================================
   NUMÉRO D'ÉTAGE
   ========================================================= */

.map-floor-label {

    text-align: center;

    margin-bottom: 11px;

    color:
        var(--text-muted);

    font-size: 9px;

    letter-spacing:
        0.28em;

    text-transform:
        uppercase;

}


.map-floor.current
.map-floor-label {

    color:
        var(--gold-light);

}


/* =========================================================
   CHOIX DE SALLES
   ========================================================= */

.map-room-row {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 8px;

}


/* =========================================================
   SALLE
   ========================================================= */

.map-room {

    position: relative;

    min-height: 104px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 7px;

    padding:
        12px
        5px;

    border:
        1px solid
        rgba(255,255,255,0.10);

    background:
        rgba(10, 10, 16, 0.90);

    color:
        var(--text-soft);

    cursor: pointer;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);

}


/* =========================================================
   ICÔNE SALLE
   ========================================================= */

.map-room-icon {

    width: 43px;
    height: 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        currentColor;

    border-radius: 50%;

    font-size: 20px;

    line-height: 1;

}


/* =========================================================
   NOM SALLE
   ========================================================= */

.map-room-name {

    font-size: 8px;

    letter-spacing:
        0.12em;

    text-align: center;

    text-transform:
        uppercase;

}


/* =========================================================
   SALLE ACCESSIBLE
   ========================================================= */

.map-room.available {

    border-color:
        rgba(199, 167, 106, 0.45);

    color:
        var(--gold-light);

    box-shadow:
        0 0 15px
        rgba(199, 167, 106, 0.05);

}


.map-room.available:hover {

    transform:
        translateY(-3px);

    border-color:
        var(--gold-light);

    background:
        rgba(30, 25, 18, 0.95);

    box-shadow:
        0 0 22px
        rgba(199, 167, 106, 0.12);

}


/* =========================================================
   SALLE ACTUELLE
   ========================================================= */

.map-room.current {

    border-color:
        var(--violet);

    color:
        var(--violet-light);

    box-shadow:

        0 0 18px
        rgba(140, 85, 255, 0.16),

        inset 0 0 20px
        rgba(140, 85, 255, 0.05);

}


/* =========================================================
   SALLE TERMINÉE
   ========================================================= */

.map-room.completed {

    opacity:
        0.38;

    border-color:
        rgba(255,255,255,0.08);

    cursor:
        default;

}


.map-room.completed .map-room-icon {

    font-size:
        16px;

}


/* =========================================================
   SALLE VERROUILLÉE
   ========================================================= */

.map-room.locked {

    opacity:
        0.20;

    cursor:
        not-allowed;

}


.map-room.locked .map-room-icon {

    border-color:
        rgba(255,255,255,0.12);

}


/* =========================================================
   COULEURS PAR TYPE
   ========================================================= */

.map-room[data-room-type="combat"] {

    color:
        #b8a8ff;

}


.map-room[data-room-type="elite"] {

    color:
        #e47b7b;

}


.map-room[data-room-type="rest"] {

    color:
        #8bc58e;

}


.map-room[data-room-type="shop"] {

    color:
        #e0bd70;

}


.map-room[data-room-type="event"] {

    color:
        #76a9df;

}


.map-room[data-room-type="boss"] {

    color:
        #c39cff;

}


/* =========================================================
   PETIT INDICATEUR DE SÉLECTION
   ========================================================= */

.map-room.available::before {

    content: "";

    position: absolute;

    top: 6px;
    left: 6px;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background:
        currentColor;

    box-shadow:
        0 0 8px
        currentColor;

}


/* =========================================================
   BOSS
   ========================================================= */

.map-boss {

    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 400px;

    margin:
        5px
        auto
        25px;

    padding:
        24px
        18px;

    text-align: center;

    border:
        1px solid
        rgba(140, 85, 255, 0.35);

    background:
        rgba(12, 8, 20, 0.90);

    box-shadow:
        0 0 30px
        rgba(100, 50, 160, 0.08);

}


.map-boss-line {

    width: 70px;

    height: 1px;

    margin:
        0
        auto
        17px;

    background:
        var(--violet);

}


.boss-icon {

    color:
        var(--violet-light);

    font-size: 27px;

    margin-bottom: 8px;

    text-shadow:
        0 0 16px
        rgba(140, 85, 255, 0.6);

}


.boss-label {

    color:
        var(--text-muted);

    font-size: 8px;

    letter-spacing:
        0.30em;

}


.boss-name {

    margin:
        7px
        0
        15px;

    color:
        var(--text-main);

    font-size: 20px;

    letter-spacing:
        0.08em;

}


/* =========================================================
   BOUTON BOSS
   ========================================================= */

.map-room-button {

    padding:
        10px
        17px;

    border:
        1px solid
        rgba(140, 85, 255, 0.50);

    background:
        rgba(20, 12, 34, 0.85);

    color:
        var(--violet-light);

    font-family:
        inherit;

    font-size: 11px;

    letter-spacing:
        0.08em;

    cursor: pointer;

}


.map-room-button:disabled {

    opacity:
        0.35;

    cursor:
        not-allowed;

}


/* =========================================================
   FOOTER CARTE
   ========================================================= */

.map-footer {

    position: relative;

    z-index: 3;

    width: 100%;

    max-width: 620px;

    margin:
        auto
        0;

    padding-top:
        15px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-top:
        1px solid
        rgba(255,255,255,0.08);

}


.map-footer-info {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.map-footer-info span {

    color:
        var(--text-muted);

    font-size: 8px;

    letter-spacing:
        0.20em;

    text-transform:
        uppercase;

}


.map-footer-info strong {

    color:
        var(--text-soft);

    font-size: 11px;

    letter-spacing:
        0.08em;

}


.map-abandon-button {

    padding:
        8px
        12px;

    border:
        1px solid
        rgba(255,255,255,0.12);

    background:
        transparent;

    color:
        var(--text-muted);

    font-family:
        inherit;

    font-size: 9px;

    letter-spacing:
        0.12em;

    cursor: pointer;

}


.map-abandon-button:hover {

    color:
        var(--text-main);

    border-color:
        rgba(255,255,255,0.25);

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (
    max-width: 600px
) {

    #map-screen {

        padding:
            15px
            12px
            20px;

    }


    .map-brand-title {

        font-size:
            9px;

    }


    .map-brand-run {

        font-size:
            7px;

    }


    .map-souls {

        padding:
            6px
            9px;

    }


    .map-biome-name {

        font-size:
            30px;

    }


    .map-biome-description {

        font-size:
            13px;

    }


    .map-room {

        min-height:
            94px;

    }


    .map-room-icon {

        width:
            38px;

        height:
            38px;

        font-size:
            18px;

    }


    .map-room-name {

        font-size:
            7px;

    }

}


/* =========================================================
   ÉCRANS DE RUN / COMBAT
   ========================================================= */

#run-screen,
#combat-screen {

    min-height: 100vh;

}


/* =========================================================
   TRANSITION CARTE
   ========================================================= */

#map-screen {

    animation:
        mapFadeIn 0.45s ease;

}


@keyframes mapFadeIn {

    from {

        opacity:
            0;

        transform:
            translateY(8px);

    }

    to {

        opacity:
            1;

        transform:
            translateY(0);

    }

}

/* =========================================================
   COMBAT — STRUCTURE GÉNÉRALE
   ========================================================= */

#combat-screen {

    min-height: 100vh;

    width: 100%;

    box-sizing: border-box;

    padding:
        18px
        18px
        28px;

    display: flex;

    flex-direction: column;

    gap: 18px;

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(80, 60, 120, 0.16),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            #0b0b12 0%,
            #08080d 100%
        );

    color: #eeeef5;

    overflow-x: hidden;
}


/* =========================================================
   AMBIANCE PAR BIOME (COMBAT)
   =========================================================
   Même mécanisme que #map-screen ci-dessus (data-biome posé
   par applyBiomeTheme(), Game.js).
   ========================================================= */

#game[data-biome="forest"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(45, 130, 75, 0.18),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(9, 14, 10, 0.62) 0%,
            rgba(7, 11, 8, 0.62) 100%
        ),

        url('Assets/Backgrounds/forest.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="volcano"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(200, 80, 30, 0.20),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(14, 10, 8, 0.62) 0%,
            rgba(10, 7, 5, 0.62) 100%
        ),

        url('Assets/Backgrounds/volcano.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="graveyard"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(90, 65, 140, 0.18),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(10, 9, 16, 0.62) 0%,
            rgba(8, 7, 12, 0.62) 100%
        ),

        url('Assets/Backgrounds/graveyard.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="toundra"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(130, 195, 230, 0.20),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(8, 13, 18, 0.62) 0%,
            rgba(5, 9, 13, 0.62) 100%
        ),

        url('Assets/Backgrounds/toundra.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="dragonCave"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(210, 150, 70, 0.20),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(11, 8, 5, 0.62) 0%,
            rgba(6, 4, 2, 0.62) 100%
        ),

        url('Assets/Backgrounds/dragonCave.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="skyCastle"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(190, 170, 250, 0.20),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(9, 9, 17, 0.62) 0%,
            rgba(5, 4, 9, 0.62) 100%
        ),

        url('Assets/Backgrounds/skyCastle.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="vampireCrypt"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(180, 25, 40, 0.22),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(10, 4, 4, 0.62) 0%,
            rgba(6, 2, 2, 0.62) 100%
        ),

        url('Assets/Backgrounds/vampireCrypt.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="samuraiLand"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(194, 59, 59, 0.20),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(16, 10, 16, 0.62) 0%,
            rgba(10, 6, 10, 0.62) 100%
        ),

        url('Assets/Backgrounds/samuraiLand.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


#game[data-biome="factory"] #combat-screen {

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(219, 154, 45, 0.16),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            rgba(12, 15, 16, 0.62) 0%,
            rgba(7, 8, 10, 0.62) 100%
        ),

        url('Assets/Backgrounds/factory.jpg');


    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

}


/* =========================================================
   BARRE SUPÉRIEURE
   ========================================================= */

.combat-topbar {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding:
        10px
        4px
        16px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08);

    box-sizing: border-box;
}


.combat-topbar-left {

    display: flex;

    align-items: center;

    gap: 18px;

    min-width: 0;
}


.combat-brand {

    font-size: 17px;

    font-weight: 800;

    letter-spacing: 2px;

    line-height: 1;

    white-space: nowrap;
}


.combat-brand span {

    display: block;

    margin-top: 5px;

    font-size: 8px;

    font-weight: 500;

    letter-spacing: 3px;

    opacity: 0.5;
}


.combat-biome-info {

    padding-left: 18px;

    border-left:
        1px solid
        rgba(255, 255, 255, 0.12);

    color: rgba(255, 255, 255, 0.52);

    font-size: 11px;

    letter-spacing: 1.2px;

    text-transform: uppercase;

    white-space: nowrap;
}


.combat-turn {

    min-width: 58px;

    padding:
        7px
        12px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 8px;

    background:
        rgba(255, 255, 255, 0.025);
}


.combat-turn-label {

    font-size: 8px;

    letter-spacing: 1.5px;

    color: rgba(255, 255, 255, 0.42);
}


#combat-turn-value {

    margin-top: 2px;

    font-size: 18px;

    font-weight: 800;

    line-height: 1;
}


/* =========================================================
   ARÈNE
   ========================================================= */

.combat-arena {

    width: 100%;

    max-width: 1100px;

    margin:
        0
        auto;

    display: flex;

    flex-direction: column;

    gap: 18px;
}


/* =========================================================
   HUD — PV / mana / statuts (cartes détaillées)
   =========================================================
   Toute l'information vitale (PV exacts, bouclier, mana,
   états) vit maintenant sur les étiquettes de la scène
   (.combat-stage-tag, plus bas) : ces cartes restent en DOM
   (leurs IDs sont encore mis à jour par renderHeroCombatInfo()
   / renderEnemyCombatInfo(), Game.js — inchangé) mais sont
   masquées, pour ne pas dupliquer l'affichage.
   ========================================================= */

.combat-hud {

    display: none;
}


/* =========================================================
   SCÈNE DE COMBAT — les personnages posés sur le décor
   =========================================================
   Grands sprites (artworks détourés, fond transparent) du
   héros et des ennemis, affichés directement sur le décor du
   biome (déjà visible en arrière-plan de #combat-screen),
   façon Final Fantasy Pixel Remaster. Purement visuel/en plus
   des cartes HUD ci-dessous : aucune information n'existe
   QUE là (le ciblage au clic fonctionne aussi ici, en plus
   des cartes).
   ========================================================= */

.combat-stage {

    position: relative;

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 18px;

    min-height: 340px;

    padding:
        18px
        18px
        0;
}


.combat-stage-enemies {

    display: flex;

    align-items: flex-end;

    /* Les ennemis sont maintenant à droite de la scène (le
       héros à gauche) : on les colle au bord droit, comme
       avant on les collait au bord gauche. */

    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 22px;

    min-width: 0;
}


.combat-stage-hero,
.combat-stage-enemy {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    flex: 0 0 auto;
}


.combat-stage-enemy.selectable {

    cursor: pointer;
}


.combat-stage-sprite {

    height: 210px;

    width: auto;

    max-width: 220px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 16px 14px
            rgba(0, 0, 0, 0.55)
        );

    transition:
        transform 0.15s ease,
        filter 0.15s ease;
}


/* Les artworks sont générés faisant face à droite par défaut
   (le héros, à gauche, n'a donc besoin d'aucun retournement) :
   seuls les ennemis (à droite) doivent être retournés pour
   faire face au héros, à gauche. */

.combat-stage-enemy .combat-stage-sprite {

    transform: scaleX(-1);
}


/* ARMURE — ARTWORK GÉNÉRIQUE TEINTÉ PAR VOIE (voir
   hexColorToHueRotateDeg()/setStageSpriteWithFallbackChain(),
   Game.js) : posée uniquement quand le niveau "b" (générique,
   pas encore d'artwork dédié à cette Voie précise) est celui
   effectivement affiché. Approximation volontaire (sepia +
   rotation de teinte), pas un vrai recolorage. */

.combat-stage-sprite.combat-stage-sprite-tinted {

    filter:
        drop-shadow(
            0 16px 14px
            rgba(0, 0, 0, 0.55)
        )
        sepia(0.45)
        saturate(2.4)
        hue-rotate(var(--hero-armor-tint-hue, 0deg))
        brightness(0.95);
}


/* ARME ÉQUIPÉE — icône superposée sur le sprite du héros (voir
   updateHeroWeaponOverlay(), Game.js). Ancrée près de la main
   avant du héros (poses tournées vers la droite, voir plus
   haut) : position approximative par défaut, pensée pour une
   icône d'arme isolée plutôt qu'un calque parfaitement aligné
   sur chaque pose. Masquée (attribut "hidden") tant qu'aucune
   arme n'est équipée ou que son image n'existe pas encore. */

.combat-stage-weapon-overlay {

    position: absolute;

    right: 8%;

    bottom: 28%;

    height: 40%;

    width: auto;

    max-width: 55%;

    object-fit: contain;

    pointer-events: none;

    filter:
        drop-shadow(
            0 6px 6px
            rgba(0, 0, 0, 0.5)
        );

    transition: transform 0.1s ease;
}


/* Animation d'attaque du héros (grand sprite de scène) :
   petite avancée + flash coloré, rejouée à chaque attaque
   principale (voir playHeroAttackAnimation() dans Game.js).
   La couleur du flash (--combat-attack-flash-color) est fixée
   en JS selon la voie du héros (doré pour Ammout, rouge sang
   pour Vampirisme, etc.) ; pour Ammout et Vampirisme, un
   défilement d'illustrations supplémentaires se fait en plus
   pendant cette même fenêtre. */

:root {

    --combat-attack-flash-color: rgba(255, 214, 120, 0.85);
}


@keyframes combatHeroAttackLunge {

    0% {
        transform: translateX(0) scale(1);
    }

    35% {
        transform: translateX(26px) scale(1.06);

        filter:
            drop-shadow(
                0 16px 14px
                rgba(0, 0, 0, 0.55)
            )
            drop-shadow(
                0 0 22px
                var(--combat-attack-flash-color)
            );
    }

    100% {
        transform: translateX(0) scale(1);
    }
}


.combat-stage-sprite-attacking {

    animation:
        combatHeroAttackLunge
        0.45s ease-out;
}


.combat-stage-enemy.selectable:hover .combat-stage-sprite {

    transform:
        scaleX(-1)
        translateY(-6px);

    filter:
        drop-shadow(
            0 20px 16px
            rgba(0, 0, 0, 0.6)
        )
        drop-shadow(
            0 0 14px
            rgba(255, 140, 140, 0.45)
        );
}


.combat-stage-enemy.selected .combat-stage-sprite {

    filter:
        drop-shadow(
            0 20px 16px
            rgba(0, 0, 0, 0.6)
        )
        drop-shadow(
            0 0 18px
            rgba(255, 90, 90, 0.75)
        );
}


.combat-stage-enemy.dead {

    cursor: default;
}


.combat-stage-enemy.dead .combat-stage-sprite {

    opacity: 0.35;

    filter: grayscale(0.7);
}


.combat-stage-enemy.dead .combat-stage-tag {

    opacity: 0.5;
}


.combat-stage-shadow {

    width: 60%;

    height: 16px;

    margin-top: -8px;

    border-radius: 50%;

    background:
        radial-gradient(
            ellipse,
            rgba(0, 0, 0, 0.5),
            transparent 70%
        );
}


.combat-stage-tag {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 3px;

    margin-bottom: 6px;

    padding:
        5px
        10px;

    border-radius: 14px;

    background: rgba(10, 8, 14, 0.6);

    border:
        1px solid
        rgba(255, 255, 255, 0.10);

    backdrop-filter: blur(3px);

    white-space: nowrap;
}


/* Étiquette secondaire (mana + ressource de voie du héros) :
   même habillage, en plus discret — elle vient sous
   l'étiquette de PV, pas au même niveau d'importance. */

.combat-stage-tag-secondary {

    padding:
        3px
        10px;

    opacity: 0.9;
}


/*
   CORRECTIF — hauteur TOUJOURS réservée (y compris sans aucun
   statut actif), jamais display:none quand vide : la scène de
   combat aligne héros et ennemis par le bas (align-items:
   flex-end sur .combat-stage), donc la moindre variation de
   hauteur de cette ligne faisait redescendre TOUTE la scène
   (héros ET ennemis) dès qu'un premier statut apparaissait —
   par exemple juste après avoir utilisé Premier lancer.
*/

.combat-stage-tag-status {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 3px;

    height: 16px;
}


.combat-stage-tag-name {

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 0.3px;

    color: rgba(255, 255, 255, 0.85);
}


.combat-stage-tag-bar-wrap {

    position: relative;
}


.combat-stage-tag-bar {

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

    width: 92px;

    height: 16px;

    border-radius: 999px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.12);
}


.combat-stage-tag-bar-mana {

    width: 78px;

    height: 12px;
}


.combat-stage-tag-fill {

    position: absolute;

    inset: 0;

    width: 0;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            #ff8a8a,
            #ff5a5a
        );

    transition: width 0.25s ease;
}


.combat-stage-tag-fill-mana {

    background:
        linear-gradient(
            90deg,
            #7fb2ff,
            #4d84e6
        );
}


.combat-stage-tag-value {

    position: relative;

    z-index: 1;

    font-size: 9px;

    font-weight: 700;

    font-variant-numeric: tabular-nums;

    color: #fff;

    text-shadow:
        0 1px 2px
        rgba(0, 0, 0, 0.85);
}


.combat-stage-tag-bar-mana .combat-stage-tag-value {

    font-size: 8px;
}


/* Le bouclier "se pose par-dessus" la barre de PV : petit
   badge qui chevauche son coin supérieur droit. */

.combat-stage-tag-shield {

    position: absolute;

    top: -8px;

    right: -6px;

    z-index: 2;

    padding:
        1px
        5px;

    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            #9fd8ff,
            #5aa8e0
        );

    color: #04243d;

    font-size: 8px;

    font-weight: 800;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, 0.45);
}


/* Ressource de voie (Concentration/Sang condensé) : simple
   ligne de texte discrète sous la barre de mana du héros. */

.combat-stage-tag-extra {

    margin-top: 1px;

    font-size: 8px;

    font-weight: 700;

    color: rgba(255, 255, 255, 0.65);
}


/* =========================================================
   ATQ / DEF EXACTS — toujours visibles sous la barre de PV
   (demande : pouvoir vérifier les stats d'un monstre sans
   interaction supplémentaire, plutôt qu'un appui long).
   ========================================================= */

.combat-stage-tag-substats {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    margin-top: 1px;

    font-size: 9px;

    font-weight: 700;

    font-variant-numeric: tabular-nums;

    color: rgba(255, 255, 255, 0.75);
}


.combat-stage-tag-substat {

    display: inline-flex;

    align-items: center;

    gap: 2px;
}


.combat-stage-tag-substat-icon {

    font-size: 9px;
}


/* =========================================================
   ICÔNE D'ATTAQUE — SVG INLINE (CORRECTIF)
   =========================================================
   L'émoji ⚔️ (épées croisées) n'a pas de glyphe couleur dans
   de nombreuses polices d'émojis (contrairement à 🛡️, bien
   couvert) : sans glyphe couleur disponible, le navigateur
   retombe sur le glyphe "texte" du caractère — deux fins
   traits qui se croisent — visible au clic sur un
   personnage puisque cette icône est affichée en permanence
   sur son étiquette (ATQ/DEF). Remplacé par un petit SVG
   plein (couleur héritée via currentColor) qui rend à
   l'identique sur toutes les plateformes.
   ========================================================= */

.stat-icon-sword {

    width: 1em;
    height: 1em;

    display: block;

    flex-shrink: 0;
}


/* =========================================================
   LOGO DE L'OR — SVG INLINE
   =========================================================
   Petit médaillon doré dessiné pour le jeu (au lieu de
   l'émoji 🪙 générique) : même esprit que les portraits
   d'ennemis/héros faits sur mesure plutôt que des icônes
   standard. Couleurs fixes (et non currentColor) : une pièce
   d'or garde le même aspect quel que soit le texte à côté.
   ========================================================= */

.gold-icon-svg {

    width: 1em;
    height: 1em;

    display: block;

    flex-shrink: 0;
}


/* =========================================================
   INTENTION DE L'ENNEMI — directement sous sa barre de PV
   (voir getEnemyIntentionInfo(), Game.js). Le nom complet de
   l'action reste disponible au survol (title), la ligne
   elle-même ne montre que l'icône + le type d'action pour
   ne pas faire déborder l'étiquette.
   ========================================================= */

.combat-stage-tag-intention {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 3px;

    margin-top: 2px;

    padding-top: 3px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);

    font-size: 8px;

    font-weight: 700;

    color: rgba(255, 190, 100, 0.75);
}


.combat-stage-tag-intention-icon {

    font-size: 9px;
}


/* =========================================================
   ÉTATS — VARIANTE ICÔNE SEULE (voir buildCombatStatusIconsHtml,
   Game.js), affichée au-dessus des barres de PV de la scène.
   ========================================================= */

.status-chip-icon-only {

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

    width: 16px;

    height: 16px;

    padding: 0;

    border-radius: 5px;

    font-size: 10px;

    line-height: 1;
}


.status-chip-icon-count {

    position: absolute;

    bottom: -3px;

    right: -3px;

    padding: 0 2px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.75);

    color: #fff;

    font-size: 7px;

    font-weight: 800;

    line-height: 1.3;
}


/* =========================================================
   CARTES PERSONNAGES
   ========================================================= */

.combat-character {

    position: relative;

    box-sizing: border-box;

    padding: 18px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.055),
            rgba(255, 255, 255, 0.018)
        );

    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.22);
}


.combat-hero {

    border-color:
        rgba(110, 170, 255, 0.18);
}


.combat-enemy {

    border-color:
        rgba(255, 90, 90, 0.18);
}


.combat-enemy.selectable {

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}


.combat-enemy.selectable:hover {

    border-color:
        rgba(255, 140, 140, 0.45);

    transform:
        translateY(-2px);
}


.combat-enemy.selected {

    border-color:
        rgba(255, 90, 90, 0.85);

    box-shadow:
        0 0 0 1px
        rgba(255, 90, 90, 0.55),
        0 12px 30px
        rgba(0, 0, 0, 0.22);
}


.combat-enemy.dead {

    cursor: default;

    opacity: 0.40;

    filter: grayscale(0.6);
}


/* =========================================================
   POINT FAIBLE (DON DE VOIE — PRÉCISION, "Prédateur parfait")
   Indicateur affiché sur la carte de l'ennemi dès que son
   point faible aléatoire est atteint : un critique porté
   maintenant profite du bonus massif avant que la marque
   ne disparaisse.
   ========================================================= */

.combat-enemy.weak-point-marked {

    border-color:
        rgba(249, 168, 37, 0.85);

    box-shadow:
        0 0 0 1px
        rgba(249, 168, 37, 0.55),
        0 0 18px
        rgba(249, 168, 37, 0.35),
        0 12px 30px
        rgba(0, 0, 0, 0.22);

    animation:
        combat-weak-point-pulse 1.6s
        ease-in-out infinite;
}


@keyframes combat-weak-point-pulse {

    0%, 100% {
        box-shadow:
            0 0 0 1px
            rgba(249, 168, 37, 0.55),
            0 0 12px
            rgba(249, 168, 37, 0.25),
            0 12px 30px
            rgba(0, 0, 0, 0.22);
    }

    50% {
        box-shadow:
            0 0 0 1px
            rgba(249, 168, 37, 0.85),
            0 0 22px
            rgba(249, 168, 37, 0.55),
            0 12px 30px
            rgba(0, 0, 0, 0.22);
    }

}


.combat-weak-point-badge {

    position: absolute;

    top: -10px;

    right: 12px;

    padding: 3px 9px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.4px;

    color: #1a1200;

    background:
        linear-gradient(
            90deg,
            #F9A825,
            #ffd166
        );

    box-shadow:
        0 4px 10px
        rgba(0, 0, 0, 0.35);

    white-space: nowrap;
}


/* =========================================================
   Point faible (PRECISION_10) hors de portée : la
   Concentration actuelle n'est pas encore dans la zone, le
   bonus de dégâts critiques n'est pas actif.
   ========================================================= */

.combat-weak-point-badge.inactive {

    color: #cfcfcf;

    background:
        linear-gradient(
            90deg,
            #4a4a4a,
            #6b6b6b
        );

    box-shadow:
        0 4px 10px
        rgba(0, 0, 0, 0.25);
}


@media (prefers-reduced-motion: reduce) {

    .combat-enemy.weak-point-marked {
        animation: none;
    }

}


.combat-character-header {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 20px;
}


.combat-character-icon {

    /* =====================================================
       VIGNETTE D'IDENTIFICATION (voir .combat-stage-sprite)
       =====================================================
       Le gros portrait "en scène" vit maintenant sur le décor
       (.combat-stage-hero / .combat-stage-enemy, plus haut) :
       cette icône de carte redevient une simple vignette de
       repérage (comme avant, avec un peu plus de présence
       qu'à l'origine — 44px -> 56px), pour éviter de répéter
       deux fois le même grand portrait. Les cartes elles-
       mêmes (nom, PV/mana, statuts, boutons) restent
       inchangées.
       ===================================================== */

    position: relative;

    overflow: hidden;

    width: 56px;

    height: 56px;

    flex:
        0 0
        56px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        rgba(110, 170, 255, 0.10);

    border:
        2px solid
        rgba(110, 170, 255, 0.28);

    box-shadow:
        0 6px 14px
        rgba(0, 0, 0, 0.4);

    font-size: 24px;
}


/* =========================================================
   PORTRAIT (image réelle à la place de l'émoji générique)
   =========================================================
   wireCombatPortraitFallbacks() (Game.js) retire cette
   balise <img> et retombe sur l'émoji de secours
   (data-fallback-icon) si le fichier Assets/Portraits/*.png
   n'existe pas encore pour cette créature.
   ========================================================= */

.combat-character-portrait {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    object-fit: cover;
}


.enemy-icon {

    background:
        rgba(255, 80, 80, 0.10);

    border-color:
        rgba(255, 80, 80, 0.30);
}


.combat-character-label {

    margin-bottom: 4px;

    color:
        rgba(255, 255, 255, 0.40);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: 1.7px;
}


.combat-character-name {

    font-size: 18px;

    font-weight: 800;

    line-height: 1.15;

    overflow-wrap: anywhere;
}


/* =========================================================
   BARRES PV / MANA
   ========================================================= */

.combat-hp-section,
.combat-mana-section,
.combat-concentration-section {

    width: 100%;

    margin-top: 13px;
}


/* =========================================================
   SOUS-STATISTIQUES (ATQ / DEF)
   ========================================================= */

.combat-character-substats {

    display: flex;

    gap: 16px;

    margin-top: 13px;

    padding-top: 12px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.07);
}


.combat-character-substat {

    display: flex;

    align-items: center;

    gap: 5px;

    font-size: 12px;

    font-weight: 700;

    color:
        rgba(255, 255, 255, 0.72);
}


.combat-character-substat-icon {

    font-size: 12px;

    opacity: 0.75;
}


.combat-bar-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 7px;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 0.8px;

    color:
        rgba(255, 255, 255, 0.58);
}


/* =========================================================
   BOUCLIER (Cuirasse écarlate / Sang durci)
   ========================================================= */

.combat-hp-value-group {

    display: flex;

    align-items: center;

    gap: 6px;
}


.combat-shield-badge {

    display: inline-flex;

    align-items: center;

    gap: 3px;

    padding: 1px 6px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 800;

    color: #cfe8ff;

    background:
        rgba(110, 170, 255, 0.16);

    border:
        1px solid
        rgba(110, 170, 255, 0.35);
}


/* =========================================================
   CORRECTIF — l'attribut [hidden] ne masquait pas le badge
   =========================================================
   Une règle de classe (.combat-shield-badge { display:
   inline-flex }) a la même spécificité qu'une règle
   d'attribut : à spécificité égale, une règle d'auteur (la
   nôtre) l'emporte toujours sur le [hidden] par défaut du
   navigateur, qui n'est qu'une feuille de style "agent
   utilisateur" de dernier recours. D'où ce correctif
   explicite, de spécificité supérieure.
   ========================================================= */

.combat-shield-badge[hidden] {

    display: none;

}


.combat-bar {

    width: 100%;

    height: 9px;

    overflow: hidden;

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.07);

    box-shadow:
        inset 0 1px 2px
        rgba(0, 0, 0, 0.35);
}


.combat-bar-fill {

    height: 100%;

    width: 0%;

    border-radius: inherit;

    transition:
        width 0.25s ease;
}


.combat-hp-fill {

    background:
        linear-gradient(
            90deg,
            #a82d38,
            #e85a62
        );

    box-shadow:
        0 0 10px
        rgba(232, 90, 98, 0.20);
}


.combat-mana-fill {

    background:
        linear-gradient(
            90deg,
            #315fc5,
            #5e9cff
        );

    box-shadow:
        0 0 10px
        rgba(94, 156, 255, 0.20);
}


.combat-concentration-fill {

    background:
        linear-gradient(
            90deg,
            #c07f0a,
            #F9A825
        );

    box-shadow:
        0 0 10px
        rgba(249, 168, 37, 0.25);
}


/* Sang condensé (voie Vampirisme) — même gabarit que la
   Concentration ci-dessus (.combat-concentration-section
   partagée), couleur propre à la voie (#8E24AA). */

.combat-condensed-blood-fill {

    background:
        linear-gradient(
            90deg,
            #6a1a80,
            #8E24AA
        );

    box-shadow:
        0 0 10px
        rgba(142, 36, 170, 0.30);
}


.combat-enemy-hp-fill {

    background:
        linear-gradient(
            90deg,
            #8c2932,
            #df4d58
        );

    box-shadow:
        0 0 10px
        rgba(223, 77, 88, 0.20);
}


/* =========================================================
   STATUTS
   ========================================================= */

.combat-status-list {

    min-height: 24px;

    margin-top: 15px;

    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


.combat-status-list > * {

    padding:
        4px
        7px;

    border-radius: 6px;

    background:
        rgba(255, 255, 255, 0.055);

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    font-size: 9px;
}


.status-chip {

    display: flex;

    align-items: center;

    gap: 4px;

    /* Affiche désormais un nom complet (voir BUFF_DISPLAY,
       Game.js), pas seulement une icône + un nombre : évite
       qu'il ne se coupe au milieu, le conteneur
       (.combat-status-list, flex-wrap) passe les puces
       suivantes à la ligne à la place. */
    white-space: nowrap;

    /* La puce est désormais un vrai <button> (clic pour voir
       le détail complet — voir buildCombatStatusChipsHtml()
       et le clic délégué de initializeGame(), Game.js) : on
       efface les styles par défaut du navigateur pour qu'elle
       garde exactement l'apparence qu'elle avait en <span>. */
    appearance: none;
    -webkit-appearance: none;

    font: inherit;
    color: inherit;

    cursor: pointer;

    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast);
}


.status-chip:hover,
.status-chip:focus-visible {

    background:
        rgba(255, 255, 255, 0.12);

    transform: translateY(-1px);
}


.status-chip:focus-visible {

    outline:
        2px solid
        rgba(255, 255, 255, 0.55);

    outline-offset: 2px;
}


.status-chip-poison {

    background:
        rgba(120, 200, 90, 0.12);

    border-color:
        rgba(120, 200, 90, 0.30);

    color:
        rgba(180, 235, 150, 0.90);
}


.status-chip-buff {

    background:
        rgba(94, 156, 255, 0.12);

    border-color:
        rgba(94, 156, 255, 0.30);

    color:
        rgba(170, 205, 255, 0.90);
}


.status-chip-debuff {

    background:
        rgba(255, 90, 90, 0.12);

    border-color:
        rgba(255, 90, 90, 0.30);

    color:
        rgba(255, 170, 170, 0.90);
}


.status-chip-mark {

    background:
        rgba(255, 180, 70, 0.12);

    border-color:
        rgba(255, 180, 70, 0.30);

    color:
        rgba(255, 210, 140, 0.90);
}


/* =========================================================
   ZONE ENNEMI
   ========================================================= */

.combat-enemy-zone {

    display: flex;

    flex-direction: column;

    gap: 12px;

    min-width: 0;
}


/* =========================================================
   LISTE DE PLUSIEURS ENNEMIS
   =========================================================
   #enemy-info accueille désormais 1 à 3 cartes .combat-character
   .combat-enemy générées dynamiquement (renderEnemyCombatInfo(),
   Game.js) au lieu d'être lui-même une carte unique : simple
   conteneur empilé, sans son propre style de carte.
   ========================================================= */

.combat-enemy-list {

    display: flex;

    flex-direction: column;

    gap: 12px;

    min-width: 0;
}


/* =========================================================
   PV CRITIQUES — PULSATION
   ========================================================= */

.combat-character.low-hp {

    border-color:
        rgba(255, 70, 70, 0.55);

    animation:
        combat-low-hp-pulse
        1.6s
        ease-in-out
        infinite;
}


@keyframes combat-low-hp-pulse {

    0%, 100% {

        box-shadow:
            0 12px 30px
            rgba(0, 0, 0, 0.22);

    }

    50% {

        box-shadow:
            0 12px 30px
            rgba(0, 0, 0, 0.22),
            0 0 22px
            rgba(255, 60, 60, 0.35);

    }

}


/* =========================================================
   INTENTION ENNEMIE
   =========================================================
   Ce panneau groupé reste en DOM (renderEnemyIntentions(),
   Game.js, continue de le remplir sans changement) mais est
   masqué : l'intention de chaque ennemi s'affiche maintenant
   directement sous sa propre barre de PV sur la scène — voir
   .combat-stage-tag-intention plus bas.
   ========================================================= */

.combat-intention {

    display: none;

    padding:
        13px
        15px;

    border:
        1px solid
        rgba(255, 185, 90, 0.16);

    border-radius: 11px;

    background:
        rgba(255, 180, 70, 0.035);

    text-align: center;
}


.combat-intention-label {

    margin-bottom: 6px;

    color:
        rgba(255, 190, 100, 0.58);

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1.7px;
}


.combat-intention-content {

    min-height: 20px;

    font-size: 12px;

    font-weight: 700;

    color:
        rgba(255, 255, 255, 0.82);
}

/* =========================================================
   COMBAT — PANNEAU D'ACTIONS
   ========================================================= */

.combat-actions-panel {

    width: 100%;

    max-width: 1100px;

    margin:
        0
        auto;

    box-sizing: border-box;

    padding: 18px;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.025);

    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.18);
}


/* =========================================================
   BANNIÈRE DE VICTOIRE (remplace les boutons d'action une
   fois le combat gagné, le temps de relire le journal —
   voir showCombatVictoryBanner(), Game.js)
   ========================================================= */

.combat-victory-banner {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 14px;

    padding: 28px 16px;

    text-align: center;
}


.combat-victory-banner-title {

    font-size: 22px;

    font-weight: 800;

    color: rgba(255, 215, 120, 0.95);
}


.combat-victory-banner-hint {

    font-size: 13px;

    color: rgba(255, 255, 255, 0.55);

    max-width: 40ch;
}


/* =========================================================
   EN-TÊTE DES ACTIONS
   ========================================================= */

.combat-actions-header {

    display: flex;

    align-items: baseline;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 14px;
}


.combat-actions-title {

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.8px;

    color:
        rgba(255, 255, 255, 0.88);
}


.combat-actions-hint {

    font-size: 9px;

    color:
        rgba(255, 255, 255, 0.36);
}


/* =========================================================
   ACTIONS PRINCIPALES
   ========================================================= */

.combat-main-actions {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    width: 100%;
}


.combat-action-button {

    min-height: 72px;

    padding:
        12px
        14px;

    display: flex;

    align-items: center;

    gap: 12px;

    border:
        1px solid
        rgba(255, 255, 255, 0.10);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.035);

    color: #eeeeF5;

    cursor: pointer;

    text-align: left;

    font-family: inherit;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}


.combat-action-button:hover {

    transform:
        translateY(-2px);

    background:
        rgba(255, 255, 255, 0.055);

    border-color:
        rgba(255, 255, 255, 0.18);

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.20);
}


.combat-action-button:active {

    transform:
        translateY(0);
}


.combat-action-button:disabled {

    opacity: 0.38;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   ICÔNES D'ACTIONS
   ========================================================= */

.combat-action-icon {

    width: 38px;

    height: 38px;

    flex:
        0 0
        38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    font-size: 18px;

    background:
        rgba(255, 255, 255, 0.06);
}


.combat-attack-button {

    border-color:
        rgba(220, 75, 85, 0.20);
}


.combat-attack-button .combat-action-icon {

    background:
        rgba(220, 75, 85, 0.10);
}


.combat-attack-button:hover {

    border-color:
        rgba(230, 85, 95, 0.40);

    background:
        rgba(220, 75, 85, 0.055);
}


.combat-parry-button {

    border-color:
        rgba(100, 160, 230, 0.20);
}


.combat-parry-button .combat-action-icon {

    background:
        rgba(100, 160, 230, 0.10);
}


.combat-parry-button:hover {

    border-color:
        rgba(100, 160, 230, 0.40);

    background:
        rgba(100, 160, 230, 0.055);
}


/* =========================================================
   TEXTE DES ACTIONS
   ========================================================= */

.combat-action-text {

    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 4px;
}


.combat-action-text strong {

    font-size: 12px;

    font-weight: 800;

    line-height: 1.1;
}


.combat-action-text small {

    font-size: 9px;

    line-height: 1.25;

    color:
        rgba(255, 255, 255, 0.38);
}


/* =========================================================
   COMPÉTENCES
   ========================================================= */

.combat-skills {

    width: 100%;

    margin-top: 10px;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(150px, 1fr)
        );

    gap: 10px;
}


/*
   Game.js génère les boutons de compétences
   dans #combat-skills.
*/

.combat-skills button {

    min-height: 82px;

    padding:
        11px
        12px;

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    justify-content: center;

    gap: 5px;

    box-sizing: border-box;

    border:
        1px solid
        rgba(120, 100, 220, 0.18);

    border-radius: 10px;

    background:
        linear-gradient(
            145deg,
            rgba(110, 90, 190, 0.08),
            rgba(255, 255, 255, 0.025)
        );

    color:
        rgba(255, 255, 255, 0.88);

    font-family: inherit;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}


.combat-skills button:hover {

    transform:
        translateY(-2px);

    border-color:
        rgba(150, 125, 255, 0.42);

    background:
        rgba(120, 100, 220, 0.10);

    box-shadow:
        0 8px 20px
        rgba(70, 50, 130, 0.18);
}


.combat-skills button:active {

    transform:
        translateY(0);
}


.combat-skills button:disabled {

    opacity: 0.35;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   ÉLÉMENTS GÉNÉRÉS À L'INTÉRIEUR DES COMPÉTENCES
   ========================================================= */

.combat-skills .skill-action-type {

    font-size: 7px;

    font-weight: 700;

    letter-spacing: 0.6px;

    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.40);
}


.combat-skills button.quick-skill {

    border-left:
        3px solid
        rgba(255, 200, 70, 0.55);
}


.combat-skills button.quick-skill .skill-action-type {

    color:
        rgba(255, 200, 70, 0.85);
}


.combat-skills button.main-skill {

    border-left:
        3px solid
        rgba(150, 125, 255, 0.45);
}


.combat-skills .skill-name {

    font-size: 11px;

    font-weight: 800;

    line-height: 1.2;
}


/* =========================================================
   ICÔNE(S) DE VOIE DE LA COMPÉTENCE
   =========================================================
   Préfixe le nom de la compétence dans la barre de combat :
   voir getSkillPathIconHtml() (Game.js). Une compétence
   hybride affiche les deux icônes de ses voies côte à côte.
   ========================================================= */

.skill-path-icon {

    margin-right: 3px;

    font-size: 10px;

    font-weight: 400;

    letter-spacing: -1px;
}


.combat-skills .skill-description {

    font-size: 8px;

    line-height: 1.35;

    color:
        rgba(255, 255, 255, 0.40);
}


.combat-skills .skill-cost {

    font-size: 8px;

    font-weight: 700;

    color:
        rgba(100, 165, 255, 0.72);
}


.combat-skills .skill-damage {

    font-size: 8px;

    font-weight: 700;

    color:
        rgba(255, 140, 100, 0.85);
}


/* =========================================================
   CIBLE (unique/zone) ET UTILISATIONS RESTANTES
   =========================================================
   Toujours affichées (contrairement à .skill-description,
   masquée sur mobile) : deux informations qui influencent le
   choix tactique du joueur, pas de la prose décorative — voir
   renderCombatSkills(), Game.js.
   ========================================================= */

.combat-skills .skill-meta {

    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


.combat-skills .skill-target {

    font-size: 8px;

    font-weight: 600;

    color:
        rgba(255, 255, 255, 0.45);
}


.combat-skills .skill-uses {

    font-size: 8px;

    font-weight: 700;

    color:
        rgba(120, 200, 160, 0.85);
}


.combat-skills .skill-uses-low {

    color:
        rgba(255, 150, 90, 0.9);
}


/* =========================================================
   JOURNAL DE COMBAT
   ========================================================= */

.combat-log-panel {

    width: 100%;

    max-width: 1100px;

    margin:
        0
        auto;

    box-sizing: border-box;

    border:
        1px solid
        rgba(255, 255, 255, 0.07);

    border-radius: 12px;

    background:
        rgba(0, 0, 0, 0.18);

    overflow: hidden;
}


.combat-log-header {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding:
        11px
        15px;

    border: none;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.07);

    background: none;

    color:
        rgba(255, 255, 255, 0.42);

    font-family: inherit;

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1.7px;

    text-align: left;

    cursor: pointer;
}


.combat-log-header:hover {

    color:
        rgba(255, 255, 255, 0.65);
}


.combat-log-toggle-icon {

    font-size: 10px;

    transition: transform var(--transition-fast);
}


/*
   CORRECTIF — journal replié : masque la zone de messages et
   supprime la bordure de séparation devenue inutile (plus rien
   en dessous). L'icône pivote pour indiquer l'état.
*/

.combat-log-panel.collapsed .combat-log-header {

    border-bottom: none;
}


.combat-log-panel.collapsed .combat-log-toggle-icon {

    transform: rotate(-90deg);
}


.combat-log-panel.collapsed .combat-log {

    display: none;
}


.combat-log {

    min-height: 70px;

    max-height: 150px;

    padding:
        10px
        15px;

    box-sizing: border-box;

    overflow-y: auto;

    /*
       CORRECTIF — sans ça, arriver en haut/bas de cette petite
       zone de défilement faisait "déborder" le geste de scroll
       sur la page entière (effet de double-scroll désagréable
       au doigt sur mobile).
    */
    overscroll-behavior: contain;

    display: flex;

    flex-direction: column;

    gap: 6px;

    scrollbar-width: thin;
}


.combat-log > * {

    font-size: 9px;

    line-height: 1.4;

    color:
        rgba(255, 255, 255, 0.58);
}


.combat-log p {

    margin: 0;
}


.combat-log div {

    margin: 0;
}


/* =========================================================
   ÉTAT DE CIBLE / SÉLECTION
   ========================================================= */

.combat-character.targetable {

    cursor: pointer;

    border-color:
        rgba(255, 210, 100, 0.30);

    box-shadow:
        0 0 0 1px
        rgba(255, 210, 100, 0.08);
}


.combat-character.targetable:hover {

    border-color:
        rgba(255, 210, 100, 0.60);

    background:
        rgba(255, 210, 100, 0.045);
}


.combat-character.selected-target {

    border-color:
        rgba(255, 210, 100, 0.75);

    box-shadow:
        0 0 20px
        rgba(255, 190, 80, 0.14);
}


/* =========================================================
   ANIMATION LÉGÈRE DES BARRES
   ========================================================= */

@keyframes combat-bar-pulse {

    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.12);
    }

    100% {
        filter: brightness(1);
    }

}


.combat-bar-fill {

    animation:
        combat-bar-pulse 2.5s
        ease-in-out
        infinite;
}
/* =========================================================
   COMBAT — RESPONSIVE MOBILE
   ========================================================= */

@media (max-width: 760px) {

    #combat-screen {

        min-height: 100vh;

        overflow-x: hidden;

        overflow-y: auto;
    }


    /* -----------------------------------------------------
       TOPBAR
       ----------------------------------------------------- */

    /*
       CORRECTIF — SUR TÉLÉPHONE, LA MARQUE + LE TAG "COMBAT"
       (À GAUCHE) ET LES BOUTONS BUILD/STATS + LE COMPTEUR DE
       TOUR (À DROITE) NE TENAIENT JAMAIS SUR UNE SEULE LIGNE
       Sans "flex-wrap", les deux groupes (chacun en
       "white-space: nowrap") ne pouvaient pas rétrécir en
       dessous de leur largeur de contenu : ils débordaient
       l'un sur l'autre au lieu de passer à la ligne, rendant
       le texte illisible (ex. le bouton "Build" recouvrait la
       fin du tag "Combat"). Passage à 2 lignes empilées dès
       que la largeur manque.
    */

    .combat-topbar {

        flex-wrap: wrap;

        row-gap: 8px;

        padding:
            12px
            14px;

        gap: 10px;
    }


    .combat-topbar-left,
    .combat-topbar-right {

        flex-wrap: wrap;
    }


    .combat-topbar-right {

        width: 100%;

        justify-content: flex-end;
    }


    .combat-brand {

        font-size: 12px;

        letter-spacing: 1.4px;
    }


    .combat-biome-info {

        font-size: 8px;
    }


    .combat-turn {

        font-size: 8px;

        padding:
            5px
            8px;
    }


    /* -----------------------------------------------------
       ARÈNE
       ----------------------------------------------------- */

    .combat-arena {

        width: 100%;

        padding:
            12px;

        box-sizing: border-box;

        gap: 10px;
    }


    .combat-hud {

        grid-template-columns: 1fr;

        gap: 10px;
    }


    /* -----------------------------------------------------
       SCÈNE DE COMBAT
       ----------------------------------------------------- */

    .combat-stage {

        min-height: 150px;

        gap: 4px;

        padding:
            6px
            4px
            0;
    }


    .combat-stage-enemies {

        /* Pas de retour à la ligne : sur petit écran, mieux
           vaut rétrécir les sprites que les empiler en
           colonne (ce qui allongeait démesurément la scène).
           Chaque ennemi (sprite + étiquette) est ici plus
           étroit que le héros, seul sur sa moitié de scène,
           pour qu'un groupe de 3 tienne quand même à côté de
           lui sans déborder l'écran. */

        flex-wrap: nowrap;

        gap: 3px;

        min-width: 0;
    }


    .combat-stage-hero,
    .combat-stage-enemy {

        min-width: 0;
    }


    .combat-stage-sprite {

        height: 80px;

        max-width: 76px;
    }


    .combat-stage-hero .combat-stage-sprite {

        height: 88px;

        max-width: 92px;
    }


    .combat-stage-tag {

        max-width: 76px;

        padding:
            2px
            4px;

        border-radius: 10px;
    }


    .combat-stage-hero .combat-stage-tag {

        max-width: 92px;
    }


    .combat-stage-tag-status {

        gap: 2px;

        height: 13px;
    }


    .status-chip-icon-only {

        width: 13px;

        height: 13px;

        border-radius: 4px;

        font-size: 8px;
    }


    .status-chip-icon-count {

        font-size: 6px;
    }


    /* CORRECTIF — noms de monstres coupés ("Le Colosse Ind...")
       : .combat-stage-tag (parent) impose white-space: nowrap
       pour ses autres lignes (PV, icônes ATQ/DÉF), hérité ici
       par erreur — combiné à overflow:hidden/text-overflow, ça
       tronquait tout nom un peu long au lieu de le laisser
       passer à la ligne dans le même encart. */
    .combat-stage-tag-name {

        white-space: normal;

        overflow-wrap: break-word;

        max-width: 100%;

        font-size: 7px;

        line-height: 1.15;
    }


    .combat-stage-tag-bar {

        width: 62px;

        height: 13px;

        min-width: 0;
    }


    .combat-stage-hero .combat-stage-tag-bar {

        width: 76px;
    }


    .combat-stage-tag-bar-mana {

        width: 54px;

        height: 10px;
    }


    .combat-stage-tag-value {

        font-size: 7px;
    }


    .combat-stage-tag-bar-mana .combat-stage-tag-value {

        font-size: 6px;
    }


    .combat-stage-tag-shield {

        top: -6px;

        right: -4px;

        padding:
            0
            4px;

        font-size: 7px;
    }


    .combat-stage-tag-extra {

        font-size: 7px;
    }


    .combat-stage-tag-intention {

        gap: 2px;

        margin-top: 1px;

        padding-top: 2px;

        font-size: 7px;
    }


    .combat-stage-tag-intention-icon {

        font-size: 8px;
    }


    /* Plus assez de place pour le libellé texte ("Attaque",
       "Préparation"...) à côté de l'icône sur un écran de
       téléphone : l'icône seule reste (le nom complet de
       l'action reste consultable au survol/appui long via
       l'attribut title). */

    .combat-stage-tag-intention-label {

        display: none;
    }


    /* -----------------------------------------------------
       CARTES PERSONNAGES
       ----------------------------------------------------- */

    .combat-character {

        width: 100%;

        min-width: 0;

        box-sizing: border-box;

        padding: 14px;
    }


    .combat-character-header {

        gap: 8px;
    }


    .combat-character-icon {

        width: 48px;

        height: 48px;

        flex:
            0 0
            48px;

        border-radius: 10px;

        font-size: 20px;
    }


    .combat-character-label {

        font-size: 8px;

        letter-spacing: 1.2px;
    }


    .combat-character-name {

        font-size: 13px;
    }


    /* -----------------------------------------------------
       BARRES
       ----------------------------------------------------- */

    .combat-bar {

        height: 9px;
    }


    .combat-resource-value {

        font-size: 8px;
    }


    /* -----------------------------------------------------
       STATUTS
       ----------------------------------------------------- */

    .combat-status {

        gap: 5px;

        margin-top: 8px;
    }


    .combat-status span {

        font-size: 7px;

        padding:
            4px
            6px;
    }


    /* -----------------------------------------------------
       INTENTION ENNEMIE
       ----------------------------------------------------- */

    .combat-intention {

        width: 100%;

        box-sizing: border-box;

        padding:
            12px;
    }


    .combat-intention-content {

        font-size: 11px;
    }


    /* -----------------------------------------------------
       PANNEAU D'ACTIONS
       ----------------------------------------------------- */

    .combat-actions-panel {

        width: calc(100% - 24px);

        margin:
            0
            12px;

        padding: 12px;

        border-radius: 12px;
    }


    .combat-actions-header {

        align-items: flex-start;

        flex-direction: column;

        gap: 5px;

        margin-bottom: 10px;
    }


    .combat-actions-title {

        font-size: 10px;
    }


    .combat-actions-hint {

        font-size: 8px;
    }


    /* -----------------------------------------------------
       ATTAQUE / PARADE
       ----------------------------------------------------- */

    .combat-main-actions {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }


    .combat-action-button {

        min-height: 0;

        padding:
            8px
            9px;

        gap: 8px;

        border-radius: 9px;
    }


    .combat-action-icon {

        width: 32px;

        height: 32px;

        flex:
            0 0
            32px;

        font-size: 15px;

        border-radius: 7px;
    }


    .combat-action-text strong {

        font-size: 10px;
    }


    .combat-action-text small {

        font-size: 7px;
    }


    /* -----------------------------------------------------
       COMPÉTENCES
       ----------------------------------------------------- */

    .combat-skills {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 6px;

        margin-top: 8px;
    }


    .combat-skills button {

        min-height: 0;

        padding:
            8px
            9px;

        gap: 3px;

        border-radius: 9px;
    }


    .combat-skills .skill-name {

        font-size: 9px;
    }


    /* CORRECTIF — cartes de compétence bien trop hautes sur
       téléphone (texte de description parfois sur 3 lignes,
       ex : Frappe absolue) : impossible de voir les 6
       compétences + Attaquer/Parer sans défiler. La
       description (déjà répétée dans les dégâts/coût
       chiffrés juste en dessous) est masquée à partir de
       cette largeur plutôt que seulement sous 390px (voir
       plus bas) : la plupart des téléphones réels ont un
       viewport CSS de 390-430px et ne déclenchaient donc
       jamais cette règle. */
    .combat-skills .skill-description {

        display: none;
    }


    .combat-skills .skill-cost {

        font-size: 7px;
    }


    /* -----------------------------------------------------
       JOURNAL
       ----------------------------------------------------- */

    .combat-log-panel {

        width: calc(100% - 24px);

        margin:
            0
            12px
            12px;
    }


    .combat-log-header {

        padding:
            9px
            12px;

        font-size: 7px;
    }


    .combat-log {

        min-height: 60px;

        max-height: 130px;

        padding:
            9px
            12px;

        gap: 5px;
    }


    .combat-log > * {

        font-size: 8px;
    }

}


/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 390px) {

    .combat-topbar {

        padding:
            10px
            11px;
    }


    .combat-brand {

        font-size: 10px;
    }


    .combat-turn {

        font-size: 7px;

        padding:
            4px
            6px;
    }


    .combat-arena {

        padding:
            10px;
    }


    /* ÉQUILIBRAGE — cartes PV/héros/ennemis compactées : demande
       explicite de rétrécir cette zone pour qu'elle tienne
       mieux à l'écran, notamment à 3 ennemis simultanés. */
    .combat-character {

        padding: 8px;
    }


    .combat-character-icon {

        width: 34px;

        height: 34px;

        flex:
            0 0
            34px;

        border-radius: 8px;

        font-size: 15px;
    }


    .combat-stage {

        min-height: 140px;
    }


    .combat-stage-sprite {

        height: 58px;

        max-width: 54px;
    }


    .combat-stage-hero .combat-stage-sprite {

        height: 64px;

        max-width: 66px;
    }


    .combat-stage-tag,
    .combat-stage-tag-bar {

        max-width: 64px;
    }


    .combat-stage-hero .combat-stage-tag,
    .combat-stage-hero .combat-stage-tag-bar {

        max-width: 78px;
    }


    .combat-stage-tag-bar {

        width: 52px;
    }


    .combat-stage-hero .combat-stage-tag-bar {

        width: 64px;
    }


    .combat-actions-panel {

        width: calc(100% - 20px);

        margin:
            0
            10px;

        padding: 10px;
    }


    .combat-main-actions {

        gap: 6px;
    }


    .combat-action-button {

        min-height: 0;

        padding:
            8px;
    }


    .combat-action-icon {

        width: 28px;

        height: 28px;

        flex:
            0 0
            28px;

        font-size: 13px;
    }


    .combat-action-text strong {

        font-size: 9px;
    }


    .combat-action-text small {

        display: none;
    }


    .combat-skills {

        gap: 6px;
    }


    .combat-skills button {

        min-height: 0;

        padding: 7px;
    }


    .combat-log-panel {

        width: calc(100% - 20px);

        margin:
            0
            10px
            10px;
    }

}


/* =========================================================
   ACCESSIBILITÉ — RÉDUCTION DES ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .combat-action-button,
    .combat-skills button {

        transition: none;
    }


    .combat-bar-fill {

        animation: none;
    }

}

/* =========================================================
   ÉCRAN DE RÉCOMPENSES DE COMBAT
   ========================================================= */

#rewards-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(140, 85, 255, 0.14),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#rewards-screen.hidden {

    display: none;
}

.rewards-panel {

    width: 100%;
    max-width: 720px;

    /* CORRECTIF — panneau plus haut que l'écran (beaucoup de
       récompenses) rendu inatteignable en haut : centrer un
       enfant plus grand que son conteneur flex ne laisse pas
       défiler jusqu'à son propre début. Le panneau scrolle
       maintenant lui-même, plafonné sous la hauteur d'écran
       (même correctif que .combat-stats-panel-inner /
       .soul-merchant-panel). */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 32px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rewards-title {

    margin: 6px 0 18px;

    font-size: 1.6rem;
    letter-spacing: 0.04em;

    color: var(--text-main);
}

.rewards-gold {

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(199, 167, 106, 0.08);

    color: var(--gold-light);

    font-weight: 600;
}

.rewards-gold-icon {

    font-size: 1.1em;
}

.rewards-divider {

    height: 1px;

    margin: 24px auto;

    max-width: 320px;

    background: var(--border-dark);
}

.rewards-subtitle {

    margin: 0 0 18px;

    color: var(--text-soft);

    font-size: 0.95rem;
}

.rewards-choices {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

    gap: 14px;

    margin-bottom: 22px;
}

.rewards-empty {

    padding: 18px 0;

    color: var(--text-muted);

    font-style: italic;
}

.reward-card {

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    padding: 18px 14px;

    border: 1px solid var(--reward-color, var(--border-dark));
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.12)
        );

    color: var(--text-main);

    cursor: pointer;

    text-align: center;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.reward-card:hover,
.reward-card:focus-visible {

    transform: translateY(-3px);

    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);

    border-color: var(--reward-color, var(--violet-light));
}

.reward-card-icon {

    font-size: 1.8rem;
}

.reward-card-rarity {

    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--reward-color, var(--text-soft));
}

.reward-card-owned-badge {

    padding: 2px 10px;

    border-radius: 999px;

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;

    color: #1a1200;

    background:
        linear-gradient(
            90deg,
            var(--reward-color, #F9A825),
            #ffd166
        );
}

.reward-card-name {

    font-weight: 700;

    font-size: 0.98rem;
}

.reward-card-description {

    font-size: 0.82rem;

    color: var(--text-soft);

    line-height: 1.35;
}

.reward-card-wrapper {

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.reward-card-wrapper .reward-card {

    flex: 1 1 auto;
}

.reward-card-reroll-button {

    padding: 6px 10px;

    border: 1px dashed var(--border-dark);
    border-radius: 10px;

    background: transparent;

    color: var(--text-soft);

    font-size: 0.72rem;

    cursor: pointer;

    transition:
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.reward-card-reroll-button:hover,
.reward-card-reroll-button:focus-visible {

    border-color: var(--violet-light);

    color: var(--text-main);
}

.rewards-skip-button {

    padding: 10px 22px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: transparent;

    color: var(--text-soft);

    cursor: pointer;

    font-size: 0.9rem;

    transition:
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.rewards-skip-button:hover {

    border-color: var(--text-soft);

    color: var(--text-main);
}

/* =========================================================
   VICTOIRE DE LA RUN
   ========================================================= */

#victory-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(255, 200, 90, 0.16),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#victory-screen.hidden {

    display: none;
}

.victory-panel {

    width: 100%;
    max-width: 560px;

    /* CORRECTIF — voir .rewards-panel : un panneau centré plus
       grand que l'écran restait inatteignable en haut au défilement. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 40px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.victory-title {

    margin: 6px 0 12px;

    font-size: 2rem;
    letter-spacing: 0.04em;

    color: var(--gold-light);
}

.victory-subtitle {

    margin: 0 0 24px;

    color: var(--text-soft);

    font-size: 0.95rem;

    line-height: 1.4;
}

.victory-stats {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    margin-bottom: 28px;
}

.victory-souls {

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(199, 167, 106, 0.08);

    color: var(--gold-light);

    font-weight: 600;
}

.victory-souls-icon {

    font-size: 1.1em;
}

.victory-continue-button {

    padding: 12px 32px;

    border: 1px solid var(--violet-light);
    border-radius: 999px;

    background: rgba(140, 85, 255, 0.14);

    color: var(--text-main);

    cursor: pointer;

    font-size: 1rem;
    font-weight: 600;

    transition:
        transform var(--transition-fast),
        background var(--transition-fast);
}

.victory-continue-button:hover {

    transform: translateY(-2px);

    background: rgba(140, 85, 255, 0.24);
}


@media (max-width: 480px) {

    .victory-panel {

        padding: 28px 16px;
    }

    .victory-title {

        font-size: 1.6rem;
    }

}


/* =========================================================
   ÉCRAN DE DÉFAITE
   ========================================================= */

#defeat-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(200, 40, 55, 0.18),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#defeat-screen.hidden {

    display: none;
}

.defeat-panel {

    width: 100%;
    max-width: 560px;

    /* CORRECTIF — voir .rewards-panel : un panneau centré plus
       grand que l'écran restait inatteignable en haut au défilement. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 40px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.defeat-title {

    margin: 6px 0 12px;

    font-size: 2rem;
    letter-spacing: 0.04em;

    color: #e85a62;
}

.defeat-subtitle {

    margin: 0 0 24px;

    color: var(--text-soft);

    font-size: 0.95rem;

    line-height: 1.4;
}

.defeat-stats {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    margin-bottom: 28px;
}

.defeat-stat {

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(200, 40, 55, 0.08);

    color: var(--text-main);

    font-weight: 600;
}

.defeat-stat-icon {

    font-size: 1.1em;
}

.defeat-restart-button {

    padding: 12px 32px;

    border: 1px solid #e85a62;
    border-radius: 999px;

    background: rgba(200, 40, 55, 0.14);

    color: var(--text-main);

    cursor: pointer;

    font-size: 1rem;
    font-weight: 600;

    transition:
        transform var(--transition-fast),
        background var(--transition-fast);
}

.defeat-restart-button:hover {

    transform: translateY(-2px);

    background: rgba(200, 40, 55, 0.24);
}


@media (max-width: 480px) {

    .defeat-panel {

        padding: 28px 16px;
    }

    .defeat-title {

        font-size: 1.6rem;
    }

}


@media (max-width: 480px) {

    .rewards-panel {

        padding: 24px 16px;
    }

    .rewards-choices {

        grid-template-columns: 1fr;
    }
}


/* =========================================================
   ÉCRAN DU MARCHAND
   ========================================================= */

#shop-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(199, 167, 106, 0.12),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#shop-screen.hidden {

    display: none;
}

.shop-panel {

    width: 100%;
    max-width: 820px;

    /* CORRECTIF — voir .rewards-panel : un panneau centré plus
       grand que l'écran restait inatteignable en haut au défilement. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 28px 24px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.shop-header {

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    margin-bottom: 22px;

    padding-bottom: 18px;

    border-bottom: 1px solid var(--border-dark);
}

.shop-title {

    margin: 4px 0 0;

    font-size: 1.5rem;
    letter-spacing: 0.03em;

    color: var(--text-main);
}

.shop-gold {

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(199, 167, 106, 0.08);

    color: var(--gold-light);

    font-weight: 600;

    white-space: nowrap;
}

/*
   CORRECTIF — la liste d'articles poussait toute la page à
   défiler, si bien qu'une carte du bas se retrouvait parfois
   pile calée contre le bord haut de l'écran (une fois le
   titre/l'or défilés hors champ) : les hampes des lettres
   accentuées (é, à...) de la ligne du haut se faisaient alors
   couper par ce bord, donnant l'impression d'un texte tronqué.
   Hauteur maximale + défilement interne à la liste : le titre et
   le bouton "Quitter la boutique" restent toujours visibles, et
   le petit padding vertical évite qu'une ligne de texte tombe
   jamais pile sur le bord de CE défilement-ci.
*/

.shop-stock {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));

    gap: 14px;

    max-height: 55vh;

    overflow-y: auto;

    overscroll-behavior: contain;

    padding: 6px 4px;

    margin-bottom: 24px;

    scrollbar-width: thin;
}

.shop-empty {

    grid-column: 1 / -1;

    padding: 24px 0;

    text-align: center;

    color: var(--text-muted);

    font-style: italic;
}

.shop-item {

    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 16px;

    border: 1px solid var(--shop-item-color, var(--border-dark));
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.12)
        );
}

.shop-item-header {

    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-item-icon {

    font-size: 1.5rem;
}

.shop-item-title {

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-item-name {

    font-weight: 700;

    color: var(--text-main);

    font-size: 0.96rem;
}

.shop-item-tag {

    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--shop-item-color, var(--text-soft));
}

.shop-item-description {

    flex: 1;

    font-size: 0.85rem;
    line-height: 1.4;

    color: var(--text-soft);
}

.shop-item-footer {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.shop-item-price {

    display: inline-flex;
    align-items: center;
    gap: 4px;

    font-weight: 600;

    color: var(--gold-light);

    font-size: 0.9rem;
}

.shop-buy-button {

    padding: 8px 16px;

    border: 1px solid var(--gold);
    border-radius: 999px;

    background: rgba(199, 167, 106, 0.12);

    color: var(--gold-light);

    font-weight: 600;

    font-size: 0.85rem;

    cursor: pointer;

    transition:
        background var(--transition-fast),
        transform var(--transition-fast);
}

.shop-buy-button:hover:not(:disabled) {

    background: rgba(199, 167, 106, 0.24);

    transform: translateY(-1px);
}

.shop-buy-button:disabled {

    opacity: 0.4;

    cursor: not-allowed;
}

.shop-leave-button {

    display: block;

    margin: 0 auto;

    padding: 10px 26px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: transparent;

    color: var(--text-soft);

    cursor: pointer;

    font-size: 0.9rem;

    transition:
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.shop-leave-button:hover {

    border-color: var(--text-soft);

    color: var(--text-main);
}

@media (max-width: 480px) {

    .shop-panel {

        padding: 20px 16px;
    }

    .shop-stock {

        grid-template-columns: 1fr;
    }

    .shop-header {

        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   ÉCRAN DU FEU DE CAMP
   ========================================================= */

#rest-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(255, 140, 60, 0.14),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#rest-screen.hidden {

    display: none;
}

.rest-panel {

    width: 100%;
    max-width: 640px;

    /* CORRECTIF — feu de camp inatteignable en haut au défilement
       dès que la liste de compétences/bonus de voie améliorables
       devient plus haute que l'écran (loin dans une run) : le
       conteneur parent (#rest-screen) centre son contenu via
       align-items/justify-content sur un display:flex, ce qui
       rend la partie qui dépasse AU-DESSUS du centre totalement
       inatteignable au scroll (bug connu du centrage flex avec
       overflow) — impossible de faire défiler jusqu'à "Se reposer",
       toujours tout en haut de la liste. Le panneau se limite
       maintenant à sa propre hauteur (85vh) et défile lui-même,
       comme .combat-stats-panel-inner / .soul-merchant-panel. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 32px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rest-title {

    margin: 6px 0 8px;

    font-size: 1.5rem;
    letter-spacing: 0.03em;

    color: var(--text-main);
}

.rest-subtitle {

    margin: 0 0 22px;

    color: var(--text-soft);

    font-size: 0.9rem;
}

.rest-options {

    display: flex;
    flex-direction: column;

    gap: 12px;
}

.rest-option {

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.12)
        );

    color: var(--text-main);

    text-align: left;

    cursor: pointer;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast);
}

.rest-option:hover {

    transform: translateY(-2px);

    border-color: var(--gold);
}

.rest-option-icon {

    font-size: 1.4rem;

    flex-shrink: 0;
}

.rest-option-body {

    flex: 1;
}

/* CORRECTIF — titre et description mal cadrés ("(Niv. 1 → 2)"
   coupé en deux lignes, la fin du titre collée au début de la
   description sur la même ligne visuelle) : ce sont des <span>
   (Game.js), donc inline par défaut — rien ne les empêchait de
   s'enchaîner comme un seul paragraphe continu, et margin-top
   ci-dessous n'avait AUCUN effet sur un élément inline. */
.rest-option-name {

    display: block;

    font-weight: 700;

    font-size: 0.95rem;
}

.rest-option-description {

    display: block;

    font-size: 0.82rem;

    color: var(--text-soft);

    margin-top: 2px;
}

.rest-empty {

    padding: 12px 0;

    color: var(--text-muted);

    font-style: italic;

    font-size: 0.85rem;
}


/* =========================================================
   ÉCRAN D'ÉVÉNEMENT
   ========================================================= */

#event-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(140, 85, 255, 0.10),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#event-screen.hidden {

    display: none;
}

.event-panel {

    width: 100%;
    max-width: 640px;

    /* CORRECTIF — voir .rewards-panel/.rest-panel : un panneau
       centré plus grand que l'écran restait inatteignable en
       haut au défilement. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 32px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.event-title {

    margin: 6px 0 12px;

    font-size: 1.5rem;
    letter-spacing: 0.03em;

    color: var(--text-main);
}

.event-description {

    margin: 0 0 22px;

    color: var(--text-soft);

    font-size: 0.9rem;

    line-height: 1.5;
}

.event-choices {

    display: flex;
    flex-direction: column;

    gap: 12px;
}

.event-choice {

    padding: 14px 18px;

    border: 1px solid var(--border-dark);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.12)
        );

    color: var(--text-main);

    text-align: left;

    cursor: pointer;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast);
}

.event-choice:hover:not(:disabled) {

    transform: translateY(-2px);

    border-color: var(--violet-light);
}

.event-choice:disabled {

    opacity: 0.4;

    cursor: not-allowed;
}

.event-choice-text {

    font-weight: 700;

    font-size: 0.95rem;
}

.event-choice-description {

    font-size: 0.82rem;

    color: var(--text-soft);

    margin-top: 4px;
}

.event-choice-locked {

    font-size: 0.75rem;

    color: var(--text-muted);

    margin-top: 4px;

    font-style: italic;
}


/* =========================================================
   ÉCRAN DE LA PIERRE DE RITUEL
   ========================================================= */

#ritual-screen {

    position: fixed;
    inset: 0;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: radial-gradient(
        circle at 50% 20%,
        rgba(120, 200, 220, 0.12),
        var(--bg-main) 65%
    );

    overflow-y: auto;
}

#ritual-screen.hidden {

    display: none;
}

.ritual-panel {

    width: 100%;
    max-width: 720px;

    /* CORRECTIF — voir .rewards-panel/.rest-panel : un panneau
       centré plus grand que l'écran restait inatteignable en
       haut au défilement. */
    max-height: 85vh;
    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 32px 24px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ritual-title {

    margin: 6px 0 8px;

    font-size: 1.5rem;
    letter-spacing: 0.03em;

    color: var(--text-main);
}

.ritual-subtitle {

    margin: 0 0 22px;

    color: var(--text-soft);

    font-size: 0.9rem;
}

.ritual-choices {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

    gap: 14px;
}

.ritual-card {

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    padding: 18px 14px;

    border: 1px solid var(--border-dark);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.12)
        );

    color: var(--text-main);

    cursor: pointer;

    text-align: center;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.ritual-card:hover {

    transform: translateY(-3px);

    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);

    border-color: #7ac8dc;
}

.ritual-card-icon {

    font-size: 1.8rem;
}

.ritual-card-tag {

    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--text-soft);
}

.ritual-card-name {

    font-weight: 700;

    font-size: 0.98rem;
}

.ritual-card-description {

    font-size: 0.82rem;

    color: var(--text-soft);

    line-height: 1.35;
}

.ritual-empty {

    grid-column: 1 / -1;

    padding: 18px 0;

    color: var(--text-muted);

    font-style: italic;
}

@media (max-width: 480px) {

    .rest-panel,
    .event-panel,
    .ritual-panel {

        padding: 24px 16px;
    }

    .ritual-choices {

        grid-template-columns: 1fr;
    }
}


/* =========================================================
   ONGLET STATISTIQUES DU COMBAT
   ========================================================= */

.combat-topbar-right {

    display: flex;
    align-items: center;
    gap: 12px;
}

.combat-stats-button {

    padding: 7px 14px;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.04);

    color: var(--text-main);

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;

    cursor: pointer;

    transition:
        transform var(--transition-fast),
        background var(--transition-fast);
}

.combat-stats-button:hover {

    transform: translateY(-1px);

    background: rgba(255, 255, 255, 0.09);
}

/* Variante destructive — même base que .combat-stats-button, teinte
   rouge (cohérente avec .combat-character.low-hp) au survol pour
   signaler une action irréversible plutôt qu'un simple panneau. */
.combat-abandon-button {

    border-color: rgba(255, 70, 70, 0.3);
    color: rgba(255, 150, 150, 0.85);
}

.combat-abandon-button:hover {

    background: rgba(255, 70, 70, 0.12);
    border-color: rgba(255, 70, 70, 0.55);
    color: var(--text-main);
}

/* CORRECTIF — sur mobile, le libellé complet ("🚪 Abandonner") en
   plus de Build/Stats/TOUR ne tenait pas sur une seule ligne : le
   bouton passait à la ligne suivante et redescendait toute la
   scène (héros/monstre) d'un cran. Icône seule en dessous de
   760px (même seuil que le passage en 2 lignes du reste de la
   topbar) : les 4 éléments tiennent alors toujours sur une ligne,
   alignés avec Build. */
@media (max-width: 760px) {

    .combat-abandon-label {

        display: none;
    }

    .combat-abandon-button {

        padding-left: 10px;
        padding-right: 10px;
    }
}

#combat-stats-panel,
#player-build-panel {

    position: fixed;
    inset: 0;

    z-index: 55;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 16px;

    background: rgba(4, 4, 8, 0.72);

    backdrop-filter: blur(2px);
}

#combat-stats-panel.hidden,
#player-build-panel.hidden {

    display: none;
}

.combat-stats-panel-inner {

    width: 100%;
    max-width: 640px;
    max-height: 85vh;

    overflow-y: auto;

    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: 18px;

    padding: 22px 24px 26px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.combat-stats-panel-header {

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 18px;

    padding-bottom: 14px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.combat-stats-panel-header h3 {

    margin: 0;

    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.combat-stats-close-button {

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border-dark);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.04);

    color: var(--text-soft);

    font-size: 14px;
    line-height: 1;

    cursor: pointer;

    transition: background var(--transition-fast);
}

.combat-stats-close-button:hover {

    background: rgba(255, 255, 255, 0.1);
}

.combat-stats-section {

    margin-bottom: 22px;
}

.combat-stats-section:last-child {

    margin-bottom: 0;
}

.combat-stats-section-title {

    margin-bottom: 10px;

    color: rgba(255, 255, 255, 0.42);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.combat-stats-damage-breakdown {

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.combat-stats-empty {

    color: var(--text-muted);

    font-style: italic;
    font-size: 0.9rem;
}

.combat-stats-bar-row {

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.combat-stats-bar-label {

    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;

    font-size: 0.85rem;
}

.combat-stats-bar-name {

    color: var(--text-main);
    font-weight: 600;
}

.combat-stats-bar-value {

    color: var(--text-soft);
    font-size: 0.8rem;
    white-space: nowrap;
}

.combat-stats-bar-track {

    height: 8px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.07);

    overflow: hidden;
}

.combat-stats-bar-fill {

    height: 100%;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        rgba(240, 180, 60, 0.9),
        rgba(240, 120, 60, 0.9)
    );
}

.combat-stats-grid {

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
}

.combat-stats-stat {

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 8px 12px;

    border: 1px solid var(--border-dark);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.03);
}

.combat-stats-stat-label {

    color: var(--text-soft);
    font-size: 0.78rem;
}

.combat-stats-stat-value {

    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;

    font-variant-numeric: tabular-nums;
}


@media (max-width: 480px) {

    .combat-stats-panel-inner {

        padding: 18px 16px 20px;
    }

    .combat-stats-grid {

        grid-template-columns: 1fr;
    }

    .combat-stats-button {

        padding: 6px 10px;

        font-size: 11px;
    }
}


/* =========================================================
   MON BUILD — dons de voie, passifs hybrides et compétences
   possédés (#player-build-panel, Index.html). Réutilise
   #combat-stats-panel / .combat-stats-panel-inner / .combat-
   stats-section pour l'ossature (fond, header, sections) —
   seul le contenu ci-dessous est spécifique.
   ========================================================= */

.build-path-header {

    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 20px;
    padding: 14px 16px;

    border: 1px solid var(--build-path-color, var(--border-dark));
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--build-path-color, var(--border-dark)) 14%, transparent),
            rgba(0, 0, 0, 0.15)
        );
}

.build-path-header-icon {

    flex-shrink: 0;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.06);

    font-size: 22px;
}

.build-path-header-name {

    margin: 0 0 4px;

    font-size: 1.05rem;
    letter-spacing: 0.02em;

    color: var(--build-path-color, var(--text-main));
}

.build-path-header-gift {

    margin: 0;

    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

.build-path-header-gift strong {

    color: var(--text-main);
}

.build-item-list {

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.build-item-card {

    padding: 10px 12px;

    border: 1px solid var(--border-dark);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.03);
}

.build-item-header {

    display: flex;
    align-items: baseline;
    gap: 8px;

    margin-bottom: 4px;
}

.build-item-icon {

    font-size: 0.9rem;
}

.build-item-name {

    flex: 1 1 auto;

    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
}

.build-item-level {

    flex-shrink: 0;

    color: var(--gold-light);
    font-size: 0.72rem;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
}

.build-item-cost {

    flex-shrink: 0;

    color: var(--text-soft);
    font-size: 0.72rem;
}

.build-item-desc {

    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

.build-item-empty {

    padding: 10px 12px;

    color: var(--text-soft);
    font-style: italic;
    font-size: 0.82rem;
}

@media (max-width: 480px) {

    .build-path-header {

        padding: 12px;
        gap: 10px;
    }

    .build-path-header-icon {

        width: 36px;
        height: 36px;

        font-size: 18px;
    }
}


/* =========================================================
   CODEX DES COMPÉTENCES
   =========================================================
   Panneau superposé listant TOUTES les compétences du jeu
   (voir renderSkillsCodex(), Game.js), groupées par Voie puis
   par Hybrides — même famille visuelle que "Mon build"
   (.build-item-*) ci-dessus, avec un détail par palier en plus.
   ========================================================= */

.skills-codex-list {

    display: flex;
    flex-direction: column;
    gap: 18px;
}

.skills-codex-section-title {

    margin-bottom: 8px;

    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 6px;
}

.skills-codex-section {

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skills-codex-card {

    padding: 10px 12px;

    border: 1px solid var(--border-dark);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.03);
}

.skills-codex-card-header {

    display: flex;
    align-items: baseline;
    gap: 8px;

    margin-bottom: 4px;
}

.skills-codex-card-icon {

    font-size: 0.85rem;
}

.skills-codex-card-name {

    flex: 1 1 auto;

    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
}

.skills-codex-card-cost {

    flex-shrink: 0;

    color: var(--text-soft);
    font-size: 0.72rem;
}

.skills-codex-card-description {

    margin-bottom: 8px;

    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

.skills-codex-card-levels {

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skills-codex-level-row {

    display: flex;
    align-items: baseline;
    gap: 8px;

    padding: 4px 8px;

    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.skills-codex-level-label {

    flex-shrink: 0;

    color: var(--gold-light);
    font-size: 0.7rem;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
}

.skills-codex-level-detail {

    color: var(--text-soft);
    font-size: 0.74rem;
    line-height: 1.4;
}

@media (max-width: 480px) {

    .skills-codex-level-row {

        flex-direction: column;
        gap: 2px;
    }

}


/* =========================================================
   ONGLETS DU CODEX (compétences / bonus de voie)
   voir switchCodexTab(), Js/Game.js
   ========================================================= */

.skills-codex-tabs {

    display: flex;
    gap: 8px;

    margin-bottom: 14px;
}

.skills-codex-tab-button {

    flex: 1 1 0;

    padding: 8px 10px;

    border: 1px solid var(--border-dark);
    border-radius: 8px;

    background: rgba(255, 255, 255, 0.03);

    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
}

.skills-codex-tab-button.active {

    border-color: var(--violet-light);

    background: rgba(140, 85, 255, 0.16);

    color: var(--text-main);
}

.skills-codex-card-rarity {

    flex-shrink: 0;

    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.skills-codex-card-flavor {

    margin-top: 6px;

    color: var(--text-soft);
    font-size: 0.72rem;
    font-style: italic;
    line-height: 1.4;

    opacity: 0.8;
}


/* =========================================================
   DÉTAIL D'UN ÉTAT (POISON / BUFF / DÉBUFF / EFFET)
   Popup ouverte au clic sur une puce .status-chip, héros ou
   ennemi — voir buildCombatStatusChipsHtml() et le clic
   délégué de initializeGame(), Js/Game.js.
   ========================================================= */

.status-detail-overlay {

    position: fixed;

    inset: 0;

    z-index: 500;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(4, 4, 8, 0.72);

    backdrop-filter: blur(2px);

    animation:
        status-detail-fade-in
        var(--transition-fast);
}


@keyframes status-detail-fade-in {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


.status-detail-card {

    position: relative;

    width: 100%;

    max-width: 340px;

    padding: 28px 24px 24px;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 10px;

    text-align: center;

    border-radius: 14px;

    border:
        1px solid
        var(--border-dark);

    background: var(--panel-bg);

    box-shadow:
        0 18px 40px
        rgba(0, 0, 0, 0.45);
}


.status-detail-close {

    position: absolute;

    top: 10px;

    right: 10px;

    width: 26px;

    height: 26px;

    display: flex;

    align-items: center;

    justify-content: center;

    appearance: none;
    -webkit-appearance: none;

    border:
        1px solid
        var(--border-dark);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.05);

    color: var(--text-soft);

    font-size: 12px;

    line-height: 1;

    cursor: pointer;

    transition: background var(--transition-fast),
                color var(--transition-fast);
}


.status-detail-close:hover,
.status-detail-close:focus-visible {

    background:
        rgba(255, 255, 255, 0.14);

    color: var(--text-main);
}


.status-detail-icon {

    font-size: 34px;

    line-height: 1;
}


.status-detail-name {

    font-size: 16px;

    font-weight: 800;

    color: var(--text-main);
}


.status-detail-description {

    font-size: 12.5px;

    line-height: 1.5;

    color: var(--text-soft);

    max-width: 32ch;
}


/* =========================================================
   PROFONDEURS (sélecteur, hub)
   ========================================================= */

.depth-selector {

    width: 100%;

    max-width: 700px;

    margin: 18px auto 0;

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 10px;
}


.depth-button {

    padding: 9px 18px;

    border-radius: 999px;

    border: 1px solid var(--border-dark);

    background: rgba(15, 12, 22, 0.75);

    color: var(--text-soft);

    font-size: 12.5px;

    font-weight: 700;

    letter-spacing: 0.3px;

    cursor: pointer;

    transition: var(--transition-fast);
}


.depth-button:hover {

    border-color: rgba(150, 125, 255, 0.5);

    color: var(--text-main);

    transform: translateY(-2px);
}


.depth-button.selected {

    border-color: var(--violet-light);

    background:
        linear-gradient(
            135deg,
            rgba(140, 85, 255, 0.35),
            rgba(80, 45, 160, 0.35)
        );

    color: var(--text-main);

    box-shadow: 0 0 18px rgba(140, 85, 255, 0.35);
}


/* =========================================================
   MARCHAND D'ÂME
   ========================================================= */

.open-soul-merchant-button {

    padding: 12px 26px;

    border-radius: 12px;

    border: 1px solid rgba(145, 94, 255, 0.4);

    background: rgba(21, 16, 37, 0.85);

    color: var(--violet-light);

    font-size: 13.5px;

    font-weight: 800;

    letter-spacing: 0.4px;

    cursor: pointer;

    transition: var(--transition-fast);
}


.open-soul-merchant-button:hover {

    border-color: rgba(145, 94, 255, 0.75);

    box-shadow: 0 0 22px rgba(120, 70, 220, 0.3);

    transform: translateY(-2px);
}


.soul-merchant-modal {

    position: fixed;

    inset: 0;

    z-index: 500;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: rgba(3, 4, 7, 0.82);

    backdrop-filter: blur(4px);
}


.soul-merchant-panel {

    width: min(720px, 100%);

    max-height: 85vh;

    overflow-y: auto;

    padding: 26px;

    border-radius: 18px;

    border: 1px solid rgba(145, 94, 255, 0.35);

    background:
        linear-gradient(
            160deg,
            rgba(21, 16, 37, 0.97),
            rgba(8, 9, 15, 0.97)
        );

    box-shadow:
        0 0 60px rgba(60, 30, 110, 0.35),
        inset 0 0 30px rgba(104, 51, 190, 0.06);
}


.soul-merchant-header {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 14px;
}


.soul-merchant-title {

    flex: 1;

    font-size: 20px;

    font-weight: 800;

    color: var(--text-main);
}


.soul-merchant-souls {

    min-width: unset;

    padding: 8px 14px;
}


.close-soul-merchant-button {

    width: 34px;
    height: 34px;

    border-radius: 50%;

    border: 1px solid var(--border-dark);

    background: rgba(255, 255, 255, 0.05);

    color: var(--text-soft);

    font-size: 15px;

    cursor: pointer;

    transition: var(--transition-fast);
}


.close-soul-merchant-button:hover {

    color: var(--text-main);

    border-color: rgba(255, 255, 255, 0.3);
}


.soul-merchant-hint {

    margin-bottom: 18px;

    font-size: 12.5px;

    line-height: 1.5;

    color: var(--text-muted);
}


/* Avertissement — les déblocages du Marchand d'âme ne
   s'appliquent qu'en Fosse des Mariannes : mis en avant (fond +
   bordure teintés, même rouge que .combat-abandon-button) pour
   ne pas passer inaperçu à côté du texte neutre ci-dessus. */
.soul-merchant-warning {

    margin: -6px 0 18px;

    padding: 10px 12px;

    border: 1px solid rgba(255, 70, 70, 0.3);
    border-radius: 8px;

    background: rgba(255, 70, 70, 0.08);

    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;

    color: rgba(255, 170, 170, 0.95);
}


.soul-merchant-owned-summary {

    margin: -6px 0 18px;

    padding: 10px 12px;

    border: 1px solid rgba(120, 220, 150, 0.35);
    border-radius: 8px;

    background: rgba(70, 180, 110, 0.08);
}


.soul-merchant-owned-summary-title {

    margin-bottom: 8px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    color: rgba(140, 230, 170, 0.9);
}


.soul-merchant-owned-list {

    display: flex;
    flex-direction: column;
    gap: 6px;
}


.soul-merchant-equipped-badge {

    font-size: 12.5px;
    font-weight: 800;

    color: rgba(200, 245, 215, 0.95);
}


.soul-merchant-reserve-hint {

    font-size: 11px;
    line-height: 1.4;

    color: var(--text-muted);
}


.soul-merchant-offers {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.soul-merchant-offer {

    position: relative;

    padding: 16px;

    border-radius: 12px;

    border: 1px solid var(--border-dark);

    background: rgba(15, 12, 22, 0.75);

    color: var(--text-main);

    text-align: left;

    cursor: pointer;

    display: flex;

    flex-direction: column;

    gap: 6px;

    transition: var(--transition-fast);
}


.soul-merchant-offer:hover:not(:disabled) {

    border-color: rgba(150, 125, 255, 0.5);

    transform: translateY(-2px);
}


.soul-merchant-offer.owned {

    cursor: default;

    border-color: rgba(120, 220, 150, 0.55);

    background:
        linear-gradient(
            135deg,
            rgba(70, 180, 110, 0.22),
            rgba(30, 90, 55, 0.22)
        );

    box-shadow: 0 0 20px rgba(90, 200, 130, 0.25);
}


.soul-merchant-offer.owned .soul-merchant-offer-cost {

    color: rgba(140, 230, 170, 0.9);
}


.soul-merchant-offer.in-reserve {

    border-color: rgba(150, 125, 255, 0.4);

    background: rgba(90, 60, 160, 0.14);
}


.soul-merchant-offer.in-reserve .soul-merchant-offer-cost {

    color: rgba(190, 165, 255, 0.95);
}


.soul-merchant-offer.unaffordable {

    opacity: 0.4;

    cursor: not-allowed;
}


.soul-merchant-offer-name {

    font-size: 13.5px;

    font-weight: 800;
}


.soul-merchant-offer-description {

    font-size: 11.5px;

    line-height: 1.4;

    color: var(--text-soft);
}


.soul-merchant-offer-cost {

    align-self: flex-end;

    font-size: 12px;

    font-weight: 800;

    color: #9c63ff;
}


/* =========================================================
   POTIONS (combat)
   ========================================================= */

.combat-potions {

    width: 100%;

    margin-top: 10px;

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;
}


.combat-potion-button {

    min-height: 58px;

    padding: 9px 12px;

    display: flex;

    align-items: center;

    gap: 10px;

    border-radius: 10px;

    border: 1px solid rgba(255, 200, 70, 0.3);

    background: rgba(15, 12, 22, 0.75);

    color: var(--text-main);

    text-align: left;

    cursor: pointer;

    transition: var(--transition-fast);
}


.combat-potion-button:hover:not(:disabled) {

    border-color: rgba(255, 200, 70, 0.6);

    transform: translateY(-2px);
}


.combat-potion-button:disabled {

    opacity: 0.35;

    cursor: not-allowed;

    transform: none;
}


.combat-potion-icon {

    font-size: 20px;
}


.combat-potion-text {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 2px;
}


.combat-potion-text strong {

    font-size: 11.5px;

    font-weight: 800;
}


.combat-potion-text small {

    font-size: 8.5px;

    line-height: 1.3;

    color: var(--text-muted);
}


.combat-potion-count {

    font-size: 11px;

    font-weight: 800;

    color: rgba(255, 200, 70, 0.85);
}


@media (max-width: 640px) {

    .soul-merchant-offers {

        grid-template-columns: 1fr;
    }


    .combat-potions {

        grid-template-columns: 1fr;
    }
}


/* =========================================================
   FOSSE DES MARIANNES (hub : boutons secondaires, run sans
   fin, records)
   ========================================================= */

.hub-secondary-buttons {

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 12px;

    margin-bottom: 4px;
}


.start-endless-run-button {

    width: min(470px, 90vw);

    min-height: 62px;

    padding: 10px 25px;

    position: relative;

    cursor: pointer;

    border: 1px solid rgba(88, 176, 214, 0.55);

    background:
        linear-gradient(
            180deg,
            rgba(15, 40, 48, 0.95),
            rgba(9, 16, 20, 0.98)
        );

    color: #dff5fb;

    box-shadow:
        inset 0 0 25px rgba(40, 140, 170, 0.14),
        0 8px 25px rgba(0, 0, 0, 0.45);

    font-family: Georgia, "Times New Roman", serif;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
}


.start-endless-run-button:not(:disabled):hover {

    transform: translateY(-3px);

    border-color: rgba(120, 210, 240, 0.95);

    box-shadow:
        inset 0 0 35px rgba(40, 140, 170, 0.2),
        0 10px 35px rgba(0, 0, 0, 0.55),
        0 0 25px rgba(60, 170, 210, 0.25);
}


.start-endless-run-button:not(:disabled):active {

    transform: translateY(0);
}


.start-endless-run-button:disabled {

    cursor: not-allowed;

    opacity: 0.35;
}


.endless-records-list {

    display: flex;

    flex-direction: column;

    gap: 10px;
}


.endless-records-empty {

    padding: 20px 0;

    text-align: center;

    font-size: 12.5px;

    color: var(--text-muted);
}


.endless-record-row {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 12px 16px;

    border-radius: 12px;

    border: 1px solid var(--border-dark);

    background: rgba(15, 12, 22, 0.75);
}


.endless-record-row.best {

    border-color: rgba(199, 167, 106, 0.55);

    background:
        linear-gradient(
            135deg,
            rgba(199, 167, 106, 0.16),
            rgba(90, 70, 30, 0.16)
        );

    box-shadow: 0 0 18px rgba(199, 167, 106, 0.2);
}


.endless-record-rank {

    min-width: 32px;

    font-size: 16px;

    font-weight: 800;

    text-align: center;

    color: var(--gold-light);
}


.endless-record-main {

    flex: 1;

    min-width: 0;
}


.endless-record-path {

    font-size: 13px;

    font-weight: 800;
}


.endless-record-date {

    font-size: 10.5px;

    color: var(--text-muted);
}


.endless-record-stats {

    display: flex;

    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 10px;

    font-size: 11px;

    color: var(--text-soft);

    font-variant-numeric: tabular-nums;
}


@media (max-width: 640px) {

    .endless-record-row {

        flex-wrap: wrap;
    }

    .endless-record-stats {

        justify-content: flex-start;

        width: 100%;
    }
}


/* =========================================================
   CLASSEMENT EN LIGNE — PSEUDO + TITRES DE SECTION
   (#endless-records-modal, Index.html)
   ========================================================= */

.leaderboard-name-row {

    display: flex;

    gap: 8px;

    margin-bottom: 18px;
}


.leaderboard-name-input {

    flex: 1;

    min-width: 0;

    padding: 9px 12px;

    border-radius: 10px;

    border: 1px solid var(--border-dark);

    background: rgba(15, 12, 22, 0.75);

    color: var(--text-main);

    font-size: 13px;
}


.leaderboard-name-input:focus {

    outline: none;

    border-color: rgba(199, 167, 106, 0.55);
}


.leaderboard-name-save-button {

    padding: 9px 16px;

    border-radius: 10px;

    border: 1px solid var(--border-dark);

    background: rgba(255, 255, 255, 0.06);

    color: var(--text-main);

    font-size: 12.5px;

    font-weight: 700;

    cursor: pointer;

    transition: background var(--transition-fast);
}


.leaderboard-name-save-button:hover {

    background: rgba(255, 255, 255, 0.12);
}


.endless-records-section-title {

    margin: 18px 0 10px;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.6px;

    text-transform: uppercase;

    color: var(--text-muted);
}


.endless-records-section-title:first-of-type {

    margin-top: 0;
}


/* =========================================================
   PANNEAU LATÉRAL — PROFONDEURS & FOSSE DES MARIANNES
   ========================================================= */

.game-info-overlay {

    position: fixed;

    inset: 0;

    z-index: 550;

    background: rgba(3, 4, 7, 0.6);
}


.game-info-panel {

    position: fixed;

    top: 0;

    right: 0;

    bottom: 0;

    z-index: 560;

    width: min(420px, 92vw);

    display: flex;

    flex-direction: column;

    border-left: 1px solid rgba(145, 94, 255, 0.35);

    background:
        linear-gradient(
            160deg,
            rgba(21, 16, 37, 0.98),
            rgba(8, 9, 15, 0.98)
        );

    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);

    transform: translateX(100%);

    transition: transform 0.28s ease;
}


.game-info-panel.open {

    transform: translateX(0);
}


.game-info-header {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 22px 22px 16px;

    border-bottom: 1px solid var(--border-dark);
}


.game-info-title {

    flex: 1;

    font-size: 17px;

    font-weight: 800;

    color: var(--text-main);
}


.game-info-body {

    flex: 1;

    overflow-y: auto;

    padding: 20px 22px 30px;

    display: flex;

    flex-direction: column;

    gap: 26px;
}


.game-info-section-title {

    margin-bottom: 10px;

    font-size: 14px;

    font-weight: 800;

    color: var(--text-main);
}


.game-info-section-intro {

    margin-bottom: 14px;

    font-size: 12px;

    line-height: 1.55;

    color: var(--text-soft);
}


.game-info-tiers {

    display: flex;

    flex-direction: column;

    gap: 8px;
}


.game-info-tier {

    padding: 10px 14px;

    border-radius: 10px;

    border: 1px solid var(--border-dark);

    background: rgba(15, 12, 22, 0.6);

    font-size: 11.5px;
}


.game-info-tier strong {

    display: block;

    margin-bottom: 4px;

    font-size: 12px;

    color: var(--violet-light);
}


.game-info-tier ul {

    margin: 0;

    padding-left: 18px;

    color: var(--text-soft);

    line-height: 1.5;
}


.game-info-tier-undefined {

    opacity: 0.5;
}


.game-info-tier-undefined span {

    color: var(--text-muted);

    font-style: italic;
}


.game-info-list {

    margin: 0;

    padding-left: 18px;

    display: flex;

    flex-direction: column;

    gap: 8px;

    font-size: 12px;

    line-height: 1.5;

    color: var(--text-soft);
}


@media (max-width: 640px) {

    .game-info-panel {

        width: 100vw;
    }
}


/* =========================================================
   BANDEAU — STATISTIQUE ALÉATOIRE OBTENUE (événements)
   ========================================================= */

/* Bandeau temporaire (pas un nouvel écran) : révèle quelle
   statistique un choix d'événement "+5 % à une statistique
   aléatoire" vient d'accorder, sans retarder ni bloquer le
   retour à la carte/au combat qui suit. */

.random-stat-toast {

    position: fixed;

    top: 16px;
    left: 50%;

    transform: translate(-50%, -12px);

    z-index: 200;

    display: flex;
    align-items: center;
    gap: 10px;

    max-width: calc(100vw - 32px);

    padding: 12px 18px;

    border: 1px solid var(--violet-light);
    border-radius: 999px;

    background: var(--panel-bg);
    backdrop-filter: blur(6px);

    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);

    color: var(--text-main);
    font-size: 13px;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity var(--transition-normal),
        transform var(--transition-normal);
}

.random-stat-toast.visible {

    opacity: 1;

    transform: translate(-50%, 0);
}

.random-stat-toast-icon {

    font-size: 18px;
    flex-shrink: 0;
}

.random-stat-toast-text strong {

    color: var(--gold-light);
}
