        /* ── Reset des tailles globales de app.css qui réduisaient le contenu ── */
        body.gm-tools-page {
            background: var(--bg-void, #0a0806);
            color: var(--text-parchment, #d4b896);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            font-size: 16px;
            line-height: 1.5;
        }
        /* Force taille MJ pour tous les inputs/buttons/selects à l'intérieur */
        .gm-page input, .gm-page select, .gm-page textarea, .gm-page button {
            font-size: 15px;
            font-family: inherit;
        }

        /* ── Barre campagne ── */
        .gm-camp-bar {
            display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
            padding: 14px 22px;
            background: rgba(201,168,76,.07);
            border-bottom: 1px solid rgba(201,168,76,.25);
            flex-shrink: 0;
        }
        .gm-camp-label {
            font-family: 'Cinzel', serif; font-size: 15px;
            color: var(--gold, #c9a84c); font-weight: 700;
            white-space: nowrap;
        }
        .gm-camp-select {
            flex: 1; min-width: 240px; max-width: 480px;
            background: rgba(0,0,0,.4);
            border: 1px solid rgba(201,168,76,.4);
            border-radius: 8px;
            color: var(--text-parchment, #d4b896);
            font-size: 16px !important; padding: 10px 14px;
        }
        .gm-camp-select option { background: #1a1208; }
        .gm-camp-info { font-size: 14px; color: var(--text-muted, #a89878); flex: 1; min-width: 140px; }

        /* ── Ornement ── */
        .gm-ornament { display: flex; align-items: center; gap: 8px; padding: 0 22px; height: 22px; flex-shrink: 0; }
        .gm-orn-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(201,168,76,.4), transparent); }
        .gm-orn-gem { color: var(--gold, #c9a84c); font-size: 10px; }

        /* ── Barre d'onglets de rencontres ── */
        .enc-tabs-bar {
            display: flex; align-items: center; gap: 4px;
            padding: 0 22px; min-height: 46px;
            background: linear-gradient(180deg, rgba(14,27,46,.55), transparent);
            border-bottom: 1px solid rgba(201,168,76,.25);
            overflow-x: auto; scrollbar-width: none;
            flex-shrink: 0;
        }
        .enc-tabs-bar::-webkit-scrollbar { display: none; }
        .enc-tab {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 10px 18px; cursor: pointer; white-space: nowrap;
            border: 1px solid transparent; border-bottom: none;
            border-radius: 8px 8px 0 0;
            background: rgba(201,168,76,.08);
            color: var(--text-muted, #a89878);
            font-family: 'Cinzel', serif; font-size: 14px;
            letter-spacing: .03em;
            transition: all .14s; position: relative; top: 1px;
        }
        .enc-tab:hover { background: rgba(201,168,76,.18); color: var(--text-parchment, #d4b896); }
        .enc-tab.active {
            background: var(--bg-panel, #13100c);
            border-color: var(--border-gold, #c9a84c);
            color: var(--gold-light, #e0c870);
        }
        .enc-tab-tools { display: inline-flex; gap: 4px; margin-left: 4px; padding-left: 7px; border-left: 1px solid rgba(201,168,76,.3); }
        .enc-tab-tools span { cursor: pointer; opacity: .55; font-size: 13px; padding: 1px 4px; border-radius: 3px; transition: all .12s; }
        .enc-tab-tools span:hover { opacity: 1; background: rgba(201,168,76,.2); color: var(--gold, #c9a84c); }
        .enc-tab-tools span.danger:hover { background: rgba(180,60,60,.3); color: #e09090; }
        .enc-tab-add {
            flex-shrink: 0; align-self: center; margin-left: 6px;
            padding: 7px 14px; border-radius: 6px; cursor: pointer;
            border: 1px dashed var(--border-gold, #c9a84c); background: transparent;
            color: var(--gold, #c9a84c); font-size: 13px; font-family: 'Cinzel', serif;
            transition: all .14s;
        }
        .enc-tab-add:hover { background: rgba(201,168,76,.18); }

        /* ── Layout main ── */
        .gm-main {
            display: grid; grid-template-columns: 3fr 1fr;
            flex: 1; min-height: 0; overflow: hidden;
        }
        @media (max-width: 920px) { .gm-main { grid-template-columns: 1fr; } }

        .gm-panel {
            display: flex; flex-direction: column;
            border-right: 1px solid rgba(201,168,76,.18);
            overflow: hidden;
        }
        .gm-panel:last-child { border-right: none; }
        .gm-panel-hdr {
            background: rgba(201,168,76,.06);
            border-bottom: 1px solid rgba(201,168,76,.18);
            padding: 14px 22px; display: flex; align-items: center; gap: 12px;
            flex-shrink: 0; flex-wrap: wrap;
        }
        .gm-panel-title {
            font-family: 'Cinzel', serif; font-size: 17px;
            font-weight: 700; color: var(--gold, #c9a84c);
            flex: 1; text-transform: uppercase; letter-spacing: .05em;
        }
        .gm-panel-body {
            flex: 1; overflow-y: auto; padding: 16px 22px;
            scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.4) transparent;
        }
        .gm-panel-body::-webkit-scrollbar { width: 7px; }
        .gm-panel-body::-webkit-scrollbar-thumb { background: rgba(201,168,76,.4); border-radius: 3px; }

        /* ── Boutons MJ ── */
        .gm-btn {
            padding: 9px 18px; border-radius: 8px;
            border: 1px solid rgba(201,168,76,.4);
            background: rgba(201,168,76,.08);
            color: var(--gold, #c9a84c);
            cursor: pointer; font-size: 14px !important; font-weight: 600;
            transition: all .15s; white-space: nowrap;
        }
        .gm-btn:hover { background: rgba(201,168,76,.22); border-color: var(--gold, #c9a84c); }
        .gm-btn-gold { background: var(--gold, #c9a84c); color: #0a0806; border-color: var(--gold, #c9a84c); }
        .gm-btn-gold:hover { background: #e0b858; }
        .gm-btn-sm { padding: 6px 13px; font-size: 13px !important; border-radius: 6px; }
        .gm-btn-red { border-color: rgba(180,60,60,.5); color: #e07070; }
        .gm-btn-red:hover { background: rgba(180,60,60,.22); }
        .gm-btn-green { border-color: rgba(76,175,80,.55); color: #80d080; }
        .gm-btn-green:hover { background: rgba(76,175,80,.22); }
        .gm-btn-vtt { border-color: rgba(82,196,26,.4); color: #8ed870; font-size: 12px !important; padding: 4px 8px !important; }
        .gm-btn-vtt:hover { background: rgba(82,196,26,.18); }
        .gm-btn-vtt.active { background: rgba(82,196,26,.2); border-color: rgba(82,196,26,.7); color: #52c41a; }
        .enc-tab-map { font-size: 11px; margin-left: 4px; opacity: 0.75; }

        /* ── Barre carte VTT ── */
        .enc-map-bar {
            display: flex; align-items: center; gap: 10px;
            padding: 7px 18px;
            background: rgba(82,196,26,.06);
            border-bottom: 1px solid rgba(82,196,26,.2);
            font-size: 13px;
        }
        .enc-map-bar label { color: var(--text-muted,#a89878); white-space: nowrap; }
        .enc-map-bar select {
            background: rgba(0,0,0,.35); border: 1px solid rgba(82,196,26,.4);
            color: #c8e8c0; border-radius: 6px; padding: 4px 8px; font-size: 13px; flex: 1; max-width: 300px;
        }
        .enc-map-bar .enc-map-hint {
            font-size: 11px; color: var(--text-muted,#a89878); flex: 1;
        }
        .enc-map-bar .enc-map-status {
            font-size: 11px; padding: 3px 8px; border-radius: 4px;
            background: rgba(82,196,26,.15); color: #52c41a; white-space: nowrap;
        }
        .enc-map-bar .enc-map-status.pending { background: rgba(255,152,0,.15); color: #ff9800; }
        .enc-map-bar a.enc-map-link {
            font-size: 12px; color: #8ed870; text-decoration: none;
            border: 1px solid rgba(82,196,26,.35); border-radius: 5px; padding: 3px 9px;
            white-space: nowrap;
        }
        .enc-map-bar a.enc-map-link:hover { background: rgba(82,196,26,.12); }

        /* ── Inputs MJ ── */
        .gm-inp {
            background: rgba(0,0,0,.35);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 6px;
            color: var(--text-parchment, #d4b896);
            font-size: 15px !important; padding: 8px 12px;
        }
        .gm-inp:focus { outline: none; border-color: var(--gold, #c9a84c); }
        .gm-inp-num { width: 70px; text-align: center; }
        .gm-inp-sm { padding: 6px 9px; font-size: 14px !important; }

        /* ── État vide ── */
        .gm-empty {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 12px; padding: 50px 20px; text-align: center;
            color: var(--text-muted, #a89878); font-size: 15px;
        }
        .gm-empty-icon { font-size: 48px; opacity: .6; }

        /* ── Formulaire ajout PNJ/Monstre ── */
        .npc-add-form {
            display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
            padding: 14px; margin-bottom: 16px;
            background: rgba(201,168,76,.05); border-radius: 10px;
            border: 1px solid rgba(201,168,76,.15);
        }
        .npc-add-form > span { font-size: 14px; color: var(--text-muted, #a89878); font-weight: 600; }

        /* ── Sélecteur visuel modificateur d'initiative ── */
        .mod-picker { display: inline-flex; align-items: center; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid rgba(201,168,76,.4); }
        .mod-picker-step {
            width: 32px; height: 36px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; background: rgba(0,0,0,.35);
            color: var(--gold, #c9a84c);
            font-size: 18px; font-weight: 700; border: none;
            transition: background .12s;
        }
        .mod-picker-step:hover { background: rgba(201,168,76,.25); }
        .mod-picker-val {
            min-width: 56px; height: 36px;
            display: flex; align-items: center; justify-content: center;
            background: rgba(0,0,0,.5);
            color: var(--gold-light, #e0c870);
            font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700;
            padding: 0 8px;
            border-left: 1px solid rgba(201,168,76,.25);
            border-right: 1px solid rgba(201,168,76,.25);
        }
        .mod-picker-val.zero { color: var(--text-muted, #a89878); }
        .mod-picker-val.positive { color: #80d080; }
        .mod-picker-val.negative { color: #e07070; }

        /* ── Round bar ── */
        .init-round-bar {
            display: flex; align-items: center; gap: 10px;
            margin-bottom: 16px; padding: 12px 16px;
            background: rgba(201,168,76,.08);
            border-radius: 10px; border: 1px solid rgba(201,168,76,.3);
            flex-wrap: wrap;
        }
        .init-round-lbl {
            font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700;
            color: var(--gold, #c9a84c); flex: 1; min-width: 100px;
        }

        /* ── Ligne combattant ── */
        .init-row {
            border-radius: 10px; margin-bottom: 10px;
            border: 1px solid rgba(255,255,255,.08);
            background: rgba(255,255,255,.03);
            overflow: hidden; transition: all .2s;
        }
        .init-row.current { border-color: var(--gold, #c9a84c); background: rgba(201,168,76,.1); box-shadow: 0 0 0 1px rgba(201,168,76,.2); }
        .init-row.inactive { opacity: 0.45; }
        .init-row-main { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }

        /* Case d'initiative XL */
        .init-init-box {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            min-width: 80px; flex-shrink: 0;
        }
        .init-init-val {
            font-size: 50px; font-weight: 900;
            color: var(--gold, #c9a84c);
            font-family: 'Cinzel', serif; line-height: 1;
        }
        .init-init-lbl {
            font-size: 12px; color: var(--text-muted, #a89878);
            text-transform: uppercase; letter-spacing: .05em;
        }

        .init-row-info { flex: 1; min-width: 0; }
        .init-row-name {
            font-size: 30px; font-weight: 700;
            margin-bottom: 6px;
            color: var(--text-parchment, #d4b896);
            font-family: 'Cinzel', serif; line-height: 1.1;
        }
        .init-type-badge {
            display: inline-block;
            font-size: 13px; padding: 3px 12px; border-radius: 12px;
            border: 1px solid; opacity: .9; font-weight: 700;
            letter-spacing: .03em;
        }
        .init-badge-pc { color: #80d080; border-color: rgba(128,208,128,.5); background: rgba(128,208,128,.12); }
        .init-badge-npc { color: #80b0f0; border-color: rgba(128,176,240,.5); background: rgba(128,176,240,.12); }
        .init-badge-monster { color: #f09080; border-color: rgba(240,144,128,.5); background: rgba(240,144,128,.12); }
        .init-sub {
            font-size: 14px; color: var(--text-muted, #a89878);
            margin-bottom: 8px;
        }

        /* PV */
        .init-hp-wrap { display: flex; align-items: center; gap: 10px; }
        .hp-bar-bg {
            flex: 1; height: 10px;
            background: rgba(255,255,255,.1);
            border-radius: 5px; overflow: hidden;
        }
        .hp-bar-fill { height: 100%; border-radius: 5px; transition: width .35s; }
        .hp-num {
            font-size: 17px; font-weight: 700;
            color: var(--text-parchment, #d4b896);
            white-space: nowrap; min-width: 90px; text-align: right;
            font-family: 'Cinzel', serif;
        }

        /* Contrôles à droite : 2 lignes, alignés droite */
        .init-row-btns {
            display: flex; flex-direction: column; gap: 6px;
            align-items: flex-end; flex-shrink: 0; min-width: 0;
        }
        .init-row-btns-line {
            display: flex; gap: 5px; align-items: center;
            justify-content: flex-end; flex-wrap: wrap;
        }
        .init-row-btns-line-lbl {
            font-size: 12px; color: var(--text-muted, #a89878);
            font-weight: 600; margin-right: 2px;
        }
        .init-expand-area {
            padding: 10px 14px 12px;
            border-top: 1px solid rgba(255,255,255,.07);
            background: rgba(0,0,0,.18);
            display: flex; flex-direction: column; gap: 10px;
        }

        /* Toggle activation PJ */
        .init-toggle-active {
            display: inline-flex; align-items: center; gap: 6px;
            cursor: pointer; font-size: 13px; color: var(--text-muted, #a89878);
            padding: 4px 10px; border-radius: 14px;
            border: 1px solid rgba(255,255,255,.12);
            transition: all .15s;
        }
        .init-toggle-active.active { color: #80d080; border-color: rgba(128,208,128,.4); background: rgba(128,208,128,.1); }
        .init-toggle-active.inactive { color: #b08080; border-color: rgba(176,128,128,.3); background: rgba(176,128,128,.07); }

        /* ── Modals MJ ── */
        .gm-modal-ov {
            position: fixed; inset: 0; z-index: 9900;
            background: rgba(0,0,0,.72); backdrop-filter: blur(5px);
            display: none; align-items: center; justify-content: center;
            padding: 20px;
        }
        .gm-modal-ov.open { display: flex; animation: gmFadeIn .15s ease; }
        @keyframes gmFadeIn { from{opacity:0} to{opacity:1} }
        .gm-modal-panel {
            background: var(--bg-panel, #13100c);
            border: 1px solid var(--border-gold, #c9a84c);
            border-radius: 12px;
            min-width: 320px; max-width: 480px; width: 100%;
            box-shadow: 0 12px 40px rgba(0,0,0,.75);
            display: flex; flex-direction: column; overflow: hidden;
        }
        .gm-modal-panel.danger { border-color: rgba(180,60,60,.6); }
        .gm-modal-head {
            padding: 16px 20px; border-bottom: 1px solid rgba(201,168,76,.25);
            display: flex; align-items: center; gap: 10px;
        }
        .gm-modal-icon { font-size: 20px; }
        .gm-modal-title {
            flex: 1; font-family: 'Cinzel', serif; font-size: 17px;
            font-weight: 700; color: var(--gold, #c9a84c);
        }
        .gm-modal-panel.danger .gm-modal-title { color: #e07070; }
        .gm-modal-body { padding: 18px 20px; }
        .gm-modal-label {
            display: block; font-size: 14px; color: var(--text-muted, #a89878);
            margin-bottom: 8px;
        }
        .gm-modal-message { font-size: 15px; line-height: 1.5; color: var(--text-parchment, #d4b896); }
        .gm-modal-input {
            width: 100%; background: rgba(0,0,0,.4);
            border: 1px solid rgba(201,168,76,.35); border-radius: 6px;
            color: var(--text-parchment, #d4b896);
            font-size: 16px; padding: 10px 14px; box-sizing: border-box;
        }
        .gm-modal-input:focus { outline: none; border-color: var(--gold, #c9a84c); }
        .gm-modal-foot {
            padding: 14px 20px; border-top: 1px solid rgba(201,168,76,.18);
            display: flex; gap: 10px; justify-content: flex-end;
        }

        /* ── Chips de conditions ── */
        .cond-chips { display: flex; gap: 5px; flex-wrap: wrap; }
        .cond-chip {
            display: flex; align-items: center; gap: 4px;
            padding: 4px 10px; border-radius: 12px;
            border: 1px solid rgba(255,255,255,.12);
            background: transparent; cursor: pointer;
            font-size: 13px; color: var(--text-muted, #a89878);
            transition: all .12s; white-space: nowrap;
        }
        .cond-chip.active { border-color: var(--cc, #c9a84c); background: rgba(201,168,76,.15); color: var(--cc, #c9a84c); }
        .cond-chip-icon { font-size: 14px; }

        /* ════════ BESTIAIRE ════════ */
        #bestiaryOv {
            position: fixed; inset: 0; z-index: 9700;
            background: rgba(0,0,0,.85); backdrop-filter: blur(6px);
            display: none; flex-direction: column;
        }
        #bestiaryOv.open { display: flex; animation: bestFade .2s ease; }
        @keyframes bestFade { from{opacity:0} to{opacity:1} }

        .best-topbar {
            display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
            padding: 14px 22px; background: rgba(13,10,8,.97);
            border-bottom: 1px solid rgba(201,168,76,.3); flex-shrink: 0;
        }
        .best-title {
            font-family: 'Cinzel', serif; font-size: 22px;
            color: var(--gold, #c9a84c); font-weight: 700; letter-spacing: .04em;
            display: flex; align-items: center; gap: 10px;
        }
        .best-search {
            flex: 1; min-width: 200px;
            background: rgba(0,0,0,.5); border: 1px solid rgba(201,168,76,.4);
            border-radius: 8px; color: var(--text-parchment, #d4b896);
            font-size: 16px !important; padding: 10px 14px;
        }
        .best-search:focus { outline: none; border-color: var(--gold, #c9a84c); }
        .best-close {
            background: none; border: none; cursor: pointer;
            color: var(--text-muted, #a89878); font-size: 28px; padding: 0 4px;
            line-height: 1; transition: color .15s;
        }
        .best-close:hover { color: var(--gold, #c9a84c); }

        .best-filters {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            padding: 10px 22px; background: rgba(201,168,76,.04);
            border-bottom: 1px solid rgba(201,168,76,.15); flex-shrink: 0;
        }
        .best-filter-lbl { font-size: 13px; color: var(--text-muted, #a89878); font-weight: 600; }
        .best-filter-sel {
            background: rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.3);
            border-radius: 6px; color: var(--text-parchment, #d4b896);
            font-size: 14px !important; padding: 6px 12px; cursor: pointer;
        }
        .best-filter-sel option { background: #1a1208; }
        .best-filter-clear {
            background: none; border: 1px solid rgba(180,60,60,.4);
            color: #e07070; cursor: pointer; padding: 5px 12px;
            border-radius: 6px; font-size: 13px;
        }
        .best-filter-clear:hover { background: rgba(180,60,60,.15); }
        .best-results-count {
            margin-left: auto; margin-right: 6px;
            font-size: 16px; color: var(--gold-light, #e0c870);
            font-weight: 600; font-style: italic;
            white-space: nowrap;
        }

        /* Main split */
        .best-main { display: grid; grid-template-columns: 320px 1fr; flex: 1; min-height: 0; overflow: hidden; }
        @media (max-width: 900px) { .best-main { grid-template-columns: 1fr; } }

        /* Liste à gauche */
        .best-list {
            border-right: 1px solid rgba(201,168,76,.2);
            overflow-y: auto; padding: 8px 0;
            scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.45) transparent;
        }
        .best-list::-webkit-scrollbar { width: 7px; }
        .best-list::-webkit-scrollbar-thumb { background: rgba(201,168,76,.45); border-radius: 3px; }
        .best-list-item {
            display: flex; align-items: center; gap: 12px; padding: 12px 18px;
            cursor: pointer; border-left: 3px solid transparent;
            transition: all .12s;
        }
        .best-list-item:hover { background: rgba(201,168,76,.1); }
        .best-list-item.selected {
            background: rgba(201,168,76,.18);
            border-left-color: var(--gold, #c9a84c);
        }
        .best-list-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
        .best-list-info { flex: 1; min-width: 0; }
        .best-list-name {
            font-size: 15px; font-weight: 700;
            color: var(--text-parchment, #d4b896);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .best-list-sub {
            font-size: 12px; color: var(--text-muted, #a89878); margin-top: 2px;
        }
        .best-list-cr {
            font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700;
            color: var(--gold, #c9a84c); white-space: nowrap;
            background: rgba(201,168,76,.12); padding: 2px 8px; border-radius: 10px;
            border: 1px solid rgba(201,168,76,.3);
        }
        .best-list-empty {
            padding: 40px 20px; text-align: center;
            color: var(--text-muted, #a89878); font-size: 14px;
        }

        /* Fiche détaillée — Stat block style D&D */
        .best-detail {
            overflow-y: auto; padding: 24px 28px;
            scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.45) transparent;
        }
        .best-detail::-webkit-scrollbar { width: 7px; }
        .best-detail::-webkit-scrollbar-thumb { background: rgba(201,168,76,.45); border-radius: 3px; }
        .best-empty-detail {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            height: 100%; color: var(--text-muted, #a89878); gap: 14px;
        }
        .best-empty-icon { font-size: 80px; opacity: .3; }

        /* Stat block */
        .stat-block {
            background: rgba(252,247,234,.04);
            border: 1px solid rgba(201,168,76,.4);
            border-radius: 10px; padding: 0;
            font-family: 'Crimson Text', Georgia, serif;
            color: var(--text-parchment, #d4b896);
            line-height: 1.4;
        }
        .stat-block-hdr {
            padding: 18px 22px 14px;
            border-bottom: 2px solid rgba(201,168,76,.4);
        }
        .stat-block-name {
            font-family: var(--best-ff-title, 'Cinzel', serif);
            font-size: var(--best-fs-title, 34px);
            font-weight: var(--best-fw-title, 700);
            font-style: var(--best-fst-title, normal);
            color: var(--best-fc-title, var(--gold, #c9a84c));
            margin: 0 0 4px; display: flex; align-items: center; gap: 12px;
        }
        .stat-block-name-icon { font-size: 44px; }
        .stat-block-sub {
            font-family: var(--best-ff-subtitle, 'Crimson Text', Georgia, serif);
            font-size: var(--best-fs-subtitle, 17px);
            font-weight: var(--best-fw-subtitle, 400);
            font-style: var(--best-fst-subtitle, italic);
            color: var(--best-fc-subtitle, var(--text-muted, #a89878));
        }

        .stat-block-illu {
            display: flex; align-items: center; justify-content: center;
            height: 220px;
            background: linear-gradient(180deg, rgba(201,168,76,.1), rgba(0,0,0,.3));
            border-bottom: 1px solid rgba(201,168,76,.25);
            font-size: 150px;
            position: relative; overflow: hidden;
        }
        .stat-block-illu::before {
            content: ''; position: absolute; inset: 0;
            background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,.6) 100%);
        }
        .stat-block-illu-icon { position: relative; z-index: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }

        .stat-block-body { padding: 16px 22px 20px; }

        .stat-divider {
            height: 5px;
            background: linear-gradient(90deg,
                transparent 0%, var(--gold, #c9a84c) 10%,
                var(--gold, #c9a84c) 90%, transparent 100%);
            opacity: .35;
            margin: 12px 0;
            border-radius: 3px;
        }
        .stat-divider.thick {
            height: 8px; opacity: .5;
            background: linear-gradient(180deg,
                var(--gold, #c9a84c) 0%, var(--gold, #c9a84c) 35%,
                transparent 36%, transparent 65%,
                var(--gold, #c9a84c) 66%, var(--gold, #c9a84c) 100%);
        }

        .stat-line { font-size: 17px; margin: 6px 0; color: var(--text-parchment, #d4b896); line-height: 1.5; }
        .stat-line b { color: var(--gold, #c9a84c); }

        .stat-abilities-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 10px; padding: 16px 0; margin: 8px 0;
            border-top: 1px solid rgba(201,168,76,.25);
            border-bottom: 1px solid rgba(201,168,76,.25);
        }
        .stat-ab-col { text-align: center; }
        .stat-ab-name {
            font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700;
            color: var(--gold, #c9a84c); letter-spacing: .05em;
        }
        .stat-ab-val {
            font-size: 22px; font-weight: 700; color: var(--text-parchment, #d4b896);
            margin-top: 6px; line-height: 1;
        }
        .stat-ab-mod { display: block; color: var(--gold-light, #e0c870); font-size: 17px; font-weight: 600; margin-top: 4px; }
        .stat-ab-save {
            display: inline-block; margin-top: 6px;
            font-size: 13px; padding: 2px 8px;
            background: rgba(201,168,76,.18);
            border: 1px solid rgba(201,168,76,.45);
            border-radius: 10px;
            color: var(--gold-light, #e0c870);
            font-weight: 700;
        }
        .stat-ab-save.no-prof {
            background: rgba(255,255,255,.04);
            border-color: rgba(255,255,255,.1);
            color: var(--text-muted, #a89878);
            font-weight: 400;
        }
        .stat-ab-save-lbl { font-size: 10px; color: var(--text-muted, #a89878); text-transform: uppercase; letter-spacing: .04em; margin-right: 3px; }

        /* Sections description enrichie */
        .stat-desc-blocks { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
        .stat-desc-block {
            padding: 14px 18px;
            background: rgba(0,0,0,.25);
            border-radius: 8px;
            border-left: 3px solid var(--gold, #c9a84c);
            font-family: var(--best-ff-body, 'Crimson Text', Georgia, serif);
            font-size: var(--best-fs-body, 15px);
            line-height: 1.7;
        }
        .stat-desc-block-title {
            font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
            color: var(--gold, #c9a84c); text-transform: uppercase;
            letter-spacing: .06em; margin-bottom: 6px;
            display: flex; align-items: center; gap: 6px;
        }
        .stat-desc-block-content {
            color: var(--best-fc-body, var(--text-muted, #beac88));
            font-weight: var(--best-fw-body, 400);
            font-style: var(--best-fst-body, italic);
        }

        /* Trésor */
        .stat-treasure {
            margin-top: 14px;
            padding: 12px 16px;
            background: rgba(255,200,80,.08);
            border: 1px solid rgba(255,200,80,.25);
            border-radius: 8px;
            font-family: var(--best-ff-body, 'Crimson Text', Georgia, serif);
            font-size: var(--best-fs-body, 15px);
            font-weight: var(--best-fw-body, 400);
            font-style: var(--best-fst-body, normal);
            color: var(--best-fc-body, var(--text-parchment, #d4b896));
            line-height: 1.65;
        }
        .stat-treasure-title {
            font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
            color: #f0c060; text-transform: uppercase;
            letter-spacing: .06em; margin-bottom: 5px;
            display: flex; align-items: center; gap: 6px;
        }

        /* Image réelle (si fournie) */
        .stat-block-img {
            width: 100%; height: 280px; object-fit: cover; display: block;
            border-bottom: 1px solid rgba(201,168,76,.25);
        }

        .stat-trait {
            font-family: var(--best-ff-body, 'Crimson Text', Georgia, serif);
            font-size: var(--best-fs-body, 16px);
            font-weight: var(--best-fw-body, 400);
            font-style: var(--best-fst-body, normal);
            color: var(--best-fc-body, var(--text-parchment, #d4b896));
            margin: 10px 0; line-height: 1.6;
        }
        .stat-trait-name { font-style: italic; font-weight: 700; color: var(--gold-light, #e0c870); }

        /* ════════ NOUVELLE GRILLE STAT BLOCK ════════ */
        /* Bandeau du haut : 3 cartouches CA / PV / Vitesse, façon caracs */
        .stat-defense-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
            padding: 14px 22px;
            border-top: 1px solid rgba(201,168,76,.25);
            border-bottom: 1px solid rgba(201,168,76,.25);
            background: rgba(201,168,76,.04);
        }
        .stat-def-box {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            padding: 12px 8px;
            background: rgba(0,0,0,.25);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 10px;
            text-align: center;
        }
        .stat-def-icon { font-size: 22px; line-height: 1; }
        .stat-def-name {
            font-family: var(--best-ff-defenses, 'Cinzel', serif);
            font-size: var(--best-fs-defenses-name, 12px);
            font-weight: 700;
            color: var(--best-fc-defenses, var(--gold, #c9a84c));
            text-transform: uppercase; letter-spacing: .05em;
        }
        .stat-def-val {
            font-family: var(--best-ff-defenses, 'Cinzel', serif);
            font-size: var(--best-fs-defenses, 30px);
            font-weight: var(--best-fw-defenses, 900);
            font-style: var(--best-fst-defenses, normal);
            color: var(--best-fc-defenses-val, var(--text-parchment, #d4b896));
            line-height: 1; margin-top: 2px;
        }
        .stat-def-sub {
            font-size: var(--best-fs-defenses-sub, 11px);
            color: var(--text-muted, #a89878);
            font-style: italic; margin-top: 3px; line-height: 1.3;
        }

        /* Ligne 1 : 3 colonnes (Caracs / Compétences-Traits / Image) */
        .stat-grid-row1 {
            display: grid;
            grid-template-columns: 1.4fr 1.6fr 1.4fr;
            gap: 16px;
            padding: 16px 22px;
            border-bottom: 1px solid rgba(201,168,76,.2);
        }
        @media (max-width: 1100px) {
            .stat-grid-row1 { grid-template-columns: 1fr; }
        }
        .stat-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
        .stat-col-title {
            font-family: var(--best-ff-section-title, 'Cinzel', serif);
            font-size: var(--best-fs-section-title, 13px);
            font-weight: var(--best-fw-section-title, 700);
            font-style: var(--best-fst-section-title, normal);
            color: var(--best-fc-section-title, var(--gold, #c9a84c));
            text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px;
            border-bottom: 1px solid rgba(201,168,76,.3);
        }

        /* Caracs en 2 sous-colonnes × 3 lignes */
        .stat-abil-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .stat-abil-box {
            display: flex; flex-direction: column; align-items: center; gap: 3px;
            padding: 10px 6px;
            background: rgba(0,0,0,.25);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 8px; text-align: center;
        }
        .stat-abil-name-box {
            font-family: var(--best-ff-abilities, 'Cinzel', serif);
            font-size: var(--best-fs-abilities-name, 14px);
            font-weight: 700;
            color: var(--best-fc-abilities, var(--gold, #c9a84c));
            letter-spacing: .05em;
        }
        .stat-abil-score {
            font-family: var(--best-ff-abilities, 'Cinzel', serif);
            font-size: var(--best-fs-abilities, 22px);
            font-weight: var(--best-fw-abilities, 800);
            font-style: var(--best-fst-abilities, normal);
            color: var(--best-fc-abilities-score, var(--text-parchment, #d4b896));
            line-height: 1;
        }
        .stat-abil-mod-box {
            font-size: var(--best-fs-abilities-mod, 16px);
            font-weight: 700;
            color: var(--best-fc-abilities-mod, var(--gold-light, #e0c870));
        }
        .stat-abil-save-box {
            font-size: var(--best-fs-abilities-save, 12px);
            padding: 2px 8px; border-radius: 8px;
            background: rgba(201,168,76,.18);
            border: 1px solid rgba(201,168,76,.45);
            color: var(--gold-light, #e0c870); font-weight: 700;
        }
        .stat-abil-save-box.no-prof {
            background: rgba(255,255,255,.04);
            border-color: rgba(255,255,255,.1);
            color: var(--text-muted, #a89878); font-weight: 400;
        }

        /* Image dans la colonne 3 */
        .stat-img-col {
            display: flex; flex-direction: column; gap: 10px; min-width: 0;
        }
        .stat-img-frame {
            position: relative;
            background: rgba(0,0,0,.4);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 8px; overflow: hidden;
            display: flex; align-items: center; justify-content: center;
        }
        .stat-img-frame.empty {
            font-size: 100px; padding: 30px 0;
            opacity: .5;
        }
        .stat-img-frame img {
            width: 100%; height: 100%; object-fit: contain;
            display: block;
        }
        .stat-img-controls {
            display: flex; flex-wrap: wrap; gap: 6px;
            padding: 8px 10px;
            background: rgba(80,140,220,.06);
            border: 1px solid rgba(80,140,220,.2);
            border-radius: 8px;
            align-items: center;
        }

        /* Ligne 2 : 2 colonnes (Actions+Trésor / Apparence+Origines+Comportement) */
        .stat-grid-row2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 18px;
            padding: 16px 22px;
        }
        @media (max-width: 900px) {
            .stat-grid-row2 { grid-template-columns: 1fr; }
        }

        /* Lignes simples dans les colonnes */
        .stat-mini-line {
            font-family: var(--best-ff-info, 'Crimson Text', Georgia, serif);
            font-size: var(--best-fs-info, 14px);
            font-weight: var(--best-fw-info, 400);
            font-style: var(--best-fst-info, normal);
            color: var(--best-fc-info, var(--text-parchment, #d4b896));
            margin: 5px 0; line-height: 1.5;
        }
        .stat-mini-line b { color: var(--gold, #c9a84c); }


        .stat-section-title {
            font-family: var(--best-ff-section-title, 'Cinzel', serif);
            font-size: var(--best-fs-section-title-big, 20px);
            font-weight: var(--best-fw-section-title, 700);
            color: var(--best-fc-section-title, var(--gold, #c9a84c));
            margin: 18px 0 8px;
            text-transform: uppercase; letter-spacing: .04em;
            border-bottom: 1px solid rgba(201,168,76,.4);
            padding-bottom: 4px;
        }

        .stat-block-description {
            margin-top: 18px; padding: 14px 18px;
            background: rgba(0,0,0,.25); border-radius: 8px;
            border-left: 3px solid var(--gold, #c9a84c);
            font-size: 15px; line-height: 1.7;
            color: var(--text-muted, #a89878); font-style: italic;
        }

        /* Barre Image (juste sous l'illustration, intégrée au stat-block) */
        .best-img-bar {
            display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            margin: 0; padding: 10px 16px;
            background: rgba(80,140,220,.08);
            border-bottom: 1px solid rgba(201,168,76,.25);
        }
        /* Navigation entre les images */
        .best-img-nav {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.3);
            border-radius: 8px; padding: 4px 10px;
        }
        .best-img-nav-btn {
            background: none; border: none; cursor: pointer;
            color: var(--gold, #c9a84c); font-size: 18px; padding: 2px 6px;
        }
        .best-img-nav-btn:hover { color: var(--gold-light, #e0c870); }
        .best-img-nav-btn:disabled { opacity: .25; cursor: not-allowed; }
        .best-img-nav-count {
            font-family: 'Cinzel', serif; font-size: 14px;
            color: var(--gold-light, #e0c870); font-weight: 700;
            min-width: 40px; text-align: center;
        }
        /* Contrôles de taille (boutons + slider) */
        .best-size-controls {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            margin-top: 10px; padding: 10px 14px;
            background: rgba(0,0,0,.25); border-radius: 8px;
            border: 1px dashed rgba(201,168,76,.3);
        }
        .best-size-presets { display: inline-flex; gap: 4px; }
        .best-size-preset {
            padding: 5px 12px; border-radius: 5px;
            border: 1px solid rgba(201,168,76,.3);
            background: transparent; color: var(--gold, #c9a84c);
            cursor: pointer; font-size: 13px; font-weight: 700;
            transition: all .12s;
        }
        .best-size-preset:hover, .best-size-preset.active {
            background: rgba(201,168,76,.2); border-color: var(--gold, #c9a84c);
        }
        .best-size-slider {
            flex: 1; min-width: 120px; max-width: 280px;
            accent-color: var(--gold, #c9a84c);
        }
        .best-size-val {
            font-family: 'Cinzel', serif; font-size: 13px;
            color: var(--gold-light, #e0c870); font-weight: 700;
            min-width: 60px; text-align: right;
        }
        /* Image avec wrapper redimensionnable */
        .best-illu-wrap { position: relative; }
        .best-illu-resize-handle {
            position: absolute; left: 50%; bottom: -4px;
            transform: translateX(-50%);
            width: 60px; height: 10px;
            background: linear-gradient(90deg, transparent, var(--gold, #c9a84c), transparent);
            cursor: ns-resize;
            opacity: .5; transition: opacity .12s;
            border-radius: 5px;
        }
        .best-illu-resize-handle:hover { opacity: 1; }
        .best-fullscreen-btn {
            position: absolute; top: 10px; right: 10px;
            background: rgba(0,0,0,.65); color: var(--gold, #c9a84c);
            border: 1px solid var(--gold, #c9a84c);
            border-radius: 6px; padding: 6px 10px;
            cursor: pointer; font-size: 14px; z-index: 2;
            backdrop-filter: blur(2px);
        }
        .best-fullscreen-btn:hover { background: rgba(0,0,0,.85); }
        /* Plein écran */
        #bestFullscreenOv {
            position: fixed; inset: 0; z-index: 99999;
            background: rgba(0,0,0,.96);
            display: none; align-items: center; justify-content: center;
            cursor: pointer; padding: 20px;
        }
        #bestFullscreenOv.open { display: flex; animation: bestFade .2s ease; }
        #bestFullscreenOv img {
            max-width: 96vw; max-height: 96vh;
            object-fit: contain;
            box-shadow: 0 0 60px rgba(201,168,76,.3);
            border: 1px solid rgba(201,168,76,.4);
        }
        .best-fs-hint {
            position: absolute; bottom: 30px; left: 50%;
            transform: translateX(-50%);
            color: rgba(255,255,255,.6); font-size: 14px;
            pointer-events: none;
        }
        /* Liste compacte (sans icône) */
        .best-list-item-compact { padding: 9px 16px; }
        .best-list-name-only { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-parchment, #d4b896); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        /* Bouton de tri */
        .best-sort-btn {
            background: rgba(0,0,0,.35);
            border: 1px solid rgba(201,168,76,.4);
            color: var(--gold, #c9a84c);
            cursor: pointer; padding: 6px 14px;
            border-radius: 6px; font-size: 14px;
            transition: all .12s; white-space: nowrap;
        }
        .best-sort-btn:hover { background: rgba(201,168,76,.15); }

        /* Bouton Ajouter à l'init */
        .best-add-init-bar {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            margin-top: 22px; padding: 14px 16px;
            background: rgba(201,168,76,.08);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 10px;
        }
        .best-qty-picker { display: inline-flex; align-items: center; }
        .best-qty-btn {
            width: 32px; height: 36px;
            background: rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.4);
            color: var(--gold, #c9a84c); font-size: 18px; font-weight: 700;
            cursor: pointer;
        }
        .best-qty-btn:first-child { border-radius: 6px 0 0 6px; }
        .best-qty-btn:last-child { border-radius: 0 6px 6px 0; }
        .best-qty-val {
            width: 48px; height: 36px; display: flex; align-items: center; justify-content: center;
            background: rgba(0,0,0,.5); border-top: 1px solid rgba(201,168,76,.4);
            border-bottom: 1px solid rgba(201,168,76,.4);
            color: var(--gold-light, #e0c870);
            font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700;
        }

        /* ════════════════════════════════════════════════════
           THÈME CLAIR — overrides pour gm_tools.html
        ════════════════════════════════════════════════════ */
        html.theme-light body.gm-tools-page {
            background: var(--bg-void);
            color: var(--text-parchment);
        }

        /* Topbar GM */
        html.theme-light .gm-topbar,
        html.theme-light .gm-topbar-section { background: var(--bg-panel); color: var(--text-parchment); }
        html.theme-light .gm-camp-bar { background: rgba(180,140,40,.1); border-bottom-color: rgba(180,140,40,.3); }
        html.theme-light .gm-camp-select { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-parchment); }
        html.theme-light .gm-camp-select option { background: var(--bg-panel); }

        /* Barre d'onglets rencontre */
        html.theme-light .enc-tabs-bar { background: var(--bg-panel); border-bottom-color: var(--border-dark); }
        html.theme-light .enc-tab { background: var(--bg-card); color: var(--text-muted); border-color: var(--border-dark); }
        html.theme-light .enc-tab:hover { background: var(--bg-hover); color: var(--text-parchment); }
        html.theme-light .enc-tab.active { background: var(--bg-void); border-color: var(--border-gold); color: var(--gold); }

        /* Panneau principal (contenu onglets) */
        html.theme-light .enc-panel { background: var(--bg-void); }

        /* Inputs / boutons GM */
        html.theme-light .gm-inp {
            background: var(--bg-card); border-color: var(--border-dark);
            color: var(--text-parchment);
        }
        html.theme-light .gm-inp:focus { border-color: var(--gold-dark); }
        html.theme-light .gm-btn { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-parchment); }
        html.theme-light .gm-btn:hover { background: var(--bg-hover); border-color: var(--border-gold); }

        /* Initiative */
        html.theme-light .init-row { background: var(--bg-card); border-color: var(--border-dark); }
        html.theme-light .init-row:hover { background: var(--bg-hover); }
        html.theme-light .init-row.current { border-color: var(--gold); background: rgba(180,140,40,.1); }
        html.theme-light .npc-add-form,
        html.theme-light .npc-add-form > span { color: var(--text-parchment); }

        /* Conditions */
        html.theme-light .cond-chip { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-muted); }

        /* ─── Bestiaire ─────────────────────────────── */
        html.theme-light #bestiaryOv {
            background: rgba(200,185,160,.92);
            backdrop-filter: blur(4px);
        }
        html.theme-light .best-topbar {
            background: var(--bg-panel);
            border-bottom-color: var(--border-gold);
        }
        html.theme-light .best-filters {
            background: rgba(180,140,40,.07);
            border-bottom-color: var(--border-dark);
        }
        html.theme-light .best-search {
            background: var(--bg-card);
            border-color: var(--border-dark);
            color: var(--text-parchment);
        }
        html.theme-light .best-search:focus { border-color: var(--gold-dark); }
        html.theme-light .best-filter-sel {
            background: var(--bg-card);
            border-color: var(--border-dark);
            color: var(--text-parchment);
        }
        html.theme-light .best-filter-sel option { background: var(--bg-panel); color: var(--text-parchment); }
        html.theme-light .best-list { border-right-color: var(--border-dark); }
        html.theme-light .best-list-item:hover { background: rgba(180,140,40,.1); }
        html.theme-light .best-list-item.selected { background: rgba(180,140,40,.15); }
        html.theme-light .best-list-name { color: var(--text-parchment); }
        html.theme-light .best-list-sub { color: var(--text-muted); }
        html.theme-light .best-detail { background: var(--bg-void); }

        /* Stat block thème clair */
        html.theme-light .stat-block {
            background: var(--bg-card);
            border-color: var(--border-gold);
            color: var(--text-parchment);
        }
        html.theme-light .stat-block-hdr { border-bottom-color: var(--border-gold); }
        html.theme-light .stat-block-illu {
            background: linear-gradient(180deg, rgba(180,140,40,.12), rgba(0,0,0,.08));
        }
        html.theme-light .stat-block-illu::before {
            background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,.12) 100%);
        }
        html.theme-light .stat-line { color: var(--text-parchment); }
        html.theme-light .stat-abilities-grid { border-color: var(--border-dark); }
        html.theme-light .stat-ab-val { color: var(--text-parchment); }
        html.theme-light .stat-ab-save.no-prof {
            background: rgba(0,0,0,.06);
            border-color: rgba(0,0,0,.12);
            color: var(--text-muted);
        }

        /* Sections enrichies (descriptions, actions…) */
        html.theme-light .best-section-hdr { color: var(--gold); border-bottom-color: var(--border-gold); }
        html.theme-light .best-desc-block { background: rgba(180,140,40,.06); border-left-color: var(--border-gold); }

        /* Panneau paramètres bestiaire */
        html.theme-light .best-settings-panel { background: var(--bg-panel); border-left-color: var(--border-dark); }
        html.theme-light .best-typo-font { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-parchment); }
        html.theme-light .best-typo-font option { background: var(--bg-panel); }

        /* Sélecteur de quantité */
        html.theme-light .best-qty-btn { background: var(--bg-card); border-color: var(--border-dark); }
        html.theme-light .best-qty-val { background: var(--bg-panel); border-color: var(--border-dark); }

        /* Modale monster-pick (ajouter à la rencontre) */
        html.theme-light .best-add-modal-bg { background: rgba(200,185,160,.75); }
        html.theme-light .best-add-modal { background: var(--bg-panel); border-color: var(--border-gold); }

        /* Modal créer/éditer monstre */
        .best-modal-overlay {
            position: fixed; inset: 0; z-index: 9999;
            background: rgba(0,0,0,.92); backdrop-filter: blur(8px);
            display: flex; align-items: center; justify-content: center;
        }
        .best-modal-content {
            background: var(--bg-void, rgba(13,10,8,.99));
            border: 2px solid rgba(201,168,76,.5);
            border-radius: 12px;
            width: 90%; max-width: 700px; max-height: 90vh;
            display: flex; flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,.7);
        }
        .best-modal-hdr {
            display: flex; align-items: center; justify-content: space-between;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(201,168,76,.3);
            flex-shrink: 0;
        }
        .best-modal-hdr h2 {
            margin: 0; font-family: 'Cinzel', serif; font-size: 18px;
            color: var(--gold, #c9a84c); font-weight: 700;
        }
        .best-modal-close {
            background: none; border: none; cursor: pointer;
            color: var(--text-muted, #a89878); font-size: 24px;
            transition: color .15s;
        }
        .best-modal-close:hover { color: var(--gold, #c9a84c); }
        .best-modal-body {
            flex: 1; overflow: hidden; display: flex; flex-direction: column;
        }
        .best-modal-scroll {
            flex: 1; overflow-y: auto; padding: 20px 24px;
            scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.45) transparent;
        }
        .best-modal-scroll::-webkit-scrollbar { width: 7px; }
        .best-modal-scroll::-webkit-scrollbar-thumb { background: rgba(201,168,76,.45); border-radius: 3px; }

        .best-form-group {
            margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px;
        }
        .best-form-group label {
            font-size: 13px; font-weight: 700; color: var(--gold, #c9a84c);
            text-transform: uppercase; letter-spacing: .04em;
        }
        .best-required { color: #e07070; }
        .best-form-group input,
        .best-form-group textarea,
        .best-form-group select {
            background: rgba(0,0,0,.4);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 6px;
            color: var(--text-parchment, #d4b896);
            caret-color: var(--gold, #c9a84c);
            font-family: 'Crimson Text', Georgia, serif;
            font-size: 14px !important;
            padding: 10px 12px;
            transition: all .15s;
        }
        .best-form-group input:focus,
        .best-form-group textarea:focus,
        .best-form-group select:focus {
            outline: none;
            border-color: var(--gold, #c9a84c);
            background: rgba(0,0,0,.6);
        }
        .best-form-group textarea {
            resize: vertical; min-height: 80px; max-height: 200px;
        }
        .best-form-row {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 12px;
        }
        .best-form-row .best-form-group { margin-bottom: 0; }

        /* Grille des caractéristiques */
        .best-abilities-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 10px;
        }
        .best-ability-box {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            background: rgba(0,0,0,.25);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 8px; padding: 10px;
        }
        .best-ability-label {
            font-family: 'Cinzel', serif; font-size: 11px; font-weight: 700;
            color: var(--gold, #c9a84c); text-transform: uppercase; letter-spacing: .05em;
        }
        .best-ability-score {
            font-family: 'Cinzel', serif; font-size: 24px; font-weight: 800;
            color: var(--text-parchment, #d4b896);
        }
        .best-ability-mod {
            font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700;
            color: var(--gold-light, #e0c870);
        }
        .best-ability-controls {
            display: flex; gap: 2px; margin-top: 4px;
        }
        .best-ability-btn {
            background: rgba(201,168,76,.2);
            border: 1px solid rgba(201,168,76,.3);
            border-radius: 4px; color: var(--gold, #c9a84c);
            cursor: pointer; font-size: 14px; font-weight: 700;
            padding: 2px 6px; transition: all .12s;
            width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
        }
        .best-ability-btn:hover { background: rgba(201,168,76,.35); border-color: var(--gold, #c9a84c); }
        .best-ability-btn:active { background: rgba(201,168,76,.5); }

        /* Picker d'icônes */
        .best-icon-picker {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
            gap: 4px;
        }
        .best-icon-btn {
            background: rgba(0,0,0,.4);
            border: 1px solid rgba(201,168,76,.2);
            border-radius: 6px;
            cursor: pointer;
            font-size: 24px;
            padding: 6px;
            transition: all .12s;
            text-align: center;
        }
        .best-icon-btn:hover {
            background: rgba(201,168,76,.15);
            border-color: rgba(201,168,76,.4);
        }
        .best-icon-btn.selected {
            background: rgba(201,168,76,.3);
            border-color: var(--gold, #c9a84c);
        }

        .best-modal-ft {
            display: flex; align-items: center; justify-content: flex-end;
            gap: 10px; padding: 16px 24px;
            border-top: 1px solid rgba(201,168,76,.3);
            flex-shrink: 0;
        }
        .best-modal-btn {
            border: none; border-radius: 6px; cursor: pointer;
            font-size: 14px; font-weight: 600;
            padding: 10px 20px;
            transition: all .15s;
        }
        .best-modal-btn-cancel {
            background: rgba(201,168,76,.12);
            color: var(--text-muted, #a89878);
            border: 1px solid rgba(201,168,76,.3);
        }
        .best-modal-btn-cancel:hover {
            background: rgba(201,168,76,.18);
            border-color: var(--text-muted, #a89878);
        }
        .best-modal-btn-save {
            background: rgba(201,168,76,.25);
            color: var(--gold, #c9a84c);
            border: 1px solid rgba(201,168,76,.5);
        }
        .best-modal-btn-save:hover {
            background: rgba(201,168,76,.35);
            border-color: var(--gold, #c9a84c);
        }

        /* Toast notifications */
        .best-toast {
            position: fixed; bottom: 20px; right: 20px;
            background: rgba(0,0,0,.95);
            border: 1px solid rgba(201,168,76,.4);
            border-radius: 8px; padding: 12px 18px;
            color: var(--gold, #c9a84c);
            font-size: 14px; font-weight: 600;
            z-index: 10000;
            animation: toast-in .3s ease-out;
        }
        @keyframes toast-in {
            from { transform: translateX(400px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        /* Thème clair overrides pour modal */
        html.theme-light .best-modal-content {
            background: var(--bg-card);
            border-color: var(--border-gold);
        }
        html.theme-light .best-modal-hdr {
            border-bottom-color: var(--border-dark);
        }
        html.theme-light .best-modal-ft {
            border-top-color: var(--border-dark);
        }
        html.theme-light .best-form-group label {
            color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-form-group input,
        html.theme-light .best-form-group textarea,
        html.theme-light .best-form-group select {
            background: var(--bg-void);
            border-color: var(--border-dark);
            color: var(--text-parchment);
            caret-color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-form-group input:focus,
        html.theme-light .best-form-group textarea:focus,
        html.theme-light .best-form-group select:focus {
            border-color: var(--gold-dark, #b8860b);
            background: rgba(180,140,40,.05);
        }
        html.theme-light .best-icon-btn {
            background: var(--bg-void);
            border-color: var(--border-dark);
        }
        html.theme-light .best-icon-btn:hover {
            background: rgba(180,140,40,.1);
            border-color: var(--border-dark);
        }
        html.theme-light .best-icon-btn.selected {
            background: rgba(180,140,40,.15);
            border-color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-modal-btn-cancel {
            background: rgba(180,140,40,.08);
            border-color: var(--border-dark);
        }
        html.theme-light .best-modal-btn-cancel:hover {
            background: rgba(180,140,40,.15);
        }
        html.theme-light .best-modal-btn-save {
            background: rgba(180,140,40,.15);
            border-color: var(--border-gold);
        }
        html.theme-light .best-modal-btn-save:hover {
            background: rgba(180,140,40,.25);
        }
        html.theme-light .best-toast {
            background: rgba(200,185,160,.95);
            border-color: var(--border-dark);
            color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-ability-box {
            background: rgba(180,140,40,.08);
            border-color: var(--border-dark);
        }
        html.theme-light .best-ability-score {
            color: var(--text-parchment);
        }
        html.theme-light .best-ability-mod {
            color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-ability-btn {
            background: rgba(180,140,40,.1);
            border-color: var(--border-dark);
            color: var(--gold-dark, #b8860b);
        }
        html.theme-light .best-ability-btn:hover {
            background: rgba(180,140,40,.15);
            border-color: var(--gold-dark, #b8860b);
        }


        /* ══════════════════════════════════════════════════════════════
           Navigation principale (Rencontres / Générateurs)
        ══════════════════════════════════════════════════════════════ */
        .gm-topnav {
            display: flex; align-items: center; gap: 4px;
            padding: 8px 22px;
            background: rgba(0,0,0,.28);
            border-bottom: 1px solid rgba(201,168,76,.18);
            flex-shrink: 0;
        }
        .gm-topnav-btn {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 9px 20px; border-radius: 8px;
            border: 1px solid transparent; background: transparent;
            color: var(--text-muted, #a89878);
            font-family: 'Cinzel', serif; font-size: 13.5px; font-weight: 600;
            letter-spacing: .04em; cursor: pointer; transition: all .15s;
        }
        .gm-topnav-btn:hover { background: rgba(201,168,76,.1); color: var(--text-parchment, #d4b896); }
        .gm-topnav-btn.active {
            background: rgba(201,168,76,.14);
            border-color: rgba(201,168,76,.4);
            color: var(--gold, #c9a84c);
        }
        #gmViewRencontres { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        #gmViewGenerateurs { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

        /* ══════════════════════════════════════════════════════════════
           Générateurs — Layout
        ══════════════════════════════════════════════════════════════ */
        .gen-layout {
            display: flex; flex: 1; overflow: hidden;
        }

        /* ── Sidebar ── */
        .gen-sidebar {
            width: 185px; flex-shrink: 0;
            display: flex; flex-direction: column; gap: 3px;
            padding: 16px 10px;
            background: rgba(0,0,0,.22);
            border-right: 1px solid rgba(201,168,76,.13);
            overflow-y: auto; scrollbar-width: none;
        }
        .gen-sidebar::-webkit-scrollbar { display: none; }

        .gen-type-btn {
            display: flex; align-items: center; gap: 10px;
            width: 100%; padding: 11px 14px;
            border-radius: 8px; border: 1px solid transparent;
            background: transparent;
            color: var(--text-muted, #a89878);
            font-size: 14px; cursor: pointer; text-align: left;
            transition: all .14s; position: relative;
        }
        .gen-type-btn::before {
            content: ''; position: absolute;
            left: 0; top: 22%; bottom: 22%;
            width: 3px; border-radius: 0 2px 2px 0;
            background: var(--gold, #c9a84c);
            opacity: 0; transition: opacity .14s;
        }
        .gen-type-btn:hover { background: rgba(201,168,76,.07); color: var(--text-parchment, #d4b896); }
        .gen-type-btn.active {
            background: rgba(201,168,76,.11);
            border-color: rgba(201,168,76,.22);
            color: var(--gold-light, #e0c870);
        }
        .gen-type-btn.active::before { opacity: 1; }
        .gen-type-icon { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
        .gen-type-label { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 600; letter-spacing: .03em; }

        /* ── Contenu ── */
        .gen-content {
            flex: 1; display: flex; flex-direction: column;
            overflow-y: auto; padding: 28px 32px;
            scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.3) transparent;
        }
        .gen-content::-webkit-scrollbar { width: 6px; }
        .gen-content::-webkit-scrollbar-thumb { background: rgba(201,168,76,.3); border-radius: 3px; }

        /* ── Header de panneau ── */
        .gen-panel-header {
            display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
        }
        .gen-ph-icon {
            width: 54px; height: 54px; border-radius: 14px;
            display: flex; align-items: center; justify-content: center;
            font-size: 26px; flex-shrink: 0;
            border: 1px solid rgba(255,255,255,.07);
        }
        .gen-ph-title {
            font-family: 'Cinzel', serif; font-size: 21px; font-weight: 700;
            color: var(--text-parchment, #d4b896); letter-spacing: .04em;
        }
        .gen-ph-desc { font-size: 13px; color: var(--text-muted, #a89878); margin-top: 3px; }

        /* ── Options ── */
        .gen-opts {
            margin-bottom: 20px; padding: 14px 18px;
            background: rgba(255,255,255,.025);
            border: 1px solid rgba(201,168,76,.1); border-radius: 10px;
        }
        .gen-opt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .gen-opt-label { font-size: 13px; color: var(--text-muted, #a89878); white-space: nowrap; }
        .gen-opt-pills { display: flex; gap: 6px; flex-wrap: wrap; }
        .gen-opt-pill {
            padding: 5px 14px; border-radius: 20px;
            border: 1px solid rgba(201,168,76,.3); background: transparent;
            color: var(--text-muted, #a89878); font-size: 13px; cursor: pointer;
            transition: all .13s;
        }
        .gen-opt-pill:hover { border-color: var(--gold, #c9a84c); color: var(--gold, #c9a84c); }
        .gen-opt-pill.active {
            background: rgba(201,168,76,.16);
            border-color: var(--gold, #c9a84c);
            color: var(--gold-light, #e0c870);
        }
        .gen-opt-select {
            background: rgba(0,0,0,.35);
            border: 1px solid rgba(201,168,76,.3); border-radius: 7px;
            color: var(--text-parchment, #d4b896);
            font-size: 13px; padding: 6px 10px; flex: 1; max-width: 340px;
        }
        .gen-opt-select option { background: #1a1208; }

        /* ── Bouton Générer ── */
        .gen-gen-btn {
            display: flex; align-items: center; justify-content: center; gap: 10px;
            width: 100%; max-width: 420px;
            padding: 15px 24px; border-radius: 10px; border: none;
            background: var(--gen-accent, #c9a84c);
            color: #0a0806;
            font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700;
            letter-spacing: .06em; cursor: pointer;
            transition: all .18s;
            box-shadow: 0 4px 18px rgba(0,0,0,.35);
            margin-bottom: 30px;
        }
        .gen-gen-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,0,0,.45); }
        .gen-gen-btn:active { transform: translateY(0); filter: brightness(.98); }

        /* ── Carte de résultat ── */
        @keyframes genFadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0);   }
        }
        .gen-anim-in { animation: genFadeIn .28s ease forwards; }

        .gen-result-card {
            background: rgba(255,255,255,.035);
            border: 1px solid rgba(201,168,76,.18);
            border-left: 3px solid var(--gen-accent, #c9a84c);
            border-radius: 12px; overflow: hidden;
            margin-bottom: 26px;
            box-shadow: 0 4px 28px rgba(0,0,0,.3);
        }
        .gen-rc-header {
            display: flex; align-items: center; gap: 14px;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255,255,255,.055);
            background: rgba(255,255,255,.018);
        }
        .gen-rc-icon-wrap {
            width: 46px; height: 46px; border-radius: 11px;
            display: flex; align-items: center; justify-content: center;
            font-size: 22px; flex-shrink: 0;
            border: 1px solid rgba(255,255,255,.06);
        }
        .gen-rc-titles { flex: 1; min-width: 0; }
        .gen-rc-title {
            font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700;
            color: var(--text-parchment, #d4b896);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .gen-rc-sub { font-size: 12.5px; color: var(--text-muted, #a89878); margin-top: 2px; }
        .gen-rc-btns { display: flex; gap: 6px; flex-shrink: 0; }
        .gen-rc-btn {
            width: 34px; height: 34px; border-radius: 8px;
            border: 1px solid rgba(201,168,76,.22);
            background: rgba(201,168,76,.06);
            color: var(--text-muted, #a89878);
            font-size: 15px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all .13s;
        }
        .gen-rc-btn:hover { background: rgba(201,168,76,.18); border-color: var(--gold, #c9a84c); color: var(--gold, #c9a84c); }

        .gen-rc-fields { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
        .gen-rc-field { display: flex; align-items: flex-start; gap: 11px; }
        .gen-rc-ficon { font-size: 15px; flex-shrink: 0; margin-top: 2px; width: 20px; text-align: center; }
        .gen-rc-fcontent { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
        .gen-rc-flabel {
            font-size: 10.5px; font-weight: 700; text-transform: uppercase;
            letter-spacing: .08em; color: var(--text-muted, #a89878); white-space: nowrap;
        }
        .gen-rc-badge {
            font-size: 11px; font-weight: 700;
            padding: 2px 8px; border-radius: 20px; border: 1px solid; white-space: nowrap;
        }
        .gen-rc-fvalue { font-size: 14px; color: var(--text-parchment, #d4b896); line-height: 1.55; flex-basis: 100%; }

        /* ── Historique ── */
        .gen-hist-hdr {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: .08em; color: var(--text-muted, #a89878); margin-bottom: 10px;
        }
        .gen-hist-list { display: flex; flex-direction: column; gap: 4px; }
        .gen-hist-item {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 12px; border-radius: 8px;
            border: 1px solid rgba(201,168,76,.09);
            background: rgba(255,255,255,.018);
            cursor: pointer; text-align: left; width: 100%;
            transition: all .13s;
        }
        .gen-hist-item:hover { background: rgba(201,168,76,.07); border-color: rgba(201,168,76,.22); }
        .gen-hi-icon {
            width: 32px; height: 32px; border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            font-size: 15px; flex-shrink: 0;
        }
        .gen-hi-text { flex: 1; min-width: 0; }
        .gen-hi-title {
            display: block; font-size: 13px; font-weight: 600;
            color: var(--text-parchment, #d4b896);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .gen-hi-sub {
            display: block; font-size: 11.5px; color: var(--text-muted, #a89878);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
        }

        /* ── Responsive : sidebar icônes seules < 680px ── */
        @media (max-width: 680px) {
            .gen-sidebar { width: 54px; padding: 12px 6px; }
            .gen-type-label { display: none; }
            .gen-type-btn { padding: 11px; justify-content: center; }
            .gen-type-btn::before { display: none; }
            .gen-type-icon { width: auto; }
            .gen-content { padding: 16px 14px; }
            .gen-gen-btn { max-width: 100%; font-size: 14px; padding: 13px 16px; }
            .gen-ph-icon { width: 42px; height: 42px; font-size: 20px; }
            .gen-ph-title { font-size: 17px; }
            .gen-rc-header { padding: 12px 14px; gap: 10px; }
            .gen-rc-icon-wrap { width: 36px; height: 36px; font-size: 18px; border-radius: 9px; }
            .gen-rc-title { font-size: 15px; }
            .gen-rc-btns { gap: 4px; }
            .gen-rc-btn { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }
            .gen-rc-fields { padding: 13px 14px; gap: 12px; }
        }

        /* ── Light theme ── */
        html.theme-light .gm-topnav { background: rgba(240,230,210,.7); }
        html.theme-light .gm-topnav-btn.active { background: rgba(140,100,30,.12); }
        html.theme-light .gen-sidebar { background: rgba(245,235,215,.6); border-right-color: rgba(140,100,30,.18); }
        html.theme-light .gen-type-btn:hover { background: rgba(140,100,30,.07); }
        html.theme-light .gen-type-btn.active { background: rgba(140,100,30,.11); border-color: rgba(140,100,30,.25); }
        html.theme-light .gen-opts { background: rgba(140,100,30,.03); border-color: rgba(140,100,30,.14); }
        html.theme-light .gen-opt-select { background: rgba(255,255,255,.8); color: var(--text-parchment); }
        html.theme-light .gen-opt-select option { background: #f5f0e8; }
        html.theme-light .gen-result-card { background: rgba(255,255,255,.75); border-color: rgba(140,100,30,.2); }
        html.theme-light .gen-rc-header { background: rgba(140,100,30,.04); border-bottom-color: rgba(140,100,30,.1); }
        html.theme-light .gen-rc-btn { background: rgba(140,100,30,.06); border-color: rgba(140,100,30,.22); }
        html.theme-light .gen-hist-item { background: rgba(255,255,255,.55); border-color: rgba(140,100,30,.1); }
        html.theme-light .gen-hist-item:hover { background: rgba(140,100,30,.07); }
