/* ============================================================
   WARD 13 — found-footage asylum horror
   ============================================================ */
:root {
  --ink: #d6d1c3;
  --ink-dim: #8d9184;
  --ink-faint: #5f665c;
  --red: #b3271e;
  --red-bright: #e34234;
  --green: #7f9b82;
  --amber: #c2a06a;
  --paper: #cfc7b5;
  --black: #040504;
  --mono: "Bodoni MT", "Didot", "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "Bodoni MT", "Times New Roman", serif;
  --sans: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "Bodoni MT", "Times New Roman", serif;
  --display: "Bodoni MT", "Didot", "Times New Roman", "Songti SC", "SimSun", serif;
  --danger: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: .015em;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border: 1px solid rgba(190, 195, 175, .28);
  border-bottom-color: rgba(190, 195, 175, .14);
  border-radius: 2px;
  background: rgba(255, 255, 255, .035);
  color: #c8c4b5;
  font-family: var(--mono);
  font-size: .82em;
  line-height: 1.55;
  text-align: center;
}
.hidden { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}
#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  image-rendering: pixelated;
  filter: contrast(1.055) saturate(.82) brightness(.98);
}
body.render3d #view {
  image-rendering: auto;
  filter: none;
}
#lens-dirt {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: screen;
  background-repeat: no-repeat;
  background-size: cover;
}
body.quality-low #lens-dirt { display: none; }
body.quality-low #scanlines { opacity: .1; }
body.quality-low #vignette { opacity: .8; }
body.render3d #scanlines { opacity: .055; }
body.render3d #vignette {
  background:
    radial-gradient(ellipse at 50% 48%, transparent 38%, rgba(0, 0, 0, .28) 66%, rgba(0, 0, 0, .78) 90%, #000 112%),
    linear-gradient(180deg, rgba(0, 0, 0, .34), transparent 13%, transparent 84%, rgba(0, 0, 0, .48));
}

