:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --panel: rgba(14, 15, 20, .84);
  --panel2: rgba(22, 23, 30, .94);
  --line: rgba(255, 255, 255, .09);
  --ink: #ece6da;
  --dim: #9b968b;
  --yellow: #f2c230;
  --red: #c2161e;
  --blood: #7d0c10;
  --cyan: #86f4ff;
  --ok: #86d38f;
  --bad: #ff6b6b;
  --f-title: 'Oswald', Impact, 'Arial Narrow', sans-serif;
  --f-type: 'Special Elite', 'Courier New', monospace;
  --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f-ui);
  overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
#app { position: fixed; inset: 0; }
@supports (height: 100dvh) { html, body { height: 100dvh; } }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#uvOverlay {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(ellipse at center, rgba(110, 50, 255, 0) 35%, rgba(50, 10, 120, .6) 100%);
}
#uvOverlay.on { opacity: 1; }
#senseFx {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s;
  background: radial-gradient(ellipse at center, rgba(60, 200, 255, 0) 45%, rgba(10, 70, 110, .42) 100%);
}
#senseFx.on { opacity: 1; transition: opacity .25s; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .55) 100%); }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .9s; z-index: 30; }
#fade.on { opacity: 1; transition: none; }

/* ---------------- HUD ---------------- */
#hud { position: absolute; inset: 0; pointer-events: none; font-size: 14px; z-index: 5; }
#topLeft { position: absolute; left: max(16px, env(safe-area-inset-left)); top: 12px; text-shadow: 0 1px 3px #000; }
#clock { font-family: var(--f-title); font-size: 26px; letter-spacing: .06em; line-height: 1; }
#place { font-size: 12px; color: var(--dim); margin-top: 3px; }
#bodies {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 4px 10px 4px 7px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 13px; text-shadow: none;
}
#bodies svg { width: 20px; height: 20px; color: #c9c2b5; }
#bodies.done { border-color: rgba(134, 211, 143, .55); color: var(--ok); }
#bodies.done svg { color: var(--ok); }
#objective {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100vw - 660px)); min-width: 220px;
  text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px;
}
#roomInfo {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: max-content; max-width: min(820px, calc(100vw - 440px));
  text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px;
  font-size: 12.5px; color: #cfc9bd; pointer-events: none;
}
#roomInfo .rn { font-family: var(--f-title); text-transform: uppercase; letter-spacing: .05em; color: var(--yellow); margin-right: 8px; }
#roomInfo b { color: #fff; }
#roomInfo i { color: var(--ok); font-style: normal; }
#hud.sensing #roomInfo { visibility: hidden; }
body.touch #roomInfo { top: 56px; font-size: 11.5px; max-width: calc(100vw - 540px); }
#objTitle { font-family: var(--f-title); font-size: 16px; letter-spacing: .03em; text-transform: uppercase; color: var(--yellow); }
#objHint { font-size: 12.5px; color: #cfc9bd; margin-top: 2px; }
#tasks {
  position: absolute; right: max(14px, env(safe-area-inset-right)); top: 10px; width: 300px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; pointer-events: auto; overflow: hidden;
}
#tasksHead {
  all: unset; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 12px;
  font-family: var(--f-title); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; box-sizing: border-box; font-size: 14px;
}
#tasksHead .chev { font-style: normal; display: inline-block; transition: transform .2s; color: var(--dim); }
#tasks.collapsed .chev { transform: rotate(-90deg); }
#cleanPct { color: var(--yellow); font-weight: 600; }
#taskList { list-style: none; margin: 0; padding: 0 12px 10px; font-size: 12.5px; }
#taskList li { display: flex; gap: 8px; padding: 3px 0; color: #d8d2c6; line-height: 1.35; }
#taskList li.done { color: #7d786e; text-decoration: line-through; }
#taskList li.opt { color: #e7c35a; }
#taskList li.opt.done { color: #7d786e; }
#taskList .ck { width: 13px; height: 13px; border: 1.5px solid #8a857a; border-radius: 3px; flex: none; margin-top: 2px; }
#taskList li.done .ck { background: var(--ok); border-color: var(--ok); }
#tasks.collapsed #taskList { display: none; }
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 3px #000; opacity: .85;
}
#crosshair.active { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: transparent; border: 2px solid var(--yellow); }
#holdRing { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; transform: rotate(-90deg); opacity: 0; }
#holdRing circle { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; }
#prompt {
  position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); text-align: center; white-space: nowrap;
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, .7); font-weight: 600; font-size: 15px; opacity: 0; transition: opacity .12s;
}
#prompt.show { opacity: 1; }
#prompt .key {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 8px; border: 1.5px solid var(--yellow);
  border-radius: 5px; color: var(--yellow); font-size: 12.5px; background: rgba(0, 0, 0, .35);
}
#prompt.no .key { display: none; }
#prompt.no #promptText { color: #c9c2b5; font-weight: 500; }
#promptSub { font-size: 12px; font-weight: 400; color: #c9c2b5; margin-top: 3px; }
#warn {
  position: absolute; left: 50%; top: calc(50% - 70px); transform: translateX(-50%); color: var(--bad); font-weight: 700;
  text-shadow: 0 1px 3px #000; opacity: 0; transition: opacity .2s; white-space: nowrap; font-size: 15px;
}
#warn.show { opacity: 1; }
/* pendant le flair, la légende prend la place de l'objectif */
#senseBar {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 13px;
  width: max-content; max-width: min(560px, calc(100vw - 660px)); min-width: 220px; padding: 7px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid rgba(127, 230, 255, .35); font-size: 13px; animation: senseIn .35s ease-out;
}
#hud.sensing #objective { visibility: hidden; }
#senseBar b { flex-basis: 100%; text-align: center; font-family: var(--f-title); text-transform: uppercase; letter-spacing: .05em; color: #7fe6ff; font-weight: 600; font-size: 15px; }
#senseBar span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#senseBar i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
@keyframes senseIn { from { opacity: 0; transform: translate(-50%, -6px); } }
#lockHint {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
}
#bottom { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#toolBtn {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 30px;
  background: var(--panel); border: 1.5px solid var(--line); cursor: pointer; text-align: left;
}
#toolIcon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(242, 194, 48, .14); color: var(--yellow); }
#toolIcon svg { width: 24px; height: 24px; }
#toolBtn .tb { display: flex; flex-direction: column; line-height: 1.15; }
#toolBtn b { font-family: var(--f-title); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; font-weight: 600; }
#toolBtn small { font-size: 11px; color: var(--dim); }
#toolBtn.disabled { opacity: .45; }
#dirtBox { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; color: #d6d0c4; }
#dirtBox .bar { width: 96px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; display: block; }
#dirtBar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d6b36a, #a3261c); }
#toolBtn.full { border-color: rgba(255, 107, 107, .75); }
#toolBtn.full #dirtLabel { color: var(--bad); font-weight: 700; }
#toolBtn:has(#dirtBox:not([hidden])) #toolHint { display: none; }
#toolBtn.bump #toolIcon { animation: bump .3s ease-out; }
@keyframes bump { 40% { transform: scale(1.25); } }
#wheel { position: absolute; left: 50%; top: 50%; width: 340px; height: 340px; margin: -170px 0 0 -170px; pointer-events: auto; animation: wheelIn .14s ease-out; }
@keyframes wheelIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
#wheelSvg { width: 100%; height: 100%; overflow: visible; }
#wheelSvg .sec path { fill: rgba(16, 17, 22, .84); stroke: rgba(255, 255, 255, .14); stroke-width: 1.5; transition: fill .1s; }
#wheelSvg .sec.cur path { stroke: rgba(242, 194, 48, .6); }
#wheelSvg .sec.sel path { fill: rgba(242, 194, 48, .9); stroke: #f2c230; }
#wheelSvg .sec .ic { color: #e9e3d6; }
#wheelSvg .sec.sel .ic { color: #1a1406; }
#wheelSvg .sec text { fill: #cfc8ba; font: 600 12px var(--f-ui); text-anchor: middle; }
#wheelSvg .sec.sel text { fill: #1a1406; }
#wheelSvg .sec .key { fill: #8f897d; font-size: 10px; }
#wheelCenter { position: absolute; left: 50%; top: 50%; width: 120px; margin-left: -60px; transform: translateY(-50%); text-align: center; pointer-events: none; }
#wheelCenter b { display: block; font-family: var(--f-title); text-transform: uppercase; letter-spacing: .05em; color: var(--yellow); font-size: 16px; }
#wheelCenter small { display: block; font-size: 11.5px; color: #d6d0c4; margin-top: 3px; line-height: 1.3; }
#toolbar.disabled #carryInfo { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; font-size: 13px; }
#toasts { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: 96px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 40vw; }
.toast {
  background: var(--panel2); border-left: 3px solid var(--yellow); padding: 6px 10px; border-radius: 6px; font-size: 13px;
  animation: toastIn .25s ease-out; transition: opacity .4s, transform .4s;
}
.toast.out { opacity: 0; transform: translateX(-12px); }
.toast.good { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.money { border-left-color: #e7c35a; color: #f3dc8f; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
#tip {
  position: absolute; left: max(16px, env(safe-area-inset-left)); top: 74px; width: min(330px, 36vw); background: var(--panel2);
  border: 1px solid var(--line); border-top: 3px solid var(--yellow); border-radius: 10px; padding: 10px 14px;
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s;
}
#tip.show { opacity: 1; transform: none; }
#tip b { font-family: var(--f-title); text-transform: uppercase; letter-spacing: .05em; color: var(--yellow); font-size: 14px; }
#tip p { margin: 4px 0 0; font-size: 13px; line-height: 1.42; color: #dcd6ca; }
#noteCard { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); }
#noteCard .paper {
  width: min(420px, 86vw); background: #efe8d6; color: #2a2620; padding: 22px 24px 16px; border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); transform: rotate(-1.2deg); font-family: var(--f-type);
}
#noteCard h3 { margin: 0 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: .05em; color: #7d0c10; }
#noteCard p { margin: 0 0 14px; font-size: 16px; line-height: 1.5; white-space: pre-line; }
#noteCard small { color: #7a7364; font-family: var(--f-ui); font-size: 11px; }

