* { box-sizing: border-box; }
:root {
  --bg: #1b1812; --panel: #e7dcc0; --ink: #272019;
  --muted: #6d6458; --green: #364d3d; --line: rgba(39,32,25,.42); --shadow: rgba(0,0,0,.24);
  --stage-w: min(100vw, calc(100dvh * 4 / 5));
}
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { font-family: Georgia,"Times New Roman",serif; color: var(--ink); }
button, select { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.game-root { position: relative; width: 100%; height: 100dvh; overflow: hidden; }

/* ── OPENING BRIEFING (full-screen cinematic) ── */
.briefing {
  position: fixed; inset: 0; z-index: 40; display: none; overflow: hidden;
  background: #0e0d0a;
}
.briefing[aria-hidden="false"] { display: block; animation: briefingFade .6s ease; }
@keyframes briefingFade { from { opacity: 0; } to { opacity: 1; } }

/* While first-screen art is still decoding, keep the scene image hidden so the
   browser never shows a half-painted top-down image. It fades in once ready. */
/* While first-screen art is still decoding, keep the scene image fully hidden
   (opacity 0, no transition) so the browser never shows a half-painted
   top-down image. When loading ends, it fades in cleanly from 0 to 1. */
.briefing-bg { opacity: 0; transition: opacity .45s ease; }
.briefing:not(.briefing-loading) .briefing-bg { opacity: 1; }
.briefing.briefing-loading .briefing-bg { opacity: 0; transition: none; }
.briefing.briefing-loading::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 50% 42%, #1a1813 0%, #0e0d0a 70%);
  animation: briefingLoadPulse 1.2s ease-in-out infinite;
}
@keyframes briefingLoadPulse { 0%,100% { opacity: .85; } 50% { opacity: 1; } }

.briefing-bg-blur { display: none; }
.briefing-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center top;
  animation: briefingZoom 14s ease-out forwards;
}

@media (max-width: 620px) and (orientation: portrait) {
  .briefing-bg { object-fit: cover; object-position: center center; }
}
@keyframes briefingZoom { from { transform: scale(1.0); } to { transform: scale(1.04); } }

.briefing-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,13,10,.55) 0%, rgba(14,13,10,.1) 30%, rgba(14,13,10,.55) 62%, rgba(14,13,10,.96) 100%),
    radial-gradient(circle at 50% 36%, rgba(0,0,0,0) 40%, rgba(0,0,0,.5) 100%);
}

.briefing-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px clamp(18px, 6vw, 48px) clamp(20px, 5vh, 40px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: #ece0c4; max-height: 88dvh; overflow-y: auto; scrollbar-width: none;
}
.briefing-content::-webkit-scrollbar { display: none; }

/* staged reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: translateY(0); }

.briefing-kicker { margin: 0 0 8px; font-size: 11px; letter-spacing: .36em; color: #c2b385; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.briefing-title { margin: 0 0 16px; font-size: clamp(28px, 7vw, 44px); letter-spacing: .03em; text-shadow: 0 3px 14px rgba(0,0,0,.8); }
.briefing-victim { margin: 0 0 8px; font-size: clamp(15px, 4vw, 19px); line-height: 1.55; max-width: 30rem; text-shadow: 0 2px 10px rgba(0,0,0,.85); }
.briefing-victim strong { color: #f6e9cb; }
.briefing-sub { margin: 0 0 18px; font-size: clamp(12px, 3.4vw, 14px); color: #c4b893; font-style: italic; text-shadow: 0 2px 8px rgba(0,0,0,.8); }

.briefing-cast-wrap { width: min(420px, 92vw); margin-bottom: 18px; }
.briefing-cast-label { margin: 0 0 8px; font-size: 10px; letter-spacing: .24em; color: #9d9377; }
.briefing-cast {
  list-style: none; margin: 0; padding: 12px 14px; text-align: left;
  background: rgba(20,18,13,.55); backdrop-filter: blur(3px);
  border: 1px solid rgba(231,220,192,.2);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
}
.briefing-cast li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.briefing-cast .bc-name { color: #ece0c4; font-weight: 700; }
.briefing-cast .bc-meta { color: #9d9377; text-align: right; }

.briefing-actions { width: min(420px, 92vw); }
.briefing-start {
  width: 100%; min-height: 44px; padding: 10px; font-weight: 900; letter-spacing: .04em;
  border: 1px solid rgba(25,20,16,.6);
  background: linear-gradient(180deg,#c8b888,#a8965f); color: #211c12;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
.briefing-start:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.briefing-skip {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border: 1px solid rgba(231,220,192,.3); background: rgba(20,18,13,.5); color: #c8b888;
}
.briefing-skip:hover { background: rgba(231,220,192,.12); }

@media (max-width: 480px) {
  .briefing-cast { grid-template-columns: 1fr; }
}

/* ── SCENE ── */
.scene-frame {
  position: absolute; left: 50%; top: 46%; z-index: 1;
  width: var(--stage-w);
  height: min(100dvh, calc(100vw * 5 / 4));
  transform: translate(-50%,-50%); overflow: hidden; background: var(--bg);
}
.room-backplate { display: none; }
.room-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; display: block; filter: saturate(.95) contrast(.98); }
.scene-frame .room-art, .scene-frame .hotspot-layer { transition: opacity .24s ease; }
.scene-frame.room-fading .room-art, .scene-frame.room-fading .hotspot-layer { opacity: 0; }

