/* Thème « fiche de perso » sombre : cadres à coins coupés, mobile d'abord. */
:root {
  --fond: #11141a;
  --fond-2: #0c0e12;
  --panneau: #14171d;
  --panneau-2: #1c2028;
  --cadre: #59606d;
  --cadre-doux: #3a404b;
  --trait: #2a2f38;
  --texte: #f1f1ef;
  --doux: #a3aab4;
  --tres-doux: #6e7580;
  --rouge: #c53131;
  --rouge-clair: #e8574d;
  --vert: #3a9b55;
  --or: #d9a93f;
  --bleu: #1d6db5;
  --coin: 7px;
  --titre: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(40, 110, 120, .18), transparent 70%),
    radial-gradient(900px 600px at 0% 100%, rgba(30, 60, 90, .2), transparent 70%),
    var(--fond);
  background-attachment: fixed;
  color: var(--texte);
  font: 14px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--rouge-clair); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--titre); }
h1 { margin: 0; font-size: 1.5rem; line-height: 1.15; }
h2 { margin: 1.1rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--doux); }
h3 { margin: .2rem 0; font-size: 1rem; }
.lib {
  font-family: var(--titre); text-transform: uppercase; letter-spacing: .08em;
  font-size: .66rem; color: var(--doux); font-weight: 700; line-height: 1.2;
}
.doux { color: var(--doux); }
.tres-doux { color: var(--tres-doux); }
.ok { color: var(--vert); font-weight: 600; }
.alerte { color: var(--or); font-weight: 600; }

/* ---------- cadre à coins coupés ---------- */
.cadre {
  --poly: polygon(var(--coin) 0, calc(100% - var(--coin)) 0, 100% var(--coin), 100% calc(100% - var(--coin)),
                  calc(100% - var(--coin)) 100%, var(--coin) 100%, 0 calc(100% - var(--coin)), 0 var(--coin));
  position: relative; isolation: isolate; clip-path: var(--poly); background: var(--cadre);
}
.cadre::before {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: var(--panneau); clip-path: var(--poly);
}
.pastille-hex {
  --poly: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
}

/* ---------- barre du haut (grand écran) et barre du bas (téléphone) ---------- */
.barre {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  height: 48px; padding: 0 1rem; background: #08090b; border-bottom: 1px solid #2b2f36;
}
.marque { font-family: var(--titre); font-weight: 700; font-size: 1.05rem; color: #fff; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.marque b { color: var(--rouge); }
.barre nav { display: flex; gap: .1rem; margin-left: auto; }
.barre nav a, .barre nav button {
  color: #cfd3d8; padding: .35rem .7rem; border: 0; background: none; cursor: pointer; border-radius: 4px;
  font-family: var(--titre); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.barre nav a:hover, .barre nav button:hover { background: #1a1d22; text-decoration: none; }
.barre nav a.actif { color: #fff; box-shadow: inset 0 -2px 0 var(--rouge); border-radius: 0; }
.bas { display: none; }
@media (max-width: 899px) {
  .barre nav { display: none; }
  .barre { height: 44px; }
  body { padding-bottom: 64px; }
  .bas {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
    background: #08090b; border-top: 1px solid #2b2f36;
  }
  .bas a, .bas button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem;
    color: #9da3ab; background: none; border: 0; font: 600 .62rem var(--titre); text-transform: uppercase; letter-spacing: .05em; width: 100%;
  }
  .bas a.actif { color: #fff; }
  .bas a.actif svg { color: var(--rouge); }
  .bas svg { width: 22px; height: 22px; }
  .bas form { display: contents; }
}

main { max-width: 1200px; margin: 0 auto; padding: .8rem 1rem 1.5rem; }
.etroit { max-width: 760px; }

/* ---------- éléments communs ---------- */
.panneau {
  background: rgba(20, 23, 29, .92); border: 1px solid var(--cadre-doux); border-radius: 4px;
  padding: .75rem .9rem; margin-bottom: .7rem;
}
.panneau-titre {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin: -.75rem -.9rem .6rem; padding: .45rem .9rem; border-bottom: 1px solid var(--trait);
  font-family: var(--titre); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--doux); font-weight: 700;
}
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--fond-2); border: 1px solid var(--cadre-doux); border-radius: 3px;
  padding: .4rem .5rem; min-height: 38px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--rouge); border-color: var(--rouge); }
