:root {
  --ry-bone: #fff8ed;
  --ry-paper: #fffaf3;
  --ry-flesh: #ed8fa0;
  --ry-flesh-deep: #a62f50;
  --ry-blood: #5b1027;
  --ry-night: #16080e;
  --ry-black: #12090d;
  --ry-retina: #d9ff55;
  --ry-iris: #d5a33b;
  --ry-cold: #9fe1e6;
  --ry-muted: #7d6268;
  --ry-line: rgba(30, 9, 17, 0.28);
  --ry-glass: rgba(28, 9, 16, 0.86);
  --ry-shadow: 12px 12px 0 rgba(24, 4, 12, 0.56);
  --eye-close: 0%;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  background: var(--ry-night);
  color: var(--ry-black);
  font-family: var(--biufun-cjk-font, "PingFang SC", "Microsoft YaHei", sans-serif);
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ry-retina);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Launch layer */

.landing-body {
  overflow: hidden;
}

.landing {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ry-night);
  color: var(--ry-bone);
}

.landing__visual {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% center;
  animation: flesh-breathe 13s ease-in-out infinite alternate;
}

.landing__veil {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(15, 3, 9, 0.97) 0%, rgba(26, 5, 13, 0.85) 34%, rgba(35, 4, 15, 0.2) 71%, rgba(20, 2, 8, 0.65) 100%),
    linear-gradient(0deg, rgba(18, 3, 9, 0.8), transparent 55%);
}

.landing__veil::after {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.12) 4px),
    radial-gradient(circle at 76% 44%, transparent 0 18%, rgba(37,3,13,.8) 70%);
  mix-blend-mode: soft-light;
  content: "";
}

@keyframes flesh-breathe {
  from { transform: scale(1.01); filter: saturate(0.92) contrast(1.03); }
  to { transform: scale(1.065); filter: saturate(1.08) contrast(1.08); }
}

.landing__eye {
  position: absolute;
  top: 50%;
  right: clamp(28px, 7vw, 110px);
  width: clamp(74px, 11vw, 154px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 248, 237, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(116, 18, 45, 0.18), 0 0 70px rgba(255, 202, 117, 0.25);
  transform: translateY(-50%);
  animation: iris-watch 6s ease-in-out infinite;
}

.landing__eye::before,
.landing__eye::after,
.landing__eye i {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.landing__eye::before {
  inset: 14%;
  border: 10px dotted rgba(255, 212, 103, 0.52);
}

.landing__eye::after {
  inset: 35%;
  background: #090306;
  box-shadow: 0 0 24px rgba(255, 224, 142, 0.75);
}

.landing__eye i {
  top: 29%;
  left: 31%;
  z-index: 1;
  width: 10%;
  aspect-ratio: 1;
  background: white;
  filter: blur(1px);
}

@keyframes iris-watch {
  0%, 100% { transform: translateY(-50%) rotate(-3deg) scaleY(1); }
  48% { transform: translateY(-50%) rotate(4deg) scaleY(1); }
  50% { transform: translateY(-50%) rotate(4deg) scaleY(0.08); }
  53% { transform: translateY(-50%) rotate(4deg) scaleY(1); }
}

.landing__back {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: clamp(20px, 4vw, 60px);
  z-index: 4;
  min-height: 44px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 248, 237, 0.55);
  background: rgba(18, 5, 11, 0.5);
  color: var(--ry-bone);
  font-weight: 850;
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.landing__back:hover {
  border-color: var(--ry-retina);
  color: var(--ry-retina);
}

.landing__copy {
  position: absolute;
  top: 50%;
  left: clamp(24px, 7vw, 110px);
  width: min(650px, calc(100% - 48px));
  transform: translateY(-47%);
}

.landing__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--biufun-mono-font, monospace);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.landing__kicker span {
  padding: 7px 9px;
  background: var(--ry-retina);
  color: var(--ry-black);
}

.landing__kicker i {
  color: #f5c0cc;
  font-style: normal;
}

.landing h1 {
  margin: 22px 0 0;
  color: var(--ry-bone);
  font-size: clamp(92px, 15vw, 220px) !important;
  font-weight: 950;
  letter-spacing: -0.12em;
  line-height: 0.72 !important;
  text-shadow: 0 12px 50px rgba(0,0,0,.52);
}

.landing__subtitle {
  margin: 18px 0 0;
  color: #f4a9b9;
  font-family: var(--biufun-mono-font, monospace);
  font-size: clamp(16px, 2.5vw, 32px) !important;
  font-weight: 900;
  letter-spacing: 0.42em;
}

.landing__line {
  margin: 28px 0 0;
  color: var(--ry-bone);
  font-size: clamp(16px, 1.55vw, 23px) !important;
  font-weight: 700;
  line-height: 1.65 !important;
}

.landing__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin-top: 27px;
}