/* ---------- film overlays ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; }

#vignette {
  z-index: 5;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 30%, rgba(0, 0, 0, .34) 62%, rgba(0, 0, 0, .82) 88%, #000 112%),
    linear-gradient(180deg, rgba(0, 0, 0, .42), transparent 12%, transparent 84%, rgba(0, 0, 0, .55));
}
#scanlines {
  z-index: 6;
  opacity: .33;
  mix-blend-mode: multiply;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .32) 0px,
    rgba(0, 0, 0, .32) 1px,
    transparent 1px,
    transparent 3px
  );
}
#scanlines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 24%;
  background: linear-gradient(to bottom, transparent, rgba(200, 215, 200, .022), transparent);
  animation: scanbar 11s linear infinite;
}
@keyframes scanbar {
  0% { top: -30%; }
  100% { top: 115%; }
}
#grain {
  z-index: 7;
  width: 100%;
  height: 100%;
  opacity: .035;
  mix-blend-mode: screen;
  image-rendering: auto;
}
#danger {
  z-index: 8;
  background: radial-gradient(ellipse at 50% 50%, transparent 36%, rgba(86, 5, 2, .38) 74%, rgba(105, 7, 3, .66) 100%);
  opacity: var(--danger);
  transition: opacity .25s linear;
}
#blood {
  z-index: 9;
  opacity: 0;
  transition: opacity .9s ease;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 44%, rgba(74, 2, 0, .55) 92%),
    radial-gradient(ellipse at 12% 8%, rgba(90, 3, 0, .38), transparent 32%),
    radial-gradient(ellipse at 88% 4%, rgba(80, 2, 0, .3), transparent 28%);
}
#interference {
  z-index: 12;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 12px, transparent 12px 25px);
}
#interference.on { animation: interference .18s steps(2) infinite; }
@keyframes interference {
  0% { opacity: .16; transform: translateY(0); }
  50% { opacity: .4; transform: translateY(-3px); }
  100% { opacity: .2; transform: translateY(2px); }
}
#flash {
  z-index: 70;
  opacity: 0;
  background: #e8e4d6;
  mix-blend-mode: screen;
}
#fade {
  z-index: 65;
  opacity: 0;
  background: #000;
}
#fatal {
  z-index: 300;
  position: fixed;
  left: 12px;
  bottom: 12px;
  max-width: 80vw;
  white-space: pre-wrap;
  color: #ff6a5c;
  background: rgba(0, 0, 0, .86);
  padding: 12px 16px;
  font-size: 12px;
  border: 1px solid #5d1611;
}

/* ---------- camcorder HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: var(--mono);
  animation: hud-in .7s ease both;
}
@keyframes hud-in { from { opacity: 0; } to { opacity: 1; } }

.cam-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 17px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: rgba(201, 210, 191, .68);
  text-shadow: 0 1px 6px #000;
}
.cam-block { display: flex; align-items: center; gap: 16px; }
.cam-right { color: rgba(201, 210, 191, .45); }
.rec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d44538;
  font-weight: 700;
  letter-spacing: .2em;
}
.rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e44435;
  box-shadow: 0 0 0 0 rgba(228, 68, 53, .5);
  animation: rec-blink 1.15s steps(1) infinite;
}
@keyframes rec-blink {
  0%, 61% { opacity: 1; }
  62%, 100% { opacity: .18; }
}
.timecode { color: rgba(210, 218, 201, .72); font-variant-numeric: tabular-nums; }
.cam-batt { display: inline-flex; align-items: center; gap: 5px; }
.cam-batt i {
  width: 13px;
  height: 6px;
  border: 1px solid currentColor;
  position: relative;
  display: inline-block;
  opacity: .7;
}
.cam-batt i::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 1px;
  width: 2px;
  height: 2px;
  background: currentColor;
}
.cam-batt b { font-weight: 400; }

.cam-frame { position: absolute; inset: 12px; opacity: .42; }
.cam-frame .c {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(200, 208, 190, .38);
  border-style: solid;
  border-width: 0;
}
.cam-frame .tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.cam-frame .tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.cam-frame .bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.cam-frame .br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

#objective {
  position: absolute;
  top: 58px;
  left: 24px;
  width: 286px;
  padding-left: 12px;
  border-left: 1px solid rgba(175, 60, 45, .5);
}
.floor-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 5px;
  border: 1px solid rgba(186, 154, 96, .45);
  color: var(--amber);
  font-size: 9px;
  letter-spacing: .16em;
  vertical-align: 1px;
}
body.render3d .floor-tag { text-shadow: 0 0 8px rgba(198, 159, 92, .3); }
.world-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border: 1px solid rgba(120, 150, 125, .3);
  color: rgba(153, 181, 157, .8);
  font-size: 9px;
  letter-spacing: .12em;
  vertical-align: 1px;
}
.world-tag.other {
  border-color: rgba(190, 62, 42, .55);
  color: #d17b65;
  background: rgba(85, 18, 12, .22);
  text-shadow: 0 0 8px rgba(195, 60, 40, .35);
}
body.other-world #vignette {
  background:
    radial-gradient(ellipse at 50% 48%, transparent 26%, rgba(36, 4, 2, .38) 62%, rgba(9, 0, 0, .88) 90%, #000 112%),
    linear-gradient(180deg, rgba(14, 2, 1, .48), transparent 13%, transparent 82%, rgba(18, 2, 1, .6));
}
body.other-world #scanlines { opacity: .2; }
body.other-world #danger { mix-blend-mode: screen; }
.panel-label {
  font-size: 9px;
  letter-spacing: .3em;
  color: rgba(160, 170, 148, .58);
  margin-bottom: 5px;
}
.objective-main {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .12em;
  color: rgba(226, 220, 204, .94);
}
.objective-main b {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 400;
  color: #cf4b3d;
  margin-right: 2px;
}
.objective-sub {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .05em;
  color: rgba(160, 168, 150, .55);
  font-family: var(--sans);
}
.objective-sub.alert { color: #cf4b3d; }

#room-tag {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .28em;
  color: rgba(215, 199, 166, .6);
  text-shadow: 0 0 8px rgba(0, 0, 0, .9);
  pointer-events: none;
}
body.touch #room-tag { top: 28px; font-size: 10px; letter-spacing: .2em; }

#condition {
  position: absolute;
  top: 58px;
  right: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(160, 168, 150, .2);
  font-size: 9px;
  letter-spacing: .16em;
  color: rgba(169, 177, 157, .65);
}
#condition.injured {
  border-color: rgba(200, 45, 32, .55);
  color: #df594b;
  background: rgba(80, 8, 4, .18);
}

#minimap {
  position: absolute;
  top: 92px;
  right: 24px;
  z-index: 14;
  width: 194px;
  padding: 7px 7px 6px;
  border: 1px solid rgba(165, 170, 150, .2);
  background: rgba(3, 6, 4, .62);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.minimap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .18em;
  color: rgba(166, 172, 152, .58);
}
.minimap-head b {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(214, 203, 177, .88);
}
#minimap-canvas {
  display: block;
  width: 180px;
  height: 180px;
  background: rgba(2, 4, 3, .66);
  image-rendering: auto;
}
.minimap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .08em;
  color: rgba(154, 160, 140, .5);
}
.minimap-legend i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 3px;
  border-radius: 50%;
}
.minimap-legend .you { background: #e3ddca; }
.minimap-legend .tape { background: #c79a4c; }
.minimap-legend .stairs { background: #8d9d89; border-radius: 0; }

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  opacity: .82;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .9));
}
#crosshair::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(226, 219, 198, .92);
  box-shadow: 0 0 4px rgba(0, 0, 0, .85);
}
#crosshair i {
  position: absolute;
  background: rgba(224, 218, 197, .88);
  box-shadow: 0 0 2px rgba(0, 0, 0, .75);
}
#crosshair i:nth-child(1) { left: 10px; top: 0; width: 2px; height: 5px; }
#crosshair i:nth-child(2) { left: 10px; bottom: 0; width: 2px; height: 5px; }
#crosshair i:nth-child(3) { top: 10px; left: 0; width: 5px; height: 2px; }
#crosshair i:nth-child(4) { top: 10px; right: 0; width: 5px; height: 2px; }
#crosshair.active { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
#crosshair.active::after { background: #d4a45c; box-shadow: 0 0 5px rgba(212, 164, 92, .6); }
#crosshair.active i { background: rgba(212, 164, 92, .95); }

/* free mouse-look: a small arrow follows the physical pointer, no click-to-lock */
#aim-cursor {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 95;
  width: 16px;
  height: 22px;
  margin: -3px 0 0 -2px;
  pointer-events: none;
  display: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .9));
}
#aim-cursor::before {
  content: "";
  display: block;
  width: 16px;
  height: 22px;
  background: rgba(224, 219, 202, .9);
  clip-path: polygon(0 0, 0 78%, 27% 59%, 52% 100%, 68% 91%, 44% 52%, 100% 52%);
}
body.playing #aim-cursor { display: none; }
body.playing,
body.playing * { cursor: none !important; }
body.photo-mode #hud { display: none !important; }

