:root {
  color-scheme: dark;
  --bg: #071018;
  --panel: #0e1a24;
  --panel-2: #142532;
  --line: rgba(205, 230, 236, .15);
  --text: #ecf3ef;
  --muted: #9bb0b4;
  --red: #ef5e53;
  --cyan: #69d4d0;
  --yellow: #f4ca58;
  --green: #78b892;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html {
  min-width: 320px; background: var(--bg); -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
body {
  min-width: 320px; min-height: 100dvh; margin: 0; color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(105,212,208,.13), transparent 35rem),
    radial-gradient(circle at 90% 20%, rgba(239,94,83,.1), transparent 34rem),
    var(--bg);
}
button, audio { font: inherit; }
button { min-height: 46px; border: 0; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, audio:focus-visible, summary:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 3px;
}
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.sound-toggle {
  position: fixed; z-index: 30; top: 86px; right: 24px; min-height: 32px; padding: 6px 9px;
  border: 1px solid rgba(105,212,208,.35); background: rgba(7,16,24,.76); color: var(--cyan);
  font: 800 .58rem ui-monospace,monospace; letter-spacing: .1em; backdrop-filter: blur(10px);
}
.volume-control { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; margin: 16px 0; color: var(--muted); }
.volume-control input { width: 100%; accent-color: var(--cyan); }
.audio-play {
  width: fit-content; min-height: 38px; padding: 8px 13px; border: 1px solid rgba(105,212,208,.38);
  background: rgba(105,212,208,.08); color: var(--cyan); font-size: .76rem; font-weight: 850;
}
.skip-link {
  position: fixed; z-index: 999; top: 8px; left: 8px; padding: 10px 14px;
  transform: translateY(-160%); background: var(--yellow); color: #081116; border-radius: 10px;
}
.skip-link:focus { transform: translateY(0); }
.layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(210px,260px) minmax(380px,680px) minmax(230px,300px); justify-content: center; gap: 24px; padding: 24px; }
.phone { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 32px; background: rgba(10,22,31,.96); box-shadow: var(--shadow); }
.topbar {
  position: sticky; z-index: 10; top: 0; display: grid; grid-template-columns: 46px 1fr 46px;
  align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: rgba(7,16,24,.92); backdrop-filter: blur(18px); text-align: center;
}
.topbar div { display: grid; min-width: 0; }
.topbar small, .eyebrow { color: var(--cyan); font-size: .66rem; font-weight: 850; letter-spacing: .17em; }
.topbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.icon-btn { width: 46px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.progress { height: 3px; background: var(--panel-2); }
.progress span, .mini-progress span { display: block; height: 100%; background: linear-gradient(90deg,var(--red),var(--yellow)); transition: width .35s; }
.case-status { display: flex; justify-content: center; gap: 18px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: rgba(14,26,36,.78); color: var(--muted); font-size: .72rem; }
.case-status strong { color: var(--text); }
.scene { min-height: calc(100dvh - 76px); padding: 26px 22px 104px; }
.scene-head { margin-bottom: 24px; }
.scene-head > span { color: var(--red); font: 800 .68rem ui-monospace,monospace; letter-spacing: .14em; }
h1,h2,p { margin-top: 0; }
.scene-head h1 { margin: 8px 0; font-size: clamp(1.65rem,6vw,2.25rem); line-height: 1.08; letter-spacing: -.04em; }
.scene-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.intro-copy, .fact-list, .goal, .audio-card, .files article, .hint, .resolved, .caption {
  border: 1px solid var(--line); border-radius: 16px; background: rgba(20,37,50,.72);
}
.intro-copy { padding: 18px; }
.intro-copy p { margin: 0 0 12px; line-height: 1.72; }
.intro-copy p:last-child { margin-bottom: 0; }
.goal { display: grid; gap: 5px; margin-top: 14px; padding: 16px; border-color: rgba(105,212,208,.34); }
.goal span { color: var(--cyan); font-size: .74rem; font-weight: 800; }
.messages { display: grid; gap: 14px; }
.message { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: end; }
.message img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.message small { color: var(--muted); font-size: .72rem; }
.message p { width: fit-content; max-width: 92%; margin: 4px 0 0; padding: 11px 14px; border-radius: 6px 16px 16px; background: var(--panel-2); line-height: 1.5; }
.message.owner { direction: rtl; }
.message.owner > * { direction: ltr; }
.message.owner p { margin-left: auto; border-radius: 16px 6px 16px 16px; background: #27483f; }
.audio-card { display: grid; gap: 12px; margin-top: 20px; padding: 16px; }
.skill-banner { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; margin-bottom: 16px; padding: 11px; border: 1px solid rgba(105,212,208,.35); border-radius: 15px; background: linear-gradient(120deg,rgba(105,212,208,.12),rgba(20,37,50,.7)); }
.skill-banner img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.skill-banner div { display: grid; gap: 3px; }
.skill-banner span { color: var(--cyan); font-size: .7rem; font-weight: 850; letter-spacing: .08em; }
.waveform { display: flex; height: 74px; align-items: center; justify-content: center; gap: 4px; margin: 14px 0; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #09141d; }
.waveform i { width: 4px; border-radius: 99px; background: linear-gradient(var(--cyan),var(--red)); opacity: .85; }
.audio-card > div { display: flex; align-items: center; gap: 10px; }
.audio-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--cyan); color: #071018; }
audio { width: 100%; }
details { color: var(--muted); font-size: .86rem; }
details summary { min-height: 44px; cursor: pointer; color: var(--text); }
details p { line-height: 1.65; }
.collect, .primary, .secondary, .danger {
  width: 100%; border-radius: 14px; padding: 12px 16px; font-weight: 850;
}
.collect { margin-top: 14px; border: 1px solid rgba(105,212,208,.35); background: rgba(105,212,208,.1); color: var(--cyan); }
.collect.done { color: var(--green); }
.primary { background: linear-gradient(135deg,var(--red),#f27d52); color: white; box-shadow: 0 12px 30px rgba(239,94,83,.2); }
.secondary { border: 1px solid var(--line); background: var(--panel-2); }
.danger { margin-top: 20px; border: 1px solid rgba(239,94,83,.4); background: rgba(239,94,83,.1); color: #ff8b84; }
.actions { display: grid; grid-template-columns: auto minmax(150px,1fr); gap: 10px; margin-top: 24px; }
.actions .primary:only-child { grid-column: 1/-1; }
.investigation-image, .wide-art { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; }
.investigation-image img, .wide-art img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hotspot {
  position: absolute; width: 48px; min-height: 48px; transform: translate(-50%,-50%); border: 2px solid white;
  border-radius: 50%; background: rgba(239,94,83,.86); box-shadow: 0 0 0 8px rgba(239,94,83,.18); font-size: 1.4rem; font-weight: 900;
}
.hotspot.found { background: var(--green); }
.caption { margin: 12px 0; padding: 14px; font-style: italic; color: #dbe8e3; }
.found-list { display: flex; flex-wrap: wrap; gap: 8px; }
.found-list span { padding: 7px 10px; border: 1px dashed var(--line); border-radius: 999px; color: #64777b; font-size: .77rem; }
.found-list span.found { border-style: solid; border-color: rgba(120,184,146,.35); color: var(--green); }
.fact-list { overflow: hidden; }
.fact-list p { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: ui-monospace,monospace; font-size: .83rem; }
.fact-list p:last-child { border: 0; }
.puzzle { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; border: 0; }
.puzzle legend { margin-bottom: 12px; font-weight: 850; }
.puzzle button, .order-options button {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--panel-2); text-align: left;
}
.puzzle button:hover, .order-options button:hover { border-color: var(--cyan); }
.resolved { margin-top: 14px; padding: 13px; border-color: rgba(120,184,146,.4); color: var(--green); font-weight: 800; }
.deductions { display: grid; gap: 10px; margin-top: 18px; }
.deductions article { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.deductions article > span { color: var(--yellow); font: 800 .7rem ui-monospace,monospace; }
.deductions article small { color: var(--muted); }
.deductions article.ready { border-color: rgba(244,202,88,.45); box-shadow: inset 3px 0 var(--yellow); }
.deductions article.done { border-color: rgba(120,184,146,.35); box-shadow: inset 3px 0 var(--green); }
.deductions article.locked { opacity: .55; }
.deductions button { margin-top: 5px; border-radius: 10px; background: var(--yellow); color: #17160e; font-weight: 850; }
.order-puzzle { display: grid; gap: 12px; margin-top: 16px; }
.order-track { display: flex; min-height: 52px; flex-wrap: wrap; gap: 7px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.order-track span { padding: 7px 9px; border-radius: 9px; background: #243846; font-size: .78rem; }
.order-track small { color: var(--muted); }
.order-options { display: grid; gap: 8px; }
.order-options button { display: grid; gap: 4px; }
.order-options button small { color: var(--muted); font-size: .72rem; }
.branch-choices { display: grid; gap: 12px; margin-top: 18px; }
.branch-choices button { display: grid; gap: 6px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); text-align: left; }
.branch-choices button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.branch-choices span { color: var(--cyan); font-size: .7rem; font-weight: 850; letter-spacing: .08em; }
.branch-choices small { color: var(--muted); }
.branch-choices em { color: var(--yellow); font-size: .72rem; font-style: normal; }
.files { display: grid; gap: 12px; margin-top: 18px; }
.files article { padding: 16px; }
.files article span { color: var(--cyan); font: 800 .68rem ui-monospace,monospace; }
.files article strong { display: block; margin: 5px 0 10px; }
.files article p { margin: 0; color: #cbd9d8; line-height: 1.6; }
.hint { margin-top: 16px; padding: 15px; border-color: rgba(244,202,88,.34); }
.hint strong { color: var(--yellow); }
.hint p { margin: 5px 0 0; color: #dfd8bc; }
.ending-choices { display: grid; gap: 10px; margin-top: 22px; }
.ending-choices button { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); text-align: left; }
.ending-choices button:not(:disabled):hover { border-color: var(--red); transform: translateY(-1px); }
.ending-choices span { color: var(--cyan); font-size: .7rem; font-weight: 800; }
.ending-choices strong { font-size: 1rem; }
.ending-choices small { color: var(--muted); }
.rail { position: sticky; top: 24px; height: fit-content; max-height: calc(100dvh - 48px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10,22,31,.78); }
.rail h2 { margin: 6px 0 18px; }
.cast-rail article, .evidence-rail article { display: grid; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cast-rail article { grid-template-columns: 48px 1fr; }
.cast-rail img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.cast-rail article div { display: grid; }
.cast-rail small, .evidence-rail small { color: var(--muted); font-size: .7rem; }
.cast-rail em { margin-top: 3px; color: var(--green); font-size: .66rem; font-style: normal; }
.evidence-rail article { grid-template-columns: 22px 1fr; }
.evidence-rail article > span { color: var(--yellow); }
.evidence-rail article div { display: grid; }
.mini-progress { height: 5px; margin-bottom: 14px; overflow: hidden; border-radius: 99px; background: var(--panel-2); }
.rail-stats { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: .72rem; }
.empty { color: var(--muted); }
.ready-note { padding: 10px; border-radius: 10px; background: rgba(244,202,88,.1); color: var(--yellow); font-size: .8rem; }
.mobile-nav { display: none; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.75); backdrop-filter: blur(7px); }
.modal { position: relative; width: min(620px,100%); max-height: 88dvh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: #0b1822; box-shadow: var(--shadow); }
.modal-close { position: sticky; z-index: 2; top: 0; float: right; width: 46px; border-radius: 50%; background: var(--panel-2); font-size: 1.4rem; }
.modal-cast, .evidence-list { display: grid; gap: 10px; clear: both; }
.modal-cast article, .evidence-list article { display: grid; grid-template-columns: 72px 1fr; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 15px; }
.modal-cast img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; }
.modal-cast p, .evidence-list p { margin: 3px 0; color: var(--muted); font-size: .82rem; }
.evidence-list article { grid-template-columns: 30px 1fr; opacity: .45; }
.evidence-list article.found { opacity: 1; }
.start { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px,580px) minmax(320px,520px); align-items: center; justify-content: center; gap: clamp(20px,5vw,80px); padding: 30px; overflow: hidden; }
.start-art { position: relative; min-height: 660px; }
.start-art img { position: absolute; width: 60%; aspect-ratio: 3/4; object-fit: cover; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.start-art img:nth-child(1) { z-index: 3; left: 20%; top: 10%; }
.start-art img:nth-child(2) { z-index: 2; left: 0; top: 24%; transform: rotate(-7deg); }
.start-art img:nth-child(3) { z-index: 1; right: 0; top: 24%; transform: rotate(7deg); }
.start-card { padding: clamp(24px,5vw,48px); border: 1px solid var(--line); border-radius: 28px; background: rgba(14,26,36,.9); box-shadow: var(--shadow); }
.start-card h1 { margin: 10px 0 18px; font-size: clamp(2.4rem,7vw,4.8rem); line-height: .94; letter-spacing: -.07em; }
.start-card h1 em { color: var(--red); font-style: normal; }
.start-card > p { color: #c6d3d2; font-size: 1.05rem; }
.start-card ul { padding-left: 1.2em; color: var(--muted); line-height: 1.8; }
.warning { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .8rem; }
.warning strong { color: var(--yellow); }
.start-card > small { display: block; margin-top: 12px; color: var(--muted); text-align: center; }
.ending { min-height: 100dvh; background: #08131b; }
.ending-hero {
  position: relative; isolation: isolate; display: flex; min-height: clamp(520px,72dvh,820px);
  align-items: flex-end; overflow: hidden; background: #03080c;
}
.ending-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ending-hero-shade {
  position: absolute; z-index: -1; inset: 0;
  background:
    linear-gradient(90deg,rgba(3,8,12,.9) 0%,rgba(3,8,12,.35) 52%,rgba(3,8,12,.12) 78%),
    linear-gradient(0deg,#08131b 0%,rgba(8,19,27,.55) 30%,transparent 68%);
}
.ending-title { width: min(1240px,calc(100% - 48px)); margin: 0 auto; padding-bottom: clamp(42px,7vw,88px); }
.ending-title h1 {
  max-width: 850px; margin: 10px 0 18px; font-size: clamp(3rem,8vw,7.2rem);
  line-height: .92; letter-spacing: -.065em; text-shadow: 0 8px 40px #000;
}
.ending-title > p {
  max-width: 720px; margin: 0; color: rgba(247,249,246,.9); font-family: Georgia,"Noto Serif KR",serif;
  font-size: clamp(1.05rem,2.2vw,1.45rem); line-height: 1.6; text-shadow: 0 4px 24px #000;
}
.ending-card {
  display: grid; grid-template-columns: minmax(280px,.72fr) minmax(520px,1.28fr); gap: clamp(28px,5vw,72px);
  width: min(1240px,calc(100% - 48px)); margin: 0 auto; padding: clamp(48px,7vw,96px) 0;
}
.ending-card h2 { margin: 7px 0 20px; font-size: clamp(1.65rem,3vw,2.35rem); }
.ending-card p { color: #c8d5d3; line-height: 1.75; }
.ending-story { position: sticky; top: 36px; align-self: start; }
.ending-aftermath { margin: 26px 0; padding: 18px; border: 1px solid var(--line); background: rgba(5,15,22,.68); }
.ending-aftermath small { color: var(--cyan); font: 800 .72rem ui-monospace,monospace; letter-spacing: .14em; }
.ending-aftermath p:last-child { margin-bottom: 0; }
.ending-report-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.ending-report-head span { color: var(--cyan); font: 800 .7rem ui-monospace,monospace; letter-spacing: .16em; }
.ending-report-head h2 { margin-bottom: 0; }
.ending-stats { display: flex; flex: none; gap: 8px; }
.ending-stats span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; }
.ending-stats strong { color: var(--text); }
.case-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.case-result { padding: 14px; border: 1px solid var(--line); background: rgba(5,15,22,.7); }
.case-result small { display: block; margin-bottom: 5px; color: var(--muted); font-weight: 760; }
.case-result strong { display: block; color: var(--text); line-height: 1.35; }
.case-result p { margin: 7px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.case-result.good { border-left: 3px solid #62c996; }
.case-result.warn { border-left: 3px solid var(--yellow); }
.case-result.bad { border-left: 3px solid var(--red); }
.decision-log { margin: 16px 0 22px; border: 1px solid var(--line); background: rgba(5,15,22,.7); }
.decision-log summary { padding: 14px; color: var(--text); cursor: pointer; font-weight: 800; }
.decision-log summary strong { float: right; color: var(--cyan); }
.decision-log ol { margin: 0; padding: 0 14px 14px; list-style: none; }
.decision-log li { padding: 10px 0; border-top: 1px solid var(--line); }
.decision-log li small, .decision-log li strong { display: block; }
.decision-log li small { margin-bottom: 4px; color: var(--muted); font-size: .68rem; }
.decision-log li strong { font-size: .88rem; line-height: 1.45; }
.decision-log li.good strong { color: #8bd7ae; }
.decision-log li.warn strong { color: var(--yellow); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: #162935; box-shadow: var(--shadow); font-weight: 760; text-align: center; }

@media (max-width: 1050px) {
  .layout { grid-template-columns: minmax(340px,680px); padding: 0; gap: 0; }
  .phone { border: 0; border-radius: 0; }
  .rail { display: none; }
  .mobile-nav {
    position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3,1fr);
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: rgba(7,16,24,.94); backdrop-filter: blur(18px);
  }
  .mobile-nav button { display: grid; place-items: center; gap: 1px; background: transparent; color: var(--muted); font-size: .7rem; }
  .mobile-nav span { color: var(--cyan); font-size: 1.05rem; }
  .scene { min-height: 100dvh; }
}
@media (max-width: 760px) {
  .start { grid-template-columns: 1fr; padding: 0; }
  .start-art { min-height: 350px; margin-top: -90px; }
  .start-art img { width: 50%; border-radius: 20px; }
  .start-art img:nth-child(1) { left: 25%; top: 14%; }
  .start-art img:nth-child(2), .start-art img:nth-child(3) { top: 30%; }
  .start-card { position: relative; z-index: 5; margin-top: -110px; padding: 30px 22px calc(26px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
  .ending-hero { min-height: 62dvh; }
  .ending-hero-shade {
    background: linear-gradient(0deg,#08131b 0%,rgba(8,19,27,.52) 38%,rgba(3,8,12,.08) 78%);
  }
  .ending-title { width: calc(100% - 40px); padding-bottom: 34px; }
  .ending-title h1 { font-size: clamp(2.8rem,15vw,4.7rem); }
  .ending-card {
    display: block; width: calc(100% - 40px); padding: 34px 0 calc(34px + env(safe-area-inset-bottom));
  }
  .ending-story { position: static; }
  .ending-report { margin-top: 42px; }
  .ending-report-head { display: block; }
  .ending-stats { margin-top: 14px; overflow-x: auto; }
  .case-result-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .scene { padding-inline: 16px; }
  .actions { grid-template-columns: 1fr; }
  .hotspot { width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Full-screen visual-novel shell */
.layout { display: block; min-height: 100dvh; padding: 0; }
.layout > .rail { display: none; }
.phone.vn-stage {
  position: relative; isolation: isolate; width: 100%; min-height: 100dvh; overflow: hidden;
  border: 0; border-radius: 0; background: #071018;
}
.vn-stage::before, .narration-screen::before {
  content: ""; position: absolute; z-index: -3; inset: 0;
  background-image: var(--scene-bg); background-position: center; background-size: cover;
  filter: saturate(.82) contrast(1.05); transform: scale(1.015);
  animation: scene-breathe 14s ease-in-out infinite alternate;
}
.vn-stage.time-past::before, .narration-screen.time-past::before,
.vn-dialogue-screen.time-past::before { filter: saturate(.58) sepia(.28) contrast(1.08); }
.time-past .progress span { background: var(--yellow); }
.vn-stage::after {
  content: ""; position: absolute; z-index: -2; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg,rgba(3,8,12,.38) 0%,transparent 34%,rgba(3,8,12,.35) 55%,rgba(3,8,12,.94) 100%),
    radial-gradient(circle at 50% 42%,transparent 15%,rgba(3,8,12,.26) 90%);
}
.vn-stage.pov-A::after {
  background:
    radial-gradient(ellipse at 32% 58%,rgba(244,202,88,.14),transparent 24%),
    radial-gradient(ellipse at 70% 48%,rgba(239,94,83,.11),transparent 27%),
    linear-gradient(180deg,rgba(3,8,12,.35),transparent 40%,rgba(3,8,12,.95));
}
.vn-stage.pov-B::after {
  background:
    linear-gradient(118deg,transparent 49%,rgba(105,212,208,.14) 50%,transparent 51%),
    linear-gradient(180deg,rgba(3,8,12,.35),transparent 40%,rgba(3,8,12,.95));
}
.vn-stage.pov-C::after {
  background:
    radial-gradient(circle at 50% 46%,transparent 10%,rgba(105,212,208,.12) 10.5%,transparent 11.5%,transparent 20%,rgba(105,212,208,.08) 20.5%,transparent 21.5%),
    linear-gradient(180deg,rgba(3,8,12,.35),transparent 40%,rgba(3,8,12,.95));
}
.vn-stage .topbar {
  position: absolute; top: 0; left: 0; right: 0; padding: 16px 20px;
  border: 0; background: linear-gradient(rgba(3,8,12,.72),transparent); backdrop-filter: none;
}
.vn-stage .progress { position: absolute; z-index: 11; top: 76px; left: 20px; right: 20px; height: 2px; background: rgba(255,255,255,.14); }
.vn-stage .scene {
  position: relative; z-index: 2; display: flex; min-height: 100dvh; flex-direction: column;
  justify-content: flex-end; padding: 112px clamp(18px,4vw,52px) clamp(22px,4vw,46px);
}
.pov-label {
  position: absolute; top: 96px; left: clamp(18px,4vw,52px); display: flex; max-width: min(430px,72vw);
  align-items: center; gap: 10px; padding: 8px 13px 8px 8px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; background: rgba(4,11,16,.58); box-shadow: 0 12px 40px rgba(0,0,0,.3);
  backdrop-filter: blur(14px);
}
.pov-label img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.pov-label span { display: grid; gap: 1px; min-width: 0; }
.pov-label small { color: var(--cyan); font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
.pov-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.story-panel {
  display: grid; grid-template-rows: auto minmax(0,1fr) auto; width: min(920px,100%); max-height: min(67dvh,720px);
  margin: 0 auto; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 24px;
  background: linear-gradient(145deg,rgba(8,18,26,.78),rgba(8,18,26,.94));
  box-shadow: 0 28px 90px rgba(0,0,0,.52); backdrop-filter: blur(22px) saturate(1.2);
}
.story-panel .scene-head { margin: 0; padding: 22px 24px 10px; }
.story-panel .scene-head h1 { margin: 7px 0 5px; font-size: clamp(1.7rem,4vw,2.7rem); }
.story-panel .story-scroll { min-height: 0; overflow: auto; padding: 8px 24px 22px; scrollbar-width: thin; }
.story-panel .actions { margin: 0; padding: 0 24px 22px; }
.story-panel .intro-copy, .story-panel .fact-list, .story-panel .goal,
.story-panel .audio-card, .story-panel .files article, .story-panel .caption {
  background: rgba(17,34,46,.64);
}
.story-panel .investigation-image img, .story-panel .wide-art img { max-height: 43dvh; object-fit: cover; }
.story-panel .message p { background: rgba(26,47,62,.88); }
.story-panel .message.owner p { background: rgba(40,75,63,.88); }
.mobile-nav { display: none !important; }

.cinematic-start {
  position: relative; isolation: isolate; display: flex; min-height: 100dvh; align-items: flex-end;
  justify-content: flex-start; padding: clamp(24px,6vw,72px); overflow: hidden;
}
.cinematic-start::before {
  content: ""; position: absolute; z-index: -2; inset: 0; background: var(--start-bg) center/cover;
  filter: saturate(.78) contrast(1.05); animation: scene-breathe 16s ease-in-out infinite alternate;
}
.cinematic-start::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg,rgba(3,8,12,.96) 0%,rgba(3,8,12,.64) 42%,rgba(3,8,12,.12) 72%),
    linear-gradient(0deg,rgba(3,8,12,.84),transparent 58%);
}
.cinematic-start .start-card {
  width: min(620px,100%); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.cinematic-start .start-card h1 { margin: 13px 0 18px; font-size: clamp(3.2rem,8vw,7rem); text-shadow: 0 8px 40px rgba(0,0,0,.55); }
.cinematic-start .start-card > p { max-width: 580px; color: rgba(236,243,239,.78); line-height: 1.65; }
.cinematic-start .start-card .primary { max-width: 390px; margin-top: 20px; }
.pack-intro { display: flex; gap: 8px; margin: 18px 0 4px; }
.pack-intro span {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px 6px 6px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(7,16,24,.5); backdrop-filter: blur(10px);
}
.pack-intro img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pack-intro strong { font-size: .78rem; }
.cinematic-start .start-card > small { max-width: 390px; text-align: center; }

.narration-screen {
  position: relative; isolation: isolate; display: flex; min-height: 100dvh; align-items: center; padding: clamp(24px,7vw,90px);
  overflow: hidden; background: #050b10;
}
.narration-screen::before { z-index: -2; }
.memory-sequence::before { animation: memory-camera 11s cubic-bezier(.2,.65,.25,1) both; }
.memory-sequence::after {
  content: ""; position: absolute; z-index: 5; inset: 0; pointer-events: none; opacity: .2;
  background:
    repeating-linear-gradient(0deg,transparent 0 3px,rgba(255,255,255,.025) 4px),
    radial-gradient(circle at 50% 48%,transparent 35%,rgba(0,0,0,.48) 100%);
  animation: memory-flicker 3.8s steps(1) infinite;
}
.narration-shade {
  position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg,rgba(3,8,12,.96),rgba(3,8,12,.7) 48%,rgba(3,8,12,.2)),
    linear-gradient(0deg,rgba(3,8,12,.75),transparent 60%);
}
.memory-caption {
  position: absolute; top: clamp(22px,4vw,48px); left: clamp(24px,7vw,90px); display: flex;
  gap: 10px; color: rgba(236,243,239,.58); font: 850 .62rem ui-monospace,monospace; letter-spacing: .16em;
}
.memory-caption span { color: var(--yellow); }
.narration-copy { width: min(760px,100%); }
.narration-copy > span { color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .18em; }
.prologue-screen .narration-copy h1 {
  max-width: 720px; margin: 14px 0 0; font-size: clamp(2.1rem,6vw,4.8rem);
  line-height: 1; letter-spacing: -.05em; text-shadow: 0 6px 32px #000;
}
.narration-copy p {
  margin: 18px 0 0; color: rgba(247,248,242,.94); font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(1.4rem,4vw,2.65rem); line-height: 1.48; text-shadow: 0 4px 28px rgba(0,0,0,.9);
  animation: narration-in .8s both;
}
.narration-copy p:nth-of-type(2) { animation-delay: .18s; }
.narration-next {
  display: flex; min-width: 170px; align-items: center; justify-content: space-between; gap: 28px;
  margin-top: 36px; padding: 12px 18px; border: 1px solid rgba(255,255,255,.26); border-radius: 999px;
  background: rgba(7,16,24,.44); backdrop-filter: blur(14px); font-weight: 850;
}
.narration-next b { color: var(--cyan); font-size: 1.2rem; }
.memory-sequence.is-leaving { pointer-events: none; }
.memory-sequence.is-leaving .narration-copy,
.memory-sequence.is-leaving .memory-caption,
.memory-sequence.is-leaving .sound-toggle {
  opacity: 0; transform: translateY(-8px); transition: opacity .28s ease, transform .28s ease;
}
.memory-sequence.is-leaving::after {
  opacity: 1; background: #03080c; animation: memory-close .62s cubic-bezier(.6,0,.8,1) both;
}
.prologue-progress { display: flex; gap: 7px; margin-top: 28px; }
.prologue-progress i {
  width: 28px; height: 3px; background: rgba(255,255,255,.22); transition: background .2s;
}
.prologue-progress i.active { background: var(--cyan); }

@keyframes scene-breathe { from { transform: scale(1.015); } to { transform: scale(1.06); } }
@keyframes narration-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes memory-camera {
  from { transform: scale(1.02) translate3d(-.8%,.4%,0); filter: saturate(.48) sepia(.22) contrast(1.08); }
  to { transform: scale(1.1) translate3d(1.2%,-.8%,0); filter: saturate(.8) sepia(.08) contrast(1.04); }
}
@keyframes memory-flicker { 0%,91%,100% { opacity: .2; } 92% { opacity: .34; } 94% { opacity: .16; } }
@keyframes memory-close { from { clip-path: inset(50% 0); } to { clip-path: inset(0); } }
@keyframes memory-return { from { opacity: 0; transform: scale(1.008); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .vn-stage .topbar { padding: 12px 14px; }
  .vn-stage .progress { top: 69px; left: 14px; right: 14px; }
  .vn-stage .scene { padding: 100px 12px 14px; }
  .pov-label { top: 84px; left: 14px; }
  .pov-label img { width: 36px; height: 36px; }
  .story-panel { max-height: 69dvh; border-radius: 20px; }
  .story-panel .scene-head { padding: 18px 17px 8px; }
  .story-panel .story-scroll { padding: 8px 17px 18px; }
  .story-panel .actions { padding: 0 17px 17px; }
  .cinematic-start { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
  .cinematic-start::after {
    background: linear-gradient(0deg,rgba(3,8,12,.98) 0%,rgba(3,8,12,.7) 53%,rgba(3,8,12,.1) 88%);
  }
  .cinematic-start .start-card { margin: 0; }
  .cinematic-start .start-card h1 { font-size: clamp(3rem,17vw,5rem); }
  .pack-intro strong { display: none; }
  .narration-screen { align-items: flex-end; padding: 26px 20px calc(38px + env(safe-area-inset-bottom)); }
  .narration-shade { background: linear-gradient(0deg,rgba(3,8,12,.98),rgba(3,8,12,.62) 58%,rgba(3,8,12,.14)); }
  .narration-copy p { font-size: clamp(1.35rem,7vw,2rem); }
  .prologue-screen .narration-copy h1 { font-size: clamp(2rem,12vw,3.4rem); }
}

/* Diegetic game HUD */
.vn-stage .topbar {
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); min-height: 76px;
  padding: 9px clamp(18px,3vw,42px);
  text-shadow: 0 2px 12px rgba(0,0,0,.9);
}
.vn-stage .topbar > :first-child { justify-self: start; }
.vn-stage .topbar .case-title { justify-self: center; }
.vn-stage .topbar-actions {
  display: flex; justify-self: end; align-items: center; justify-content: flex-end; gap: 14px;
}
.vn-stage .topbar .sound-toggle {
  position: static; min-height: 34px; padding: 5px 8px; white-space: nowrap;
}
.vn-stage .icon-btn {
  width: auto; min-height: 34px; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: rgba(236,243,239,.78); font: 850 .62rem ui-monospace,monospace; letter-spacing: .16em;
}
.vn-stage .icon-btn:first-child { text-align: left; }
.vn-stage .icon-btn:last-child { text-align: right; }
.vn-stage .hud-deduction {
  display: flex; width: auto; justify-self: start;
  min-height: 58px; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  border: 1px solid rgba(105,212,208,.72); border-radius: 999px;
  background: rgba(3,13,19,.86); color: var(--cyan); box-shadow: 0 0 32px rgba(105,212,208,.22);
  backdrop-filter: blur(14px); text-align: left;
}
.deduction-avatar { position: relative; display: block; width: 44px; height: 44px; flex: none; }
.deduction-avatar img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 18%;
}
.deduction-avatar b {
  position: absolute; top: -8px; right: -8px; display: grid; width: 24px; height: 24px; place-items: center;
  border: 2px solid #071018; border-radius: 50%; background: var(--yellow); color: #071018;
  font: 950 1rem ui-sans-serif,sans-serif; animation: deduction-prompt 1.2s ease-in-out infinite;
}
.deduction-copy { display: grid; gap: 1px; padding-right: 3px; }
.deduction-copy small { color: rgba(236,243,239,.58); font: 850 .54rem ui-monospace,monospace; letter-spacing: .12em; }
.deduction-copy strong { color: var(--text); font-size: .86rem; letter-spacing: -.02em; white-space: nowrap; }
@keyframes deduction-prompt { 50% { transform: translateY(-3px) rotate(5deg); } }
.vn-stage .progress { left: clamp(18px,3vw,42px); right: clamp(18px,3vw,42px); }
.vn-stage .scene { padding-inline: 0; padding-bottom: 0; }
.pov-label {
  top: 92px; left: clamp(18px,3vw,42px); gap: 0; padding: 0 0 0 13px;
  border: 0; border-left: 2px solid var(--cyan); border-radius: 0; background: transparent;
  box-shadow: none; backdrop-filter: none; text-shadow: 0 2px 14px #000;
}
.pov-label img { display: none; }
.pov-label small { font-size: .58rem; }
.pov-label strong { font-size: .72rem; font-weight: 700; }
.story-panel {
  width: 100%; max-height: 50dvh; margin: 0; border: 0; border-radius: 0;
  background: linear-gradient(0deg,rgba(3,8,12,.98) 0%,rgba(3,8,12,.87) 68%,rgba(3,8,12,.28) 92%,transparent 100%);
  box-shadow: none; backdrop-filter: none;
}
.story-panel .scene-head, .story-panel .story-scroll, .story-panel .actions {
  width: min(980px,calc(100% - 40px)); margin-inline: auto;
}
.story-panel .scene-head { padding: 42px 0 8px; }
.story-panel .scene-head > span { color: rgba(236,243,239,.64); }
.story-panel .scene-head h1 { max-width: 820px; font-size: clamp(1.8rem,3.8vw,3.2rem); text-shadow: 0 4px 22px #000; }
.story-panel .scene-head p { max-width: 760px; color: rgba(236,243,239,.68); }
.story-panel .story-scroll { padding: 8px 0 20px; }
.story-panel .actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 0 24px; }
.story-panel .actions .primary, .story-panel .actions .secondary { width: auto; min-width: 190px; }
.story-panel .primary {
  border: 1px solid rgba(255,255,255,.38); border-radius: 3px; background: rgba(236,243,239,.92);
  color: #071018; box-shadow: none;
}
.story-panel .primary.leave-search {
  border-color: rgba(244,202,88,.58); background: rgba(7,16,24,.64); color: var(--yellow);
}
.story-panel .secondary {
  border: 1px solid rgba(255,255,255,.26); border-radius: 3px; background: rgba(7,16,24,.48);
}
.story-panel .intro-copy, .story-panel .fact-list, .story-panel .goal,
.story-panel .audio-card, .story-panel .files article, .story-panel .caption,
.story-panel .skill-banner, .story-panel .deductions article {
  border-color: rgba(255,255,255,.12); border-radius: 2px; background: transparent; box-shadow: none;
}
.story-panel .intro-copy { padding: 0; border: 0; }
.story-panel .intro-copy p { color: rgba(236,243,239,.82); }
.story-panel .goal { border-width: 0 0 0 2px; padding: 7px 13px; }
.story-panel .skill-banner { grid-template-columns: 1fr; padding: 6px 0 10px; border-width: 0 0 1px; }
.story-panel .skill-banner img { display: none; }
.story-panel .audio-card { margin-top: 8px; padding: 11px 0; border-width: 1px 0; }
.story-panel .fact-list p { padding-inline: 0; }
.story-panel .message { grid-template-columns: 1fr; gap: 2px; padding-left: 14px; border-left: 2px solid rgba(105,212,208,.38); }
.story-panel .message img { display: none; }
.story-panel .message p, .story-panel .message.owner p {
  max-width: 760px; margin: 2px 0 0; padding: 0; border-radius: 0; background: transparent;
}
.story-panel .message.owner { direction: ltr; border-left-color: rgba(244,202,88,.5); }
.story-panel .messages { gap: 12px; }
.story-panel .puzzle button, .story-panel .order-options button,
.story-panel .branch-choices button, .story-panel .ending-choices button {
  position: relative; border: 0; border-bottom: 1px solid rgba(255,255,255,.14); border-radius: 0;
  background: rgba(7,16,24,.2); transition: background .18s,border-color .18s,padding-left .18s;
}
.story-panel .puzzle button:hover, .story-panel .order-options button:hover,
.story-panel .branch-choices button:hover, .story-panel .ending-choices button:not(:disabled):hover {
  padding-left: 20px; border-color: var(--cyan); background: rgba(105,212,208,.08); transform: none;
}
.story-panel .branch-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
.story-panel .branch-choices button { border: 1px solid rgba(255,255,255,.14); padding: 18px; }
.story-panel .deductions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.story-panel .deductions article { border-width: 0 0 0 2px; }
.scene-image .story-panel { max-height: 31dvh; }
.scene-image .story-panel .scene-head { display: none; }
.scene-image .story-panel .story-scroll { padding-top: 20px; }
.scene-image .skill-banner { display: none; }
.world-hotspots {
  position: fixed; z-index: 7; inset: 0; pointer-events: none;
}
.world-hotspots .hotspot {
  width: 52px; min-height: 52px; padding: 0; transform: translate(-50%,-50%);
  border: 0; background: transparent; box-shadow: none; opacity: 0;
  pointer-events: auto; cursor: crosshair; animation: none;
}
.world-hotspots .hotspot::before, .world-hotspots .hotspot span { display: none; }
.world-hotspots .hotspot:focus-visible { opacity: 1; outline: 2px solid var(--cyan); outline-offset: 2px; }
.mobile-investigation-open, .place-search-open {
  display: block; width: 100%; min-height: 48px; margin: 10px 0; border: 1px solid rgba(105,212,208,.55);
  border-radius: 3px; background: rgba(105,212,208,.1); color: var(--cyan); font-weight: 850;
}
.image-next { margin: 10px 0; }
.place-search-open { margin: 12px 0 4px; }
.mobile-investigation {
  position: fixed; z-index: 80; inset: 0; display: grid; grid-template-rows: auto 1fr auto;
  background: #03080c;
}
.investigation-active > .topbar,
.investigation-active > .sound-toggle,
.investigation-active > .progress,
.investigation-active .pov-label { display: none; }
.mobile-investigation > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid rgba(255,255,255,.14);
}
.mobile-investigation > header div { display: grid; }
.mobile-investigation > header span { color: var(--cyan); font: 900 .58rem ui-monospace,monospace; letter-spacing: .14em; }
.mobile-investigation > header strong { margin-top: 3px; font-size: .9rem; }
.mobile-investigation > header button {
  min-width: 58px; min-height: 42px; border: 1px solid rgba(255,255,255,.24); border-radius: 3px; background: transparent;
}
.mobile-investigation-stage {
  position: relative; align-self: center; justify-self: center;
  width: min(100vw,calc((100dvh - 146px) * 1.7778)); aspect-ratio: 16/9; overflow: hidden;
  background: #000; touch-action: pinch-zoom;
}
.mobile-investigation-stage img { width: 100%; height: 100%; object-fit: contain; }
.object-hotspot {
  position: absolute; min-width: 44px; min-height: 44px; padding: 0; border: 0;
  background: transparent; opacity: 0; cursor: crosshair;
}
.object-hotspot span { display: none; }
.object-hotspot:focus-visible { opacity: 1; outline: 2px solid var(--cyan); outline-offset: -2px; }
.mobile-investigation > footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.14); color: var(--muted); font-size: .72rem;
}
.mobile-investigation > footer strong { flex: none; color: var(--green); }
.mobile-investigation > footer button {
  flex: none; min-height: 40px; padding: 0 14px; border: 1px solid var(--cyan);
  background: rgba(105,212,208,.1); color: var(--cyan); font-weight: 850;
}
.found-list { gap: 6px; }
.search-instruction {
  margin: 8px 0 10px; color: rgba(236,243,239,.78); font-size: .8rem; font-weight: 750;
}
.found-list span { border-radius: 2px; }
.found-list button {
  min-height: 36px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 2px;
  background: rgba(7,16,24,.26); color: rgba(236,243,239,.6); font-size: .72rem;
}
.found-list button.found { border-color: rgba(120,184,146,.5); color: var(--green); }
.evidence-list article.missed { opacity: 1; border-color: rgba(239,94,83,.42); }
.evidence-list article.missed > span { color: var(--red); }
.branch-choices button:disabled { opacity: .46; }
.branch-choices button:disabled em { color: var(--red); }
.scene-hub .story-panel { max-height: 78dvh; }
.scene-hub .story-panel .scene-head { padding-top: 28px; }
.hub-thought {
  margin-bottom: 16px; padding: 12px 15px; border-left: 2px solid var(--cyan);
  background: rgba(7,16,24,.46);
}
.hub-thought span { color: var(--cyan); font-size: .65rem; font-weight: 900; letter-spacing: .13em; }
.hub-thought p { margin: 5px 0 0; color: rgba(236,243,239,.86); line-height: 1.55; }
.hub-objective {
  display: flex; gap: 9px; margin: 0 0 8px; color: rgba(236,243,239,.82);
  font-size: .78rem; line-height: 1.5;
}
.hub-objective span { color: var(--yellow); font: 900 .62rem ui-monospace,monospace; letter-spacing: .12em; }
.hub-position { margin: 0; color: var(--muted); font-size: .78rem; }
.hub-position span { margin-right: 7px; color: var(--yellow); font: 900 .62rem ui-monospace,monospace; letter-spacing: .12em; }
.hub-position strong { color: var(--text); }
.hub-group { margin-top: 18px; }
.hub-group > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.hub-group > header span { color: var(--cyan); font: 900 .62rem ui-monospace,monospace; letter-spacing: .14em; }
.hub-group > header h2 { margin: 0; font-size: 1rem; }
.location-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.location-grid button {
  position: relative; display: grid; min-height: 126px; align-content: end; gap: 5px; padding: 15px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 2px;
  background: linear-gradient(145deg,rgba(10,26,36,.72),rgba(4,12,18,.5)); text-align: left;
}
.location-grid button:hover { border-color: var(--cyan); background: rgba(105,212,208,.1); }
.location-grid button > span { color: var(--cyan); font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
.location-grid button strong { font-size: .95rem; }
.location-grid button small { color: var(--muted); line-height: 1.4; }
.location-grid button.unknown { border-style: dashed; filter: saturate(.45); }
.location-grid button.unknown > span { color: var(--yellow); }
.location-grid button.visited::after { content: "↻"; position: absolute; top: 10px; right: 12px; color: var(--green); }
.action-grid button { border-left: 2px solid rgba(244,202,88,.45); }
.action-grid button > span { color: var(--yellow); }
.action-empty {
  grid-column: 1 / -1; margin: 0; padding: 14px 15px; border-left: 2px solid rgba(244,202,88,.45);
  background: rgba(7,16,24,.46); color: var(--muted); font-size: .78rem;
}
.caption { border: 0 !important; padding: 0 !important; }
.sense-layer { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.sense-layer i, .sense-layer b { position: absolute; display: none; }
.pov-A .sense-layer i {
  display: block; width: 42vw; height: 2px; left: -8vw; top: 38%;
  background: linear-gradient(90deg,transparent,rgba(244,202,88,.72),transparent);
  filter: blur(2px); transform: rotate(-12deg); animation: scent-drift 5s ease-in-out infinite;
}
.pov-A .sense-layer i:nth-child(2) { top: 47%; left: 28vw; animation-delay: -1.7s; }
.pov-A .sense-layer i:nth-child(3) { top: 31%; left: 62vw; animation-delay: -3.2s; }
.pov-B .sense-layer b {
  display: block; width: 54vw; height: 30vh; left: 24vw; top: 27%;
  border: solid rgba(105,212,208,.34); border-width: 0 0 2px 2px; transform: skewX(-24deg) rotate(-5deg);
  filter: drop-shadow(0 0 8px rgba(105,212,208,.28)); animation: route-scan 3.4s ease-in-out infinite;
}
.pov-C .sense-layer i {
  display: block; width: 16vmin; height: 16vmin; left: calc(50% - 8vmin); top: 34%;
  border: 1px solid rgba(105,212,208,.55); border-radius: 50%; animation: sonar-ring 3s ease-out infinite;
}
.pov-C .sense-layer i:nth-child(2) { animation-delay: -1s; }
.pov-C .sense-layer i:nth-child(3) { animation-delay: -2s; }
@keyframes trace-pulse { 50% { box-shadow: 0 0 0 10px transparent,0 0 36px rgba(105,212,208,.65); } }
@keyframes scent-drift { 50% { transform: translate(18vw,5vh) rotate(-4deg); opacity: .35; } }
@keyframes route-scan { 50% { transform: translateX(3vw) skewX(-18deg) rotate(-3deg); opacity: .5; } }
@keyframes sonar-ring { from { transform: scale(.2); opacity: .8; } to { transform: scale(5); opacity: 0; } }

@media (max-width: 760px) {
  .vn-stage .topbar { grid-template-columns: 74px 1fr 74px; }
  .pov-label { top: 82px; }
  .story-panel { max-height: 56dvh; }
  .story-panel .scene-head, .story-panel .story-scroll, .story-panel .actions { width: calc(100% - 28px); }
  .story-panel .scene-head { padding-top: 34px; }
  .story-panel .scene-head h1 { font-size: 1.55rem; }
  .story-panel .scene-head p { font-size: .78rem; }
  .story-panel .actions { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .story-panel .actions .primary, .story-panel .actions .secondary { min-width: 0; flex: 1; }
  .story-panel .branch-choices, .story-panel .deductions { grid-template-columns: 1fr; }
  .scene-image .story-panel { max-height: 39dvh; }
  .desktop-hotspots { display: none; }
  .mobile-investigation-open {
    display: block; width: 100%; min-height: 48px; margin: 10px 0; border: 1px solid rgba(105,212,208,.55);
    border-radius: 3px; background: rgba(105,212,208,.1); color: var(--cyan); font-weight: 850;
  }
  .mobile-investigation {
    display: flex; flex-direction: column;
  }
  .investigation-active > .topbar,
  .investigation-active > .sound-toggle,
  .investigation-active > .progress,
  .investigation-active .pov-label { display: none; }
  .mobile-investigation > header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid rgba(255,255,255,.14);
  }
  .mobile-investigation > header div { display: grid; }
  .mobile-investigation > header span { color: var(--cyan); font: 900 .58rem ui-monospace,monospace; letter-spacing: .14em; }
  .mobile-investigation > header strong { margin-top: 3px; font-size: .9rem; }
  .mobile-investigation > header button {
    min-width: 58px; min-height: 42px; border: 1px solid rgba(255,255,255,.24); border-radius: 3px; background: transparent;
  }
  .mobile-investigation-stage {
    position: relative; align-self: flex-start; width: 100%; aspect-ratio: 16/9; overflow: hidden;
    background: #000; touch-action: pinch-zoom;
  }
  .mobile-investigation-stage img { width: 100%; height: 100%; object-fit: contain; }
  .mobile-investigation-stage .hotspot {
    width: 64px; min-height: 64px; border: 0; background: transparent; box-shadow: none; opacity: 0;
  }
  .mobile-investigation-stage .hotspot:focus-visible { opacity: 1; outline: 2px solid var(--cyan); }
  .mobile-investigation-stage .hotspot span { display: none; }
  .mobile-investigation > footer {
    display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); color: var(--muted); font-size: .72rem;
  }
  .mobile-investigation > footer strong { flex: none; color: var(--green); }
  .found-list { display: grid; grid-template-columns: 1fr; }
  .scene-hub .story-panel { max-height: 79dvh; }
  .location-grid { grid-template-columns: 1fr; }
  .location-grid button { min-height: 96px; }
}

/* Visual-novel dialogue */
.vn-dialogue-screen {
  position: relative; isolation: isolate; min-height: 100dvh; overflow: hidden;
  background: #03080c;
}
.vn-dialogue-screen.from-memory { animation: memory-return .72s cubic-bezier(.2,.75,.25,1) both; }
.vn-dialogue-screen::before {
  content: ""; position: absolute; z-index: -3; inset: 0;
  background: var(--scene-bg) center/cover; filter: saturate(.72) contrast(1.08);
  animation: scene-breathe 16s ease-in-out infinite alternate;
}
.vn-dialogue-shade {
  position: absolute; z-index: -2; inset: 0;
  background:
    linear-gradient(90deg,rgba(2,7,11,.18),transparent 58%,rgba(2,7,11,.42)),
    linear-gradient(0deg,rgba(2,7,11,.96) 0%,rgba(2,7,11,.2) 62%,rgba(2,7,11,.58));
}
.vn-dialogue-header {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: grid; gap: 4px;
  padding: 20px clamp(20px,4vw,54px); background: linear-gradient(rgba(2,7,11,.76),transparent);
  text-shadow: 0 3px 16px #000;
}
.vn-dialogue-header span {
  color: var(--cyan); font: 900 .62rem ui-monospace,monospace; letter-spacing: .16em;
}
.vn-dialogue-header strong { font-size: clamp(.9rem,2vw,1.15rem); }
.vn-speaker {
  position: absolute; z-index: -1; inset: 8dvh 4vw 17dvh 36vw; display: grid; align-items: end;
  justify-items: center; overflow: hidden; pointer-events: none;
}
.vn-speaker img {
  width: min(52vw,680px); height: 100%; object-fit: cover; object-position: center 22%;
  border-radius: 4px; filter: drop-shadow(0 26px 42px rgba(0,0,0,.65));
  mask-image: linear-gradient(#000 78%,transparent 100%);
}
.vn-dialogue-box {
  position: absolute; z-index: 4; left: 50%; bottom: max(24px,env(safe-area-inset-bottom));
  width: min(980px,calc(100% - 40px)); min-height: 180px; padding: 28px 34px;
  transform: translateX(-50%); border: 1px solid rgba(255,255,255,.26); border-radius: 3px;
  background: linear-gradient(145deg,rgba(5,13,19,.88),rgba(5,13,19,.98));
  box-shadow: 0 28px 90px rgba(0,0,0,.62); backdrop-filter: blur(18px); text-align: left;
}
.vn-dialogue-box::after {
  content: "›"; position: absolute; right: 24px; bottom: 18px; color: var(--cyan);
  font-size: 1.55rem; animation: dialogue-pulse 1.1s ease-in-out infinite;
}
.vn-speaker-name {
  position: absolute; left: -1px; top: -43px; display: flex; min-height: 43px;
  align-items: center; gap: 10px; padding: 9px 18px; border: 1px solid rgba(255,255,255,.26);
  border-bottom: 0; background: rgba(5,13,19,.96); color: var(--cyan);
  font-size: 1rem; font-weight: 900;
}
.vn-speaker-name em {
  color: rgba(236,243,239,.54); font: 700 .65rem ui-monospace,monospace;
  letter-spacing: .1em; font-style: normal;
}
.vn-dialogue-box p {
  max-width: 820px; margin: 2px 0 24px; color: rgba(247,249,246,.96);
  font-family: Georgia,"Noto Serif KR",serif; font-size: clamp(1.15rem,2.4vw,1.55rem);
  line-height: 1.62; word-break: keep-all;
}
.vn-dialogue-box small { color: rgba(236,243,239,.45); font-size: .68rem; letter-spacing: .06em; }
.reaction-dialogue .vn-dialogue-header span::after { content: " · 현장 반응"; color: var(--yellow); }
.reaction-dialogue .vn-dialogue-box { min-height: 150px; }
.time-past .vn-dialogue-header span, .time-past .vn-speaker-name { color: var(--yellow); }
@keyframes dialogue-pulse { 50% { transform: translateX(5px); opacity: .45; } }

@media (min-width: 761px) {
  .vn-dialogue-screen .vn-speaker {
    inset: 8dvh auto 247px max(20px,calc(50% - 490px));
    width: min(230px,15vw); justify-items: start;
  }
  .vn-dialogue-screen .vn-speaker img {
    width: 100%; object-fit: contain; object-position: left bottom;
  }
}

@media (max-width: 760px) {
  .vn-stage .topbar {
    grid-template-columns: auto minmax(0,1fr) auto; min-height: 70px; padding: 8px 12px;
  }
  .vn-stage .topbar.has-deduction .case-title { visibility: hidden; }
  .vn-stage .topbar-actions { gap: 8px; }
  .vn-stage .topbar .sound-toggle { font-size: .52rem; letter-spacing: .06em; }
  .vn-stage .progress { top: 70px; left: 12px; right: 12px; }
  .vn-stage .hud-deduction { min-height: 52px; padding-right: 11px; }
  .deduction-avatar, .deduction-avatar img { width: 40px; height: 40px; }
  .deduction-copy strong { font-size: .8rem; }
  .vn-dialogue-header { padding: 16px 18px; }
  .vn-speaker { inset: 10dvh auto 275px 12px; width: 44vw; justify-items: start; }
  .vn-speaker img { width: 100%; object-fit: contain; object-position: left bottom; opacity: .88; }
  .vn-dialogue-box {
    bottom: max(12px,env(safe-area-inset-bottom)); width: calc(100% - 24px); min-height: 220px;
    padding: 22px 20px 24px;
  }
  .vn-dialogue-box p { margin: 13px 0 24px; font-size: 1.08rem; line-height: 1.58; }
  .vn-speaker-name { font-size: .92rem; }
}