input[type=number] { width: 5rem; }
.bouton, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 36px; padding: .35rem .85rem; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--rouge); background: var(--rouge); color: #fff;
  font: 700 .78rem var(--titre); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
}
.bouton:hover, button:hover { filter: brightness(1.12); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; filter: none; }
.second { background: transparent !important; color: var(--texte) !important; border-color: var(--cadre) !important; }
.vert { background: var(--vert) !important; border-color: var(--vert) !important; }
.petit { min-height: 28px !important; padding: .15rem .55rem !important; font-size: .7rem !important; }
button.lien {
  background: none; border: 0; padding: 0; min-height: 0; color: var(--rouge-clair);
  font: 400 .82rem Roboto, sans-serif; text-transform: none; letter-spacing: 0;
}
form.enligne { display: inline; }
.ligne { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ligne + .ligne { margin-top: .5rem; }
.pile > * + * { margin-top: .5rem; }
.etiquette {
  display: inline-block; font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .06em;
  padding: .08rem .4rem; border-radius: 2px; border: 1px solid var(--cadre-doux); color: var(--doux); vertical-align: middle;
}
.etiquette.rouge { border-color: #7d2a24; color: #f0938b; }
.etiquette.vert { border-color: #2a6b3b; color: #86d39c; }
.messages { list-style: none; padding: 0; margin: 0 0 .7rem; }
.messages li { padding: .55rem .8rem; border-radius: 3px; margin-bottom: .4rem; background: var(--panneau-2); border-left: 3px solid var(--bleu); }
.messages .error { border-left-color: var(--rouge); }
.messages .warning { border-left-color: var(--or); }
.messages .success { border-left-color: var(--vert); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .35rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
th { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); }
tr:last-child td { border-bottom: 0; }
.nb { text-align: center; white-space: nowrap; }
.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.3rem var(--titre); color: #fff;
  background: radial-gradient(circle at 35% 30%, #5b2622, #1a0d0e); border: 2px solid #7d8591;
}
.boite {  /* valeur dans une petite boîte, comme les bonus de compétences */
  display: inline-block; min-width: 2.4rem; text-align: center; font-weight: 700;
  padding: .1rem .35rem; border: 1px solid var(--cadre); border-radius: 3px; background: var(--fond-2);
}
.point { width: .6rem; height: .6rem; border-radius: 50%; border: 1px solid var(--cadre); flex: none; display: inline-block; }
.point.oui { background: var(--texte); border-color: var(--texte); }
.point.double { background: var(--or); border-color: var(--or); }
.point.moitie { background: linear-gradient(90deg, var(--texte) 50%, transparent 50%); }
.cases { display: inline-flex; gap: .3rem; flex-wrap: wrap; vertical-align: middle; }
.case {
  width: 1.15rem; height: 1.15rem; min-height: 0 !important; padding: 0 !important;
  border: 1px solid var(--cadre) !important; border-radius: 2px !important; background: var(--fond-2) !important;
}
.case.cochee { background: var(--rouge) !important; border-color: var(--rouge) !important; }
details > summary { cursor: pointer; }

/* ---------- fiche : en-tête ---------- */
.tete-perso { display: flex; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.tete-perso .nom { flex: 1; min-width: 0; }
.tete-perso h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tete-perso .sous { color: var(--doux); font-size: .82rem; }
.tete-perso .boutons { display: flex; gap: .4rem; flex-wrap: wrap; }
.pilule-pv {
  list-style: none; user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 5.6rem; padding: .3rem .6rem; border-radius: 3px; background: var(--bleu); color: #fff; cursor: pointer;
}
.pilule-pv::-webkit-details-marker { display: none; }
.pilule-pv .val { font: 700 1.05rem var(--titre); }
.pilule-pv .lib { color: #d6e7f7; font-size: .58rem; }

/* téléphone : rangées compactes */
.rangee-etats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .6rem; }
.rangee-etats > details > summary {
  list-style: none; text-align: center; padding: .55rem; background: var(--panneau-2); border: 1px solid var(--cadre-doux);
  font: 700 .72rem var(--titre); text-transform: uppercase; letter-spacing: .08em; border-radius: 3px;
}
.rangee-etats > details > summary::-webkit-details-marker { display: none; }
.rangee-etats > details[open] { grid-column: 1 / -1; order: 3; }
.rangee-etats .contenu { padding: .6rem .2rem 0; }
.stats-rapides { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .7rem; text-align: center; }
.stats-rapides .val { font: 700 1.35rem var(--titre); line-height: 1.1; }
.stats-rapides .lib { font-size: .58rem; }
.panneau-pv { margin-bottom: .7rem; }

/* caractéristiques */
.caracs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.carac { text-align: center; padding: .45rem .3rem .5rem; }
.carac .mod {
  margin: .25rem auto; width: 70%; max-width: 4.2rem; padding: .15rem 0;
  font: 700 1.6rem/1.15 var(--titre); border: 1px solid var(--cadre-doux); background: var(--fond-2);
}
.carac .score {
  display: inline-block; min-width: 2.6rem; padding: 0 .5rem; border-radius: 999px;
  border: 1px solid var(--cadre); background: var(--fond-2); font-weight: 700;
}
.sauvegardes { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.sauvegarde { display: flex; align-items: center; gap: .4rem; padding: .35rem .9rem; }
.sauvegarde .nom { flex: 1; font: 700 .72rem var(--titre); text-transform: uppercase; letter-spacing: .05em; }
.passif { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.passif .boite { min-width: 2.2rem; }
.passif span:last-child { font: 700 .66rem var(--titre); text-transform: uppercase; letter-spacing: .06em; color: var(--doux); }

/* compétences */
.competences { list-style: none; margin: 0; padding: 0; }
.competences li { display: grid; grid-template-columns: 1rem 2.2rem 1fr auto; gap: .4rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--trait); }
.competences li:last-child { border-bottom: 0; }
.competences .carac-abr { font: 700 .62rem var(--titre); color: var(--tres-doux); }
.competences .entete { font: 700 .6rem var(--titre); color: var(--doux); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--cadre-doux); }

/* onglets */
.onglets {
  display: flex; overflow-x: auto; scrollbar-width: none; gap: .1rem;
  border-bottom: 1px solid var(--cadre-doux); margin: -.75rem -.9rem .7rem; padding: 0 .4rem;
  position: sticky; top: 44px; z-index: 10; background: #12151b;
}
.onglets::-webkit-scrollbar { display: none; }
.onglets a {
  padding: .65rem .6rem; white-space: nowrap; color: var(--doux); border-bottom: 2px solid transparent;
  font: 700 .74rem var(--titre); text-transform: uppercase; letter-spacing: .06em;
}
.onglets a:hover { color: #fff; text-decoration: none; }
.onglets a.actif { color: #fff; border-bottom-color: var(--rouge); }
.sous-titre-section {
  margin: .9rem 0 .35rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rouge);
  font: 700 .72rem var(--titre); text-transform: uppercase; letter-spacing: .1em; color: var(--rouge-clair);
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
.sous-titre-section:first-child { margin-top: 0; }

/* attaques */
.attaques td { padding: .45rem .3rem; }
.attaques .nom { font-weight: 600; }
.attaques .detail { color: var(--tres-doux); font-size: .74rem; }
.compteur { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .4rem 0; border-bottom: 1px solid var(--trait); }
.compteur:last-child { border-bottom: 0; }
.compteur .nom { flex: 1 1 8rem; min-width: 0; }
.compteur .recharge { color: var(--tres-doux); font-size: .72rem; }
.ligne-objet { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.ligne-objet:last-child { border-bottom: 0; }
.ligne-objet .nom { flex: 1 1 9rem; min-width: 0; }
.capacite { border-bottom: 1px solid var(--trait); padding: .45rem 0; }
.capacite:last-child { border-bottom: 0; }
.capacite summary { list-style: none; display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.capacite summary::-webkit-details-marker { display: none; }
.capacite summary::after { content: "+"; color: var(--doux); }
.capacite[open] summary::after { content: "–"; }
.description { color: #d9d8d4; font-size: .88rem; }
.description p { margin: .35rem 0; }

/* PV (grand écran) */
.bloc-pv { display: grid; grid-template-columns: 5.2rem 1fr; gap: .6rem; align-items: center; padding: .5rem .7rem; }
.bloc-pv .saisie { display: grid; gap: .25rem; }
.bloc-pv .saisie input { width: 100%; text-align: center; min-height: 30px; padding: .15rem; }
.bloc-pv .saisie button { width: 100%; min-height: 26px; padding: 0 .3rem; font-size: .66rem; }
.bloc-pv .chiffres { display: grid; grid-template-columns: 1fr auto 1fr 1fr; align-items: end; text-align: center; gap: .2rem; }
.bloc-pv .chiffres .val { font: 700 1.7rem/1.1 var(--titre); }
.bloc-pv .sep { font: 400 1.4rem var(--titre); color: var(--tres-doux); padding-bottom: .1rem; }
.bloc-pv .titre { grid-column: 1 / -1; text-align: center; }
.barre-pv { height: 5px; background: var(--fond-2); border-radius: 3px; overflow: hidden; }
.barre-pv span { display: block; height: 100%; background: var(--vert); }
.barre-pv span.moyen { background: var(--or); }
.barre-pv span.bas { background: var(--rouge); }

/* ---------- grilles de la fiche ---------- */
@media (max-width: 899px) {
  .seulement-bureau, .fiche-haut { display: none !important; }
  .panneau-pv { display: none; }
  #ouvre-pv:checked ~ .panneau-pv { display: block; }
}
@media (min-width: 900px) {
  .seulement-mobile { display: none !important; }
  .fiche-haut {
    display: grid; gap: .5rem; margin-bottom: .7rem;
    grid-template-columns: repeat(6, minmax(0, 1fr)) repeat(3, minmax(0, .8fr)) minmax(0, 2.6fr);
  }
  .fiche-haut > * { min-width: 0; }
  .fiche-haut .caracs { display: contents; }
  .fiche-haut .stat { text-align: center; padding: .5rem .3rem; display: flex; flex-direction: column; justify-content: center; }
  .fiche-haut .stat .val { font: 700 1.6rem/1.15 var(--titre); }
  .fiche-cols {
    display: grid; gap: 0 .7rem; align-items: start;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-areas: "jets droite" "comp droite";
  }
  .fiche-cols > :nth-child(1) { grid-area: jets; }
  .fiche-cols > :nth-child(2) { grid-area: comp; }
  .fiche-cols > :nth-child(3) { grid-area: droite; grid-row: 1 / span 2; }
  .fiche-haut .bloc-pv { grid-column: 1 / -1; justify-self: end; width: min(100%, 420px); }
  .colonne-droite-haut { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .5rem; margin-bottom: .7rem; align-items: stretch; }
  .colonne-droite-haut > .panneau { min-width: 0; }
  .colonne-droite-haut .stat { text-align: center; padding: .5rem .8rem; display: flex; flex-direction: column; justify-content: center; }
  .colonne-droite-haut .stat .val { font: 700 1.5rem var(--titre); }
  .bouclier { clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%) !important; padding-bottom: 1rem !important; }
  .bouclier::before { clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%) !important; }
  .onglets { top: 48px; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .fiche-haut { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .fiche-cols { grid-template-columns: 250px 280px minmax(0, 1fr); grid-template-areas: "jets comp droite"; }
  .fiche-cols > :nth-child(3) { grid-row: auto; }
  .fiche-haut .bloc-pv { grid-column: auto; width: auto; justify-self: stretch; }
}

/* ---------- autres pages ---------- */
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; margin-bottom: .8rem; }
.identite { flex: 1 1 200px; min-width: 0; }
.identite .sous { color: var(--doux); font-size: .85rem; margin-top: .1rem; }
.cartes { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.carte-perso { display: flex; gap: .8rem; align-items: center; color: inherit; }
.carte-perso:hover { text-decoration: none; border-color: var(--cadre); }
.filtres { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .filtres { grid-template-columns: 2fr 1fr 1fr 1fr auto; } }
.filtres input, .filtres select { width: 100%; }
.resultat { display: flex; justify-content: space-between; gap: .6rem; padding: .5rem .1rem; border-bottom: 1px solid var(--trait); }
.resultat:last-child { border-bottom: 0; }
.proprietes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .7rem; }
.proprietes > div { padding: .45rem .6rem; }
.caracs-saisie { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (min-width: 600px) { .caracs-saisie { grid-template-columns: repeat(6, 1fr); } }
.caracs-saisie label { text-align: center; padding: .45rem .3rem; }
.caracs-saisie input { width: 100%; text-align: center; font-weight: 700; font-size: 1.1rem; margin: .2rem 0; }

/* combat */
.combat-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: space-between; margin-bottom: .7rem; }
.round { font: 700 1.1rem var(--titre); }
.participant {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: center;
  background: rgba(20, 23, 29, .95); border: 1px solid var(--cadre-doux); border-left: 3px solid var(--cadre);
  border-radius: 3px; padding: .55rem .75rem; margin-bottom: .45rem;
}
.participant.joueur { border-left-color: var(--bleu); }
.participant.monstre { border-left-color: var(--rouge); }
.participant.son-tour { box-shadow: 0 0 0 1px var(--or), 0 0 12px rgba(217, 169, 63, .25); }
.participant.a-terre { opacity: .5; }
.participant .init { font: 700 1.15rem var(--titre); text-align: center; padding: .2rem 0; border: 1px solid var(--cadre); background: var(--fond-2); }
.participant .nom { font-weight: 700; }
.participant .pvs { font: 700 1.1rem var(--titre); text-align: right; white-space: nowrap; }
.participant .barre-pv { grid-column: 2 / -1; }
.participant .outils { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .3rem; }
.participant .outils input[type=number] { width: 4.2rem; }

@media (max-width: 600px) {
  main { padding: .6rem .6rem 1rem; }
  h1 { font-size: 1.25rem; }
}

/* illustrations et bloc de stats des créatures */
.illustration { margin: 0 0 .8rem; text-align: center; }
.illustration img {
  max-width: 100%; max-height: 60vh; border-radius: 4px;
  border: 1px solid var(--cadre-doux); background: var(--fond-2);
}
.miniature {
  width: 2.6rem; height: 2.6rem; object-fit: cover; border-radius: 50%;
  border: 1px solid var(--cadre); vertical-align: middle; margin-right: .5rem; flex: none;
}
.miniature.vide { display: inline-block; background: var(--panneau-2); }
.bloc-stats {
  background: #f1e8d4; color: #2b211a; border-top: 4px solid #8a1f12; border-bottom: 4px solid #8a1f12;
  border-radius: 3px; padding: .8rem 1rem; display: grid; gap: .35rem;
}
.bloc-stats .lib { color: #7a1c10; }
.bloc-stats .doux { color: #6a5a4a; }
.bloc-stats .description { color: #2b211a; margin: .2rem 0; }
.bloc-stats .sous-titre-section { color: #7a1c10; border-bottom-color: #7a1c10; }
.ligne-stats { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.caracs-bloc { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin: .3rem 0; }
@media (min-width: 600px) { .caracs-bloc { grid-template-columns: repeat(6, 1fr); } }
.caracs-bloc > div {
  display: flex; flex-direction: column; align-items: center; background: #e6d8bb;
  border-radius: 3px; padding: .25rem; font-size: .85rem;
}
.resultat > * { min-width: 0; }
.resultat .resume { text-align: right; font-size: .8rem; flex: 0 1 40%; }

/* pages de campagne */
.tete-page { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; padding-bottom: .6rem; border-bottom: 2px solid var(--bleu); }
.fil { font: 700 .7rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); margin-bottom: .4rem; }
.cartes-campagnes { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte-campagne { text-align: center; padding: 1rem; }
.titre-campagne { margin: 0; font-size: 1.25rem; color: var(--texte); text-transform: none; letter-spacing: 0; }
.carte-campagne .compteurs { justify-content: center; gap: 2rem; margin: .7rem 0; }
.carte-campagne .compteurs div { display: flex; flex-direction: column; }
.carte-campagne .compteurs strong { font: 700 1.5rem var(--titre); }
.carte-campagne .role { padding: .4rem 0; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.carte-campagne .liens { justify-content: center; gap: 1.2rem; margin-top: .6rem; font: 700 .78rem var(--titre); text-transform: uppercase; }
.grille-campagne { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grille-campagne { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.invitation { border: 1px dashed var(--bleu); border-radius: 4px; padding: .7rem; margin-bottom: .8rem; text-align: center; }
.invitation input { width: 100%; text-align: center; color: #6fb0ea; background: transparent; border: 0; }
.mj-carte { gap: .7rem; margin: .4rem 0 .6rem; }
.cartes-persos { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.carte-banniere { border: 1px solid var(--cadre-doux); border-radius: 4px; overflow: hidden; background: var(--panneau); }
.carte-banniere .banniere {
  display: flex; gap: .7rem; align-items: center; padding: .9rem .8rem;
  background: linear-gradient(120deg, #2a1712, #1a2430 70%), var(--panneau-2);
}
.carte-banniere .nom { font: 700 1.1rem var(--titre); }
.carte-banniere .sous { color: var(--doux); font-size: .78rem; }
.carte-banniere .actions { display: flex; justify-content: space-around; padding: .45rem; font: 700 .75rem var(--titre); text-transform: uppercase; }

/* création de rencontre */
.tete-rencontre { margin-bottom: .8rem; padding: .8rem; border-radius: 4px; background: linear-gradient(120deg, #1d2a33, #15181e); border: 1px solid var(--cadre-doux); }
.nom-rencontre { flex: 1; font: 700 1.4rem var(--titre); background: transparent; border: 0; border-bottom: 1px dashed var(--cadre); border-radius: 0; color: var(--texte); }
.tete-rencontre .infos { gap: .4rem 1.4rem; margin-top: .5rem; font-weight: 600; }
.grille-rencontre { display: grid; gap: .8rem; }
@media (min-width: 1000px) {
  .grille-rencontre { grid-template-columns: minmax(0, 1fr) 330px; }
  .resume-rencontre { order: 2; position: sticky; top: 60px; }
}
.val-rencontre { font: 700 1.2rem var(--titre); margin-bottom: .4rem; }
.jauge { height: 8px; background: var(--fond-2); border-radius: 4px; overflow: hidden; margin: .5rem 0; }
.jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--vert), var(--or), var(--rouge)); }
.filtres-rencontre { display: grid; gap: .45rem; grid-template-columns: 1fr 1fr; padding: .6rem; }
.filtres-rencontre input { grid-column: 1 / -1; }
@media (min-width: 700px) { .filtres-rencontre { grid-template-columns: 2fr 1fr 1fr .8fr .8fr auto; } .filtres-rencontre input { grid-column: auto; } }
.entete-monstres, .ligne-monstre {
  display: grid; align-items: center; gap: .4rem;
  grid-template-columns: minmax(0, 1fr) 2.4rem auto;
}
.entete-monstres { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); padding-bottom: .3rem; border-bottom: 1px solid var(--cadre-doux); }
.ligne-monstre { padding: .4rem 0; border-bottom: 1px solid var(--trait); }
.ligne-monstre .nom { display: flex; align-items: center; min-width: 0; color: var(--texte); font-weight: 600; }
.ligne-monstre .nom span { overflow: hidden; text-overflow: ellipsis; }
.entete-monstres span:nth-child(2), .entete-monstres span:nth-child(3), .ligne-monstre .type, .ligne-monstre .taille { display: none; }
.ligne-monstre .fp { text-align: center; font-weight: 700; }
.points { display: inline-flex; gap: 3px; }
.points i { width: 8px; height: 8px; border-radius: 50%; background: var(--trait); }
.points.p1 i:nth-child(-n+1) { background: var(--vert); }
.points.p2 i:nth-child(-n+2) { background: var(--or); }
.points.p3 i:nth-child(-n+3) { background: #e07b2a; }
.points.p4 i { background: var(--rouge); }
@media (min-width: 700px) {
  .entete-monstres, .ligne-monstre { grid-template-columns: minmax(0, 1fr) 8rem 3rem 2.5rem 4rem auto; }
  .entete-monstres span:nth-child(2), .entete-monstres span:nth-child(3), .ligne-monstre .type, .ligne-monstre .taille { display: block; }
}
@media (max-width: 699px) { .entete-monstres span:nth-child(5) { display: none; } .ligne-monstre .points { display: none; } }
.grille-rencontre > *, .grille-campagne > * { min-width: 0; }
.filtres-rencontre > * { min-width: 0; width: 100%; }

/* ---------- jets de dés (des.js) ---------- */
html { background: var(--fond); }
.lancable { cursor: pointer; transition: background-color .12s, border-color .12s, color .12s; }
.lancable:hover, .lancable:focus-visible { outline: none; }
.boite.lancable:hover, .boite.lancable:focus-visible, .carac .mod.lancable:hover, .carac .mod.lancable:focus-visible {
  border-color: var(--rouge); background: #2a1514; color: #fff;
}
.competences li.lancable:hover, .competences li.lancable:focus-visible { background: rgba(197, 49, 49, .12); }
.competences li.lancable:hover .boite { border-color: var(--rouge); }
.stat.lancable:hover::before, .stat.lancable:focus-visible::before { background: #241818; }
.stats-rapides .lancable { border-radius: 4px; }
.stats-rapides .lancable:active { background: rgba(197, 49, 49, .15); }
.degats.lancable { font-weight: 600; border-bottom: 1px dashed var(--cadre); }
.degats.lancable:hover, .degats.lancable:focus-visible { color: var(--rouge-clair); border-bottom-color: var(--rouge-clair); }
.souligne.lancable { border-bottom: 1px dashed var(--cadre); }
.souligne.lancable:hover { color: var(--rouge-clair); }
#zone-jets {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem;
  width: min(360px, calc(100vw - 1.5rem)); pointer-events: none;
}
@media (max-width: 899px) { #zone-jets { right: .75rem; bottom: calc(72px + env(safe-area-inset-bottom)); } }
.carte-jet {
  pointer-events: auto; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; align-items: center;
  padding: .7rem 2rem .7rem .9rem; border-radius: 6px; background: #1b1f27; border: 1px solid var(--cadre);
  border-left: 4px solid var(--rouge); box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  animation: jet-entre .18s ease-out; transition: opacity .35s, transform .35s;
}
.carte-jet.part { opacity: 0; transform: translateX(20px); }
.carte-jet.nat20 { border-left-color: var(--or); }
.carte-jet.nat20 .total { color: var(--or); }
.carte-jet.nat1 .total { color: #8b939e; }
.carte-jet .titre { font: 700 .95rem var(--titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-jet .type { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--rouge-clair); }
.carte-jet .detail { color: var(--doux); font-size: .8rem; margin-top: .1rem; }
.carte-jet .total { font: 700 2.3rem/1 var(--titre); min-width: 2.6rem; text-align: center; }
.carte-jet .outils { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .4rem; }
.carte-jet .fermer {
  position: absolute; top: .2rem; right: .25rem; min-height: 0; padding: .1rem .35rem; background: none; border: 0;
  color: var(--tres-doux); font: 400 1.1rem Roboto, sans-serif;
}
@keyframes jet-entre { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.historique-jets {
  position: fixed; right: 1rem; top: 60px; z-index: 55; width: min(360px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 140px); overflow-y: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}
.ligne-jet { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid var(--trait); }
.ligne-jet .titre { font-weight: 600; }
.ligne-jet .total { font: 700 1.3rem var(--titre); }

/* ---------- PV ---------- */
.bloc-pv .pv-droite, .panneau-pv .pv-droite { min-width: 0; }
.chiffres { display: grid; grid-template-columns: 1fr auto 1fr 1fr; align-items: end; text-align: center; gap: .2rem; }
.chiffres .val { font: 700 1.7rem/1.1 var(--titre); }
.chiffres .sep { font: 400 1.4rem var(--titre); color: var(--tres-doux); padding-bottom: .1rem; }
.pv-droite .barre-pv { margin: .35rem 0; }
.pied-pv { display: flex; align-items: center; justify-content: center; gap: .4rem; flex-wrap: wrap; }
.pied-pv .temp { display: flex; gap: .3rem; align-items: center; }
.pied-pv .temp input { width: 4rem; min-height: 28px; padding: .1rem .3rem; }
.panneau-pv .saisie { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; margin-bottom: .7rem; }
.panneau-pv .saisie input { width: 100%; text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ---------- états ---------- */
.etats .puces { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0; }
.puce-etat {
  min-height: 26px !important; padding: .1rem .5rem !important; font-size: .68rem !important;
  background: #3a1715 !important; border-color: #7d2a24 !important; color: #f0b0aa !important;
}
.choix-etats summary { color: var(--rouge-clair); font-size: .82rem; margin-top: .2rem; list-style: none; }
.choix-etats summary::-webkit-details-marker { display: none; }
.choix-etats summary::after { content: " ▾"; }
.choix-etats[open] summary::after { content: " ▴"; }
.grille-etats { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr)); gap: .3rem; margin-top: .4rem; }
.bascule {
  min-height: 32px !important; padding: .15rem .4rem !important; font-size: .68rem !important; justify-content: flex-start !important;
  background: var(--fond-2) !important; border-color: var(--cadre-doux) !important; color: var(--doux) !important;
}
.bascule.actif { background: #3a1715 !important; border-color: var(--rouge) !important; color: #fff !important; }
.bascule.actif::before { content: "✓"; color: var(--rouge-clair); }

/* ---------- épuisement ---------- */
.epuisement { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.pip {
  width: 2rem; min-height: 2rem !important; padding: 0 !important; border-radius: 50% !important;
  background: var(--fond-2) !important; border-color: var(--cadre) !important; color: var(--doux) !important; font-size: .75rem !important;
}
.pip.plein { background: var(--rouge) !important; border-color: var(--rouge) !important; color: #fff !important; }
.epuisement .doux { font-size: .8rem; margin-left: .3rem; }

/* onglets : le dernier visible s'estompe quand la barre défile */
@media (max-width: 899px) {
  .onglets { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .onglets a { padding: .7rem .65rem; }
}
.choix-etats { position: relative; }
.choix-etats .grille-etats { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) {
  .choix-etats[open] .grille-etats {
    position: absolute; right: 0; top: 1.6rem; z-index: 40; width: 19rem; padding: .6rem;
    background: #1b1f27; border: 1px solid var(--cadre); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  }
}

/* ---------- combat : ordre d'initiative + fiche du participant ---------- */
.grille-combat { display: grid; gap: 1rem; align-items: start; }
.grille-combat > * { min-width: 0; }
.participant { cursor: pointer; }
.participant:hover { border-color: var(--cadre); }
.participant.choisi { background: #1d222b; border-color: var(--cadre); outline: 1px solid var(--rouge); }
.participant .qui { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.participant .qui .miniature { margin: 0; width: 2.2rem; height: 2.2rem; }
.participant .nom.ouvrir-fiche {
  min-height: 0; padding: 0; background: none; border: 0; color: var(--texte); text-transform: none; letter-spacing: 0;
  font: 700 .98rem Roboto, sans-serif; text-align: left; white-space: normal;
}
.participant .nom.ouvrir-fiche:hover { color: var(--rouge-clair); filter: none; }
.detail-combat .vide-detail { text-align: center; color: var(--tres-doux); padding: 2.5rem 1rem; }
.fiche-combat { padding: .9rem; background: rgba(20, 23, 29, .97); border: 1px solid var(--cadre-doux); border-radius: 4px; }
.tete-fiche-combat { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.tete-fiche-combat .miniature { width: 3.2rem; height: 3.2rem; margin: 0; }
.tete-fiche-combat .titre { flex: 1; min-width: 0; }
.tete-fiche-combat h2 { margin: 0; color: var(--texte); font-size: 1.3rem; text-transform: none; letter-spacing: 0; }
.tete-fiche-combat .fermer {
  min-height: 0; padding: .1rem .5rem; background: none; border: 1px solid var(--cadre-doux); color: var(--doux);
  font: 400 1.3rem Roboto, sans-serif;
}
.bandeau-combat { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-bottom: .7rem; text-align: center; }
.bandeau-combat > div { background: var(--fond-2); border: 1px solid var(--cadre-doux); border-radius: 3px; padding: .35rem .2rem; display: flex; flex-direction: column; }
.bandeau-combat strong { font: 700 1.15rem var(--titre); }
.caracs-combat { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
@media (min-width: 520px) { .caracs-combat { grid-template-columns: repeat(6, 1fr); } }
.caracs-combat .cadre { display: flex; flex-direction: column; align-items: center; padding: .35rem .2rem; gap: .15rem; }
.caracs-combat .mod { font: 700 1.25rem var(--titre); padding: 0 .4rem; border: 1px solid transparent; border-radius: 3px; }
.caracs-combat .mod:hover { border-color: var(--rouge); background: #2a1514; }
.caracs-combat .js { font-size: .7rem; color: var(--doux); padding: 0 .3rem; border-radius: 3px; }
.caracs-combat .js.maitrise { color: var(--texte); font-weight: 700; }
.caracs-combat .js:hover { background: #2a1514; color: #fff; }
.competences-combat summary { list-style: none; cursor: pointer; }
.competences-combat summary::-webkit-details-marker { display: none; }
.competences-combat summary::after { content: "+"; }
.competences-combat[open] summary::after { content: "–"; }
.illustration.petite img { max-height: 220px; }
.lien-bloc { display: inline-block; margin-top: .6rem; font-size: .85rem; }
.bloc-stats .boite.lancable { background: #fff8e8; border-color: #b9a27e; color: #2b211a; padding: 0 .3rem; min-width: 0; }
.bloc-stats .boite.lancable:hover { background: #8a1f12; border-color: #8a1f12; color: #fff; }
.bloc-stats .degats.lancable { border-bottom-color: #8a1f12; font-weight: 700; }
.bloc-stats .degats.lancable:hover { color: #8a1f12; }

@media (min-width: 1000px) {
  .grille-combat { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
  .detail-combat { position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow-y: auto; }
  .tete-fiche-combat .fermer { display: none; }
}
@media (max-width: 999px) {
  .detail-combat { display: none; }
  .detail-combat.ouvert {
    display: block; position: fixed; inset: 44px 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index: 45;
    overflow-y: auto; padding: .6rem; background: rgba(8, 9, 11, .97);
  }
}
@media (min-width: 900px) and (max-width: 999px) {
  .detail-combat.ouvert { inset: 48px 0 0 0; }
}
.caracs-bloc .jets-carac { display: flex; gap: .2rem; flex-wrap: wrap; justify-content: center; margin-top: .15rem; }
.caracs-bloc .jets-carac .boite { font-size: .72rem; }

/* bestiaire */
.entete-bestiaire, .ligne-bestiaire { display: grid; align-items: center; gap: .5rem; grid-template-columns: minmax(0, 1fr) 3rem; }
.entete-bestiaire { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); padding-bottom: .3rem; border-bottom: 1px solid var(--cadre-doux); }
.entete-bestiaire span:nth-child(2), .ligne-bestiaire .fp { text-align: center; }
.ligne-bestiaire { padding: .45rem .2rem; border-bottom: 1px solid var(--trait); color: var(--texte); }
.ligne-bestiaire:hover { background: rgba(255, 255, 255, .03); text-decoration: none; }
.ligne-bestiaire .nom { display: flex; align-items: center; min-width: 0; }
.ligne-bestiaire .fr { color: var(--rouge-clair); font-weight: 600; }
.ligne-bestiaire .sous-mobile { display: block; color: var(--tres-doux); font-size: .78rem; }
.ligne-bestiaire .fp { font: 700 1rem var(--titre); }
.entete-bestiaire span:nth-child(n+3), .ligne-bestiaire .type, .ligne-bestiaire .taille, .ligne-bestiaire .px { display: none; }
@media (min-width: 700px) {
  .entete-bestiaire, .ligne-bestiaire { grid-template-columns: minmax(0, 1fr) 3.5rem 10rem 4rem 4.5rem; }
  .entete-bestiaire span:nth-child(n+3), .ligne-bestiaire .type, .ligne-bestiaire .taille, .ligne-bestiaire .px { display: block; }
  .ligne-bestiaire .sous-mobile { display: none; }
  .ligne-bestiaire .px, .entete-bestiaire span:nth-child(5) { text-align: right; color: var(--doux); }
  .ligne-bestiaire .taille, .entete-bestiaire span:nth-child(4) { text-align: center; }
}

/* sorts */
.entete-sorts, .ligne-sort { display: grid; align-items: center; gap: .5rem; grid-template-columns: minmax(0, 1fr); }
.entete-sorts { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); padding-bottom: .3rem; border-bottom: 1px solid var(--cadre-doux); }
.ligne-sort { padding: .45rem .2rem; border-bottom: 1px solid var(--trait); color: var(--texte); }
.ligne-sort:hover { background: rgba(255, 255, 255, .03); text-decoration: none; }
.ligne-sort .fr { color: var(--rouge-clair); font-weight: 600; }
.ligne-sort .sous-mobile { display: block; color: var(--tres-doux); font-size: .78rem; }
.marque-sort {
  display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  font: 700 .6rem var(--titre); color: var(--fond); background: var(--doux); vertical-align: middle;
}
.entete-sorts span:nth-child(n+2), .ligne-sort .temps, .ligne-sort .portee, .ligne-sort .ecole { display: none; }
@media (min-width: 700px) {
  .entete-sorts, .ligne-sort { grid-template-columns: minmax(0, 1fr) 9rem 9rem 8rem; }
  .entete-sorts span:nth-child(n+2), .ligne-sort .temps, .ligne-sort .portee, .ligne-sort .ecole { display: block; }
  .ligne-sort .sous-mobile { display: none; }
  .ligne-sort .temps, .ligne-sort .portee, .ligne-sort .ecole { color: var(--doux); font-size: .85rem; }
}

/* journal des jets */
.carte-jet .qui { font: 700 .62rem var(--titre); text-transform: uppercase; letter-spacing: .08em; color: #6fb0ea; }
.carte-jet.autre { border-left-color: var(--bleu); }
.carte-jet.cache { border-style: dashed; }
.ligne-jet .qui { color: #6fb0ea; font-weight: 700; }
.ligne-jet.nat20 .total { color: var(--or); }
.ligne-jet.nat1 .total { color: #8b939e; }
.ligne-jet.cache { opacity: .75; }
.bascule-cache { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--doux); margin: -.2rem 0 .5rem; }
.bascule-cache input { min-height: 0; }
.journal-liste .ligne-jet:last-child { border-bottom: 0; }

/* vignettes des créatures et des persos */
img.miniature { object-position: 50% 22%; }
.miniature.symbole {
  display: inline-grid; place-items: center; font-size: 1.15rem; line-height: 1;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 75%, #fff 25%), var(--c));
  border-color: color-mix(in srgb, var(--c) 60%, #fff 40%);
}
.miniature.avatar-perso {
  display: inline-grid; place-items: center; font: 700 .85rem var(--titre); color: #fff;
  background: radial-gradient(circle at 35% 30%, #2b4f7a, #12233a); border-color: #6fb0ea;
}
.tete-fiche-combat .miniature.symbole { font-size: 1.6rem; }

/* créateur de créatures */
.grille-createurs { display: grid; gap: .8rem; }
@media (min-width: 800px) { .grille-createurs { grid-template-columns: 1fr 1fr; } }
.grille-createurs > * { min-width: 0; }
.grille-createur { display: grid; gap: 1rem; align-items: start; }
.grille-createur > * { min-width: 0; }
@media (min-width: 1000px) {
  .grille-createur { grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); }
  .colonne-apercu { position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow-y: auto; }
}
.champs { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.champs label { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.champs label.large { grid-column: 1 / -1; }
.champs input, .champs select { width: 100%; }
.case-libre { display: flex !important; flex-direction: row !important; align-items: center; gap: .35rem; font-size: .85rem; }
.case-libre input { min-height: 0; width: auto !important; }
.caracs-createur { display: grid; gap: .45rem; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .caracs-createur { grid-template-columns: repeat(6, 1fr); } }
.caracs-createur label { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .45rem .3rem; }
.caracs-createur input[type=number] { width: 100%; text-align: center; font: 700 1.2rem var(--titre); }
.grille-competences { display: grid; gap: .35rem .9rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.grille-competences label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.grille-competences select { min-height: 30px; padding: .1rem .3rem; font-size: .8rem; }
.choix-defenses { margin: .3rem 0; }
.choix-defenses summary { padding: .3rem 0; }
.bascule-case { display: flex; align-items: center; gap: .3rem; font-size: .82rem; padding: .2rem .35rem; border: 1px solid var(--cadre-doux); border-radius: 3px; background: var(--fond-2); }
.bascule-case input { min-height: 0; }
.entree { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem; padding: .5rem 0; border-bottom: 1px solid var(--trait); }
.entree .nom-entree { font-weight: 700; }
.entree textarea { grid-column: 1 / 2; width: 100%; resize: vertical; }
.entree [data-retirer] { grid-row: 1; grid-column: 2; }
.assistants { margin-top: .4rem; gap: 1rem; }
.barre-enregistrer { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .6rem; align-items: center; padding: .6rem 0; background: linear-gradient(transparent, var(--fond) 30%); }
@media (max-width: 899px) { .barre-enregistrer { bottom: calc(64px + env(safe-area-inset-bottom)); } }
.tete-apercu { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .4rem; }
.tete-apercu h2 { margin: 0; color: var(--texte); font-size: 1.3rem; text-transform: none; letter-spacing: 0; }
.assistant { width: min(560px, calc(100vw - 2rem)); background: var(--panneau); color: var(--texte); border: 1px solid var(--cadre); border-radius: 6px; padding: 1rem; }
.assistant::backdrop { background: rgba(0, 0, 0, .6); }
.assistant h3 { margin: 0; }
.assistant [hidden] { display: none !important; }

/* portraits des persos */
img.avatar.portrait { object-fit: cover; padding: 0; }
.porte-portrait { margin: 0; }
.porte-portrait label { position: relative; display: block; cursor: pointer; }
.changer-portrait {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); opacity: 0;
  font: 700 .55rem var(--titre); text-transform: uppercase; letter-spacing: .06em;
  background: #000c; color: #fff; padding: .05rem .35rem; border-radius: 3px; transition: opacity .15s;
}
.porte-portrait label:hover .changer-portrait, .porte-portrait label:focus-within .changer-portrait { opacity: 1; }
.tete-perso .avatar { width: 64px; height: 64px; }

/* bandeau « combat en cours » */
#bandeaux { position: sticky; top: 48px; z-index: 25; }
@media (max-width: 899px) { #bandeaux { top: 44px; } }
.bandeau-combat {
  display: flex; align-items: center; gap: .7rem; padding: .55rem 1rem; color: #fff;
  background: linear-gradient(90deg, #7a1c1c, #b52a22 60%, #7a1c1c); border-bottom: 1px solid #e8574d;
  font-size: .9rem;
}
.bandeau-combat:hover { text-decoration: none; filter: brightness(1.1); }
.bandeau-combat .epees { font-size: 1.2rem; }
.bandeau-combat .aller { margin-left: auto; font: 700 .75rem var(--titre); text-transform: uppercase; letter-spacing: .08em; }
.bandeau-combat.arrive { animation: bandeau-pulse 1.2s ease-in-out 3; }
@keyframes bandeau-pulse { 50% { filter: brightness(1.35); } }
.carte-jet .total:not(:empty) { font-variant-numeric: tabular-nums; }

/* dés en 3D : couche transparente au-dessus de la page */
#des-3d { position: fixed; inset: 0; z-index: 58; pointer-events: none; opacity: 0; transition: opacity .3s; }
#des-3d.visible { opacity: 1; }
#des-3d canvas { width: 100% !important; height: 100% !important; }

/* bloc de stats : même thème sombre que le reste du site */
.bloc-stats {
  background: linear-gradient(180deg, #1d2129, #171a20); color: var(--texte);
  border: 1px solid var(--cadre-doux); border-top: 3px solid var(--rouge); border-bottom: 3px solid var(--rouge);
  border-radius: 4px;
}
.bloc-stats .lib { color: var(--rouge-clair); }
.bloc-stats .doux { color: var(--doux); }
.bloc-stats .description { color: #dcdad5; }
.bloc-stats .sous-titre-section { color: var(--rouge-clair); border-bottom-color: var(--rouge); }
.caracs-bloc > div { background: var(--fond-2); border: 1px solid var(--cadre-doux); color: var(--texte); }
.caracs-bloc > div strong { font: 700 1.05rem var(--titre); }
.bloc-stats .boite.lancable { background: var(--fond-2); border-color: var(--cadre); color: var(--texte); }
.bloc-stats .boite.lancable:hover { background: #2a1514; border-color: var(--rouge); color: #fff; }
.bloc-stats .degats.lancable { border-bottom-color: var(--cadre); }
.bloc-stats .degats.lancable:hover { color: var(--rouge-clair); border-bottom-color: var(--rouge-clair); }
.bloc-stats em { color: #f0d9a8; }
/* illustration du panneau de combat : un bandeau, pas une vignette */
.fiche-combat .illustration.petite { margin: 0 0 .7rem; }
.fiche-combat .illustration.petite img {
  width: 100%; height: 190px; max-height: none; object-fit: cover; object-position: 50% 25%;
}
.botte { border-bottom: 1px dotted var(--tres-doux); cursor: help; }
.botte-ligne { margin: .3rem 0; font-size: .88rem; color: #dcdad5; }

/* règles : page du glossaire et recherche rapide */
.recherche-regles { display: grid; gap: .6rem; }
.recherche-regles input { width: 100%; font-size: 1rem; }
.puces-categories { display: flex; flex-wrap: wrap; gap: .35rem; }
.puce-cat {
  min-height: 30px !important; padding: .15rem .65rem !important; font-size: .7rem !important; border-radius: 999px !important;
  background: var(--fond-2) !important; border-color: var(--cadre-doux) !important; color: var(--doux) !important;
}
.puce-cat.actif { background: var(--rouge) !important; border-color: var(--rouge) !important; color: #fff !important; }
.regle { border-bottom: 1px solid var(--trait); padding: .5rem 0; }
.regle:last-of-type { border-bottom: 0; }
.regle summary { list-style: none; display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.regle summary::-webkit-details-marker { display: none; }
.regle summary::after { content: "+"; margin-left: auto; color: var(--doux); }
.regle[open] summary::after { content: "–"; }
.regle .nom-regle { font-weight: 700; color: var(--texte); }
.regle .en { font-size: .78rem; }
.regle .description { margin-top: .4rem; }
.regle .description ul { margin: .3rem 0; padding-left: 1.2rem; }
.liste-regles .regle.par-nom .nom-regle { color: var(--rouge-clair); }
.regles-rapides {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 65; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: #15181e; border-left: 1px solid var(--cadre);
  box-shadow: -12px 0 30px rgba(0, 0, 0, .5); transform: translateX(105%); transition: transform .2s ease-out;
}
.regles-rapides.ouvert { transform: none; }
.tete-regles { display: flex; gap: .5rem; padding: .7rem; border-bottom: 1px solid var(--trait); }
.tete-regles input { flex: 1; font-size: 1rem; }
.tete-regles .fermer { background: none; border: 1px solid var(--cadre-doux); color: var(--doux); font: 400 1.3rem Roboto, sans-serif; min-height: 38px; padding: 0 .7rem; }
.resultats-regles { flex: 1; overflow-y: auto; padding: 0 .9rem; }
.tout-glossaire { padding: .7rem .9rem; border-top: 1px solid var(--trait); font-size: .85rem; }
@media (max-width: 899px) { .regles-rapides { bottom: calc(64px + env(safe-area-inset-bottom)); top: 44px; width: 100vw; } }
.puce-etat-groupe { display: inline-flex; align-items: stretch; }
.aide-etat {
  display: inline-grid; place-items: center; min-width: 1.4rem; margin-left: -1px; border: 1px solid #7d2a24;
  border-radius: 0 3px 3px 0; background: #2a1514; color: #f0b0aa; font: 700 .7rem var(--titre);
}
.aide-etat:hover { background: var(--rouge); color: #fff; text-decoration: none; }
a.etiquette[data-regle] { cursor: help; }
a.etiquette[data-regle]:hover { text-decoration: none; filter: brightness(1.25); }

/* combat : qui joue */
.tour-en-cours {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: .7rem .9rem; margin-bottom: .7rem; border-radius: 4px;
  background: linear-gradient(90deg, rgba(217, 169, 63, .18), rgba(20, 23, 29, .95) 60%);
  border: 1px solid var(--or); box-shadow: 0 0 14px rgba(217, 169, 63, .18);
}
.tour-en-cours.a-moi { background: linear-gradient(90deg, rgba(58, 155, 85, .3), rgba(20, 23, 29, .95) 60%); border-color: var(--vert); }
.qui-joue { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.qui-joue .miniature { width: 3.4rem; height: 3.4rem; margin: 0; border: 2px solid var(--or); font-size: 1.5rem; }
.tour-en-cours.a-moi .qui-joue .miniature { border-color: var(--vert); }
.qui-joue .lib { color: var(--or); }
.nom-tour { font: 700 1.45rem/1.15 var(--titre); }
.ensuite { font-size: .85rem; margin-top: .1rem; }
.bouton-tour { min-height: 44px !important; padding: .4rem 1.1rem !important; font-size: .85rem !important; }
.participant.son-tour { border-color: var(--or); border-left-width: 5px; background: #221e14; }
.fleche-tour { color: var(--or); margin-right: .35rem; font-size: .9rem; }
.etiquette.or { border-color: #8a6a22; color: #f0d08a; }

/* éléments qui ouvrent une fenêtre d'information (sorts, objets…) */
.lien-info {
  color: #f0d08a; font-weight: 600; border-bottom: 1px dotted #b8923a; text-decoration: none;
  padding: 0 .1rem; border-radius: 2px;
}
.lien-info::after { content: "i"; display: inline-grid; place-items: center; width: .95rem; height: .95rem; margin-left: .3rem; border-radius: 50%; border: 1px solid #b8923a; font: 700 .55rem var(--titre); vertical-align: .15em; }
.lien-info:hover, .lien-info:focus-visible { background: rgba(217, 169, 63, .14); color: #fff; text-decoration: none; }
.info-element { z-index: 66; }
.info-element .tete-regles { justify-content: space-between; align-items: center; }
.contenu-info { padding-top: .7rem !important; }
.titre-apercu { margin: 0; color: var(--texte); font-size: 1.35rem; text-transform: none; letter-spacing: 0; }
.sous-apercu { font-size: .82rem; margin: .15rem 0 .6rem; }
.image-apercu { width: 100%; max-height: 220px; object-fit: cover; object-position: 50% 25%; border-radius: 4px; margin-bottom: .6rem; }
.proprietes-apercu { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: 0 0 .6rem; font-size: .88rem; }
.proprietes-apercu dt { font: 700 .66rem var(--titre); text-transform: uppercase; letter-spacing: .06em; color: var(--rouge-clair); align-self: center; }
.proprietes-apercu dd { margin: 0; }

/* Inspiration : un appui la gagne ou la dépense */
.inspiration-rapide { all: unset; box-sizing: border-box; width: 100%; height: 100%; cursor: pointer; border-radius: 4px; color: var(--tres-doux); }
.inspiration-rapide.active { color: var(--or); background: rgba(217, 169, 63, .12); }
.inspiration-rapide .lib { color: var(--doux, inherit); }
.inspiration-rapide:active { background: rgba(217, 169, 63, .2); }
.inspiration-rapide:focus-visible { outline: 2px solid var(--or); }

/* lien de montée de niveau sous le nom du perso */
.monter-niveau { color: var(--or); font-weight: 600; white-space: nowrap; }
.monter-niveau.pret { color: #fff; background: #2f7d4f; padding: 0 .4rem; border-radius: 3px; }

/* historique des versions d'un perso */
.historique { padding: 0; }
.ligne-version { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; border-bottom: 1px solid var(--cadre); }
.ligne-version:last-child { border-bottom: 0; }
.ligne-version .quand { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ligne-version .quand .doux { font-size: .78rem; }

/* numéro d'un choix à faire (« 1/3 ») */
.etape { display: inline-block; min-width: 2.2rem; text-align: center; font: 700 .7rem var(--titre); color: #111; background: var(--or); border-radius: 3px; padding: .05rem .3rem; margin-right: .3rem; }

/* montée de niveau : saisie d'un dé lancé à la main */
.propre-de summary { cursor: pointer; font-size: .85rem; }
.propre-de[open] summary { margin-bottom: .4rem; }

/* assistant de montée de niveau */
.etapes-montee { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 0 0 .8rem; counter-reset: etape; }
.etapes-montee li { flex: 1; text-align: center; font: 700 .68rem var(--titre); text-transform: uppercase; letter-spacing: .04em; color: var(--tres-doux); padding: .45rem .2rem; border-bottom: 3px solid var(--cadre); }
.etapes-montee li.faite { color: var(--doux); border-color: #2f7d4f; }
.etapes-montee li.actuelle { color: #fff; border-color: var(--or); }
.gain-pv { margin: 0 0 .8rem; font-weight: 600; color: #7fd49b; }
.choix-pv { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choix-pv button, button.gros { width: 100%; min-height: 3rem; font-size: .95rem; }
.options-montee { display: flex; flex-direction: column; gap: .35rem; }
.option-montee { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--cadre); border-radius: 4px; cursor: pointer; }
.option-montee:has(input:checked) { border-color: var(--or); background: rgba(217, 169, 63, .1); }
.option-montee .nom { flex: 1; }
.option-montee .lien-info::after { margin-left: 0; width: 1.3rem; height: 1.3rem; font-size: .7rem; }
.boutons-montee { justify-content: space-between; margin-top: .6rem; }

/* montée de niveau : détail du dé de vie */
.calcul-pv { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; padding: .6rem 0; }
.calcul-pv .terme { display: flex; flex-direction: column; align-items: center; min-width: 4.2rem; padding: .5rem .4rem; border: 1px solid var(--cadre); border-radius: 6px; }
.calcul-pv .valeur { font: 700 2rem var(--titre); line-height: 1.1; }
.calcul-pv .lib { font-size: .7rem; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; }
.calcul-pv .op { font: 700 1.4rem var(--titre); color: var(--doux); }
.calcul-pv .total { border-color: #2f7d4f; background: rgba(47, 125, 79, .15); }
.calcul-pv .total .valeur { color: #7fd49b; }
.pv-final { text-align: center; margin: 0; }
/* pendant que les dés roulent, le résultat attend */
.resultat-pv.en-attente .calcul-pv, .resultat-pv.en-attente .pv-final, .resultat-pv.en-attente form { visibility: hidden; }
.resultat-pv .roule { display: none; text-align: center; margin: 0; }
.resultat-pv.en-attente .roule { display: block; }
.resultat-pv.revele .calcul-pv { animation: apparait .35s ease-out; }
@keyframes apparait { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* bourse : pièces du perso */
.bourse { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; margin-bottom: .5rem; text-align: center; }
.bourse .piece { display: flex; flex-direction: column; padding: .35rem 0; border: 1px solid var(--cadre); border-radius: 6px; }
.bourse .val { font: 700 1.15rem var(--titre); line-height: 1.1; }
.bourse .lib { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.bourse .po { border-color: #b8923a; } .bourse .po .val { color: var(--or); }
.bourse .pp .val { color: #d8dde5; } .bourse .pa .val { color: #b9c2cc; } .bourse .pc .val { color: #c98a5a; } .bourse .pe .val { color: #a8c4d6; }
.bourse-form { margin-bottom: .6rem; flex-wrap: wrap; }
.bourse-form input { width: 6rem; }
.bourse-form select { width: auto; }