/* ---------------- tactile ---------------- */
#touch { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.tbtn {
  pointer-events: auto; position: absolute; border: 1.5px solid rgba(255, 255, 255, .28); background: rgba(16, 16, 22, .5);
  color: var(--ink); border-radius: 50%; font: 600 13px var(--f-ui); display: grid; place-items: center; line-height: 1.1;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); touch-action: none; padding: 0;
}
.tbtn.down { background: rgba(242, 194, 48, .35); border-color: var(--yellow); }
#tAction { right: calc(22px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 92px; height: 92px; font-size: 14px; border-color: rgba(242, 194, 48, .7); }
#tInteract { right: calc(128px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); width: 66px; height: 66px; font-size: 22px; color: var(--yellow); border-color: var(--yellow); }
#tCrouch { right: calc(36px + env(safe-area-inset-right)); bottom: calc(130px + env(safe-area-inset-bottom)); width: 52px; height: 52px; font-size: 20px; }
#tJump { right: calc(36px + env(safe-area-inset-right)); bottom: calc(192px + env(safe-area-inset-bottom)); width: 52px; height: 52px; font-size: 20px; }
#tSense { right: calc(36px + env(safe-area-inset-right)); bottom: calc(254px + env(safe-area-inset-bottom)); width: 52px; height: 52px; font-size: 22px; color: #7fe6ff; border-color: rgba(127, 230, 255, .55); }
#tDrop { right: calc(104px + env(safe-area-inset-right)); bottom: calc(112px + env(safe-area-inset-bottom)); width: 60px; height: 60px; font-size: 12px; }
#tStow { right: calc(176px + env(safe-area-inset-right)); bottom: calc(112px + env(safe-area-inset-bottom)); width: 60px; height: 60px; font-size: 10.5px; }
#tBag { right: calc(104px + env(safe-area-inset-right)); bottom: calc(112px + env(safe-area-inset-bottom)); width: 60px; height: 60px; font-size: 10.5px; }
#tPause { left: calc(12px + env(safe-area-inset-left)); top: 12px; width: 42px; height: 42px; font-size: 12px; border-radius: 10px; }
body.touch #topLeft { left: calc(64px + env(safe-area-inset-left)); }
#joyBase {
  position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .05); left: calc(36px + env(safe-area-inset-left)); bottom: calc(36px + env(safe-area-inset-bottom)); opacity: .45;
}
#joyBase.on { opacity: .9; }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(255, 255, 255, .32); }
body.touch #toasts { bottom: auto; top: 110px; max-width: 34vw; }
body.touch #tip { top: 108px; }
body.touch #toolHint { display: none; }
body.touch #lockHint { display: none !important; }

