:root {
  --bois: #140e0a;
  --bois-2: #1f1610;
  --papier: #e8dabb;
  --papier-2: #d9c69c;
  --papier-ombre: #b79e70;
  --encre: #2b1d12;
  --encre-2: #5a4330;
  --braise: #d0682f;
  --braise-2: #f0a050;
  --or: #c9a24a;
  --lune: #cfd8e6;
  --gris-anneau: #8f96a3;
  --texte-clair: #e9dcc4;
  --texte-doux: #a8987f;
  --ombre-pct: 0;
  --titre: "IM Fell English", "EB Garamond", Georgia, serif;
  --titre-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --corps: "EB Garamond", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bois); color: var(--texte-clair); font-family: var(--corps); font-size: 18px; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }
b { font-weight: 600; }

/* ——— Boutons */
.btn { background: transparent; border: 1px solid rgba(233, 220, 196, .28); border-radius: 3px; padding: .55em 1.1em; color: var(--texte-clair); font-family: var(--titre); font-size: 1rem; letter-spacing: .01em; transition: background .2s, border-color .2s, color .2s; }
.btn:hover { background: rgba(233, 220, 196, .07); border-color: rgba(233, 220, 196, .5); }
.btn:focus-visible, .icone:focus-visible, input:focus-visible { outline: 1px solid var(--braise-2); outline-offset: 2px; }
.btn-principal { border-color: rgba(240, 160, 80, .55); color: #f6dcb8; }
.btn-principal:hover { background: rgba(208, 104, 47, .16); border-color: var(--braise-2); }
.btn-petit { padding: .35em .8em; font-size: .9rem; }
.btn-danger { border-color: rgba(200, 80, 60, .4); color: #e6a090; }
.icone { background: none; border: 0; width: 38px; height: 38px; padding: 8px; color: var(--texte-doux); }
.icone svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icone:hover { color: var(--texte-clair); }
body.muet #b-son .ondes { opacity: 0; }

/* ——— Écrans */
.ecran { position: fixed; inset: 0; display: none; }
.ecran.actif { display: block; }

/* ——— Titre */
#titre .titre-fond { position: absolute; inset: -3%; background: #0b0806 url(../img/titre.jpg) center / cover no-repeat; animation: respire 40s ease-in-out infinite alternate; filter: saturate(.85) brightness(.75); }
#titre .titre-voile { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, transparent 0 30%, rgba(8, 5, 3, .75) 75%), linear-gradient(to bottom, rgba(8, 5, 3, .35), rgba(8, 5, 3, .1) 40%, rgba(8, 5, 3, .85)); }
@keyframes respire { from { transform: scale(1); } to { transform: scale(1.06) translate(-1%, -1%); } }
.titre-contenu { position: absolute; left: 0; right: 0; bottom: 9vh; text-align: center; padding: 0 24px; }
.titre-sur { font-family: var(--titre); font-style: italic; color: var(--texte-doux); margin: 0 0 .4em; font-size: 1.05rem; }
.titre-nom { font-family: var(--titre); font-weight: 400; font-size: clamp(3rem, 8vw, 6.4rem); margin: 0; line-height: 1; color: #f2e4c8; text-shadow: 0 0 40px rgba(240, 140, 60, .25); }
.titre-sous { color: var(--texte-doux); font-size: .95rem; margin: 1.1em 0 2em; }
.titre-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.titre-actions .btn { font-size: 1.15rem; padding: .7em 1.6em; background: rgba(10, 6, 4, .45); }
.titre-casque { margin-top: 2.2em; font-family: var(--titre); font-style: italic; color: #8a7a62; font-size: .95rem; }

/* ——— Préparatifs */
#prepa { background: radial-gradient(ellipse at 50% 30%, #2a1d13, var(--bois) 70%); overflow: auto; }
#prepa.actif { display: flex; align-items: center; justify-content: center; }
.prepa-boite { width: min(860px, 100%); padding: 40px 24px; }
.prepa-boite h2 { font-family: var(--titre); font-weight: 400; font-size: 2.4rem; margin: 0 0 .3em; color: #f2e4c8; }
.prepa-texte { color: var(--texte-doux); font-size: 1.1rem; max-width: 640px; margin: 0 0 1.6em; line-height: 1.5; }
.prepa-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 1.8em; }
.role { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid rgba(233, 220, 196, .14); border-radius: 3px; background: rgba(255, 240, 210, .025); }
.role-nom { font-family: var(--titre); font-size: 1.35rem; color: #f2e4c8; }
.role-desc { color: var(--texte-doux); font-size: .98rem; line-height: 1.4; flex: 1; }
.role input { background: rgba(0, 0, 0, .3); border: 0; border-bottom: 1px solid rgba(233, 220, 196, .3); color: var(--texte-clair); padding: 8px 2px; font-family: var(--titre); font-size: 1.25rem; }
.prepa-qr { display: flex; gap: 26px; align-items: center; margin-bottom: 1.8em; }
#qr { background: #efe3c8; padding: 12px; border-radius: 2px; width: 196px; height: 196px; flex: none; }
#qr svg, #qr img { width: 100%; height: 100%; display: block; }
.prepa-url { font-family: var(--titre); font-size: 1.3rem; color: #f2e4c8; word-break: break-all; margin: 0 0 .8em; }
.prepa-petit { color: var(--texte-doux); font-size: .95rem; line-height: 1.45; }
.prepa-petit a { color: var(--braise-2); }
.regles { display: grid; gap: 14px; margin-bottom: 1.8em; }
.regle { display: flex; gap: 16px; align-items: flex-start; }
.regle p { margin: 0; line-height: 1.45; color: #d6c8ae; }
.regle-num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titre); font-size: 1.1rem; color: #3a2414; background: radial-gradient(circle at 40% 35%, #c76a3a, #8e3a1c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.regle-ombre { background: radial-gradient(circle, #0c0a10 30%, #3a3448); }

/* ——— Cinématique */
#cine { background: #070504; cursor: default; }
#cine.actif { display: flex; align-items: center; justify-content: center; }
.cine-fond { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 3s; filter: brightness(.45) saturate(.8); }
.cine-fond.visible { opacity: 1; }
.cine-texte { position: relative; max-width: 760px; padding: 0 28px; font-family: var(--titre); font-size: clamp(1.25rem, 2.3vw, 1.75rem); line-height: 1.6; color: #eadcc2; text-align: center; text-shadow: 0 2px 20px #000; }
.cine-texte p { margin: 0; opacity: 0; transform: translateY(6px); transition: opacity 1.6s ease, transform 1.6s ease; }
.cine-texte p.visible { opacity: 1; transform: none; }
.cine-suite { position: absolute; bottom: 7vh; left: 50%; transform: translateX(-50%); background: none; border: 0; color: #9c8a70; font-family: var(--titre); font-style: italic; font-size: 1.05rem; opacity: 0; transition: opacity 1s; }
.cine-suite.visible { opacity: 1; }
.cine-suite:hover { color: var(--texte-clair); }

/* ——— La Table */
#table { background:
  radial-gradient(ellipse at 30% 40%, rgba(255, 170, 90, .07), transparent 60%),
  repeating-linear-gradient(93deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 9px),
  linear-gradient(180deg, #1c140e, #120c08); }
#table.actif { display: grid; grid-template-rows: auto 1fr auto; }
.barre-haut { display: flex; align-items: center; gap: 20px; padding: 10px 18px; border-bottom: 1px solid rgba(233, 220, 196, .08); position: relative; z-index: 3; }
.chapitre { display: flex; flex-direction: column; min-width: 210px; }
#chap-nom { font-family: var(--titre-sc); font-size: .85rem; color: var(--texte-doux); }
#chap-titre { font-family: var(--titre); font-size: 1.15rem; color: #f0e2c6; }
.ombre { flex: 1; display: flex; align-items: center; gap: 12px; }
.ombre-cases { flex: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; max-width: 620px; }
.ombre-cases i { height: 10px; border-radius: 1px; background: rgba(233, 220, 196, .1); transition: background .8s, box-shadow .8s; }
.ombre-cases i.pleine { background: #0b0910; box-shadow: 0 0 0 1px rgba(110, 90, 140, .35), 0 0 10px rgba(60, 40, 90, .6); }
.ombre-cases i.nouvelle { animation: case 1.6s ease; }
@keyframes case { 0% { background: #6d4c8a; box-shadow: 0 0 20px #6d4c8a; } 100% {} }
.ombre-nom { font-family: var(--titre); font-style: italic; color: #8d7f97; font-size: .95rem; }
.haut-actions { display: flex; gap: 2px; }

.plan { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.scene { display: flex; flex-direction: column; min-height: 0; padding: 16px 10px 10px 18px; }
.scene-cadre { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.scene-boite { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: 16 / 9; height: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .5); }
.scene-img { position: absolute; display: block; object-fit: cover; }
.scene-calques, .scene-noir { position: absolute; pointer-events: none; }
.scene-calques > * { pointer-events: auto; }
.scene.cible-glisser .scene-cadre { outline: 1px dashed rgba(240, 160, 80, .6); outline-offset: 4px; }
.scene-legende { padding: 12px 4px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 20px; align-items: baseline; }
.scene-legende h2 { margin: 0; font-family: var(--titre); font-weight: 400; font-size: 1.35rem; color: #f2e4c8; white-space: nowrap; }
.scene-legende p { margin: 0; color: #c4b598; font-size: .98rem; line-height: 1.45; max-height: 4.4em; overflow: auto; }
.scene-actions { display: flex; gap: 8px; }

/* nombres cachés : encre posée dans l'image */
.nombre-cache { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, -4deg)); font-family: var(--titre); font-size: clamp(14px, 1.45vw, 26px); color: rgba(30, 20, 12, .85); mix-blend-mode: multiply; pointer-events: none; user-select: none; letter-spacing: .02em; }
.nombre-cache.clair { color: rgba(240, 226, 196, .78); mix-blend-mode: screen; }
.seul-anneau { opacity: 0; transition: opacity 1.2s; pointer-events: none; }
body.anneau .seul-anneau { opacity: 1; }

/* lieux sombres : la lanterne */
.scene-noir { background: radial-gradient(circle var(--rayon, 110px) at var(--lx, 50%) var(--ly, 50%), rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, .2) 50%, rgba(0, 0, 0, .93) 100%); display: none; }
.scene.sombre .scene-noir { display: block; }
.scene.sombre .scene-boite { cursor: none; }
.scene.sombre.froide .scene-img { filter: saturate(.3) hue-rotate(160deg) brightness(1.1); }

/* ——— La main */
.main-joueur { border-left: 1px solid rgba(233, 220, 196, .07); display: flex; flex-direction: column; min-height: 0; background: rgba(0, 0, 0, .14); }
.main-titre { font-family: var(--titre); font-style: italic; color: var(--texte-doux); padding: 14px 18px 6px; font-size: .95rem; }
.cartes { flex: 1; overflow-y: auto; padding: 8px 14px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 12px; align-content: start; }
.carte { position: relative; aspect-ratio: 3 / 4; border-radius: 4px; background: var(--papier); color: var(--encre); box-shadow: 0 6px 14px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(80, 55, 25, .25), inset 0 0 30px rgba(140, 100, 50, .35); transform: rotate(var(--rot, 0deg)); transition: transform .25s, box-shadow .25s; touch-action: none; user-select: none; cursor: grab; overflow: hidden; }
.carte::before { content: ""; position: absolute; inset: 0; background: url(../img/papier.jpg) center / cover; mix-blend-mode: multiply; opacity: .55; pointer-events: none; }
.carte:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 12px 22px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(80, 55, 25, .3), inset 0 0 30px rgba(140, 100, 50, .35); }
.carte .c-num { position: absolute; top: 5px; left: 5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titre); font-size: .8rem; color: #f3dcc0; background: radial-gradient(circle at 40% 35%, #b4542a, #7a2b14); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); z-index: 2; }
.carte .c-img { position: absolute; left: 8%; right: 8%; top: 13%; bottom: 30%; background-size: cover; background-position: center; mix-blend-mode: multiply; filter: sepia(.25) contrast(1.05); border-radius: 2px; }
.carte .c-img.vide { display: grid; place-items: center; mix-blend-mode: normal; filter: none; }
.carte .c-img.vide svg { width: 52%; opacity: .5; stroke: var(--encre-2); fill: none; stroke-width: 1.3; }
.carte .c-titre { position: absolute; left: 6px; right: 6px; bottom: 7px; height: 2.6em; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--titre); font-size: .8rem; line-height: 1.12; }
.carte .c-type { position: absolute; top: 7px; right: 7px; width: 14px; height: 14px; opacity: .55; }
.carte.lieu { background: #d7c7a3; }
.carte.lieu .c-img { top: 10%; bottom: 28%; left: 5%; right: 5%; }
.carte.meca .c-type, .carte.lieu .c-type { opacity: .7; }
.carte.anneau-carte { background: radial-gradient(circle at 50% 40%, #f6e8c4, #d9c08a); }
.carte.active { box-shadow: 0 0 0 2px rgba(240, 160, 80, .9), 0 8px 18px rgba(0, 0, 0, .6); }
.carte.nouvelle { animation: arrive .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes arrive { from { transform: translateY(-30px) rotate(-8deg) scale(1.15); opacity: 0; } }
.carte.cible { transform: scale(1.06); box-shadow: 0 0 0 2px var(--braise-2), 0 0 26px rgba(240, 160, 80, .55); }
.carte.fantome { position: fixed; z-index: 100; pointer-events: none; width: 104px; opacity: .92; transform: rotate(-4deg) scale(1.05); box-shadow: 0 22px 40px rgba(0, 0, 0, .7); }
.carte.retient { opacity: .3; }
.carte.secoue { animation: secoue .45s; }
@keyframes secoue { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ——— Barre du bas */
.barre-bas { display: flex; align-items: center; gap: 18px; padding: 10px 18px 12px; border-top: 1px solid rgba(233, 220, 196, .08); position: relative; z-index: 3; }
.pioche { display: flex; align-items: center; gap: 10px; }
.pioche label { font-family: var(--titre); color: var(--texte-doux); font-size: 1rem; }
.pioche input { width: 58px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(233, 220, 196, .2); border-radius: 3px; color: var(--texte-clair); padding: 6px 8px; text-align: center; font-family: var(--titre); font-size: 1.15rem; }
.bas-centre { flex: 1; text-align: center; color: var(--texte-doux); font-style: italic; font-size: .95rem; }
.bas-actions { display: flex; gap: 10px; }
.btn-anneau { display: flex; align-items: center; gap: 10px; border-color: rgba(201, 162, 74, .5); color: #ecd59c; }
.anneau-rond { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--or); box-shadow: 0 0 8px rgba(201, 162, 74, .5); }
body.anneau .btn-anneau { background: rgba(201, 162, 74, .15); border-color: var(--or); animation: pouls 1.3s infinite; }
@keyframes pouls { 50% { box-shadow: 0 0 22px rgba(201, 162, 74, .45); } }

/* ——— Voiles : l'Ombre et l'anneau */
.voile-ombre { position: fixed; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 50% 50%, transparent calc(70% - var(--ombre-pct) * 30%), rgba(10, 6, 18, calc(.15 + var(--ombre-pct) * .55)) 100%); transition: background 2s; }
.voile-anneau { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 1.2s; background: radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(30, 30, 40, .65) 100%); backdrop-filter: grayscale(1) contrast(1.15) brightness(.85); -webkit-backdrop-filter: grayscale(1) contrast(1.15) brightness(.85); }
body.anneau .voile-anneau { opacity: 1; animation: tangue 7s ease-in-out infinite; }
@keyframes tangue { 50% { transform: scale(1.015) rotate(.15deg); } }
body.anneau .scene-img { filter: blur(.6px); }
.poussiere { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.poussiere i { position: absolute; top: -10px; width: 2px; height: 2px; background: rgba(200, 180, 150, .7); border-radius: 50%; animation: tombe 1.8s linear forwards; }
@keyframes tombe { to { transform: translateY(105vh) translateX(var(--dx, 0)); opacity: 0; } }
#table.tremble .plan { animation: tremble .25s; }
@keyframes tremble { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }

/* ——— Modales */
.modale { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modale-fond { position: absolute; inset: 0; background: rgba(6, 4, 3, .78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modale > *:not(.modale-fond) { position: relative; }
.carte-grande { width: min(880px, 100%); max-height: calc(100vh - 40px); overflow: auto; display: grid; grid-template-columns: 300px 1fr; background: var(--papier); color: var(--encre); border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8), inset 0 0 60px rgba(140, 100, 50, .35); animation: ouvre .35s cubic-bezier(.2, .8, .2, 1); }
.carte-grande::before { content: ""; position: absolute; inset: 0; background: url(../img/papier.jpg) center / cover; mix-blend-mode: multiply; opacity: .5; pointer-events: none; border-radius: 4px; }
@keyframes ouvre { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.cg-visuel { position: relative; padding: 22px 0 22px 22px; }
.cg-visuel .cg-img { width: 100%; aspect-ratio: 3 / 4; background-size: cover; background-position: center; mix-blend-mode: multiply; filter: sepia(.2); border-radius: 2px; }
.cg-num { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titre); font-size: 1.15rem; color: #f3dcc0; background: radial-gradient(circle at 40% 35%, #b4542a, #7a2b14); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); z-index: 2; }
.cg-corps { position: relative; padding: 26px 30px 26px 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cg-corps h2 { margin: 0; font-family: var(--titre); font-weight: 400; font-size: 1.85rem; line-height: 1.1; }
.cg-texte { font-size: 1.08rem; line-height: 1.55; }
.cg-texte p { margin: .5em 0; }
.carte-grande.sans-visuel { grid-template-columns: 1fr; }
.carte-grande.sans-visuel .cg-num { position: relative; top: 0; left: 0; }
.carte-grande.sans-visuel .cg-corps { padding-left: 30px; }
.cg-fermer { position: absolute; top: 10px; right: 10px; z-index: 3; color: var(--encre-2); }
.cg-anneau { display: none; }
body.anneau .cg-anneau { display: block; }
body.anneau .cg-sans-anneau.a-alt { display: none; }
.cg-anneau { color: #2c2f38; background: rgba(120, 130, 150, .12); border-left: 2px solid #7d8698; padding: 10px 14px; animation: apparait 1.5s; }
@keyframes apparait { from { opacity: 0; filter: blur(4px); } }
.manuscrit { font-family: var(--titre); font-style: italic; font-size: 1.12em; line-height: 1.5; color: #3a2616; }
.manuscrit.signature { text-align: right; }
.citation { font-family: var(--titre); font-style: italic; border-left: 2px solid var(--papier-ombre); padding-left: 14px; }
.lune-ecrit { color: #4b5a72; text-shadow: 0 0 6px rgba(200, 215, 240, .9); }
.inscription { margin: 10px 0; padding: 14px; background: rgba(60, 40, 20, .08); border: 1px solid rgba(60, 40, 20, .18); color: var(--encre); display: flex; justify-content: center; }
.inscription.feu { background: #1d0f08; color: #f5a14a; filter: drop-shadow(0 0 4px rgba(255, 140, 40, .8)); }
.runes-phrase { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.runes-ligne { display: flex; flex-wrap: wrap; gap: 4px 2px; align-items: center; justify-content: center; }
.runes-mot { display: inline-flex; gap: 3px; }
.runes-sep { opacity: .6; padding: 0 5px; }
svg.rune { width: 13px; height: 26px; }
.inscription svg.rune { width: 15px; height: 30px; }

/* ——— Billet */
.billet { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--papier); color: var(--encre); padding: 30px 34px 24px; border-radius: 3px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8), inset 0 0 50px rgba(140, 100, 50, .35); animation: ouvre .4s cubic-bezier(.2, .8, .2, 1); }
.billet-texte { font-family: var(--titre); font-size: 1.22rem; line-height: 1.6; margin-bottom: 20px; }
.billet .btn { color: var(--encre); border-color: rgba(43, 29, 18, .4); }
.billet .btn:hover { background: rgba(43, 29, 18, .07); }

/* ——— Panneaux (conseil, menu) */
.panneau { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #1d1510; border: 1px solid rgba(233, 220, 196, .12); border-radius: 4px; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); }
.panneau h2 { margin: 0 0 .2em; font-family: var(--titre); font-weight: 400; font-size: 1.8rem; color: #f2e4c8; }
.panneau-sous { color: var(--texte-doux); margin: 0 0 1.2em; font-size: .98rem; }
.enigme { border-top: 1px solid rgba(233, 220, 196, .1); padding: 14px 0; }
.enigme h3 { margin: 0 0 8px; font-family: var(--titre); font-weight: 400; font-size: 1.2rem; color: #ecdcbf; }
.enigme ol { margin: 0 0 10px; padding-left: 1.2em; color: #d2c3a6; line-height: 1.45; }
.enigme li { margin-bottom: 6px; }
.reglage { display: flex; align-items: center; gap: 14px; color: #d2c3a6; margin-bottom: 1em; }
.reglage input { flex: 1; accent-color: var(--braise); }
.menu-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1em; }

/* ——— Plateau */
.ecran-dessus { position: fixed; inset: 0; z-index: 15; background: #0e0a07; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; animation: fondu .8s; }
@keyframes fondu { from { opacity: 0; } }
.plateau-carte { width: min(100%, calc((100vh - 120px) * 1.6)); aspect-ratio: 16 / 10; position: relative; }
.plateau-carte svg { width: 100%; height: 100%; display: block; }
.plateau-legende { margin-top: 12px; font-family: var(--titre); font-style: italic; color: var(--texte-doux); text-align: center; min-height: 1.5em; }
.plateau-fermer { margin-top: 10px; }

/* ——— Fin */
#fin { background: linear-gradient(rgba(10, 7, 4, .78), rgba(10, 7, 4, .92)), url(../img/fin.jpg) center / cover, #0b0806; overflow: auto; }
#fin.garde { background: linear-gradient(rgba(6, 4, 8, .85), rgba(6, 4, 8, .95)), url(../img/s-couche.jpg) center / cover, #060408; }
#fin.actif { display: flex; justify-content: center; }
.fin-boite { width: min(720px, 100%); padding: 9vh 24px 60px; text-align: center; }
.fin-sur { font-family: var(--titre); font-style: italic; color: var(--texte-doux); }
.fin-boite h2 { font-family: var(--titre); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); margin: .2em 0 .6em; color: #f2e4c8; }
#fin-texte p { font-family: var(--titre); font-size: 1.25rem; line-height: 1.65; color: #e3d4b8; }
.fin-bilan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 2.2em 0; }
.fin-bilan div { border: 1px solid rgba(233, 220, 196, .12); padding: 12px; border-radius: 3px; }
.fin-bilan dt { color: var(--texte-doux); font-size: .9rem; }
.fin-bilan dd { margin: 4px 0 0; font-family: var(--titre); font-size: 1.6rem; color: #f2e4c8; }
.fin-carnet { color: #e6c79a; font-family: var(--titre); font-size: 1.15rem; line-height: 1.5; }
.fin-credits { color: #6f6250; font-size: .85rem; margin-top: 3em; line-height: 1.5; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px); background: #2a1f17; border: 1px solid rgba(233, 220, 196, .18); color: var(--texte-clair); padding: 10px 18px; border-radius: 3px; font-family: var(--titre); font-size: 1.05rem; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 40; max-width: 90vw; text-align: center; }
.toast.visible { opacity: 1; transform: translateX(-50%); }

/* ——— Mécanismes */
.meca { margin-top: 6px; padding-top: 14px; border-top: 1px solid rgba(60, 40, 20, .2); }
.meca .btn { color: var(--encre); border-color: rgba(43, 29, 18, .4); }
.meca .btn:hover { background: rgba(43, 29, 18, .07); }
.meca .btn-principal { background: #3a2414; color: #f3dcc0; border-color: #3a2414; }
.meca .btn-principal:hover { background: #4d311c; }
.meca-ligne { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 10px 0 16px; }
.roue { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.roue-plaque { width: 54px; height: 54px; border-radius: 4px; background: linear-gradient(145deg, #c08a4a, #8a5a28); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 4px rgba(0, 0, 0, .3); }
.roue-plaque svg { width: 36px; height: 36px; stroke: #3a2210; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.roue-val { width: 54px; height: 64px; display: grid; place-items: center; font-family: var(--titre); font-size: 2rem; background: linear-gradient(#2a1c12, #4a3322 50%, #2a1c12); color: #f0dcb8; border-radius: 3px; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6); }
.roue-val svg.chiffre-nain { width: 30px; height: 36px; color: #f0dcb8; }
.roue button { background: none; border: 0; color: var(--encre-2); width: 54px; height: 26px; font-size: 1rem; }
.roue button:hover { color: var(--encre); }
.horloge { width: 260px; height: 260px; margin: 6px auto 14px; touch-action: none; display: block; }
.harpe { width: 100%; max-width: 460px; height: 260px; margin: 0 auto 10px; display: block; touch-action: none; }
.harpe .corde { stroke: #6b4a28; stroke-width: 2; }
.harpe .corde.vibre { animation: vibre .5s; stroke: #b07a3a; }
@keyframes vibre { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(1.5px); } 40% { transform: translateX(-1.5px); } 60% { transform: translateX(1px); } 80% { transform: translateX(-.5px); } }
.notes-jouees { text-align: center; min-height: 1.4em; font-family: var(--titre); color: var(--encre-2); letter-spacing: .2em; }
.lunaire { width: 300px; height: 300px; margin: 0 auto; display: block; }
.lunaire-commandes { display: flex; justify-content: center; gap: 30px; margin: 10px 0 14px; flex-wrap: wrap; }
.lunaire-commandes > div { display: flex; align-items: center; gap: 8px; font-family: var(--titre); }
.clavier-runes { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 460px; margin: 10px auto; }
.clavier-runes button { aspect-ratio: 1 / 1.25; background: linear-gradient(#cdbb95, #b39d72); border: 0; border-radius: 3px; box-shadow: 0 3px 0 #7d6744, inset 0 1px 0 rgba(255, 255, 255, .3); display: grid; place-items: center; color: #2b1d12; padding: 4px; }
.clavier-runes button:active, .clavier-runes button.enfonce { transform: translateY(3px); box-shadow: 0 0 0 #7d6744, inset 0 2px 4px rgba(0, 0, 0, .3); }
.clavier-runes svg.rune { width: 12px; height: 24px; }
.saisie-runes { min-height: 46px; display: flex; gap: 4px; justify-content: center; align-items: center; padding: 6px; border-bottom: 1px solid rgba(60, 40, 20, .3); margin-bottom: 10px; }
.saisie-runes svg.rune { width: 15px; height: 30px; }
.porte-frappe { width: 100%; height: 240px; border-radius: 3px; background: radial-gradient(ellipse at 50% 40%, #6a5a48, #2c241c 75%); position: relative; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 0 40px rgba(0, 0, 0, .7); user-select: none; }
.porte-frappe .inscription { background: transparent; border: 0; color: #c9b896; opacity: .7; }
.porte-frappe.coup { animation: coup .15s; }
@keyframes coup { 50% { transform: scale(.992); filter: brightness(1.15); } }
.coups { text-align: center; min-height: 1.6em; margin-top: 8px; font-family: var(--titre); letter-spacing: .15em; color: var(--encre-2); }
.choix-liste { display: flex; flex-direction: column; gap: 8px; }
.choix-liste .btn { text-align: left; }
.falaise-grille { position: absolute; top: 8%; right: 46%; bottom: 26%; left: 4%; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(2, 1fr); gap: 0; }
.falaise-grille button { background: rgba(20, 14, 8, .12); border: 1px dashed rgba(25, 16, 8, .55); color: #1b120a; font-family: var(--titre); font-size: 1.05rem; margin: 3px; border-radius: 2px; text-shadow: 0 0 4px rgba(240, 230, 210, .9), 0 0 2px rgba(240, 230, 210, 1); }
.falaise-grille button:hover { background: rgba(240, 230, 210, .22); }
.falaise-grille button.frappe { animation: coup .2s; background: rgba(240, 230, 210, .12); }
.falaise-grille button.marque { border-color: rgba(255, 255, 255, .7); border-style: solid; }
.champis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 14px; }
.champi { background: #16110d; border-radius: 3px; padding: 8px 6px 6px; border: 0; color: #d6c8ae; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.champi svg { width: 100%; height: 110px; }
.champi span { font-family: var(--titre); }
.champi:hover { outline: 1px solid rgba(240, 160, 80, .5); }

/* ——— Le dédale */
.dedale { position: absolute; inset: 0; }
.dedale-arche { position: absolute; bottom: 18%; width: 15%; height: 54%; transform: translateX(-50%); border: 0; background: transparent; cursor: pointer; padding: 0; }
.dedale-arche svg.forme { position: absolute; inset: 0; width: 100%; height: 100%; }
.dedale-arche .arche-rune { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); color: #e9d9b8; }
.dedale-arche .arche-rune svg.rune { width: 16px; height: 32px; }
.dedale-arche .pas-fantome { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); width: 60%; opacity: 0; transition: opacity 1.4s; }
body.anneau .dedale-arche.bonne .pas-fantome { opacity: .9; }
.dedale-arche:hover svg.forme path { stroke: rgba(240, 200, 140, .7); }
.dedale-trait { position: absolute; left: 4%; top: 4%; max-width: 44%; font-family: var(--titre); color: #d9c9a8; font-size: clamp(14px, 1.15vw, 19px); line-height: 1.45; text-shadow: 0 1px 6px #000; pointer-events: none; }
.dedale-trait b { display: block; font-weight: 400; font-size: 1.3em; margin-bottom: 4px; color: #f2e4c8; }
.dedale-grille { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); }
.eclat { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, #fff6d8 0, #ffcf7a 30%, rgba(255, 140, 50, 0) 70%); animation: eclat 1.1s ease-in-out infinite alternate; cursor: pointer; border: 0; padding: 0; }
@keyframes eclat { to { transform: translate(-50%, -50%) scale(1.5); } }
.couchant-teinte { position: absolute; pointer-events: none; mix-blend-mode: multiply; transition: background 1s linear; }
.sous-titre { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); font-family: var(--titre); font-style: italic; color: #f1e2c4; text-shadow: 0 1px 8px #000; font-size: 1.1rem; pointer-events: none; transition: opacity .6s; }
.ciel-vue { width: 100%; height: 340px; overflow: hidden; position: relative; border-radius: 3px; cursor: grab; touch-action: none; background: #05070d; }
.ciel-vue svg { position: absolute; top: 0; height: 100%; }
.ciel-aide { text-align: center; font-style: italic; color: var(--encre-2); font-size: .95rem; margin: 6px 0 0; }

/* ——— Petits écrans */
@media (max-width: 1000px) {
  html, body { font-size: 16px; }
  .plan { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 200px; }
  .main-joueur { border-left: 0; border-top: 1px solid rgba(233, 220, 196, .07); }
  .cartes { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .scene-legende { grid-template-columns: 1fr; }
  .carte-grande { grid-template-columns: 1fr; }
  .cg-visuel { padding: 18px 18px 0; }
  .cg-visuel .cg-img { aspect-ratio: 16 / 9; }
  .prepa-roles { grid-template-columns: 1fr; }
  .ombre-nom { display: none; }
  .chapitre { min-width: 0; }
  .barre-bas { flex-wrap: wrap; gap: 10px; }
  .bas-centre { order: -1; flex-basis: 100%; }
  .bas-centre:empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.horloge, .harpe, .lunaire, .ciel-vue, .porte-frappe, .finale { user-select: none; -webkit-user-select: none; }
.cine-chap { font-family: var(--titre-sc); font-size: .8em; color: #a08a6a; letter-spacing: .1em; }
.lueur-feu { position: absolute; left: var(--fx, 50%); top: var(--fy, 60%); width: 30%; height: 40%; transform: translate(-50%, -50%); background: radial-gradient(ellipse, rgba(255, 170, 70, .85), rgba(255, 110, 30, .35) 40%, rgba(255, 120, 40, 0) 70%); mix-blend-mode: screen; animation: flamme 2.3s infinite alternate ease-in-out; pointer-events: none; }
@keyframes flamme { 0% { opacity: .75; } 30% { opacity: 1; } 55% { opacity: .82; } 80% { opacity: .97; } 100% { opacity: .7; } }

.carte-grande.plan { grid-template-columns: 1fr; width: min(1000px, 100%); }
.carte-grande.plan .cg-visuel { padding: 22px 22px 0; }
.carte-grande.plan .cg-img { aspect-ratio: 16 / 10; background-size: contain; background-repeat: no-repeat; mix-blend-mode: normal; filter: none; }

.arche-argent { position: absolute; left: 16.5%; top: 60%; width: 9%; transform: translate(-50%, -50%); filter: drop-shadow(0 0 6px rgba(210, 225, 255, .9)); animation: apparait 3s; pointer-events: none; }

.cg-plan, .c-plan { mix-blend-mode: normal !important; filter: none !important; }
.cg-plan svg, .c-plan svg { width: 100%; height: 100%; display: block; }
.carte .c-plan { background: #e6d3aa; }

/* ——— Écrans bas (portables 13 pouces, 720 à 820 px de haut) */
@media (max-height: 820px) and (min-width: 1001px) {
  .carte-grande { grid-template-columns: 210px 1fr; }
  .cg-visuel { padding: 16px 0 16px 16px; }
  .cg-corps { padding: 18px 24px 18px 20px; gap: 9px; }
  .cg-corps h2 { font-size: 1.5rem; }
  .cg-texte { font-size: 1rem; line-height: 1.45; }
  .inscription { padding: 8px; margin: 4px 0; }
  .inscription svg.rune { width: 12px; height: 24px; }
  .clavier-runes { gap: 5px; max-width: 400px; margin: 6px auto; }
  .clavier-runes button { aspect-ratio: 1 / 1.1; }
  .horloge { width: 210px; height: 210px; }
  .lunaire { width: 250px; height: 250px; }
  .harpe { height: 210px; }
  .ciel-vue { height: 280px; }
  .porte-frappe { height: 190px; }
  .champi svg { height: 84px; }
  .billet { padding: 22px 26px 18px; }
  .billet-texte { font-size: 1.1rem; }
}