.landing__meta span {
  display: grid;
  min-width: 128px;
  padding: 10px 13px;
  background: rgba(255, 248, 237, 0.9);
  color: var(--ry-black);
  backdrop-filter: blur(14px);
}

.landing__meta small {
  color: var(--ry-muted);
  font-size: 9px;
  font-weight: 900;
}

.landing__meta b {
  margin-top: 3px;
  font-size: 13px;
}

.landing__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}

.launch-button,
.resume-button {
  display: grid;
  min-width: min(100%, 278px);
  min-height: 66px;
  padding: 13px 17px;
  border: 1px solid var(--ry-bone);
  color: inherit;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.launch-button {
  background: var(--ry-retina);
  color: var(--ry-black);
  box-shadow: 7px 7px 0 rgba(255, 248, 237, 0.2);
}

.resume-button {
  background: rgba(23, 7, 13, 0.7);
  backdrop-filter: blur(14px);
}

.launch-button:hover,
.resume-button:hover {
  box-shadow: 8px 8px 0 var(--ry-bone);
  transform: translate(-3px, -3px);
}

.launch-button span,
.resume-button span {
  font-size: 16px;
  font-weight: 950;
}

.launch-button b,
.resume-button b {
  align-self: end;
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.landing__notice {
  max-width: 540px;
  margin: 17px 0 0;
  color: #d7b4bc;
  font-size: 10px !important;
  line-height: 1.55 !important;
}

.landing__system {
  position: absolute;
  right: clamp(20px, 4vw, 60px);
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(70px, 12vw) auto;
  align-items: center;
  gap: 10px;
  color: #f7d5dc;
  font-family: var(--biufun-mono-font, monospace);
  font-size: 9px;
}

.landing__system i {
  height: 1px;
  background: rgba(255, 248, 237, 0.46);
}

.landing__system b {
  color: var(--ry-retina);
}

/* Runtime shell */

.game-body {
  overflow: hidden;
}

.game-shell {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 68px;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--ry-night);
}

.top-hud,
.bottom-hud {
  position: relative;
  z-index: 70;
  background: rgba(255, 250, 243, 0.96);
  backdrop-filter: blur(18px);
}

.top-hud {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) minmax(100px, 240px) 42px auto auto auto;
  align-items: center;
  gap: 9px;
  padding: 7px clamp(9px, 2vw, 27px);
  border-bottom: 1px solid var(--ry-line);
}

.hud-icon,
.hud-prop,
.hud-memory,
.hud-reset,
.map-trigger {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--ry-black);
  border-radius: 0;
  background: white;
  color: var(--ry-black);
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.hud-memory,
.hud-prop,
.hud-reset {
  padding-inline: 13px;
}

.hud-memory,
.hud-prop {
  grid-auto-flow: column;
  gap: 7px;
}

.hud-memory b,
.hud-prop b {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  background: var(--ry-flesh);
  font-size: 9px;
}

.hud-prop b {
  min-width: 30px;
  padding-inline: 5px;
  background: #dfd0d3;
}

.hud-prop.is-raised {
  background: #2a0e18;
  color: white;
}

.hud-prop.is-raised b {
  background: var(--ry-retina);
  color: var(--ry-black);
}

.hud-icon:hover,
.hud-prop:hover,
.hud-memory:hover,
.hud-reset:hover,
.map-trigger:hover {
  background: var(--ry-retina);
}

.case-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.case-heading small,
.bottom-hud small {
  color: #715d62;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.11em;
}

.case-heading strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-progress {
  height: 5px;
  overflow: hidden;
  background: #dacdd0;
}

