/* vigies/vigies.css — « Les Vigies du Val » (base reprise de la Fonderie des Lingots) */
:root {
  --ink: #eef3e6; --dim: #b8c4a8; --or: #ffd36a; --vert: #8dffc0; --cyan: #7fe0ff; --rouge: #ff9a8a; --violet: #c4a2ff;
  --panel: rgba(12, 18, 14, .92); --bord: rgba(255, 211, 106, .3); --sw: 1024px;
  --u: calc(var(--sw) / 1280);
  --serif: Georgia, "Times New Roman", Times, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #0a100c; color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }
body { overflow-x: hidden; }
.wrap { position: relative; z-index: 1; width: var(--sw); max-width: 100%; margin: 0 auto; background: #0a100c; }

/* ── Bandeau ─────────────────────────────────────────────────────────────── */
.fv-header { display: flex; align-items: center; gap: 7px; padding: 6px 8px; min-height: 50px; background: linear-gradient(180deg, #1c2a20, #0e1610); border-bottom: 1px solid var(--bord); }
.fv-header .titre { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-header .titre small { color: var(--dim); font-weight: 400; }
.pastille { flex: none; display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.06); border: 1px solid var(--bord); border-radius: 99px; padding: 5px 10px; font-size: .88rem; color: var(--ink); }
.pastille.possibles i { font-style: normal; opacity: .28; filter: grayscale(1); }
.btn-rond { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bord); background: rgba(255,255,255,.06); color: var(--ink); font-size: 1.05rem; padding: 0; cursor: pointer; font-family: inherit; }
.btn-rond:active { transform: scale(.94); }

/* ── Scène ───────────────────────────────────────────────────────────────── */
.scene { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; user-select: none; -webkit-user-select: none; background: #0a100c; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.calque { position: absolute; pointer-events: none; }
.bulle { left: calc(24 * var(--u)); bottom: calc(24 * var(--u)); width: min(calc(520 * var(--u)), 92%); max-height: 70%; overflow: auto; padding: calc(12 * var(--u)) calc(16 * var(--u)); border-radius: calc(18 * var(--u));
  background: rgba(12, 20, 16, .93); border: 1px solid var(--bord); box-shadow: 0 8px 30px rgba(0,0,0,.6); font-size: max(13px, calc(20 * var(--u))); line-height: 1.4; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.bulle.vue { opacity: 1; transform: none; }
.bulle .qui { color: var(--or); font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.bulle .portrait-dessin { width: 34px; height: 34px; }

/* ── Console ─────────────────────────────────────────────────────────────── */
.console { position: relative; background: linear-gradient(180deg, #16241a, #0b120d); border-top: 1px solid var(--bord); padding: 8px 10px 4px; }
.consigne { text-align: center; color: var(--ink); font-size: 1rem; line-height: 1.5; min-height: 1.5em; margin: 0 auto 8px; max-width: 920px; }
.consigne b { color: var(--or); }
.num-etape { display: inline-block; font-size: .78rem; font-weight: 800; color: #10180c; background: var(--or); border-radius: 99px; padding: 1px 8px; margin-right: 4px; vertical-align: 1px; }
.commandes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; }
.barre-outils { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bouton.outil { color: var(--ink); background: rgba(255,255,255,.07); box-shadow: none; border: 1px solid var(--bord); min-height: 48px; padding: 9px 14px; }
.bouton.outil.actif { color: #10180c; background: linear-gradient(135deg, #fff1b8, #ffc94d); box-shadow: 0 0 16px rgba(255, 201, 77, .45); }
.aide { color: var(--dim); font-size: .9rem; }
.bloc-pave { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.saisie { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; min-height: 56px; padding: 2px 16px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,211,106,.38); }
.champ { min-width: 2.2em; text-align: center; font: 700 1.7rem var(--serif); color: #fff; font-variant-numeric: lining-nums tabular-nums; }
.champ.vide { color: rgba(255,255,255,.3); }
.unite { color: var(--dim); font: 700 1.2rem var(--serif); }
.pave { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 360px; }
.touche { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--bord); background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); color: var(--ink); font: 700 1.2rem system-ui, sans-serif; cursor: pointer; padding: 0; }
.touche:active { transform: scale(.94); }
.touche.efface { width: 54px; color: var(--rouge); }
.pied { display: flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 4px; padding: 0 130px 0 60px; }
.pied .msg { flex: 1; text-align: center; font-size: .92rem; color: var(--dim); min-height: 1.2em; }
.pied .msg.ok { color: var(--vert); } .pied .msg.ko { color: var(--rouge); }
.pied .msg b { color: var(--or); }
.bouton { cursor: pointer; font: 800 1rem system-ui, sans-serif; padding: 11px 18px; min-height: 48px; border-radius: 12px; border: 0; color: #10180c; background: linear-gradient(135deg, #fff1b8, #ffc94d); box-shadow: 0 0 20px rgba(255, 201, 77, .45); }
.bouton:active { transform: scale(.96); }
.bouton.violet { color: #fff; background: linear-gradient(135deg, #4a8a5a, #24543a); box-shadow: 0 0 18px rgba(80, 160, 110, .4); }
.bouton.discret { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--bord); }
.bouton.valider { min-height: 54px; font-size: 1.06rem; }
.choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 920px; }
.bouton.choix-btn { min-height: 52px; font-size: 1rem; max-width: 860px; text-align: left; line-height: 1.35; }
.bouton.choix-btn.montre, .bouton.carte-preuve.montre { outline: 3px solid var(--vert); box-shadow: 0 0 24px rgba(141,255,192,.6); }
.bouton.ko { opacity: .45; background: linear-gradient(135deg, #ffd0c8, #e08070); }

/* Preuve « Je sais que… Or… Donc… » */
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; width: 100%; max-width: 980px; }
.fiche .col { border-radius: 12px; border: 1px dashed rgba(255,211,106,.35); background: rgba(0,0,0,.22); padding: 6px 9px; min-height: 58px; }
.fiche .col.remplie { border-style: solid; border-color: rgba(141,255,192,.55); background: rgba(40,90,60,.25); }
.fiche .col.encours { border-style: solid; border-color: var(--or); box-shadow: 0 0 14px rgba(255,211,106,.25); }
.fiche .t { font: 700 .8rem var(--serif); color: var(--or); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.fiche .v { font-size: .9rem; line-height: 1.35; }
.fiche .attente { color: var(--dim); font-style: italic; }
.quoi { width: 100%; text-align: center; color: var(--dim); font-size: .9rem; }
.cartes { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 980px; }
.bouton.carte-preuve { text-align: left; line-height: 1.35; font-size: .95rem; max-width: 470px; min-height: 48px; background: linear-gradient(135deg, #f8eccc, #e8cf94); }
.bouton.carte-preuve.propriete { max-width: 980px; font-weight: 600; font-family: var(--serif); }
.bouton.carte-preuve.prise { opacity: .5; }

/* ── Dialogues ───────────────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 12px; background: rgba(4, 8, 6, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.voile.ouvert { display: flex; }
.voile.bas { align-items: flex-end; background: linear-gradient(180deg, transparent 35%, rgba(4, 8, 6, .72)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.voile.bas .dialogue { margin-bottom: 64px; max-height: 56dvh; }
.dialogue { width: min(100%, 720px); max-height: calc(100dvh - 24px); overflow: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, #1c2a20, #0c140e); border: 1px solid var(--bord); border-radius: 20px;
  padding: 16px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.75), 0 0 40px rgba(255, 211, 106, .12); animation: monte .35s ease-out; color: var(--ink); }
@keyframes monte { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialogue .qui { font-weight: 800; color: var(--or); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.dialogue .qui .gros { font-size: 1.7rem; }
.portrait-dessin { flex: none; display: inline-block; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,211,106,.6); box-shadow: 0 0 14px rgba(255,200,90,.3); background: #1a2418; }
.portrait-dessin img { width: 100%; height: 100%; display: block; }
.portrait-dessin.parle { animation: parle .5s ease-in-out infinite alternate; }
@keyframes parle { to { box-shadow: 0 0 22px rgba(255,220,120,.85); } }
.dialogue p { margin: 0 0 12px; line-height: 1.6; font-size: 1.05rem; }
.dialogue p.tt { min-height: 3.2em; }
.dialogue .avertit { color: var(--rouge); font-size: .92rem; }
.dialogue .actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.grosses-lanternes { font-size: 2.8rem; text-align: center; letter-spacing: 10px; margin: 4px 0 6px; }
.grosses-lanternes i { font-style: normal; display: inline-block; animation: lanterne .6s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(0 0 12px rgba(255,180,90,.85)); }
.grosses-lanternes i.perdue { opacity: .25; filter: grayscale(1); }
@keyframes lanterne { from { transform: scale(0) rotate(-160deg); opacity: 0; } }

/* Carte des chapitres, en deux parties */
.carte-jeu h2 { margin: 0 0 4px; text-align: center; font: 700 1.6rem var(--serif); color: #fff; text-shadow: 0 0 18px rgba(255, 211, 106, .5); }
.carte-jeu .sous { text-align: center; color: var(--dim); margin: 0 0 12px; font-size: .92rem; }
.partie { margin: 0 0 14px; }
.partie h3 { margin: 6px 0 2px; font: 700 1.15rem var(--serif); color: var(--or); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.partie .classe { font: 800 .8rem system-ui, sans-serif; color: #10180c; background: var(--vert); border-radius: 99px; padding: 2px 9px; }
.partie .sous-partie { margin: 0 0 6px; color: var(--dim); font-size: .86rem; }
.partie .conseil { margin: 0 0 8px; font-size: .86rem; color: var(--cyan); }
.chapitres { display: grid; gap: 8px; }
.chap { --c: #ffd36a; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); cursor: pointer; text-align: left; font: inherit; color: var(--ink); min-height: 60px;
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.chap:disabled { opacity: .45; cursor: default; }
.chap .num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: 800 1.25rem var(--serif); color: #10180c; background: radial-gradient(circle at 35% 30%, #fff, var(--c) 60%); box-shadow: 0 0 16px var(--c); }
.chap .t { flex: 1; font-weight: 700; }
.chap .t small { display: block; font-weight: 400; color: var(--dim); font-size: .8rem; }
.chap .barre { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 6px; overflow: hidden; }
.chap .barre i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.chap .et { color: var(--or); font-size: .9rem; white-space: nowrap; }
.niveaux-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.niveaux-liste button { font: inherit; text-align: left; cursor: pointer; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255,255,255,.05); color: var(--ink); min-height: 48px; }
.niveaux-liste button:disabled { opacity: .4; cursor: default; }
.niveaux-liste .et { display: block; font-size: .85rem; letter-spacing: 1px; margin-top: 2px; }
.niveaux-liste .et i { font-style: normal; opacity: .25; filter: grayscale(1); }
.niveaux-liste .boss { border-color: rgba(255, 138, 100, .7); }

/* Carnet */
.grimoire { background: linear-gradient(180deg, #f1e3bf, #e2cd9d); color: #2a1406; border-radius: 14px; padding: 14px 16px; box-shadow: inset 0 0 40px rgba(120, 80, 30, .35); }
.grimoire h3 { margin: 12px 0 6px; font: 700 1.15rem var(--serif); color: #1e4a2a; border-bottom: 1px solid rgba(30,74,42,.3); padding-bottom: 3px; }
.grimoire h3:first-child { margin-top: 0; }
.grimoire .regle { margin: 0 0 8px; line-height: 1.55; font-size: .98rem; }
.grimoire .regle b { color: #7a2a10; }
.grimoire .ex { display: block; font-family: var(--serif); color: #3a2a6a; margin-top: 2px; }
.grimoire .scelle { color: #8a6a40; font-style: italic; }

.seo-about { max-width: 840px; margin: 26px auto 16px; padding: 16px 22px; border-radius: 14px; background: rgba(18, 28, 20, .8); border: 1px solid var(--bord); color: var(--dim); font-size: .92rem; line-height: 1.55; }
.seo-about h2 { color: var(--or); font-size: 1.05rem; margin: 0 0 8px; }
.seo-about a { color: var(--cyan); }

@media (max-width: 820px) { .pied { padding: 0 96px 0 50px; } .consigne { font-size: .95rem; } }
@media (max-width: 599px) { .scene { aspect-ratio: 4 / 3; } }
@media (max-width: 600px) {
  #lanTotal { display: none; }
  .fv-header { gap: 4px; padding: 5px 4px; }
  .btn-rond { width: 40px; height: 40px; font-size: .95rem; }
  .pastille { padding: 4px 6px; font-size: .74rem; }
  .fv-header .titre { font-size: .82rem; }
  .fv-header .titre small { display: none; }
  .touche { width: 44px; height: 44px; }
  .pave { max-width: 300px; }
  .pied { padding: 0 70px 0 10px; }
  .dialogue { padding: 14px 14px; }
  .dialogue p { font-size: 1rem; }
  .bouton.outil { padding: 8px 10px; font-size: .9rem; }
  .fiche { grid-template-columns: 1fr 1fr; }
  .bouton.carte-preuve { font-size: .88rem; }
}
@media (max-width: 420px) { #btnRecommencer { display: none; } }

/* Garde-fous thèmes du site (fond sombre : texte clair obligatoire ; .wrap ET .fv-header) */
body[class*="theme-"] .wrap { background: #0a100c !important; }
body[class*="theme-"] .fv-header { background: linear-gradient(180deg, #1c2a20, #0e1610) !important; }
body[class*="theme-"] .wrap, body[class*="theme-"] .wrap * { color: #eef3e6 !important; -webkit-text-fill-color: #eef3e6 !important; }
body[class*="theme-"] .wrap .consigne b, body[class*="theme-"] .wrap .fiche .t, body[class*="theme-"] .wrap .msg b { color: #ffd36a !important; -webkit-text-fill-color: #ffd36a !important; }
body[class*="theme-"] .wrap .bouton:not(.discret):not(.violet):not(.outil), body[class*="theme-"] .wrap .bouton:not(.discret):not(.violet):not(.outil) *, body[class*="theme-"] .wrap .num-etape, body[class*="theme-"] .wrap .bouton.outil.actif { color: #10180c !important; -webkit-text-fill-color: #10180c !important; }
body[class*="theme-"] .wrap .msg.ok { color: #8dffc0 !important; -webkit-text-fill-color: #8dffc0 !important; }
body[class*="theme-"] .wrap .msg.ko { color: #ff9a8a !important; -webkit-text-fill-color: #ff9a8a !important; }
body[class*="theme-"] .voile .dialogue, body[class*="theme-"] .voile .dialogue * { color: #eef3e6 !important; -webkit-text-fill-color: #eef3e6 !important; }
body[class*="theme-"] .voile .bouton:not(.discret):not(.violet) { color: #10180c !important; -webkit-text-fill-color: #10180c !important; }
body[class*="theme-"] .voile .grimoire, body[class*="theme-"] .voile .grimoire * { color: #2a1406 !important; -webkit-text-fill-color: #2a1406 !important; }
body[class*="theme-"] .voile .dialogue .qui, body[class*="theme-"] .voile .dialogue .qui *, body[class*="theme-"] .voile .partie h3 { color: #ffd36a !important; -webkit-text-fill-color: #ffd36a !important; }
body[class*="theme-"] .voile .partie .classe { color: #10180c !important; -webkit-text-fill-color: #10180c !important; }
body[class*="theme-"] .fv-header, body[class*="theme-"] .fv-header * { color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: none !important; }
