/* ==========================================================================================
   Valombre — feuille de style unique
   Charte : ardoise sombre + bois runique + parchemin orangé + or (comme les menus du jeu et le wiki)
   ========================================================================================== */
:root {
  --ardoise: #16171c;
  --ardoise-2: #1f2128;
  --ardoise-3: #262933;
  --trait: #3a3d48;
  --texte: #e9dfc6;
  --texte-doux: #a8a294;
  --or: #e2b553;
  --or-clair: #ffe39a;
  --or-sombre: #a8741c;
  --braise: #e0703a;
  --mousse: #8fd17a;
  --brume: #8fa3c9;
  --danger: #e05a4a;
  --bois-0: #24160c; --bois-1: #3b2614; --bois-2: #53361d; --bois-3: #6c4827; --bois-4: #875c33; --bois-5: #a3743f;
  --parch-0: #5a4026; --parch-1: #8a6a44; --parch-3: #dcc596; --parch-4: #e8d6aa; --parch-5: #f3e6c2;
  --encre: #3a2814;
  --or-bois: #e2b553; --or-bois-clair: #ffe39a;   /* or sur bois : identique dans les deux thèmes */
  --fond-page: var(--ardoise);
  --fond-carte: var(--ardoise-2);
  --fond-champ: #121318;
  --ombre: 0 6px 20px rgb(0 0 0 / .45);
  --f-titre: "IM Fell English SC", "Palatino Linotype", Georgia, serif;
  --f-texte: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-pixel: "Pixelify Sans", "Lucida Console", monospace;
  --rayon: 3px;
  --haut-nav-bas: 64px;
  --t-com: #8a8a8a; --t-pc: #55c255; --t-rare: #5a8cff; --t-epi: #d15fc0; --t-leg: #f0a830; --t-myth: #ff5555;
  color-scheme: dark;
}
/* Thème parchemin (choisi dans le menu du compte ; le sombre reste le défaut) */
:root[data-theme="clair"] {
  --ardoise: #efe2c2; --ardoise-2: #f6ecd2; --ardoise-3: #e6d5ae; --trait: #c4a877;
  --texte: #2e2010; --texte-doux: #6e5a3c; --or: #8a5a0e; --or-clair: #a8741c; --or-sombre: #6b4508;
  --braise: #b04a1c; --mousse: #3f7a2a; --brume: #3c5482; --danger: #b0281c;
  --fond-page: #e9dab5; --fond-carte: #f6ecd2; --fond-champ: #fffaf0;
  --ombre: 0 4px 14px rgb(80 50 10 / .18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--fond-page) url("../img/ui/ardoise.png") repeat;
  background-size: 128px;
  image-rendering: auto;
  color: var(--texte); font-family: var(--f-texte); font-size: 17px; line-height: 1.5;
  padding-bottom: calc(var(--haut-nav-bas) + env(safe-area-inset-bottom));
}
:root[data-theme="clair"] body { background-image: url("../img/ui/parchemin.png"); background-size: 192px; image-rendering: pixelated; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-titre); font-weight: 400; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); color: var(--or); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.8rem); color: var(--or); }
h3 { font-size: 1.22rem; }
p { margin: 0; }
a { color: var(--or); }
a:hover { color: var(--or-clair); }
code, .pixel { font-family: var(--f-pixel); }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
[hidden] { display: none !important; }
.evitement { position: absolute; left: -999px; top: 8px; background: var(--or); color: #000; padding: 8px 12px; z-index: 100; }
.evitement:focus { left: 8px; }
.doux { color: var(--texte-doux); }
.petit { font-size: .88rem; }
.pixelise { image-rendering: pixelated; }

/* ------------------------------------------------------------------ en-tête en bois runique */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: var(--bois-3) url("../img/ui/bois.png") repeat-x;
  background-size: 128px 64px; image-rendering: pixelated;
  border-bottom: 3px solid var(--bois-0);
  box-shadow: inset 0 -2px 0 var(--bois-5), 0 4px 14px rgb(0 0 0 / .5);
  padding-top: env(safe-area-inset-top);
}
.entete-rail { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 8px 16px; min-height: 58px; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.marque img { image-rendering: pixelated; filter: drop-shadow(0 2px 0 var(--bois-0)); }
.marque-nom { font-family: var(--f-pixel); font-weight: 600; font-size: 1.45rem; color: var(--or-bois); letter-spacing: .02em;
  text-shadow: 2px 2px 0 var(--bois-0); }
.nav-haut { display: none; gap: 2px; flex: 1; justify-content: center; }
.nav-haut a { font-family: var(--f-pixel); font-size: 1rem; color: var(--parch-4); text-decoration: none; padding: 8px 12px;
  text-shadow: 1px 1px 0 var(--bois-0); border: 2px solid transparent; border-radius: 2px; white-space: nowrap; }
.nav-haut a:hover { color: var(--or-bois-clair); background: rgb(0 0 0 / .18); }
.nav-haut a[aria-current="page"] { color: var(--or-bois-clair); background: rgb(0 0 0 / .3); border-color: var(--bois-0); box-shadow: inset 0 0 0 1px var(--bois-5); }
.entete-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bouton-compte { font: 600 .95rem var(--f-pixel); color: var(--parch-5); background: rgb(0 0 0 / .32); border: 2px solid var(--bois-0);
  box-shadow: inset 0 0 0 1px var(--bois-5); padding: 6px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; max-width: 46vw; }
.bouton-compte:hover { color: var(--or-bois-clair); }
.bouton-compte img { width: 24px; height: 24px; image-rendering: pixelated; }
.bouton-compte span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bandeau-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 6px 16px;
  background: #2b2412; border-bottom: 1px solid var(--or-sombre); color: var(--parch-4); font-size: .9rem; text-align: center; }
:root[data-theme="clair"] .bandeau-demo { background: #f3dfa6; color: var(--encre); }
.bandeau-demo code { color: var(--or); }

/* ------------------------------------------------------------------ barre d'onglets du bas (téléphone) */
.nav-bas {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: repeat(var(--nb-onglets, 6), 1fr);
  background: var(--bois-2) url("../img/ui/bois.png") repeat; background-size: 128px 64px; image-rendering: pixelated;
  border-top: 3px solid var(--bois-0); box-shadow: inset 0 2px 0 var(--bois-5), 0 -4px 14px rgb(0 0 0 / .45);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bas a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--haut-nav-bas);
  text-decoration: none; color: var(--parch-3); font: 400 .72rem var(--f-pixel); text-shadow: 1px 1px 0 var(--bois-0); position: relative; }
.nav-bas a svg { width: 26px; height: 26px; filter: drop-shadow(1px 1px 0 var(--bois-0)); }
.nav-bas a[aria-current="page"] { color: var(--or-bois-clair); background: rgb(0 0 0 / .32); }
.nav-bas a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 3px; background: var(--or-bois); }

