/* =====================================================================
   Purpose ? — direction artistique : cabinet de curiosités (noir chaud, ivoire, terracotta)
   ===================================================================== */
:root {
  /* Purpose ? — cabinet de curiosités : noir chaud, ivoire, terracotta */
  --bg: #0d0f10;
  --bg2: #131516;
  --panel: rgba(27, 30, 31, 0.9);
  --panel-solid: #1b1e1f;
  --line: rgba(233, 225, 214, 0.09);
  --line2: rgba(233, 225, 214, 0.17);
  --text: #e9e1d6;
  --muted: #a39b8f;
  --dim: #8c857a; /* contraste ≥ 4,5:1 sur le fond (accessibilité) */
  --accent: #bd5d36;        /* aplats : boutons d'action */
  --accent-hi: #d0703f;     /* survol */
  --accent-ink: #fff7ee;    /* texte sur aplat terracotta */
  --gold: #dc8158;          /* terracotta lisible sur fond sombre (texte, traits) */
  --gold2: #eaa27f;
  --brass: #b79a6b;         /* laiton : illustrations au trait */
  --good: #86c18f;
  --good-bg: rgba(134, 193, 143, 0.13);
  --bad: #e2566f;
  --bad-bg: rgba(226, 86, 111, 0.13);
  --mid: #e3bb5c;
  --mid-bg: rgba(227, 187, 92, 0.13);
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --hud-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--gold); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(214,118,78, 0.35); }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .5s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-x { font: 800 64px/1 var(--display); color: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.92); } }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid var(--line2); border-radius: 12px; padding: 11px 18px;
  background: rgba(233,225,214, 0.04); font-weight: 700; letter-spacing: .01em;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover:not(:disabled) { background: rgba(233,225,214, 0.08); border-color: rgba(233,225,214, .25); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; }