/* touch / phone controls */
#touch-ui { display: none; position: absolute; inset: 0; z-index: 60; pointer-events: none; }
body.touch.playing #touch-ui { display: block; }
#touch-look {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
}
#move-stick {
  position: absolute;
  left: calc(22px + env(safe-area-inset-left));
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 5;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1px solid rgba(193, 188, 164, .24);
  background: radial-gradient(circle, rgba(22, 27, 21, .18) 0 42%, rgba(8, 11, 8, .48) 43% 100%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .35);
  pointer-events: auto;
  touch-action: none;
}
#move-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 1px solid rgba(220, 210, 181, .36);
  background: rgba(180, 174, 148, .2);
  box-shadow: 0 0 18px rgba(0, 0, 0, .35);
  pointer-events: none;
}
#touch-actions {
  position: absolute;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 7px;
  pointer-events: auto;
}
.tbtn {
  width: 54px;
  height: 54px;
  padding: 5px 2px;
  border: 1px solid rgba(188, 182, 156, .3);
  border-radius: 50%;
  background: rgba(9, 13, 9, .6);
  color: rgba(226, 218, 195, .9);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.tbtn span { display: block; margin-top: 3px; font-family: var(--mono); font-size: 7px; letter-spacing: .06em; color: rgba(180, 174, 151, .62); }
.tbtn:active, .tbtn.pressed { background: rgba(158, 127, 72, .38); border-color: rgba(218, 183, 116, .65); }
.tbtn.small { width: 46px; height: 46px; margin: 4px 4px 0 0; }
body.touch #objective { top: 44px; left: calc(14px + env(safe-area-inset-left)); width: 220px; }
body.touch #objective .objective-sub { font-size: 9px; }
body.touch #condition { display: none; }
body.touch #minimap { top: 70px; right: calc(12px + env(safe-area-inset-right)); width: 150px; }
body.touch #minimap-canvas { width: 136px; height: 136px; }
body.touch .minimap-legend { display: none; }
body.touch #status-panel { top: 150px; left: calc(14px + env(safe-area-inset-left)); bottom: auto; width: 160px; }
body.touch #backpack {
  top: auto;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  right: auto;
  width: 170px;
  transform: translateX(-50%);
  z-index: 70;
  pointer-events: auto;
}
body.touch #radio, body.touch #hint { display: none !important; }
body.touch #interact { bottom: 34%; }
body.touch .bag-slot { pointer-events: auto; touch-action: manipulation; }
body.touch .bag-slot:active { border-color: rgba(210, 174, 106, .5); background: rgba(102, 86, 56, .25); }
body.touch.force-landscape #app {
  inset: auto;
  top: 0;
  left: 100vw;
  width: 100vh;
  height: 100vw;
  transform: rotate(90deg);
  transform-origin: top left;
}
body.touch.force-landscape #rotate-device { display: none !important; }
body.touch.force-landscape #jumpscare { position: absolute; }

#rotate-device {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 36px 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(92, 72, 42, .2), transparent 46%),
    #050705;
  color: rgba(222, 211, 184, .9);
  font-family: var(--serif);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 13px;
}
body.touch.portrait:not(.landscape-ready) #rotate-device { display: flex; }
body.touch.landscape-ready #rotate-device { display: none !important; }
#rotate-device::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(174, 160, 126, .17);
  pointer-events: none;
}
.rotate-icon {
  width: 76px;
  height: 48px;
  border: 2px solid rgba(210, 190, 150, .7);
  border-radius: 7px;
  position: relative;
  transform: rotate(90deg);
  margin-bottom: 10px;
  box-shadow: 0 0 24px rgba(0, 0, 0, .5);
}
.rotate-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: rgba(210, 190, 150, .65);
}
#rotate-device b { font-size: clamp(22px, 5vw, 34px); letter-spacing: .12em; font-weight: 700; }
#rotate-device span { max-width: 360px; font-family: var(--mono); font-size: 10px; line-height: 1.9; letter-spacing: .06em; color: rgba(174, 168, 145, .62); }
#rotate-request {
  margin-top: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(210, 180, 118, .48);
  background: rgba(36, 30, 20, .55);
  color: rgba(226, 212, 181, .9);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
}
#rotate-request:active { background: rgba(126, 100, 53, .45); }

@media (orientation: portrait) {
  body.touch #objective { width: 190px; }
  body.touch #minimap { width: 140px; }
  body.touch #minimap-canvas { width: 126px; height: 126px; }
  body.touch #status-panel { top: 145px; width: 150px; }
  body.touch #backpack {
    top: 238px;
    right: 12px;
    bottom: auto;
    left: auto;
    width: 160px;
    transform: none;
  }
  body.touch #interact { bottom: 36%; }
}

