:root {
  color-scheme: only dark;
  color: #e7eeed;
  background: #080c10;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #e7eeed;
  --muted: #829196;
  --panel: rgba(8, 14, 18, 0.94);
  --panel-soft: rgba(13, 21, 26, 0.92);
  --line: rgba(139, 173, 174, 0.22);
  --mint: #9adbd2;
  --mint-dark: #285c58;
  --danger: #d44e57;
  --amber: #d3b26c;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #e7eeed;
  background-color: #080c10;
}

body {
  color: #e7eeed;
  background: #080c10;
}

button,
input,
select,
textarea,
output {
  font: inherit;
  color: #e7eeed;
  color-scheme: only dark;
  -webkit-text-fill-color: currentColor;
}

button { font: inherit; }
button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  /* Dialogue and investigation use full-screen tap targets; native feedback flashes the whole screen. */
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  forced-color-adjust: none;
  background:
    radial-gradient(circle at 50% 28%, rgba(50, 77, 80, 0.15), transparent 42%),
    #080c10;
}

.game-header {
  position: absolute;
  z-index: 40;
  inset: 0 0 auto 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 26px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5, 9, 12, 0.98), rgba(6, 11, 14, 0.87));
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #527f7b;
  color: var(--mint);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  transform: rotate(45deg);
}
.brand-mark::first-line { transform: rotate(-45deg); }
.brand div { display: flex; flex-direction: column; }
.brand strong { font-family: "Nanum Myeongjo", "Batang", serif; font-size: 19px; letter-spacing: .12em; }
.brand div span { color: #607075; font-size: 8px; letter-spacing: .22em; }

.header-actions { justify-self: end; display: flex; gap: 8px; }
.header-actions button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #9cacb0;
  background: rgba(19, 29, 34, 0.72);
  cursor: pointer;
  font-size: 11px;
}
.header-actions button:hover, .header-actions button.is-active { border-color: #6ca49e; color: #d9f3ef; background: rgba(35, 75, 71, 0.42); }

.game-stage { position: absolute; inset: 72px 0 76px; overflow: hidden; }
.room-canvas-viewport { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: contain; }
.room-canvas { width: 100%; height: 100%; }
.room-canvas canvas {
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

.scan-status {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-left: 2px solid #5b9992;
  color: #73878b;
  background: rgba(4, 9, 12, 0.64);
  pointer-events: none;
}
.scan-status span { font-size: 9px; letter-spacing: .18em; }
.scan-status strong { color: #b6cac7; font-size: 12px; }

.room-view-edge-nav { position: absolute; z-index: 8; inset: 0; pointer-events: none; }
.room-view-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 92px;
  border: 1px solid rgba(122, 169, 165, .24);
  color: #a2bfbc;
  background: linear-gradient(90deg, rgba(5, 12, 15, .92), rgba(11, 25, 28, .5));
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  cursor: pointer;
  font-size: 34px;
  transform: translateY(-50%);
  pointer-events: auto;
  backdrop-filter: blur(5px);
}
.room-view-arrow--left { left: 0; border-left: 0; border-radius: 0 6px 6px 0; }
.room-view-arrow--right { right: 0; border-right: 0; border-radius: 6px 0 0 6px; background: linear-gradient(270deg, rgba(5, 12, 15, .92), rgba(11, 25, 28, .5)); }
.room-view-arrow:hover { color: #ecfffc; border-color: rgba(132, 201, 194, .6); }
.room-view-arrow:disabled { opacity: .2; cursor: default; }
.closeup-back-button {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 16px 10px;
  border: 1px solid rgba(122, 169, 165, .34);
  border-radius: 4px;
  color: #b9cfcc;
  background: rgba(5, 12, 15, .91);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  cursor: pointer;
  font-size: 11px;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}
.closeup-back-button > .game-icon { width: 25px; height: 25px; color: var(--mint); }
.closeup-back-button:hover { color: #effdfa; border-color: rgba(132, 201, 194, .68); }
.closeup-back-button:disabled { opacity: .24; cursor: default; }
.room-entry-title {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 34px 16px;
  border-top: 1px solid rgba(139, 190, 185, .38);
  border-bottom: 1px solid rgba(139, 190, 185, .18);
  color: #dbe7e5;
  background: linear-gradient(90deg, transparent, rgba(4,10,13,.78) 20% 80%, transparent);
  transform: translate(-50%, -50%);
  animation: room-entry-title 2.4s ease both;
  pointer-events: none;
}
.room-entry-title span { color: #728784; font-size: 9px; letter-spacing: .2em; white-space: nowrap; }
.room-entry-title strong { margin-top: 5px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 25px; font-weight: 400; letter-spacing: .13em; white-space: nowrap; }
@keyframes room-entry-title { 0% { opacity: 0; transform: translate(-50%, -42%); } 14%, 72% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -57%); } }

.inspection-panel {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 16px;
  width: min(780px, calc(100% - 40px));
  max-height: min(50vh, 330px);
  min-height: 172px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  padding: 22px 60px 20px 24px;
  border: 1px solid rgba(126, 171, 168, 0.32);
  border-left: 3px solid #6ea9a3;
  background:
    linear-gradient(110deg, rgba(17, 30, 35, 0.98), rgba(5, 10, 13, 0.97)),
    var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  animation: panel-in .18s ease-out;
  overflow-y: auto;
}

@keyframes panel-in { from { opacity: 0; transform: translate(-50%, 12px); } }

.panel-close, .icon-button {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  color: #829397;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}
.panel-close:hover, .icon-button:hover { color: #eef8f6; }
.inspection-symbol {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-top: 5px;
  border: 1px solid #527d79;
  color: var(--mint);
  font-size: 27px;
  background: rgba(70, 116, 111, 0.1);
}
.eyebrow { display: block; margin-bottom: 3px; color: #638c88; font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.inspection-copy h2 { margin: 0 0 6px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 21px; }
.inspection-copy p { margin: 0; color: #bdc8c7; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 15px; line-height: 1.65; }
.protagonist-thought {
  position: relative;
  margin: 10px 0 0;
  padding: 9px 13px 9px 16px;
  border-left: 2px solid #526f6e;
  color: #879998;
  background: rgba(94, 126, 124, .06);
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.6;
}
.protagonist-thought::before { content: "P-00"; margin-right: 9px; color: #5e8380; font-family: monospace; font-size: 8px; font-style: normal; letter-spacing: .12em; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.action-button {
  padding: 9px 14px;
  border: 1px solid #465b5d;
  border-radius: 2px;
  color: #d3dddb;
  background: #172126;
  cursor: pointer;
  font-size: 12px;
}
.action-button > span { display: block; }
.action-button small { display: block; margin-top: 3px; color: #728184; font-size: 9px; }
.action-button:hover { border-color: #7baaa5; background: #213238; }
.action-button--key { border-color: #4e8d86; color: #c8f2eb; background: #173330; }
.action-button--danger { border-color: #6f3439; color: #f0bdc0; background: #35191d; }
.action-button--danger:hover { border-color: #d75a63; background: #4b1d23; }
.action-button:disabled { border-color: #303c3e; color: #596669; background: #11191d; cursor: not-allowed; }
.action-button:disabled:hover { border-color: #303c3e; background: #11191d; }
.investigation-layer {
  position: absolute;
  z-index: 20;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  outline: none;
}
.investigation-dim { position: absolute; inset: 0; background: rgba(2, 5, 7, .62); backdrop-filter: blur(2px); }
.object-inspection {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(126, 171, 168, .36);
  border-left: 3px solid #6ea9a3;
  background: linear-gradient(135deg, rgba(18, 31, 36, .98), rgba(5, 10, 13, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
  animation: object-card-in .22s ease-out;
  transition: opacity .22s ease, filter .22s ease, transform .22s ease;
}
@keyframes object-card-in { from { opacity: 0; transform: translate(-50%, -47%) scale(.985); } }
.object-inspection--focus {
  top: 50%;
  left: 50%;
  width: min(900px, calc(100% - 70px));
  max-height: calc(100% - 54px);
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  transform: translate(-50%, -50%);
}
.object-inspection--quick {
  left: 50%;
  bottom: 16px;
  width: min(790px, calc(100% - 40px));
  max-height: min(55vh, 360px);
  padding: 22px 58px 19px 25px;
  overflow-y: auto;
  transform: translateX(-50%);
  animation-name: quick-card-in;
}
@keyframes quick-card-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.object-inspection.is-behind-character { opacity: .34; filter: brightness(.52) saturate(.4); pointer-events: none; }
.object-focus-art {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid rgba(115, 151, 151, .24);
  background:
    radial-gradient(circle at 50% 48%, rgba(103, 159, 151, .16), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(132, 181, 176, .025) 5px),
    #091115;
}
.object-focus-art img { width: 86%; height: 82%; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }
.object-focus-art > span { color: #a8d7d0; font-size: 92px; text-shadow: 0 0 45px rgba(126, 206, 195, .28); }
.object-focus-art i { position: absolute; inset: 12%; border: 1px solid rgba(111, 164, 158, .1); pointer-events: none; }
.object-inspection-copy { position: relative; align-self: center; padding: 34px 44px 38px; overflow-y: auto; }
.object-inspection-copy h2 { margin: 2px 0 13px; color: #e3ecea; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 27px; font-weight: 400; }
.object-inspection-copy > p { margin: 0; color: #bec9c7; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 15px; line-height: 1.82; }
.investigation-character-scene { position: absolute; z-index: 5; inset: 0; animation: character-layer-in .24s ease-out; }
@keyframes character-layer-in { from { opacity: 0; } }
.investigation-portrait {
  position: absolute;
  z-index: 3;
  right: max(3%, calc(50% - 520px));
  bottom: 130px;
  width: min(38vw, 430px);
  height: auto;
  aspect-ratio: 520 / 720;
  max-height: calc(100% - 80px);
  filter: saturate(.42) brightness(.7);
  transform: translateX(4%);
  animation: portrait-rise .28s ease-out forwards;
}
.investigation-portrait--left {
  right: auto;
  left: max(3%, calc(50% - 520px));
  transform: translateX(-4%);
  animation-name: portrait-rise-left;
}
@keyframes portrait-rise-left { from { opacity: 0; transform: translate(-6%, 18px); } to { opacity: .96; transform: translateX(-4%); } }
@keyframes portrait-rise { from { opacity: 0; transform: translate(6%, 18px); } to { opacity: .96; transform: translateX(4%); } }
.investigation-portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.portrait-identity-veil {
  position: absolute;
  z-index: 2;
  top: 20%;
  left: 27%;
  width: 46%;
  height: 25%;
  border-radius: 46% 46% 42% 42%;
  background: radial-gradient(ellipse at 50% 48%, rgba(3,7,10,.98) 0 45%, rgba(3,7,10,.88) 62%, rgba(3,7,10,.14) 81%, transparent);
  box-shadow: 0 0 14px rgba(3,7,10,.72);
  filter: blur(5px);
  transform: rotate(-4deg);
}
.investigation-character-scene.mood-uneasy .investigation-portrait { filter: saturate(.28) brightness(.6) sepia(.12); }
.investigation-character-scene.mood-focused .investigation-portrait { filter: saturate(.5) brightness(.78); }
.investigation-dialogue-box {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 16px;
  width: min(900px, calc(100% - 42px));
  min-height: 145px;
  padding: 30px 34px 20px;
  border: 1px solid rgba(138, 181, 177, .42);
  background: rgba(5, 11, 15, .97);
  box-shadow: 0 20px 70px rgba(0,0,0,.78);
  transform: translateX(-50%);
}
.investigation-speaker { position: absolute; top: -18px; left: 25px; min-width: 150px; display: flex; align-items: baseline; gap: 11px; padding: 8px 18px; border: 1px solid #4e7774; background: #122421; }
.investigation-speaker strong { color: #e0f2ef; font-family: "Nanum Myeongjo", "Batang", serif; }
.investigation-speaker span { color: #65817e; font-size: 8px; letter-spacing: .16em; }
.investigation-dialogue-box > p { margin: 0; min-height: 54px; padding-right: 38px; color: #e0e8e6; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 17px; line-height: 1.8; }
.investigation-character-scene.is-thought .investigation-dialogue-box {
  border-color: rgba(116, 132, 148, .42);
  background: linear-gradient(135deg, rgba(8, 13, 20, .98), rgba(12, 18, 23, .96));
  box-shadow: 0 20px 70px rgba(0,0,0,.82), inset 4px 0 rgba(93, 118, 132, .24);
}
.investigation-character-scene.is-thought .investigation-dialogue-box > p { color: #cdd5d7; }
.investigation-character-scene.is-spoken .investigation-dialogue-box { border-color: rgba(115, 181, 172, .5); }

.investigation-action-panel {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 36px));
  display: grid;
  gap: 9px;
  padding: 20px;
  border: 1px solid rgba(117, 158, 157, .42);
  background: rgba(6, 12, 16, .98);
  box-shadow: 0 28px 90px rgba(0,0,0,.78);
  transform: translate(-50%, -50%);
  animation: action-panel-in .2s ease-out;
}
@keyframes action-panel-in { from { opacity: 0; transform: translate(-50%, -47%); } }
.investigation-action-panel .action-button {
  width: 100%;
  min-height: 48px;
  text-align: left;
}
.action-cancel {
  margin-top: 4px;
  padding: 10px;
  border: 0;
  color: #718083;
  background: transparent;
  cursor: pointer;
}
.action-cancel:hover { color: #bcc9c8; }

.puzzle-panel {
  position: absolute;
  z-index: 14;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid #527b78;
  background: linear-gradient(145deg, #111d22, #060b0e);
  box-shadow: 0 30px 100px rgba(0,0,0,.82);
  transform: translate(-50%, -50%);
  cursor: default;
}
.puzzle-panel.puzzle-panel--choice {
  background:
    url("/assets/ui/minigames/ui_minigame_evidence_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(11, 19, 22, .91), rgba(5, 9, 12, .96));
}
.puzzle-panel.puzzle-panel--connectNodes {
  background:
    url("/assets/ui/minigames/ui_minigame_connect_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(11, 19, 22, .88), rgba(5, 9, 12, .94));
}
.puzzle-panel.puzzle-panel--assembleFragments {
  width: min(820px, calc(100% - 32px));
  background:
    linear-gradient(rgba(11, 16, 18, .94), rgba(5, 8, 10, .98)),
    url("/assets/ui/minigames/ui_minigame_evidence_panel.webp") center / 100% 100% no-repeat;
}
.puzzle-panel.puzzle-panel--rotateDials,
.puzzle-panel.puzzle-panel--slideRails,
.puzzle-panel.puzzle-panel--balanceWeights,
.puzzle-panel.puzzle-panel--sequenceKeys {
  width: min(700px, calc(100% - 32px));
  background:
    linear-gradient(rgba(11, 18, 20, .92), rgba(5, 9, 11, .98)),
    url("/assets/ui/minigames/ui_minigame_connect_panel.webp") center / 100% 100% no-repeat;
}
.puzzle-panel h3 { margin: 0 34px 20px 0; color: #dbe6e4; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 20px; font-weight: 400; }
.puzzle-close { position: absolute; top: 12px; right: 13px; width: 32px; height: 32px; border: 0; color: #80908f; background: transparent; cursor: pointer; font-size: 22px; }
.keypad-display { margin-bottom: 14px; padding: 15px; border: 1px solid #2d4e4b; color: #b8dfd9; background: #06100f; text-align: center; font-family: monospace; font-size: 24px; letter-spacing: .18em; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad-grid button, .puzzle-choice-list button {
  min-height: 48px;
  border: 1px solid #344f4d;
  color: #d0dcda;
  background: #142125;
  cursor: pointer;
  font-size: 16px;
}
.keypad-grid button:hover, .puzzle-choice-list button:hover { border-color: #75a8a2; background: #1c3031; }
.keypad-grid button:disabled { opacity: .34; cursor: default; }
.puzzle-choice-list { display: grid; gap: 9px; }
.puzzle-choice-list button { padding: 12px 14px; text-align: left; font-size: 13px; }
.puzzle-feedback { margin: 13px 0 0; color: #c79497; font-size: 11px; line-height: 1.55; }
.wire-cut-stage { position: relative; min-height: 180px; overflow: hidden; border: 1px solid #2e4648; background: radial-gradient(circle at 50% 50%, #172329, #080d10 72%); touch-action: none; }
.wire-label { position: absolute; top: 18px; left: 18px; color: #9aa7a7; font-size: 10px; letter-spacing: .08em; }
.wire-line { position: absolute; top: 48%; left: 8%; right: 8%; height: 10px; border: 2px solid #8a3b41; border-radius: 9px; background: linear-gradient(#582329, #2c1115); box-shadow: 0 0 13px rgba(157,52,61,.28); }
.wire-cutter { position: absolute; z-index: 2; top: calc(48% - 24px); width: 52px; height: 58px; border: 1px solid #91aba7; border-radius: 7px; color: #dce7e4; background: #28383a; cursor: grab; font-size: 24px; transform: translateX(-50%); touch-action: none; }
.wire-cutter:active { cursor: grabbing; }
.wire-cut-stage small { position: absolute; left: 18px; right: 18px; bottom: 15px; color: #687779; font-size: 9px; text-align: center; }
.rotary-puzzle > p,
.slide-rails-puzzle > p,
.balance-puzzle > p,
.sequence-puzzle > p { margin: -7px 0 18px; color: #81918f; font-size: 11px; line-height: 1.6; }
.rotary-dials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rotary-dial { padding: 13px 10px 11px; border: 1px solid #2e4647; background: rgba(5, 12, 14, .7); text-align: center; }
.rotary-dial > strong { display: block; min-height: 30px; color: #b7c6c3; font-size: 11px; font-weight: 500; line-height: 1.45; }
.rotary-dial > small { color: #5f7472; font-size: 8px; letter-spacing: .12em; }
.rotary-dial-controls { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 5px; margin: 9px 0 5px; }
.rotary-dial-controls > button { width: 32px; height: 45px; border: 1px solid #3a5956; color: #a8c9c4; background: #132124; cursor: pointer; font-size: 24px; }
.rotary-dial-controls > button:hover { border-color: #72a59f; background: #1d3031; }
.dial-face { --dial-turn: 0deg; position: relative; aspect-ratio: 1; display: grid; place-items: center; margin: auto; border: 5px solid #263a3b; border-radius: 50%; color: #d2dfdc; background: radial-gradient(circle, #17272a 0 50%, #0a1113 52%); box-shadow: inset 0 0 18px #000, 0 5px 18px rgba(0,0,0,.5); }
.dial-face::before { content: ""; position: absolute; top: -8px; left: calc(50% - 1px); width: 2px; height: 17px; background: #b39762; transform-origin: 1px calc(50% + 30px); transform: rotate(var(--dial-turn)); transition: transform .18s ease; }
.dial-face span { padding: 5px; font-size: 10px; line-height: 1.25; }
.puzzle-submit { display: block; min-width: 170px; margin: 20px auto 0; padding: 11px 22px; border: 1px solid #5e8580; color: #d9e6e3; background: #172a29; cursor: pointer; font-size: 12px; }
.puzzle-submit:hover { border-color: #91b8b2; background: #223b38; }
.slide-rails { display: grid; gap: 13px; }
.slide-rail { display: block; padding: 12px 14px 10px; border: 1px solid #2f4848; background: rgba(5, 12, 14, .72); }
.slide-rail > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.slide-rail strong { color: #bccbc8; font-size: 11px; font-weight: 500; }
.slide-rail em { color: #d3c69e; font-size: 11px; font-style: normal; }
.slide-rail input { width: 100%; margin: 13px 0 7px; accent-color: #79a9a3; cursor: grab; }
.slide-rail input:active { cursor: grabbing; }
.slide-rail-stops { display: grid !important; grid-auto-flow: column; grid-auto-columns: 1fr; color: #556866; font-size: 7px; text-align: center; }
.slide-rail-stops i { font-style: normal; }
.balance-gauge {
  position: relative;
  width: 150px;
  height: 72px;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 1px solid #3c5553;
  border-bottom: 0;
  border-radius: 150px 150px 0 0;
  background: radial-gradient(circle at 50% 100%, #1d3031 0 12%, #0a1215 14% 65%, #162326 66%);
  box-shadow: inset 0 0 22px rgba(0,0,0,.7);
}
.balance-gauge::before { content: "−  보정  ＋"; position: absolute; inset: 15px 16px auto; color: #607674; font-size: 8px; letter-spacing: .16em; text-align: center; }
.balance-gauge > span { position: absolute; left: calc(50% - 1px); bottom: 0; width: 2px; height: 59px; background: #c7b074; transform-origin: 50% 100%; transition: transform .2s ease; }
.balance-gauge > span::after { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d8c590; box-shadow: 0 0 9px rgba(215,193,133,.42); }
.balance-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.balance-channel { padding: 13px 10px 10px; border: 1px solid #2e4747; background: rgba(5, 12, 14, .72); text-align: center; }
.balance-channel > strong { display: block; min-height: 30px; color: #b9c8c6; font-size: 10px; font-weight: 500; line-height: 1.45; }
.balance-channel > div { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 5px; margin: 10px 0 7px; }
.balance-channel button { height: 36px; border: 1px solid #3a5956; color: #b6cfcb; background: #132124; cursor: pointer; font-size: 18px; }
.balance-channel button:disabled { opacity: .28; cursor: default; }
.balance-channel output { color: #ded5b6; font-family: monospace; font-size: 13px; }
.balance-channel > small { color: #607370; font-size: 8px; }
.sequence-progress { display: flex; justify-content: center; gap: 9px; margin: 0 0 18px; }
.sequence-progress i { width: 32px; height: 4px; background: #263b3b; box-shadow: inset 0 0 3px #000; }
.sequence-progress i.is-filled { background: #7caea7; box-shadow: 0 0 9px rgba(105,169,160,.45); }
.sequence-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sequence-keys button { min-height: 112px; padding: 14px 8px; border: 1px solid #3a5150; color: #becdca; background: linear-gradient(#192729, #0d1619); cursor: pointer; box-shadow: inset 0 -5px rgba(0,0,0,.25); }
.sequence-keys button:hover { border-color: #83aaa5; background: linear-gradient(#243638, #122022); }
.sequence-keys button:active { transform: translateY(2px); box-shadow: inset 0 -2px rgba(0,0,0,.3); }
.sequence-keys button span { display: block; margin-bottom: 11px; color: #d5c48e; font-size: 25px; }
.sequence-keys button strong { font-size: 10px; font-weight: 500; line-height: 1.45; }
@media (max-width: 620px) {
  .rotary-dials { grid-template-columns: 1fr; max-height: 52vh; overflow-y: auto; }
  .rotary-dial { display: grid; grid-template-columns: 90px 1fr 35px; align-items: center; }
  .rotary-dial > strong { min-height: 0; }
  .rotary-dial-controls { margin: 0; }
  .dial-face { width: 74px; }
  .balance-channels { grid-template-columns: 1fr; max-height: 48vh; overflow-y: auto; }
  .balance-channel { display: grid; grid-template-columns: 90px 1fr 55px; align-items: center; }
  .balance-channel > strong { min-height: 0; }
  .sequence-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sequence-keys button { min-height: 78px; }
}
.narrative-caret {
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #7eb0aa;
  border-bottom: 2px solid #7eb0aa;
  transform: rotate(45deg);
  animation: narrative-caret 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes narrative-caret { 50% { opacity: .28; transform: translateY(3px) rotate(45deg); } }

.bottom-nav {
  position: absolute;
  z-index: 50;
  inset: auto 0 0 0;
  height: 76px;
  display: flex;
  justify-content: center;
  gap: 1px;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(5, 10, 13, 0.97);
  backdrop-filter: blur(16px);
}
.bottom-nav button {
  position: relative;
  width: min(130px, 19vw);
  border: 0;
  border-top: 2px solid transparent;
  color: #748589;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.bottom-nav button > span { display: block; margin-bottom: 2px; color: #9badb0; font-size: 21px; line-height: 26px; }
.bottom-nav button em {
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 10px;
  color: #a8c7c3;
  background: #243c3a;
  font-size: 8px;
  font-style: normal;
}
.bottom-nav button:hover, .bottom-nav button.is-active { border-top-color: #72aaa5; color: #d9e6e4; background: linear-gradient(180deg, rgba(75, 128, 122, 0.15), transparent); }
.bottom-nav button.is-active > span { color: var(--mint); }

.collection-drawer {
  position: absolute;
  z-index: 60;
  top: 72px;
  right: 0;
  bottom: 76px;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(122, 162, 160, 0.28);
  background: rgba(7, 13, 17, 0.985);
  box-shadow: -30px 0 70px rgba(0, 0, 0, .55);
  animation: drawer-in .22s ease-out;
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.collection-drawer > header { position: relative; padding: 22px 26px 12px; }
.collection-drawer header h2 { margin: 0; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 26px; }
.drawer-tabs { display: flex; padding: 0 18px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.drawer-tabs button { padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; color: #66777b; background: transparent; cursor: pointer; font-size: 11px; white-space: nowrap; }
.drawer-tabs button.is-active { border-bottom-color: var(--mint); color: #d8eae7; }
.drawer-content { flex: 1; overflow-y: auto; padding: 20px 24px 30px; }
.empty-state { grid-column: 1 / -1; padding: 55px 20px; color: #68797d; text-align: center; font-family: "Nanum Myeongjo", "Batang", serif; }
.card-grid, .stack-list, .profile-list, .ending-grid { display: grid; gap: 12px; }
.archive-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(22, 32, 37, 0.67);
}
.archive-card h3, .profile-card h3, .ending-card h3 { margin: 0 0 6px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 17px; }
.archive-card p, .ending-card p { margin: 0; color: #96a5a6; font-size: 12px; line-height: 1.6; }
.archive-card small, .fact small { display: block; margin-top: 8px; color: #64797b; font-size: 9px; }
.inventory-card { grid-template-columns: 72px minmax(0, 1fr); }
.item-symbol {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #4a706d;
  color: var(--mint);
  font-size: 23px;
  background:
    radial-gradient(circle at 50% 45%, rgba(71, 119, 112, .18), transparent 58%),
    #101d20;
}
.item-symbol img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, .55));
}
.item-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.item-use-button, .item-combine-button, .item-disassemble-button { padding: 8px 18px; border: 1px solid #507c77; color: #d2e7e3; background: #162a28; cursor: pointer; font-size: 11px; }
.item-use-button:hover, .item-combine-button:hover, .item-disassemble-button:hover { border-color: #86b8b1; background: #203a37; }
.item-combine-button { border-color: #70684e; color: #ded5b6; background: #282519; }
.item-combine-button.is-ready { border-color: #a69862; background: #37311d; }
.item-disassemble-button { border-color: #6e5950; color: #d9c8bc; background: #251c19; }
.combine-guide { position: sticky; bottom: 0; grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 16px; border: 1px solid #7b7457; background: rgba(19, 19, 15, .97); color: #d8d0b5; font-size: 12px; }
.combine-guide button { padding: 6px 13px; border: 1px solid #605d50; color: #beb9a7; background: transparent; cursor: pointer; }

.tutorial-overlay { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(3, 7, 9, .78); backdrop-filter: blur(5px); }
.tutorial-overlay section { width: min(520px, 100%); padding: 34px 38px 30px; border: 1px solid rgba(117, 161, 157, .55); border-left: 3px solid #6f9a95; background: #091114; box-shadow: 0 24px 90px rgba(0, 0, 0, .72); }
.tutorial-overlay span { color: #68817f; font-size: 9px; letter-spacing: .25em; }
.tutorial-overlay h2 { margin: 11px 0 15px; color: #e3ece9; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 24px; }
.tutorial-overlay p { margin: 0; color: #b3c0be; font-size: 14px; line-height: 1.85; white-space: pre-line; }
.tutorial-overlay button { display: block; min-width: 120px; margin: 25px 0 0 auto; padding: 10px 20px; border: 1px solid #567b77; color: #e0ebe8; background: #142624; cursor: pointer; }

.item-acquisition-overlay {
  position: fixed;
  z-index: 160;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(67, 100, 94, .2), transparent 34%),
    rgba(2, 6, 8, .78);
  backdrop-filter: blur(6px) saturate(.7);
  cursor: pointer;
  outline: none;
  animation: item-acquisition-fade-in .2s ease-out;
}
.item-acquisition-card {
  position: relative;
  width: min(590px, 100%);
  min-height: 310px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 18px 28px;
  padding: 38px 42px 34px;
  background:
    url("/assets/ui/frames/ui_frame_inventory_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(145deg, rgba(13, 24, 27, .99), rgba(5, 10, 13, .99));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .84);
  cursor: default;
  animation: item-acquisition-card-in .28s cubic-bezier(.2, .78, .24, 1);
}
.item-acquisition-eyebrow {
  grid-column: 1 / -1;
  color: #779590;
  font-size: 9px;
  letter-spacing: .28em;
  text-align: center;
}
.item-acquisition-visual {
  position: relative;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(112, 161, 154, .42);
  color: #c5e2dc;
  background:
    linear-gradient(135deg, transparent 8px, rgba(23, 43, 44, .82) 0) top left,
    radial-gradient(circle, rgba(78, 130, 122, .2), rgba(8, 17, 20, .92) 67%);
  box-shadow: inset 0 0 32px rgba(102, 165, 155, .08), 0 14px 34px rgba(0, 0, 0, .42);
}
.item-acquisition-visual::before,
.item-acquisition-visual::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  border-color: rgba(155, 199, 192, .56);
}
.item-acquisition-visual::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.item-acquisition-visual::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.item-acquisition-visual > span {
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 54px;
  text-shadow: 0 0 24px rgba(128, 194, 184, .28);
}
.item-acquisition-visual > img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .58));
}
.item-acquisition-copy { align-self: center; }
.item-acquisition-copy h2 {
  margin: 0 0 12px;
  color: #e6efec;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 26px;
  font-weight: 600;
}
.item-acquisition-copy p {
  margin: 0;
  color: #9eaeac;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 13px;
  line-height: 1.75;
}
.item-acquisition-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: #83aaa4;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
}
.item-acquisition-copy strong .game-icon { width: 23px; height: 23px; }
.item-acquisition-card > button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 150px;
  padding: 10px 20px;
  border: 0;
  color: #dce9e6;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    rgba(15, 29, 31, .94);
  cursor: pointer;
}
.item-acquisition-card > button:hover { filter: brightness(1.18); }
@keyframes item-acquisition-fade-in { from { opacity: 0; } }
@keyframes item-acquisition-card-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.connect-puzzle { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 62px; min-height: 310px; margin-top: 18px; }
.connect-puzzle > p { grid-column: 1 / -1; margin: 0; color: #829391; font-size: 11px; text-align: center; }
.connect-puzzle svg { position: absolute; z-index: 0; inset: 43px 0 0; width: 100%; height: calc(100% - 43px); pointer-events: none; }
.connect-puzzle line { stroke: #78a7a1; stroke-width: .8; filter: drop-shadow(0 0 3px rgba(103, 170, 162, .5)); }
.connect-column { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 13px; }
.connect-column button { min-height: 54px; padding: 10px 13px; border: 1px solid #3d5251; color: #b8c4c2; background: #0c1518; cursor: pointer; font-size: 11px; line-height: 1.45; }
.connect-column button.is-selected { border-color: #a99c68; color: #efe4b9; box-shadow: 0 0 0 2px rgba(169, 156, 104, .12); }
.connect-column button.is-connected { border-color: #527a75; color: #d5e8e4; background: #142522; }
.fragment-puzzle > p { margin: -8px 0 12px; color: #829391; font-size: 11px; text-align: center; }
.fragment-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(95, 119, 116, .55);
  background:
    radial-gradient(circle at 50% 48%, rgba(102, 92, 70, .12), transparent 48%),
    linear-gradient(145deg, #10191b, #05090b 75%);
  box-shadow: inset 0 0 45px rgba(0, 0, 0, .76);
  touch-action: none;
}
.fragment-target-frame {
  position: absolute;
  left: 23%;
  top: 12%;
  width: 54%;
  height: 76%;
  border: 1px dashed rgba(166, 157, 125, .24);
  background: rgba(173, 163, 128, .025);
}
.fragment-piece {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  padding: 0;
  border: 0;
  background-repeat: no-repeat;
  box-shadow: 0 8px 20px rgba(0,0,0,.52);
  cursor: grab;
  transform-origin: center;
  transition: box-shadow .12s ease, filter .12s ease;
  touch-action: none;
}
.fragment-piece--0 { clip-path: polygon(2% 6%, 96% 0, 100% 91%, 61% 98%, 45% 91%, 3% 100%); }
.fragment-piece--1 { clip-path: polygon(3% 0, 95% 8%, 99% 98%, 44% 93%, 2% 100%); }
.fragment-piece--2 { clip-path: polygon(0 8%, 42% 1%, 100% 6%, 94% 97%, 8% 100%); }
.fragment-piece--3 { clip-path: polygon(4% 2%, 97% 0, 100% 87%, 72% 100%, 1% 94%); }
.fragment-piece.is-dragging { z-index: 8; cursor: grabbing; filter: brightness(1.16); box-shadow: 0 18px 36px rgba(0,0,0,.78); }
.fragment-piece.is-locked { z-index: 1; cursor: default; box-shadow: none; filter: none; }
.item-target-banner {
  position: absolute;
  z-index: 16;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 15px;
  border: 1px solid #8d8156;
  color: #d9d0ae;
  background: rgba(25, 23, 15, .94);
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
  transform: translateX(-50%);
}
.item-target-banner span { color: #a99d73; font-size: 9px; }
.item-target-banner strong { font-size: 11px; font-weight: 500; }
.item-target-banner button { padding: 4px 7px; border: 0; color: #8d8876; background: transparent; cursor: pointer; }
.keyword-card { grid-template-columns: 12px 1fr; }
.status-dot { width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(154, 219, 210, .5); }

.profile-card { display: grid; grid-template-columns: 155px 1fr; overflow: hidden; border: 1px solid var(--line); background: #111a1f; }
.profile-portrait { position: relative; width: 155px; height: 240px; align-self: start; overflow: hidden; background: #0d151a; }
.profile-portrait > img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.72); }
.profile-portrait .portrait-identity-veil { top: 12%; left: 25%; width: 50%; height: 23%; filter: blur(5px); }
.profile-body { padding: 18px; }
.profile-role { margin: -3px 0 14px; color: #7e9093; font-size: 11px; }
.fact-list { display: grid; gap: 10px; }
.fact { padding-top: 9px; border-top: 1px solid rgba(129, 160, 160, .15); }
.fact strong { color: #b8cac8; font-size: 11px; }
.fact p { margin: 4px 0 0; color: #8f9fa0; font-size: 11px; line-height: 1.55; }

.ending-grid { grid-template-columns: 1fr 1fr; }
.ending-card { min-height: 166px; padding: 18px; border: 1px solid var(--line); background: linear-gradient(145deg, #151e23, #0b1014); }
.ending-card > span { color: var(--danger); font-family: monospace; font-size: 11px; letter-spacing: .12em; }
.ending-card h3 { margin-top: 18px; }
.ending-card.is-locked { opacity: .48; filter: grayscale(1); }
.journal-list { display: grid; }
.journal-list article { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); }
.journal-list article span { color: #526d6d; font-family: monospace; }
.journal-list article p { margin: 0; color: #a7b4b4; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 14px; line-height: 1.55; }

.dialogue-scene {
  position: absolute;
  z-index: 80;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(80, 105, 101, .16), transparent 37%),
    linear-gradient(180deg, #10181d 0%, #090d11 65%, #050709 100%);
}
.dialogue-scene.is-tappable { cursor: pointer; outline: none; }
.corridor-depth { position: absolute; inset: 0; opacity: .7; perspective: 500px; }
.corridor-depth::before, .corridor-depth::after { content: ""; position: absolute; top: 0; bottom: 0; width: 39%; background: linear-gradient(90deg, #111a1e, #202b2f); transform-origin: center; }
.corridor-depth::before { left: 0; clip-path: polygon(0 0, 100% 19%, 100% 78%, 0 100%); }
.corridor-depth::after { right: 0; clip-path: polygon(0 19%, 100% 0, 100% 100%, 0 78%); background: linear-gradient(270deg, #111a1e, #202b2f); }
.corridor-depth span { position: absolute; left: 50%; width: 1px; top: 0; bottom: 0; background: rgba(201, 222, 217, .1); }
.corridor-depth span:nth-child(2) { transform: translateX(-220px) rotate(-17deg); }
.corridor-depth span:nth-child(3) { transform: translateX(220px) rotate(17deg); }
.dialogue-chapter { position: absolute; z-index: 3; top: 28px; left: 50%; transform: translateX(-50%); color: #718489; font-size: 10px; letter-spacing: .22em; }
.dialogue-portrait { position: absolute; z-index: 2; bottom: 180px; width: min(43vw, 520px); height: auto; aspect-ratio: 520 / 720; max-height: calc(100% - 135px); opacity: .36; filter: saturate(.35) brightness(.65); transition: opacity .22s ease, filter .22s ease, transform .22s ease; }
.dialogue-portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.dialogue-identity-veil { position: absolute; z-index: 2; top: 20%; left: 27%; width: 46%; height: 25%; border-radius: 48%; background: radial-gradient(ellipse, rgba(3,7,10,.98) 0 46%, rgba(3,7,10,.88) 63%, transparent 82%); box-shadow: 0 0 14px rgba(3,7,10,.72); filter: blur(5px); transform: rotate(-4deg); }
.dialogue-portrait--left { left: 4%; transform: translateX(-2%); }
.dialogue-portrait--right { right: 4%; transform: translateX(2%); }
.dialogue-portrait.is-active { opacity: 1; filter: none; transform: translateX(0); }
.dialogue-portrait--hidden { visibility: hidden; opacity: 0; }
.dialogue-portrait--silhouette img { filter: brightness(0) opacity(.78); }
.dialogue-portrait--silhouette.is-active { opacity: .72; filter: drop-shadow(0 0 28px rgba(110, 140, 136, .12)); }
.dialogue-box {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(34px, env(safe-area-inset-bottom));
  width: min(980px, calc(100% - 38px));
  min-height: 188px;
  padding: 31px 36px 25px;
  border: 1px solid rgba(143, 184, 181, .37);
  background: rgba(6, 12, 16, .95);
  box-shadow: 0 18px 70px rgba(0,0,0,.72);
  transform: translateX(-50%);
}
.speaker-name { position: absolute; top: -17px; min-width: 150px; padding: 8px 21px; border: 1px solid #4e7774; color: #def5f1; background: #142725; font-family: "Nanum Myeongjo", "Batang", serif; font-weight: 700; }
.speaker-name--left { left: 26px; }
.speaker-name--right { right: 26px; text-align: right; }
.dialogue-box > p { margin: 0; min-height: 54px; color: #e3e8e6; font-family: "Nanum Myeongjo", "Batang", serif; font-size: clamp(15px, 1.6vw, 19px); line-height: 1.8; }
.dialogue-choice-panel {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100% - 42px));
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(103, 144, 143, .4);
  background: rgba(7, 13, 17, .97);
  box-shadow: 0 24px 80px rgba(0,0,0,.75);
  transform: translate(-50%, -58%);
}
.dialogue-choice-panel--questions { grid-template-columns: 1fr 1fr; }
.dialogue-choice-panel button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 15px; border: 1px solid #34484b; color: #cbd5d4; background: #101a1f; text-align: left; cursor: pointer; font-size: 12px; }
.dialogue-choice-panel button:hover { border-color: #6ea7a1; color: white; background: #192a2e; }
.dialogue-choice-panel button.is-seen { border-color: #263436; color: #687679; background: #0b1216; }
.dialogue-choice-panel button.is-seen .choice-keyword { color: #597a77; }
.dialogue-choice-panel button.is-seen:hover { border-color: #587b78; color: #aebdbc; background: #111d21; }
.dialogue-choice-panel button.is-progress { border-color: #6d6650; color: #d7c99f; background: #272418; }
.dialogue-choice-panel--questions button.is-progress:last-child { grid-column: 1 / -1; }
.choice-seen { margin-top: 2px; color: #4f6062; font-size: 8px; font-style: normal; letter-spacing: .08em; }
.choice-keyword { color: var(--mint); font-size: 9px; letter-spacing: .06em; }

.ending-overlay, .completion-overlay, .start-overlay, .intro-overlay {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 7, .97);
}

.intro-overlay {
  overflow: hidden;
  cursor: pointer;
  outline: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(25, 46, 48, .48), transparent 42%),
    #060a0d;
}
.intro-overlay--system::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .1;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, #8bb5b0 4px);
}
.intro-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(820px, 86vw);
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  opacity: .14;
  transform: translate(-50%, -50%);
}
.intro-pulse span { width: 1px; height: 100%; background: #9cd3cc; animation: pulse-line 1.3s ease-in-out infinite alternate; }
.intro-pulse span:nth-child(2) { height: 45%; animation-delay: .2s; }
.intro-pulse span:nth-child(3) { height: 70%; animation-delay: .4s; }
.intro-pulse span:nth-child(4) { height: 30%; animation-delay: .6s; }
@keyframes pulse-line { to { transform: scaleY(.18); opacity: .2; } }
.intro-message {
  position: relative;
  width: min(720px, calc(100% - 38px));
  padding: 34px 42px 28px;
  border: 1px solid rgba(100, 144, 141, .27);
  background: rgba(5, 11, 14, .88);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
}
.intro-message h2 { margin: 7px 0 16px; color: #cfdfdc; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 22px; font-weight: 400; }
.intro-message > p { margin: 0; color: #c1cecc; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 17px; line-height: 1.85; }
.intro-overlay--thought { background: linear-gradient(180deg, rgba(4,7,10,.86), rgba(3,6,9,.98)); }
.intro-thought-scene { position: absolute; inset: 0; overflow: hidden; }
.intro-thought-portrait { position: absolute; right: max(2%, calc(50% - 520px)); bottom: 122px; width: min(40vw, 450px); aspect-ratio: 520 / 720; opacity: .72; filter: saturate(.25) brightness(.58); }
.intro-thought-portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.intro-thought-box {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  width: min(900px, calc(100% - 38px));
  min-height: 148px;
  padding: 31px 36px 23px;
  border: 1px solid rgba(116, 132, 148, .42);
  background: linear-gradient(135deg, rgba(8, 13, 20, .98), rgba(12, 18, 23, .96));
  box-shadow: 0 20px 70px rgba(0,0,0,.82), inset 4px 0 rgba(93, 118, 132, .24);
  transform: translateX(-50%);
}
.intro-thought-box p { margin: 0; padding-right: 30px; color: #d1d8da; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 17px; line-height: 1.8; }
.ending-overlay { background: radial-gradient(circle at 50% 48%, #32161a, #090608 58%, #020203); }
.ending-overlay--lead-in { cursor: pointer; background: rgba(2,3,4,.22); }
.ending-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, transparent 0 calc(46% - var(--ending-progress) * 20%), rgba(0,0,0,calc(.3 + var(--ending-progress) * .58)) 68%),
    rgba(19, 3, 6, calc(var(--ending-progress) * .32));
  transition: background .35s ease;
}
.ending-visual--shutdown .ending-vignette { background: radial-gradient(circle at 50% 45%, transparent 0 calc(42% - var(--ending-progress) * 24%), rgba(0,0,0,calc(.45 + var(--ending-progress) * .5)) 66%); }
.ending-visual--capture .ending-vignette { background: repeating-linear-gradient(0deg, rgba(83,12,18,calc(var(--ending-progress) * .22)) 0 2px, rgba(0,0,0,.1) 3px 5px), rgba(5,0,1,calc(var(--ending-progress) * .58)); }
.ending-lead-line, .ending-afterimage-box {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 24px;
  width: min(880px, calc(100% - 38px));
  min-height: 142px;
  padding: 31px 36px 22px;
  border: 1px solid rgba(122, 85, 88, .46);
  background: rgba(9, 7, 9, .95);
  box-shadow: 0 22px 80px rgba(0,0,0,.8);
  transform: translateX(-50%);
}
.ending-lead-line p, .ending-afterimage-box p { margin: 0; color: #dfd1d1; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 17px; line-height: 1.8; }
.ending-overlay--afterimage { cursor: pointer; background: radial-gradient(circle at 50% 44%, #172024, #040608 68%); }
.ending-afterimage-box { border-color: rgba(101, 126, 132, .42); background: rgba(7, 12, 16, .96); box-shadow: 0 22px 80px rgba(0,0,0,.8), inset 4px 0 rgba(91, 117, 128, .22); }
.ending-afterimage-box p { color: #cdd7d8; }
.ending-noise { position: absolute; inset: 0; opacity: .12; background-image: repeating-linear-gradient(0deg, transparent 0 2px, #8e5257 3px); }
.ending-content { position: relative; width: min(620px, calc(100% - 40px)); text-align: center; }
.ending-number { color: #c94f58; font-family: monospace; font-size: 13px; letter-spacing: .28em; }
.ending-content h2 { margin: 18px 0; color: #f0dcdb; font-family: "Nanum Myeongjo", "Batang", serif; font-size: clamp(36px, 6vw, 68px); font-weight: 400; }
.ending-content p { color: #ae9293; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 16px; line-height: 1.9; }
.ending-content button, .completion-card button, .start-overlay button { display: block; margin: 35px auto 12px; padding: 13px 24px; border: 1px solid #6d4549; color: #ead1d2; background: rgba(75, 29, 35, .5); cursor: pointer; }
.ending-content small, .start-overlay small { color: #65585a; font-size: 9px; letter-spacing: .08em; }

.start-overlay {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  overflow: auto;
  padding: clamp(52px, 7vh, 82px) 22px 28px;
  background: radial-gradient(circle at 50% 45%, #17272a, #080d10 52%, #030506);
}
.start-overlay::before { content: ""; position: absolute; width: 1px; height: 74%; background: linear-gradient(transparent, #56827e, transparent); transform: rotate(18deg); opacity: .22; }
.start-mark { position: absolute; top: 9%; color: #3d5c5b; font-family: monospace; font-size: 11px; letter-spacing: .3em; }
.start-title { position: relative; z-index: 1; text-align: center; }
.start-title span { color: #5a7777; font-size: 9px; letter-spacing: .45em; }
.start-title h1 { margin: 10px 0 3px; color: #e4edeb; font-family: "Nanum Myeongjo", "Batang", serif; font-size: clamp(42px, 7vw, 72px); font-weight: 400; letter-spacing: .14em; text-shadow: 0 0 35px rgba(146, 206, 197, .12); }
.start-title p { color: #82918f; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 14px; letter-spacing: .06em; }
.start-actions { position: relative; z-index: 2; display: flex; min-height: 38px; flex-wrap: wrap; justify-content: center; gap: 10px; }
.start-overlay .start-actions button { position: static; min-width: 150px; margin: 0; border-color: #4e7773; color: #d5e7e4; background: rgba(26, 54, 52, .38); }
.start-overlay button:hover { background: rgba(53, 98, 93, .45); }
.start-overlay .start-actions .start-secondary-action { border-color: rgba(126, 116, 87, .62); color: #d9cfad; background: rgba(64, 56, 33, .32); }
.chapter-select {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(900px, 100%);
}
.chapter-card {
  min-height: 226px;
  padding: 24px 26px 20px;
  border: 1px solid rgba(91, 128, 125, .38);
  background:
    linear-gradient(150deg, rgba(24, 42, 44, .86), rgba(6, 12, 15, .94)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(130, 175, 168, .025) 4px);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, .34), 0 18px 50px rgba(0, 0, 0, .25);
}
.chapter-card > span { color: #708d89; font-family: monospace; font-size: 9px; letter-spacing: .18em; }
.chapter-card h2 { margin: 13px 0 10px; color: #d8e3df; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 25px; font-weight: 400; }
.chapter-card p { min-height: 58px; margin: 0; color: #869795; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 12px; line-height: 1.75; }
.start-overlay .chapter-card button { width: min(220px, 100%); margin: 18px auto 0; padding: 10px 16px; }
.chapter-card--e07 {
  border-color: rgba(142, 112, 79, .42);
  background:
    linear-gradient(150deg, rgba(44, 41, 34, .88), rgba(9, 13, 14, .95)),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(179, 141, 90, .025) 55px);
}
.chapter-card--e07 > span { color: #a48b67; }
.chapter-card.is-current { box-shadow: inset 3px 0 rgba(107, 169, 161, .48), 0 18px 55px rgba(0, 0, 0, .34); }
.chapter-card.is-locked { opacity: .5; filter: saturate(.45); }
.chapter-card.is-locked button { cursor: not-allowed; }
.start-system-actions {
  position: absolute;
  right: 26px;
  top: 22px;
  display: flex;
  gap: 7px;
}
.start-overlay .start-system-actions button {
  min-width: 92px;
  margin: 0;
  padding: 8px 12px;
  color: #80918f;
  font-size: 10px;
  background: rgba(7, 15, 18, .72);
}
.demo-next-record {
  position: absolute;
  top: calc(50% + 84px);
  display: grid;
  gap: 5px;
  padding: 10px 22px;
  color: #686f65;
  text-align: center;
  background: rgba(5, 10, 12, .42);
}
.demo-next-record span { font-size: 8px; letter-spacing: .28em; }
.demo-next-record strong { color: #99927a; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 13px; font-weight: 400; }
.start-overlay--completed {
  background:
    linear-gradient(rgba(3, 7, 9, .5), rgba(3, 7, 9, .92)),
    radial-gradient(circle at 50% 42%, #263430, #080d10 57%, #030506);
}
.start-overlay--completed .start-mark { color: #8c866d; }
.start-overlay--completed .start-title span { color: #8f8a73; }
.start-overlay--completed .start-title h1 { color: #e7e1cd; text-shadow: 0 0 35px rgba(206, 192, 146, .1); }
.start-overlay small { position: relative; z-index: 1; margin-top: auto; color: #3f5253; }

@media (max-width: 760px) {
  .start-overlay { padding: 54px 14px 20px; }
  .start-title h1 { font-size: 40px; }
  .start-title p { font-size: 12px; }
  .chapter-select { grid-template-columns: 1fr; }
  .chapter-card { min-height: 0; padding: 18px 20px 16px; }
  .chapter-card p { min-height: 0; }
}

@media (max-height: 700px) and (orientation: landscape) {
  .start-overlay { gap: 7px; padding: 24px 18px 14px; }
  .start-mark { display: none; }
  .start-title span, .start-title p { display: none; }
  .start-title h1 { margin: 0; font-size: 34px; }
  .start-actions { min-height: 32px; }
  .start-overlay .start-actions button { padding: 8px 14px; }
  .chapter-card { min-height: 168px; padding: 15px 18px 13px; }
  .chapter-card h2 { margin: 7px 0 5px; font-size: 20px; }
  .chapter-card p { min-height: 44px; font-size: 10px; line-height: 1.55; }
  .start-overlay .chapter-card button { margin-top: 9px; padding: 8px 12px; }
  .start-overlay small { font-size: 8px; }
}

.completion-overlay { background: rgba(3, 7, 9, .87); backdrop-filter: blur(10px); }
.completion-card { width: min(560px, calc(100% - 40px)); padding: 42px; border: 1px solid #466e6b; background: linear-gradient(150deg, #142126, #080d10); text-align: center; box-shadow: 0 25px 90px #000; }
.completion-card h2 { margin: 8px 0 14px; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 32px; }
.completion-card p { color: #9baaaa; font-family: "Nanum Myeongjo", "Batang", serif; line-height: 1.75; }
.completion-stat { display: flex; justify-content: center; align-items: baseline; gap: 7px; margin-top: 22px; }
.completion-stat strong { color: var(--mint); font-size: 30px; }
.completion-stat span { color: #637477; font-size: 11px; }
.completion-card button { border-color: #4e7773; color: #d5e7e4; background: #142926; }

.debug-checkpoint-launcher {
  position: fixed;
  z-index: 180;
  right: 14px;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 78px));
  padding: 9px 12px;
  border: 1px solid rgba(211, 178, 108, .62);
  border-radius: 3px;
  color: #ead9ad;
  background: rgba(35, 30, 19, .94);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: .08em;
}
.debug-checkpoint-launcher:hover { border-color: #e4c77d; color: #fff0c5; background: rgba(58, 49, 28, .97); }

.debug-checkpoint-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 7, .86);
  backdrop-filter: blur(8px);
}
.debug-checkpoint-panel {
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(117, 154, 151, .42);
  background: linear-gradient(145deg, rgba(14, 24, 29, .99), rgba(6, 11, 14, .99));
  box-shadow: 0 28px 100px rgba(0, 0, 0, .74);
}
.debug-checkpoint-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}
.debug-checkpoint-panel > header span { color: var(--amber); font-size: 8px; letter-spacing: .22em; }
.debug-checkpoint-panel > header h2 { margin: 6px 0 5px; color: #e5efed; font-size: 23px; font-weight: 500; }
.debug-checkpoint-panel > header p { margin: 0; color: #78898d; font-size: 11px; }
.debug-checkpoint-close {
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  color: #9dafb1;
  background: rgba(18, 29, 34, .82);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.debug-checkpoint-backup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 26px;
  border-bottom: 1px solid rgba(139, 173, 174, .13);
  background: rgba(25, 31, 27, .64);
}
.debug-checkpoint-backup p { margin: 0; color: #a7aaa0; font-size: 10px; line-height: 1.5; }
.debug-checkpoint-backup button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(211, 178, 108, .45);
  color: #d8c590;
  background: rgba(55, 46, 27, .5);
  cursor: pointer;
  font-size: 9px;
}
.debug-checkpoint-backup button:disabled { border-color: #263033; color: #4f5a5b; background: #101619; cursor: default; }
.debug-checkpoint-list {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 26px 24px;
  scrollbar-color: #466e6b #0c1316;
}
.debug-checkpoint-group + .debug-checkpoint-group { margin-top: 22px; }
.debug-checkpoint-group h3 {
  margin: 0 0 9px;
  color: #8db7b2;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
}
.debug-checkpoint-group > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.debug-checkpoint-group button {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(112, 141, 142, .2);
  color: #c7d4d2;
  background: rgba(12, 21, 25, .88);
  cursor: pointer;
  text-align: left;
}
.debug-checkpoint-group button:hover { border-color: rgba(110, 167, 161, .62); background: rgba(23, 40, 43, .92); }
.debug-checkpoint-group button.is-active { border-color: var(--amber); box-shadow: inset 3px 0 rgba(211, 178, 108, .65); }
.debug-checkpoint-group button strong { font-size: 12px; font-weight: 500; }
.debug-checkpoint-group button span { color: #748488; font-size: 10px; line-height: 1.45; }
.debug-checkpoint-panel > footer {
  padding: 11px 26px;
  border-top: 1px solid var(--line);
  color: #536266;
  font-size: 8px;
  letter-spacing: .06em;
}

.toast {
  position: absolute;
  z-index: 140;
  top: 92px;
  left: 50%;
  padding: 11px 18px;
  border: 1px solid #5e908b;
  color: #d9efeb;
  background: rgba(14, 34, 33, .96);
  box-shadow: 0 12px 35px rgba(0,0,0,.45);
  font-size: 11px;
  transform: translateX(-50%);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }

.resolution-feedback {
  position: absolute;
  z-index: 132;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  animation: resolution-feedback-out 2.1s ease both;
}
.resolution-feedback-pulse {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(126, 211, 194, .17), transparent 42%),
    linear-gradient(90deg, transparent, rgba(149, 218, 208, .08), transparent);
  animation: resolution-scene-pulse .62s ease-out both;
}
.resolution-feedback section {
  position: relative;
  min-width: min(440px, calc(100% - 40px));
  max-width: min(620px, calc(100% - 40px));
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 20px 34px 22px;
  border: 1px solid rgba(121, 190, 180, .68);
  color: #e3f1ee;
  background:
    linear-gradient(135deg, transparent 10px, rgba(6, 19, 22, .96) 0) top left,
    linear-gradient(-45deg, transparent 10px, rgba(6, 19, 22, .96) 0) bottom right;
  background-size: 52% 100%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 32px rgba(90, 164, 154, .09),
    0 18px 60px rgba(0, 0, 0, .62);
  text-align: center;
  animation: resolution-card-in .28s cubic-bezier(.2, .85, .2, 1) both;
}
.resolution-feedback section::before,
.resolution-feedback section::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-block: 1px solid rgba(208, 184, 113, .75);
}
.resolution-feedback section::before { left: 8px; border-left: 1px solid rgba(208, 184, 113, .75); }
.resolution-feedback section::after { right: 8px; border-right: 1px solid rgba(208, 184, 113, .75); }
.resolution-feedback span {
  color: #82aaa5;
  font-size: 9px;
  letter-spacing: .2em;
}
.resolution-feedback strong {
  color: #f0e9d2;
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 500;
  letter-spacing: .04em;
}
.resolution-feedback p {
  margin: 0;
  color: #bad0cc;
  font-size: clamp(11px, 1.15vw, 14px);
  line-height: 1.55;
}
@keyframes resolution-scene-pulse {
  from { opacity: 0; transform: scale(.94); }
  45% { opacity: 1; }
  to { opacity: .28; transform: scale(1.04); }
}
@keyframes resolution-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes resolution-feedback-out {
  0%, 76% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 760px) {
  .game-header { height: 60px; grid-template-columns: 1fr auto; padding: max(7px, env(safe-area-inset-top)) 12px 7px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand strong { font-size: 15px; }
  .header-actions button { padding: 7px 8px; font-size: 9px; }
  .game-stage { inset: 60px 0 66px; }
  .bottom-nav { height: 66px; }
  .bottom-nav button { width: 20%; font-size: 9px; }
  .bottom-nav button > span { font-size: 17px; line-height: 21px; }
  .bottom-nav button em { top: 8px; }
  .collection-drawer { top: 60px; bottom: 66px; }
  .inspection-panel { bottom: 8px; width: calc(100% - 16px); min-height: 132px; grid-template-columns: 44px 1fr; gap: 11px; padding: 15px 38px 14px 14px; }
  .inspection-symbol { width: 41px; height: 41px; font-size: 19px; }
  .inspection-copy h2 { font-size: 17px; }
  .inspection-copy p { font-size: 12px; line-height: 1.55; }
  .protagonist-thought { margin-top: 7px; padding: 7px 9px 7px 11px; font-size: 11px; }
  .action-row { margin-top: 9px; }
  .action-button { padding: 8px 10px; font-size: 10px; }
  .object-inspection--focus { width: calc(100% - 22px); min-height: 330px; grid-template-columns: 35% 1fr; }
  .object-focus-art { min-height: 330px; }
  .object-inspection-copy { padding: 26px 29px 23px; }
  .object-inspection-copy h2 { font-size: 20px; }
  .object-inspection-copy > p { font-size: 12px; line-height: 1.62; }
  .object-inspection--quick { bottom: 8px; width: calc(100% - 16px); padding: 15px 38px 14px 16px; }
  .investigation-portrait { right: -6%; bottom: 180px; width: 54vw; }
  .investigation-dialogue-box { bottom: 8px; width: calc(100% - 16px); min-height: 156px; padding: 27px 18px 16px; }
  .investigation-dialogue-box > p { padding-right: 0; font-size: 14px; line-height: 1.65; }
  .investigation-action-panel { width: calc(100% - 24px); padding: 14px; }
  .puzzle-panel { width: calc(100% - 24px); padding: 20px; }
  .item-target-banner { top: 8px; width: calc(100% - 86px); justify-content: center; }
  .scan-status { top: 8px; left: 8px; padding: 6px 9px; }
  .room-view-arrow { width: 42px; height: 78px; font-size: 30px; }
  .closeup-back-button { bottom: 8px; min-height: 44px; padding: 8px 13px 9px; font-size: 10px; }
  .room-entry-title { top: 57%; padding: 11px 26px 13px; }
  .room-entry-title strong { font-size: 21px; }
  .profile-card { grid-template-columns: 100px 1fr; }
  .profile-portrait { width: 100px; height: 180px; }
  .ending-grid { grid-template-columns: 1fr; }
  .dialogue-portrait { bottom: 238px; width: 62vw; height: calc(100% - 185px); }
  .dialogue-portrait--left { left: -12%; }
  .dialogue-portrait--right { right: -12%; }
  .dialogue-box { bottom: max(12px, env(safe-area-inset-bottom)); min-height: 168px; padding: 28px 18px 18px; }
  .dialogue-box > p { font-size: 14px; line-height: 1.65; }
  .dialogue-choice-panel, .dialogue-choice-panel--questions { grid-template-columns: 1fr; max-height: 54vh; overflow-y: auto; padding: 12px; }
  .dialogue-choice-panel button { padding: 10px 12px; font-size: 11px; }
  .dialogue-choice-panel--questions button.is-progress:last-child { grid-column: 1; }
  .intro-message { padding: 26px 22px 22px; }
  .intro-message h2 { font-size: 18px; }
  .intro-message > p { font-size: 14px; line-height: 1.7; }
  .intro-thought-portrait { right: -8%; bottom: 150px; width: 62vw; }
  .intro-thought-box { bottom: 8px; width: calc(100% - 16px); min-height: 156px; padding: 26px 18px 17px; }
  .intro-thought-box p { font-size: 14px; line-height: 1.65; }
  .ending-lead-line, .ending-afterimage-box { bottom: 8px; width: calc(100% - 16px); min-height: 156px; padding: 26px 18px 17px; }
  .ending-lead-line p, .ending-afterimage-box p { font-size: 14px; line-height: 1.65; }
  .debug-checkpoint-launcher { right: 8px; bottom: max(74px, calc(env(safe-area-inset-bottom) + 68px)); padding: 8px 9px; }
  .debug-checkpoint-overlay { padding: 8px; }
  .debug-checkpoint-panel { max-height: calc(100vh - 16px); }
  .debug-checkpoint-panel > header { padding: 18px 16px 14px; }
  .debug-checkpoint-panel > header h2 { font-size: 19px; }
  .debug-checkpoint-backup { align-items: flex-start; padding: 11px 16px; }
  .debug-checkpoint-backup p { max-width: 58%; }
  .debug-checkpoint-list { padding: 16px; }
  .debug-checkpoint-group > div { grid-template-columns: 1fr; }
  .debug-checkpoint-group button { min-height: 60px; }
  .debug-checkpoint-panel > footer { padding: 9px 16px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  .room-canvas-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }
  .room-canvas-viewport::-webkit-scrollbar { display: none; }
  .room-canvas, .room-canvas canvas { touch-action: pan-x; }
  .room-canvas { width: calc((100vh - 126px) * 16 / 9); min-width: 100%; height: 100%; }
  .room-view-arrow { width: 44px; height: 88px; }
  .scan-status { opacity: .72; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .game-header { height: 54px; padding-top: 6px; padding-bottom: 6px; }
  .game-stage { inset: 54px 0 58px; }
  .bottom-nav { height: 58px; }
  .bottom-nav button > span { display: inline; margin-right: 6px; font-size: 15px; }
  .bottom-nav button em { top: 6px; }
  .collection-drawer { top: 54px; bottom: 58px; }
  .scan-status { top: 8px; }
  .dialogue-portrait { bottom: 128px; }
  .dialogue-box { bottom: 12px; min-height: 134px; padding: 25px 30px 16px; }
  .dialogue-box > p { min-height: 40px; font-size: 14px; line-height: 1.55; }
  .dialogue-choice-panel { max-height: calc(100% - 30px); grid-template-columns: 1fr 1fr; overflow-y: auto; padding: 10px; }
  .dialogue-choice-panel button { padding: 7px 10px; }
  .inspection-panel { max-height: 72%; min-height: 138px; }
  .object-inspection--focus { top: 47%; max-height: calc(100% - 12px); min-height: 238px; grid-template-columns: 31% 1fr; }
  .object-focus-art { min-height: 238px; }
  .object-focus-art::before { display: none; }
  .object-focus-art img { width: 92%; height: 88%; }
  .object-inspection-copy { padding: 18px 28px 15px 20px; }
  .object-inspection-copy h2 { margin-bottom: 6px; font-size: 17px; }
  .object-inspection-copy > p { font-size: 11px; line-height: 1.5; }
  .object-inspection--quick { max-height: 78%; }
  .investigation-portrait { right: -2%; bottom: 103px; width: auto; height: min(calc(100% - 58px), 47vw); max-height: none; }
  .investigation-dialogue-box { bottom: 6px; min-height: 102px; padding: 24px 22px 10px; }
  .investigation-dialogue-box > p { min-height: 34px; font-size: 12px; line-height: 1.48; }
  .choice-seen { font-size: 7px; }
  .intro-message { max-height: calc(100% - 20px); overflow-y: auto; padding: 18px 24px; }
  .intro-message h2 { margin: 4px 0 8px; font-size: 17px; }
  .intro-message > p { font-size: 13px; line-height: 1.55; }
  .intro-thought-portrait { bottom: 95px; height: calc(100% - 55px); width: auto; }
  .intro-thought-box, .ending-lead-line, .ending-afterimage-box { bottom: 6px; min-height: 100px; padding: 22px 22px 10px; }
  .intro-thought-box p, .ending-lead-line p, .ending-afterimage-box p { font-size: 12px; line-height: 1.48; }
  .puzzle-panel { max-height: calc(100% - 14px); overflow-y: auto; padding: 16px; }
  .puzzle-panel h3 { margin-bottom: 10px; font-size: 16px; }
  .keypad-display { margin-bottom: 8px; padding: 8px; font-size: 18px; }
  .keypad-grid { gap: 5px; }
  .keypad-grid button { min-height: 34px; }
  .wire-cut-stage { min-height: 145px; }
}

/* Diegetic HUD and menu presentation */
.game-stage { inset: 0; }

.game-icon {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: #9eb8b4;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 19px;
  line-height: 1;
}
.game-icon > img { width: 100%; height: 100%; object-fit: contain; filter: saturate(.65) brightness(.92); }
.game-icon.has-image > span { display: none; }
.game-icon > span { display: block; }

.game-hud-buttons {
  position: absolute;
  z-index: 50;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
}
.game-hud-buttons > button {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(115, 153, 150, .38);
  border-radius: 50%;
  color: #9aaba9;
  background:
    radial-gradient(circle at 50% 43%, rgba(37, 58, 59, .94), rgba(7, 13, 16, .97) 69%),
    #0b1216;
  box-shadow: 0 10px 35px rgba(0,0,0,.58), inset 0 0 0 3px rgba(120,158,154,.05);
  cursor: pointer;
  backdrop-filter: blur(7px);
}
.game-hud-buttons > button::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(145, 174, 169, .1);
  border-radius: 50%;
  pointer-events: none;
}
.game-hud-buttons > button:hover,
.game-hud-buttons > button.is-active { border-color: #7ba9a4; color: #e2eeeb; transform: translateY(-2px); }
.game-hud-buttons > button .game-icon { width: 32px; height: 32px; }
.game-hud-buttons > button > span:not(.game-icon) { font-size: 9px; letter-spacing: .08em; }
.game-hud-buttons > button > em {
  position: absolute;
  top: -3px;
  right: -1px;
  min-width: 20px;
  padding: 3px 5px;
  border: 1px solid #6e9c97;
  border-radius: 12px;
  color: #e8f6f2;
  background: #1a3432;
  font-size: 9px;
  font-style: normal;
}

.menu-overlay {
  position: absolute;
  z-index: 72;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(2, 5, 7, .74);
  backdrop-filter: blur(7px) saturate(.7);
  animation: menu-fade-in .18s ease-out;
}
@keyframes menu-fade-in { from { opacity: 0; } }
.menu-overlay .collection-drawer {
  position: relative;
  z-index: 1;
  inset: auto;
  width: min(1100px, 100%);
  height: min(820px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(133, 163, 157, .48);
  background:
    url("/assets/ui/frames/ui_frame_notebook_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(8, 14, 16, .94), rgba(5, 10, 13, .98));
  box-shadow: 0 35px 120px rgba(0,0,0,.84), inset 0 0 55px rgba(87, 123, 119, .05);
  animation: menu-panel-in .2s ease-out;
}
.menu-overlay--inventory .collection-drawer {
  width: min(780px, 100%);
  height: min(610px, 88%);
  background:
    url("/assets/ui/frames/ui_frame_inventory_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(9, 15, 17, .93), rgba(5, 10, 13, .98));
}
@keyframes menu-panel-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.menu-overlay .collection-drawer > header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(120, 154, 151, .21);
  background: linear-gradient(180deg, rgba(24, 37, 39, .72), rgba(8, 15, 18, .34));
}
.menu-title { display: flex; align-items: center; gap: 13px; }
.menu-title > .game-icon { width: 43px; height: 43px; }
.menu-title h2 { margin: 0; color: #e3ece9; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 26px; font-weight: 400; }
.menu-close {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(112, 146, 143, .22);
  color: #94a6a4;
  background: rgba(8, 14, 17, .68);
  cursor: pointer;
}
.menu-close:hover { border-color: #779f9a; color: #edf8f5; }
.menu-close .game-icon { width: 27px; height: 27px; }

.menu-overlay .drawer-tabs {
  min-height: 70px;
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  padding: 0 22px;
  border-bottom: 1px solid rgba(121, 155, 152, .25);
  overflow: visible;
  background: rgba(5, 10, 13, .54);
}
.menu-overlay .drawer-tabs button {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #72817f;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}
.menu-overlay .drawer-tabs button .game-icon { width: 25px; height: 25px; opacity: .72; }
.menu-overlay .drawer-tabs button.is-active {
  border-bottom-color: #84aea8;
  color: #dce8e5;
  background: linear-gradient(180deg, transparent, rgba(84, 125, 119, .1));
}
.menu-overlay .drawer-tabs button.is-active .game-icon { opacity: 1; }
.menu-overlay .drawer-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 34px;
  scrollbar-color: #3c5a57 transparent;
}
.menu-overlay--inventory .drawer-content { padding: 24px; }
.inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.inventory-card { min-height: 128px; align-content: start; transition: border-color .16s ease, background .16s ease; }
.inventory-card.is-combine-source { border-color: #a69862; background: rgba(52, 47, 29, .74); }
.item-card-actions button { display: inline-flex; align-items: center; gap: 5px; }
.item-card-actions .game-icon { width: 19px; height: 19px; }
.menu-overlay--notebook .stack-list,
.menu-overlay--notebook .profile-list,
.menu-overlay--notebook .journal-list { max-width: 900px; margin: 0 auto; }
.menu-overlay--notebook .ending-grid { max-width: 900px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 auto; }

.settings-page { max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0 auto; }
.settings-page section {
  padding: 20px;
  border: 1px solid rgba(119, 150, 147, .24);
  background: rgba(14, 22, 25, .72);
}
.settings-page section h3 { margin: 0 0 14px; color: #d5e1de; font-family: "Nanum Myeongjo", "Batang", serif; font-size: 18px; font-weight: 400; }
.settings-page__system { grid-column: 1 / -1; }
.setting-row {
  display: grid;
  grid-template-columns: 30px minmax(90px, 1fr) minmax(120px, 2fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border-bottom: 1px solid rgba(119, 150, 147, .1);
  color: #aab7b5;
  font-size: 11px;
}
.setting-row .game-icon { width: 24px; height: 24px; opacity: .78; }
.setting-row input[type="range"] { width: 100%; accent-color: #6f9f99; }
.setting-row output { color: #738784; font-family: monospace; text-align: right; }
.setting-row--buttons { grid-template-columns: 30px minmax(90px, 1fr) 2fr; }
.setting-row--buttons > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.setting-row--buttons button {
  min-height: 34px;
  border: 1px solid #354947;
  color: #7c8d8b;
  background: #0c1518;
  cursor: pointer;
  font-size: 10px;
}
.setting-row--buttons button.is-active { border-color: #719e99; color: #e0ebe8; background: #18302e; }
.setting-toggle,
.reset-save-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 13px;
  border: 1px solid #354947;
  color: #9dadaa;
  background: #0b1417;
  cursor: pointer;
  text-align: left;
}
.setting-toggle strong { margin-left: auto; color: #657876; font-size: 10px; }
.setting-toggle.is-active { border-color: #5f8d88; color: #d7e6e2; background: #142925; }
.setting-toggle .game-icon { width: 26px; height: 26px; }
.setting-save-button {
  border-color: #587d78;
  color: #d9e8e5;
  background: linear-gradient(90deg, #132523, #0b1518);
}

/* Scrolling panels must not pass their gesture to the room behind them. */
.drawer-content,
.drawer-tabs,
.object-inspection--quick,
.object-inspection-copy,
.dialogue-choice-panel,
.investigation-action-panel,
.puzzle-panel,
.rotary-dials,
.balance-channels,
.debug-checkpoint-list {
  overscroll-behavior: contain;
}
.setting-save-button strong { color: #9adbd2; }
.setting-save-button:hover { border-color: #83b6b0; background: linear-gradient(90deg, #1a3531, #0d1a1d); }
.reset-save-button { justify-content: center; border-color: #65464a; color: #c5a7aa; background: #1b1114; }
.desktop-system-actions { display: grid; gap: 8px; margin-bottom: 14px; }
.desktop-system-actions .setting-toggle,
.desktop-system-actions .reset-save-button { margin-top: 0; }

/* Dialogue scenes now keep the current room visible behind the cast. */
.dialogue-scene { background: transparent; }
.dialogue-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.dialogue-scene-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 5, 7, .34), rgba(2, 5, 7, .15) 42%, rgba(2, 5, 7, .82)),
    radial-gradient(ellipse at 50% 43%, transparent 15%, rgba(2, 5, 7, .42) 78%);
  backdrop-filter: saturate(.62) brightness(.72);
}
.dialogue-portrait {
  bottom: 174px;
  width: auto;
  height: min(78vh, 760px, calc(36vw * 720 / 520));
  max-height: none;
  aspect-ratio: 520 / 720;
}
.dialogue-portrait--left { left: max(2%, calc(50% - 590px)); }
.dialogue-portrait--right { right: max(2%, calc(50% - 590px)); }
.dialogue-identity-veil {
  top: 18%;
  left: 27%;
  width: 46%;
  height: 24%;
  filter: blur(7px);
}
.investigation-portrait {
  bottom: 130px;
  width: auto;
  height: min(74vh, 740px, calc(34vw * 720 / 520));
  max-height: none;
  aspect-ratio: 520 / 720;
}
.investigation-portrait .portrait-identity-veil,
.intro-thought-portrait .portrait-identity-veil {
  top: 18%;
  left: 27%;
  width: 46%;
  height: 24%;
  filter: blur(7px);
}
.intro-thought-portrait {
  bottom: 122px;
  width: auto;
  height: min(74vh, 740px, calc(34vw * 720 / 520));
  aspect-ratio: 520 / 720;
}

/* Keep the P-00 garment palette stable between reactions; mood is carried by the scene treatment. */
.investigation-character-scene.mood-uneasy .investigation-portrait,
.investigation-character-scene.mood-focused .investigation-portrait {
  filter: saturate(.42) brightness(.7);
}
.dialogue-box > p,
.investigation-dialogue-box > p,
.intro-message > p,
.intro-thought-box p,
.ending-lead-line p,
.ending-afterimage-box p { white-space: pre-wrap; }

/* Minigame resources are layered below live labels and controls. */
.puzzle-panel {
  border-color: rgba(114, 151, 147, .68);
  background:
    url("/assets/ui/minigames/ui_minigame_keypad_panel.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(11, 19, 22, .91), rgba(5, 9, 12, .96));
}
.keypad-display {
  box-shadow: inset 0 0 18px rgba(56, 112, 104, .18);
  text-shadow: 0 0 9px rgba(147, 222, 211, .34);
}
.keypad-grid button {
  background:
    url("/assets/ui/minigames/ui_minigame_keypad_key_default.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(21, 34, 37, .82), rgba(9, 16, 19, .9));
  box-shadow: inset 0 -3px rgba(0,0,0,.2);
}
.keypad-grid button:active,
.keypad-grid button.is-pressed {
  transform: translateY(2px);
  background:
    url("/assets/ui/minigames/ui_minigame_keypad_key_pressed.webp") center / 100% 100% no-repeat,
    linear-gradient(rgba(11, 22, 24, .78), rgba(20, 36, 37, .9));
}
.connect-puzzle {
  padding: 14px;
  border: 1px solid rgba(82, 116, 113, .28);
  background:
    url("/assets/ui/minigames/ui_minigame_connect_panel.webp") center / cover no-repeat,
    linear-gradient(rgba(5, 10, 13, .67), rgba(5, 10, 13, .82));
}
.wire-cut-stage {
  background:
    url("/assets/ui/minigames/ui_minigame_wire_stage.webp") center / cover no-repeat,
    linear-gradient(rgba(7, 13, 16, .35), rgba(7, 13, 16, .55)),
    radial-gradient(circle at 50% 50%, #172329, #080d10 72%);
}
.wire-cutter { overflow: visible; padding: 4px; }
.wire-cutter img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.wire-cutter.has-image { border-color: transparent; color: transparent; background: transparent; box-shadow: none; }
.wire-cutter.has-image > span { display: none; }

@media (max-width: 760px) {
  .game-stage { inset: 0; }
  .game-hud-buttons {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 7px;
  }
  .game-hud-buttons > button { width: 58px; height: 58px; }
  .game-hud-buttons > button .game-icon { width: 27px; height: 27px; }
  .menu-overlay { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .menu-overlay .collection-drawer,
  .menu-overlay--inventory .collection-drawer { width: 100%; height: 100%; }
  .menu-overlay--inventory .collection-drawer { height: min(78vh, 650px); }
  .menu-overlay .collection-drawer > header { min-height: 70px; padding: 12px 14px; }
  .menu-title > .game-icon { width: 35px; height: 35px; }
  .menu-title h2 { font-size: 20px; }
  .menu-close { width: 39px; height: 39px; }
  .menu-overlay .drawer-tabs {
    min-height: 62px;
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    padding: 0 5px;
  }
  .menu-overlay .drawer-tabs button { flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 9px; }
  .menu-overlay .drawer-tabs button .game-icon { width: 23px; height: 23px; }
  .menu-overlay .drawer-content,
  .menu-overlay--inventory .drawer-content { padding: 14px 12px 22px; }
  .inventory-grid { grid-template-columns: 1fr; }
  .menu-overlay--notebook .ending-grid { grid-template-columns: 1fr; }
  .settings-page { grid-template-columns: 1fr; }
  .settings-page__system { grid-column: 1; }
  .setting-row { grid-template-columns: 26px 84px minmax(80px, 1fr) 30px; gap: 7px; }
  .setting-row--buttons { grid-template-columns: 26px 84px 1fr; }
  .setting-row--buttons > div { grid-template-columns: repeat(2, 1fr); }
  .dialogue-portrait {
    bottom: 218px;
    width: auto;
    height: min(65vh, 700px, calc(67vw * 720 / 520));
  }
  .dialogue-portrait--left { left: -17%; }
  .dialogue-portrait--right { right: -17%; }
  .dialogue-identity-veil { top: 18%; left: 27%; width: 46%; height: 24%; }
  .investigation-portrait { right: -12%; bottom: 174px; width: auto; height: min(65vh, 700px, calc(67vw * 720 / 520)); }
  .investigation-portrait--left { right: auto; left: -12%; }
  .intro-thought-portrait { right: -14%; bottom: 150px; width: auto; height: min(65vh, 700px, calc(67vw * 720 / 520)); }
  .item-acquisition-overlay { padding: 12px; }
  .item-acquisition-card {
    width: min(470px, 100%);
    min-height: 0;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px 18px;
    padding: 28px 26px 24px;
  }
  .item-acquisition-visual { width: 98px; height: 98px; }
  .item-acquisition-visual > span { font-size: 40px; }
  .item-acquisition-copy h2 { margin-bottom: 7px; font-size: 21px; }
  .item-acquisition-copy p { font-size: 11px; line-height: 1.55; }
  .item-acquisition-copy strong { margin-top: 10px; }
  .item-acquisition-card > button { min-width: 132px; margin-top: 2px; }
  .toast { top: max(12px, env(safe-area-inset-top)); }
  .resolution-feedback section {
    min-width: calc(100% - 28px);
    max-width: calc(100% - 28px);
    padding: 16px 24px 18px;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .room-canvas { width: calc(100vh * 16 / 9); }
}

@media (max-height: 620px) and (orientation: landscape) {
  .game-stage { inset: 0; }
  .game-hud-buttons { right: 9px; bottom: 9px; }
  .game-hud-buttons > button { width: 51px; height: 51px; }
  .game-hud-buttons > button > span:not(.game-icon) { display: none; }
  .game-hud-buttons > button .game-icon { width: 29px; height: 29px; }
  .menu-overlay .collection-drawer > header { min-height: 58px; padding: 8px 14px; }
  .menu-overlay .drawer-tabs { min-height: 48px; }
  .menu-overlay .drawer-content { padding: 10px 16px 16px; }
  .dialogue-portrait { bottom: 120px; height: min(calc(100% - 38px), calc(32vw * 720 / 520)); width: auto; }
}

/* Resource-backed controls and restrained noir frames. */
.room-view-arrow {
  width: 60px;
  height: 118px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  color: #b8cfcb;
  background: url("/assets/ui/frames/ui_button_nav.svg") center / 100% 100% no-repeat;
  box-shadow: none;
}
.room-view-arrow--left {
  left: 0;
  border: 0;
  border-radius: 0;
}
.room-view-arrow--right {
  right: 0;
  border: 0;
  border-radius: 0;
  background: url("/assets/ui/frames/ui_button_nav.svg") center / 100% 100% no-repeat;
  transform: translateY(-50%) scaleX(-1);
}
.room-view-arrow:hover {
  color: #effffc;
  filter: brightness(1.22);
}
.room-view-arrow .game-icon { width: 35px; height: 35px; }
.room-view-arrow .game-icon img { filter: saturate(.45) brightness(1.28); }

.closeup-back-button {
  border: 0;
  border-radius: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    rgba(6, 14, 17, .94);
  box-shadow: 0 13px 34px rgba(0,0,0,.48);
}
.closeup-back-button:hover {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    rgba(12, 27, 29, .97);
  filter: brightness(1.18);
}

.puzzle-close,
.debug-checkpoint-close {
  display: grid;
  place-items: center;
  padding: 3px;
  border: 0;
  background: transparent;
}
.puzzle-close .game-icon,
.debug-checkpoint-close .game-icon { width: 27px; height: 27px; }

.dialogue-box {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(6, 12, 16, .97);
  box-shadow: 0 22px 84px rgba(0,0,0,.75);
}
.dialogue-scene--narration .dialogue-scene-shade {
  background:
    linear-gradient(180deg, rgba(2, 5, 7, .24), rgba(2, 5, 7, .1) 45%, rgba(2, 5, 7, .72)),
    radial-gradient(ellipse at 50% 48%, transparent 18%, rgba(2, 5, 7, .34) 82%);
}
.dialogue-box--narration {
  bottom: max(11%, calc(env(safe-area-inset-bottom) + 24px));
  width: min(760px, calc(100% - 52px));
  min-height: 112px;
  padding: 28px 42px 23px;
  background:
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(7, 12, 15, .9);
  box-shadow: 0 18px 64px rgba(0,0,0,.58);
}
.dialogue-box--narration > p {
  min-height: 0;
  color: #bcc7c5;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.75;
  text-align: center;
}
.dialogue-scene--thought .dialogue-scene-shade {
  background:
    linear-gradient(180deg, rgba(2, 5, 8, .32), rgba(3, 8, 12, .16) 42%, rgba(2, 5, 8, .78)),
    radial-gradient(ellipse at 72% 48%, transparent 10%, rgba(2, 6, 9, .4) 78%);
}
.dialogue-scene--thought .dialogue-portrait--p00 {
  filter: saturate(.62) brightness(.78);
}
.dialogue-box--thought {
  background:
    linear-gradient(90deg, rgba(20, 43, 47, .34), transparent 28%),
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(5, 11, 15, .97);
  box-shadow:
    inset 4px 0 0 rgba(90, 139, 136, .45),
    0 22px 84px rgba(0,0,0,.75);
}
.dialogue-box--thought > p {
  color: #c7d2d3;
}
.speaker-name {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #142725;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.dialogue-choice-panel {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_choice_panel.svg") center / 100% 100% no-repeat,
    rgba(7, 13, 17, .985);
}
.dialogue-choice-panel button,
.dialogue-choice-panel button.is-progress,
.dialogue-choice-panel button.is-seen {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #101a1f;
  box-shadow: inset 0 0 0 1px rgba(102, 134, 130, .08);
  transition: filter .13s ease, transform .13s ease, color .13s ease;
}
.dialogue-choice-panel button:hover,
.dialogue-choice-panel button.is-seen:hover {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #17262a;
  filter: brightness(1.22);
  transform: translateX(3px);
}
.dialogue-choice-panel button.is-progress {
  color: #d8cba5;
  filter: sepia(.12);
}
.dialogue-choice-panel button.is-seen {
  color: #687679;
  filter: grayscale(.55) brightness(.74);
}

.object-inspection {
  border: 0;
  border-left: 0;
  background:
    url("/assets/ui/frames/ui_frame_choice_panel.svg") center / 100% 100% no-repeat,
    linear-gradient(135deg, rgba(18, 31, 36, .98), rgba(5, 10, 13, .98));
}
.object-inspection--quick {
  background:
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(7, 14, 18, .97);
}
.investigation-dialogue-box,
.intro-thought-box,
.intro-message,
.ending-lead-line,
.ending-afterimage-box {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(6, 12, 16, .97);
}
.investigation-character-scene.is-thought .investigation-dialogue-box,
.investigation-character-scene.is-spoken .investigation-dialogue-box {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_dialogue_minimal.svg") center / 100% 100% no-repeat,
    rgba(6, 12, 16, .97);
}
.investigation-speaker {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #122421;
}
.investigation-action-panel {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_choice_panel.svg") center / 100% 100% no-repeat,
    rgba(6, 12, 16, .985);
}
.investigation-action-panel .action-button,
.investigation-action-panel .action-button:disabled {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #101a1f;
}
.investigation-action-panel .action-button:not(:disabled):hover {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #17262a;
  filter: brightness(1.2);
  transform: translateX(3px);
}

.item-use-button,
.item-combine-button,
.item-disassemble-button,
.combine-guide button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #101a1f;
}
.item-use-button:hover,
.item-combine-button:hover,
.item-disassemble-button:hover,
.combine-guide button:hover {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    #17262a;
  filter: brightness(1.18);
}
.item-use-button .game-icon,
.item-combine-button .game-icon,
.item-disassemble-button .game-icon { width: 20px; height: 20px; }

.tutorial-overlay section {
  border: 0;
  background:
    url("/assets/ui/frames/ui_frame_choice_panel.svg") center / 100% 100% no-repeat,
    rgba(7, 14, 18, .98);
}
.tutorial-overlay button,
.ending-content button,
.completion-card button,
.start-overlay button {
  border: 0;
  border-radius: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    rgba(15, 29, 31, .94);
}
.tutorial-overlay button:hover,
.ending-content button:hover,
.completion-card button:hover,
.start-overlay button:hover {
  border: 0;
  background:
    url("/assets/ui/frames/ui_button_choice.svg") center / 100% 100% no-repeat,
    rgba(24, 43, 44, .98);
  filter: brightness(1.17);
}

.ending-collection { display: grid; gap: 34px; }
.ending-collection-group > header {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 0 0 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(115, 145, 141, .24);
}
.ending-collection-group > header span {
  color: #718784;
  font-size: 8px;
  letter-spacing: .2em;
}
.ending-collection-group > header h3 {
  margin: 0;
  color: #d4dfdc;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 18px;
  font-weight: 400;
}
.ending-collection-group > header strong {
  margin-left: auto;
  color: #b7a36f;
  font-family: monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
}
.menu-overlay--notebook .ending-grid {
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ending-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #090d10;
  isolation: isolate;
}
.ending-card::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background: url("/assets/ui/frames/ui_frame_ending_card.svg") center / 100% 100% no-repeat;
}
.ending-card > img {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .18s ease, transform .24s ease;
}
.ending-card__shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(3,5,7,.06) 24%, rgba(3,5,7,.52) 58%, rgba(3,5,7,.97) 88%);
}
.ending-card__copy {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 21px;
  left: 18px;
}
.ending-card__copy > span {
  color: #cf666c;
  font-family: monospace;
  font-size: 10px;
  letter-spacing: .15em;
}
.ending-card__copy h3 { margin: 8px 0 6px; color: #eee4df; font-size: 17px; }
.ending-card__copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #9ca8a7;
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.ending-card.is-unlocked:hover > img { transform: scale(1.025); filter: brightness(1.08); }
.ending-card.is-locked { opacity: .68; filter: none; }
.ending-card.is-locked > img {
  filter: grayscale(1) blur(5px) brightness(.35);
  transform: scale(1.08);
}
.ending-card.is-locked .ending-card__shade {
  background:
    repeating-linear-gradient(0deg, rgba(110,135,131,.04) 0 2px, rgba(0,0,0,.08) 3px 5px),
    linear-gradient(180deg, rgba(3,5,7,.32), rgba(3,5,7,.98));
}

.ending-scene-art,
.ending-card-art,
.ending-epilogue-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ending-scene-art {
  background: var(--ending-art) center / cover no-repeat;
  filter: saturate(.55) brightness(calc(.76 - var(--ending-progress) * .24));
  transform: scale(1.035);
}
.ending-card-art {
  object-fit: cover;
  filter: saturate(.62) brightness(.52);
}
.ending-overlay--death .ending-scene-art {
  background-color: #020406;
  background-size: contain;
}
.ending-overlay--death .ending-card-art {
  object-fit: contain;
  background: #020406;
  filter: saturate(.58) brightness(.56);
}
.ending-card-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 43%, transparent 0 22%, rgba(2,3,5,.42) 62%, rgba(2,3,5,.94) 100%),
    linear-gradient(180deg, rgba(3,4,5,.1), rgba(3,4,5,.88));
}
.ending-overlay--card .ending-content {
  width: min(690px, calc(100% - 42px));
  padding: 48px 58px 42px;
  background:
    url("/assets/ui/frames/ui_frame_ending_card.svg") center / 100% 100% no-repeat,
    rgba(6,8,10,.66);
  text-shadow: 0 2px 12px #000;
}
.ending-overlay--outcome .ending-number { color: #c9b57e; }
.ending-overlay--outcome .ending-content h2 { color: #f1e9d5; }

.ending-overlay--epilogue {
  cursor: pointer;
  overflow: hidden;
  background: #020406;
}
.ending-epilogue-art {
  object-fit: cover;
  animation: ending-epilogue-drift 9s ease-out both;
}
@keyframes ending-epilogue-drift {
  from { transform: scale(1.045); }
  to { transform: scale(1); }
}
.ending-epilogue-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2,4,6,.16), transparent 42%, rgba(2,4,6,.88) 82%),
    radial-gradient(ellipse at 50% 45%, transparent 20%, rgba(2,4,6,.42) 96%);
}
.ending-epilogue-caption {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  padding: 9px 14px;
  color: #d7d2c2;
  background: rgba(5,8,10,.76);
  font-size: 9px;
  letter-spacing: .09em;
}
.ending-epilogue-copy {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(980px, calc(100% - 42px));
  min-height: 150px;
  padding: 38px 42px 26px;
  background:
    url("/assets/ui/frames/ui_frame_epilogue_caption.svg") center / 100% 100% no-repeat,
    rgba(5,9,12,.94);
  transform: translateX(-50%);
}
.ending-epilogue-copy p {
  margin: 0;
  color: #e2e5df;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.8;
}

@media (max-width: 980px) {
  .menu-overlay--notebook .ending-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .room-view-arrow { width: 52px; height: 104px; }
  .room-view-arrow .game-icon { width: 31px; height: 31px; }
  .menu-overlay--notebook .ending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ending-card { min-height: 275px; }
  .ending-overlay--card .ending-content { padding: 38px 31px 31px; }
  .ending-epilogue-copy { bottom: max(8px, env(safe-area-inset-bottom)); min-height: 120px; padding: 28px 24px 18px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .room-view-arrow { width: 48px; height: 94px; }
  .ending-overlay--card .ending-content { padding: 24px 36px 20px; }
  .ending-content h2 { margin: 8px 0; font-size: 35px; }
  .ending-content p { font-size: 12px; line-height: 1.55; }
  .ending-content button { margin-top: 14px; }
  .ending-epilogue-copy { bottom: 7px; min-height: 92px; padding: 21px 24px 12px; }
  .ending-epilogue-copy p { font-size: 12px; line-height: 1.5; }
}