.hud-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ry-flesh-deep);
  transition: width 360ms ease;
}

.story-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #3a121e;
}

.story-visual {
  position: absolute;
  inset: -1.5%;
  z-index: -5;
  width: 103%;
  height: 103%;
  object-fit: cover;
  opacity: 1;
  transform: scale(1.008);
  filter: saturate(0.94) contrast(1.03);
  animation: stage-breathe 14s ease-in-out infinite alternate;
  transition: opacity 220ms ease, transform 900ms ease, filter 500ms ease;
}

.story-visual.is-changing {
  opacity: 0.12;
  transform: scale(1.05);
}

@keyframes stage-breathe {
  from { transform: scale(1.008) translate3d(-0.15%, 0, 0); }
  to { transform: scale(1.045) translate3d(0.2%, -0.25%, 0); }
}

.story-shade {
  position: absolute;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(22, 3, 11, 0.84) 0%, rgba(32, 5, 14, 0.34) 51%, rgba(22, 3, 10, 0.08) 75%),
    linear-gradient(0deg, rgba(20, 2, 9, 0.8), transparent 48%),
    radial-gradient(circle at 75% 36%, transparent 12%, rgba(27, 2, 10, 0.32) 88%);
  transition: background 500ms ease;
}

.retina-noise {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.15;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,.07) 5px),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(75,4,27,.55) 100%);
  mix-blend-mode: soft-light;
}

.game-shell.high-gaze .story-visual {
  filter: saturate(1.34) contrast(1.12) hue-rotate(-7deg);
}

.game-shell.high-gaze .retina-noise {
  opacity: 0.33;
  animation: retinal-slip 3.5s steps(2, end) infinite;
}

@keyframes retinal-slip {
  0%, 100% { transform: translateX(0); }
  49% { transform: translateX(0); }
  50% { transform: translateX(4px); }
  52% { transform: translateX(-3px); }
  54% { transform: translateX(0); }
}

.game-shell[data-ending="good"] .story-shade {
  background: linear-gradient(90deg, rgba(63, 18, 30, 0.68), rgba(255, 233, 209, 0.08)), linear-gradient(0deg, rgba(77, 22, 37, 0.55), transparent 55%);
}

.scene-index {
  position: absolute;
  top: clamp(18px, 3vh, 34px);
  left: clamp(18px, 3vw, 42px);
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: white;
  text-shadow: 0 2px 15px rgba(0,0,0,.58);
}

.scene-index span {
  padding: 5px 7px;
  background: var(--ry-retina);
  color: var(--ry-black);
  font-family: var(--biufun-mono-font, monospace);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-shadow: none;
}

.scene-index b {
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.78;
}

.stage-location {
  position: absolute;
  top: clamp(20px, 3vh, 36px);
  right: clamp(18px, 3vw, 42px);
  z-index: 5;
  display: grid;
  justify-items: end;
  color: white;
  text-shadow: 0 2px 14px rgba(0,0,0,.72);
}