/* ---------------- écrans ---------------- */
.screen { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; touch-action: pan-y; }
.btn {
  display: block; width: 100%; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  font-family: var(--f-title); text-transform: uppercase; letter-spacing: .08em; font-size: 15px; cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--yellow); color: #1a1406; border-color: var(--yellow); }
.btn.primary:hover { background: #ffd447; }
.btn.ghost { background: transparent; }
.btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

#menu { background: linear-gradient(90deg, rgba(8, 9, 12, .92) 0%, rgba(8, 9, 12, .72) 45%, rgba(8, 9, 12, .15) 100%); justify-content: flex-start; padding-left: max(5vw, env(safe-area-inset-left)); }
.menuInner { max-width: 640px; width: 100%; }
.logo { position: relative; margin-bottom: 26px; }
.logo h1 { position: relative; margin: 0; font-family: var(--f-title); font-weight: 700; font-size: clamp(46px, 9vw, 96px); line-height: .9; text-transform: uppercase; letter-spacing: .02em; }
.logo h1 em { font-style: normal; color: var(--red); text-shadow: 0 0 24px rgba(194, 22, 30, .35); }
.logo .tag { position: relative; margin: 10px 0 0; font-family: var(--f-type); font-size: 17px; color: #cbbfa8; }
.splat {
  position: absolute; left: -30px; top: -26px; width: 260px; height: 190px; opacity: .55; pointer-events: none;
  background:
    radial-gradient(circle at 40% 50%, var(--blood) 0 34%, transparent 35%),
    radial-gradient(circle at 70% 38%, var(--blood) 0 12%, transparent 13%),
    radial-gradient(circle at 18% 70%, var(--blood) 0 8%, transparent 9%),
    radial-gradient(circle at 82% 72%, var(--blood) 0 5%, transparent 6%),
    radial-gradient(circle at 60% 85%, var(--blood) 0 4%, transparent 5%);
  filter: blur(.5px);
}
.menuCols { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 22px; align-items: start; }
.menuBtns { display: flex; flex-direction: column; gap: 8px; }
.ledger { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ledger .debt { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.ledger .debt span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ledger .debt b { font-family: var(--f-title); font-size: 30px; color: var(--yellow); }
.contracts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.contracts li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); }
.contracts .num { font-family: var(--f-title); font-size: 20px; color: var(--dim); text-align: center; }
.contracts .t { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.contracts .meta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.contracts .meta i { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #d9d2c5; }
.contracts small { font-weight: 400; color: var(--dim); font-size: 11.5px; }
.contracts .st { text-align: right; font-size: 13px; color: var(--ok); display: flex; flex-direction: column; }
.contracts li.done .st { color: var(--yellow); letter-spacing: .1em; }
.contracts li.locked { opacity: .5; }
.contracts li.locked .st { color: var(--dim); }
.soundHint { position: absolute; right: max(5vw, env(safe-area-inset-right)); bottom: 12px; margin: 0; font-size: 12px; color: #cbbfa8; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.disclaimer { position: absolute; left: max(5vw, env(safe-area-inset-left)); bottom: 12px; margin: 0; font-size: 11.5px; color: #8a857a; max-width: 90vw; }

/* ---------- appel téléphonique ---------- */
#call { background: radial-gradient(ellipse at 30% 40%, rgba(40, 18, 18, .96), rgba(4, 4, 6, .98) 70%); }
.callBox { width: min(860px, 100%); display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: center; }
.callArt { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.phoneStage { position: relative; width: 220px; height: 190px; }
.phoneSvg { width: 100%; height: 100%; overflow: visible; }
.phoneSvg .handset { transform-origin: 110px 60px; transition: transform .45s cubic-bezier(.2, .8, .3, 1.2); }
.phoneStage.ringing .phoneSvg { animation: phoneShake .9s infinite; }
.phoneStage.ringing .handset { animation: handsetJump .18s infinite alternate; }
.phoneStage.offhook .handset { transform: translate(-6px, -58px) rotate(-16deg); }
@keyframes phoneShake { 0%, 60%, 100% { transform: rotate(0); } 8%, 24%, 40% { transform: rotate(-4deg); } 16%, 32%, 48% { transform: rotate(4deg); } }
@keyframes handsetJump { from { transform: translateY(0); } to { transform: translateY(-5px); } }
.waves { position: absolute; left: 4px; top: -36px; width: 80px; height: 80px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.phoneStage.offhook .waves, .phoneStage.ringing .waves { opacity: 1; }
.waves i { position: absolute; inset: 0; border: 3px solid rgba(242, 194, 48, .8); border-radius: 50%; clip-path: polygon(0 0, 55% 0, 55% 55%, 0 55%); animation: wave 1.6s ease-out infinite; }
.waves i:nth-child(2) { animation-delay: .5s; } .waves i:nth-child(3) { animation-delay: 1s; }
@keyframes wave { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
.callerTag { text-align: center; }
.callerTag small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.callerTag b { font-family: var(--f-title); font-size: 22px; letter-spacing: .05em; color: var(--red); font-weight: 600; }
.polaroid { margin: 0; background: #f4f1e8; padding: 8px 8px 6px; width: 200px; transform: rotate(-4deg); box-shadow: 0 10px 24px rgba(0, 0, 0, .6); visibility: hidden; opacity: 0; }
.polaroid.show { visibility: visible; opacity: 1; animation: polaIn .6s cubic-bezier(.2, .8, .3, 1.1); }
.polaroid .pimg { aspect-ratio: 4 / 3; }
.polaroid .pimg svg { display: block; width: 100%; height: auto; }
.polaroid figcaption { font-family: var(--f-type); font-size: 12px; color: #2a2620; text-align: center; margin-top: 4px; }
@keyframes polaIn { from { opacity: 0; transform: translateY(30px) rotate(8deg); } }
#callScroll {
  height: min(46vh, 340px); overflow-y: auto; scroll-behavior: smooth; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 100%);
}
#callScroll::-webkit-scrollbar { display: none; }
#callText { font-family: var(--f-type); font-size: clamp(15px, 2.1vw, 19px); line-height: 1.55; color: #e3dccd; padding-top: 30vh; padding-bottom: 6px; }
#callText p { margin: 0 0 14px; }
#callText p.narr { color: #a9a294; font-style: italic; }
#callText b { display: block; font-family: var(--f-title); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--red); font-size: 13px; }
.callBtns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.callBtns .btn { width: auto; text-align: center; }
.ledger ul.menuList { max-height: min(32vh, 250px); overflow-y: auto; scrollbar-width: thin; }
.dossierLine { margin: 8px 0 0; font-size: 13px; color: var(--dim); }
.dossierLine b { color: #ff7ac8; }
ul.clues { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
ul.clues li { border-radius: 10px; padding: 9px 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
ul.clues li.got { background: #f1ead8; color: #2a2620; border-color: #d8ccaa; }
ul.clues li b { display: block; font-family: var(--f-title); letter-spacing: .04em; text-transform: uppercase; font-size: 13px; color: #a3171c; font-weight: 600; }
ul.clues li.miss b { color: var(--dim); }
ul.clues li small { display: block; font-size: 11.5px; opacity: .75; margin-bottom: 4px; }
ul.clues li p { margin: 0; font-family: var(--f-type); font-size: 13px; line-height: 1.45; }
#callChoices { display: grid; gap: 8px; margin-top: 14px; }
#callChoices .btn { text-align: left; display: flex; flex-direction: column; gap: 2px; }
#callChoices .btn small { font-family: var(--f-ui); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: inherit; opacity: .8; }
/* ---------- fin du jeu ---------- */
#ending { background: radial-gradient(ellipse at 50% 30%, rgba(40, 30, 18, .95), rgba(4, 4, 6, .99) 70%); }
.endBox { width: min(720px, 100%); display: flex; flex-direction: column; gap: 12px; }
.endBox h2 { font-family: var(--f-title); font-size: clamp(28px, 5vw, 44px); margin: 0; color: var(--yellow); letter-spacing: .03em; }
#endText p { font-family: var(--f-type); font-size: clamp(15px, 2vw, 18px); line-height: 1.6; color: #e3dccd; margin: 0 0 12px; opacity: 0; transform: translateY(8px); animation: endLine .9s ease-out forwards; }
@keyframes endLine { to { opacity: 1; transform: none; } }
#endStats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
#endStats div { background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
#endStats span { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
#endStats b { font-family: var(--f-title); font-size: 20px; font-weight: 600; }
.endThanks { color: var(--dim); font-size: 13px; margin: 4px 0 0; }
.endBox .row .btn { width: auto; }
@media (max-width: 760px), (max-height: 480px) {
  .callBox { grid-template-columns: 150px 1fr; gap: 14px; }
  .phoneStage { width: 140px; height: 121px; }
  .polaroid { width: 130px; padding: 5px 5px 4px; }
  .callerTag b { font-size: 16px; }
  #callScroll { height: min(52vh, 260px); }
  #callText { font-size: 14px; }
}
@media (max-width: 520px) { .callBox { grid-template-columns: 1fr; } .callArt { flex-direction: row; } .polaroid { display: none; } }

#brief { background: rgba(5, 6, 9, .8); }
.brief h2 { font-size: 30px; }
.briefGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.briefGrid div { background: rgba(255, 255, 255, .045); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.briefGrid span { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.briefGrid b { font-size: 15px; font-weight: 600; }
.briefGrid .big b { font-family: var(--f-title); font-size: 24px; color: var(--yellow); font-weight: 600; }
.briefGrid .big small { font-family: var(--f-ui); font-size: 12px; color: #d6d0c4; font-weight: 400; display: block; }
#pause, #summary { background: rgba(5, 6, 9, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(360px, 100%); display: flex; flex-direction: column; gap: 8px; }
.card h2 { margin: 0 0 8px; font-family: var(--f-title); text-transform: uppercase; letter-spacing: .06em; font-size: 28px; }
.card.wide { width: min(760px, 100%); }
.eyebrow { margin: 0; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
#sumGrade { display: flex; align-items: center; gap: 14px; font-size: 34px; }
#sumGrade .stars { color: var(--yellow); letter-spacing: .1em; font-size: 28px; }
.quote { margin: 0 0 6px; font-family: var(--f-type); color: #d9cfb8; font-size: 16px; }
.sumCols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rows { display: flex; flex-direction: column; gap: 4px; background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 12px 14px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.rows span { color: #c8c1b3; }
.rows .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 17px; }
.rows .total b { color: var(--yellow); font-family: var(--f-title); font-size: 22px; }
.rows .debt b { color: var(--bad); }
.next { margin: 6px 0 4px; color: var(--dim); font-size: 13px; }
.row { display: flex; gap: 10px; }
.row .btn { text-align: center; }

/* souvenirs : panneau en bas, sans voile, pour garder l'étagère à l'écran */
#hubPanel.peek { background: none; place-items: end center; pointer-events: none; }
#hubPanel.peek > * { pointer-events: auto; max-height: 38vh; overflow-y: auto; }
#hubPanel { position: absolute; inset: 0; z-index: 24; display: grid; place-items: center; background: rgba(0, 0, 0, .55); padding: 16px; overflow-y: auto; }
.hubCard { width: min(820px, 100%); }
.hubMoney { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--dim); }
.hubMoney b { color: var(--yellow); font-family: var(--f-title); font-size: 20px; margin-left: 6px; }
.hubMoney b.bad { color: var(--bad); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; text-align: center; }
.btn:disabled { opacity: .45; cursor: default; }
.row.wrap { flex-wrap: wrap; }
.hubList li { grid-template-columns: 30px 1fr auto; }
.contracts .stars { color: var(--yellow); }
.shopGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.shopItem { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); }
.shopItem.own { border-color: rgba(134, 211, 143, .35); }
.shopItem .kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.shopItem b { font-size: 15px; }
.shopItem p { margin: 0; flex: 1; font-size: 13px; line-height: 1.4; color: #cfc8ba; }
.souvenirs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.souvenirs li { padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .05); display: flex; flex-direction: column; }
.souvenirs small { color: var(--dim); }
.ledger .inprogress { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(242, 194, 48, .1); font-size: 13px; color: #e9dfc4; }
.ledger .money { display: flex; gap: 22px; flex-wrap: wrap; }
.ledger .wallet { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.ledger .wallet span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ledger .wallet b { font-family: var(--f-title); font-size: 30px; color: var(--ok); }
.rows .wallet b { color: var(--ok); }
body.hub #tasks, body.hub #bodies, body.hub #toolBtn, body.hub #clock { display: none !important; }
#panel { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 16px; overflow-y: auto; }
.panelCard { width: min(720px, 100%); position: relative; max-height: calc(100vh - 32px); overflow-y: auto; touch-action: pan-y; }
.panelCard h3 { font-family: var(--f-title); text-transform: uppercase; letter-spacing: .06em; font-size: 15px; color: var(--yellow); margin: 6px 0 8px; }
.panelCard p { line-height: 1.5; font-size: 14px; color: #d6d0c4; margin: 0 0 10px; }
.panelCard .dim { color: var(--dim); font-size: 12px; }
.close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.ctrlCols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.keys dt { font-weight: 600; color: var(--ink); white-space: nowrap; }
.keys dd { margin: 0; color: #c8c1b3; }
.toolsHelp { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: #c8c1b3; }
.opt { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; font-size: 14px; }
.opt span { display: flex; justify-content: space-between; }
.opt b { color: var(--yellow); }
.opt input[type=range] { width: 100%; accent-color: var(--yellow); }
.opt select { background: #1c1d24; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; }
.opt.check { flex-direction: row; align-items: center; gap: 10px; }
.opt.check input { width: 18px; height: 18px; accent-color: var(--yellow); }

#loading { background: var(--bg); }
.loader { text-align: center; width: min(320px, 80vw); }
.loader h1 { font-family: var(--f-title); text-transform: uppercase; font-size: 42px; margin: 0 0 18px; }
.loader h1 em { font-style: normal; color: var(--red); }
.loader .bar { height: 4px; background: rgba(255, 255, 255, .1); border-radius: 2px; overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 0; background: var(--yellow); transition: width .3s; }
.loader p { color: var(--dim); font-size: 13px; }

#rotate { display: none; position: absolute; inset: 0; z-index: 40; background: #0b0c10; align-items: center; justify-content: center; text-align: center; font-size: 46px; color: var(--yellow); }
#rotate p { font-size: 16px; color: var(--ink); font-family: var(--f-ui); }
@media (orientation: portrait) and (pointer: coarse) { body.playing #rotate { display: flex; } }

/* ---------------- petits écrans ---------------- */
@media (max-width: 1150px) {
  #tasks { width: 240px; }
  #objective { max-width: calc(100vw - 540px); }
}
@media (max-width: 760px), (max-height: 480px) {
  #objective { max-width: calc(100vw - 500px); padding: 5px 10px; }
  #objTitle { font-size: 13px; }
  #objHint { font-size: 11px; }
  #tasks { width: 230px; }
  #taskList { font-size: 11.5px; }
  #clock { font-size: 20px; }
  #toolIcon { width: 32px; height: 32px; }
  #wheel { transform: scale(.82); }
  #tip { width: min(280px, 34vw); padding: 8px 11px; }
  #tip p { font-size: 12px; }
  .toast { font-size: 12px; }
  #prompt { font-size: 13.5px; }
  #senseBar { font-size: 11.5px; padding: 5px 10px; gap: 2px 9px; max-width: calc(100vw - 500px); min-width: 200px; }
  #senseBar b { font-size: 13px; }
  .menuCols { grid-template-columns: 1fr; }
  .sumCols, .ctrlCols { grid-template-columns: 1fr; }
  .briefGrid { grid-template-columns: 1fr 1fr; }
  .brief h2 { font-size: 22px; }
  #menu { padding-top: 24px; align-items: stretch; flex-direction: column; justify-content: flex-start; }
  .menuInner { max-width: 520px; }
  .logo { margin-bottom: 14px; }
  .disclaimer { position: static; margin-top: 14px; }
  .soundHint { position: static; margin-top: 8px; }
}
@media (max-height: 480px) {
  #menu { padding: 14px max(18px, env(safe-area-inset-left)); flex-direction: column; align-items: stretch; justify-content: center; }
  #menu .menuInner {
    display: grid; grid-template-columns: minmax(230px, 1fr) minmax(270px, 1.1fr); grid-template-rows: auto 1fr;
    column-gap: 22px; row-gap: 10px; align-items: start; max-width: 860px; margin: 0 auto;
  }
  #menu .logo { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  #menu .logo h1 { font-size: 44px; }
  #menu .logo .tag { font-size: 14px; margin-top: 6px; }
  .splat { width: 180px; height: 130px; }
  .menuCols { display: contents; }
  .menuBtns { grid-column: 1; grid-row: 2; gap: 6px; }
  .ledger { grid-column: 2; grid-row: 1 / span 2; padding: 12px 14px; }
  .ledger .debt b { font-size: 26px; }
  .disclaimer { position: static; margin: 10px auto 0; text-align: center; font-size: 10.5px; }
  .btn { padding: 9px 14px; font-size: 13.5px; }
  body.touch #bottom { left: calc(50% - 40px); }
  .card { padding: 16px; }
}

/* gros plan sur un objet ramassé */
#inspectCard { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 7vh; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
#inspectCard::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 46% 52% at 50% 46%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .72) 100%); }
#inspectCard.show { opacity: 1; }
#inspectCard .inspectBox { position: relative; transform: translateY(12px); transition: transform .3s ease; }
#inspectCard.show .inspectBox { transform: none; }
#hud.inspecting > :not(#inspectCard) { opacity: 0; transition: opacity .2s; }
.inspectBox { max-width: 560px; text-align: center; color: #f4f1e8; text-shadow: 0 2px 10px rgba(0, 0, 0, .9); }
.inspectCat { display: inline-flex; align-items: center; gap: 10px; font: 600 11px var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: #e8574a; }
.inspectCat::before, .inspectCat::after { content: ''; width: 34px; height: 1px; background: currentColor; opacity: .7; }
.inspectCat.gold { color: #e8c35a; }
#inspectName { font-family: var(--f-title); font-size: clamp(22px, 4.2vw, 34px); letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 4px; }
#inspectDesc { margin: 0 auto; max-width: 440px; font: italic 15px/1.45 Georgia, serif; color: #e6e0d2; }
#inspectHint { margin-top: 12px; font: 12px var(--f-ui); color: #c9c3b4; }
#inspectHint b { display: inline-block; min-width: 18px; padding: 1px 6px; margin: 0 2px; border: 1px solid rgba(244, 241, 232, .45); border-radius: 4px; font-weight: 600; color: #f4f1e8; }
#inspectHint .inspectClose { pointer-events: auto; margin-right: 10px; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--yellow, #f2c230); color: #1a1406; font: 700 14px var(--f-ui); text-transform: uppercase; letter-spacing: .06em; }

/* catalogue : niveaux */
.shopItem .pips { display: flex; gap: 4px; margin: 2px 0 6px; }
.shopItem .pips i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.shopItem .pips i.on { background: var(--yellow); }
.shopItem p.now { color: var(--ink); }
.shopItem p.next { color: var(--yellow); font-size: .92em; margin-top: 2px; }
/* options : sauvegarde */
.saveBox { display: flex; flex-direction: column; gap: 8px; }
.saveBox textarea { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, .06); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 12px/1.3 monospace; resize: vertical; }