#interact {
  position: absolute;
  left: 50%;
  bottom: 24%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: rgba(2, 3, 2, .6);
  border: 1px solid rgba(200, 208, 188, .14);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  color: #d4cebd;
  white-space: nowrap;
  animation: prompt-in .22s ease both;
}
@keyframes prompt-in {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#interact kbd {
  border-color: rgba(208, 78, 62, .55);
  color: #e58a7d;
  background: rgba(120, 20, 12, .12);
}

#toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: min(680px, 82vw);
  padding: 18px 38px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(16px, 1.55vw, 21px);
  line-height: 1.85;
  letter-spacing: .07em;
  color: #d9d2c0;
  text-shadow: 0 2px 14px #000, 0 0 34px #000;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .34) 18%, rgba(0, 0, 0, .34) 82%, transparent);
  animation: toast-in .45s ease both;
}
#toast small {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .25em;
  color: rgba(190, 90, 70, .75);
}
#toast .warn { color: #d65544; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 7px); filter: blur(2px); }
  to { opacity: 1; transform: translate(-50%, 0); filter: blur(0); }
}

#radio {
  position: absolute;
  right: 24px;
  bottom: 26px;
  width: 290px;
  padding: 9px 12px 10px;
  border-left: 2px solid rgba(166, 47, 35, .6);
  background: rgba(4, 6, 4, .58);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .08em;
  color: #b4bca9;
  text-shadow: 0 1px 8px #000;
}
.radio-tag {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .3em;
  color: #c14a3c;
}

#nv {
  z-index: 10;
  opacity: 0;
  background: #2e8a51;
  mix-blend-mode: color;
  transition: opacity .18s linear;
}
#nv.on { opacity: .42; }
#nv::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(0, 0, 0, .52) 100%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, .18) 2px 3px);
}

#hide-fx {
  z-index: 14;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, .96) 0px,
    rgba(0, 0, 0, .96) 14px,
    rgba(0, 0, 0, .28) 14px,
    rgba(0, 0, 0, .08) 17px,
    transparent 17px 30px
  );
  transition: opacity .18s linear;
}
#hide-fx.on { opacity: 1; }
#hide-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #000 0%,
    rgba(0, 0, 0, .82) 9%,
    rgba(0, 0, 0, .18) 19%,
    transparent 29%,
    transparent 71%,
    rgba(0, 0, 0, .18) 81%,
    rgba(0, 0, 0, .82) 91%,
    #000 100%
  );
}
#hide-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 34%, rgba(0, 0, 0, .5) 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .9);
}

#hide-ui {
  position: absolute;
  z-index: 21;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  width: min(320px, 82vw);
  padding: 10px 14px 9px;
  border: 1px solid rgba(190, 188, 162, .14);
  border-left: 2px solid rgba(170, 48, 34, .55);
  background: rgba(3, 4, 3, .76);
  box-shadow: 0 10px 36px rgba(0, 0, 0, .55);
  font-family: var(--mono);
}
.hide-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 8px;
  letter-spacing: .26em;
  color: rgba(200, 82, 62, .78);
}
.hide-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bd4435;
  animation: rec-blink 1.15s steps(1) infinite;
}
.hide-breath-row {
  display: grid;
  grid-template-columns: 30px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .12em;
  color: rgba(195, 200, 178, .7);
}
.hide-breath-row .bar { height: 3px; background: rgba(200, 208, 188, .18); }
#breath-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: #c4bca4;
  transition: width .12s linear, background .25s;
}
#breath-fill.low { background: #c04433; }
.hide-breath-row b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  text-align: right;
  color: rgba(205, 208, 184, .72);
}
.hide-tip {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(190, 188, 162, .08);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .04em;
  color: rgba(164, 171, 153, .55);
}
.hide-tip kbd {
  border-color: rgba(190, 80, 64, .38);
  color: #d08672;
  font-size: 8px;
}

#evp {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 5px 8px;
  border: 1px solid rgba(175, 188, 155, .14);
  background: rgba(3, 5, 3, .5);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .2em;
  color: rgba(174, 185, 157, .55);
}
#evp span { margin-right: 3px; }
#evp i {
  display: block;
  width: 3px;
  height: 7px;
  background: rgba(175, 190, 160, .13);
  transition: background .2s, opacity .2s;
}
#evp i:nth-of-type(2) { height: 10px; }
#evp i:nth-of-type(3) { height: 13px; }
#evp i:nth-of-type(4) { height: 16px; }
#evp i.lit { background: rgba(184, 208, 146, .82); box-shadow: 0 0 6px rgba(160, 190, 120, .25); }
#evp.pulse { animation: evp-pulse 2.3s ease-in-out infinite; }
@keyframes evp-pulse { 50% { border-color: rgba(175, 195, 145, .3); } }
#evp b { font-weight: 400; margin-left: 4px; color: rgba(185, 205, 150, .7); }