.stage-location small {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.stage-location strong {
  margin-top: 4px;
  font-size: clamp(14px, 1.5vw, 21px);
}

.map-trigger {
  position: absolute;
  top: clamp(72px, 10vh, 96px);
  right: clamp(18px, 3vw, 42px);
  z-index: 8;
  padding: 0 14px;
  box-shadow: 5px 5px 0 rgba(39, 4, 17, 0.46);
}

.narrative-card {
  position: absolute;
  top: clamp(14px, 2.5vh, 28px);
  bottom: auto;
  left: 50%;
  z-index: 12;
  display: grid;
  width: min(680px, calc(100% - clamp(36px, 32vw, 360px)));
  max-height: min(44vh, 400px);
  padding: clamp(17px, 2.5vw, 30px);
  overflow: auto;
  border: 2px solid var(--ry-black);
  border-radius: 2px 30px 2px 2px;
  background: rgba(255, 250, 243, 0.96);
  box-shadow: var(--ry-shadow);
  backdrop-filter: blur(18px);
  translate: -50% 0;
  transition: top 260ms ease, transform 180ms ease, opacity 180ms ease;
}

.narrative-card.is-entering {
  animation: card-in 260ms ease-out both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.narrative-card > header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--ry-line);
  color: #765e64;
  font-family: var(--biufun-mono-font, monospace);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.speaker-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.speaker-line span {
  padding: 5px 9px;
  background: var(--ry-flesh-deep);
  color: white;
  font-size: 10px;
  font-weight: 950;
}

.speaker-line i {
  color: #7e6269;
  font-size: 10px;
  font-style: normal;
}

.narrative-card h1 {
  margin: 13px 0 7px;
  color: var(--ry-black);
  font-size: 14px !important;
  letter-spacing: -0.01em;
  line-height: 1.35 !important;
}

.story-text {
  font-size: clamp(13px, 1.12vw, 14px);
  font-weight: 650;
  line-height: 1.72;
}

.story-text p {
  margin: 8px 0 0;
  font-size: inherit !important;
  line-height: inherit !important;
}

.story-dialogue {
  position: relative;
  margin: 16px 0 0;
  padding: 14px 16px 14px 29px;
  border: 1px solid var(--ry-line);
  background: #2a0e18;
  color: var(--ry-bone);
  font-size: clamp(13px, 1.18vw, 14px);
  font-weight: 750;
  line-height: 1.65;
}

.story-dialogue::before {
  position: absolute;
  top: 15px;
  left: 13px;
  color: var(--ry-retina);
  content: "●";
}

.continue-button {
  justify-self: start;
  min-height: 44px;
  margin-top: 19px;
  padding: 0 18px;
  border: 1px solid var(--ry-black);
  border-radius: 0;
  background: var(--ry-retina);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.continue-button:hover {
  background: white;
}

kbd {
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid currentColor;
  background: rgba(255,255,255,.55);
  color: inherit;
  font-family: inherit;
  font-size: 9px;
}

.choice-tray {
  position: absolute;
  right: clamp(18px, 3vw, 48px);
  bottom: clamp(14px, 2.5vh, 28px);
  left: clamp(18px, 3vw, 48px);
  z-index: 25;
  max-height: 47vh;
  padding: 14px;
  overflow: auto;
  border: 2px solid var(--ry-black);
  background: rgba(255, 250, 243, 0.98);
  box-shadow: 10px 10px 0 rgba(37, 3, 15, 0.5);
  animation: choice-in 240ms ease-out both;
}

@keyframes choice-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.choice-tray > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.choice-tray h2 {
  margin: 2px 0 0;
  font-size: clamp(15px, 1.7vw, 23px) !important;
  letter-spacing: -0.02em;
}

.choice-tray small,
.choice-tray > header > span {
  color: #765f65;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.choice-options {
  display: grid;
  grid-template-columns: repeat(var(--choice-count, 2), minmax(0, 1fr));
  gap: 10px;
}

.choice-options button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 12px 15px;
  border: 1px solid var(--ry-black);
  border-radius: 0 18px 0 0;
  background: white;
  color: var(--ry-black);
  text-align: left;
  cursor: pointer;
  transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.choice-options button:hover,
.choice-options button:focus-visible {
  background: #ffd7df;
  box-shadow: 5px 5px 0 var(--ry-black);
  transform: translate(-2px, -2px);
}

.choice-options button > span:first-child {
  color: var(--ry-flesh-deep);
  font-family: var(--biufun-mono-font, monospace);
  font-size: 17px;
  font-weight: 950;
}

.choice-options button > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.choice-options b {
  font-size: 14px;
}

.choice-options small {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-options i {
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
}

.has-choices .narrative-card {
  top: clamp(14px, 2.5vh, 28px);
  bottom: auto;
  max-height: min(43vh, 370px);
}

/* Map and memory components */

.map-panel {
  position: absolute;
  inset: clamp(18px, 4vh, 40px) clamp(18px, 5vw, 74px);
  z-index: 45;
  padding: clamp(18px, 2.7vw, 34px);
  overflow: auto;
  border: 2px solid var(--ry-black);
  border-radius: 2px 34px 2px 2px;
  background: rgba(255, 250, 243, 0.98);
  box-shadow: 14px 14px 0 rgba(38, 4, 16, 0.55);
  backdrop-filter: blur(20px);
}

.map-panel > header,
.memory-panel > header,
.camera-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.map-panel header small,
.memory-panel header small,
.camera-panel header small {
  color: var(--ry-flesh-deep);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.map-panel h2,
.memory-panel h2,
.camera-panel h2,
.focus-panel h2 {
  margin: 8px 0 0;
  font-size: clamp(26px, 4vw, 48px) !important;
  letter-spacing: -0.045em;
  line-height: 1.05 !important;
}

.map-panel header button,
.memory-panel header button,
.camera-panel header button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--ry-black);
  background: white;
  font-size: 21px;
  cursor: pointer;
}

.map-summary {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) minmax(240px, auto);
  align-items: center;
  gap: 13px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--ry-line);
  background: #f5e7e5;
}