/* entre 900 et 1180 px, 8 onglets + le compte doivent tenir sur une ligne : onglets resserrés */
@media (min-width: 900px) and (max-width: 1179px) {
  .entete-rail { gap: 10px; padding: 8px 12px; }
  .marque-nom { font-size: 1.2rem; }
  .nav-haut { gap: 0; min-width: 0; }
  .nav-haut a { padding: 7px 6px; font-size: .9rem; }
  .bouton-compte { max-width: 150px; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav-bas { display: none; }
  .nav-haut { display: flex; }
}

/* ------------------------------------------------------------------ mise en page */
.contenu { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 26px; outline: none; }
.contenu > * { min-width: 0; }
.entete-page { display: flex; flex-direction: column; gap: 6px; }
.entete-page .sur-titre { font: 400 .8rem var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); }
.entete-page p { color: var(--texte-doux); max-width: 70ch; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grille-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grille-2 { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.pile { display: flex; flex-direction: column; gap: 12px; }
.rang { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* bandeau de titre en bois, comme le titre « Fonderie » des menus */
.bandeau-bois { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  background: var(--bois-3) url("../img/ui/bois.png") repeat-x; background-size: 128px 64px; image-rendering: pixelated;
  border: 3px solid var(--bois-0); box-shadow: inset 0 0 0 2px var(--bois-5), 3px 3px 0 rgb(0 0 0 / .4);
  padding: 6px 16px; font: 600 1.05rem var(--f-pixel); color: var(--or-bois); text-shadow: 2px 2px 0 var(--bois-0); }
.bandeau-bois::before, .bandeau-bois::after { content: ""; width: 8px; height: 8px; background: var(--braise); transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--bois-0); flex: none; }

/* cartes : ardoise cerclée de bois (9 tranches) */
.carte {
  background: var(--fond-carte); border: 10px solid transparent;
  border-image: url("../img/ui/cadre.png") 5 / 10px repeat; image-rendering: auto;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative;
}
.carte > * { image-rendering: auto; }
.carte-image { margin: -14px -16px 2px; aspect-ratio: 16 / 8; overflow: hidden; background: #000; }
.carte-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte h3 { color: var(--or); }

/* parchemin orangé : encarts importants */
.parchemin {
  background: var(--parch-4) url("../img/ui/parchemin.png"); background-size: 128px; image-rendering: pixelated;
  color: var(--encre); border: 3px solid var(--parch-0); box-shadow: inset 0 0 0 2px var(--parch-5), inset 0 0 0 4px var(--parch-1), var(--ombre);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
}
.parchemin > * { image-rendering: auto; }
.parchemin h2, .parchemin h3 { color: #6b3a0a; }
.parchemin .doux { color: #6e5232; }
.parchemin a { color: #7a3c06; }

/* ------------------------------------------------------------------ boutons et champs */
.bouton {
  font: 600 1rem var(--f-pixel); letter-spacing: .02em; color: var(--parch-5); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  background: var(--bois-3) url("../img/ui/bois.png"); background-size: 128px 64px; image-rendering: pixelated;
  border: 3px solid var(--bois-0); box-shadow: inset 0 2px 0 var(--bois-5), inset 0 -3px 0 var(--bois-1), 2px 2px 0 rgb(0 0 0 / .35);
  text-shadow: 1px 1px 0 var(--bois-0); border-radius: 0; transition: transform .06s, filter .12s;
}
.bouton:hover { filter: brightness(1.12); color: var(--or-bois-clair); }
.bouton:active { transform: translateY(2px); box-shadow: inset 0 2px 0 var(--bois-1), 0 0 0 rgb(0 0 0 / .35); }
.bouton[disabled], .bouton[aria-disabled="true"] { filter: grayscale(.7) brightness(.75); cursor: not-allowed; transform: none; }
.bouton-or { background: linear-gradient(#f2c96a, #c98f24); color: #3a2006; text-shadow: 0 1px 0 #ffe9b0;
  border-color: #4a2c06; box-shadow: inset 0 2px 0 #fff0b8, inset 0 -3px 0 #8a5a10, 2px 2px 0 rgb(0 0 0 / .35); }
.bouton-or:hover { color: #241200; }
.bouton-discord { background: #4a55c8; border-color: #1d2160; box-shadow: inset 0 2px 0 #7c86f0, inset 0 -3px 0 #2c3390, 2px 2px 0 rgb(0 0 0 / .35); text-shadow: 1px 1px 0 #1d2160; }
.bouton-discord:hover { color: #fff; }
.bouton-fantome { background: transparent; border: 2px solid var(--trait); box-shadow: none; color: var(--texte); text-shadow: none; min-height: 40px; }
.bouton-fantome:hover { border-color: var(--or); color: var(--or); }
.bouton-plein { width: 100%; }
.bouton svg { width: 20px; height: 20px; flex: none; }
.lien-bouton { font: inherit; background: none; border: 0; color: var(--or); text-decoration: underline; cursor: pointer; padding: 4px; }

.champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ > span { font: 400 .78rem var(--f-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
.champ input, .champ textarea, .champ select {
  font: inherit; color: var(--texte); background: var(--fond-champ); border: 2px solid var(--trait); padding: 10px 12px; border-radius: 0; width: 100%; min-height: 44px; }
.champ textarea { min-height: 140px; resize: vertical; }
.champ input:focus-visible, .champ textarea:focus-visible, .champ select:focus-visible { outline: none; border-color: var(--or); }
.champ small { color: var(--texte-doux); font-size: .84rem; }
.case-cocher { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.case-cocher input { width: 22px; height: 22px; accent-color: var(--or); }
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire .rang > .champ { flex: 1 1 200px; }

/* code de liaison : 6 cases */
.code-liaison { font: 600 1.6rem var(--f-pixel); letter-spacing: .5em; text-transform: uppercase; text-align: center; padding-left: .5em !important; }

/* ------------------------------------------------------------------ éléments divers */
.puce { display: inline-flex; align-items: center; gap: 6px; font: 400 .78rem var(--f-pixel); letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border: 1px solid currentColor; white-space: nowrap; }
.puce-or { color: var(--or); } .puce-mousse { color: var(--mousse); } .puce-braise { color: var(--braise); } .puce-brume { color: var(--brume); } .puce-doux { color: var(--texte-doux); }
.voyant { width: 10px; height: 10px; border-radius: 50%; background: var(--texte-doux); flex: none; }
.voyant.allume { background: var(--mousse); box-shadow: 0 0 0 3px rgb(143 209 122 / .2), 0 0 10px var(--mousse); animation: pouls 2s infinite; }
.voyant.eteint { background: var(--danger); }
@keyframes pouls { 50% { box-shadow: 0 0 0 6px rgb(143 209 122 / 0), 0 0 4px var(--mousse); } }
.chiffre { font: 400 2.1rem var(--f-titre); color: var(--or); line-height: 1; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--ardoise-3); border: 1px solid var(--trait); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--texte-doux); font-size: .86rem; }
.separateur { height: 1px; background: var(--trait); border: 0; margin: 4px 0; width: 100%; }
.vide { color: var(--texte-doux); font-style: italic; padding: 12px 0; }
.squelette { background: linear-gradient(90deg, var(--ardoise-2), var(--ardoise-3), var(--ardoise-2)); background-size: 200% 100%; animation: luit 1.2s infinite; min-height: 120px; }
@keyframes luit { to { background-position: -200% 0; } }

/* héros de l'accueil */
.heros { position: relative; overflow: hidden; border: 3px solid var(--bois-0); box-shadow: inset 0 0 0 2px var(--bois-5), var(--ombre);
  background: #0c0d12 center / cover no-repeat; min-height: 300px; display: flex; align-items: flex-end; }
.heros::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(10 10 14 / .15) 0%, rgb(10 10 14 / .55) 45%, rgb(10 10 14 / .94) 100%); }
.heros-corps { position: relative; padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 12px; width: 100%; color: #e9dfc6; }
.heros h1 { font-size: clamp(2.3rem, 9vw, 3.8rem); text-shadow: 3px 3px 0 #000; color: #e2b553; }
.heros .devise { color: #d4cab4; font-size: 1.08rem; max-width: 52ch; text-shadow: 1px 1px 0 #000; }
.etat-serveur { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-family: var(--f-pixel); font-size: .95rem; }
.adresse { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; max-width: 520px; }
.adresse code { flex: 1 1 180px; background: rgb(0 0 0 / .55); border: 3px solid var(--bois-0); border-right: 0; color: var(--or-bois-clair);
  padding: 8px 12px; font-size: 1.1rem; display: flex; align-items: center; min-height: 48px; }
.adresse .bouton { min-height: 48px; }
@media (min-width: 700px) { .heros { min-height: 380px; } .heros-corps { padding: 32px; } }

/* compte à rebours */
.rebours { display: flex; gap: 8px; font-family: var(--f-pixel); }
.rebours div { background: #0d0e12; border: 2px solid var(--bois-0); box-shadow: inset 0 0 0 1px var(--bois-4); padding: 6px 4px; min-width: 56px;
  display: flex; flex-direction: column; align-items: center; color: var(--or-bois-clair); }
:root[data-theme="clair"] .rebours div { background: #2a1c0e; }
.rebours b { font-size: 1.5rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rebours span { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: #c9ad7c; }

/* ------------------------------------------------------------------ nouveautés */
.article-corps { display: flex; flex-direction: column; gap: 10px; max-width: 72ch; }
.article-corps h4 { font: 400 1.15rem var(--f-titre); color: var(--or); margin: 6px 0 0; }
.article-corps ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.article-corps li::marker { color: var(--or); }
.journal { display: flex; flex-direction: column; gap: 0; border-left: 3px solid var(--bois-3); margin-left: 8px; }
.journal-entree { position: relative; padding: 0 0 22px 22px; }
.journal-entree::before { content: ""; position: absolute; left: -9px; top: 6px; width: 12px; height: 12px; background: var(--or); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--ardoise); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--texte-doux); font-size: .88rem; }
.filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre { font: 400 .9rem var(--f-pixel); color: var(--texte-doux); background: transparent; border: 2px solid var(--trait); padding: 6px 12px; cursor: pointer; min-height: 38px; }
.filtre[aria-pressed="true"] { color: var(--or); border-color: var(--or); background: rgb(226 181 83 / .08); }

/* ------------------------------------------------------------------ événements / calendrier */
.calendrier { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-family: var(--f-pixel); }
.calendrier .jour-sem { text-align: center; font-size: .72rem; color: var(--texte-doux); padding: 4px 0; text-transform: uppercase; }
.calendrier .jour { aspect-ratio: 1; min-height: 38px; background: var(--ardoise-3); border: 1px solid var(--trait); display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding-top: 4px; font-size: .9rem; color: var(--texte-doux); position: relative; cursor: default; }
.calendrier .jour.hors { opacity: .35; }
.calendrier .jour.aujourdhui { border-color: var(--or); color: var(--or); }
.calendrier .jour.a-evt { color: var(--texte); background: #2d2516; cursor: pointer; }
:root[data-theme="clair"] .calendrier .jour.a-evt { background: #f0d79a; }
.calendrier .jour.a-evt::after { content: ""; position: absolute; bottom: 6px; width: 8px; height: 8px; background: var(--braise); transform: rotate(45deg); }
.calendrier .jour.choisi { outline: 2px solid var(--or); outline-offset: -2px; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-tete b { font: 400 1.25rem var(--f-titre); color: var(--or); text-transform: capitalize; }
.cal-tete button { min-width: 44px; }
.evt-date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 64px; padding: 6px 0;
  background: var(--bois-3) url("../img/ui/bois.png"); background-size: 128px 64px; image-rendering: pixelated; border: 2px solid var(--bois-0);
  box-shadow: inset 0 0 0 1px var(--bois-5); font-family: var(--f-pixel); color: var(--parch-5); text-shadow: 1px 1px 0 var(--bois-0); }
.evt-date b { font-size: 1.6rem; line-height: 1; color: var(--or-bois-clair); }
.evt-date span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.evt-ligne { display: flex; gap: 14px; align-items: flex-start; }
.jauge { height: 10px; background: #0d0e12; border: 2px solid var(--bois-0); position: relative; overflow: hidden; }
.jauge i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(var(--or-clair), var(--or-sombre)); transition: width .5s; }

/* ------------------------------------------------------------------ votes */
.option-vote { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; text-align: left;
  font: inherit; color: var(--texte); background: var(--ardoise-3); border: 2px solid var(--trait); cursor: pointer; overflow: hidden; width: 100%; }
.option-vote:hover:not([disabled]) { border-color: var(--or); }
.option-vote[disabled] { cursor: default; }
.option-vote .barre { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgb(226 181 83 / .26), rgb(226 181 83 / .12)); transition: width .7s cubic-bezier(.2,.8,.2,1); z-index: 0; }
.option-vote.choisie { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.option-vote.choisie .barre { background: linear-gradient(90deg, rgb(226 181 83 / .45), rgb(226 181 83 / .2)); }
.option-vote > *:not(.barre) { position: relative; z-index: 1; }
.option-vote .lib { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option-vote .lib b { font: 400 1.2rem var(--f-titre); color: var(--or); }
.option-vote .lib small { color: var(--texte-doux); }
.option-vote .pct { font: 600 1.2rem var(--f-pixel); color: var(--or-clair); font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }
:root[data-theme="clair"] .option-vote .pct { color: var(--or); }
.option-vote .coche { width: 26px; height: 26px; border: 2px solid var(--trait); flex: none; display: grid; place-items: center; background: var(--fond-champ); }
.option-vote.choisie .coche { border-color: var(--or); background: var(--or); color: #2a1a04; }
.en-direct { display: inline-flex; align-items: center; gap: 6px; font: 400 .78rem var(--f-pixel); color: var(--braise); text-transform: uppercase; letter-spacing: .08em; }
.en-direct::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--braise); animation: clignote 1.4s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
.site-vote { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-vote .info { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }

/* ------------------------------------------------------------------ personnage */
.fiche-tete { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.portrait { width: 88px; height: 88px; image-rendering: pixelated; background: #0d0e12; border: 3px solid var(--bois-0); box-shadow: inset 0 0 0 2px var(--bois-5); flex: none; }
.metiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.metier { display: flex; flex-direction: column; gap: 6px; background: var(--ardoise-3); border: 1px solid var(--trait); padding: 10px 12px; }
.metier .rang { justify-content: space-between; }
.metier b { font: 400 1.1rem var(--f-titre); color: var(--or); }
.metier .niv { font: 600 .9rem var(--f-pixel); color: var(--or-clair); }
:root[data-theme="clair"] .metier .niv { color: var(--or); }
.ecus { display: inline-flex; align-items: center; gap: 8px; font: 600 1.5rem var(--f-pixel); color: var(--or-clair); }
:root[data-theme="clair"] .ecus { color: var(--or); }
.piece { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e2b553 45%, #8a5a10); border: 2px solid #4a2c06; }
.onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--trait); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.onglets button { font: 400 .95rem var(--f-pixel); color: var(--texte-doux); background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; margin-bottom: -2px; min-height: 44px; }
.onglets button[aria-selected="true"] { color: var(--or); border-bottom-color: var(--or); }

/* inventaire — le vrai gris de Minecraft */
.inv-mc {
  --case: clamp(30px, calc((100vw - 92px) / 9), 44px);
  align-self: center; background: #c6c6c6; padding: 10px; width: max-content; max-width: 100%;
  border: 3px solid #000; box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555; border-radius: 4px;
  display: flex; flex-direction: column; gap: 8px; color: #404040; font-family: var(--f-pixel); image-rendering: pixelated;
}
.inv-mc .titre-mc { font-size: .9rem; color: #404040; padding-left: 2px; }
.inv-haut { display: flex; gap: 10px; align-items: flex-start; }
.inv-haut .colonne { display: flex; flex-direction: column; gap: 0; }
.inv-avatar { width: calc(var(--case) * 2.4); height: calc(var(--case) * 4); background: #000; border: 2px solid; border-color: #373737 #fff #fff #373737; display: grid; place-items: center; overflow: hidden; }
.inv-avatar img { height: 92%; image-rendering: pixelated; }
.inv-grille { display: grid; grid-template-columns: repeat(9, var(--case)); }
.inv-barre { margin-top: 4px; }
.case-mc { width: var(--case); height: var(--case); background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737;
  position: relative; display: grid; place-items: center; padding: 0; cursor: default; font: inherit; }
button.case-mc { cursor: pointer; }
.case-mc:hover, .case-mc.active { background: #a9a9a9; }
.case-mc .ico { width: 80%; height: 80%; }
.case-mc .qte { position: absolute; right: 1px; bottom: -1px; font: 600 calc(var(--case) * .36) var(--f-pixel); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; line-height: 1; pointer-events: none; }
.case-mc .fond-arm { width: 70%; height: 70%; opacity: .35; }
.case-mc .usure { position: absolute; left: 12%; right: 12%; bottom: 10%; height: 3px; background: #000; pointer-events: none; }
.case-mc .usure i { display: block; height: 2px; }
.case-mc.enchante .ico { filter: drop-shadow(0 0 2px rgb(190 120 255 / .9)) drop-shadow(0 0 1px rgb(190 120 255 / .9)); animation: lueur 2.6s ease-in-out infinite; }
@keyframes lueur { 50% { filter: drop-shadow(0 0 3px rgb(160 90 255 / 1)) drop-shadow(0 0 1px rgb(255 255 255 / .6)); } }
.ico { display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.ico-texte { display: grid; place-items: center; font: 600 .7rem var(--f-pixel); color: #222; background: #b0b0b0; border: 1px dashed #666; }
.inv-maj { font-size: .8rem; color: #555; text-align: right; }

/* infobulle façon Minecraft */
.infobulle-mc { position: fixed; z-index: 60; max-width: min(320px, calc(100vw - 16px)); pointer-events: none;
  background: rgb(16 0 16 / .94); padding: 6px 9px 7px; font: 400 .95rem/1.35 var(--f-pixel); color: #fff; text-shadow: 2px 2px 0 #3e3e3e;
  border: 2px solid #100010; box-shadow: inset 0 0 0 2px #2d0a6b, inset 0 -2px 0 2px #28007f; border-radius: 2px; }
.infobulle-mc .nom { font-size: 1.02rem; }
.infobulle-mc .gris { color: #aaa; } .infobulle-mc .bleu { color: #5555ff; } .infobulle-mc .lore { color: #aa55aa; font-style: italic; }
.infobulle-mc .id { color: #555; font-size: .8rem; text-shadow: none; }
.r-commun { color: #fff; } .r-peu_commun { color: #55ff55; } .r-rare { color: #55ffff; } .r-epique { color: #ff55ff; } .r-legendaire { color: #ffaa00; } .r-mythique { color: #ff5555; }
.badge-r { font: 600 .7rem var(--f-pixel); padding: 0 5px; color: #fff; text-shadow: none; display: inline-block; margin-top: 3px; }
.b-commun { background: #6d6d6d; } .b-peu_commun { background: #3f9c3f; } .b-rare { background: #3a64c8; } .b-epique { background: #b03a8c; } .b-legendaire { background: #b9780f; } .b-mythique { background: #c0282d; }

/* mini-carte */
.carte-base { position: relative; border: 3px solid var(--bois-0); box-shadow: inset 0 0 0 2px var(--bois-5); background: #0c0d12; }
.carte-base canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; touch-action: none; }
.coord { font: 600 1rem var(--f-pixel); color: var(--or-bois-clair); background: #0d0e12; border: 2px solid var(--bois-0); padding: 6px 10px; display: inline-flex; gap: 12px; flex-wrap: wrap; }
:root[data-theme="clair"] .coord { background: #2a1c0e; }
.coord span { color: #c9ad7c; font-weight: 400; }

/* ------------------------------------------------------------------ wiki plein écran */
.wiki-cadre { position: fixed; z-index: 10; left: 0; top: var(--haut-entete, 62px); border: 0; width: 100%; background: #16171c;
  height: calc(100dvh - var(--haut-entete, 62px) - var(--haut-nav-bas) - env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .wiki-cadre { height: calc(100dvh - var(--haut-entete, 62px)); } }
body.mode-wiki .contenu { padding: 0; }
body.mode-wiki .bandeau-demo { display: none !important; }

/* ------------------------------------------------------------------ fenêtre (compte), toasts */
.fenetre { border: 0; padding: 0; background: transparent; color: var(--texte); max-width: min(460px, calc(100vw - 24px)); width: 100%; }
.fenetre::backdrop { background: rgb(5 5 8 / .72); backdrop-filter: blur(2px); }
.fenetre .carte { box-shadow: var(--ombre); }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fermer { width: 44px; height: 44px; background: none; border: 2px solid var(--trait); color: var(--texte); font-size: 1.4rem; cursor: pointer; flex: none; }
.fermer:hover { border-color: var(--or); color: var(--or); }
.toasts { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--haut-nav-bas) + env(safe-area-inset-bottom) + 12px);
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 20px; } }
.toast { pointer-events: auto; background: var(--parch-4) url("../img/ui/parchemin.png"); background-size: 128px; color: var(--encre);
  border: 3px solid var(--parch-0); box-shadow: inset 0 0 0 2px var(--parch-5), var(--ombre); padding: 10px 14px; font-weight: 500; animation: monte .25s ease-out; }
.toast.erreur { border-color: #6b1a10; box-shadow: inset 0 0 0 2px #f3c2b6, var(--ombre); }
@keyframes monte { from { transform: translateY(12px); opacity: 0; } }

/* ------------------------------------------------------------------ admin */
.admin-liste { display: flex; flex-direction: column; gap: 6px; }
.admin-ligne { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--ardoise-3); border: 1px solid var(--trait); flex-wrap: wrap; }
.apercu-image { max-height: 160px; object-fit: cover; border: 2px solid var(--trait); }

/* ------------------------------------------------------------------ guildes */
.tag-guilde { display: inline-block; font: 600 .82rem/1.25 var(--f-pixel); letter-spacing: .03em; color: var(--g, #f0c040);
  background: #16171c; border: 1px solid rgb(255 255 255 / .12); padding: 0 5px; white-space: nowrap; text-shadow: 1px 1px 0 #000; text-transform: none; }
.puce .tag-guilde { font-size: .74rem; padding: 0 3px; margin-right: 2px; }
.lien-tag { text-decoration: none; }
.lien-tag:hover .tag-guilde { border-color: var(--g); }
.rang-guilde { font-size: .72rem; }
.rang-chef { color: #ffd65a; } .rang-officier { color: #8fc8ff; } .rang-membre { color: #e8dcc0; } .rang-recrue { color: #b8b0a0; }
:root[data-theme="clair"] .rang-chef { color: #8a5a0e; }
:root[data-theme="clair"] .rang-officier { color: #2c5c9a; }
:root[data-theme="clair"] .rang-membre { color: #4a3a22; }
:root[data-theme="clair"] .rang-recrue { color: #7a6a52; }
/* bannière de tissu à la couleur de la guilde, suspendue à une hampe de bois */
.banniere { --l: 40px; position: relative; flex: none; width: var(--l); height: calc(var(--l) * 1.45); display: grid; place-items: center;
  padding-top: 6px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgb(0 0 0 / .45)); }
.banniere::before { content: ""; position: absolute; left: -4px; right: -4px; top: 0; height: 6px; background: var(--bois-3);
  border: 2px solid var(--bois-0); box-shadow: inset 0 1px 0 var(--bois-5); }
.banniere::after { content: ""; position: absolute; inset: 6px 0 0 0; z-index: -1;
  background: linear-gradient(90deg, rgb(0 0 0 / .22), transparent 22%, transparent 78%, rgb(0 0 0 / .22)), var(--g, #f0c040);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.banniere span { position: relative; margin-top: -18%; font: 600 .78rem var(--f-pixel); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  letter-spacing: .02em; max-width: 100%; overflow: hidden; }
.banniere { isolation: isolate; }
.banniere.grande { --l: 64px; }
.banniere.grande span { font-size: 1.05rem; }
.guilde-tete { display: flex; gap: 14px; align-items: center; min-width: 0; }
.guilde-tete h3 a { color: var(--or); text-decoration: none; }
.guilde-tete h3 a:hover { text-decoration: underline; }
.carte-guilde::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--g, var(--or)); opacity: .85; }
.barre-guildes { justify-content: space-between; align-items: flex-end; }
.champ-recherche { flex: 1 1 260px; max-width: 420px; }
.guilde-entete { display: flex; gap: 18px; align-items: center; min-width: 0; }
.guilde-entete h1 { overflow-wrap: anywhere; }
.guilde-entete .sur-titre { font: 400 .8rem var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); }
.retour { font: 400 .95rem var(--f-pixel); text-decoration: none; align-self: flex-start; }
.liste-membres { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.membre { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--ardoise-3); border: 1px solid var(--trait); min-width: 0; }
.membre .tete { width: 32px; height: 32px; image-rendering: pixelated; border: 2px solid var(--bois-0); background: #0d0e12; flex: none; }
.membre-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche-guilde a { font-weight: 600; }
.stat-guilde { font: 600 1.15rem var(--f-pixel); color: var(--g); background: #16171c; align-self: flex-start; padding: 2px 8px; text-shadow: 1px 1px 0 #000; }
.reglage-chef { gap: 6px; }

/* ------------------------------------------------------------------ pied de page et pages légales */
.pied { max-width: 1180px; margin: 0 auto; padding: 18px 16px 26px; border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap;
  gap: 6px 22px; align-items: center; justify-content: space-between; color: var(--texte-doux); font-size: .88rem; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pied-liens a { font-family: var(--f-pixel); }
body.mode-wiki .pied { display: none; }
.legal { max-width: 900px; }
.legal-section h2 { font-size: 1.35rem; }
.legal-section ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal-liste { margin: 0; display: grid; gap: 4px 16px; grid-template-columns: minmax(0, 1fr); }
.legal-liste dt { font: 400 .8rem var(--f-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--texte-doux); margin-top: 6px; }
.legal-liste dd { margin: 0; }
mark.a-remplir { background: #ffe066; color: #3a2006; font: 600 .86em var(--f-pixel); padding: 0 4px; outline: 1px dashed #8a5a0e; outline-offset: 1px;
  overflow-wrap: anywhere; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.bandeau-legal { max-width: 900px; }
.tableau-defilant { overflow-x: auto; }
.tableau-legal { border-collapse: collapse; width: 100%; font-size: .94rem; }
.tableau-legal th, .tableau-legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--trait); }
.tableau-legal thead th { font: 400 .78rem var(--f-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--texte-doux); border-bottom: 2px solid var(--trait); }
.tableau-legal tbody th { color: var(--or); font-weight: 600; }
@media (max-width: 760px) {
  .tableau-legal thead { display: none; }
  .tableau-legal, .tableau-legal tbody, .tableau-legal tr, .tableau-legal th, .tableau-legal td { display: block; width: 100%; }
  .tableau-legal tr { padding: 10px 0; border-bottom: 2px solid var(--trait); }
  .tableau-legal th, .tableau-legal td { border: 0; padding: 3px 0; }
  .tableau-legal td::before { content: attr(data-label) " : "; font: 400 .74rem var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--texte-doux); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .marque-nom { font-size: 1.2rem; }
  .carte { padding: 12px 12px; }
  .carte-image { margin: -12px -12px 2px; }
}

/* ------------------------------------------------------------------ ajustements téléphone */
.bouton-compte svg { width: 20px; height: 20px; flex: none; }
.heros { background-position: center 30%; }
@media (max-width: 600px) {
  .bandeau-demo { font-size: .8rem; padding: 4px 12px; gap: 2px 10px; }
  .bandeau-demo .detail { display: none; }
  .bouton-compte { padding: 6px 8px; font-size: .85rem; }
}
.parchemin .champ > span { color: #6e5232; }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .stats-3 .stat { padding: 10px; } .stats-3 .chiffre { font-size: 1.7rem; } }
