/**
 * Styles pour les shortcodes de gestion de fiches joueurs.
 * - [mjbox_mes_fiches]    : liste des fiches d'un user
 * - [mjbox_editer_fiche]  : formulaire d'édition d'une fiche
 *
 * Reste cohérent avec frontoffice.css (palette or/sombre, typographie D&D).
 */

/* ============================================================
   [mjbox_mes_fiches] — Liste des fiches
   ============================================================ */

/* Trois panneaux côte à côte : création manuelle | génération auto | import JSON */
.mjbox-creer-fiche-onglets {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 1rem;
    margin: 1.2rem 0 1.5rem;
}

@media (max-width: 1000px) {
    .mjbox-creer-fiche-onglets {
        grid-template-columns: 1fr 1fr;
    }
    .mjbox-form-importer-fiche {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .mjbox-creer-fiche-onglets {
        grid-template-columns: 1fr;
    }
    .mjbox-form-importer-fiche {
        grid-column: auto;
    }
}

.mjbox-mes-fiches .mjbox-form-creer-fiche,
.mjbox-mes-fiches .mjbox-form-generer-fiche,
.mjbox-mes-fiches .mjbox-form-importer-fiche {
    padding: 1rem 1.2rem;
    background: rgba(200, 155, 74, 0.07);
    border: 1px solid rgba(200, 155, 74, 0.22);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
}

.mjbox-form-importer-fiche input[type="file"] {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.mjbox-textarea-import {
    flex: 1 1 auto;
    min-height: 60px;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 11px;
}

.mjbox-form-importer-fiche button {
    align-self: flex-start;
}

/* Bandeau "Sauvegarder dans mes fiches" au-dessus de la fiche générée */
.dnd-perso-sauvegarder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    background: rgba(200, 155, 74, 0.1);
    border: 1px solid rgba(200, 155, 74, 0.3);
    border-radius: 5px;
}

.dnd-btn-sauver-fiche {
    background: #c89b4a;
    color: #1a1a26;
    border: 1px solid #b8893d;
    padding: 0.5rem 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
}

.dnd-btn-sauver-fiche:hover:not([disabled]) {
    background: #b8893d;
    transform: translateY(-1px);
}

.dnd-btn-sauver-fiche[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.dnd-sauver-statut {
    font-size: 13px;
}
.dnd-sauver-statut.is-ok  { color: #6dd47a; }
.dnd-sauver-statut.is-err { color: #f38a8a; }
.dnd-sauver-statut a {
    color: #c89b4a;
    text-decoration: none;
    font-weight: 600;
}
.dnd-sauver-statut a:hover { text-decoration: underline; }

.mjbox-creer-titre {
    margin: 0 0 4px 0;
    color: #c89b4a;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.4px;
}

.mjbox-creer-desc {
    margin: 0 0 0.8rem 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

.mjbox-creer-fiche-grille {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: auto; /* pousse le bouton vers le bas */
}

.mjbox-creer-fiche-grille input[type="text"] {
    flex: 1 1 200px;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 14px;
}

.mjbox-creer-fiche-grille input[type="text"]:focus {
    outline: none;
    border-color: #c89b4a;
    background: rgba(255, 255, 255, 0.08);
}

.mjbox-generer-grille {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-bottom: 0.8rem;
}

.mjbox-btn-generer {
    align-self: flex-start;
}

.mjbox-vide {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.mjbox-liste-fiches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.mjbox-fiche-card {
    display: flex;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid #c89b4a;
    border-radius: 5px;
    padding: 0.9rem 1rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.mjbox-fiche-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.mjbox-fiche-card-avatar {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mjbox-fiche-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mjbox-avatar-defaut {
    font-size: 32px;
    opacity: 0.6;
}

.mjbox-fiche-card-info {
    flex: 1 1 auto;
    min-width: 0;
}

.mjbox-fiche-card-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: #f3c97a;
    font-family: 'Cinzel', serif;
}

.mjbox-fiche-card-sous {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.mjbox-fiche-card-align {
    margin: 2px 0 6px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
}

.mjbox-fiche-card-pv {
    margin-top: 5px;
    font-size: 12px;
}

.mjbox-pv-libelle {
    color: rgba(255, 255, 255, 0.65);
    margin-right: 4px;
}

.mjbox-pv-valeur {
    color: #fff;
    font-weight: 600;
}

.mjbox-pv-barre {
    margin-top: 4px;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.mjbox-pv-rempli {
    height: 100%;
    background: linear-gradient(90deg, #6b3232 0%, #c0392b 60%, #b8893d 100%);
    transition: width 0.3s ease;
}

.mjbox-fiche-card-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.mjbox-fiche-card-actions .mjbox-btn {
    padding: 0.35rem 0.7rem;
    font-size: 12px;
}

.mjbox-btn-danger {
    background: #6b1f1f !important;
    color: #fff !important;
    border-color: #8b2c2c !important;
}

.mjbox-btn-danger:hover {
    background: #8b2c2c !important;
}

.mjbox-form-suppr-fiche {
    margin: 0;
}

/* ============================================================
   [mjbox_editer_fiche] — Formulaire d'édition
   ============================================================ */

.mjbox-form-fiche fieldset {
    margin: 1rem 0;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(200, 155, 74, 0.22);
    border-radius: 5px;
}

.mjbox-form-fiche legend {
    padding: 4px 12px;
    background: #c89b4a;
    color: #1a1a26;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.mjbox-sous-titre {
    margin: 1.2rem 0 0.6rem;
    color: #f3c97a;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    border-bottom: 1px dotted rgba(200, 155, 74, 0.3);
    padding-bottom: 4px;
}

/* Statistiques en blocs façon "carte D&D" */
.mjbox-stats-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin: 0.5rem 0;
}

.mjbox-stat-bloc {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(200, 155, 74, 0.3);
    border-radius: 5px;
    padding: 0.8rem 0.6rem;
    text-align: center;
}

.mjbox-stat-nom {
    font-size: 11px;
    color: #c89b4a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 700;
}

.mjbox-stat-score {
    width: 100%;
    padding: 0.4rem 0.2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.mjbox-stat-score:focus {
    outline: none;
    border-color: #c89b4a;
}

.mjbox-stat-mod {
    margin-top: 6px;
    background: #c89b4a;
    color: #1a1a26;
    border-radius: 3px;
    padding: 2px 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.mjbox-stat-mod-libelle {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-right: 5px;
}

.mjbox-info-bonus {
    margin: 0.8rem 0 0 0;
    padding: 8px 12px;
    background: rgba(200, 155, 74, 0.1);
    border-left: 3px solid #c89b4a;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
}

.mjbox-info-bonus #mjbox-bonus-maitrise {
    color: #f3c97a;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Cases à cocher en grille compacte (compétences) */
.mjbox-checkbox-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 12px;
}

.mjbox-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
}

.mjbox-checkbox-item input[type="checkbox"] {
    accent-color: #c89b4a;
    cursor: pointer;
}

/* Emplacements de sorts (9 niveaux) */
.mjbox-emp-sorts-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
}

.mjbox-emp-niveau {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.6rem;
    text-align: center;
}

.mjbox-emp-niveau strong {
    display: block;
    color: #c89b4a;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.mjbox-emp-niveau label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin: 2px 0;
}

.mjbox-emp-niveau input[type="number"] {
    width: 45px;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    text-align: center;
    font-size: 13px;
}

.mjbox-aide {
    margin: 0 0 6px 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Aide grise sous un champ de l'éditeur (ex. XP → niveau auto). */
.mjbox-aide-champ {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
    font-style: italic;
}

/* Champ readonly visuellement distinct (niveau quand XP > 0). */
.mjbox-champ input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

/* Fiche imprimable : on enlève les marges du conteneur thème pour que la
   fiche officielle prenne toute la largeur en print. */
.mjbox-fiche-imprimable {
    max-width: none;
    margin: 0;
    padding: 0;
}

@media print {
    .mjbox-fiche-imprimable {
        background: #fff !important;
    }
}

.mjbox-retour {
    margin: 0 0 1rem 0;
}

.mjbox-bouton-retour {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    color: #f3c97a;
    border: 1px solid rgba(200, 155, 74, 0.3);
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
}

.mjbox-bouton-retour:hover {
    background: rgba(200, 155, 74, 0.15);
}

.mjbox-meta {
    margin-top: 1rem;
    text-align: right;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile : on simplifie un peu */
@media (max-width: 600px) {
    .mjbox-fiche-card {
        flex-direction: column;
        align-items: stretch;
    }
    .mjbox-fiche-card-avatar {
        align-self: center;
    }
    .mjbox-fiche-card-actions {
        flex-direction: row;
    }
    .mjbox-fiche-card-actions .mjbox-btn {
        flex: 1;
    }
}

/* ============================================================
   Accordéon "Fiches actives" sur les cards d'aventure
   ([mjbox_mes_creations])
   ============================================================ */

.mjbox-aventure-meta {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

.mjbox-fiches-actives-accordeon {
    margin: 0.6rem 0 0.8rem;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(200, 155, 74, 0.18);
    border-radius: 4px;
}

.mjbox-fiches-actives-accordeon > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.55rem 0.8rem;
    font-size: 13px;
    color: #f3c97a;
    user-select: none;
    transition: background 0.15s ease;
    position: relative;
    padding-right: 28px;
}

.mjbox-fiches-actives-accordeon > summary::-webkit-details-marker { display: none; }

.mjbox-fiches-actives-accordeon > summary::after {
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(200, 155, 74, 0.6);
    font-size: 12px;
    transition: transform 0.15s ease;
}

.mjbox-fiches-actives-accordeon[open] > summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.mjbox-fiches-actives-accordeon > summary:hover {
    background: rgba(200, 155, 74, 0.07);
}

.mjbox-form-fiches-actives {
    padding: 0.7rem 0.9rem 0.9rem;
    border-top: 1px solid rgba(200, 155, 74, 0.18);
}

.mjbox-aide-fiches {
    margin: 0 0 0.7rem 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    font-style: italic;
}

.mjbox-fiches-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.mjbox-fiche-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mjbox-fiche-check:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(200, 155, 74, 0.25);
}

.mjbox-fiche-check.is-actif {
    background: rgba(200, 155, 74, 0.08);
    border-color: rgba(200, 155, 74, 0.3);
    border-left-color: #c89b4a;
}

.mjbox-fiche-check input[type="checkbox"] {
    accent-color: #c89b4a;
    cursor: pointer;
    flex: 0 0 auto;
}

.mjbox-fiche-check-avatar {
    flex: 0 0 32px;
    height: 32px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mjbox-fiche-check-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mjbox-fiche-check-avatar .mjbox-avatar-defaut {
    font-size: 18px;
}

.mjbox-fiche-check-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.mjbox-fiche-check-info strong {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mjbox-fiche-check-info small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.mjbox-fiches-vides {
    padding: 0.8rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 13px;
}

.mjbox-fiches-vides a {
    color: #c89b4a;
    text-decoration: none;
    font-weight: 600;
}

.mjbox-fiches-vides a:hover {
    text-decoration: underline;
}

.mjbox-btn-lancer {
    display: inline-block;
    margin-top: 4px;
}

/* ============================================================
   PHASE 3 — Widget « fiches joueurs » dans la barre du lecteur
   (templates/lecteur.php → div#dnd-barre-fiches)
   ============================================================ */

.dnd-barre-fiches {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 64px; /* juste au-dessus de la barre des dés */
    z-index: 60;
    background: linear-gradient(180deg, rgba(13, 13, 26, 0.98) 0%, rgba(20, 18, 34, 0.98) 100%);
    border-top: 1px solid rgba(200, 155, 74, 0.3);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
    color: #fdf8f0;
    font-family: 'Crimson Text', Georgia, serif;
    display: flex;
    align-items: stretch;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* État masqué : on glisse la barre hors écran vers le bas */
.dnd-barre-fiches.is-masquee {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ---- BOUTON FLOTTANT 🎴 Fiches : visible UNIQUEMENT quand la barre est masquée ----
   Sinon ça chevauche le dropdown "Compétence" en bas à droite de la barre. */
.dnd-barre-fiches-toggle {
    position: fixed;
    right: 14px;
    bottom: 14px; /* coller à la barre des dés */
    z-index: 70;
    display: none; /* caché par défaut, montré seulement si is-collapsed */
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #2a2a40 0%, #1a1a26 100%);
    color: #f3c97a;
    border: 1px solid #c89b4a;
    border-radius: 22px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
}

.dnd-barre-fiches-toggle.is-collapsed {
    display: inline-flex; /* visible uniquement quand la barre est masquée */
}

.dnd-barre-fiches-toggle:hover {
    background: #c89b4a;
    color: #1a1a26;
    transform: translateY(-1px);
}

.dnd-barre-fiches-toggle .dnd-toggle-icon {
    font-size: 14px;
}

.dnd-barre-fiches-toggle .dnd-toggle-icon::before {
    content: "▲ "; /* flèche montante pour "ouvrir" */
    font-size: 11px;
    margin-right: 4px;
    color: inherit;
}

/* ---- BOUTON ✕ INLINE dans la barre : ferme la barre proprement ---- */
.dnd-barre-fiches-fermer {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.dnd-barre-fiches-fermer:hover {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.dnd-barre-fiches.is-masquee .dnd-barre-fiches-fermer {
    display: none; /* pas besoin du bouton ✕ quand la barre est masquée */
}

/* Bandeau d'onglets : occupe ~55% de la barre, scrollable horizontal si trop de fiches */
.dnd-fiches-onglets {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1 1 auto;
    min-width: 0;
    border-right: 1px solid rgba(200, 155, 74, 0.2);
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 155, 74, 0.4) transparent;
}

.dnd-fiches-onglets::-webkit-scrollbar { height: 6px; }
.dnd-fiches-onglets::-webkit-scrollbar-thumb { background: rgba(200, 155, 74, 0.4); border-radius: 3px; }

.dnd-fiche-onglet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    transition: all 0.15s ease;
    min-width: 0;
    flex: 0 0 auto;
}

.dnd-fiche-onglet:hover {
    background: rgba(200, 155, 74, 0.1);
    border-color: rgba(200, 155, 74, 0.35);
}

.dnd-fiche-onglet.is-actif {
    background: rgba(200, 155, 74, 0.18);
    border-color: #c89b4a;
    box-shadow: 0 0 0 1px rgba(200, 155, 74, 0.35) inset;
}

.dnd-fiche-onglet-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.dnd-fiche-onglet-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dnd-fiche-onglet-corps {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
    min-width: 0;
    gap: 1px;
}

.dnd-fiche-onglet-nom {
    color: #f3c97a;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 13px;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dnd-fiche-onglet-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.dnd-fiche-onglet-pv {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.dnd-fiche-onglet-pv-val {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 42px;
}

.dnd-fiche-onglet-pv-barre {
    display: inline-block;
    width: 56px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.dnd-fiche-onglet-pv-rempli {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #6b3232 0%, #c0392b 60%, #b8893d 100%);
    transition: width 0.3s ease;
}

/* Panneau détail à droite */
.dnd-fiche-detail {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    min-width: 480px;
    max-width: 60%;
}

.dnd-fiche-detail-panneau {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.dnd-fiche-detail-panneau.is-actif {
    display: flex;
}

.dnd-fiche-detail-pv {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dnd-fiche-detail-libelle {
    color: #f3c97a;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    margin-right: 4px;
    letter-spacing: 0.5px;
}

.dnd-pv-mod {
    background: rgba(255, 255, 255, 0.05);
    color: #fdf8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    min-width: 32px;
    transition: all 0.1s ease;
}

.dnd-pv-mod:hover {
    background: #c89b4a;
    color: #1a1a26;
    border-color: #c89b4a;
}

.dnd-pv-mod[data-delta^="+"] { color: #6dd47a; border-color: rgba(109, 212, 122, 0.3); }
.dnd-pv-mod[data-delta^="+"]:hover { background: #2d6b32; color: #fff; border-color: #6dd47a; }
.dnd-pv-mod[data-delta^="-"] { color: #f38a8a; border-color: rgba(243, 138, 138, 0.3); }
.dnd-pv-mod[data-delta^="-"]:hover { background: #6b1f1f; color: #fff; border-color: #c0392b; }

.dnd-pv-actuels {
    width: 60px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 1px solid rgba(200, 155, 74, 0.4);
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
}

.dnd-pv-actuels:focus {
    outline: none;
    border-color: #c89b4a;
    background: rgba(0, 0, 0, 0.5);
}

.dnd-pv-max {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.dnd-pv-statut {
    margin-left: 5px;
    min-width: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.dnd-pv-statut.is-ok  { color: #6dd47a; }
.dnd-pv-statut.is-err { color: #f38a8a; }

/* Zone "Jets rapides" : 6 attributs + dropdown compétences */
.dnd-fiche-detail-jets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.dnd-jet-attr {
    background: rgba(255, 255, 255, 0.04);
    color: #fdf8f0;
    border: 1px solid rgba(200, 155, 74, 0.3);
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.1s ease;
    min-width: 50px;
}

.dnd-jet-attr:hover {
    background: #c89b4a;
    color: #1a1a26;
    border-color: #c89b4a;
}

.dnd-jet-attr:active {
    transform: scale(0.95);
}

.dnd-jet-competence {
    margin-left: 4px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fdf8f0;
    border: 1px solid rgba(200, 155, 74, 0.3);
    border-radius: 3px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    max-width: 220px;
}

.dnd-jet-competence:focus {
    outline: none;
    border-color: #c89b4a;
}

.dnd-jet-competence option {
    background: #1a1a26;
    color: #fdf8f0;
}

.dnd-fiche-detail-ressources {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
}

.dnd-fiche-detail-ressources strong {
    color: #f3c97a;
}

.dnd-fiche-detail-bonus {
    color: rgba(255, 255, 255, 0.6);
}

/* Petit padding bottom sur le main pour ne pas masquer du texte
   sous la barre des fiches quand elle est présente. */
.dnd-lecteur:has(.dnd-barre-fiches) .dnd-colonne-centre {
    padding-bottom: 160px;
}

/* Quand la barre est masquée, on libère de la place
   (le padding-bottom redescend juste au-dessus de la barre des dés). */
.dnd-lecteur:has(.dnd-barre-fiches.is-masquee) .dnd-colonne-centre {
    padding-bottom: 80px;
}

/* Mobile : empilement vertical */
@media (max-width: 720px) {
    .dnd-barre-fiches {
        flex-direction: column;
        max-height: none;
        bottom: 0;
    }
    .dnd-fiches-onglets {
        border-right: none;
        border-bottom: 1px solid rgba(200, 155, 74, 0.2);
    }
    .dnd-fiche-detail {
        min-width: 0;
        width: 100%;
        padding: 8px;
    }
    .dnd-fiche-detail-pv {
        flex-wrap: wrap;
    }
}