.map-summary span {
  font-size: 11px;
  font-weight: 900;
}

.map-summary > i {
  height: 6px;
  overflow: hidden;
  background: #d8c2c5;
}

.map-summary > i b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ry-flesh-deep);
  transition: width 300ms ease;
}

.map-summary p {
  margin: 0;
  color: #765f65;
  font-size: 10px !important;
  text-align: right;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(9px, 1.4vw, 18px);
}

.map-grid button {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ry-black);
  background: white;
  color: var(--ry-black);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.map-grid button:hover:not(:disabled),
.map-grid button:focus-visible:not(:disabled) {
  box-shadow: 6px 6px 0 var(--ry-flesh-deep);
  transform: translate(-2px, -2px);
}

.map-grid button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.9);
  opacity: 0.62;
}

.map-grid button.is-visited {
  border-width: 2px;
  border-color: var(--ry-flesh-deep);
}

.map-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.map-grid button > span {
  display: grid;
  min-height: 112px;
  padding: 12px;
}

.map-grid small {
  color: var(--ry-flesh-deep);
  font-family: var(--biufun-mono-font, monospace);
  font-size: 9px;
  font-weight: 950;
}

.map-grid b {
  margin-top: 5px;
  font-size: clamp(16px, 1.8vw, 24px);
}

.map-grid em {
  margin-top: 5px;
  color: #735d63;
  font-size: 10px;
  font-style: normal;
  line-height: 1.45;
}

.map-state {
  align-self: end;
  justify-self: start;
  margin-top: 9px;
  padding: 4px 7px;
  background: #eddde0;
  color: var(--ry-black);
  font-size: 9px;
  font-weight: 950;
}

.is-visited .map-state {
  background: var(--ry-retina);
}

.memory-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  width: min(410px, calc(100% - 36px));
  padding: 23px;
  overflow: auto;
  border: 2px solid var(--ry-black);
  background: rgba(255, 250, 243, 0.98);
  box-shadow: -12px 12px 0 rgba(37, 4, 15, 0.48);
  backdrop-filter: blur(20px);
}

.camera-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 56;
  width: min(500px, calc(100% - 36px));
  padding: 23px;
  overflow: auto;
  border: 2px solid var(--ry-black);
  background: rgba(255, 250, 243, 0.98);
  box-shadow: -12px 12px 0 rgba(37, 4, 15, 0.48);
  backdrop-filter: blur(20px);
}

.camera-hero {
  position: relative;
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid var(--ry-black);
  background: #060507;
}

.camera-hero img,
.camera-blueprint img {
  display: block;
  width: 100%;
  height: auto;
}

.camera-hero figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(13, 4, 8, 0.82);
  color: white;
  backdrop-filter: blur(10px);
}

.camera-hero figcaption span {
  color: #eab2bd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.camera-hero figcaption b {
  color: var(--ry-retina);
  font-size: 11px;
}

.camera-panel > p {
  margin: 17px 0;
  color: #715b61;
  font-size: 12px;
  line-height: 1.75 !important;
}

.camera-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.camera-stats div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--ry-line);
  background: white;
}

.camera-stats dt {
  color: #85676e;
  font-size: 8px;
  font-weight: 900;
}

.camera-stats dd {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 900;
}

.camera-blueprint {
  margin-top: 12px;
  border: 1px solid var(--ry-black);
  background: #130a0e;
  color: white;
}

