:root {
  color-scheme: dark;
  --night: #08090b;
  --ink: #f4ead7;
  --muted: #b8ad9b;
  --dim: #80786d;
  --gold: #d1a85f;
  --gold-bright: #f0cd83;
  --wine: #5b1f22;
  --wine-bright: #9a403b;
  --green: #172c27;
  --glass: rgba(12, 12, 13, .72);
  --line: rgba(234, 205, 151, .28);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html,
body { width: 100%; min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #050506;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

img { display: block; max-width: 100%; }

[hidden],
.hidden,
.is-hidden { display: none !important; }

.cinema-shell,
.episode-app,
.scene-viewport,
.story-intro,
.inspection,
.ending { position: fixed; inset: 0; }

.cinema-shell { background: var(--night); }

.episode-hud {
  position: fixed;
  z-index: 70;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(72px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) clamp(22px, 3.2vw, 52px) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(180deg, rgba(4, 5, 6, .88), rgba(4, 5, 6, .38) 68%, transparent);
  pointer-events: none;
}

.episode-hud > * { pointer-events: auto; }

.episode-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.brand-sigil {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 190, 117, .65);
  border-radius: 50%;
  color: var(--gold-bright);
  font: 17px/1 Georgia, serif;
  box-shadow: inset 0 0 0 4px rgba(10, 10, 10, .52);
}

.episode-brand b { display: block; font: 700 15px/1.1 var(--serif); }
.episode-brand small { display: block; margin-top: 4px; color: #b09e83; font-size: 8px; letter-spacing: .23em; }

.hud-chapter { text-align: center; text-transform: uppercase; }
.hud-chapter span { display: block; color: var(--gold); font-size: 9px; letter-spacing: .28em; }
.hud-chapter b { display: block; margin-top: 4px; font: 500 13px/1.3 var(--serif); letter-spacing: .14em; }

.sound-toggle {
  justify-self: end;
  min-width: 94px;
  padding: 8px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(238, 221, 188, .24);
  border-radius: 99px;
  background: rgba(7, 8, 8, .48);
  color: #d8cbb8;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.sound-toggle[aria-pressed="false"] { color: #756f67; }
.sound-label { font-size: 10px; letter-spacing: .13em; }
.sound-bars { height: 13px; display: flex; align-items: center; gap: 2px; }
.sound-bars i { width: 2px; height: 6px; border-radius: 3px; background: currentColor; animation: soundBar .8s ease-in-out infinite alternate; }
.sound-bars i:nth-child(2) { height: 12px; animation-delay: -.33s; }
.sound-bars i:nth-child(3) { height: 8px; animation-delay: -.55s; }
.sound-toggle[aria-pressed="false"] .sound-bars i { height: 2px; animation: none; }

.story-intro { z-index: 50; isolation: isolate; background: #08090b; }

.intro-backdrop,
.ending-backdrop,
.scene-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-backdrop {
  position: absolute;
  inset: 0;
  z-index: -4;
  filter: saturate(.72) contrast(1.05) brightness(.73);
  transform: scale(1.035);
  animation: introPush 16s cubic-bezier(.18, .68, .2, 1) both;
}

.intro-vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 65% 48%, transparent 0 19%, rgba(2, 2, 3, .2) 48%, rgba(2, 2, 3, .84) 100%),
    linear-gradient(90deg, rgba(3, 4, 5, .88) 0%, rgba(5, 6, 7, .72) 30%, rgba(6, 7, 8, .08) 70%);
}

.intro-copy {
  position: absolute;
  z-index: 4;
  left: clamp(30px, 8vw, 130px);
  top: 50%;
  max-width: 620px;
  transform: translateY(-45%);
  animation: introCopyIn 1.1s .2s cubic-bezier(.16, 1, .3, 1) both;
}

.kicker,
.inspection-header p {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.intro-time { margin: 28px 0 3px; color: rgba(244, 234, 215, .54); font: 400 16px/1 Georgia, serif; letter-spacing: .18em; }

.intro-copy h1 {
  margin: 8px 0 25px;
  font: 600 clamp(46px, 5.5vw, 84px)/1.14 var(--serif);
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 5px 35px rgba(0, 0, 0, .8);
}

.intro-copy h1 em { color: var(--gold-bright); font-style: normal; }

.intro-lede {
  max-width: 520px;
  margin: 0 0 30px;
  color: #d6ccbd;
  font: 400 16px/1.9 var(--serif);
  letter-spacing: .04em;
  text-shadow: 0 2px 18px #000;
}

.cinema-button {
  min-width: 210px;
  min-height: 52px;
  padding: 0 18px 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, #c7984e, #e2bc70);
  color: #17120b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .11em;
  cursor: pointer;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .35);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.cinema-button i { font: normal 22px/1 Georgia, serif; }
.cinema-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.cinema-button:disabled { opacity: .34; cursor: not-allowed; filter: grayscale(.7); }
.cinema-button.compact { min-width: 176px; min-height: 45px; font-size: 11px; }

.interaction-note { margin: 17px 0 0; color: #8f877b; font-size: 10px; letter-spacing: .16em; }

.intro-credit {
  position: absolute;
  z-index: 4;
  left: clamp(30px, 4vw, 64px);
  right: clamp(30px, 4vw, 64px);
  bottom: 29px;
  display: flex;
  justify-content: space-between;
  color: rgba(230, 221, 207, .48);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.episode-app { z-index: 10; background: #050506; }
.scene-viewport { overflow: hidden; isolation: isolate; background: #0d0d0d; animation: trainSway 7s ease-in-out infinite; }

.scene-backdrop {
  position: absolute;
  z-index: -8;
  inset: -1.5%;
  width: 103%;
  height: 103%;
  filter: saturate(.78) contrast(1.08) brightness(.75);
  transform-origin: 61% 50%;
}

.scene-backdrop.camera-push,
.camera-push { animation: cameraPush 18s cubic-bezier(.2, .55, .2, 1) both; }

.scene-backdrop.is-blackout {
  filter: saturate(.12) contrast(1.32) brightness(.1) !important;
  transition: filter .18s ease;
}

.episode-app[data-phase="blackout"] .lamp-shadow { opacity: .02; }
.character-portrait.is-startled { animation: shockedRecoil .72s cubic-bezier(.15, .9, .25, 1) both; }

.scene-grade {
  position: absolute;
  z-index: -7;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 67% 45%, rgba(240, 181, 95, .1), transparent 23%),
    linear-gradient(90deg, rgba(3, 5, 7, .66) 0%, rgba(4, 5, 6, .08) 42%, rgba(2, 3, 4, .38) 100%),
    linear-gradient(0deg, rgba(2, 2, 3, .88) 0%, transparent 40%, rgba(3, 3, 4, .32) 100%);
}

.scene-heading {
  position: absolute;
  z-index: 5;
  top: 94px;
  left: clamp(24px, 4.5vw, 74px);
  filter: drop-shadow(0 3px 15px #000);
}

.scene-time { margin: 0 0 7px; color: var(--gold-bright); font-size: 9px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.scene-heading h1 { margin: 0; font: 500 clamp(22px, 2vw, 32px)/1.25 var(--serif); letter-spacing: .06em; }

.film-grain {
  position: absolute;
  z-index: 20;
  inset: -20%;
  opacity: .07;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grain .35s steps(2) infinite;
}

.lamp-shadow {
  position: absolute;
  z-index: -3;
  top: -20%;
  left: 24%;
  width: 31%;
  height: 140%;
  pointer-events: none;
  opacity: .26;
  background: linear-gradient(90deg, transparent, rgba(255, 207, 118, .33), transparent);
  filter: blur(26px);
  transform: skewX(-10deg);
  mix-blend-mode: screen;
  animation: lampSweep 9s ease-in-out infinite alternate;
}

.snow {
  position: absolute;
  z-index: -1;
  inset: -25%;
  overflow: hidden;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(235, 244, 244, .9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(235, 244, 244, .55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(235, 244, 244, .7) 0 1.2px, transparent 1.8px);
  background-size: 83px 79px, 121px 113px, 157px 143px;
  background-position: 0 0, 31px 19px, 77px 63px;
  transform: rotate(-13deg);
  animation: snowDrift 5.8s linear infinite;
  mask-image: linear-gradient(90deg, transparent 0 22%, #000 42% 100%);
}

.snow-far { opacity: .27; filter: blur(.3px); }
.snow-near { z-index: 18; opacity: .18; filter: blur(1.8px); transform: rotate(-13deg) scale(1.2); animation-duration: 3.4s; }

.scene-letterbox { position: absolute; z-index: 24; left: 0; right: 0; height: 17px; background: #020203; pointer-events: none; }
.scene-letterbox.top { top: 0; }
.scene-letterbox.bottom { bottom: 0; }

.character-zone {
  position: absolute;
  z-index: 2;
  right: clamp(4px, 4vw, 66px);
  bottom: 12%;
  width: min(43vw, 650px);
  height: 78%;
  pointer-events: none;
}

.character-portrait {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: -4%;
  width: 100%;
  height: 108%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(-25px 18px 24px rgba(0, 0, 0, .62)) saturate(.88);
  transform-origin: 56% 82%;
  transition: opacity .32s ease, transform .4s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
  animation: portraitBreathe 5.2s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}

.character-portrait.guarded,
.character-portrait.state-guarded,
.character-portrait[data-state="guarded"] {
  transform: translateX(2.5%) scale(.992);
  filter: drop-shadow(-25px 18px 24px rgba(0, 0, 0, .68)) saturate(.72) brightness(.88);
  animation: guardedShift .55s cubic-bezier(.2, .85, .2, 1) both;
}

.character-portrait.shocked,
.character-portrait.state-shocked,
.character-portrait[data-state="shocked"] {
  filter: drop-shadow(-25px 18px 30px rgba(0, 0, 0, .72)) saturate(.74) brightness(1.08);
  animation: shockedRecoil .72s cubic-bezier(.15, .9, .25, 1) both;
}

.present-zone {
  position: absolute;
  z-index: 4;
  inset: 11% 13% 12%;
  display: grid;
  place-items: center;
  border: 1px dashed transparent;
  border-radius: 45% 45% 16% 16%;
  color: transparent;
  font-size: 11px;
  letter-spacing: .14em;
  pointer-events: auto;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.present-zone.is-ready,
.present-zone.drag-active,
body.is-dragging-evidence .present-zone {
  border-color: rgba(240, 205, 131, .7);
  background: radial-gradient(circle, rgba(208, 166, 91, .2), transparent 67%);
  color: var(--gold-bright);
  box-shadow: inset 0 0 60px rgba(217, 173, 91, .07);
}

.present-zone.is-over,
.present-zone.drag-over,
.present-zone.is-drag-over {
  border-style: solid;
  background: radial-gradient(circle, rgba(235, 194, 112, .3), transparent 68%);
  box-shadow: inset 0 0 65px rgba(240, 201, 122, .17), 0 0 35px rgba(217, 173, 91, .16);
}

.evidence-hotspots { position: absolute; z-index: 6; inset: 0; pointer-events: none; }

.evidence-hotspot {
  position: absolute;
  width: 176px;
  min-height: 62px;
  padding: 6px 10px 6px 6px;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(234, 205, 151, .32);
  background: linear-gradient(100deg, rgba(12, 12, 13, .84), rgba(18, 17, 15, .61));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .36);
  backdrop-filter: blur(8px);
  transition: border-color .2s ease, transform .2s ease, background .2s ease, opacity .3s ease;
}

.evidence-hotspot:hover { transform: translateY(-3px); border-color: var(--gold-bright); background: rgba(29, 24, 18, .9); }
.evidence-hotspot.is-found { opacity: .42; pointer-events: none; }
.evidence-hotspot.is-discovered { opacity: .68; }
.watch-hotspot { left: 38%; top: 43%; }
.cylinder-hotspot { left: 19%; top: 34%; }

.hotspot-picture {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle, #584a36, #181512 72%);
}

.hotspot-picture img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px #000); }
.hotspot-copy small { display: block; margin-bottom: 4px; color: var(--gold); font-size: 7px; letter-spacing: .16em; }
.hotspot-copy b { display: block; font: 600 12px/1.35 var(--serif); letter-spacing: .04em; }

.hotspot-pulse {
  position: absolute;
  left: -6px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 0 rgba(240, 205, 131, .6);
  animation: hotspotPulse 2s ease-out infinite;
}

.dialogue-layer {
  position: absolute;
  z-index: 12;
  left: clamp(24px, 4.5vw, 74px);
  bottom: clamp(125px, 14vh, 154px);
  width: min(620px, 52vw);
  min-height: 165px;
  padding: 24px 28px 21px;
  border-top: 1px solid var(--gold);
  background: linear-gradient(115deg, rgba(8, 9, 10, .9), rgba(13, 13, 13, .7));
  box-shadow: 0 20px 70px rgba(0, 0, 0, .48);
  backdrop-filter: blur(10px);
}

.speaker-line { display: flex; align-items: center; gap: 10px; }
.speaker-line span { color: var(--gold-bright); font: 700 12px/1 var(--serif); letter-spacing: .14em; }
.speaker-line i { width: 26px; height: 1px; background: rgba(232, 198, 132, .42); }
.speaker-line small { color: #90877b; font-size: 9px; letter-spacing: .12em; }
.dialogue-layer > p { margin: 14px 0 20px; color: #eee4d5; font: 500 clamp(14px, 1.25vw, 18px)/1.75 var(--serif); letter-spacing: .025em; text-shadow: 0 2px 12px #000; }

.choice-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.story-choice {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  border: 1px solid rgba(224, 196, 145, .2);
  background: rgba(52, 43, 33, .26);
  color: #e8dfd1;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.story-choice span { grid-row: 1 / 3; color: var(--gold); font: 10px/1.4 Georgia, serif; }
.story-choice b { font: 600 11px/1.25 var(--serif); letter-spacing: .05em; }
.story-choice small { margin-top: 3px; overflow: hidden; color: #8f877c; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.story-choice:hover { transform: translateY(-2px); border-color: rgba(240, 205, 131, .67); background: rgba(98, 72, 41, .28); }

.interaction-prompt {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(240, 205, 131, .68);
  background: rgba(54, 43, 30, .3);
  color: #c8bdad;
  font: 500 10px/1.55 var(--sans);
  letter-spacing: .06em;
}

.evidence-tray {
  position: absolute;
  z-index: 13;
  left: clamp(24px, 4.5vw, 74px);
  right: clamp(24px, 4.5vw, 74px);
  bottom: 34px;
  height: 68px;
  display: grid;
  grid-template-columns: 155px 1fr;
  border: 1px solid rgba(224, 196, 145, .2);
  background: linear-gradient(90deg, rgba(8, 9, 10, .9), rgba(14, 13, 12, .72));
  box-shadow: 0 8px 35px rgba(0, 0, 0, .38);
  backdrop-filter: blur(12px);
}

.tray-title { padding: 13px 18px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid rgba(224, 196, 145, .14); }
.tray-title span { color: var(--gold-bright); font: 600 11px/1.3 var(--serif); letter-spacing: .11em; }
.tray-title small { margin-top: 4px; color: #756e65; font-size: 7px; letter-spacing: .08em; }
.tray-slots { padding: 6px 10px; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tray-slots::-webkit-scrollbar { display: none; }
.tray-placeholder { height: 52px; display: flex; align-items: center; gap: 12px; color: #777067; font-size: 9px; letter-spacing: .08em; }
.tray-placeholder i { width: 42px; height: 42px; display: block; border: 1px dashed rgba(214, 190, 146, .25); }

.tray-evidence,
.evidence-card {
  position: relative;
  flex: 0 0 auto;
  width: 174px;
  height: 54px;
  padding: 4px 8px 4px 4px;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(237, 203, 137, .36);
  background: rgba(45, 36, 27, .78);
  color: var(--ink);
  cursor: grab;
  touch-action: none;
}

.tray-evidence:active,
.evidence-card:active { cursor: grabbing; }
.tray-evidence img,
.evidence-card img { width: 46px; height: 46px; object-fit: contain; background: #171410; }
.tray-evidence small,
.evidence-card small { color: var(--gold); font-size: 7px; letter-spacing: .12em; }
.tray-evidence b,
.evidence-card b { display: block; margin-top: 3px; font: 600 10px/1.25 var(--serif); }
.tray-evidence.is-dragging,
.evidence-card.is-dragging { z-index: 99; opacity: .84; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); transform: scale(1.05) rotate(-2deg); }
.evidence-card.is-presented,
.evidence-card:disabled { cursor: default; opacity: .5; filter: grayscale(.35); }
.evidence-card.is-selected {
  border-color: var(--gold-bright);
  background: rgba(102, 75, 41, .88);
  box-shadow: 0 0 0 2px rgba(240, 205, 131, .16), 0 8px 26px rgba(0, 0, 0, .34);
}

.pickup-flight,
.evidence-flight,
.evidence-item.is-picking-up {
  position: fixed;
  z-index: 130;
  pointer-events: none;
  animation: evidencePickup .85s cubic-bezier(.18, .78, .3, 1) both;
}

.inspection { z-index: 100; display: grid; place-items: center; padding: 74px clamp(28px, 6vw, 90px) 38px; background: #09090a; }
.inspection-shade { position: absolute; inset: 0; background: radial-gradient(circle at 52% 42%, #2f271c 0%, #10100f 43%, #050506 100%); }

.inspection-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  height: min(720px, calc(100dvh - 120px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(285px, .55fr);
  grid-template-rows: 76px 1fr;
  border: 1px solid rgba(231, 200, 139, .24);
  background: linear-gradient(135deg, rgba(25, 23, 20, .76), rgba(7, 8, 8, .92));
  box-shadow: 0 32px 110px rgba(0, 0, 0, .7);
}

.inspection-header {
  grid-column: 1 / -1;
  padding: 0 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(231, 200, 139, .16);
}

.inspection-header h2 { margin: 6px 0 0; font: 600 22px/1.2 var(--serif); letter-spacing: .06em; }

.round-close {
  width: 39px;
  height: 39px;
  border: 1px solid rgba(234, 205, 151, .29);
  border-radius: 50%;
  background: rgba(8, 8, 8, .5);
  color: #c9bdac;
  font: 300 24px/1 var(--sans);
  cursor: pointer;
}

.round-close:hover { border-color: var(--gold); color: var(--gold-bright); }

.evidence-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(231, 200, 139, .14);
  background:
    radial-gradient(circle, rgba(209, 164, 87, .09), transparent 50%),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  cursor: grab;
  touch-action: none;
  perspective: 900px;
}

.evidence-stage[data-evidence="watch"]::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background: radial-gradient(circle at var(--glint-x, 57%) var(--glint-y, 35%), rgba(255, 238, 194, .38), transparent 10%);
  mix-blend-mode: screen;
  transition: opacity .2s ease;
}

.evidence-stage.is-handling[data-evidence="watch"]::after { opacity: .85; }
.evidence-stage.is-ticking[data-evidence="watch"] .inspection-halo { animation: evidenceGlow .46s ease-in-out 2 alternate; }
.evidence-stage.is-playing[data-evidence="cylinder"] .inspection-halo { animation: evidenceGlow .55s ease-in-out infinite alternate; }

.evidence-stage:active { cursor: grabbing; }

.inspection-halo {
  position: absolute;
  width: min(46vw, 490px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 180, 93, .18), transparent 67%);
  box-shadow: 0 0 100px rgba(213, 161, 73, .08);
}

#evidenceImage {
  position: relative;
  z-index: 2;
  width: min(58%, 490px);
  max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 34px 28px rgba(0, 0, 0, .72));
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotateZ(var(--tilt-z, 0deg));
  transition: filter .25s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.evidence-stage[data-evidence="cylinder"] #evidenceImage { width: min(72%, 620px); }
.evidence-stage.is-discovered #evidenceImage { filter: drop-shadow(0 34px 28px rgba(0, 0, 0, .72)) brightness(1.08); }

.object-control {
  position: absolute;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gold-bright);
  border-radius: 50%;
  background: rgba(21, 17, 12, .4);
  cursor: pointer;
  box-shadow: 0 0 0 8px rgba(236, 196, 119, .08), 0 0 30px rgba(236, 196, 119, .22);
  animation: controlPulse 1.8s ease-out infinite;
}

.object-control span { position: absolute; inset: 12px; border-radius: 50%; background: var(--gold-bright); }
.watch-crown { top: 24%; left: 68%; transform: translate(-50%, -50%); }
.cylinder-crank { right: 17%; top: 51%; }
.cylinder-needle { left: 42%; top: 27%; }

.cylinder-crank span {
  inset: 18px auto auto 18px;
  width: 52px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-bright), #8f6733);
  transform-origin: 2px 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .55);
}

.cylinder-crank span::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -6px;
  width: 14px;
  height: 14px;
  border: 1px solid #f1cc82;
  border-radius: 50%;
  background: #4f351c;
  box-shadow: 0 2px 7px #000;
}

.cylinder-crank.is-cranking { border-color: #fff0c5; box-shadow: 0 0 0 10px rgba(236, 196, 119, .12), 0 0 42px rgba(236, 196, 119, .4); }
.cylinder-crank.needs-crank { animation: needsCrank .28s ease-in-out 3 alternate; }
.evidence-stage.needle-down .cylinder-needle { transform: rotate(12deg) translateY(3px); }
.present-zone.evidence-landed { animation: evidenceLanded .6s cubic-bezier(.16, 1, .3, 1); }
.character-portrait.is-reacting { filter: drop-shadow(-25px 18px 36px rgba(0, 0, 0, .8)) saturate(.7); }
.episode-app.is-obscured { filter: blur(2px) brightness(.55); }

.gesture-hint {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0;
  color: #81786d;
  font-size: 9px;
  letter-spacing: .14em;
  text-align: center;
  pointer-events: none;
}

.gesture-hint span { margin-right: 8px; color: var(--gold); font-size: 18px; vertical-align: -2px; }

.discovery-card {
  padding: clamp(26px, 4vw, 52px) clamp(24px, 3vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(150deg, rgba(50, 37, 23, .18), rgba(6, 7, 7, .4));
}

.discovery-label { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .25em; }
.discovery-card > p { min-height: 128px; margin: 20px 0 34px; color: #e6ddcf; font: 500 clamp(18px, 2vw, 26px)/1.7 var(--serif); letter-spacing: .035em; }
.discovery-actions { margin-top: auto; }
.observation-progress { display: flex; gap: 7px; margin-bottom: 24px; }
.observation-progress i { width: 28px; height: 2px; background: rgba(233, 207, 160, .17); }
.observation-progress i.is-active { background: var(--gold-bright); box-shadow: 0 0 10px rgba(239, 198, 117, .4); }

.ending { z-index: 110; display: grid; place-items: center; isolation: isolate; background: #060607; }
.ending-backdrop { position: absolute; z-index: -3; inset: 0; filter: saturate(.45) brightness(.42) contrast(1.1); transform: scale(1.05); animation: endingPull 15s ease-out both; }
.ending-shade { position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(28, 22, 16, .13), rgba(2, 3, 4, .86) 74%), linear-gradient(90deg, rgba(3, 4, 5, .76), rgba(3, 4, 5, .35)); }

.ending-copy {
  width: min(660px, calc(100% - 48px));
  padding: 50px clamp(28px, 5vw, 62px);
  border: 1px solid rgba(230, 198, 139, .3);
  background: rgba(9, 9, 10, .76);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
  backdrop-filter: blur(16px);
  animation: endingCopyIn .85s cubic-bezier(.16, 1, .3, 1) both;
}

.ending-copy h2 { margin: 16px 0 18px; font: 600 clamp(35px, 5vw, 60px)/1.18 var(--serif); letter-spacing: -.035em; }
.ending-copy > p:not(.kicker) { margin: 0; color: #c8bfb1; font: 400 15px/1.9 var(--serif); }
.ending-evidence { margin: 30px 0; padding: 8px; display: flex; align-items: center; gap: 14px; border: 1px solid rgba(224, 196, 145, .2); background: rgba(34, 27, 20, .55); }
.ending-evidence img { width: 74px; height: 74px; object-fit: contain; background: #15120f; }
.ending-evidence small { display: block; color: var(--gold); font-size: 8px; letter-spacing: .18em; }
.ending-evidence b { display: block; margin-top: 7px; font: 600 14px/1.3 var(--serif); letter-spacing: .06em; }

@keyframes introPush {
  from { transform: scale(1.035); }
  to { transform: scale(1.12) translateX(-1.2%); }
}

@keyframes introCopyIn {
  from { opacity: 0; transform: translateY(-39%) translateX(-22px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(-45%) translateX(0); filter: blur(0); }
}

@keyframes cameraPush {
  from { transform: scale(1.015) translate3d(0, 0, 0); }
  to { transform: scale(1.095) translate3d(-1.2%, -.6%, 0); }
}

@keyframes trainSway {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  24% { transform: translate3d(.45px, -.25px, 0) rotate(.012deg); }
  51% { transform: translate3d(-.55px, .4px, 0) rotate(-.016deg); }
  78% { transform: translate3d(.3px, .45px, 0) rotate(.009deg); }
}

@keyframes lampSweep {
  from { transform: translateX(-7%) skewX(-10deg); opacity: .15; }
  45% { opacity: .29; }
  to { transform: translateX(12%) skewX(-7deg); opacity: .19; }
}

@keyframes snowDrift {
  from { background-position: 0 0, 31px 19px, 77px 63px; }
  to { background-position: 180px 360px, 255px 390px, 343px 423px; }
}

@keyframes grain {
  0% { transform: translate3d(-2%, 3%, 0); }
  33% { transform: translate3d(3%, -2%, 0); }
  66% { transform: translate3d(-1%, -3%, 0); }
  100% { transform: translate3d(2%, 1%, 0); }
}

@keyframes portraitBreathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -2px, 0) scale(1.002); }
}

@keyframes guardedShift {
  0% { transform: translateX(-1.5%) scale(1.006); }
  55% { transform: translateX(3.2%) scale(.989); }
  100% { transform: translateX(2.5%) scale(.992); }
}

@keyframes shockedRecoil {
  0% { transform: translateX(0) scale(1); }
  20% { transform: translateX(2.8%) translateY(1%) scale(.975); }
  48% { transform: translateX(1.1%) translateY(-.6%) scale(1.01); }
  100% { transform: translateX(1.5%) scale(.994); }
}

@keyframes hotspotPulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 205, 131, .65); }
  70%, 100% { box-shadow: 0 0 0 13px rgba(240, 205, 131, 0); }
}

@keyframes controlPulse {
  0%, 100% { box-shadow: 0 0 0 7px rgba(236, 196, 119, .07), 0 0 24px rgba(236, 196, 119, .18); }
  50% { box-shadow: 0 0 0 13px rgba(236, 196, 119, 0), 0 0 38px rgba(236, 196, 119, .34); }
}

@keyframes evidenceGlow {
  from { opacity: .42; transform: scale(.96); }
  to { opacity: .95; transform: scale(1.08); }
}

@keyframes needsCrank {
  from { transform: translateX(-4px); }
  to { transform: translateX(4px); }
}

@keyframes evidenceLanded {
  0% { background: radial-gradient(circle, rgba(240, 205, 131, .48), transparent 64%); transform: scale(.98); }
  100% { background: transparent; transform: scale(1); }
}

@keyframes evidencePickup {
  0% { opacity: 1; transform: translate3d(var(--pickup-x, 0), var(--pickup-y, 0), 0) scale(1) rotate(0); }
  65% { opacity: 1; transform: translate3d(var(--pickup-mid-x, -20vw), var(--pickup-mid-y, 12vh), 0) scale(.72) rotate(-5deg); }
  100% { opacity: 0; transform: translate3d(var(--pickup-end-x, -34vw), var(--pickup-end-y, 40vh), 0) scale(.24) rotate(-8deg); }
}

@keyframes soundBar { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
@keyframes endingPull { from { transform: scale(1.1); } to { transform: scale(1.02); } }
@keyframes endingCopyIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  .episode-hud { height: calc(64px + env(safe-area-inset-top)); grid-template-columns: 1fr 1fr; }
  .hud-chapter { display: none; }
  .scene-heading { top: 76px; }
  .character-zone { right: -5%; bottom: 18%; width: 53vw; height: 68%; }
  .watch-hotspot { left: 35%; top: 39%; }
  .cylinder-hotspot { left: 7%; top: 31%; }
  .dialogue-layer { bottom: 116px; width: min(590px, 61vw); }
  .evidence-tray { bottom: 27px; }
  .inspection-shell { grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); }
}

@media (max-width: 680px) {
  .episode-hud {
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: linear-gradient(180deg, rgba(4, 5, 6, .94), rgba(4, 5, 6, .45), transparent);
  }

  .episode-brand { gap: 7px; }
  .brand-sigil { width: 29px; height: 29px; font-size: 14px; }
  .episode-brand b { font-size: 12px; }
  .episode-brand small { font-size: 6px; }
  .sound-toggle { min-width: 43px; width: 43px; height: 34px; padding: 0; }
  .sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .intro-backdrop,
  .ending-backdrop,
  .scene-backdrop { object-position: 60% center; }

  .intro-vignette {
    background:
      linear-gradient(0deg, rgba(3, 4, 5, .97) 0%, rgba(3, 4, 5, .74) 45%, rgba(3, 4, 5, .15) 78%),
      radial-gradient(circle at 63% 33%, transparent, rgba(2, 2, 3, .48) 68%);
  }

  .intro-copy {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: max(68px, calc(env(safe-area-inset-bottom) + 47px));
    transform: none;
    animation-name: introCopyInMobile;
  }

  .intro-time { margin-top: 18px; font-size: 12px; }
  .intro-copy h1 { margin: 8px 0 16px; font-size: clamp(40px, 13.5vw, 56px); line-height: 1.12; }
  .intro-lede { margin-bottom: 22px; font-size: 13px; line-height: 1.75; }
  .cinema-button { width: 100%; min-height: 49px; }
  .interaction-note { font-size: 8px; }
  .intro-credit { display: none; }

  .scene-backdrop {
    inset: -1%;
    width: 102%;
    height: 102%;
    object-position: 54% center;
    filter: saturate(.75) contrast(1.08) brightness(.66);
  }

  .scene-grade {
    background:
      linear-gradient(0deg, rgba(2, 2, 3, .96) 0%, rgba(3, 3, 4, .54) 41%, transparent 64%),
      linear-gradient(90deg, rgba(3, 5, 7, .42), transparent 70%);
  }

  .scene-heading { top: calc(68px + env(safe-area-inset-top)); left: 18px; }
  .scene-time { font-size: 7px; }
  .scene-heading h1 { font-size: 19px; }
  .scene-letterbox { height: 8px; }

  .character-zone {
    z-index: 2;
    right: -20%;
    bottom: 39%;
    width: 89vw;
    height: 51%;
  }

  .character-portrait { height: 105%; object-position: bottom right; }
  .present-zone { inset: 3% 17% 3% 25%; }

  .evidence-hotspot {
    width: 142px;
    min-height: 50px;
    grid-template-columns: 39px 1fr;
    padding: 5px;
    gap: 7px;
  }

  .hotspot-picture { width: 39px; height: 39px; }
  .hotspot-copy small { font-size: 6px; }
  .hotspot-copy b { font-size: 10px; }
  .watch-hotspot { left: 7%; top: 35%; }
  .cylinder-hotspot { left: 7%; top: 44%; }

  .dialogue-layer {
    left: 12px;
    right: 12px;
    bottom: calc(91px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 0;
    padding: 15px 16px 13px;
    background: linear-gradient(115deg, rgba(8, 9, 10, .94), rgba(13, 13, 13, .85));
  }

  .speaker-line span { font-size: 10px; }
  .speaker-line small { font-size: 7px; }
  .dialogue-layer > p { margin: 9px 0 12px; font-size: 13px; line-height: 1.55; }
  .choice-panel { gap: 5px; }
  .story-choice { min-height: 48px; padding: 8px; grid-template-columns: 16px 1fr; }
  .story-choice span { font-size: 8px; }
  .story-choice b { font-size: 9px; }
  .story-choice small { display: none; }

  .evidence-tray {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    height: 67px;
    grid-template-columns: 82px 1fr;
  }

  .tray-title { padding: 9px; }
  .tray-title span { font-size: 9px; }
  .tray-title small { display: none; }
  .tray-slots { padding: 6px; }
  .tray-placeholder span { font-size: 7px; }
  .tray-placeholder i { width: 39px; height: 39px; }
  .tray-evidence,
  .evidence-card { width: 135px; height: 53px; grid-template-columns: 43px 1fr; gap: 6px; }
  .tray-evidence img,
  .evidence-card img { width: 43px; height: 43px; }

  .inspection { padding: calc(57px + env(safe-area-inset-top)) 0 0; }
  .inspection-shell {
    width: 100%;
    height: calc(100dvh - 57px - env(safe-area-inset-top));
    grid-template-columns: 1fr;
    grid-template-rows: 63px minmax(0, 1fr) auto;
    border-right: 0;
    border-left: 0;
  }

  .inspection-header { padding: 0 17px; }
  .inspection-header p { font-size: 7px; }
  .inspection-header h2 { margin-top: 4px; font-size: 17px; }
  .round-close { width: 34px; height: 34px; }

  .evidence-stage { min-height: 0; border-right: 0; border-bottom: 1px solid rgba(231, 200, 139, .14); }
  #evidenceImage { width: min(67%, 330px); max-height: 72%; }
  .evidence-stage[data-evidence="cylinder"] #evidenceImage { width: min(83%, 390px); }
  .inspection-halo { width: 78vw; }
  .watch-crown { top: 31%; left: 69%; }
  .cylinder-crank { right: 10%; top: 50%; }
  .cylinder-needle { left: 39%; top: 24%; }
  .gesture-hint { bottom: 13px; font-size: 8px; }

  .discovery-card { min-height: 204px; padding: 18px 20px max(18px, env(safe-area-inset-bottom)); }
  .discovery-card > p { min-height: 53px; margin: 10px 0 14px; font-size: 15px; line-height: 1.55; }
  .observation-progress { margin-bottom: 13px; }
  .cinema-button.compact { width: 100%; min-height: 43px; }

  .ending-copy { width: calc(100% - 28px); padding: 33px 22px; }
  .ending-copy h2 { font-size: 36px; }
  .ending-copy > p:not(.kicker) { font-size: 13px; line-height: 1.75; }
  .ending-evidence { margin: 22px 0; }
  .ending-evidence img { width: 60px; height: 60px; }

  .snow { mask-image: linear-gradient(90deg, transparent 0 5%, #000 40% 100%); }
}

@media (max-width: 680px) and (max-height: 720px) {
  .intro-copy h1 { font-size: 39px; }
  .intro-lede { margin-bottom: 14px; line-height: 1.55; }
  .interaction-note { display: none; }
  .character-zone { bottom: 43%; height: 45%; }
  .dialogue-layer { bottom: 84px; }
  .evidence-tray { height: 62px; }
}

@keyframes introCopyInMobile {
  from { opacity: 0; transform: translateY(25px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .scene-backdrop,
  .intro-backdrop,
  .ending-backdrop,
  .character-portrait { transform: none !important; }

  .film-grain,
  .lamp-shadow,
  .snow { animation: none !important; }
}


/* Keep the player's three hypotheses readable on narrow and short screens. */
.dialogue-layer.has-deduction {
  max-height: calc(100dvh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.choice-panel.is-deducing { grid-template-columns: minmax(0, 1fr); }
.choice-panel.is-deducing .story-choice { min-height: 48px; }
.choice-panel.is-deducing .story-choice b { font-size: 13px; line-height: 1.45; }
.choice-panel.is-deducing .story-choice small {
  display: block;
  font-size: 11px;
  white-space: normal;
  line-height: 1.5;
}
.deduction-feedback { border-left-color: #deb582; color: #f0debf; }
@media (max-width: 680px) {
  .dialogue-layer.has-deduction { max-height: calc(100dvh - 190px); }
  .choice-panel.is-deducing .story-choice small { display: none; }
  .choice-panel.is-deducing .interaction-prompt { font-size: 12px; }
}

/* Match direct manipulation to the pointer; prevent browser panning on props. */
.evidence-stage, .object-control { touch-action: none; }
.evidence-stage.is-handling #evidenceImage { transition: transform 70ms ease-out; }
.object-control:disabled { animation: none; opacity: .55; cursor: default; }
.cylinder-crank { background: conic-gradient(rgba(236,196,119,.55) var(--wind-progress, 0deg), rgba(21,17,12,.8) 0); }
.cylinder-crank::after {
  content: attr(data-progress);
  position: absolute;
  top: 48px;
  left: -12px;
  min-width: 64px;
  padding: 4px;
  border-radius: 4px;
  background: rgba(9,9,11,.85);
  color: #f1cc82;
  font: 12px/1.4 sans-serif;
}
.sound-toggle[data-sound="locked"] .sound-bars i,
.sound-toggle[data-sound="unavailable"] .sound-bars i { animation: none; height: 3px; }

.cylinder-crank span { transform: rotate(var(--crank-turn, 0deg)); transition: transform 65ms linear; }

.case-objective {
  max-width: min(440px, 68vw);
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 2px solid var(--gold);
  background: rgba(8,9,10,.76);
  color: #e9dcc4;
  font: 12px/1.65 var(--sans);
}
.testimony-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid #d7b57c;
  background: rgba(108,76,38,.24);
  color: #f2e3ca;
  font: 13px/1.65 var(--serif);
}
.episode-app[data-phase="confrontation"] .dialogue-layer {
  max-height: calc(100dvh - 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 680px) {
  .case-objective { max-width: calc(100vw - 48px); font-size: 11px; margin-top: 6px; }
  .testimony-note { font-size: 12px; padding: 8px 10px; }
  .episode-app[data-phase="confrontation"] .dialogue-layer { max-height: calc(100dvh - 250px); }
}

/* Reading layout: scene narration, a character's speech, and player tools
   occupy distinct places and use distinct visual treatments. */
:root { --muted: #d7cebf; --dim: #bdb4a7; }
.intro-backdrop, .ending-backdrop { filter: saturate(.95) contrast(.98) brightness(1.12); }
.scene-backdrop { filter: saturate(.95) contrast(.96) brightness(1.16); }
.scene-grade { background: linear-gradient(0deg, rgba(13,18,24,.22), transparent 44%), linear-gradient(90deg, rgba(13,18,24,.12), transparent 65%); }
.intro-vignette { background: linear-gradient(90deg, rgba(13,18,24,.65), rgba(13,18,24,.2) 50%, transparent 82%); }
.ending-shade { background: rgba(12,17,22,.24); }
.film-grain { opacity: .025; }
.scene-letterbox { display: none; }
.scene-backdrop.is-blackout { filter: brightness(.78) saturate(.8) !important; }
.scene-heading { top: 94px; }
.scene-heading h1 { color: #fff7e9; text-shadow: 0 2px 6px #17130f; }
.scene-time { color: #ffe0a3; font-size: 12px; }
.scene-narration {
  position: absolute;
  z-index: 10;
  top: 176px;
  left: clamp(24px, 4.5vw, 74px);
  width: min(460px, 41vw);
  max-height: 160px;
  overflow-y: auto;
  padding: 14px 18px;
  border-radius: 5px;
  background: rgba(22,31,40,.86);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.channel-label { color: #efd1a0; font: 600 11px/1.4 var(--sans); letter-spacing: .14em; }
.scene-narration p { margin: 7px 0 0; color: #fff9ef; font: 16px/1.8 var(--serif); }
.character-zone { right: 4%; bottom: 260px; width: 44vw; height: calc(100dvh - 350px); }
.character-portrait, .character-portrait[data-state] {
  bottom: 0; height: 100%;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.26)) saturate(.95) brightness(1.12);
}
.dialogue-layer, .episode-app[data-phase="confrontation"] .dialogue-layer {
  left: auto;
  right: 4.5%;
  bottom: 132px;
  width: min(570px, 43vw);
  min-height: 0;
  max-height: 200px;
  overflow-y: auto;
  padding: 20px 24px;
  border: 1px solid #b5c6cf;
  border-top: 3px solid #e7c58f;
  border-radius: 8px;
  background: #23323f;
  box-shadow: 0 12px 25px rgba(0,0,0,.2);
  backdrop-filter: none;
}
.speaker-line span { color: #ffe1ac; font: 700 16px/1.5 var(--serif); letter-spacing: .05em; }
.speaker-line small { color: #e3e8eb; font-size: 12px; letter-spacing: .04em; }
.dialogue-layer > p { margin: 10px 0 0; color: #fffaf1; font: 19px/1.8 var(--serif); text-shadow: none; }
.investigation-panel {
  position: absolute;
  z-index: 14;
  left: clamp(24px, 4.5vw, 74px);
  bottom: 132px;
  width: min(460px, 41vw);
  max-height: calc(100dvh - 470px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 1px solid #c7b89e;
  border-radius: 8px;
  color: #302b23;
  background: #f6eddd;
  box-shadow: 0 12px 25px rgba(0,0,0,.2);
}
.investigation-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.investigation-header > span { color: #795724; font: 700 12px/1.5 var(--sans); letter-spacing: .12em; }
.investigation-header small { color: #675e50; font-size: 11px; }
.investigation-panel .case-objective { max-width: none; margin: 9px 0; padding: 0; border: 0; background: none; color: #302b23; font: 600 17px/1.5 var(--serif); }
.action-hint { margin: 9px 0 12px; color: #615646; font: 13px/1.65 var(--sans); }
.testimony-record { margin: 10px 0; padding: 9px 12px; border: 1px solid #cdbd9f; border-radius: 4px; background: #eadeca; }
.testimony-record summary { cursor: pointer; color: #57401c; font: 600 13px/1.6 var(--sans); }
.testimony-record summary span { float: right; font-size: 11px; font-weight: 400; }
.testimony-record blockquote { margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid #c9b795; color: #3e352a; font: 15px/1.75 var(--serif); }
.investigation-panel .choice-panel { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.investigation-panel .story-choice { min-height: 49px; padding: 10px 12px; border: 1px solid #c3b193; border-radius: 4px; background: #fffaf0; color: #342b20; }
.investigation-panel .story-choice:hover { background: #ead9b9; border-color: #8e672f; transform: none; }
.investigation-panel .story-choice span { color: #805c29; font-size: 12px; }
.investigation-panel .story-choice b { font: 600 15px/1.5 var(--sans); letter-spacing: 0; }
.investigation-panel .story-choice small { display: block; color: #6b5d49; font-size: 12px; white-space: normal; line-height: 1.5; }
.investigation-panel .present-zone {
  position: relative; inset: auto; width: 100%; min-height: 48px; margin-top: 10px; padding: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed #a0804b; border-radius: 5px; background: #e6d6b9; color: #584425;
  font: 600 13px/1.5 var(--sans); letter-spacing: .02em; cursor: pointer;
}
.investigation-panel .present-zone.is-ready, .investigation-panel .present-zone.is-armed,
body.is-dragging-evidence .investigation-panel .present-zone {
  background: #8c652c; color: #fffaf0; border: 1px solid #694719; box-shadow: none;
}
.evidence-tray { bottom: 22px; height: 90px; background: #f4e8d1; border: 1px solid #cab28b; color: #382d20; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.tray-title span { color: #695026; font-size: 14px; }
.tray-title small, .tray-placeholder { color: #695d4c; font-size: 12px; }
.evidence-card { background: #fff8e9; border-color: #c4b18e; color: #382d20; }
.evidence-card b { color: #382d20; font-size: 14px; }
.evidence-card small { color: #70542a; font-size: 11px; }
.evidence-card.is-selected { border: 2px solid #94652a; background: #ead4aa; }
.evidence-card.is-presented { opacity: .72; }
.sound-toggle, .sound-toggle[aria-pressed="false"] { color: #fff1d9; background: #27343f; border-color: #9fa9ae; }
.inspection-shell { background: #e8decc; border-color: #bba98c; }
.inspection-header { background: #f7efdf; color: #352d23; border-color: #c6b595; }
.inspection-header p, .discovery-label { color: #755321; }
.evidence-stage { background: radial-gradient(circle at 50% 40%, #e7dcc4, #a79a83); border-color: #b6a382; }
#evidenceImage, .evidence-stage.is-discovered #evidenceImage { filter: drop-shadow(0 16px 15px rgba(42,32,20,.25)) brightness(1.12); }
.discovery-card { background: #f7efdf; color: #352d23; }
.discovery-card > p { color: #352d23; }
.gesture-hint { color: #342b20; font-size: 13px; background: rgba(248,239,219,.88); padding: 7px; }
.gesture-hint span { color: #705024; }
.round-close { background: #e4d4b7; color: #3a2b1c; border-color: #9e8050; }
.ending-copy { background: #f4e9d5; color: #332b20; border-color: #c1a16f; }
.ending-copy > p:not(.kicker) { color: #514333; }
.ending-copy .kicker { color: #795627; }
.ending-evidence { color: #392e21; background: #e5d4b6; border-color: #bda47b; }
.ending-evidence small { color: #775321; }
.ending-evidence img { background: #d7c6a7; }

/* Small screens read in story order and scroll as a page. No text is hidden
   beneath fixed portraits or constrained to a tiny all-purpose dialogue box. */
@media (max-width: 760px), (max-height: 650px) {
  .scene-viewport { display: flex; flex-direction: column; gap: 12px; padding: 78px 14px 24px; overflow-y: auto; animation: none; }
  .scene-backdrop { position: fixed; height: 100dvh; inset: 0; width: 100%; filter: saturate(.95) contrast(.96) brightness(1.16); }
  .scene-heading { position: relative; top: auto; left: auto; flex: 0 0 auto; }
  .scene-heading h1 { font-size: 23px; }
  .scene-time { font-size: 11px; }
  .scene-narration { position: relative; top: auto; left: auto; width: 100%; max-height: none; flex: 0 0 auto; padding: 12px 15px; }
  .scene-narration p { font-size: 15px; line-height: 1.8; }
  .character-zone { position: relative; top: auto; right: auto; bottom: auto; width: 100%; height: clamp(200px, 32dvh, 300px); flex: 0 0 clamp(200px, 32dvh, 300px); }
  .character-portrait, .character-portrait[data-state] { width: 100%; height: 100%; bottom: 0; }
  .dialogue-layer, .episode-app[data-phase="confrontation"] .dialogue-layer { position: relative; left: auto; right: auto; bottom: auto; width: 100%; max-height: none; flex: 0 0 auto; margin-top: -16px; padding: 16px 18px; }
  .dialogue-layer > p { font-size: 18px; line-height: 1.8; }
  .speaker-line span { font-size: 15px; }
  .speaker-line small { font-size: 12px; }
  .investigation-panel { position: relative; top: auto; left: auto; bottom: auto; width: 100%; max-height: none; flex: 0 0 auto; padding: 16px; }
  .investigation-panel .case-objective { font-size: 17px; }
  .investigation-panel .story-choice small { display: block; }
  .evidence-hotspots { position: relative; inset: auto; display: flex; align-items: stretch; gap: 10px; flex: 0 0 auto; margin: 8px 0; }
  .evidence-hotspot.watch-hotspot, .evidence-hotspot.cylinder-hotspot { position: relative; left: auto; top: auto; flex: 1; width: auto; min-height: 88px; padding: 10px; background: #f8efdf; border: 1px solid #bda479; border-radius: 6px; color: #372b1b; }
  .hotspot-copy b { font-size: 14px; color: #372b1b; }
  .hotspot-copy small { font-size: 10px; color: #6b5534; }
  .evidence-tray { position: relative; inset: auto; width: 100%; height: auto; min-height: 86px; flex: 0 0 auto; grid-template-columns: 80px 1fr; padding: 8px; }
  .tray-slots { flex-wrap: wrap; }
  .evidence-card { flex: 1; min-width: 100px; }
  .evidence-card b { font-size: 13px; }
  .sound-toggle { width: auto; min-width: 88px; padding: 7px 10px; }
  .sound-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; font-size: 11px; }
  .intro-backdrop { filter: saturate(.95) brightness(1.1); }
  .intro-vignette { background: linear-gradient(0deg, rgba(17,23,29,.8), rgba(17,23,29,.28) 60%, transparent); }
  .interaction-note { font-size: 12px; line-height: 1.8; }
  .intro-lede { color: #fff3e0; font-size: 15px; }
}
@media (min-width: 761px) and (min-height: 651px) {
  .episode-app[data-phase="inspection"] .evidence-hotspots {
    position: absolute; left: auto; right: 6%; top: 38%; bottom: auto;
    width: 43%; display: flex; gap: 18px; align-items: center;
  }
  .episode-app[data-phase="inspection"] .evidence-hotspot {
    position: relative; left: auto; top: auto; flex: 1; width: auto; min-height: 112px; padding: 14px;
    border: 1px solid #bda479; border-radius: 8px; background: #f8efdf; color: #372b1b;
  }
  .episode-app[data-phase="inspection"] .hotspot-copy b { color: #372b1b; font-size: 16px; }
  .episode-app[data-phase="inspection"] .hotspot-copy small { color: #6b5534; font-size: 11px; }
}