/* ── HOTSPOTS ── */
.hotspot-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
/* ── CHARACTER STANDEES in room ── */
/* Stand low on the rug to the left and right of the central furniture, above the dialogue. */
.standee-layer { position: absolute; left: 0; right: 0; top: 42%; bottom: 9%; z-index: 6; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 1%; pointer-events: none; }
.standee-layer[hidden] { display: none !important; }
.standee { --hit-l: 0%; --hit-t: 0%; --hit-w: 100%; --hit-h: 100%; pointer-events: none; position: relative; height: 100%; width: auto; cursor: pointer; transition: transform 0.16s ease, filter 0.16s ease; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); border: none; background: none; padding: 0; }
.standee img { display: block; height: 100%; width: auto; object-fit: contain; object-position: bottom; pointer-events: none; }
.standee-hit { position: absolute; left: var(--hit-l); top: var(--hit-t); width: var(--hit-w); height: var(--hit-h); pointer-events: auto; cursor: pointer; }
.standee:has(.standee-hit:hover) { transform: scale(1.06) translateY(-3px); filter: drop-shadow(0 10px 16px rgba(0,0,0,.75)) brightness(1.08); z-index: 7; }
.standee:has(.standee-hit:active) { transform: scale(0.98); }
.standee-hit::after { content: 'Question →'; position: absolute; left: 50%; top: -4px; transform: translate(-50%,-100%); background: rgba(20,16,12,.9); color: #f2e4c0; font-size: 10px; letter-spacing: .06em; padding: 2px 7px; white-space: nowrap; opacity: 0; transition: opacity .16s; pointer-events: none; }
.standee-hit:hover::after { opacity: 1; }
.mobile-standee-layer { display: none; }
.hotspot {
  position: absolute; width: 18px; height: 18px; transform: translate(-50%,-50%);
  border: 2px solid rgba(255,244,214,.96); border-radius: 50%;
  background: rgba(54,77,61,.72); padding: 0;
  box-shadow: 0 0 0 2px rgba(20,16,12,.42), 0 0 14px rgba(255,238,190,.42);
  cursor: pointer; z-index: 9; pointer-events: auto;
}
.hotspot::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #f7e7be; }
.hotspot span {
  position: absolute; left: 50%; top: -1.7rem; transform: translateX(-50%);
  padding: .18rem .42rem; background: rgba(18,15,12,.82); color: #f3e5c7;
  font-size: 11px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.hotspot.live { background: rgba(92,121,73,.82); }
.hotspot:hover span, .hotspot:focus-visible span { opacity: 1; }

/* ── HUD ── */
.hud {
  position: absolute; left: 50%; top: 0; z-index: 10;
  width: var(--stage-w); transform: translateX(-50%);
  display: grid; grid-template-columns: 36px 1fr 36px auto 36px;
  align-items: start; gap: 6px; padding: 8px 9px 0;
  color: #f2e2bf; pointer-events: none;
}
.hud > * { pointer-events: none; }
.hud button { pointer-events: auto; }
.hud .mini-map { pointer-events: none; }
.hud .mini-map .mm-room { pointer-events: auto; }
.round-btn {
  width: 36px; height: 36px; font-size: 22px; font-weight: 700;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 3px 3px 0 var(--shadow); color: var(--ink);
}
.signal { min-width: 0; padding-top: 0; }
.signal b { display: none; }
.signal #roomName[hidden] { display: none; }
.mini-map { margin-top: 0; width: min(116px, 33vw); padding: 0; background: none; border: none; border-radius: 0; backdrop-filter: none; pointer-events: none; box-shadow: none; }
.mini-map svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 5px rgba(0,0,0,.55)); }
.mini-map.hidden { display: none; }
.mm-shell { fill: rgba(20,18,13,.35); stroke: #d8c8a0; stroke-width: 2.4; }
.mm-corridor { fill: rgba(231,220,192,.06); stroke: rgba(216,200,160,.45); stroke-width: 1; }
.mm-corridor-label { fill: rgba(216,200,160,.5); font-size: 5px; font-weight: 700; letter-spacing: 1.5px; font-family: Georgia, serif; }
.mm-room rect { fill: rgba(231,220,192,.08); stroke: #cdbd95; stroke-width: 1.6; transition: fill .2s, stroke .2s; cursor: pointer; }
.mm-door { stroke: rgba(20,18,13,.85); stroke-width: 2.4; }
.mm-room text { fill: #c4b693; font-size: 5.4px; font-weight: 800; font-family: Georgia, serif; pointer-events: none; }
.mm-room.cleared rect { fill: rgba(92,121,73,.32); stroke: rgba(150,180,120,.65); }
.mm-room.cleared text { fill: #d8e2c4; }
.mm-room.current rect { fill: #c0ad7e; stroke: #6f5a32; stroke-width: 2; animation: mmGlow 1.7s ease-in-out infinite; }
.mm-room.current text { fill: #211c12; }
@keyframes mmGlow { 0%,100% { filter: drop-shadow(0 0 1px rgba(255,238,190,.5)); } 50% { filter: drop-shadow(0 0 5px rgba(255,238,190,.95)); } }
.book-btn {
  min-height: 36px; padding: 7px 12px; font-weight: 900; color: #2b2419;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 3px 3px 0 var(--shadow); align-self: start;
}

/* ── MUSIC TOGGLE ── */
.icon-btn .ico { width: 18px; height: 18px; display: block; fill: #3a3122; stroke: none; }
.icon-btn .ico .ico-hole { fill: #efe2c0; }
.icon-btn .ico .ico-stroke { fill: none; stroke: #3a3122; stroke-width: 2.6; stroke-linecap: round; }
.file-entry { display: inline-flex; align-items: center; gap: 3px; }
.file-entry span:not(.nav-dot) { font-size: 10px; font-weight: 900; }
.music-btn {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center; align-self: start;
  font-size: 15px; line-height: 1; color: var(--ink);
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer; transition: opacity .15s, filter .15s;
}
.music-btn:hover { filter: brightness(1.04); }
.music-btn.muted { opacity: .62; }
.music-btn.muted .ico { fill: #8a6a4a; }
.music-btn.muted::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 26px; height: 2px; background: #b9362d;
  transform: translate(-50%,-50%) rotate(-45deg);
}

/* ── DIALOGUE / ACTIONS ── */
.dialogue {
  position: absolute; left: 50%; right: auto; bottom: calc(3rem + var(--keyboard-lift, 0px)); z-index: 4;
  width: var(--stage-w); transform: translateX(-50%);
  display: grid; grid-template-rows: auto 1fr auto auto auto;
  min-height: 9.5rem; max-height: 34vh; padding: .72rem .9rem .64rem;
  border: 1px solid rgba(25,20,16,.82);
  background: rgba(245,235,209,.93); backdrop-filter: blur(2px);
  box-shadow: 8px 8px 0 rgba(0,0,0,.22);
  transition: bottom .12s ease;
}
.dialogue.contextual {
  width: min(24rem, calc(100vw - 1.1rem)); right: auto; bottom: auto;
  min-height: 8rem; max-height: 38vh; transform: none;
}
.dialogue.clue-caption {
  left: 50%; right: auto; bottom: 3rem; top: auto;
  width: var(--stage-w); transform: translateX(-50%);
  min-height: 9.5rem; max-height: 34vh; padding: .72rem .9rem .64rem;
  background: rgba(245,235,209,.90);
}
.dialogue.clue-caption #dialogueText { font-size: 12.5px; line-height: 1.42; }
.dialogue.clue-caption .action-panel { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 4px; margin-top: 6px; }
.dialogue.clue-caption .action-btn { min-height: 27px; font-size: 11px; padding: 5px 8px; }
.nameplate { font-size: 12px; font-weight: 900; letter-spacing: .06em; color: var(--green); margin-bottom: .3rem; }
#dialogueText { font: 500 14px/1.5 Georgia,serif; overflow-y: auto; scrollbar-width: none; margin: 0; }
#dialogueText::-webkit-scrollbar { display: none; }
.action-panel {
  display: grid; gap: 5px; margin-top: 8px;
}
.action-panel.hidden { display: none; }
.action-btn {
  min-height: 30px; padding: 6px 10px; text-align: left; font-weight: 800; font-size: 12px;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 2px 2px 0 rgba(0,0,0,.18);
}
.action-btn.primary { background: linear-gradient(180deg,#3c5a43,#314936); color: #f8edd0; }
.ask-bar {
  display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center;
  margin-top: 6px;
}
.ask-bar.hidden { display: none; }
.ask-input {
  width: 100%; min-width: 0; min-height: 32px; padding: 6px 8px;
  border: 1px solid rgba(25,20,16,.4); background: #fbf4e1; color: var(--ink);
  font: 500 16px/1.3 Georgia,serif; outline: none;
}
.ask-input:focus { border-color: rgba(54,77,61,.65); box-shadow: 0 0 0 2px rgba(54,77,61,.12); }
.ask-submit {
  min-height: 32px; padding: 0 12px; font-size: 12px; font-weight: 900;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#3c5a43,#314936); color: #f8edd0;
  box-shadow: 2px 2px 0 rgba(0,0,0,.18);
}
.dialogue-footer {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);
  padding-top: .36rem; border-top: 1px solid rgba(39,32,25,.12); margin-top: .36rem;
}
.chat-exit-btn {
  position: fixed; left: calc((100vw - var(--stage-w)) / 2 + .55rem); top: .55rem;
  z-index: 12; min-height: 34px; padding: 0 12px; font-size: 12px; font-weight: 900;
  border: 1px solid rgba(25,20,16,.82); background: linear-gradient(180deg,#d4c28f,#b9a369); color: #211c12;
  box-shadow: 2px 2px 0 rgba(0,0,0,.2);
}
.chat-exit-btn.hidden { display: none; }
.chat-exit-btn:active { transform: translateY(1px); }

/* ── CASE FILE OVERLAY ── */
.case-book {
  position: fixed; inset: 0; z-index: 20; display: none;
  align-items: stretch; justify-content: flex-end;
  background: rgba(14,12,8,.55);
}
.case-book[aria-hidden="false"] { display: flex; }
.book-card {
  width: min(420px,98vw); max-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg,#e9dcc0,#d8c7a5);
  border-left: 1px solid rgba(20,18,14,.35);
  box-shadow: -8px 0 24px rgba(0,0,0,.3);
  padding: 12px 12px 0;
}
.book-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: 0 0 auto; }
.book-head h2 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.page-sub { margin: 8px 0 6px; font-size: 11px; letter-spacing: .04em; color: var(--green); display: flex; justify-content: space-between; }
.close-btn {
  width: 32px; height: 32px; font-size: 20px; line-height: 1;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 2px 2px 0 var(--shadow); flex: 0 0 auto;
}
.victim-card {
  margin-top: 8px; padding: 8px 10px; flex: 0 0 auto;
  border: 1px solid var(--line); background: rgba(255,247,227,.52);
}
.victim-card > span { display: block; font-size: 9px; letter-spacing: .16em; color: var(--green); margin-bottom: 3px; }
.victim-card > strong { display: block; font-size: 17px; }
.victim-card > p { margin: 3px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* book panels */
.book-panel { display: none; flex: 1; overflow-y: auto; scrollbar-width: none; padding: 6px 2px 12px; }
.book-panel::-webkit-scrollbar { display: none; }
.book-panel.active { display: flex; flex-direction: column; }

/* clue list */
.clue-list { display: grid; gap: 7px; }
.clue-card {
  display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 7px; align-items: start;
  border: 1px solid var(--line); background: rgba(255,247,227,.52); padding: 6px;
}
.clue-card img { width: 52px; height: 52px; object-fit: cover; }
.clue-card strong { display: block; font-size: 13px; margin-bottom: 3px; }
.clue-card p { margin: 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
.empty-note { font-size: 12px; color: var(--muted); font-style: italic; padding: .4rem 0; }
.clue-herring { border-style: dashed; opacity: .82; }
.clue-herring strong em { color: #a07840; font-size: 10px; font-weight: 700; font-style: italic; }
.ending-motive { font-style: italic; color: #6d5a3a; border-left: 2px solid rgba(120,90,40,.4); padding-left: 10px; }
.ending-portrait { display: block; width: 140px; height: 140px; object-fit: cover; object-position: top center; margin: 0 auto 14px; border: 2px solid rgba(120,90,40,.45); background: #ccb27c; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* suspect carousel (defined in interaction layer below) */

/* verdict inside book */
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.answer-cell { position: relative; padding: 6px 8px; border: 1px solid var(--line); background: rgba(255,247,227,.52); }
.answer-cell label { display: block; font-size: 9px; letter-spacing: .12em; color: var(--green); margin-bottom: 4px; }
.answer-cell select { width: 100%; border: 1px solid rgba(25,20,16,.4); background: #fbf4e1; padding: 3px 4px; font-size: 11px; }
.answer-tick, .answer-cross { position: absolute; top: 4px; right: 5px; font-size: 13px; font-weight: 900; }
.answer-tick { color: #468a46; } .answer-cross { color: #a04040; }
.answer-tick.hidden, .answer-cross.hidden { display: none; }
.answer-cell.correct { border-color: rgba(70,138,70,.5); background: rgba(70,138,70,.08); }
.answer-cell.wrong { border-color: rgba(160,64,64,.4); background: rgba(160,64,64,.06); }
.wrong-count { font-size: 11px; color: #a04040; margin: 0 0 8px; min-height: 1.2em; }
.submit-btn {
  width: 100%; min-height: 38px; padding: 8px; font-weight: 900; margin-bottom: 6px;
  border: 1px solid rgba(25,20,16,.82);
  background: linear-gradient(180deg,#3c5a43,#314936); color: #f8edd0;
  box-shadow: 3px 3px 0 var(--shadow);
}
.ghost-btn {
  width: 100%; min-height: 34px; padding: 7px; font-weight: 800; margin-bottom: 10px;
  border: 1px solid rgba(25,20,16,.5);
  background: linear-gradient(180deg,#efe2c0,#dbc59a);
  box-shadow: 2px 2px 0 var(--shadow);
}

/* ── CONFIRM / ENDING MODALS ── */
.confirm-modal { position: fixed; inset: 0; background: rgba(14,12,8,.68); display: grid; place-items: center; padding: 16px; z-index: 32; }
.confirm-modal.hidden { display: none; }
.confirm-card { width: min(420px, 92vw); border: 1px solid rgba(25,20,16,.82); background: #ede0c2; padding: 16px; box-shadow: 10px 10px 0 rgba(0,0,0,.25); }
.confirm-card h2 { margin: 0 0 8px; font-size: 20px; color: #2b2419; }
.confirm-card p { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: #4f4637; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-actions .ghost-btn, .confirm-actions .submit-btn { margin: 0; }
.ending { position: fixed; inset: 0; background: rgba(14,12,8,.72); display: grid; place-items: center; padding: 16px; z-index: 30; }
.ending.hidden { display: none; }
.ending-card { width: min(480px,94vw); border: 1px solid rgba(25,20,16,.82); background: #ede0c2; padding: 16px; box-shadow: 10px 10px 0 rgba(0,0,0,.25); }
.ending-card h2 { margin: 0 0 10px; }
.ending-card p { line-height: 1.5; margin: 0 0 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 620px) {
  .scene-frame { width: min(100vw,calc(100dvh * 4/5)); height: min(100dvh,calc(100vw * 5/4)); }
  .hotspot { width: 15px; height: 15px; }
  .hotspot::before { inset: 4px; }
  .scene-frame { top: 45%; }
  .standee-layer { display: none !important; }
  .mobile-standee-layer {
    position: absolute; left: calc((100vw - var(--stage-w)) / 2 + 5%); bottom: calc(2.25rem + 8rem + .15rem);
    z-index: 1; width: 42%; height: 34vh; display: flex; align-items: flex-end; justify-content: center;
    pointer-events: none;
  }
  .mobile-standee-layer[hidden] { display: none !important; }
  .mobile-standee { --hit-l: 0%; --hit-t: 0%; --hit-w: 100%; --hit-h: 100%; pointer-events: none; position: relative; height: 100%; width: auto; max-width: 100%; border: none; padding: 0; background: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
  .mobile-standee[hidden] { display: none !important; }
  .mobile-standee img { display: block; height: 100%; width: auto; object-fit: contain; object-position: bottom; pointer-events: none; }
  .mobile-standee .standee-hit { position: absolute; left: var(--hit-l); top: var(--hit-t); width: var(--hit-w); height: var(--hit-h); pointer-events: auto; cursor: pointer; }
  .mobile-standee .standee-hit::after { display: none; }
  .dialogue { width: calc(var(--stage-w) - .9rem); bottom: 2.25rem; max-height: 34vh; min-height: 9rem; }
  .chat-exit-btn { left: calc((100vw - var(--stage-w)) / 2 + .55rem); top: .55rem; }
  .dialogue.contextual { width: min(23rem, calc(100vw - 1.1rem)); min-height: 8rem; max-height: 40vh; transform: none; }
  .dialogue.clue-caption { width: calc(var(--stage-w) - .9rem); bottom: 2.25rem; min-height: 9rem; max-height: 34vh; }
  .book-btn { padding: 7px 8px; font-size: 11px; }
  .book-card { width: 100vw; }
}

/* ── BRIEFING landscape, no split, no duplicate backdrop ── */
@media (orientation: landscape) and (max-height: 640px) {
  .briefing-bg { width: 100%; height: 100%; left: 0; right: 0; object-fit: contain; object-position: center center; }
  .briefing-bg-blur { display: none; }
  .briefing-vignette {
    background:
      linear-gradient(180deg, rgba(14,13,10,.55) 0%, rgba(14,13,10,.1) 30%, rgba(14,13,10,.55) 62%, rgba(14,13,10,.96) 100%),
      radial-gradient(circle at 50% 36%, rgba(0,0,0,0) 40%, rgba(0,0,0,.5) 100%);
  }
  .briefing-content {
    left: 0; right: 0; bottom: 0; top: auto;
    justify-content: flex-start; padding: 20px clamp(18px, 6vw, 48px) clamp(20px, 5vh, 40px);
    max-height: 88dvh; background: none;
  }
  .briefing-title { margin-bottom: 16px; font-size: clamp(28px, 7vw, 44px); }
  .briefing-victim { margin-bottom: 8px; font-size: clamp(15px, 4vw, 19px); }
  .briefing-sub { margin-bottom: 18px; }
  .briefing-cast-wrap { width: min(420px, 92vw); margin-bottom: 18px; }
  .briefing-cast { padding: 12px 14px; gap: 6px 16px; }
  .briefing-kicker { margin-bottom: 8px; }
  .briefing-actions { width: min(420px, 92vw); }
}

/* ── v1.55 full-screen aperture transition: blades cover the whole screen, focus hole in centre ── */
.shutter-fx { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: none; place-items: center; isolation: isolate; }
.shutter-fx.active, .shutter-fx.flash-only { display: grid; pointer-events: auto; }
.shutter-stage { position: absolute; inset: 0; display: block; }
.shutter-backdrop { display: none; }
.shutter-aperture { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; overflow: hidden; background: transparent; }
.shutter-fx.flash-only .shutter-aperture { display: none; }
.shutter-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.shutter-blade { fill: #0b0a07; stroke: none; }
.shutter-edge { fill: none; stroke: rgba(243,231,203,.7); stroke-width: 0.5; stroke-linecap: round; stroke-linejoin: round; }
.shutter-mask { display: none; }
.shutter-fx span { position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%); z-index: 2; padding: 7px 14px; background: rgba(239,226,192,.95); border: 1px solid rgba(25,20,16,.82); color: #2b2419; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; box-shadow: 4px 4px 0 rgba(0,0,0,.28); }
.shutter-fx.active span { animation: shutterLabel .9s ease both; }
.shutter-fx.flash-only span { display: none; }
@keyframes shutterFlash { 0%,18% { background: rgba(255,255,255,0); } 30% { background: rgba(255,255,255,.5); } 100% { background: rgba(255,255,255,0); } }
@keyframes clueFlash { 0% { background: rgba(255,250,230,0); } 30% { background: rgba(255,250,230,.5); } 100% { background: rgba(255,250,230,0); } }
@keyframes shutterLabel { 0%,30% { opacity: 0; transform: translate(-50%, 8px); } 48%,80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.hud { grid-template-columns: minmax(0,1fr) 36px 36px auto 36px 36px; }
.icon-btn { min-height: 36px; height: 36px; padding: 0 8px; font-weight: 900; color: #2b2419; border: 1px solid rgba(25,20,16,.82); background: linear-gradient(180deg,#efe2c0,#dbc59a); box-shadow: 3px 3px 0 var(--shadow); align-self: start; display: inline-flex; align-items: center; justify-content: center; gap: 5px; position: relative; }
.icon-btn .ico { width: 17px; height: 17px; flex: 0 0 auto; }
.file-entry { min-width: 36px; }
.file-entry #clueNavCount { font-size: 12px; font-weight: 900; font-family: Georgia, serif; letter-spacing: .02em; }
.nav-dot { position: absolute; right: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #b9362d; box-shadow: 0 0 0 2px #efe2c0, 0 0 10px rgba(185,54,45,.8); }
.nav-dot.hidden { display: none; }
.book-btn, .round-btn#prevRoom, .round-btn#nextRoom { display: none; }

.hotspot.unvisited { animation: hotspotBreathe 1.5s ease-in-out infinite; }
.hotspot.unvisited::before { animation: hotspotCore 1.5s ease-in-out infinite; }
@keyframes hotspotBreathe {
  0%,100% { transform: translate(-50%,-50%) scale(.92); background: rgba(54,77,61,.7); box-shadow: 0 0 0 2px rgba(20,16,12,.42), 0 0 8px rgba(255,238,190,.3); }
  50% { transform: translate(-50%,-50%) scale(1.32); background: rgba(120,150,96,.95); box-shadow: 0 0 0 2px rgba(20,16,12,.34), 0 0 20px rgba(255,238,190,.85); }
}
@keyframes hotspotCore {
  0%,100% { background: #f3e2b4; }
  50% { background: #fff6da; }
}

.side-room { position: fixed; top: 50%; transform: translateY(-50%); z-index: 12; width: 46px; height: 92px; border: none; background: none; color: #ece0c4; font-size: 40px; font-weight: 400; line-height: 1; opacity: .55; text-shadow: 0 2px 10px rgba(0,0,0,.7); transition: opacity .15s, transform .15s; }
.side-room:hover { opacity: 1; transform: translateY(-50%) scale(1.12); }
.side-prev { left: max(8px, calc((100vw - var(--stage-w)) / 2 - 52px)); }
.side-next { right: max(8px, calc((100vw - var(--stage-w)) / 2 - 52px)); }
.room-swipe-hint { position: absolute; left: 50%; bottom: calc(30vh - 0.6rem); transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; padding: 0; border: none; background: none; box-shadow: none; animation: hintNudge 1.5s ease-in-out infinite, hintBlink 1.5s ease-in-out infinite; }
.room-swipe-hint svg { width: 96px; height: 40px; overflow: visible; }
.room-swipe-hint path { fill: none; stroke: #f3e3bc; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0,0,0,.55)); }
.room-swipe-hint .arrow-shaft { stroke-dasharray: 4 9; }
.room-swipe-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #f3e3bc; text-shadow: 0 2px 5px rgba(0,0,0,.7); white-space: nowrap; }
.room-swipe-hint.hidden { display: none; }
@keyframes hintBlink { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes hintNudge { 0%,100% { transform: translateX(calc(-50% - 5px)); } 50% { transform: translateX(calc(-50% + 7px)); } }

.briefing-cast { display: flex; gap: 8px; overflow-x: auto; padding: 10px; scroll-snap-type: x mandatory; }
.briefing-cast li { flex: 0 0 86px; display: grid; justify-items: center; gap: 4px; text-align: center; scroll-snap-align: center; }
.cast-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid rgba(236,224,196,.72); background: #ccb27c; box-shadow: 0 2px 8px rgba(0,0,0,.24); }
.suspect-avatar { border-radius: 50%; object-fit: cover; object-position: top; background: #ccb27c; }
.briefing-cast .bc-name { font-size: 11px; }
.briefing-cast .bc-meta { font-size: 9px; text-align: center; }

/* suspect turntable */
.suspect-carousel { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 4px; min-height: 0; flex: 1; }
.carousel-btn { height: 64px; border: none; background: none; color: #6f5a3a; font-size: 30px; font-weight: 900; box-shadow: none; opacity: .7; transition: opacity .15s, transform .15s; }
.carousel-btn:hover { opacity: 1; transform: scale(1.12); }
.suspect-list.carousel-track { display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; overflow: hidden; gap: 0; }
.suspect-card { display: none; }
.suspect-card.active {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  width: 100%; padding: 6px 4px 4px;
  animation: cardIn .32s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.suspect-card .suspect-avatar { width: 132px; height: 132px; border: 3px solid rgba(236,224,196,.85); box-shadow: 0 6px 18px rgba(0,0,0,.32); }
.suspect-card strong { font-size: 21px; }
.suspect-card .suspect-role { font-size: 12px; letter-spacing: .04em; color: var(--green); font-weight: 700; }
.suspect-card .suspect-info { font-size: 12px; line-height: 1.45; color: var(--muted); max-width: 280px; font-style: italic; }
.suspect-card .suspect-stat { font-size: 11px; color: #8a7c5e; margin: 0; }
.suspect-talk-btn { margin-top: 4px; min-height: 38px; padding: 8px 18px; font-weight: 900; border: 1px solid rgba(25,20,16,.82); background: linear-gradient(180deg,#3c5a43,#314936); color: #f8edd0; box-shadow: 3px 3px 0 var(--shadow); }
.carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(54,77,61,.28); }
.carousel-dot.active { background: var(--green); }
.panel-return { width: 100%; min-height: 36px; margin-top: auto; border: 1px solid rgba(25,20,16,.62); background: linear-gradient(180deg,#efe2c0,#dbc59a); font-weight: 900; box-shadow: 2px 2px 0 var(--shadow); }

@media (max-width: 620px) {
  .hud { grid-template-columns: minmax(0,1fr) 34px 34px 58px 34px 34px; }
  .icon-btn { height: 34px; min-height: 34px; padding: 0 6px; }
  .side-room { display: none; }
  .room-swipe-hint { bottom: calc(30vh - 0.8rem); width: 92px; }
  .room-swipe-hint svg { width: 82px; height: 34px; }
}
.briefing-victim-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid rgba(236,224,196,.78); background: #ccb27c; box-shadow: 0 4px 16px rgba(0,0,0,.35); margin: 0 0 10px; }
/* ── v1.52 briefing cast polish ── */
.briefing-content {
  top: 50%; bottom: auto;
  transform: translateY(-50%);
  justify-content: center;
  overflow: visible;
  max-height: 94dvh;
}
.briefing-cast-wrap {
  position: relative;
  width: min(520px, 92vw);
  margin: 4px 0 16px;
}
.briefing-cast {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px 28px;
  background: rgba(20,18,13,.46);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
}
.briefing-cast::-webkit-scrollbar { display: none; width: 0; height: 0; }
.briefing-cast::before, .briefing-cast::after { content: none; }
.briefing-cast li { flex-basis: 92px; }
.cast-avatar {
  width: 66px; height: 66px;
  object-fit: cover; object-position: center 8%;
  border-width: 2px;
}
.briefing-victim-avatar { object-position: center 8%; filter: grayscale(1) contrast(1.05) brightness(.96); }
.briefing-title { margin-bottom: 10px; }
.briefing-victim { margin-bottom: 5px; }
.briefing-sub { margin-bottom: 10px; }
.briefing-cast-label { margin-bottom: 6px; }
.briefing-actions { margin-top: 2px; }

@media (max-width: 620px) {
  .briefing-content { transform: translateY(-50%); max-height: 96dvh; padding-top: 12px; padding-bottom: 12px; }
  .briefing-cast-wrap { width: min(430px, 94vw); margin-bottom: 12px; }
  .briefing-cast { padding: 10px 24px; }
  .cast-avatar { width: 58px; height: 58px; }
}

@media (orientation: landscape) and (max-height: 640px) {
  .briefing-content { transform: none; }
  .briefing-cast-wrap { width: 100%; }
  .briefing-cast { padding: 8px 24px; }
  .cast-avatar { width: 52px; height: 52px; }
}
.clue-guide { margin: 0 0 8px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.clue-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; margin-bottom: 3px; }
.clue-card-head strong { margin-bottom: 0; }
.clue-purpose { display: inline-flex; align-items: center; min-height: 18px; padding: 1px 6px; border: 1px solid rgba(54,77,61,.28); background: rgba(92,121,73,.12); color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.clue-purpose.misleading { border-color: rgba(126,102,55,.32); background: rgba(126,102,55,.1); color: #7e6637; }
.clue-verdict-btn { margin-top: 8px; }