.camera-blueprint summary {
  padding: 11px 13px;
  color: var(--ry-retina);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.camera-blueprint img {
  border-top: 1px solid #806a70;
}

.memory-panel > p {
  margin: 18px 0;
  color: #755f65;
  line-height: 1.7 !important;
}

.memory-list {
  display: grid;
  gap: 9px;
}

.memory-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--ry-line);
  background: white;
}

.memory-item > i {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border: 7px solid #efbec8;
  border-radius: 50%;
  background: var(--ry-black);
  box-shadow: inset 0 0 0 4px var(--ry-iris);
}

.memory-item.is-empty {
  opacity: 0.52;
  filter: grayscale(1);
}

.memory-item span {
  display: grid;
}

.memory-item b {
  font-size: 13px;
}

.memory-item small {
  margin-top: 3px;
  color: #765f65;
  font-size: 9px;
}

.memory-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 0;
}

.memory-stats div {
  padding: 13px;
  border: 1px solid var(--ry-line);
  background: #2a0e18;
  color: white;
}

.memory-stats dt {
  color: #e8aeb9;
  font-size: 9px;
  font-weight: 900;
}

.memory-stats dd {
  margin: 4px 0 0;
  color: var(--ry-retina);
  font-family: var(--biufun-mono-font, monospace);
  font-size: 24px;
  font-weight: 950;
}

/* Close-eyes interaction */

.focus-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 58;
  display: grid;
  width: min(590px, calc(100% - 36px));
  padding: clamp(25px, 4vw, 45px);
  border: 2px solid var(--ry-black);
  border-radius: 2px 40px 2px 2px;
  background: rgba(255, 250, 243, 0.98);
  box-shadow: 14px 14px 0 rgba(39, 4, 16, 0.58);
  transform: translate(-50%, -50%);
}

.focus-panel > small {
  color: var(--ry-flesh-deep);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.focus-panel > p {
  margin: 15px 0 18px;
  color: #715b61;
  line-height: 1.65 !important;
}

.close-eyes-button {
  display: grid;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--ry-black);
  background: var(--ry-black);
  color: white;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.close-eyes-button span {
  align-self: center;
  font-size: 18px;
  font-weight: 950;
}

.close-eyes-button > i {
  align-self: end;
  height: 6px;
  overflow: hidden;
  background: #58303a;
}

.close-eyes-button > i b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ry-retina);
}

.focus-panel > em {
  min-height: 18px;
  margin-top: 12px;
  color: #745e64;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.focus-assist {
  justify-self: center;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid var(--ry-black);
  background: white;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.eyelids {
  position: absolute;
  inset: 0;
  z-index: 57;
  overflow: hidden;
  pointer-events: none;
}

.eyelids i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: #050103;
  box-shadow: 0 0 80px #050103;
}

.eyelids i:first-child {
  top: 0;
  transform: translateY(calc(-100% + var(--eye-close)));
}

.eyelids i:last-child {
  bottom: 0;
  transform: translateY(calc(100% - var(--eye-close)));
}

.is-closing-eyes .focus-panel {
  opacity: calc(1 - var(--eye-opacity, 0));
}

/* Loading, feedback, reset */

.asset-loading {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(25, 4, 12, 0.95), rgba(54, 8, 22, 0.48)),
    url("assets/RY_wake-v1.jpg") center / cover;
  color: white;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.asset-loading > div {
  width: min(540px, 100%);
}

.asset-loading small {
  color: var(--ry-retina);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.asset-loading h1 {
  margin: 10px 0 0;
  color: white;
  font-size: clamp(35px, 6vw, 74px) !important;
  letter-spacing: -0.055em;
  line-height: 1 !important;
}

.asset-loading p {
  margin: 18px 0 9px;
  color: #f0c3cc;
}

.asset-loading > div > i {
  display: block;
  height: 7px;
  background: rgba(255,255,255,.22);
}

.asset-loading > div > i b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ry-retina);
  transition: width 120ms linear;
}

.asset-loading.is-done {
  opacity: 0;
  visibility: hidden;
}

