/* ════════════════════════════════════════════════════════════════
   BESTIAIRE — Styles de widgets PARTAGÉS
   Liés par pages/bestiary.html ET pages/gm_tools.html (après leur
   <style> inline → priorité). Source unique pour : panneau typographie,
   bouton typo, bandeau « ajouter à l'initiative », sélecteur de quantité,
   et boutons de contrôle d'image. Évite la divergence entre les 2 pages.
   ════════════════════════════════════════════════════════════════ */

/* ──────── Boutons de contrôle d'image (colonne illustration) ──────── */
.best-ctrl-btn {
    background: rgba(0,0,0,.35); border: 1px solid rgba(201,168,76,.35);
    border-radius: 6px; color: var(--gold, #c9a84c);
    cursor: pointer; font-size: 13px; padding: 5px 10px;
    transition: all .12s; white-space: nowrap;
}
.best-ctrl-btn:hover { background: rgba(201,168,76,.15); border-color: var(--gold, #c9a84c); }
.best-ctrl-btn-del { color: #e07070; border-color: rgba(200,70,70,.35); }
.best-ctrl-btn-del:hover { background: rgba(200,70,70,.15); border-color: #e07070; }
html.theme-light .best-ctrl-btn { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-parchment); }
html.theme-light .best-ctrl-btn:hover { background: var(--bg-hover); border-color: var(--border-gold); }

/* ──────── Bandeau « Ajouter à l'initiative » (contexte gm_tools) ──────── */
.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;
}
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); }

/* ──────── Bouton déclencheur de typographie (barre de filtres) ──────── */
.best-typo-btn {
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(201,168,76,.4);
    color: var(--gold-light, #e0c870);
    cursor: pointer; padding: 6px 12px;
    border-radius: 6px; font-size: 15px;
    font-family: 'Cinzel', serif; font-weight: 700;
    transition: all .12s; white-space: nowrap;
}
.best-typo-btn:hover { background: rgba(201,168,76,.18); border-color: var(--gold, #c9a84c); }

/* ──────── Panneau typographie (slide-in droite) ──────── */
#bestTypoBackdrop {
    position: fixed; inset: 0; z-index: 9890;
    background: rgba(0,0,0,.25); display: none;
}
#bestTypoBackdrop.open { display: block; }
#bestTypoPanel {
    position: fixed; top: 0; right: -460px; bottom: 0;
    width: 440px; max-width: 95vw; z-index: 9900;
    background: var(--bg-panel, #13100c);
    border-left: 1px solid var(--border-gold, #c9a84c);
    box-shadow: -12px 0 32px rgba(0,0,0,.55);
    display: flex; flex-direction: column;
    transition: right .25s ease;
}
#bestTypoPanel.open { right: 0; }
.best-typo-hdr {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(201,168,76,.25);
    flex-shrink: 0;
}
.best-typo-hdr-title {
    font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700;
    color: var(--gold, #c9a84c); flex: 1;
    text-transform: uppercase; letter-spacing: .04em;
}
.best-typo-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted, #a89878); font-size: 24px; padding: 0 4px;
}
.best-typo-close:hover { color: var(--gold, #c9a84c); }
.best-typo-body {
    flex: 1; overflow-y: auto; padding: 16px 20px;
    scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.4) transparent;
}
.best-typo-body::-webkit-scrollbar { width: 6px; }
.best-typo-body::-webkit-scrollbar-thumb { background: rgba(201,168,76,.4); border-radius: 3px; }
.best-typo-global {
    padding: 14px 16px; margin-bottom: 16px;
    background: rgba(201,168,76,.08);
    border: 1px solid rgba(201,168,76,.3);
    border-radius: 10px;
}
.best-typo-global-title {
    font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700;
    color: var(--gold, #c9a84c); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: .04em;
}
.best-typo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.best-typo-row-lbl { font-size: 13px; color: var(--text-muted, #a89878); min-width: 70px; }
.best-typo-slider { flex: 1; min-width: 120px; accent-color: var(--gold, #c9a84c); }
.best-typo-val {
    font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700;
    color: var(--gold-light, #e0c870); min-width: 50px; text-align: right;
}
.best-typo-section {
    padding: 12px 14px; margin-bottom: 10px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(201,168,76,.18);
    border-radius: 8px;
}
.best-typo-section-name {
    font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700;
    color: var(--gold-light, #e0c870);
    text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(201,168,76,.2);
}
.best-typo-btns { display: inline-flex; gap: 3px; }
.best-typo-tog {
    width: 30px; height: 28px;
    background: rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.3);
    color: var(--gold, #c9a84c); cursor: pointer;
    border-radius: 5px; font-size: 13px; font-weight: 700;
}
.best-typo-tog.active { background: rgba(201,168,76,.3); border-color: var(--gold, #c9a84c); }
.best-typo-tog:hover { background: rgba(201,168,76,.15); }
.best-typo-color {
    width: 36px; height: 28px; padding: 0; border: 1px solid rgba(201,168,76,.3);
    border-radius: 5px; cursor: pointer; background: transparent;
}
.best-typo-font {
    background: rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.3);
    color: var(--text-parchment, #d4b896); padding: 5px 8px; border-radius: 5px;
    font-size: 13px; flex: 1; min-width: 100px;
}
.best-typo-font option { background: #1a1208; }
.best-typo-reset-mini {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted, #a89878); font-size: 12px;
    text-decoration: underline; padding: 0;
}
.best-typo-reset-mini:hover { color: var(--gold, #c9a84c); }
.best-typo-foot {
    padding: 12px 20px; border-top: 1px solid rgba(201,168,76,.2);
    display: flex; gap: 10px; flex-shrink: 0;
}
.best-typo-foot button { flex: 1; }
.best-typo-preset-row { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.best-typo-preset { padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(201,168,76,.3); background: transparent; color: var(--gold, #c9a84c); cursor: pointer; font-size: 12px; font-weight: 700; }
.best-typo-preset:hover, .best-typo-preset.active { background: rgba(201,168,76,.2); }

/* Thème clair — panneau typo */
html.theme-light #bestTypoPanel { background: var(--bg-panel); }
html.theme-light .best-typo-section { background: rgba(0,0,0,.04); }
html.theme-light .best-typo-tog,
html.theme-light .best-typo-font { background: var(--bg-card); color: var(--text-parchment); }

/* ════════════════════════════════════════════════════════════════
   BESTIAIRE PAGE (bestiary.html) — styles propres à la page autonome
   ════════════════════════════════════════════════════════════════ */

        /* ── Layout page complète ── */
        body.bestiary-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;
        }

        #bestiaryOv {
            position: fixed; inset: 0; z-index: 9700;
            background: rgba(0,0,0,.85); backdrop-filter: blur(6px);
            display: flex; flex-direction: column;
        }

        .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: var(--bg-card, #1A150E);
            border-bottom: 1px solid rgba(139,26,26,.4); 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-srd-btn {
            background: none; border: 1px solid rgba(60,160,60,.45);
            color: #70c870; cursor: pointer; padding: 5px 12px;
            border-radius: 6px; font-size: 13px; font-weight: 600;
            font-family: 'Cinzel', serif; letter-spacing: .04em;
            transition: background .15s, border-color .15s, color .15s;
        }
        .best-srd-btn:hover { background: rgba(40,120,40,.18); }
        .best-srd-btn.active {
            background: rgba(40,120,40,.9); border-color: #3ca03c; color: #eafff0;
            box-shadow: 0 0 8px rgba(60,160,60,.5);
        }
        html.theme-light .best-srd-btn { border-color: rgba(20,100,20,.4); color: #2a7a2a; }
        html.theme-light .best-srd-btn.active {
            background: rgba(30,120,30,.9); border-color: #1e7a1e; color: #fff;
        }
        .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;
        }
        .best-btn-add-monster {
            background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.4);
            color: var(--gold, #c9a84c); cursor: pointer; padding: 6px 14px;
            border-radius: 6px; font-size: 13px; font-weight: 600;
            transition: all .15s;
        }
        .best-btn-add-monster:hover { background: rgba(201,168,76,.25); border-color: var(--gold, #c9a84c); }

        .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; } }

        .best-list {
            border-right: 1px solid rgba(139,26,26,.4);
            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: 8px 10px;
            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-family: 'Cinzel', serif; font-size: 16px; 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);
        }
        /* Bloc nom de la liste : FR au-dessus, EN (italique, atténué) en dessous */
        .best-list-name-only { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; min-width: 0; }
        .best-list-name-en {
            font-size: 11px; color: var(--text-muted, #a89878);
            font-style: italic; font-weight: 400; letter-spacing: .01em;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        html.theme-light .best-list-name-en { color: #8a6a3a; }
        .best-list-empty {
            padding: 40px 20px; text-align: center;
            color: var(--text-muted, #a89878); font-size: 14px;
        }

        .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 {
            background: rgba(252,247,234,.04);
            border: 1px solid rgba(139,26,26,.5);
            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(139,26,26,.55);
        }
        .stat-block-hdr-top {
            display: flex; align-items: flex-start;
            justify-content: space-between; gap: 12px;
        }
        .best-srd-badge {
            display: inline-flex; align-items: center;
            font-family: 'Cinzel', serif; font-size: 10px; font-weight: 700;
            padding: 3px 8px; border-radius: 4px; white-space: nowrap;
            flex-shrink: 0; letter-spacing: .06em; margin-top: 4px;
            background: rgba(40,120,40,.2); border: 1px solid rgba(60,160,60,.45);
            color: #70c870;
            cursor: default;
        }
        html.theme-light .best-srd-badge {
            background: rgba(20,100,20,.1); border-color: rgba(20,100,20,.35);
            color: #2a7a2a;
        }
        .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-name-en {
            font-size: 17px; font-weight: 400; font-style: italic;
            font-family: 'Crimson Text', Georgia, serif;
            color: var(--text-muted, #a89878); align-self: center;
            letter-spacing: .01em;
        }
        .stat-block-name-en::before { content: '· '; opacity: .6; }
        .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-defense-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
            padding: 14px 22px;
            border-top: 1px solid rgba(139,26,26,.3);
            border-bottom: 1px solid rgba(139,26,26,.3);
            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;
        }

        .stat-grid-row1 {
            display: grid;
            grid-template-columns: 1.4fr 1.6fr 1.4fr;
            gap: 16px;
            padding: 16px 22px;
            border-bottom: 1px solid rgba(139,26,26,.28);
        }
        @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(139,26,26,.38);
        }

        .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;
        }

        .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-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; }
        }

        .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-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); }

        .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(139,26,26,.45);
            padding-bottom: 4px;
        }

        .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);
        }

        .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;
        }

        .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); }

        .best-section-header {
            display: flex; align-items: center; gap: 8px;
            padding: 12px 14px; cursor: pointer;
            background: rgba(201,168,76,.12);
            border-bottom: 1px solid rgba(201,168,76,.2);
            font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
            color: var(--gold, #c9a84c);
            text-transform: uppercase; letter-spacing: .05em;
            user-select: none;
            transition: background .15s;
        }
        .best-section-header:hover { background: rgba(201,168,76,.18); }
        .best-section-toggle { display: inline-block; width: 12px; }
        .best-section-title { flex: 1; }
        .best-section-count {
            font-size: 11px; color: var(--text-muted, #a89878);
            font-weight: 400; letter-spacing: 0;
        }

        .best-list-item-custom {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 12px; cursor: pointer;
            border-left: 3px solid rgba(201,168,76,.3);
            transition: all .12s;
        }
        .best-list-item-custom:hover {
            background: rgba(201,168,76,.08);
            border-left-color: var(--gold, #c9a84c);
        }
        .best-list-item-custom.selected {
            background: rgba(201,168,76,.15);
            border-left-color: var(--gold, #c9a84c);
        }
        .best-list-item-custom .best-list-name-only { flex: 1; }
        .best-list-actions {
            display: flex; gap: 4px; opacity: 0;
            transition: opacity .12s;
        }
        .best-list-item-custom:hover .best-list-actions { opacity: 1; }
        .best-list-btn {
            background: none; border: none; cursor: pointer;
            color: var(--text-muted, #a89878); font-size: 14px;
            padding: 2px 4px; transition: color .12s;
        }
        .best-list-btn:hover { color: var(--gold, #c9a84c); }
        .best-list-btn-del:hover { color: #e07070; }

        /* Thème clair overrides */
        html.theme-light body.bestiary-page { background: var(--bg-void); color: var(--text-parchment); }
        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: var(--bg-card); border-bottom-color: var(--crimson-light, #C03030); border-bottom-width: 1px; }
        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(--crimson-light, #C03030); background: #fdf3e3; }
        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: #fdf3e3; }
        html.theme-light .stat-block { background: var(--bg-card); border-color: var(--crimson-light, #C03030); color: var(--text-parchment); }
        html.theme-light .stat-block-hdr { border-bottom-color: var(--crimson-light, #C03030); }
        html.theme-light .stat-line { color: var(--text-parchment); }

        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); }

        /* 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; }

        .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); }

        .stat-img-controls {
            display: flex; flex-wrap: wrap; gap: 6px;
            padding: 8px 6px; align-items: center;
        }
        .best-img-nav {
            display: flex; align-items: center; gap: 4px;
        }
        .best-img-nav-btn {
            background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.3);
            border-radius: 4px; color: var(--gold, #c9a84c);
            cursor: pointer; font-size: 13px; padding: 3px 8px;
            transition: all .12s;
        }
        .best-img-nav-btn:hover { background: rgba(201,168,76,.3); }
        .best-img-nav-btn:disabled { opacity: .25; cursor: not-allowed; }
        .best-img-nav-count { font-size: 12px; color: var(--text-muted, #a89878); white-space: nowrap; }
        .best-size-presets { display: flex; gap: 4px; }
        .best-size-preset {
            background: rgba(0,0,0,.3); border: 1px solid rgba(201,168,76,.25);
            border-radius: 4px; color: var(--text-muted, #a89878);
            cursor: pointer; font-size: 11px; font-weight: 700;
            padding: 3px 7px; transition: all .12s;
        }
        .best-size-preset:hover { background: rgba(201,168,76,.15); }
        .best-size-preset.active { background: rgba(201,168,76,.25); color: var(--gold, #c9a84c); border-color: rgba(201,168,76,.5); }
        .best-size-slider { accent-color: var(--gold, #c9a84c); cursor: pointer; }

        html.theme-light .best-ctrl-btn { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-parchment); }
        html.theme-light .best-ctrl-btn:hover { background: var(--bg-hover); border-color: var(--border-gold); }
        html.theme-light .best-size-preset { background: var(--bg-card); border-color: var(--border-dark); }
        html.theme-light .best-size-preset.active { background: rgba(180,140,40,.15); border-color: var(--border-gold); }

        .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); }

        .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; }
        }