#exit-guide {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(130, 175, 135, .2);
  background: rgba(4, 12, 7, .55);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .18em;
  color: rgba(167, 196, 167, .7);
}
.eg-label { font-size: 7px; color: rgba(150, 180, 150, .4); }
.eg-arrow { display: inline-block; color: #9bc69c; font-size: 10px; transition: transform .12s linear; }
#exit-guide.acquired { border-color: rgba(150, 200, 150, .45); box-shadow: 0 0 18px rgba(80, 150, 90, .08); }
#exit-guide b { font-weight: 400; color: #a8cba5; }

#warn-battery {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .3em;
  color: #d85746;
  text-shadow: 0 0 12px rgba(170, 30, 20, .7);
  animation: warn-blink 1.4s steps(1) infinite;
}
@keyframes warn-blink { 0%, 55% { opacity: .9; } 56%, 100% { opacity: .1; } }

#backpack {
  position: absolute;
  right: 24px;
  bottom: 94px;
  z-index: 14;
  width: 214px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(160, 168, 150, .22);
  background: rgba(4, 7, 5, .68);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
  pointer-events: none;
}
#backpack.hidden { display: none; }
.bag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .16em;
  color: rgba(158, 164, 144, .55);
}
.bag-head b {
  color: rgba(212, 201, 174, .88);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .12em;
}
.bag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.bag-slot {
  min-width: 0;
  padding: 5px 3px 4px;
  border: 1px solid rgba(150, 156, 136, .14);
  background: rgba(10, 14, 10, .38);
  text-align: center;
}
.bag-slot i {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 3px;
  position: relative;
}
.bag-slot .bag-tape { background: #b79555; border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.bag-slot .bag-battery { width: 7px; background: #6f8a5b; border-radius: 1px; }
.bag-slot .bag-battery::before { content: ""; position: absolute; left: 1px; top: -2px; width: 5px; height: 2px; background: #9da58e; }
.bag-slot .bag-med { background: #d8d5c6; border-radius: 1px; }
.bag-slot .bag-med::before,
.bag-slot .bag-med::after { content: ""; position: absolute; background: #a83d31; }
.bag-slot .bag-med::before { left: 4px; top: 1px; width: 2px; height: 8px; }
.bag-slot .bag-med::after { left: 1px; top: 4px; width: 8px; height: 2px; }
.bag-slot .bag-sed { width: 7px; background: #8b744e; border-radius: 3px 3px 1px 1px; }
.bag-slot b { display: block; font-family: var(--mono); font-size: 12px; color: rgba(231, 221, 196, .9); line-height: 1.1; }
.bag-slot span { display: block; margin-top: 2px; font-family: var(--mono); font-size: 6.5px; letter-spacing: .08em; color: rgba(154, 160, 140, .52); }
.bag-tip {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(160, 168, 150, .12);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: .05em;
  color: rgba(184, 174, 145, .58);
  text-align: center;
}

#status-panel {
  position: absolute;
  left: 24px;
  bottom: 28px;
  width: 252px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 11px 8px;
  background: linear-gradient(90deg, rgba(2, 3, 2, .5), rgba(2, 3, 2, .12) 76%, transparent);
  border-left: 1px solid rgba(175, 180, 155, .16);
}
.meter {
  display: grid;
  grid-template-columns: 34px 1fr 36px;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(190, 197, 175, .7);
}
.meter-name { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; color: rgba(190, 195, 172, .68); }
.meter b {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  text-align: right;
  color: rgba(202, 208, 184, .7);
}
.bar {
  position: relative;
  height: 3px;
  background: rgba(200, 208, 188, .18);
  overflow: hidden;
}
.bar i {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(210, 204, 180, .82);
  transform-origin: left center;
  transition: width .18s linear, background .3s;
}
.bar.sanity i { background: rgba(136, 168, 139, .86); }
.bar i.low { background: #b84032; }
.bar i.flash { animation: bar-flash .55s steps(2) infinite; }
@keyframes bar-flash { 50% { opacity: .25; } }

#hint {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: .1em;
  color: rgba(165, 173, 153, .32);
  white-space: nowrap;
}
#devhud {
  position: absolute;
  left: 10px;
  top: 47%;
  z-index: 25;
  white-space: pre;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  color: #82a57f;
  background: rgba(0, 0, 0, .62);
  padding: 8px 10px;
  border-left: 1px solid #35513a;
}

/* ---------- menu ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 50;
}
#menu {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(3, 4, 3, .975) 0%, rgba(3, 4, 3, .93) 34%, rgba(3, 4, 3, .52) 67%, rgba(3, 4, 3, .74) 100%),
    radial-gradient(ellipse at 74% 50%, rgba(18, 28, 20, .25), transparent 55%);
}
#menu::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 16%, transparent 78%, rgba(0, 0, 0, .8));
}
.menu-inner {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 9vw, 148px);
  top: 50%;
  transform: translateY(-50%);
  width: min(650px, 56vw);
}
.kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .32em;
  color: rgba(154, 165, 146, .62);
  margin-bottom: 24px;
}
.kicker span { color: #9d3b30; padding: 0 5px; }
.title-lockup {
  position: relative;
  display: inline-block;
}
.title {
  position: relative;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(58px, 8.2vw, 120px);
  line-height: .94;
  letter-spacing: .12em;
  white-space: nowrap;
  color: #cfc6b1;
  text-shadow:
    0 0 1px rgba(255, 246, 225, .42),
    0 18px 60px rgba(0, 0, 0, .9),
    5px 0 0 rgba(115, 18, 12, .3),
    -4px 0 0 rgba(28, 70, 58, .16),
    0 0 38px rgba(96, 12, 8, .18);
  animation: title-flicker 9s steps(1) infinite;
}
.title-seal {
  position: absolute;
  right: -72px;
  top: 10px;
  padding: 8px 6px;
  border: 2px solid rgba(151, 37, 27, .82);
  color: #a73328;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .08em;
  text-align: center;
  transform: rotate(-5deg);
  background: rgba(78, 12, 8, .16);
  box-shadow: 0 0 0 1px rgba(90, 16, 10, .35), 0 0 22px rgba(92, 18, 12, .16);
  opacity: .9;
}
.title-seal::before,
.title-seal::after {
  content: "";
  position: absolute;
  background: rgba(151, 37, 27, .55);
}
.title-seal::before { left: 4px; right: 4px; top: 4px; height: 1px; }
.title-seal::after { left: 4px; right: 4px; bottom: 4px; height: 1px; }
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: .5;
  pointer-events: none;
}
.title::before {
  color: rgba(155, 40, 28, .6);
  transform: translate(3px, 1px);
  clip-path: polygon(0 9%, 100% 9%, 100% 16%, 0 16%);
  animation: title-glitch-a 7.3s steps(1) infinite;
}
.title::after {
  color: rgba(120, 170, 150, .18);
  transform: translate(-4px, -1px);
  clip-path: polygon(0 64%, 100% 64%, 100% 71%, 0 71%);
  animation: title-glitch-b 8.6s steps(1) infinite;
}
@media (max-width: 900px) {
  .title-seal { display: none; }
}
@keyframes title-flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93% { opacity: .55; }
  94% { opacity: .86; }
  95% { opacity: .3; }
  97% { opacity: .72; }
}
@keyframes title-glitch-a {
  0%, 88%, 92%, 100% { transform: translate(3px, 1px); opacity: .5; }
  89% { transform: translate(-9px, 2px); opacity: .2; }
  90% { transform: translate(14px, -2px); opacity: .7; }
  91% { transform: translate(3px, 1px); }
}
@keyframes title-glitch-b {
  0%, 76%, 80%, 100% { transform: translate(-4px, -1px); opacity: .35; }
  77% { transform: translate(10px, 0); opacity: .12; }
  78% { transform: translate(-13px, 1px); opacity: .5; }
  79% { transform: translate(-4px, -1px); }
}
.title-en {
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .58em;
  color: rgba(170, 177, 157, .6);
}
.title-en span {
  display: inline-block;
  margin-left: 14px;
  letter-spacing: .2em;
  font-size: 8px;
  color: rgba(180, 72, 55, .65);
}
.menu-rule {
  width: 72px;
  height: 1px;
  background: rgba(160, 70, 55, .3);
  margin: 28px 0 22px;
  position: relative;
}
.menu-rule i {
  position: absolute;
  left: 0;
  top: -1px;
  width: 30px;
  height: 3px;
  background: #9f3125;
  box-shadow: 0 0 18px rgba(175, 40, 26, .45);
}
.tagline {
  font-family: var(--serif);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 2;
  letter-spacing: .08em;
  color: rgba(185, 181, 165, .8);
}
.tagline em {
  font-style: normal;
  color: #b95647;
  letter-spacing: .14em;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 190px;
  padding: 14px 26px;
  background: transparent;
  border: 1px solid rgba(180, 178, 155, .24);
  color: rgba(214, 208, 193, .88);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .25em;
  text-align: center;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.btn:hover {
  background: rgba(210, 203, 183, .09);
  border-color: rgba(220, 212, 190, .5);
  color: #f0e9d8;
}
.btn.primary {
  margin-top: 32px;
  border-color: rgba(174, 52, 39, .62);
  background: linear-gradient(90deg, rgba(90, 13, 8, .42), rgba(40, 5, 3, .12));
  color: #e1d7c4;
  box-shadow: inset 0 0 30px rgba(120, 17, 9, .08);
}
.btn.primary:hover {
  background: linear-gradient(90deg, rgba(135, 25, 16, .62), rgba(60, 8, 4, .24));
  border-color: #b64233;
  box-shadow: 0 0 28px rgba(125, 22, 13, .22), inset 0 0 30px rgba(160, 35, 24, .14);
}
.btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cf4435;
  box-shadow: 0 0 10px rgba(220, 55, 40, .7);
  animation: rec-blink 1.15s steps(1) infinite;
}
.menu-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 30px;
  max-width: 560px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(160, 167, 149, .55);
}
.menu-controls span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.menu-controls kbd {
  border-color: rgba(170, 177, 155, .18);
  color: rgba(190, 195, 175, .68);
  font-size: 8px;
}
.warning {
  margin-top: 28px;
  padding-left: 11px;
  border-left: 1px solid rgba(160, 60, 45, .4);
  font-family: var(--sans);
  font-size: 9.5px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: rgba(150, 157, 139, .45);
}
.best {
  margin-top: 16px;
  font-size: 9px;
  letter-spacing: .16em;
  color: rgba(190, 156, 105, .7);
}
.menu-vhs {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: rgba(195, 203, 183, .4);
}
.menu-vhs .rec { color: #c74236; }
.menu-side {
  position: absolute;
  z-index: 2;
  right: 4vw;
  top: 15%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .28em;
  text-align: right;
  color: rgba(160, 168, 148, .28);
}
.menu-side-rule { width: 58px; height: 1px; background: rgba(166, 58, 44, .28); }
.menu-footer {
  position: absolute;
  z-index: 3;
  left: 24px;
  bottom: 18px;
  right: 24px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .24em;
  color: rgba(150, 157, 139, .22);
  display: flex;
  justify-content: space-between;
}
#best-time { color: rgba(198, 160, 104, .76); }

/* ---------- pause / dead / win screens ---------- */
.overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(12, 14, 11, .72), rgba(2, 3, 2, .96) 76%),
    rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
  animation: overlay-in .35s ease both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.screen-card {
  position: relative;
  width: min(570px, 88vw);
  max-height: 90vh;
  overflow: auto;
  padding: 44px 48px 36px;
  background:
    linear-gradient(180deg, rgba(13, 15, 12, .96), rgba(5, 6, 5, .98)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
  border: 1px solid rgba(190, 192, 168, .12);
  box-shadow: 0 40px 130px rgba(0, 0, 0, .85);
  scrollbar-width: thin;
  scrollbar-color: #3b3f35 #0a0b09;
}
.screen-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 2px;
  background: #a33024;
  box-shadow: 0 0 18px rgba(160, 40, 28, .42);
}
.screen-card::after {
  content: "REC";
  position: absolute;
  right: 20px;
  top: 18px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .2em;
  color: rgba(180, 50, 40, .45);
}
.screen-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .3em;
  color: rgba(150, 160, 140, .55);
  margin-bottom: 14px;
}
.screen-kicker.red { color: rgba(208, 68, 52, .85); }
.screen-card h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.4vw, 60px);
  letter-spacing: .1em;
  font-weight: 700;
  line-height: 1.1;
  color: #d7d0be;
  text-shadow: 0 12px 40px #000;
}
.screen-line {
  margin-top: 17px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .06em;
  color: rgba(185, 180, 164, .68);
}
.screen-quote {
  margin-top: 15px;
  padding: 13px 16px;
  border-left: 1px solid rgba(160, 55, 40, .4);
  background: rgba(100, 20, 12, .055);
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(165, 158, 143, .55);
}
.stats {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(190, 192, 168, .1);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 2;
  letter-spacing: .15em;
  color: rgba(150, 160, 142, .6);
  text-transform: uppercase;
}
.screen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.screen-actions .btn { min-width: 0; flex: 1; padding: 13px 18px; letter-spacing: .18em; white-space: nowrap; }
.btn.ghost { border-color: rgba(180, 178, 155, .1); color: rgba(170, 176, 158, .55); }
.screen-actions .btn.primary { margin-top: 0; }
.quality-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(171, 151, 108, .12);
}
.quality-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  color: rgba(168, 166, 150, .55);
}
.quality-buttons { display: flex; gap: 6px; }
.quality-btn {
  background: rgba(8, 10, 8, .7);
  border: 1px solid rgba(171, 151, 108, .22);
  color: rgba(174, 168, 148, .6);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  padding: 6px 12px;
  cursor: pointer;
}
.quality-btn:hover { border-color: rgba(197, 163, 99, .5); color: var(--amber); }
.quality-auto-note {
  color: rgba(196, 185, 158, .5);
  font-size: 9px;
  letter-spacing: .04em;
}
.quality-btn.active {
  background: rgba(116, 82, 42, .28);
  border-color: rgba(197, 163, 99, .65);
  color: #d6c5a2;
  box-shadow: inset 0 0 18px rgba(190, 150, 82, .1);
}
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 10px;
  color: rgba(160, 168, 150, .55);
}
.toggles label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggles input {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(180, 185, 165, .3);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.toggles input:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #a9a58f;
}
.bgm-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(171, 151, 108, .12);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(160, 168, 150, .62);
}
.bgm-label {
  white-space: nowrap;
}
#bgm-volume {
  flex: 1;
  min-width: 80px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