.status-toast {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 80;
  min-width: min(360px, calc(100% - 36px));
  padding: 12px 16px;
  border: 1px solid var(--ry-bone);
  background: rgba(26, 7, 14, 0.94);
  color: white;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.status-toast.is-good {
  border-color: var(--ry-retina);
  color: var(--ry-retina);
}

.status-toast.is-alert {
  border-color: #ff9aaa;
  color: #ffd7de;
}

.reset-dialog {
  width: min(480px, calc(100% - 36px));
  padding: 0;
  border: 2px solid var(--ry-black);
  border-radius: 0;
  background: var(--ry-paper);
  color: var(--ry-black);
  box-shadow: 14px 14px 0 rgba(0,0,0,.45);
}

.reset-dialog::backdrop {
  background: rgba(12, 2, 7, 0.72);
  backdrop-filter: blur(5px);
}

.reset-dialog form {
  padding: 22px;
}

.reset-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reset-dialog h2 {
  margin: 0;
  font-size: 24px !important;
}

.reset-dialog header button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ry-black);
  background: white;
  cursor: pointer;
}

.reset-dialog p {
  margin: 18px 0;
  color: #745e64;
}

.reset-dialog footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reset-dialog footer button {
  min-height: 48px;
  border: 1px solid var(--ry-black);
  background: white;
  font-weight: 900;
  cursor: pointer;
}

.reset-dialog footer .danger {
  background: var(--ry-flesh-deep);
  color: white;
}

/* Bottom component */

.bottom-hud {
  display: grid;
  grid-template-columns: 1.1fr .72fr 1fr .8fr 1fr 1.12fr;
  border-top: 1px solid var(--ry-line);
}

.bottom-hud > div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px clamp(9px, 1.5vw, 20px);
  border-right: 1px solid var(--ry-line);
}

.bottom-hud > div:last-child {
  border-right: 0;
  background: var(--ry-retina);
}

.bottom-hud strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-hud {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-auto-flow: column;
  align-items: center;
  gap: 9px;
}

.player-hud > span:last-child {
  display: grid;
  min-width: 0;
}

.player-eye {
  display: block;
  width: 31px;
  aspect-ratio: 1;
  border: 7px solid #efc5cc;
  border-radius: 50%;
  background: #080306;
  box-shadow: inset 0 0 0 4px var(--ry-iris);
}

.gaze-hud > i {
  display: block;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  background: #ddcdd0;
}

.gaze-hud > i b {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--ry-flesh-deep);
  transition: width 300ms ease;
}

.countdown-hud {
  position: relative;
  transition: color 180ms ease, background 180ms ease;
}

.countdown-hud > strong {
  font-family: var(--biufun-mono-font, monospace);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.countdown-hud > i {
  display: block;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  background: #ddcdd0;
}

.countdown-hud > i b {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ry-flesh-deep);
  transform-origin: left center;
  transition: width 240ms linear, background 180ms ease;
}

.countdown-hud.is-urgent {
  background: #3b0718;
  color: white;
}

.countdown-hud.is-urgent small {
  color: #ffbdc9;
}

.countdown-hud.is-urgent > i {
  background: rgba(255, 255, 255, 0.18);
}

.countdown-hud.is-urgent > i b {
  background: var(--ry-retina);
}

.countdown-hud.is-critical > strong {
  animation: countdown-pulse 780ms steps(2, end) infinite;
}

@keyframes countdown-pulse {
  50% { opacity: 0.38; }
}

/* Responsive */

