/* Lot W2 : campagnes, table du MJ, vue joueur, livres d'aventure, cartes et aides de jeu (repris de chroniques-srd,
   aux couleurs de Shadowdark : rouge sang pour l'actif, lueur de torche pour la lumière). */

.chip-btn { font: inherit; font-size: .85rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); cursor: pointer; }
.chip-btn:hover { border-color: var(--torch); background: var(--torch-soft); }
.tag-x { background: none; border: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font: inherit; }
.titre-edit { font: inherit; color: inherit; background: transparent; border: 1px dashed transparent; border-radius: var(--radius-sm); width: min(100%, 28ch); padding: 0 4px; }
.titre-edit:hover, .titre-edit:focus { border-color: var(--line); }
.fav.on { color: var(--star); border-color: var(--star); }
.des-mode { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: .92rem; border: 0; padding: 0; margin: 4px 0; }
.des-mode input { accent-color: var(--blood); }

/* Campagnes */
.sommaire-campagne { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: .92rem; }
.card.session h3, .card.pnj-campagne h3 { margin-top: 0; }
.pnj-campagne:target { outline: 2px solid var(--torch); }
.pnj-campagne h3 .chip-btn { margin-left: 6px; }
.pnj-campagne details { margin: 8px 0; }
.pnj-campagne summary { cursor: pointer; color: var(--ink-soft); }
.campagne-compte h3 { margin-top: 0; }
.aides-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.aides-compte { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin: 6px 0 10px; }
.aide { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.aide.revelee { border-color: var(--torch); box-shadow: 0 0 0 1px var(--torch); }
.aide img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--line); }
.aide figcaption { padding: 6px 8px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.aide-titre { flex: 1 1 100%; font: inherit; padding: 3px 5px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.aide-revele { display: inline-flex; gap: 4px; align-items: center; }

/* Table du MJ */
.table-jeu { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1.25fr); gap: 18px; align-items: start; }
.table-jeu-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
@media (max-width: 1000px) { .table-jeu { grid-template-columns: 1fr; } .table-jeu-side { position: static; max-height: none; } }
.tag.round { font-size: .95rem; padding: 4px 10px; }
.combattant { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; border-left: 4px solid var(--line); }
.combattant.pj { border-left-color: var(--torch); }
.combattant.actif { box-shadow: 0 0 0 2px var(--blood); border-left-color: var(--blood); }
.combattant.hors { opacity: .55; }
.combattant.mourant { background: var(--blood-soft); }
.combattant-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.combattant-nom { font-size: 1.05rem; }
.combattant-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.combattant-actions .fav { width: 34px; height: 34px; margin-left: 2px; font-size: 1rem; }
.combattant .init { width: 62px; font: inherit; font-weight: 700; text-align: center; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.pv { font-weight: 700; }
.pv.bas { color: var(--blood); }
.pv-barre { height: 5px; background: var(--line); border-radius: 3px; margin: 6px 0; overflow: hidden; }
.pv-barre span { display: block; height: 100%; background: linear-gradient(90deg, var(--blood), var(--torch)); }
.filters.compact { gap: 6px; margin: 4px 0; }
.filters.compact input, .filters.compact select { padding: 4px 6px; }
.attaques .chip-btn { white-space: nowrap; }
.moral { padding: 6px 10px; border-left: 3px solid var(--blood); background: var(--blood-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.journal ol { padding-left: 0; list-style: none; margin: 0; max-height: 55vh; overflow-y: auto; font-size: .86rem; }
.journal li { padding: 3px 0; border-bottom: 1px dotted var(--line); }
.rencontre-tiree { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; font-size: .92rem; }
.rencontre-tiree p { margin: 0 0 .4em; }
tr.ligne-active td { background: var(--blood-soft); font-weight: 600; }

/* Lumière */
.lumieres { display: grid; gap: 8px; margin: 6px 0 10px; }
.lumiere { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--torch-soft); }
.lumiere.eteinte { background: none; opacity: .65; }
.lumiere.basse .lumiere-temps { color: var(--blood); }
.lumiere-temps { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.lumiere-barre { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.lumiere-barre span { display: block; height: 100%; background: var(--torch); box-shadow: 0 0 8px var(--glow); }
.lumiere-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.lumiere-noire { margin: 0; padding: 6px 8px; background: var(--night); color: var(--night-ink); border-radius: var(--radius-sm); display: flex; gap: 6px; align-items: center; }

/* Vue joueur */
.combat-joueur { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .combat-joueur { grid-template-columns: 1fr; } }
.combat-etat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jets-combat { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 8px; background: var(--torch-soft); border-radius: var(--radius-sm); }

/* Livres d'aventure */
.livre-page { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 24px; align-items: start; }
.livre-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.livre-side h3:first-child { margin-top: 0; }
@media (max-width: 1000px) { .livre-page { grid-template-columns: 1fr; } .livre-side { position: static; max-height: none; } }
.livre-texte p { text-align: justify; hyphens: auto; }
.livre-texte .page-livre.visible { display: block; height: auto; margin: 18px 0 6px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: .75rem; color: var(--muted); }
.illus-livre { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0 14px; }
.illus-livre img { max-width: min(100%, 520px); max-height: 520px; object-fit: contain; border-radius: var(--radius-sm); }
/* Encre noire sur fond transparent : lisible en thème sombre sur un fond papier. */
.card.mention p { margin: 0; }

/* Cartes interactives */
.carte-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.carte-vue { position: relative; height: 74vh; min-height: 420px; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-sm);
             background: var(--night); touch-action: none; cursor: grab; user-select: none; }
.carte-vue:active { cursor: grabbing; }
.carte-calque { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }
.carte-calque img { display: block; width: 100%; height: 100%; pointer-events: none; }
.repere { position: absolute; width: 28px; height: 28px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer;
          transform: translate(-50%, -50%) scale(var(--inv)); border: 2px solid transparent; background: transparent;
          color: transparent; font: 700 11px/1 var(--font-body); min-height: 0; }
.repere.nom { width: 34px; height: 34px; }
.repere:hover, .repere:focus-visible { border-color: #ff9b3d; background: color-mix(in srgb, #ff9b3d 30%, transparent); outline: none; }
.repere.actif { border-color: #fff; background: color-mix(in srgb, #d23c30 55%, transparent); box-shadow: 0 0 0 3px #d23c30; }
.carte-outils { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.carte-outils button { width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink);
                       font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow); }
.carte-panneau { max-height: 74vh; overflow: auto; }
.carte-fiche h3 { margin-top: 0; }
.carte-filtre { width: 100%; margin: 10px 0 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: inherit; }
.carte-liste { list-style: none; margin: 0; padding: 0; }
.carte-liste button { width: 100%; text-align: left; padding: 5px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; cursor: pointer; min-height: 0; }
.carte-liste button:hover { background: var(--torch-soft); }
.carte-liste button.actif { background: var(--blood-soft); font-weight: 600; }
.carte-liste .cle { display: inline-block; min-width: 2.4em; color: var(--heading); font-weight: 700; }
.cartes-livre { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cartes-livre a { display: block; color: inherit; text-decoration: none; }
.cartes-livre img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--night); }
@media (max-width: 900px) {
    .carte-page { grid-template-columns: 1fr; }
    .carte-vue { height: 62vh; }
    .carte-panneau { max-height: none; }
}