#bgm-volume::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(170, 165, 145, .28);
}
#bgm-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 14px;
  margin-top: -6px;
  border: 1px solid rgba(210, 200, 178, .72);
  border-radius: 0;
  background: #a84234;
}
#bgm-volume::-moz-range-track { height: 2px; background: rgba(170, 165, 145, .28); }
#bgm-volume::-moz-range-thumb {
  width: 10px;
  height: 14px;
  border: 1px solid rgba(210, 200, 178, .72);
  border-radius: 0;
  background: #a84234;
}
#bgm-value {
  width: 34px;
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(190, 180, 158, .72);
}
.bgm-status {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: rgba(155, 148, 126, .46);
}
.screen-tiny {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .18em;
  color: rgba(140, 148, 130, .3);
}
.dead-card { border-color: rgba(130, 38, 28, .24); }
.dead-card::before { background: #b43426; }
.dead-card .screen-line { color: rgba(205, 190, 170, .8); }
.win-card::before { background: #a88a58; }
.win-card h2 { color: #e4dcc7; }
.epilogue {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid rgba(178, 158, 112, .16);
  background: rgba(80, 65, 35, .07);
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.95;
  letter-spacing: .05em;
  color: rgba(190, 176, 145, .62);
}

#story-intro {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  padding: 8vw;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(8, 10, 8, .2), rgba(2, 3, 2, .94) 70%),
    #020302;
  animation: intro-in .7s ease both;
}
#story-intro.hidden { display: none; }
.intro-card { max-width: 680px; }
.intro-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .3em;
  color: rgba(173, 148, 98, .7);
  margin-bottom: 18px;
}
.intro-card h2 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.22;
  color: #d4cdbb;
  letter-spacing: .02em;
}
.intro-card p {
  max-width: 560px;
  margin: 0 0 26px;
  font-size: 13px;
  line-height: 2;
  color: rgba(184, 180, 164, .72);
}
.intro-crew {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  padding: 16px 0;
  border-top: 1px solid rgba(167, 151, 113, .16);
  border-bottom: 1px solid rgba(167, 151, 113, .16);
  font-family: var(--mono);
  font-size: 11px;
  color: #b8ab8e;
  letter-spacing: .1em;
}
.intro-crew em { font-style: normal; color: rgba(133, 128, 113, .55); margin-left: 4px; }
.intro-foot {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(173, 60, 45, .8);
}
@keyframes intro-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.intro-skip {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .24em;
  color: rgba(157, 151, 132, .35);
}
body.low-flash #story-intro { animation: none; }