@media (max-width: 880px) {
  .landing__eye { display: none; }
  .landing__veil { background: linear-gradient(90deg, rgba(15,3,9,.97), rgba(25,4,12,.62)), linear-gradient(0deg, rgba(18,3,9,.84), transparent 55%); }

  .top-hud {
    grid-template-columns: 40px minmax(100px, 1fr) minmax(70px, 120px) 40px auto auto;
  }

  .hud-reset { display: none; }
  .bottom-hud { grid-template-columns: 1fr .75fr 1fr 1fr; }
  .bottom-hud > div:nth-child(1),
  .bottom-hud > div:nth-child(3) { display: none; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .landing { min-height: 560px; }
  .landing__visual { object-position: 62% center; }
  .landing__copy { top: 51%; left: 20px; width: calc(100% - 40px); }
  .landing h1 { font-size: clamp(82px, 29vw, 132px) !important; }
  .landing__subtitle { margin-top: 14px; font-size: 15px !important; }
  .landing__line { margin-top: 20px; font-size: 15px !important; }
  .landing__meta span { min-width: 31%; flex: 1; padding: 9px; }
  .landing__actions { display: grid; }
  .launch-button,
  .resume-button { min-width: 100%; min-height: 58px; }
  .landing__notice { margin-top: 12px; }
  .landing__system { display: none; }

  .game-shell { grid-template-rows: 54px minmax(0, 1fr) 61px; }
  .top-hud { grid-template-columns: 40px minmax(80px, 1fr) 40px 42px 42px; gap: 6px; padding: 6px; }
  .case-heading small { display: none; }
  .case-heading strong { font-size: 11px; }
  .hud-progress { display: none; }
  .hud-memory { min-width: 42px; padding: 0 8px; font-size: 0; }
  .hud-memory b { font-size: 9px; }
  .hud-prop { min-width: 42px; padding: 0 8px; font-size: 0; }
  .hud-prop span { font-size: 12px; }
  .hud-prop b { display: none; }

  .scene-index { top: 14px; left: 12px; }
  .scene-index b { font-size: 40px; }
  .stage-location { top: 14px; right: 12px; }
  .map-trigger { top: 60px; right: 12px; }

  .narrative-card {
    top: 12px;
    bottom: auto;
    left: 50%;
    width: calc(100% - 24px);
    max-height: min(44vh, 380px);
    padding: 15px;
    border-radius: 1px 22px 1px 1px;
    box-shadow: 7px 7px 0 rgba(29,3,12,.54);
  }

  .narrative-card h1 { font-size: 14px !important; }
  .story-text { font-size: 13px; }
  .story-dialogue { padding: 11px 12px 11px 25px; }
  .continue-button { margin-top: 14px; }

  .choice-tray {
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-height: 48%;
    padding: 10px;
    box-shadow: 6px 6px 0 rgba(29,3,12,.55);
  }

  .choice-tray > header { margin-bottom: 7px; }
  .choice-tray > header > span { display: none; }
  .choice-options { grid-template-columns: 1fr; gap: 7px; }
  .choice-options button { min-height: 62px; padding: 9px 11px; }
  .choice-options small { white-space: normal; line-height: 1.35; }
  .has-choices .narrative-card { top: 12px; bottom: auto; max-height: 35%; }
  .has-choices .narrative-card .story-dialogue { display: none; }

  .map-panel { inset: 9px; padding: 15px; border-radius: 1px 23px 1px 1px; }
  .map-panel h2 { font-size: 27px !important; }
  .map-summary { grid-template-columns: 1fr 1fr; }
  .map-summary p { grid-column: 1 / -1; text-align: left; }
  .map-grid { grid-template-columns: 1fr; }
  .map-grid button { grid-template-columns: 112px 1fr; }
  .map-grid img { height: 100%; aspect-ratio: auto; }
  .map-grid button > span { min-height: 104px; }

  .memory-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); padding: 17px; }
  .memory-panel h2 { font-size: 27px !important; }
  .camera-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); padding: 17px; }
  .camera-panel h2 { font-size: 27px !important; }
  .camera-stats { grid-template-columns: 1fr; }
  .focus-panel { padding: 24px 18px; }
  .focus-panel h2 { font-size: 28px !important; }

  .bottom-hud { grid-template-columns: .9fr .75fr 1fr; }
  .bottom-hud > div { padding: 7px 8px; }
  .bottom-hud > div:nth-child(1) { display: none; }
  .bottom-hud > div:nth-child(4) { display: none; }
  .bottom-hud strong { font-size: 11px; }
}

@media (max-height: 620px) and (min-width: 621px) {
  .narrative-card { top: 14px; bottom: auto; left: 14px; width: 46%; max-height: calc(100% - 28px); translate: 0 0; }
  .choice-tray { top: 14px; right: 14px; bottom: 14px; left: 51%; max-height: none; }
  .choice-options { grid-template-columns: 1fr; }
  .has-choices .narrative-card { top: 14px; bottom: auto; max-height: calc(100% - 28px); }
  .scene-index,
  .stage-location { display: none; }
}

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