.btn-primary { background: linear-gradient(180deg, #d0703f, #b4552f); color: #fff7ee; border-color: transparent; box-shadow: 0 6px 22px rgba(214,118,78, .25), inset 0 1px 0 rgba(233,225,214,.4); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #eaa27f, #c4623a); box-shadow: 0 8px 30px rgba(214,118,78, .38), inset 0 1px 0 rgba(233,225,214,.4); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(226,86,111, .14); border-color: rgba(226,86,111, .45); color: #f3bcc5; }
.btn-xl { padding: 16px 34px; font-size: 19px; border-radius: 16px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-sub { font-size: 12px; font-weight: 600; opacity: .72; letter-spacing: 0; }
.link-btn { background: none; border: 0; color: var(--dim); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.link-btn:hover { color: var(--muted); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(233,225,214,.03); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg path:first-child { fill: currentColor; stroke: none; }
.icon-btn.off .wave { opacity: .15; }

/* ---------- écrans ---------- */
.screen { position: fixed; inset: 0; }
.screen-home, .screen-end { overflow-y: auto; display: flex; flex-direction: column; }
.home-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.home-grid {
  position: absolute; inset: -50%;
  background-image: linear-gradient(rgba(214,118,78,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(214,118,78,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(58deg) translateY(10%);
  animation: gridmove 18s linear infinite;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 65%);
}
@keyframes gridmove { to { background-position: 0 48px, 48px 0; } }
.home-glow { position: absolute; left: 50%; top: 30%; width: 900px; height: 900px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(214,118,78,.16), transparent 60%); }
.home-inner { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px 24px; max-width: 980px; margin: 0 auto; }
.home-kicker { font: 600 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); opacity: .85; margin-bottom: 18px; }
.logo { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(64px, 13vw, 148px); line-height: .9; letter-spacing: -.02em; display: flex; align-items: baseline; gap: .08em; }
.logo span { background: linear-gradient(180deg, #fff, #b8ae9e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo b { color: var(--gold); font-weight: 800; text-shadow: 0 0 60px rgba(214,118,78,.45); display: inline-block; animation: xspin 6s var(--ease) infinite; }
@keyframes xspin { 0%, 80% { transform: rotate(0); } 90% { transform: rotate(90deg) scale(1.08); } 100% { transform: rotate(180deg); } }
.home-tagline { font: 500 clamp(19px, 2.6vw, 26px)/1.3 var(--display); color: #ddd4c6; margin: 18px 0 36px; font-style: italic; }
.home-steps { list-style: none; padding: 0; margin: 0 0 38px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left; width: 100%; }
.home-steps li { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(233,225,214,.025); backdrop-filter: blur(6px); }
.home-steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--mono); color: var(--gold); border: 1px solid rgba(214,118,78,.4); }
.home-steps b { display: block; font-size: 15.5px; }
.home-steps small { color: var(--muted); font-size: 13px; line-height: 1.45; display: block; margin-top: 2px; }
.home-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.home-stats { margin-top: 26px; display: flex; gap: 22px; color: var(--muted); font-size: 13px; flex-wrap: wrap; justify-content: center; }
.home-stats b { color: var(--text); font-family: var(--mono); }
.home-foot { position: relative; text-align: center; color: var(--dim); font-size: 12px; padding: 16px 20px 22px; }

/* ---------- HUD ---------- */
.screen-game { display: flex; flex-direction: column; }
.hud { height: var(--hud-h); flex: none; display: flex; align-items: center; gap: 22px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(13,15,16,.85); backdrop-filter: blur(10px); z-index: 5; }
.hud-logo { font: 800 20px var(--display); background: none; border: 0; padding: 0; letter-spacing: -.01em; }
.hud-logo b { color: var(--gold); margin-left: 3px; }
.hud-label { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.hud-round { margin-left: 10px; }
.hud-pips { display: flex; gap: 6px; margin-top: 5px; }
.hud-pips i { width: 26px; height: 6px; border-radius: 4px; background: rgba(233,225,214,.1); transition: background .3s; }
.hud-pips i.cur { background: var(--gold); box-shadow: 0 0 12px rgba(214,118,78,.6); }
.hud-pips i.v-good { background: var(--good); }
.hud-pips i.v-mid { background: var(--mid); }
.hud-pips i.v-bad { background: var(--bad); }
.hud-capital { margin-left: auto; text-align: right; }
.hud-capital-val { font: 700 26px/1.1 var(--mono); color: var(--gold2); }
.hud-capital-val small { font-size: 12px; color: var(--dim); margin-left: 4px; }
.hud-capital.hit .hud-capital-val { animation: hit .5s; }
@keyframes hit { 0% { color: var(--bad); transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 100% { color: var(--gold2); transform: none; } }
.hud-total { text-align: right; }
.hud-total-val { font: 700 18px/1.3 var(--mono); }
.hud-timer { display: flex; align-items: center; gap: 7px; font: 600 14px var(--mono); color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; }
.hud-timer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 1.6s infinite; }

/* ---------- layout de jeu ---------- */
.game-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 440px; position: relative; }
.stage { position: relative; min-height: 0; overflow: hidden; }
.stage-bg { position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 60% at 50% 45%, #2a2d2e 0%, #191c1d 45%, #0d0f10 100%); }
.stage-bg::after { content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(233,225,214,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(233,225,214,.035) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at 50% 60%, #000 10%, transparent 70%); }
.viewer-host { position: absolute; inset: 0; touch-action: none; }
.viewer-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.viewer-canvas:active { cursor: grabbing; }
.specimen-tag { position: absolute; left: 18px; top: 18px; padding: 10px 14px 9px; border-radius: 6px; background: #efe6d2; color: #2a2216; box-shadow: 0 8px 24px rgba(0,0,0,.45); transform: rotate(-2deg); font-family: var(--mono); pointer-events: none; }
.specimen-tag::before { content: ''; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); transform: translateX(-50%); box-shadow: inset 0 0 0 2px #b9ab8c; }
.tag-k { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; opacity: .65; }
.tag-n { font: 800 22px/1.05 var(--display); }
.tag-d { font-size: 11px; margin-top: 2px; letter-spacing: .08em; }
.spec-dims { position: absolute; left: 18px; top: 112px; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; max-width: 260px; border-radius: 10px; background: rgba(16,18,19,.72); border: 1px solid var(--line); backdrop-filter: blur(8px); pointer-events: none; }
.spec-dims .sd-k { font: 600 9.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.spec-dims .sd-v { font: 700 14px var(--mono); color: var(--gold2); }
.spec-dims .sd-h { font-size: 11.5px; color: var(--muted); }
.stage-tools { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(16,18,19,.72); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.tool { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: background .2s, color .2s; }
.tool:hover { background: rgba(233,225,214,.07); color: var(--text); }
.tool.on { background: rgba(214,118,78,.16); color: var(--gold2); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stage-hint { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(0,0,0,.4); padding: 5px 12px; border-radius: 20px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.stage-hint.gone { opacity: 0; }
.stage-credit { position: absolute; right: 14px; bottom: 10px; font-size: 10.5px; color: var(--dim); pointer-events: none; }

.loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(circle, rgba(13,15,16,.5), rgba(13,15,16,.92)); transition: opacity .5s; z-index: 2; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-ring { position: relative; width: 96px; height: 96px; }
.loader-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.loader-ring circle { fill: none; stroke: rgba(233,225,214,.08); stroke-width: 4; }
.loader-ring .prog { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 276.5; transition: stroke-dashoffset .3s; }
.loader-ring.spin svg { animation: spin 1.2s linear infinite; }
.loader-ring.spin .prog { stroke-dashoffset: 200; }
@keyframes spin { to { transform: rotate(270deg); } }
.loader-ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 16px var(--mono); }
.loader-text { color: var(--muted); font-size: 14px; text-align: center; max-width: 340px; }
.loader-actions { display: flex; gap: 10px; }
.loader.error .loader-ring .prog { stroke: var(--bad); }

/* ---------- panneau d'enquête ---------- */
.panel { position: relative; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(24,27,28,.96), rgba(16,18,19,.98)); }
.panel-grip { display: none; }
.panel-head { padding: 18px 20px 8px; }
.panel-head h2 { margin: 0; font: 700 21px var(--display); }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-head b { color: var(--gold2); }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 8px 16px 0; }
.step-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(233,225,214,.02); color: var(--muted); font-size: 12.5px; font-weight: 700; transition: all .2s; }
.step-tab i { font: 700 12px var(--mono); font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line2); }
.step-tab:hover { color: var(--text); border-color: var(--line2); }
.step-tab.active { color: var(--text); border-color: rgba(214,118,78,.55); background: rgba(214,118,78,.08); }
.step-tab.active i { border-color: var(--gold); color: var(--gold); }
.step-tab .st { position: absolute; top: 5px; right: 6px; font-style: normal; font-size: 11px; }
.step-tab .st.done-good::after { content: '✓'; color: var(--good); }
.step-tab .st.done-mid::after { content: '●'; color: var(--mid); }
.step-tab .st.done-bad::after { content: '●'; color: var(--bad); }
.step-tab .st.off::after { content: '—'; color: var(--dim); }
.step-tab .st.prog::after { content: '●'; color: var(--gold); opacity: .7; }
.step-tab[data-state="completed"] { border-color: rgba(134,193,143,.35); }
.step-tab[data-state="completed"] i { border-color: var(--good); color: var(--good); }
.step-tab[data-state="unavailable"] { opacity: .55; }
.step-tab span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.step-tab .st.count::after { content: attr(data-n); color: var(--gold); font-family: var(--mono); }
.step-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 18px; animation: fadeup .35s var(--ease); scrollbar-width: thin; scrollbar-color: #333 transparent; }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } }
.step-intro p { margin: 0 0 8px; color: #cac1b2; font-size: 14px; }
.rule { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; font-weight: 600; margin-bottom: 12px; }
.r-good { color: var(--good); } .r-bad { color: var(--bad); } .r-mid { color: var(--mid); }
.step-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.risk { font-size: 12px; color: var(--muted); }
.risk b { color: var(--bad); font-family: var(--mono); }

.fam-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.fam-meta b { color: var(--text); }
.fam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.fam { position: relative; display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px 11px; border-radius: 11px; border: 1px solid var(--line); background: rgba(233,225,214,.025); font-size: 13px; font-weight: 600; color: #d3cabb; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; min-height: 46px; }
.fam .fi { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(233,225,214,.05); font-size: 14px; }
.fam .fs { margin-left: auto; white-space: nowrap; flex: none; font-size: 11px; font-weight: 800; font-family: var(--mono); }
.fam:hover:not(:disabled) { border-color: var(--line2); background: rgba(233,225,214,.05); }
.fam.sel { border-color: var(--gold); background: rgba(214,118,78,.12); box-shadow: inset 0 0 0 1px rgba(214,118,78,.35); color: #fff; }
.fam.sel .fi { background: rgba(214,118,78,.25); }
.fam.sel .fs::after { content: '?'; color: var(--gold); }
.fam.correct { border-color: rgba(134,193,143,.6); background: var(--good-bg); color: #dcefe0; animation: pop .45s var(--ease); }
.fam.correct .fs::after { content: '✓ Oui'; color: var(--good); }
.fam.faux { border-color: rgba(226,86,111,.55); background: var(--bad-bg); color: #f7d3d9; animation: shake .45s; }
.fam.faux .fs::after { content: '✗ −50'; color: var(--bad); }
.fam.proche { border-color: rgba(227,187,92,.55); background: var(--mid-bg); color: #f6d5c2; animation: pop .45s var(--ease); }
.fam.proche .fs::after { content: '≈ Indirect'; color: var(--mid); }
.fam:disabled { cursor: default; }
@keyframes pop { 40% { transform: scale(1.05); } }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* frise */
.tl { padding: 6px 2px 0; user-select: none; }
.tl-readout { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.tl-approx { color: var(--dim); font: 600 22px var(--display); }
.tl-year { font: 800 46px/1 var(--display); color: var(--gold2); font-variant-numeric: tabular-nums; }
.tl-year.long { font-size: 32px; }
.tl-controls { display: flex; justify-content: center; gap: 6px; margin: 8px 0 16px; }
.tl-step { min-width: 44px; height: 32px; padding: 0 4px; white-space: nowrap; border-radius: 8px; border: 1px solid var(--line2); background: rgba(233,225,214,.03); font: 600 13px var(--mono); }
.tl-step:hover:not(:disabled) { background: rgba(233,225,214,.08); }
.tl-wrap { position: relative; padding: 22px 8px 26px; }
.tl-eras { position: absolute; left: 8px; right: 8px; top: 0; height: 18px; }
.tl-eras span { position: absolute; top: 0; font-size: 9.5px; color: var(--dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px dashed rgba(233,225,214,.12); padding: 0 2px; }
.tl-track { position: relative; height: 34px; border-radius: 17px; background: linear-gradient(90deg, #202324, #2a2d2e); border: 1px solid var(--line2); cursor: pointer; touch-action: none; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 17px 0 0 17px; background: linear-gradient(90deg, rgba(214,118,78,.05), rgba(214,118,78,.25)); }
.tl-band { position: absolute; top: -4px; bottom: -4px; border-radius: 6px; background: rgba(134,193,143,.35); border: 2px solid var(--good); box-shadow: 0 0 18px rgba(134,193,143,.45); }
.tl-handle { position: absolute; top: 50%; width: 0; height: 0; }
.tl-handle span { position: absolute; left: -13px; top: -21px; width: 26px; height: 42px; border-radius: 9px; background: linear-gradient(180deg, #eaa27f, #b4552f); box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 0 0 3px rgba(214,118,78,.25); }
.tl-handle span::after { content: ''; position: absolute; left: 11px; top: 10px; width: 4px; height: 22px; border-radius: 2px; background: rgba(0,0,0,.25); }
.tl-ticks { position: absolute; left: 8px; right: 8px; bottom: 2px; height: 16px; }
.tl-ticks span { position: absolute; transform: translateX(-50%); font: 500 10px var(--mono); color: var(--dim); }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }
.tl.locked .tl-track { cursor: default; }

/* carte */
.map-host { position: relative; height: 270px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line2); background: #1f2223; }
.map-host .maplibregl-canvas { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
.map-host .maplibregl-ctrl-attrib { font-size: 10px; }
.map-pin { width: 0; height: 0; }
.map-pin span { position: absolute; left: -11px; top: -30px; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.map-pin.guess span { background: var(--gold); }
.map-pin.truth span { background: var(--good); }
.map-fallback { position: relative; height: 100%; cursor: crosshair; background: radial-gradient(circle, #242728, #16191a); }
.map-fallback svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-fallback line { stroke: rgba(233,225,214,.08); stroke-width: .4; }
.map-fallback line.eq { stroke: rgba(214,118,78,.35); }
.map-fallback p { position: absolute; left: 10px; right: 10px; bottom: 8px; margin: 0; font-size: 11.5px; color: var(--muted); }
.map-fallback .map-pin { position: absolute; }

.step-result { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(233,225,214,.03); animation: fadeup .35s var(--ease); }
.step-result.t-good { border-color: rgba(134,193,143,.45); background: var(--good-bg); }
.step-result.t-mid { border-color: rgba(227,187,92,.45); background: var(--mid-bg); }
.step-result.t-bad { border-color: rgba(226,86,111,.45); background: var(--bad-bg); }
.sr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sr-title { font-weight: 800; font-size: 15px; }
.sr-pen { font: 700 15px var(--mono); }
.sr-pen.zero { color: var(--good); } .sr-pen.neg { color: var(--bad); }
.sr-body { font-size: 13px; color: #ccc3b4; margin-top: 4px; }
.sr-body small { color: var(--muted); display: block; margin-top: 4px; }
.step-disabled { padding: 16px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--muted); font-size: 13.5px; }
.step-disabled b { color: var(--text); display: block; margin-bottom: 4px; }

/* indices */
.hints { display: flex; flex-direction: column; gap: 10px; }
.hint { border-radius: 12px; border: 1px solid var(--line); background: rgba(233,225,214,.025); padding: 13px 14px; }
.hint-top { display: flex; align-items: center; gap: 10px; }
.hint-k { font-weight: 800; font-size: 13.5px; }
.hint-n { font: 700 11px var(--mono); color: var(--dim); }
.hint .btn { margin-left: auto; }
.hint-text { margin-top: 8px; font-size: 14px; color: #e2dacd; animation: fadeup .35s var(--ease); font-family: var(--display); font-style: italic; }
.hint.open { border-color: rgba(214,118,78,.4); background: rgba(214,118,78,.06); }
.hint-paid { margin-left: auto; font: 700 12px var(--mono); color: var(--bad); }

.panel-cta { flex: none; padding: 14px 20px 16px; border-top: 1px solid var(--line); background: rgba(13,15,16,.6); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.btn-final { width: 100%; border: 0; border-radius: 16px; padding: 14px 18px; color: #fff7ee; background: linear-gradient(135deg, #eaa27f 0%, #dc8158 45%, #a94e2b 100%); box-shadow: 0 10px 34px rgba(214,118,78,.35), inset 0 1px 0 rgba(233,225,214,.5); position: relative; overflow: hidden; }
.btn-final::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(233,225,214,.45), transparent); transform: skewX(-20deg); animation: shine 4.5s infinite; }
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.btn-final:hover { box-shadow: 0 12px 40px rgba(214,118,78,.5), inset 0 1px 0 rgba(233,225,214,.5); }
.bf-main { display: block; font: 800 21px var(--display); letter-spacing: .01em; }
.bf-sub { display: block; font-size: 12px; font-weight: 700; opacity: .7; }
.btn-final.locked { background: rgba(233,225,214,.05); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); cursor: not-allowed; }
.btn-final.locked::after { display: none; }
.btn-final.locked:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.btn-final.locked .bf-main { font-size: 18px; }
.final-dots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.final-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(233,225,214,.14); }
.final-dots i.on { background: var(--good); }
.btn-final:not(.locked) .final-dots { display: none; }
.final-lock { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.35; margin-bottom: 2px; }

/* gains et barèmes V2 */
.step-max { margin-top: 6px; font: 700 11.5px var(--mono); color: var(--gold); letter-spacing: .03em; }
.sr-gain { font: 800 17px var(--mono); color: var(--good); }
.sr-max { font: 600 12px var(--mono); color: var(--muted); white-space: nowrap; }
.step-result.t-bad .sr-gain { color: var(--mid); }
.fam-now { color: var(--good) !important; font-family: var(--mono); }
.fam.missed { border-style: dashed; border-color: rgba(134,193,143,.5); }
.fam.missed .fs::after { content: 'principale'; color: var(--good); opacity: .8; }
.hint-btn { display: flex; flex-direction: column; align-items: center; line-height: 1.15; margin-left: auto; padding: 6px 12px; }
.hint-btn small { font: 600 10.5px var(--mono); opacity: .75; }
.hint-paid { color: var(--mid); }
.hint-total { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.hud-pen { font: 600 10.5px var(--mono); color: var(--mid); margin-top: 1px; }
.rv-ledger tr.na td { color: var(--dim); font-style: italic; }
.rv-ledger tr.sub td { border-top: 1px solid var(--line2); font-weight: 700; }

/* jauge des dimensions */
.dg { padding: 6px 2px 0; user-select: none; }
.dg-readout { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dg-k { font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.dg-val { font: 800 42px/1 var(--display); color: var(--gold2); font-variant-numeric: tabular-nums; }
.dg-near { min-height: 17px; font-size: 12.5px; color: var(--muted); }
.dg-wrap { position: relative; padding: 52px 14px 24px; }
.dg-refs { position: absolute; left: 14px; right: 14px; top: 0; height: 48px; }
.dg-ref { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; color: var(--dim); transition: color .2s, transform .2s; }
.dg-ref svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dg-ref em { font-style: normal; font-size: 9.5px; white-space: nowrap; }
.dg-ref.on { color: var(--gold2); transform: translateX(-50%) scale(1.12); }
.dg-track { position: relative; height: 34px; border-radius: 17px; background: linear-gradient(90deg, #202324, #2a2d2e); border: 1px solid var(--line2); cursor: pointer; touch-action: none; }
.dg-track:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.dg-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 17px 0 0 17px; background: linear-gradient(90deg, rgba(214,118,78,.05), rgba(214,118,78,.25)); }
.dg-band { position: absolute; top: -4px; bottom: -4px; border-radius: 6px; background: rgba(134,193,143,.22); border: 1px dashed var(--good); }
.dg-truth { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--good); box-shadow: 0 0 14px rgba(134,193,143,.7); }
.dg-handle { position: absolute; top: 50%; width: 0; height: 0; }
.dg-handle span { position: absolute; left: -13px; top: -21px; width: 26px; height: 42px; border-radius: 9px; background: linear-gradient(180deg, #eaa27f, #b4552f); box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 0 0 3px rgba(214,118,78,.25); }
.dg-handle span::after { content: ''; position: absolute; left: 11px; top: 10px; width: 4px; height: 22px; border-radius: 2px; background: rgba(0,0,0,.25); }
.dg-ticks { position: absolute; left: 14px; right: 14px; bottom: 2px; height: 16px; }
.dg-ticks span { position: absolute; transform: translateX(-50%); font: 500 10px var(--mono); color: var(--dim); white-space: nowrap; }
.dg-controls { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.dg.locked .dg-track, .dg.locked .dg-handle { cursor: default; }

/* ---------- modales ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(8,9,10,.66); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(600px, 100%); border-radius: 20px; padding: 26px 26px 20px; background: linear-gradient(180deg, #1c1f20, #16191a); border: 1px solid var(--line2); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .35s var(--ease); }
.modal-card.small { width: min(420px, 100%); }
.modal-card h3 { margin: 0 0 6px; font: 700 26px/1.15 var(--display); }
.modal-card p { color: var(--muted); margin: 0 0 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(233,225,214,.06); font-size: 20px; line-height: 1; }
.ans-kicker { font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.ans-help { font-size: 13.5px; }
.ans-help b { color: var(--text); }
#ans-input { width: 100%; resize: vertical; min-height: 92px; border-radius: 14px; border: 1px solid var(--line2); background: #0e1011; color: var(--text); padding: 14px 16px; font: 500 17px/1.45 var(--font); }
#ans-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,118,78,.18); }
.ans-feedback { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--mid-bg); border: 1px solid rgba(227,187,92,.4); color: #f6d5c2; }
.ans-scale { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.ans-cap { font-size: 13px; color: var(--muted); }
.ans-cap b { color: var(--gold2); font-family: var(--mono); }
.ans-coefs { display: flex; flex-wrap: wrap; gap: 6px; }
.ans-coefs span { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line); }
.c-good { color: var(--good); } .c-mid { color: var(--mid); } .c-bad { color: var(--bad); }
.ans-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ans-kbd { text-align: right; font-size: 11px; color: var(--dim); margin-top: 8px; }

/* ---------- révélation ---------- */
.reveal { position: fixed; inset: var(--hud-h) 0 0 auto; width: min(640px, 100%); z-index: 20; overflow-y: auto; background: linear-gradient(180deg, #151718, #0d0f10); border-left: 1px solid var(--line2); box-shadow: -30px 0 80px rgba(0,0,0,.55); animation: slidein .55s var(--ease); scrollbar-width: thin; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.rv { padding: 26px 28px 30px; }
.rv-stamp { display: inline-flex; align-items: center; gap: 8px; font: 800 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 7px 14px; border-radius: 30px; border: 2px solid; animation: stamp .55s var(--ease) both .15s; }
.rv-stamp.t-good { color: var(--good); border-color: var(--good); background: var(--good-bg); }
.rv-stamp.t-mid { color: var(--mid); border-color: var(--mid); background: var(--mid-bg); }
.rv-stamp.t-bad { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
@keyframes stamp { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } 70% { transform: scale(.94); } }
.rv-wow { margin: 18px 0 2px; font: 600 13px var(--mono); letter-spacing: .12em; color: var(--gold); text-transform: uppercase; animation: fadeup .5s both .35s; }
.rv-name { margin: 0; font: 800 clamp(26px, 3.2vw, 36px)/1.1 var(--display); animation: fadeup .5s both .45s; }
.rv-orig { color: var(--dim); font-size: 13px; margin-top: 4px; font-style: italic; animation: fadeup .5s both .5s; }
.rv-fn { margin: 16px 0 0; padding: 16px 18px; border-radius: 14px; background: rgba(214,118,78,.08); border: 1px solid rgba(214,118,78,.3); font-size: 15.5px; line-height: 1.55; animation: fadeup .5s both .6s; }
.rv-fn b { display: block; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.rv-score { display: flex; align-items: center; gap: 18px; margin: 20px 0 6px; animation: fadeup .5s both .7s; }
.rv-pts { font: 800 58px/1 var(--display); color: var(--gold2); font-variant-numeric: tabular-nums; }
.rv-pts small { font: 600 16px var(--mono); color: var(--dim); margin-left: 6px; }
.rv-calc { font: 500 12.5px/1.6 var(--mono); color: var(--muted); }
.rv-sec { margin-top: 20px; animation: fadeup .5s both .8s; }
.rv-sec h4 { margin: 0 0 8px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rv-quote { font: 500 italic 16px/1.5 var(--display); color: #e4dccf; padding-left: 14px; border-left: 3px solid var(--line2); margin: 0 0 10px; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line2); }
.chip.ok { color: var(--good); border-color: rgba(134,193,143,.45); background: var(--good-bg); }
.chip.ko { color: var(--muted); border-style: dashed; }
.chip.warn { color: var(--mid); border-color: rgba(227,187,92,.45); background: var(--mid-bg); }
.rv-reasons { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: #cac1b2; }
.rv-reasons li { padding-left: 18px; position: relative; margin-top: 4px; }
.rv-reasons li::before { content: '→'; position: absolute; left: 0; color: var(--gold); }
.rv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rv-cell { padding: 12px 14px; border-radius: 12px; background: rgba(233,225,214,.03); border: 1px solid var(--line); }
.rv-cell b { display: block; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.rv-cell span { font-size: 14px; }
.rv-cell small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.rv-anec { position: relative; padding: 18px 18px 18px 54px; border-radius: 14px; background: linear-gradient(135deg, rgba(214,118,78,.13), rgba(214,118,78,.03)); border: 1px solid rgba(214,118,78,.3); font-size: 15px; line-height: 1.55; }
.rv-anec::before { content: '!'; position: absolute; left: 16px; top: 16px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #fff7ee; font: 800 16px var(--display); }
.rv-hist { font-size: 14px; color: #cac1b2; }
.rv-ledger { width: 100%; border-collapse: collapse; font: 500 13px var(--mono); }
.rv-ledger td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.rv-ledger td:last-child { text-align: right; }
.rv-ledger .neg { color: var(--bad); } .rv-ledger .tot td { font-weight: 800; color: var(--gold2); border-bottom: 0; padding-top: 8px; }
.rv-credit { font-size: 12px; color: var(--dim); margin-top: 18px; }
.rv-next { position: sticky; bottom: 0; padding: 14px 28px 18px; background: linear-gradient(180deg, transparent, rgba(13,15,16,.98) 35%); display: flex; gap: 10px; justify-content: flex-end; }
.rv-next .btn-primary { min-width: 220px; font-size: 16px; }

/* ---------- fin de partie ---------- */
.end-inner { position: relative; width: min(880px, 100%); margin: 0 auto; padding: 44px 20px 40px; text-align: center; }
.end-kicker { font: 600 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.end-title { font: 800 clamp(30px, 5vw, 48px)/1.1 var(--display); margin: 8px 0 4px; }
.end-total { font: 800 clamp(72px, 14vw, 128px)/1 var(--display); color: var(--gold2); text-shadow: 0 0 60px rgba(214,118,78,.35); font-variant-numeric: tabular-nums; }
.end-total small { font: 600 22px var(--mono); color: var(--dim); }
.end-record { display: inline-block; margin-top: 8px; padding: 6px 14px; border-radius: 30px; background: var(--good-bg); color: var(--good); border: 1px solid rgba(134,193,143,.45); font-weight: 800; font-size: 13px; animation: stamp .6s var(--ease) both .6s; }
.end-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 26px 0 18px; text-align: left; }
.end-tile { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(233,225,214,.03); }
.end-tile b { display: block; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.end-tile span { display: block; font: 700 22px/1.25 var(--display); margin-top: 4px; }
.end-tile small { display: block; color: var(--muted); font-size: 12.5px; }
.end-list { list-style: none; margin: 0; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.end-list li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(233,225,214,.02); }
.end-list li:last-child { border-bottom: 0; }
.end-list .i { font: 700 13px var(--mono); color: var(--dim); }
.end-list .nm { font-weight: 700; }
.end-list .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.badge { font: 700 11px var(--mono); padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.badge.t-good { color: var(--good); background: var(--good-bg); }
.badge.t-mid { color: var(--mid); background: var(--mid-bg); }
.badge.t-bad { color: var(--bad); background: var(--bad-bg); }
.end-list .pt { font: 700 16px var(--mono); min-width: 54px; text-align: right; }
.end-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.share-preview { margin: 18px auto 0; max-width: 420px; text-align: left; white-space: pre-wrap; font: 500 12.5px/1.5 var(--mono); color: var(--muted); padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line2); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 12px; background: #222526; border: 1px solid var(--line2); box-shadow: 0 14px 40px rgba(0,0,0,.5); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 60; max-width: calc(100% - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.t-good { border-color: rgba(134,193,143,.5); } .toast.t-bad { border-color: rgba(226,86,111,.5); }

.float-pts { position: fixed; z-index: 70; font: 800 18px var(--mono); color: var(--bad); pointer-events: none; animation: floatup 1.1s var(--ease) forwards; }
.float-pts.good { color: var(--good); }
@keyframes floatup { to { transform: translateY(-46px); opacity: 0; } }


/* ====================================================================== DUEL */
.btn-duel { background: rgba(214,118,78,.08); border-color: rgba(214,118,78,.55); color: var(--gold2, #d0703f); }
.btn-duel:hover:not(:disabled) { background: rgba(214,118,78,.16); border-color: var(--gold); }
.screen-duel { overflow-y: auto; }
.duel-inner { position: relative; max-width: 620px; margin: 0 auto; padding: 34px 20px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.duel-back { align-self: flex-start; margin-bottom: 18px; }
.duel-title { font: 700 clamp(24px, 3.6vw, 34px)/1.2 var(--display); margin: 0 0 26px; }
.duel-title em { color: var(--gold); font-weight: 500; }
.duel-card { width: 100%; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(233,225,214,.03); backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.duel-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.duel-card input { font: 600 17px var(--font); color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line2, rgba(233,225,214,.14)); border-radius: 12px; padding: 12px 14px; outline: none; }
.duel-card input:focus { border-color: var(--gold); }
.duel-or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12.5px; }
.duel-or::before, .duel-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.duel-joinrow { display: flex; gap: 10px; }
.duel-joinrow input { flex: 1; min-width: 0; font: 700 20px var(--mono); letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.duel-msg { color: var(--muted); font-size: 13.5px; min-height: 1.4em; }
.duel-msg.bad { color: #f2b0bb; }
.duel-code-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.duel-code-box b { font: 800 40px/1.1 var(--mono); letter-spacing: .22em; color: var(--gold); }
.duel-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat { padding: 14px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); text-align: left; display: flex; flex-direction: column; gap: 4px; }
.seat b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.seat.ready { border-color: rgba(134,193,143,.5); background: var(--good-bg); }
.seat.empty { border-style: dashed; color: var(--dim); }
.seat .you { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.odot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.odot.on { background: var(--good); box-shadow: 0 0 8px rgba(134,193,143,.7); }
.odot.off { background: var(--bad); }
.duel-rules { list-style: none; padding: 0; margin: 22px 0 0; text-align: left; color: var(--muted); font-size: 13.5px; display: grid; gap: 7px; }
.duel-rules li { padding-left: 18px; position: relative; }
.duel-rules li::before { content: '⚔'; position: absolute; left: 0; color: var(--gold); font-size: 11px; top: 2px; }
.duel-rules b { color: var(--text); }

.hud-opp { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: rgba(233,225,214,.03); font-size: 13px; max-width: 290px; min-width: 0; }
.hud-opp b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.hud-opp .op-prog { font: 700 12px var(--mono); color: var(--muted); }
.hud-opp .op-done { font: 600 11px var(--mono); color: var(--good); white-space: nowrap; }
.hud-opp .op-vs { font: 600 10px var(--mono); letter-spacing: .12em; color: var(--dim); }
body.duel-on .hud-timer { display: flex; font-size: 17px; padding: 6px 12px; color: var(--text); }
body.duel-on .hud-timer.warn { color: var(--mid); border-color: rgba(227,187,92,.5); }
body.duel-on .hud-timer.crit { color: var(--bad); border-color: rgba(226,86,111,.6); animation: pulse 1s infinite; }
body.duel-on .hud-timer .dot { background: var(--gold); }
body.duel-on #btn-swap, body.duel-on #btn-retry { display: none; }

.duel-veil { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: radial-gradient(circle, rgba(13,15,16,.55), rgba(13,15,16,.88)); backdrop-filter: blur(2px); }
.dv-box { text-align: center; padding: 20px; max-width: 460px; }
.dv-big { font: 800 clamp(64px, 12vw, 120px)/1 var(--display); color: var(--gold); text-shadow: 0 0 40px rgba(214,118,78,.45); }
.dv-big.pop { animation: dvpop .6s var(--ease); }
@keyframes dvpop { from { transform: scale(1.5); opacity: 0; } }
.dv-text { font: 700 20px/1.35 var(--display); margin-top: 10px; }
.dv-sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.duel-wait { width: 100%; text-align: center; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(134,193,143,.4); background: var(--good-bg); font-size: 14px; }
.duel-wait b { display: block; font-size: 15.5px; }
.duel-wait small { color: var(--muted); }

.dl-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 18px 0 4px; }
.dl-side { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(233,225,214,.03); text-align: center; min-width: 0; }
.dl-side.win { border-color: rgba(214,118,78,.6); background: rgba(214,118,78,.08); }
.dl-side .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-side .pts { font: 800 30px/1.15 var(--mono); }
.dl-side small { color: var(--muted); font-size: 12px; display: block; }
.dl-mid { font: 700 13px var(--mono); color: var(--dim); }
.dl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dl-table th, .dl-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.dl-table th:first-child, .dl-table td:first-child { text-align: left; color: var(--muted); font-weight: 600; }
.dl-table thead th { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.dl-table td.best { color: var(--good); font-weight: 700; }
.dl-table tr.tot td { font-weight: 800; color: var(--text); border-bottom: 0; }
.dl-table td small { display: block; color: var(--dim); font-size: 11px; font-weight: 500; }
.dl-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dl-answers .rv-quote { margin: 4px 0 0; }
.dl-answers b { font-size: 12.5px; color: var(--muted); }
.dl-ready { color: var(--muted); font-size: 13px; text-align: center; flex: 1; }
.end-outcome { font: 800 clamp(40px, 7vw, 64px)/1.05 var(--display); margin: 6px 0 4px; }
.end-outcome.win { color: var(--gold); text-shadow: 0 0 40px rgba(214,118,78,.35); }
.end-outcome.loss { color: #c6bdae; }
@media (max-width: 820px) {
  .hud-opp { padding: 4px 8px; gap: 6px; font-size: 12px; max-width: 150px; }
  .hud-opp .op-vs, .hud-opp .op-done { display: none; }
  body.duel-on .hud-round { display: none; }
  body.duel-on .hud-timer { font-size: 15px; padding: 4px 9px; }
  .duel-seats, .dl-answers { grid-template-columns: 1fr; }
  .duel-code-box b { font-size: 32px; }
}


/* ====================================================================== MUSÉE DES MENSONGES */
.mus-players { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mus-players .seat { padding: 10px 12px; }
.mus-players .crown { color: var(--gold); margin-left: 4px; }
.mus-settings { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; text-align: left; }
.mus-settings .grp { display: flex; flex-direction: column; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 8px 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: rgba(214,118,78,.16); color: var(--gold); }
.seg button:disabled { cursor: default; }
.mus-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mus-actions .btn { flex: 1; }
body.museum-on #panel, body.museum-on .hud-capital, body.museum-on .hud-pips, body.museum-on #hud-opp, body.museum-on .specimen-tag .tag-d, body.museum-on #btn-swap { display: none !important; }
body.museum-on .hud-timer { display: flex; font-size: 17px; padding: 6px 12px; color: var(--text); }
body.museum-on .hud-timer.warn { color: var(--mid); border-color: rgba(227,187,92,.5); }
body.museum-on .hud-timer.crit { color: var(--bad); border-color: rgba(226,86,111,.6); animation: pulse 1s infinite; }
body.museum-on .hud-total { margin-left: auto; }
.mpanel { display: flex; flex-direction: column; }
.mp-body { flex: 1; overflow-y: auto; padding: 22px 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.mp-k { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.mp-head h2 { font: 700 23px/1.2 var(--display); margin: 6px 0 4px; }
.mp-head p { color: var(--muted); font-size: 13.5px; margin: 0; }
.mp-body textarea { width: 100%; font: 600 16px/1.4 var(--font); color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; resize: none; outline: none; }
.mp-body textarea:focus { border-color: var(--gold); }
.mp-count { text-align: right; font: 600 11.5px var(--mono); color: var(--dim); margin-top: -8px; }
.mp-count.over { color: var(--bad); }
.mp-msg { font-size: 13.5px; color: #f2b0bb; min-height: 0; }
.mp-msg:empty { display: none; }
.mp-mine { padding: 14px; border-radius: 14px; border: 1px solid rgba(134,193,143,.4); background: var(--good-bg); }
.mp-mine b { display: block; font-size: 12px; color: var(--good); font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.mp-mine q { font: 500 italic 16px/1.4 var(--display); }
.mp-who { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-who span { font-size: 12.5px; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.mp-who span.done { border-color: rgba(134,193,143,.45); color: var(--good); }
.mp-who span.off { opacity: .5; text-decoration: line-through; }
.mp-opts { display: flex; flex-direction: column; gap: 8px; }
.mp-opt { text-align: left; width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(233,225,214,.03); font: 600 15px/1.4 var(--font); color: var(--text); display: flex; gap: 10px; align-items: flex-start; transition: border-color .2s, background .2s; overflow-wrap: anywhere; }
.mp-opt .l { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); border: 1px solid var(--line2); color: var(--muted); margin-top: 1px; }
.mp-opt .t { flex: 1; }
.mp-opt:hover:not(:disabled) { border-color: rgba(214,118,78,.5); }
.mp-opt.sel { border-color: var(--gold); background: rgba(214,118,78,.1); }
.mp-opt.sel .l { background: var(--gold); color: #fff7ee; border-color: var(--gold); }
.mp-opt.own { opacity: .55; }
.mp-opt .tag { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); display: block; margin-top: 4px; }
.mp-opt.truth { border-color: rgba(134,193,143,.7); background: var(--good-bg); }
.mp-opt.truth .l { background: var(--good); color: #062014; border-color: var(--good); }
.mp-opt .by { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mp-opt .by i { font-style: normal; color: var(--gold); }
.mp-opt .vt { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mp-opt .vt span { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: rgba(233,225,214,.07); color: var(--text); }
.mp-rv .mp-opt { opacity: 0; transform: translateY(8px); animation: mpin .45s var(--ease) forwards; }
@keyframes mpin { to { opacity: 1; transform: none; } }
.mp-banner { padding: 14px 16px; border-radius: 14px; font: 700 17px/1.35 var(--display); text-align: center; animation: dvpop .6s var(--ease); }
.mp-banner.good { background: var(--good-bg); border: 1px solid rgba(134,193,143,.5); }
.mp-banner.gold { background: rgba(214,118,78,.12); border: 1px solid rgba(214,118,78,.5); }
.mp-banner.none { background: rgba(233,225,214,.04); border: 1px solid var(--line); font-weight: 600; }
.mp-banner small { display: block; font: 700 14px var(--mono); color: var(--gold); margin-top: 4px; }
.mp-story { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(233,225,214,.03); }
.mp-story h3 { font: 700 19px/1.25 var(--display); margin: 4px 0 2px; }
.mp-story .meta { color: var(--muted); font-size: 12.5px; }
.mp-story .anec { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.mp-story .more { margin-top: 10px; font-size: 13.5px; color: #d3cabb; line-height: 1.5; }
.mp-story .more small { display: block; color: var(--dim); margin-top: 8px; }
.mp-board { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-board td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mp-board td:last-child { text-align: right; font: 700 14px var(--mono); }
.mp-board .gain { color: var(--good); font: 600 12px var(--mono); margin-left: 6px; }
.mp-board tr.me td { color: var(--gold); }
.mp-foot { display: flex; gap: 10px; align-items: center; }
.mp-foot .dl-ready { text-align: left; }
@media (max-width: 820px) {
  .mus-players { grid-template-columns: 1fr 1fr; }
  .mpanel { flex: none; height: 58vh; border-left: 0; border-top: 1px solid var(--line2); border-radius: 18px 18px 0 0; margin-top: -14px; z-index: 3; box-shadow: 0 -18px 40px rgba(0,0,0,.4); }
  .mp-body { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  .mp-head h2 { font-size: 20px; }
  body.museum-on .hud-round { display: block; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .tool span { display: none; }
  .hud-timer { display: none; }
}
@media (max-width: 820px) {
  :root { --hud-h: 56px; }
  body { font-size: 14px; }
  .hud { gap: 12px; padding: 0 12px; }
  .hud-logo { font-size: 17px; }
  .hud-pips i { width: 16px; }
  .hud-total { display: none; }
  .hud-capital-val { font-size: 21px; }
  .home-steps { grid-template-columns: 1fr; }
  .game-layout { display: flex; flex-direction: column; }
  .stage { flex: 1 1 auto; min-height: 38vh; }
  .panel { flex: none; height: 56vh; border-left: 0; border-top: 1px solid var(--line2); border-radius: 18px 18px 0 0; margin-top: -14px; z-index: 3; box-shadow: 0 -18px 40px rgba(0,0,0,.4); transition: height .35s var(--ease); }
  .panel.collapsed { height: 156px; }
  .panel.collapsed .step-body, .panel.collapsed .panel-head { display: none !important; }
  .panel-grip { display: flex; justify-content: center; padding: 8px 0 2px; background: none; border: 0; width: 100%; }
  .panel-grip span { width: 44px; height: 5px; border-radius: 3px; background: rgba(233,225,214,.25); }
  .panel-head { padding: 4px 16px 4px; }
  .panel-head h2 { font-size: 17px; }
  .panel-head p { font-size: 12px; }
  .steps { padding: 6px 12px 0; gap: 5px; }
  .step-tab { padding: 7px 2px; font-size: 11.5px; flex-direction: row; justify-content: center; }
  .step-tab i { width: 19px; height: 19px; font-size: 10.5px; }
  .step-tab .st { top: 1px; right: 3px; font-size: 9px; }
  .steps { gap: 4px; padding: 6px 8px 0; }
  .step-tab { flex-direction: column; gap: 2px; padding: 6px 1px; font-size: 10.5px; }
  .dg-val { font-size: 34px; }
  .dg-wrap { padding: 48px 12px 22px; }
  .dg-ref em { font-size: 8.5px; }
  .final-lock { display: none; }
  .panel.collapsed { height: 176px; }
  .tl-ticks span:nth-child(4) { display: none; }
  .tl-step { min-width: 38px; font-size: 12px; }
  .step-body { padding: 12px 14px; }
  .panel-cta { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); flex-direction: row; }
  .panel-cta .link-btn { flex: none; font-size: 11px; max-width: 90px; line-height: 1.2; }
  .btn-final { padding: 10px 14px; }
  .bf-main { font-size: 18px; } .bf-sub { font-size: 11px; }
  .specimen-tag { left: 12px; top: 12px; padding: 7px 10px 6px; }
  .tag-n { font-size: 17px; }
  .spec-dims { left: 12px; top: 84px; padding: 6px 9px; max-width: 190px; }
  .spec-dims .sd-v { font-size: 12px; }
  .spec-dims .sd-h { display: none; }
  .stage-tools { bottom: 24px; }
  .stage-hint { display: none; }
  .stage-credit { bottom: 18px; font-size: 9.5px; right: 10px; left: auto; display: none; }
  .map-host { height: 230px; }
  .reveal { inset: var(--hud-h) 0 0 0; width: 100%; }
  .rv { padding: 22px 18px 24px; }
  .rv-next { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .rv-next .btn-primary { flex: 1; min-width: 0; }
  .end-tiles { grid-template-columns: repeat(2, 1fr); }
  .end-list li { grid-template-columns: 26px 1fr auto; }
  .end-list .badge { display: none; }
  .modal { align-items: end; padding: 0; }
  .modal-card { border-radius: 20px 20px 0 0; padding: 22px 18px calc(16px + env(safe-area-inset-bottom)); }
  .ans-kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* =====================================================================
   PURPOSE ? — refonte (écrans témoins : accueil et écran de jeu)
   ===================================================================== */
body { font-variant-numeric: tabular-nums; font-feature-settings: 'cv11', 'ss03'; }
a { color: var(--gold); }

/* ---------- boutons : pilules ---------- */
.btn { border-radius: 999px; padding: 11px 22px; font-weight: 600; background: transparent; border-color: var(--line2); }
.btn:hover:not(:disabled) { background: rgba(233,225,214,.06); border-color: rgba(233,225,214,.34); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 22px rgba(189,93,54,.22); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); border-color: transparent; box-shadow: 0 8px 28px rgba(189,93,54,.34); }
.btn-duel { background: transparent; border-color: rgba(214,118,78,.6); color: var(--gold2); }
.btn-duel:hover:not(:disabled) { background: rgba(214,118,78,.1); border-color: var(--gold); }
.btn-xl { border-radius: 999px; padding: 14px 32px; font-size: 17px; }
.btn-sm { padding: 7px 14px; }
.btn-sub { font-weight: 500; opacity: .78; }
.link-btn { color: var(--muted); }
.boot-x { font-weight: 600; }

/* ---------- accueil ---------- */
.home-grid {
  inset: 0; transform: none; animation: none; opacity: .9;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='620' height='620' viewBox='0 0 620 620' fill='none' stroke='%23b79a6b' stroke-width='1'%3E%3Cg opacity='.16'%3E%3Ccircle cx='310' cy='310' r='300'/%3E%3Ccircle cx='310' cy='310' r='236'/%3E%3Ccircle cx='310' cy='310' r='228' stroke-dasharray='3 9'/%3E%3Ccircle cx='310' cy='310' r='150'/%3E%3Ccircle cx='310' cy='310' r='58'/%3E%3Cpath d='M0 310h620M310 0v620M98 98l424 424M522 98L98 522' stroke-dasharray='10 8'/%3E%3Cpath d='M310 74v-22M310 546v22M74 310H52M546 310h22M143 143l-16-16M477 477l16 16M143 477l-16 16M477 143l16-16'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520' fill='none' stroke='%23b79a6b' stroke-width='1'%3E%3Cg opacity='.13'%3E%3Ccircle cx='260' cy='260' r='250'/%3E%3Ccircle cx='260' cy='260' r='190' stroke-dasharray='14 7'/%3E%3Ccircle cx='260' cy='260' r='120'/%3E%3Ccircle cx='260' cy='260' r='28'/%3E%3Cpath d='M260 10v500M10 260h500'/%3E%3Cpath d='M260 140l104 180H156z' stroke-dasharray='4 6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: left -210px top -230px, right -190px bottom -200px;
  background-size: 620px 620px, 520px 520px;
  -webkit-mask-image: none; mask-image: none;
}
.home-glow { top: 22%; width: 1100px; height: 800px; background: radial-gradient(ellipse, rgba(189,93,54,.13), transparent 62%); }
.home-inner { max-width: 1080px; padding: 44px 24px 20px; justify-content: flex-start; }
@media (min-height: 860px) { .home-inner { justify-content: center; } }
.logo { position: relative; font-weight: 600; font-size: clamp(54px, 10.5vw, 118px); line-height: 1; letter-spacing: .005em; gap: .02em; padding-bottom: .2em; font-variation-settings: 'opsz' 144; }
.logo span { background: linear-gradient(180deg, #f3ebdf 10%, #cdbfa9 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo b { color: var(--gold); font-weight: 600; text-shadow: none; animation: none; }
.logo-brush { position: absolute; left: 24%; bottom: 0; width: 50%; height: auto; fill: var(--accent-hi); transform-origin: left center; animation: brush 1.1s var(--ease) .25s both; }
@keyframes brush { from { transform: scaleX(0); opacity: 0; } }
.home-tagline { font: 500 clamp(11.5px, 1.5vw, 15px)/1.6 var(--font); font-style: normal; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); margin: 18px 0 40px; padding-left: .34em; }
.home-kicker { align-self: flex-start; font: 600 11.5px var(--font); letter-spacing: .26em; color: var(--muted); opacity: 1; margin: 0 0 14px 4px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; }
.mode-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 20px 20px; border-radius: 18px; border: 1px solid rgba(214,118,78,.38); background: linear-gradient(180deg, #17191a, #101213); overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 18px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(214,118,78,.25); }
.mc-art { display: block; width: calc(100% + 40px); margin: 0 -20px 4px; background: radial-gradient(ellipse 70% 80% at 50% 45%, rgba(183,154,107,.13), transparent 70%); }
.mc-art svg { display: block; width: 100%; height: auto; max-height: 190px; fill: none; stroke: var(--brass); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mc-art .a-guide { stroke-width: .7; stroke-dasharray: 3 5; opacity: .45; }
.mc-art .a-line { stroke-width: 1; opacity: .7; }
.mc-art .a-main > path, .mc-art .a-main g > path:first-child { fill: #141617; }
.mc-art .a-main circle + circle { fill: none; }
.mc-art .a-thin, .mc-art .a-shine { stroke-width: .8; opacity: .7; fill: none !important; }
.mode-card:hover .mc-art svg { stroke: #d2b583; }
.mc-title { font: 600 25px/1.15 var(--display); color: var(--text); margin-bottom: 8px; }
.mc-text { color: #cfc6b8; font-size: 14px; line-height: 1.45; max-width: 26ch; min-height: 2.9em; }
.mc-meta { margin-top: 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.btn-training { margin-top: 22px; flex-direction: row; gap: 10px; align-items: baseline; }
.home-stats { margin-top: 18px; }
.home-stats b { font-family: var(--font); }
.home-foot { max-width: 900px; margin: 0 auto; line-height: 1.6; }
.home-foot a { color: var(--muted); }

/* ---------- barre du haut ---------- */
.hud { background: rgba(13,15,16,.86); }
.hud-logo { font: 600 21px var(--display); letter-spacing: .01em; color: var(--text); }
.hud-logo b { color: var(--gold); font-weight: 600; margin-left: 1px; }
.hud-label { font-family: var(--font); letter-spacing: .14em; }

/* ---------- scène ---------- */
.stage-bg { background: radial-gradient(ellipse 68% 62% at 50% 46%, #2b2a27 0%, #1a1a19 46%, #0d0f10 100%); }
.stage-bg::after { opacity: 1; background: none; -webkit-mask-image: none; mask-image: none; inset: 22px; --c: rgba(233,225,214,.22);
  background-image: linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-size: 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom; }
.specimen-tag { background: #e9e1d6; color: #2a241b; font-family: var(--font); }
.tag-n { font-weight: 600; }
.tool.on { background: var(--accent); color: var(--accent-ink); }
@media (min-width: 821px) {
  .stage-tools { left: 22px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px; background: rgba(22,24,25,.82); border-color: var(--line2); }
  .tool { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 11px; color: var(--text); }
  .tool span { display: none; }
  .tool svg { width: 20px; height: 20px; stroke-width: 1.6; }
  .specimen-tag { left: 44px; top: 40px; }
  .spec-dims { left: 44px; top: 134px; }
  .stage-hint { bottom: 40px; }
  .stage-credit { right: 40px; bottom: 28px; }
}

/* ---------- carnet d'enquête : liste d'épreuves à cocher ---------- */
.panel { background: linear-gradient(180deg, #151718, #101213); }
.panel-head h2 { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 23px; }
.panel-head h2 svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.panel-head b { color: var(--text); }
.panel-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.step-tab i { font-family: var(--font); }
.step-tab .st.prog::after { color: var(--gold); opacity: 1; }
.step-tab .st.count::after { font-family: var(--font); }
.fam { border-radius: 12px; }
.panel-cta { background: rgba(13,15,16,.7); gap: 6px; }
.btn-final { border-radius: 999px; padding: 13px 20px; color: var(--accent-ink); background: var(--accent); box-shadow: 0 10px 30px rgba(189,93,54,.35); }
.btn-final:hover { background: var(--accent-hi); box-shadow: 0 12px 36px rgba(189,93,54,.45); }
.btn-final::after { background: linear-gradient(90deg, transparent, rgba(255,247,238,.28), transparent); }
.btn-final .bf-main { font-family: var(--font); font-weight: 600; }
.btn-final.locked { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.btn-final.locked:hover { background: transparent; }
.btn-final.locked .bf-main { font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.btn-final.locked .bf-main::before { content: ''; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat; }
/* Épreuves en onglets toujours visibles ; panneau élargi pour que les familles tiennent sans défiler. */
.panel-scroll { overflow: hidden; }
.step-tab { border-radius: 12px; background: #1b1e1f; border-color: transparent; color: #cfc6b8; font-weight: 600; }
.step-tab:hover { background: #222526; border-color: var(--line); }
.step-tab.active { background: #232627; border-color: rgba(214,118,78,.6); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.step-tab.active i { border-color: var(--gold); color: var(--gold); }
.step-tab[data-state="completed"] { border-color: transparent; }
.step-tab.active[data-state="completed"] { border-color: rgba(214,118,78,.6); }
.step-tab[data-state="completed"] i { border-color: var(--gold); color: var(--gold); }
.step-tab .st.done-good::after, .step-tab .st.done-mid::after, .step-tab .st.done-bad::after { content: ''; display: block; width: 13px; height: 9px; background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.5l4.5 4 9.5-8'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.5l4.5 4 9.5-8'/%3E%3C/svg%3E") center/contain no-repeat; }
@media (min-width: 1101px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) clamp(520px, 43vw, 680px); }
}
@media (min-width: 821px) {
  .panel-head { padding: 22px 24px 10px; }
  .steps { padding: 6px 20px 0; gap: 8px; }
  .step-tab { padding: 12px 6px 11px; font-size: 13.5px; gap: 6px; }
  .step-tab i { width: 24px; height: 24px; }
  .step-tab .st { top: 7px; right: 8px; }
  .step-body { padding: 16px 24px 18px; }
  .step-body[data-body="famille"] .step-actions { position: sticky; bottom: -18px; z-index: 2; margin: 0 -24px; padding: 10px 24px 4px; background: #121415; box-shadow: 0 -14px 14px -6px #121415; }
  .panel-cta { padding: 14px 24px 16px; }
}
@media (min-width: 1101px) {
  .fam-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .fam { padding: 5px 9px; gap: 8px; font-size: 12.5px; line-height: 1.2; min-height: 40px; }
  .fam .fi { width: 24px; height: 24px; font-size: 13px; }
}
@media (min-width: 821px) {
  /* Bouton final compact tant qu'il est verrouillé : plus de place pour les épreuves. */
  .final-lock { display: none; }
  .btn-final.locked { padding: 10px 18px; }
  .btn-final.locked .final-dots { display: none; }
  .step-intro p { margin-bottom: 6px; }
  .rule { margin-bottom: 8px; }
  .fam-meta { margin-bottom: 8px; }
}
@media (min-width: 821px) and (max-height: 800px) {
  .panel-head { padding: 14px 24px 4px; }
  .panel-head p { display: none; }
  .steps { gap: 6px; }
  .step-tab { padding: 10px 4px; font-size: 13px; }
  .step-tab i { display: none; }
  .step-tab .st { top: 2px; right: 5px; }
  .step-body { padding-top: 12px; }
  .panel-cta { padding: 10px 24px 10px; }
}
@media (max-width: 820px) {
  .modes { grid-template-columns: 1fr; gap: 12px; }
  .mode-card { display: grid; grid-template-columns: 112px 1fr; align-items: center; justify-items: start; text-align: left; padding: 12px 16px 14px 0; column-gap: 6px; }
  .mc-art { grid-column: 1; grid-row: 1 / span 3; width: 112px; margin: 0; align-self: stretch; display: grid; place-items: center; }
  .mc-art svg { max-height: 96px; }
  .mode-card > :not(.mc-art) { grid-column: 2; max-width: none; min-height: 0; }
  .mc-title { font-size: 21px; margin-bottom: 3px; align-self: end; }
  .mc-text { font-size: 13px; }
  .mc-meta { margin-top: 6px; font-size: 10.5px; }
  .home-inner { padding: 30px 16px 16px; }
  .home-tagline { margin: 12px 0 26px; letter-spacing: .22em; }
  .logo-brush { left: 18%; width: 60%; }
  .hud-label { letter-spacing: .06em; font-size: 9px; white-space: nowrap; }
  .hud-capital-val { white-space: nowrap; }
  .hud-capital-val small { font-size: 10px; }
  .hud-logo { font-size: 17px; }
  .home-stats { gap: 6px 18px; }
}

/* Musée : relecture orthographique avant envoi */
.mp-fix { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(214,118,78,.45); background: rgba(214,118,78,.08); display: flex; flex-direction: column; gap: 8px; }
.mp-fix > b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.mp-fix q { font: 500 16px/1.4 var(--display); quotes: '« ' ' »'; }
.mp-fix mark { background: rgba(214,118,78,.25); color: var(--text); border-radius: 4px; padding: 0 2px; }
.mp-fix-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-fix-actions .btn { flex: 1; }

/* =====================================================================
   PURPOSE ? — composants communs : icônes, pastilles, pilules
   ===================================================================== */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; }
.btn .ic, .btn svg { width: 16px; height: 16px; }
.btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 600 17px/1 var(--display); color: #fff7ee; background: var(--av, #bd5d36); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.av.ghost { background: transparent; box-shadow: none; border: 1.5px dashed var(--line2); color: var(--dim); }
.av.lg { width: 64px; height: 64px; font-size: 28px; }
.av.sm { width: 26px; height: 26px; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line2); white-space: nowrap; }
.pill.on { color: var(--good); border-color: rgba(134,193,143,.45); background: var(--good-bg); }
.pill.off { color: var(--bad); border-color: rgba(226,86,111,.4); background: var(--bad-bg); }

/* =====================================================================
   SALONS (Duel, Musée des mensonges)
   ===================================================================== */
.screen-lobby { overflow-y: auto; }
.lobby { position: relative; max-width: 1120px; margin: 0 auto; padding: 22px 28px 40px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.lobby-back { font-size: 14px; }
.lobby-brand { font: 600 22px var(--display); letter-spacing: .01em; color: var(--text); }
.lobby-brand b { color: var(--gold); font-weight: 600; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); gap: 56px; align-items: start; }
.lobby-intro { padding-top: 8px; }
.lobby-art { width: 220px; margin: -10px 0 6px -24px; }
.lobby-art svg { display: block; width: 100%; height: auto; fill: none; stroke: var(--brass); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lobby-art .a-guide { stroke-width: .7; stroke-dasharray: 3 5; opacity: .45; }
.lobby-art .a-line { stroke-width: 1; opacity: .7; }
.lobby-art .a-main > path, .lobby-art .a-main g > path:first-child { fill: #141617; }
.lobby-art .a-thin, .lobby-art .a-shine { stroke-width: .8; opacity: .7; fill: none !important; }
.lobby-kicker { font: 600 11.5px var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.lobby-title { margin: 10px 0 12px; font: 600 clamp(30px, 3.6vw, 44px)/1.1 var(--display); color: var(--text); }
.lobby-title em { display: block; font-style: italic; font-weight: 400; color: #d6b9a3; }
.lobby-pitch { margin: 0 0 26px; max-width: 46ch; color: #cfc6b8; font-size: 15.5px; line-height: 1.55; }
.lobby-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 52ch; }
.lobby-rules li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.lobby-rules i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 15px var(--display); font-style: normal; color: var(--gold); border: 1px solid rgba(214,118,78,.5); background: rgba(214,118,78,.08); }
.lobby-rules b { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin: 2px 0 2px; }
.lobby-rules span { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

.lobby-card { position: relative; padding: 26px; border-radius: 20px; border: 1px solid rgba(214,118,78,.32); background: linear-gradient(180deg, rgba(27,30,31,.94), rgba(18,20,21,.96)); box-shadow: 0 30px 70px rgba(0,0,0,.45); backdrop-filter: blur(8px); }
.lobby-step { display: flex; flex-direction: column; gap: 16px; }
.lc-head h3 { margin: 6px 0 0; font: 600 25px/1.2 var(--display); }
.lc-k { font: 600 11px var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: #cfc6b8; }
.lobby-card input { width: 100%; font: 500 17px var(--font); color: var(--text); background: #0f1112; border: 1px solid var(--line2); border-radius: 12px; padding: 13px 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.lobby-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,118,78,.18); }
.lobby-card input::placeholder { color: var(--dim); }
.btn-block { width: 100%; }
.lc-or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12.5px; }
.lc-or::before, .lc-or::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; text-align: center; text-transform: uppercase; font: 600 20px var(--font); letter-spacing: .32em; padding-left: calc(15px + .32em); }
.lc-msg { font-size: 13.5px; color: var(--muted); text-align: center; min-height: 1.3em; }
.lc-msg.bad { color: #f2b0bb; }
.code-ticket { position: relative; text-align: center; padding: 18px 16px 16px; border-radius: 16px; border: 1px dashed rgba(214,118,78,.55); background: radial-gradient(ellipse at 50% 0%, rgba(214,118,78,.12), transparent 70%); }
.code-ticket::before, .code-ticket::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #16191a; border: 1px dashed rgba(214,118,78,.55); }
.code-ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.code-ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }
.ct-k { font: 600 11px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.code-ticket b { display: block; margin: 4px 0 12px; font: 600 44px/1.1 var(--display); letter-spacing: .2em; padding-left: .2em; color: var(--gold2); }
.ct-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ct-actions .btn { gap: 7px; }
.lc-sub { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: -6px; }
.lc-count { font-size: 12.5px; color: var(--dim); }
.pl-list { display: flex; flex-direction: column; gap: 8px; }
#mus-players.pl-list { display: grid; grid-template-columns: 1fr 1fr; }
.pl { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(13,15,16,.55); min-width: 0; transition: border-color .25s, background .25s; }
.pl.ready { border-color: rgba(134,193,143,.4); background: rgba(134,193,143,.06); }
.pl.offline { opacity: .6; }
.pl.empty { border-style: dashed; background: transparent; }
.pl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-t b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl.empty .pl-t b { color: var(--dim); font-weight: 500; }
.pl-t small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pl .host { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-weight: 600; }
#mus-players .pl { padding: 9px 10px; gap: 10px; }
#mus-players .av { width: 32px; height: 32px; font-size: 15px; }
#mus-players .pill { padding: 3px 7px; font-size: 11px; }
#mus-players .pill:not(.on):not(.off) { display: none; }
.mus-settings { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-row > span { font-size: 14px; font-weight: 500; color: #cfc6b8; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--line2); background: #0f1112; overflow: visible; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 600 13.5px var(--font); color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:not(.on):not(:disabled):hover { color: var(--text); background: rgba(233,225,214,.06); }
.seg button:disabled { cursor: default; }
.seg button:disabled.on { background: rgba(214,118,78,.35); }
.lc-actions { display: flex; gap: 10px; }
.lc-actions .btn { flex: 1; }
.btn-start:disabled { opacity: .5; }
@media (max-width: 960px) {
  .lobby { padding: 16px 16px 32px; }
  .lobby-top { margin-bottom: 14px; }
  .lobby-grid { grid-template-columns: 1fr; gap: 22px; }
  .lobby-intro { display: grid; grid-template-columns: 96px 1fr; column-gap: 14px; align-items: center; padding: 0; }
  .lobby-art { grid-row: 1 / span 2; width: 104px; margin: 0 0 0 -8px; }
  .lobby-title { margin: 4px 0 0; font-size: 26px; }
  .lobby-title em { font-size: 22px; }
  .lobby-pitch, .lobby-rules { grid-column: 1 / -1; }
  .lobby-pitch { margin: 14px 0 14px; font-size: 14.5px; }
  .lobby-rules { gap: 12px; }
  .lobby-card { padding: 20px 16px; order: -1; }
  .lobby-grid > .lobby-card { order: -1; }
  .code-ticket b { font-size: 36px; }
}
@media (max-width: 420px) {
  #mus-players.pl-list { grid-template-columns: 1fr; }
  .lc-actions { flex-direction: column; }
}
.seat.pl { flex-direction: row; align-items: center; text-align: left; gap: 12px; }
#mus-players .seat.pl { gap: 10px; }
.lobby-card .lc-msg { text-align: center; }
@media (max-width: 960px) { .lobby-intro .lobby-kicker { letter-spacing: .14em; } }
.ct-actions .btn { flex-direction: row; padding: 9px 16px; }
.lc-actions .btn { white-space: nowrap; }

/* =====================================================================
   RÉVÉLATIONS (Enquête, Duel, Musée)
   ===================================================================== */
.av.xs { width: 20px; height: 20px; font-size: 10.5px; box-shadow: none; }
.av.xl { width: 84px; height: 84px; font-size: 38px; }
.rv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-stamp .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.rv-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-time .ic { width: 15px; height: 15px; }
.rv-card { margin-top: 18px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line2); background: rgba(13,15,16,.5); animation: fadeup .5s both .7s; }
.rv-scorecard .rv-pts { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.rv-scorecard .rv-pts small { font: 600 15px var(--font); }
.rv-scorecard .rv-pts em { margin-left: auto; font: 600 13px var(--font); font-style: normal; color: var(--bad); padding: 4px 10px; border-radius: 999px; background: var(--bad-bg); }
.sbars { display: grid; gap: 9px; }
.sbar { display: grid; grid-template-columns: 120px 1fr 96px; align-items: center; gap: 12px; font-size: 13.5px; }
.sb-l { color: #cfc6b8; }
.sb-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-v small { color: var(--dim); font-weight: 500; }
.sb-t { height: 8px; border-radius: 999px; background: rgba(233,225,214,.07); overflow: hidden; }
.sb-t i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold2)); transform-origin: left; animation: barin 1s var(--ease) both 1s; }
.sbar.id .sb-l { color: var(--text); font-weight: 600; }
.sbar.id .sb-t i { background: linear-gradient(90deg, #6f9c77, var(--good)); }
.sbar.na { color: var(--dim); }
.sbar.na .sb-l { color: var(--dim); }
.sbar.na .sb-t { background: repeating-linear-gradient(90deg, rgba(233,225,214,.08) 0 4px, transparent 4px 8px); }
.sbar.na .sb-v { font-weight: 500; font-size: 12px; }
@keyframes barin { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rv-det { margin-top: 14px; }
.rv-det > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gold2); }
.rv-det > summary::-webkit-details-marker { display: none; }
.rv-det > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
.rv-det[open] > summary::before { transform: rotate(45deg); }
.rv-det > summary:hover { color: var(--text); }
.rv-det .rv-ledger { margin-top: 10px; }
details.rv-sec > summary { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
details.rv-sec[open] > summary { margin-bottom: 8px; }
.rv-sec h4 { display: flex; align-items: center; gap: 7px; }
.rv-sec h4 .ic { width: 14px; height: 14px; color: var(--gold); }
.chip .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.rv-anec { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.rv-anec::before { content: none; }
.rv-anec > .ic { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--accent); color: #fff7ee; stroke-width: 1.7; }
.rv-anec b { display: block; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.rv-cell b { display: flex; align-items: center; gap: 6px; }
.rv-cell b .ic { width: 14px; height: 14px; color: var(--gold); }
.rv-credit a { display: inline-flex; align-items: center; gap: 4px; }
.rv-credit .ic { width: 13px; height: 13px; }
.rv-next { align-items: center; }
.rv-next .dl-ready { flex: 1; text-align: left; font-size: 13px; color: var(--muted); }

/* Face-à-face (duel) */
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.vs-side { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 14px; min-width: 0; text-align: center; }
.vs-side.win { background: radial-gradient(ellipse at 50% 30%, rgba(214,118,78,.16), transparent 70%); }
.vs-side .nm { margin-top: 4px; font-weight: 600; font-size: 14.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-side .pts { font: 600 34px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.vs-side.win .pts { color: var(--gold2); }
.vs-side small { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.vs-side small .ic { width: 13px; height: 13px; }
.vs-crown { position: absolute; top: -2px; left: 50%; transform: translate(-50%, -55%); color: var(--gold2); z-index: 1; }
.vs-crown .ic { width: 26px; height: 26px; stroke-width: 1.6; fill: rgba(214,118,78,.25); }
.vs-side.win .av { box-shadow: 0 0 0 3px #16191a, 0 0 0 5px var(--gold), 0 10px 30px rgba(214,118,78,.35); }
.vs-mid { font: italic 500 20px var(--display); color: var(--dim); }
.vs-bars { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.vsb { display: grid; grid-template-columns: 44px 1fr 104px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.vsb .vl { text-align: center; color: #cfc6b8; font-size: 12.5px; }
.vsb .vv { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.vsb .vv:first-child { text-align: right; }
.vsb .vv.best { color: var(--good); }
.vsb .vt { height: 7px; border-radius: 999px; background: rgba(233,225,214,.07); overflow: hidden; display: flex; }
.vsb .vt.l { justify-content: flex-end; }
.vsb .vt i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold2)); animation: barin 1s var(--ease) both 1s; }
.vsb .vt.l i { background: linear-gradient(270deg, var(--accent), var(--gold2)); transform-origin: right; }
.vsb .vt.r i { background: linear-gradient(90deg, #8f8676, #c9bfae); }
.vsb.pen .vv { color: var(--bad); }
.vs-total { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.vs-total span { margin-right: 6px; }
.vs-total b { font: 600 20px var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.vs-total b.best { color: var(--gold2); }
.vs-total i { color: var(--dim); font-style: normal; }
.dl-answers > div { display: flex; gap: 10px; align-items: flex-start; }
.dl-answers .av { margin-top: 4px; }

/* Musée : révélation */
.mp-banner { display: flex; align-items: center; gap: 14px; text-align: left; font-size: 16px; }
.mp-banner .bi { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.mp-banner .bi .ic { width: 20px; height: 20px; stroke-width: 2; }
.mp-banner.good .bi { background: var(--good); color: #0b1f10; }
.mp-banner.gold .bi { background: var(--accent); color: #fff7ee; }
.mp-banner.none .bi { background: rgba(233,225,214,.08); color: var(--muted); }
.mp-banner small { color: var(--gold2); font: 600 13.5px var(--font); }
.mp-rv .mp-opt .l .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.mp-rv .mp-opt:not(.truth) .l { color: var(--bad); border-color: rgba(226,86,111,.4); }
.mp-opt .by { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-opt .by .nv { margin-left: auto; font-size: 12px; color: var(--dim); }
.mp-opt .vt span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 2px; border-radius: 999px; }
.mp-story .mp-k { display: inline-flex; align-items: center; gap: 6px; }
.mp-story .mp-k .ic { width: 14px; height: 14px; }
.mp-rank { display: flex; flex-direction: column; gap: 8px; }
ol.mp-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ol.mp-board li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(233,225,214,.03); border: 1px solid var(--line); font-size: 14px; }
ol.mp-board li.me { border-color: rgba(214,118,78,.45); background: rgba(214,118,78,.07); }
ol.mp-board .rk { width: 16px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
ol.mp-board li:first-child .rk { color: var(--gold2); }
ol.mp-board .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.mp-board .nm small { color: var(--muted); font-weight: 500; }
ol.mp-board .gain { color: var(--good); font: 600 12.5px var(--font); }
ol.mp-board b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.mp-foot { position: sticky; bottom: -28px; margin: 0 -22px; padding: 14px 22px 22px; background: linear-gradient(180deg, transparent, rgba(13,15,16,.97) 30%); z-index: 2; }
.mp-foot .btn-primary { margin-left: auto; }

/* =====================================================================
   FINS DE PARTIE
   ===================================================================== */
.end-inner { width: min(900px, 100%); padding-top: 52px; }
.end-hero { display: flex; align-items: center; justify-content: center; gap: 36px; text-align: left; margin-bottom: 8px; }
.end-ring { --p: 0; flex: none; width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(233,225,214,.07) 0); position: relative; box-shadow: 0 0 80px rgba(214,118,78,.18); }
.end-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #1f2223, #121415); }
.end-ring > .end-total { position: relative; text-align: center; font: 600 58px/1 var(--display); text-shadow: none; }
.end-ring > .end-total small { display: block; margin-top: 6px; font: 500 14px var(--font); color: var(--muted); }
.end-hero-t .end-title { margin: 8px 0 12px; }
.end-dots { display: flex; gap: 6px; }
.end-dots span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.end-dots .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.end-dots .t-good { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 1px rgba(134,193,143,.45); }
.end-dots .t-mid { background: var(--mid-bg); color: var(--mid); box-shadow: inset 0 0 0 1px rgba(227,187,92,.4); }
.end-dots .t-bad { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(226,86,111,.4); }
.end-record { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; }
.end-best { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.end-best b { color: var(--text); }
.end-tile b { display: flex; align-items: center; gap: 6px; }
.end-tile b .ic { width: 14px; height: 14px; color: var(--gold); }
.end-list .mini { display: block; margin-top: 7px; height: 4px; border-radius: 999px; background: rgba(233,225,214,.06); overflow: hidden; max-width: 260px; }
.end-list .mini i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--accent), var(--gold2)); border-radius: inherit; animation: barin 1s var(--ease) both .8s; }
.end-list .pt { font: 600 16px var(--font); font-variant-numeric: tabular-nums; }
.end-list .pt i { color: var(--dim); font-style: normal; margin: 0 5px; }
.end-list .pt b { font-weight: 600; color: var(--muted); }
.end-list .pt b.best { color: var(--good); }
.end-list li.me { background: rgba(214,118,78,.07); }
.end-list .badge .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.end-rank .nm { display: flex; align-items: center; gap: 10px; }
.end-rank .nm small { display: inline; }
.end-share-box { margin: 18px auto 0; max-width: 420px; text-align: left; }
.end-share-box > summary { cursor: pointer; list-style: none; text-align: center; font-size: 13px; font-weight: 600; color: var(--gold2); }
.end-share-box > summary::-webkit-details-marker { display: none; }
.end-share-box .share-preview { margin-top: 10px; }
.end-why { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.end-outcome-sm { font-size: clamp(30px, 5vw, 46px); }
.end-vs { max-width: 560px; margin: 30px auto 26px; }
.end-vs .vs-side { padding: 22px 8px 16px; }
.end-vs .vs-side .pts { font-size: 44px; }
.end-vs .vs-crown .ic { width: 34px; height: 34px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 44px auto 26px; max-width: 560px; }
.pod { position: relative; flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pod .nm { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .nm small { color: var(--muted); font-weight: 500; }
.pod .pts { font: 600 22px var(--display); color: var(--gold2); font-variant-numeric: tabular-nums; }
.pod .step { width: 100%; margin-top: 6px; border-radius: 14px 14px 4px 4px; border: 1px solid rgba(214,118,78,.35); border-bottom: 0; background: linear-gradient(180deg, rgba(214,118,78,.16), rgba(214,118,78,.02)); display: grid; place-items: start center; padding-top: 12px; }
.pod .step span { font: 600 28px var(--display); color: var(--gold); }
.pod.r1 .step { height: 120px; border-color: rgba(214,118,78,.6); background: linear-gradient(180deg, rgba(214,118,78,.28), rgba(214,118,78,.03)); }
.pod.r2 .step { height: 84px; }
.pod.r3 .step { height: 60px; }
.pod.r1 .av { box-shadow: 0 0 0 3px #121415, 0 0 0 5px var(--gold), 0 10px 30px rgba(214,118,78,.4); }
.pod .vs-crown { top: 0; }
.pod.me .nm { color: var(--gold2); }
.end-objs { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.end-objs > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.end-objs > div span { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2); color: #cfc6b8; }
@media (max-width: 700px) {
  .end-inner { padding-top: 30px; }
  .end-hero { flex-direction: column; gap: 18px; text-align: center; }
  .end-dots { justify-content: center; }
  .end-ring { width: 170px; height: 170px; }
  .end-ring > .end-total { font-size: 46px; }
  .sbar { grid-template-columns: 92px 1fr 78px; gap: 8px; font-size: 12.5px; }
  .vsb { grid-template-columns: 36px 1fr 84px 1fr 36px; gap: 6px; font-size: 12px; }
  .vsb .vl { font-size: 11.5px; }
  .vs-side .pts { font-size: 28px; }
  .av.xl { width: 64px; height: 64px; font-size: 28px; }
  .podium { gap: 8px; }
  .pod.r1 .step { height: 96px; } .pod.r2 .step { height: 66px; } .pod.r3 .step { height: 46px; }
  .mp-foot { bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 0 -16px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .sb-t i, .vsb .vt i, .end-list .mini i { animation: none; } }
.mp-opt .vt span.av { padding: 0; border-radius: 50%; background: var(--av); color: #fff7ee; }
.mp-opt .by .av { margin-left: 2px; }
.vs-side.win { background: radial-gradient(closest-side, rgba(214,118,78,.16), transparent); }
.vs-crown { transform: translate(-50%, -88%); }
.pod .vs-crown { top: 2px; transform: translate(-50%, -100%); }
.pod.r1 { padding-top: 10px; }
.rv-top + .rv-name { margin-top: 16px; }
@media (max-width: 700px) { .rv-next .dl-ready { font-size: 12px; } }
/* Duel : la fonction de l'objet, principale source de points, mise en avant */
.vsb.id { padding: 8px 0 10px; margin-bottom: 2px; border-bottom: 1px dashed var(--line2); }
.vsb.id .vl { color: var(--text); font-weight: 600; }
.vsb.id .vv { font-size: 15px; }
.vsb.id .vt { height: 10px; }
.vsb.id .vt.l i { background: linear-gradient(270deg, #6f9c77, var(--good)); }
.vsb.id .vt.r i { background: linear-gradient(90deg, #6f9c77, var(--good)); opacity: .7; }
.end-break { max-width: 640px; margin: 0 auto 18px; text-align: left; }
.end-break h4 { margin: 0; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.end-break .vs-bars { margin-top: 10px; padding-top: 4px; border-top: 0; }
.end-duel small br + * { display: inline; }

/* Grand chrono (Musée : écriture et vote ; Duel : 30 dernières secondes) */
.bigclock { padding: 12px 22px 12px; border-bottom: 1px solid var(--line); background: rgba(13,15,16,.6); }
.bc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bc-k { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bc-v { font: 600 38px/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; transition: color .3s; }
.bc-bar { margin-top: 9px; height: 6px; border-radius: 999px; background: rgba(233,225,214,.08); overflow: hidden; }
.bc-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold2)); transition: width .25s linear, background .3s; }
.bigclock.warn .bc-v { color: var(--mid); }
.bigclock.warn .bc-bar i { background: var(--mid); }
.bigclock.crit .bc-v { color: var(--bad); animation: bcpulse 1s infinite; }
.bigclock.crit .bc-bar i { background: var(--bad); }
.bigclock.crit { background: rgba(226,86,111,.08); }
@keyframes bcpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.bigclock.crit .bc-v { display: inline-block; transform-origin: right center; }
.stage-clock { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 6; min-width: 230px; border: 1px solid var(--line2); border-radius: 16px; background: rgba(13,15,16,.82); backdrop-filter: blur(8px); box-shadow: 0 16px 40px rgba(0,0,0,.4); padding: 10px 16px 11px; }
.stage-clock .bc-v { font-size: 32px; }
.stage-clock.crit { border-color: rgba(226,86,111,.6); background: rgba(40,16,21,.88); }
@media (max-width: 900px) {
  .bigclock { padding: 10px 16px; }
  .bc-v { font-size: 30px; }
  .stage-clock { top: 10px; min-width: 190px; padding: 8px 12px; }
  .stage-clock .bc-v { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .bigclock.crit .bc-v { animation: none; } }

/* =====================================================================
   PAGES LÉGALES ET CRÉDITS
   ===================================================================== */
body.legal-page { overflow: auto; height: auto; min-height: 100%; }
.legal { max-width: 780px; margin: 0 auto; padding: 28px 24px 80px; line-height: 1.65; color: #d9d1c4; }
.legal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.legal-top a { color: var(--gold2); text-decoration: none; font-weight: 600; font-size: 14px; }
.legal-brand { font: 600 22px var(--display); color: var(--text); }
.legal-brand b { color: var(--gold); }
.legal h1 { font: 600 clamp(30px, 4vw, 42px)/1.15 var(--display); color: var(--text); margin: 0 0 8px; }
.legal .upd { color: var(--muted); font-size: 13.5px; margin: 0 0 30px; }
.legal h2 { font: 600 22px/1.3 var(--display); color: var(--text); margin: 38px 0 10px; }
.legal h3 { font: 600 16px var(--font); color: var(--text); margin: 22px 0 6px; }
.legal a { color: var(--gold2); }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.legal th, .legal td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.legal .todo { background: rgba(227,187,92,.16); color: #f0d28c; padding: 0 5px; border-radius: 4px; font-weight: 600; }
.legal .draft { border: 1px dashed rgba(227,187,92,.6); background: rgba(227,187,92,.08); color: #f0d28c; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 26px; }
.legal details { border: 1px solid var(--line2); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.legal summary { cursor: pointer; font-weight: 600; color: var(--gold2); }
.legal-foot { margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.home-legal { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.home-legal a { color: var(--muted); font-size: 12.5px; }

/* Visite guidée : voile sombre et projecteur sur l'élément expliqué */
.coach { position: fixed; inset: 0; z-index: 80; }
.coach-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(6,7,8,.78); outline: 2px solid var(--gold); outline-offset: 0; transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease); pointer-events: none; }
.coach-hole::after { content: ''; position: absolute; inset: -6px; border-radius: 18px; border: 1px solid rgba(214,118,78,.35); animation: coachpulse 1.8s infinite; }
@keyframes coachpulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04); } }
.coach-card { position: fixed; padding: 18px 18px 14px; border-radius: 16px; background: linear-gradient(180deg, #1f2223, #171a1b); border: 1px solid rgba(214,118,78,.45); box-shadow: 0 24px 60px rgba(0,0,0,.6); transition: left .35s var(--ease), top .35s var(--ease); animation: rise .3s var(--ease); }
.coach-k { font: 600 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.coach-card h3 { margin: 6px 0 6px; font: 600 21px/1.2 var(--display); color: var(--text); }
.coach-card p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: #d5ccbf; }
.coach-card p b { color: var(--text); }
.coach-nav { display: flex; align-items: center; gap: 8px; }
.coach-nav .link-btn { font-size: 13px; color: var(--muted); }
.coach-dots { flex: 1; display: flex; gap: 5px; justify-content: center; }
.coach-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(233,225,214,.2); }
.coach-dots i.on { width: 16px; border-radius: 999px; background: var(--gold); }
@media (prefers-reduced-motion: reduce) { .coach-hole, .coach-card { transition: none; } .coach-hole::after { animation: none; } }
.lobby-tuto { margin-top: 18px; font-size: 14px; }
@media (max-width: 960px) { .lobby-tuto { grid-column: 1 / -1; justify-self: start; } }
/* Accessibilité : focus visible sur les champs dont le contour est retiré */
.mp-body textarea:focus-visible, .duel-card input:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,118,78,.18); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
  .hud { gap: 8px; padding: 0 10px; }
  .hud-logo { font-size: 15px; }
  .hud-round { margin-left: 0; min-width: 0; }
  .hud-pips { gap: 4px; }
  .hud-pips i { width: 12px; }
  .hud .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
  .hud .icon-btn svg { width: 18px; height: 18px; }
  .hud-capital .hud-label { font-size: 9px; letter-spacing: .08em; }
  .hud-capital-val { font-size: 18px; }
  .hud-capital-val small { display: none; }
  body:not(.duel-on):not(.museum-on) .hud-timer { display: none; }
}
@media (max-width: 400px) { body.duel-on #btn-help, body.museum-on #btn-help { display: none; } }
.coach-nav .btn { white-space: nowrap; }

/* =====================================================================
   MOBILE — refonte ergonomique (novembre 2026)
   Objectif : plus de place pour les épreuves, cibles tactiles ≥ 44 px,
   carnet en tiroir à trois positions, clavier virtuel pris en compte.
   ===================================================================== */
button, a, [role="tab"], .fam, .tl-track, .dg-track { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.screen { height: 100%; height: 100dvh; }
.panel-scroll, .step-body, .mp-body, .reveal, .screen-lobby, .modal-card { overscroll-behavior: contain; }

@media (max-width: 820px) {
  /* ---------- barre du haut ---------- */
  .hud { padding-top: env(safe-area-inset-top); height: calc(var(--hud-h) + env(safe-area-inset-top)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .hud-logo { min-height: 44px; padding: 0 4px; margin-left: -4px; }
  .hud .icon-btn { width: 40px; height: 40px; border-radius: 11px; }
  .hud-label { font-size: 10px; }

  /* ---------- scène 3D ---------- */
  .specimen-tag { left: 10px; top: 10px; padding: 5px 9px 4px; transform: rotate(-1.5deg); }
  .specimen-tag .tag-k { display: none; }
  .tag-n { font-size: 15px; }
  .tag-d { font-size: 11px; }
  .stage-tools { bottom: 22px; gap: 2px; padding: 4px; border-radius: 16px; }
  .tool { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 12px; color: var(--text); }
  .tool svg { width: 21px; height: 21px; }
  .stage-bg::after { inset: 12px; }
  /* Duel : le chrono passe en haut à droite, l'étiquette s'efface pour ne pas être recouverte */
  .stage-clock { left: auto; right: 10px; transform: none; min-width: 0; top: 10px; padding: 7px 12px 8px; }
  .stage-clock .bc-k { font-size: 9.5px; letter-spacing: .1em; }
  .stage-clock .bc-v { font-size: 24px; }
  .stage:has(#duel-clock:not([hidden])) .specimen-tag { display: none; }

  /* ---------- carnet d'enquête : tiroir ---------- */
  .panel { height: 57%; height: 57dvh; }
  .panel.collapsed { height: 150px; }
  .panel.expanded { height: calc(100% - 96px); }
  .panel-head { display: none; }
  .panel-grip { padding: 0; height: 26px; align-items: center; cursor: grab; flex: none; }
  .panel-grip span { width: 48px; height: 5px; }
  .stage { min-height: 0; }
  .game-layout:has(.panel.expanded) .stage-tools,
  .game-layout:has(.panel.expanded) .specimen-tag, .game-layout:has(.panel.expanded) .spec-dims { display: none; }
  .steps { padding: 0 10px; gap: 5px; }
  .step-tab { min-height: 48px; padding: 6px 1px 5px; font-size: 11.5px; gap: 3px; }
  .step-tab i { width: 20px; height: 20px; font-size: 11px; }
  .step-body { padding: 12px 16px 16px; }
  .step-intro p { font-size: 14.5px; line-height: 1.45; margin-bottom: 6px; }
  /* Légende des couleurs : visible sur les familles elles-mêmes après vérification */
  .rule { display: none; }
  .step-max { font-size: 12.5px; }
  .fam-meta { font-size: 13px; }
  .fam { min-height: 48px; font-size: 13.5px; }
  .step-actions { gap: 8px; }
  .step-actions .btn { min-height: 46px; }
  .step-body[data-body="famille"] .step-actions { flex-wrap: wrap; }
  .step-body[data-body="famille"] .step-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 10px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .step-body[data-body="famille"] .step-actions .risk { flex-basis: 100%; font-size: 12.5px; }
  .step-body[data-body="famille"] .step-actions .risk:empty { display: none; }
  /* Le bouton « Vérifier » des catégories reste accessible sans défiler */
  .step-body[data-body="famille"] .step-actions { position: sticky; bottom: -16px; z-index: 2; margin: 10px -16px 0; padding: 10px 16px 6px; background: #111314; box-shadow: 0 -14px 14px -6px #111314; }
  .tl-step { min-width: 44px; height: 42px; font-size: 13px; }
  .map-host { height: 46vh; max-height: 320px; min-height: 220px; }

  /* Pied du carnet : identification finale compacte sur une ligne */
  .panel-cta { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 10px; align-items: center; }
  .btn-final { flex: 1; min-width: 0; min-height: 50px; padding: 6px 14px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 8px; row-gap: 0; }
  .btn-final .bf-main, .btn-final.locked .bf-main { font-size: 16px; }
  .btn-final .bf-sub { font-size: 12px; }
  .btn-final .final-dots { display: none; }
  .panel-cta .link-btn { min-height: 44px; max-width: 96px; font-size: 12px; }

  /* ---------- modales : feuille du bas qui suit le clavier ---------- */
  .modal { top: var(--vvt, 0); bottom: auto; height: var(--vvh, 100%); }
  .modal-card { max-height: 100%; overflow-y: auto; }
  .modal-card h3 { font-size: 22px; }
  .modal .ans-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: #16191a; padding: 10px 0 2px; margin-top: 10px; }
  .modal .ans-actions .btn { flex: 1; min-height: 48px; }
  .modal-x { width: 44px; height: 44px; }
  body.kb .ans-scale, body.kb .ans-help, body.kb .ans-kicker { display: none; }
  body.kb #ans-input { min-height: 84px; }

  /* Clavier ouvert dans le Musée (écriture du mensonge) : l'objet se réduit à un bandeau */
  body.kb .screen-game { top: var(--vvt, 0); bottom: auto; height: var(--vvh, 100%); }
  body.kb.museum-on .stage { flex: 0 0 72px; min-height: 0; }
  body.kb.museum-on .stage > :not(.viewer-host):not(.stage-bg) { display: none; }
  body.kb.museum-on .mpanel { flex: 1; height: auto; margin-top: 0; }
  body.kb.museum-on .mpanel .mp-head p { display: none; }
  body.kb .hud { display: none; }

  /* ---------- Musée des mensonges ---------- */
  .mpanel { height: 58%; height: 58dvh; }
  .mp-opt { min-height: 52px; font-size: 15px; }
  .mp-opt .l { width: 26px; height: 26px; }

  /* ---------- toasts : en haut, jamais sur les boutons ---------- */
  .toast { top: calc(var(--hud-h) + 10px + env(safe-area-inset-top)); bottom: auto; transform: translate(-50%, -14px); font-size: 14px; }
  .toast.show { transform: translate(-50%, 0); }

  /* ---------- révélation et fin ---------- */
  .rv-next { gap: 10px; padding-top: 22px; background: linear-gradient(180deg, transparent, #0f1112 22px); }
  .rv-next .dl-ready { flex: 0 1 34%; font-size: 12px; line-height: 1.3; text-align: left; }
  .rv-next .btn { min-height: 50px; }
  .lobby-card input { font-size: 17px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .seg button { min-height: 38px; padding: 6px 14px; }
}

@media (max-width: 400px) {
  .hud { gap: 6px; }
  body:not(.museum-on) .hud-round .hud-label { display: none; }
  .step-body[data-body="famille"] .step-actions .btn { font-size: 13px; padding: 10px 8px; }
  .hud .icon-btn { width: 38px; height: 38px; }
  .step-tab { font-size: 10.5px; }
  .step-tab i { display: none; }
  .step-tab { min-height: 42px; }
  .tl-step { min-width: 40px; }
}

/* ---------- téléphone à l'horizontale : objet à gauche, carnet à droite ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --hud-h: 46px; }
  .hud { gap: 10px; }
  .hud-label { font-size: 9.5px; }
  .game-layout { display: grid !important; grid-template-columns: minmax(0, 1fr) min(400px, 48vw); flex-direction: row; }
  .stage { min-height: 0; }
  .panel, .panel.collapsed, .panel.expanded, .mpanel { height: auto !important; margin-top: 0; border-radius: 0; border-top: 0; border-left: 1px solid var(--line2); box-shadow: none; }
  .panel.collapsed .step-body { display: block !important; }
  .panel-grip, .panel-head { display: none !important; }
  .steps { padding: 6px 10px 0; }
  .step-tab { min-height: 40px; flex-direction: row; gap: 4px; font-size: 11px; }
  .step-tab i { display: none; }
  .stage-tools { left: 10px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; }
  .stage-tools .tool { width: 40px; height: 40px; }
  .specimen-tag { left: 62px; }
  .map-host { height: 200px; }
  .modal { align-items: center; padding: 8px; }
  .modal-card { border-radius: 18px; max-height: 100%; }
  .reveal { inset: var(--hud-h) 0 0 auto; width: min(560px, 70vw); }
  .stage-hint, .stage-credit { display: none; }
  .panel-cta { flex-direction: row; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 10px; }
  .btn-final { flex: 1; min-width: 0; padding: 6px 12px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 8px; }
  .btn-final .bf-main, .btn-final.locked .bf-main { font-size: 15px; }
  .btn-final .final-dots, .final-lock { display: none; }
  .panel-cta .link-btn { max-width: 96px; font-size: 12px; line-height: 1.2; }
  .step-body { padding: 10px 14px 14px; }
  .step-body:not([data-body="famille"]) .rule { display: none; }
  .step-body[data-body="famille"] .step-actions { position: static; margin: 10px 0 0; padding: 0; box-shadow: none; background: none; }
  .tl-step { height: 40px; }
}