/* ---------- jumpscare ---------- */
#jumpscare {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  overflow: hidden;
  animation: scare-shake .075s steps(2) infinite;
}
#scare-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1);
  object-fit: cover;
  filter: contrast(1.16) saturate(.34) brightness(.84) blur(.55px);
  animation: none;
}
#jumpscare::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 22%, rgba(32,2,2,.35) 65%, rgba(0,0,0,.92) 100%);
}
.scare-text {
  display: none;
}
@keyframes scare-shake {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-6px, 4px); }
  100% { transform: translate(5px, -3px); }
}
@keyframes scare-zoom {
  0% { transform: translate(-50%, -50%) scale(1.55); opacity: 0; }
  5% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes scare-text {
  0% { opacity: .9; }
  50% { opacity: .35; }
  100% { opacity: 1; }
}

#lock-hint {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 80;
  transform: translateX(-50%);
  padding: 7px 13px;
  border: 1px solid rgba(190, 172, 120, .18);
  background: rgba(4, 5, 4, .75);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(200, 184, 140, .65);
  pointer-events: none;
  white-space: nowrap;
}

/* low-flash accessibility mode */
body.low-flash #jumpscare { animation: none; }
body.low-flash #scare-canvas { animation: none; }
body.low-flash .scare-text { animation: none; opacity: .7; }
@keyframes scare-zoom-soft {
  from { transform: translate(-50%, -50%) scale(1.16); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1.04); opacity: .85; }
}
body.low-flash #interference.on { animation: none; opacity: .1; }
body.low-flash #danger { opacity: calc(var(--danger) * .55); }

/* responsive */
@media (max-width: 1100px) {
  .menu-inner { width: min(620px, 68vw); }
  .menu-side { display: none; }
}
@media (max-width: 840px) {
  .cam-top { padding: 13px 15px 0; font-size: 9px; }
  .cam-right span:first-child { display: none; }
  #objective { top: 48px; left: 15px; width: 220px; }
  #condition { top: 48px; right: 15px; }
  #minimap { top: 82px; right: 15px; width: 164px; }
  #minimap-canvas { width: 150px; height: 150px; }
  #status-panel { left: 15px; bottom: 20px; width: 185px; }
  #radio { right: 15px; bottom: 20px; width: 230px; font-size: 10px; }
  #backpack { right: 15px; bottom: 82px; width: 196px; }
  .menu-inner { left: 7vw; width: 78vw; }
  .menu-controls { display: none; }
  .warning { max-width: 320px; }
  .screen-card { padding: 34px 26px 28px; }
  .title-en span { display: none; }
  #hint { display: none !important; }
}
@media (max-width: 560px) {
  .title { font-size: 15.5vw; letter-spacing: .035em; }
  .menu-inner { left: 24px; right: 24px; width: auto; }
  .kicker { font-size: 8px; letter-spacing: .18em; }
  .tagline { font-size: 14px; }
  .btn.primary { width: 100%; }
  #objective { width: 190px; }
  #objective .panel-label { font-size: 7.5px; }
  .objective-main { font-size: 11px; }
  .objective-main b { font-size: 17px; }
  #condition { display: none; }
  #minimap { display: none; }
  #backpack { display: none; }
  .cam-right { gap: 8px; }
  #status-panel { width: 160px; }
  .meter { grid-template-columns: 25px 1fr 25px; gap: 6px; }
  #radio { display: none !important; }
  #toast { width: 92vw; padding: 14px 18px; }
  .screen-actions { flex-direction: column; }
  .screen-actions .btn { width: 100%; }
  #interact { bottom: 28%; }
}

@media (max-height: 660px) {
  .menu-inner .tagline { line-height: 1.7; }
  .menu-controls { display: none; }
  .warning { margin-top: 18px; }
  .btn.primary { margin-top: 20px; }
  .kicker { margin-bottom: 14px; }
  .menu-rule { margin: 18px 0 14px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
}