:root {
  --bg: #071011;
  --ink: #e7dcc9;
  --ink-88: rgba(231, 220, 201, 0.88);
  --ink-68: rgba(231, 220, 201, 0.68);
  --ink-48: rgba(231, 220, 201, 0.48);
  --ink-32: rgba(231, 220, 201, 0.32);
  --ink-20: rgba(231, 220, 201, 0.2);
  --line: rgba(226, 214, 192, 0.14);
  --line-soft: rgba(226, 214, 192, 0.08);
  --gold: #c8a46d;
  --gold-bright: #e0c08c;
  --cinnabar: #ab5038;
  --moss: #788a70;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --latin: "Bodoni Moda", "Cormorant Garamond", "Baskerville", "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  user-select: none;
}

button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 5px;
}

::selection {
  background: rgba(171, 80, 56, 0.38);
  color: #fff6e8;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 1.8s ease 0.1s;
}

#scene:active { cursor: grabbing; }
.is-ready #scene { opacity: 1; }

/* --------------------------------------------------------------------------
   Lens, grain and light falloff
   -------------------------------------------------------------------------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 8, 9, 0.55) 0%, rgba(3, 8, 9, 0.18) 13%, rgba(3, 8, 9, 0) 26%, rgba(3, 8, 9, 0) 60%, rgba(3, 8, 9, 0.18) 76%, rgba(3, 8, 9, 0.72) 100%),
    radial-gradient(ellipse 82% 75% at 54% 45%, rgba(2, 6, 7, 0) 46%, rgba(2, 6, 7, 0.17) 78%, rgba(2, 6, 7, 0.42) 100%);
}

.film-grain {
  position: fixed;
  inset: -80px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.62'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grain-drift 1.1s steps(3, end) infinite;
}

@keyframes grain-drift {
  0% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(-12px, 7px, 0); }
  66% { transform: translate3d(9px, -10px, 0); }
  100% { transform: translate3d(-4px, 3px, 0); }
}

/* --------------------------------------------------------------------------
   Film frame & interface transition
   -------------------------------------------------------------------------- */

.ui-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.9s var(--ease-soft);
}

.ui-layer button { pointer-events: auto; }

.is-ui-hidden .ui-layer {
  opacity: 0;
  pointer-events: none;
}

.is-ui-hidden .ui-layer button { pointer-events: none; }

.cinema-frame {
  position: fixed;
  inset: clamp(14px, 1.5vw, 24px);
  z-index: 1;
  border: 1px solid rgba(230, 218, 197, 0.065);
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, #000 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 76%, transparent 100%);
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  opacity: 0.68;
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  background: rgba(201, 169, 117, 0.58);
}

.corner::before { width: 20px; height: 1px; }
.corner::after { width: 1px; height: 20px; }
.corner-tl { top: -1px; left: -1px; }
.corner-tl::before { top: 0; left: 0; }
.corner-tl::after { top: 0; left: 0; }
.corner-tr { top: -1px; right: -1px; transform: scaleX(-1); }
.corner-tr::before { top: 0; left: 0; }
.corner-tr::after { top: 0; left: 0; }
.corner-bl { bottom: -1px; left: -1px; transform: scaleY(-1); opacity: 0.3; }
.corner-bl::before { top: 0; left: 0; }
.corner-bl::after { top: 0; left: 0; }
.corner-br { bottom: -1px; right: -1px; transform: scale(-1); opacity: 0.3; }
.corner-br::before { top: 0; left: 0; }
.corner-br::after { top: 0; left: 0; }

.ui-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.35s var(--ease), transform 1.35s var(--ease);
}

.is-ready .ui-reveal {
  opacity: 1;
  transform: translateY(0);
}

.is-ready .topbar { transition-delay: 0.55s; }
.is-ready .title-block { transition-delay: 0.78s; }
.is-ready .chapter-rail { transition-delay: 0.98s; }
.is-ready .footer-bar { transition-delay: 1.12s; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: calc(clamp(22px, 3.2vh, 38px) + var(--safe-top));
  left: clamp(24px, 4.4vw, 68px);
  right: clamp(24px, 4.4vw, 68px);
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-88);
  pointer-events: auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: rgba(219, 207, 185, 0.66);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.38));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 1px;
}

.brand-name {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.34em;
  line-height: 1;
  color: rgba(236, 225, 206, 0.86);
}

.brand-sub {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1;
  color: rgba(231, 220, 201, 0.44);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: clamp(14px, 1.8vw, 27px);
  padding-top: 1px;
  pointer-events: auto;
}

.top-coordinate {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0.13em;
  color: rgba(231, 220, 201, 0.42);
  line-height: 1.7;
  padding-top: 1px;
  white-space: nowrap;
}

.top-divider {
  width: 1px;
  height: 16px;
  background: linear-gradient(180deg, rgba(231, 220, 201, 0.2), rgba(231, 220, 201, 0.02));
  margin-top: 1px;
}

.text-control {
  position: relative;
  color: rgba(231, 220, 201, 0.62);
  font-size: 10.5px;
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1.6;
  transition: color 0.4s ease;
  white-space: nowrap;
  pointer-events: auto;
}

.text-control::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 1px;
  background: rgba(201, 169, 117, 0.65);
  transition: width 0.5s var(--ease);
}

.text-control:hover,
.text-control.is-active {
  color: rgba(238, 228, 210, 0.9);
}

.text-control:hover::after,
.text-control.is-active::after {
  width: 100%;
}

.sound-control {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sound-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 11px;
}

.sound-bars i {
  display: block;
  width: 1px;
  height: 4px;
  background: rgba(231, 220, 201, 0.38);
  transition: background 0.4s ease, height 0.4s ease;
}

.sound-bars i:nth-child(2) { height: 8px; }
.sound-bars i:nth-child(3) { height: 6px; }

.sound-control.is-active .sound-bars i {
  background: var(--gold);
  animation: equalize 1.5s ease-in-out infinite alternate;
}

.sound-control.is-active .sound-bars i:nth-child(2) { animation-delay: -0.45s; }
.sound-control.is-active .sound-bars i:nth-child(3) { animation-delay: -0.9s; }

@keyframes equalize {
  0% { transform: scaleY(0.5); }
  100% { transform: scaleY(1.15); }
}

.control-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  line-height: 1;
}

#sound-label {
  font-size: 9.5px;
  letter-spacing: 0.16em;
}

.sound-state {
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 300;
  letter-spacing: 0.13em;
  color: rgba(231, 220, 201, 0.4);
  transition: color 0.4s ease;
}

.sound-control.is-active .sound-state {
  color: rgba(200, 164, 109, 0.72);
}

.ui-hide-button {
  font-size: 11px;
  color: rgba(231, 220, 201, 0.42);
}

/* --------------------------------------------------------------------------
   Title block
   -------------------------------------------------------------------------- */

.title-block {
  position: fixed;
  left: clamp(24px, 4.7vw, 80px);
  top: clamp(116px, 19.5vh, 205px);
  z-index: 7;
  display: flex;
  align-items: stretch;
  gap: clamp(17px, 1.8vw, 26px);
  pointer-events: none;
}

.title-rule {
  position: relative;
  width: 1px;
  min-height: 305px;
  background: linear-gradient(180deg, rgba(201, 169, 117, 0.64), rgba(201, 169, 117, 0.22) 32%, rgba(201, 169, 117, 0.07) 72%, transparent 100%);
  margin-top: 9px;
}

.title-rule::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 5px;
  height: 5px;
  background: var(--cinnabar);
  box-shadow: 0 0 16px rgba(171, 80, 56, 0.55);
}

.rule-glyph {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 300;
  color: rgba(231, 220, 201, 0.24);
  letter-spacing: 0;
}

.title-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: rgba(231, 220, 201, 0.56);
  font-size: 9px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.eyebrow-dot {
  width: 2px;
  height: 2px;
  background: rgba(201, 169, 117, 0.65);
  border-radius: 50%;
}

.hero-title {
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: block;
  margin: 22px 0 0;
  padding: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 4.35vw, 74px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 0.19em;
  color: rgba(235, 224, 207, 0.94);
  text-shadow: 0 3px 34px rgba(0, 0, 0, 0.56), 0 1px 1px rgba(0, 0, 0, 0.32);
}

.hero-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(13px);
  filter: blur(5px);
}

.is-ready .hero-title span {
  animation: title-glyph 1.6s var(--ease) forwards;
}

.is-ready .hero-title span:nth-child(1) { animation-delay: 0.98s; }
.is-ready .hero-title span:nth-child(2) { animation-delay: 1.08s; }
.is-ready .hero-title span:nth-child(3) { animation-delay: 1.18s; }
.is-ready .hero-title span:nth-child(4) { animation-delay: 1.28s; }

@keyframes title-glyph {
  0% { opacity: 0; transform: translateY(13px); filter: blur(5px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.title-foot {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: clamp(18px, 2.5vh, 27px);
}

.seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: rgba(12, 8, 6, 0.8);
  background: #a84e39;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  transform: rotate(-2.5deg);
  clip-path: polygon(3% 0%, 99% 1%, 100% 96%, 96% 100%, 1% 98%, 0% 3%);
  box-shadow: inset 0 0 0 1px rgba(34, 12, 7, 0.24), 0 4px 18px rgba(0, 0, 0, 0.2);
  opacity: 0.88;
}

.seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(42, 16, 9, 0.34);
  pointer-events: none;
}

.title-foot-copy {
  max-width: 265px;
  padding-top: 1px;
}

.latin-title {
  margin: 0;
  font-family: var(--latin);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.27em;
  line-height: 1.4;
  color: rgba(230, 219, 199, 0.72);
}

.intro {
  margin: 8px 0 0;
  font-size: 11.5px;
  font-weight: 300;
  line-height: 2.05;
  letter-spacing: 0.07em;
  color: rgba(231, 220, 201, 0.54);
}

/* --------------------------------------------------------------------------
   Chapter rail
   -------------------------------------------------------------------------- */

.chapter-rail {
  position: fixed;
  top: 50%;
  right: clamp(23px, 4.1vw, 64px);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: translateY(-50%);
  pointer-events: none;
  isolation: isolate;
}

.chapter-rail::before {
  content: "";
  position: absolute;
  inset: -34px -32px -34px -72px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 74% 50%, rgba(3, 9, 10, 0.46), rgba(3, 9, 10, 0.18) 48%, transparent 76%);
  filter: blur(5px);
}

.is-ready .chapter-rail {
  transform: translateY(-50%);
}

.chapter-rail .rail-heading {
  margin: 0 2px 15px 0;
  color: rgba(231, 220, 201, 0.4);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 300;
  letter-spacing: 0.22em;
  line-height: 1;
}

.chapter {
  position: relative;
  display: grid;
  grid-template-columns: 17px minmax(86px, auto) 31px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 193px;
  padding: 10px 0;
  color: rgba(231, 220, 201, 0.54);
  text-align: right;
  transition: color 0.5s ease;
  pointer-events: auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.chapter::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 0;
  height: 1px;
  background: rgba(201, 169, 117, 0.48);
  transform: translateY(-50%);
  transition: width 0.55s var(--ease), opacity 0.55s ease;
  opacity: 0;
}

.chapter-index {
  font-family: var(--serif);
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0;
  color: rgba(231, 220, 201, 0.38);
  transition: color 0.5s ease;
}

.chapter-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chapter-cn {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.25em;
  line-height: 1.2;
  transition: letter-spacing 0.55s var(--ease), color 0.5s ease;
}

.chapter-en {
  font-family: var(--mono);
  font-size: 5.8px;
  font-weight: 300;
  letter-spacing: 0.12em;
  line-height: 1;
  color: rgba(231, 220, 201, 0.3);
  transition: color 0.5s ease;
}

.chapter-line {
  display: block;
  justify-self: end;
  width: 21px;
  height: 1px;
  background: rgba(231, 220, 201, 0.26);
  transition: width 0.55s var(--ease), background-color 0.5s ease;
}

.chapter:hover {
  color: rgba(231, 220, 201, 0.78);
}

.chapter:hover .chapter-index { color: var(--gold); }
.chapter:hover .chapter-line { width: 35px; background: rgba(201, 169, 117, 0.6); }

.chapter.is-active {
  color: rgba(241, 230, 212, 0.94);
}

.chapter.is-active .chapter-index {
  color: var(--gold-bright);
}

.chapter.is-active .chapter-cn {
  color: rgba(241, 230, 212, 0.96);
  letter-spacing: 0.31em;
}

.chapter.is-active .chapter-en {
  color: rgba(201, 169, 117, 0.6);
}

.chapter.is-active .chapter-line {
  width: 55px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 117, 0.82));
}

.chapter.is-active::before {
  width: 4px;
  opacity: 1;
  background: var(--cinnabar);
  box-shadow: 0 0 12px rgba(171, 80, 56, 0.5);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer-bar {
  position: fixed;
  left: clamp(24px, 4.4vw, 68px);
  right: clamp(24px, 4.4vw, 68px);
  bottom: calc(clamp(19px, 3.2vh, 33px) + var(--safe-bottom));
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(231, 220, 201, 0.56);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.footer-bar::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 52px;
  height: 1px;
  background: rgba(201, 169, 117, 0.44);
}

.interaction-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  white-space: nowrap;
}

.hint-orbit {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: rgba(201, 169, 117, 0.5);
}

.hint-orbit svg {
  width: 100%;
  height: 100%;
}

.light-control {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-self: center;
}

.control-kicker {
  font-size: 8px;
  letter-spacing: 0.26em;
  color: rgba(231, 220, 201, 0.42);
}

.light-readout {
  display: none;
}

.light-options {
  display: flex;
  align-items: center;
  gap: clamp(13px, 1.5vw, 22px);
}

.light-options button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(231, 220, 201, 0.58);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  transition: color 0.45s ease;
  pointer-events: auto;
}

.light-options button i {
  display: block;
  width: 4px;
  height: 4px;
  border: 1px solid rgba(231, 220, 201, 0.38);
  border-radius: 50%;
  transition: background-color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.light-options button:hover { color: rgba(236, 225, 206, 0.8); }

.light-options button.is-active {
  color: rgba(239, 226, 205, 0.92);
}

.light-options button.is-active i {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 169, 117, 0.5);
}

.view-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  justify-self: end;
  pointer-events: auto;
}

.view-tools button {
  color: rgba(231, 220, 201, 0.52);
  font-size: 9.5px;
  font-weight: 300;
  letter-spacing: 0.12em;
  transition: color 0.4s ease;
  pointer-events: auto;
}

.view-tools button:hover { color: rgba(238, 228, 210, 0.9); }

.auto-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pulse-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(231, 220, 201, 0.22);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

.auto-toggle.is-active {
  color: rgba(234, 221, 200, 0.82);
}

.auto-toggle.is-active .pulse-dot {
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(201, 169, 117, 0.45);
  animation: auto-pulse 2.8s ease-out infinite;
}

@keyframes auto-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 169, 117, 0.4); }
  65% { box-shadow: 0 0 0 5px rgba(201, 169, 117, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 169, 117, 0); }
}

.tool-separator {
  width: 1px;
  height: 10px;
  background: rgba(231, 220, 201, 0.14);
}

.auto-state {
  min-width: 36px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Restore UI button
   -------------------------------------------------------------------------- */

.ui-restore {
  position: fixed;
  top: calc(24px + var(--safe-top));
  right: clamp(22px, 3.2vw, 50px);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(231, 220, 201, 0.18);
  color: rgba(231, 220, 201, 0.66);
  font-size: 11px;
  letter-spacing: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.5s ease, transform 0.5s var(--ease), visibility 0.5s;
  pointer-events: none;
}

.is-ui-hidden .ui-restore {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.ui-restore:hover {
  color: var(--ink);
  border-color: rgba(201, 169, 117, 0.48);
}

/* --------------------------------------------------------------------------
   Colophon panel
   -------------------------------------------------------------------------- */

.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  pointer-events: none;
}

.info-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.info-veil {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 7, 0.48);
  backdrop-filter: blur(7px) saturate(0.82);
  -webkit-backdrop-filter: blur(7px) saturate(0.82);
  opacity: 0;
  transition: opacity 0.8s var(--ease-soft);
}

.info-overlay.is-open .info-veil { opacity: 1; }

.codex {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(468px, 92vw);
  user-select: text;
  padding: clamp(42px, 7vh, 72px) clamp(30px, 3.3vw, 54px) 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse 90% 55% at 90% 12%, rgba(87, 58, 35, 0.2), transparent 64%),
    linear-gradient(180deg, #0d1413 0%, #0a0f0f 58%, #080c0c 100%);
  border-left: 1px solid rgba(201, 169, 117, 0.22);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.38);
  transform: translateX(100%);
  transition: transform 0.9s var(--ease);
}

.info-overlay.is-open .codex { transform: translateX(0); }

.codex::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 117, 0.6), rgba(201, 169, 117, 0.05));
}

.codex-close {
  position: absolute;
  top: clamp(20px, 3.4vh, 34px);
  right: clamp(20px, 2.6vw, 34px);
  width: 32px;
  height: 32px;
}

.codex-close span {
  position: absolute;
  top: 15px;
  left: 7px;
  width: 18px;
  height: 1px;
  background: rgba(231, 220, 201, 0.56);
  transition: background-color 0.4s ease, transform 0.4s var(--ease);
}

.codex-close span:first-child { transform: rotate(45deg); }
.codex-close span:last-child { transform: rotate(-45deg); }

.codex-close:hover span { background: var(--gold-bright); }

.codex-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(201, 169, 117, 0.7);
}

.codex h2 {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(27px, 2.8vw, 38px);
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1.3;
  color: rgba(239, 228, 211, 0.95);
}

.codex-lead {
  margin: 14px 0 0;
  font-size: 12.5px;
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.08em;
  color: rgba(231, 220, 201, 0.5);
}

.codex-rule {
  width: 100%;
  height: 1px;
  margin: clamp(28px, 4.2vh, 42px) 0 clamp(23px, 3.2vh, 31px);
  background: linear-gradient(90deg, rgba(201, 169, 117, 0.4), rgba(231, 220, 201, 0.05) 64%, transparent);
}

.codex-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 clamp(25px, 3.8vh, 36px);
  border-top: 1px solid rgba(231, 220, 201, 0.08);
  border-left: 1px solid rgba(231, 220, 201, 0.08);
}

.codex-data div {
  padding: 11px 12px;
  border-right: 1px solid rgba(231, 220, 201, 0.08);
  border-bottom: 1px solid rgba(231, 220, 201, 0.08);
}

.codex-data dt {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgba(231, 220, 201, 0.28);
}

.codex-data dd {
  margin: 7px 0 0;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(231, 220, 201, 0.74);
}

.codex-body {
  margin: 0 0 1.25em;
  font-size: 11.5px;
  font-weight: 300;
  line-height: 2.25;
  letter-spacing: 0.055em;
  color: rgba(231, 220, 201, 0.53);
  text-align: justify;
}

.codex-note {
  display: flex;
  gap: 15px;
  margin: clamp(24px, 3.5vh, 35px) 0 clamp(28px, 4vh, 42px);
  padding: 17px 17px 18px 15px;
  border-left: 1px solid rgba(171, 80, 56, 0.65);
  background: rgba(171, 80, 56, 0.045);
}

.codex-note-index {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.2;
  color: rgba(201, 169, 117, 0.6);
}

.codex-note p {
  margin: 0;
  font-size: 10.5px;
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.04em;
  color: rgba(231, 220, 201, 0.48);
}

.codex-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(231, 220, 201, 0.08);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(231, 220, 201, 0.25);
}

.codex::-webkit-scrollbar { width: 3px; }
.codex::-webkit-scrollbar-track { background: transparent; }
.codex::-webkit-scrollbar-thumb { background: rgba(201, 169, 117, 0.24); }

/* --------------------------------------------------------------------------
   Loader
   -------------------------------------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background:
    radial-gradient(ellipse 54% 60% at 52% 52%, rgba(91, 69, 44, 0.15), transparent 68%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(47, 61, 52, 0.2), transparent 64%),
    #070c0c;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 1.2s var(--ease-soft), visibility 1.2s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-noise {
  position: absolute;
  inset: -15%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.34'/%3E%3C/svg%3E");
  opacity: 0.075;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.loader-topline,
.loader-bottom {
  position: absolute;
  left: clamp(24px, 4.4vw, 68px);
  right: clamp(24px, 4.4vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1;
  color: rgba(231, 220, 201, 0.3);
}

.loader-topline { top: calc(clamp(26px, 4.2vh, 48px) + var(--safe-top)); }
.loader-bottom { bottom: calc(clamp(24px, 4vh, 42px) + var(--safe-bottom)); }

.loader-inner {
  position: relative;
  z-index: 2;
  width: min(420px, 80vw);
  text-align: center;
  animation: loader-breathe 1.4s var(--ease) both;
}

@keyframes loader-breathe {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.loader-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto clamp(24px, 4.2vh, 40px);
  color: rgba(9, 6, 4, 0.84);
  background: #a74f3a;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  transform: rotate(-3deg);
  clip-path: polygon(2% 0%, 98% 2%, 100% 95%, 95% 100%, 2% 98%, 0% 4%);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.loader-eyebrow {
  margin: 0 0 17px;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(201, 169, 117, 0.48);
}

.loader-title {
  margin: 0 0 clamp(27px, 4.4vh, 42px);
  font-family: var(--serif);
  font-size: clamp(23px, 2.3vw, 30px);
  font-weight: 300;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  line-height: 1.3;
  color: rgba(238, 225, 205, 0.88);
}

.loader-track {
  width: min(238px, 66vw);
  height: 1px;
  margin: 0 auto 14px;
  overflow: hidden;
  background: rgba(231, 220, 201, 0.12);
}

.loader-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(171, 80, 56, 0.55), rgba(201, 169, 117, 0.95));
  transition: width 0.75s var(--ease-soft);
}

.loader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(238px, 66vw);
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgba(231, 220, 201, 0.28);
}

.loader-meta b {
  font-weight: 400;
  color: rgba(231, 220, 201, 0.58);
}

.loader-hint {
  margin: clamp(29px, 5vh, 46px) 0 0;
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: rgba(231, 220, 201, 0.22);
}

.loader.is-error .loader-seal {
  background: #74362a;
}

.loader.is-error .loader-title {
  color: rgba(214, 153, 128, 0.9);
  font-size: 19px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

.loader.is-error .loader-hint {
  color: rgba(211, 154, 134, 0.64);
}

.loader.is-error .loader-track span {
  width: 100% !important;
  background: #74362a;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: #070c0c;
  color: rgba(231, 220, 201, 0.7);
  font-size: 14px;
  letter-spacing: 0.18em;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .top-coordinate { display: none; }
  .top-divider { display: none; }
  .hero-title { font-size: clamp(45px, 5vw, 64px); }
  .title-foot-copy { max-width: 230px; }
  .chapter { min-width: 172px; grid-template-columns: 14px minmax(76px, auto) 25px; gap: 8px; }
  .chapter-en { font-size: 5.2px; }
}

@media (max-width: 900px) {
  .cinema-frame { inset: 12px; }

  .topbar {
    top: calc(20px + var(--safe-top));
    left: 22px;
    right: 22px;
    gap: 20px;
  }

  .brand { gap: 10px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 10.5px; letter-spacing: 0.3em; }
  .brand-sub { font-size: 6px; letter-spacing: 0.12em; }
  .top-actions { gap: 16px; }

  .title-block {
    top: calc(88px + var(--safe-top));
    left: 22px;
    gap: 15px;
  }

  .title-rule { min-height: 235px; }
  .eyebrow { font-size: 7.5px; letter-spacing: 0.12em; gap: 7px; }
  .hero-title {
    margin-top: 16px;
    font-size: clamp(39px, 8.2vw, 50px);
    letter-spacing: 0.14em;
    line-height: 1.06;
  }
  .title-foot { margin-top: 17px; gap: 11px; }
  .seal { width: 28px; height: 28px; font-size: 15px; }
  .title-foot-copy { max-width: 210px; }
  .latin-title { font-size: 10px; letter-spacing: 0.2em; }
  .intro { display: none; }

  .chapter-rail {
    top: auto;
    left: 22px;
    right: 22px;
    bottom: calc(77px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    gap: 10px;
    transform: none;
  }

  .chapter-rail::before { display: none; }

  .is-ready .chapter-rail { transform: none; }
  .chapter-rail .rail-heading { display: none; }

  .chapter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: auto;
    min-width: 0;
    padding: 9px 0 0;
    border-top: 1px solid rgba(231, 220, 201, 0.12);
    text-align: left;
  }

  .chapter-index {
    font-size: 7px;
    color: rgba(231, 220, 201, 0.26);
  }

  .chapter-copy { align-items: flex-start; gap: 3px; }
  .chapter-cn { font-size: 11px; letter-spacing: 0.18em; }
  .chapter-en { display: none; }
  .chapter-line {
    position: absolute;
    top: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.55s var(--ease);
  }

  .chapter:hover .chapter-line { width: 50%; }
  .chapter.is-active .chapter-line { width: 100%; }
  .chapter.is-active::before { display: none; }
  .chapter.is-active .chapter-cn { letter-spacing: 0.22em; }

  .footer-bar {
    left: 22px;
    right: 22px;
    bottom: calc(18px + var(--safe-bottom));
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-top: 11px;
    font-size: 10px;
  }

  .interaction-hint { display: none; }
  .light-control { justify-self: start; gap: 10px; }
  .control-kicker { display: none; }
  .light-options { gap: 12px; }
  .view-tools { justify-self: end; gap: 10px; }
  .auto-state { display: none; }
  .footer-bar::before { width: 38px; }
}

@media (max-width: 600px) {
  .topbar { left: 17px; right: 17px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 10px; }
  .brand-mark { width: 25px; height: 25px; }
  .top-actions { gap: 13px; padding-top: 2px; }
  .text-control { font-size: 9px; letter-spacing: 0.12em; }
  #sound-label { font-size: 8.5px; }
  .sound-state { display: none; }
  .control-copy { gap: 0; }
  .sound-control { gap: 7px; }
  .ui-hide-button { display: none; }

  .title-block { top: calc(77px + var(--safe-top)); left: 17px; gap: 12px; }
  .title-rule { min-height: 200px; }
  .eyebrow span:nth-child(3) { display: none; }
  .eyebrow .eyebrow-dot { display: none; }
  .hero-title { font-size: clamp(34px, 10.2vw, 42px); margin-top: 14px; letter-spacing: 0.1em; }
  .title-foot { margin-top: 14px; }
  .title-foot-copy { max-width: 165px; }
  .latin-title { font-size: 8.5px; letter-spacing: 0.17em; }

  .chapter-rail { left: 17px; right: 17px; bottom: calc(63px + var(--safe-bottom)); gap: 7px; }
  .chapter { padding-top: 8px; }
  .chapter-index { display: none; }
  .chapter-cn { font-size: 10.5px; letter-spacing: 0.13em; }
  .chapter.is-active .chapter-cn { letter-spacing: 0.16em; }

  .footer-bar { left: 17px; right: 17px; bottom: calc(15px + var(--safe-bottom)); padding-top: 9px; gap: 10px; }
  .light-options { gap: 10px; }
  .light-options button { font-size: 9px; gap: 4px; }
  .view-tools { gap: 8px; }
  .view-tools button { font-size: 9px; }
  .auto-state { display: none; }
  .tool-separator { height: 8px; }
  .ui-restore { top: calc(18px + var(--safe-top)); right: 17px; }

  .codex { width: 100%; padding: 45px 24px 30px; border-left: 0; }
  .codex h2 { font-size: 26px; }
  .codex-data { grid-template-columns: 1fr 1fr; }
  .codex-foot { font-size: 6px; }
}

@media (max-height: 670px) and (min-width: 901px) {
  .title-block { top: 108px; }
  .title-rule { min-height: 225px; }
  .hero-title { font-size: clamp(38px, 3.7vw, 55px); }
  .intro { display: none; }
  .title-foot { margin-top: 14px; }
  .chapter { padding: 7px 0; }
  .footer-bar { bottom: 16px; }
}

@media (max-height: 560px) and (max-width: 900px) {
  .title-block {
    top: calc(60px + var(--safe-top));
    left: 18px;
    gap: 10px;
  }
  .title-rule { min-height: 146px; }
  .eyebrow { font-size: 7px; letter-spacing: 0.08em; }
  .hero-title {
    font-size: 29px;
    letter-spacing: 0.08em;
    margin-top: 8px;
  }
  .title-foot { margin-top: 8px; gap: 8px; }
  .seal { width: 24px; height: 24px; font-size: 12px; }
  .title-foot-copy { display: none; }

  .chapter-rail {
    bottom: calc(47px + var(--safe-bottom));
    gap: 8px;
  }
  .chapter { padding-top: 6px; }
  .chapter-cn { font-size: 9.5px; }

  .footer-bar {
    bottom: calc(8px + var(--safe-bottom));
    padding-top: 6px;
    border-top: 0;
  }
  .footer-bar::before { display: none; }
  .light-options button { font-size: 8.5px; }
  .view-tools button { font-size: 8.5px; }
}

/* Larger hit areas for touch while keeping the small editorial type. */
@media (max-width: 900px) {
  .chapter { position: relative; }
  .chapter::after {
    content: "";
    position: absolute;
    inset: -10px -4px;
  }
  .light-options button,
  .view-tools button { min-height: 28px; }
}

/* --------------------------------------------------------------------------
   Free roam · chamber index · orbit centre
   -------------------------------------------------------------------------- */

.free-ui {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: none;
  pointer-events: none;
}

.is-free-mode .free-ui {
  display: block;
}

.is-free-mode .auto-toggle,
.is-free-mode .view-tools .tool-separator,
.is-free-mode .footer-bar .interaction-hint {
  display: none;
}

.is-free-mode .view-tools {
  justify-content: flex-end;
}

.free-ui button {
  pointer-events: auto;
}

.chamber-nav {
  position: fixed;
  top: calc(clamp(24px, 4.2vh, 46px) + var(--safe-top));
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid rgba(230, 218, 197, 0.1);
  background: rgba(4, 10, 11, 0.36);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transform: translateX(-50%);
  pointer-events: auto;
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.2);
}

.chamber-nav-label {
  padding: 0 9px 0 7px;
  color: rgba(231, 220, 201, 0.35);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.chamber-nav button {
  min-width: 47px;
  padding: 7px 10px;
  border: 1px solid transparent;
  color: rgba(231, 220, 201, 0.54);
  font-size: 9.5px;
  font-weight: 300;
  letter-spacing: 0.16em;
  white-space: nowrap;
  transition: color 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.chamber-nav button:hover {
  color: rgba(241, 230, 212, 0.85);
  border-color: rgba(201, 169, 117, 0.2);
}

.chamber-nav button.is-active {
  color: rgba(243, 232, 213, 0.94);
  border-color: rgba(201, 169, 117, 0.32);
  background: rgba(201, 169, 117, 0.06);
}

.free-hint {
  position: fixed;
  left: clamp(24px, 4.4vw, 68px);
  bottom: calc(clamp(66px, 9.6vh, 94px) + var(--safe-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(231, 220, 201, 0.48);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  line-height: 1.5;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
}

.free-hint-mark {
  color: var(--gold);
  font-size: 9px;
  opacity: 0.8;
}

.center-tools {
  position: fixed;
  left: clamp(24px, 4.4vw, 68px);
  bottom: calc(clamp(98px, 14vh, 142px) + var(--safe-bottom));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.center-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(231, 220, 201, 0.12);
  background: rgba(4, 11, 12, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(231, 220, 201, 0.48);
  font-size: 8.5px;
  font-weight: 300;
  letter-spacing: 0.12em;
  transition: color 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.center-button:hover {
  color: rgba(241, 230, 212, 0.86);
  border-color: rgba(201, 169, 117, 0.32);
}

.center-button.is-active,
.center-button[aria-pressed="true"] {
  color: rgba(231, 204, 157, 0.88);
  border-color: rgba(201, 169, 117, 0.28);
}

.center-button.is-picking {
  color: #f1ddbd;
  border-color: rgba(201, 169, 117, 0.68);
  background: rgba(201, 169, 117, 0.12);
}

.center-glyph {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  color: var(--gold);
}

.center-reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid rgba(213, 181, 126, 0.72);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s var(--ease);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16), 0 0 18px rgba(201, 169, 117, 0.12);
}

.center-reticle::before,
.center-reticle::after {
  content: "";
  position: absolute;
  background: rgba(221, 190, 136, 0.72);
}

.center-reticle::before {
  left: 50%;
  top: -6px;
  width: 1px;
  height: 8px;
  box-shadow: 0 32px 0 rgba(221, 190, 136, 0.72);
}

.center-reticle::after {
  top: 50%;
  left: -6px;
  width: 8px;
  height: 1px;
  box-shadow: 32px 0 0 rgba(221, 190, 136, 0.72);
}

.center-reticle.is-visible {
  opacity: 0.9;
  visibility: visible;
  transform: scale(1);
}

.reticle-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(224, 192, 140, 0.8);
}

.reticle-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  color: rgba(231, 220, 201, 0.5);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.2em;
  white-space: nowrap;
  transform: translateX(-50%);
}

@media (max-width: 900px), (pointer: coarse) {
  .center-reticle {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
  }
  .center-reticle::before { box-shadow: 0 28px 0 rgba(221, 190, 136, 0.72); }
  .center-reticle::after { box-shadow: 28px 0 0 rgba(221, 190, 136, 0.72); }
}

.crawl-hint {
  position: fixed;
  left: 50%;
  bottom: calc(176px + var(--safe-bottom));
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(201, 169, 117, 0.2);
  background: rgba(4, 11, 12, 0.56);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: rgba(231, 220, 201, 0.66);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.09em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease), visibility 0.35s;
  pointer-events: none;
}

.crawl-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.crawl-hint > span {
  color: var(--gold);
  font-size: 12px;
}

.free-exit { display: none; }

.free-mobile { display: none; }

.free-ui button[data-move] {
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.is-center-picking #scene {
  cursor: crosshair;
}

.center-hint {
  position: fixed;
  top: calc(16vh + var(--safe-top));
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(201, 169, 117, 0.22);
  background: rgba(4, 11, 12, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(235, 221, 199, 0.76);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -5px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  pointer-events: none;
  white-space: nowrap;
}

.center-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.center-hint > span { color: var(--gold); font-size: 12px; }

/* Free roam on a touch device: compact, translucent six-button control. */
@media (max-width: 900px), (pointer: coarse) {
  .is-free-mode .title-block {
    opacity: 0;
    transform: translateX(-18px);
    pointer-events: none;
    transition-delay: 0s;
    transition-duration: 0.45s;
  }

  .is-free-mode .chapter-rail,
  .is-free-mode .footer-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .is-free-mode .free-ui { display: block; }

  .chamber-nav {
    top: calc(57px + var(--safe-top));
    left: 17px;
    right: 101px;
    justify-content: flex-start;
    gap: 0;
    padding: 3px 4px;
    transform: none;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chamber-nav::-webkit-scrollbar { display: none; }

  .chamber-nav-label { display: none; }

  .chamber-nav button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 7px;
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .free-hint { display: none; }

  .center-tools {
    left: auto;
    right: 17px;
    bottom: calc(215px + var(--safe-bottom));
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .center-button {
    min-height: 34px;
    justify-content: center;
    padding: 0 12px;
    border-color: rgba(231, 220, 201, 0.16);
    background: rgba(4, 11, 12, 0.44);
    font-size: 8.5px;
  }

  .center-button .center-glyph { font-size: 15px; }

  .free-exit {
    position: fixed;
    top: calc(57px + var(--safe-top));
    right: 17px;
    z-index: 3;
    display: block;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(231, 220, 201, 0.14);
    background: rgba(4, 11, 12, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(231, 220, 201, 0.56);
    font-size: 8px;
    letter-spacing: 0.12em;
    white-space: nowrap;
    pointer-events: auto;
  }

  .free-mobile {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: block;
    pointer-events: none;
  }

  .free-pad {
    position: absolute;
    left: 17px;
    bottom: calc(19px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(3, 50px);
    gap: 5px;
    width: 160px;
    height: 160px;
    pointer-events: auto;
  }

  .move-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(231, 220, 201, 0.18);
    background: rgba(5, 13, 14, 0.34);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    color: rgba(239, 226, 205, 0.72);
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    box-shadow: inset 0 0 22px rgba(201, 169, 117, 0.025);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    pointer-events: auto;
  }

  .move-button span {
    font-family: var(--serif);
    font-size: 7px;
    letter-spacing: 0.1em;
    color: rgba(231, 220, 201, 0.38);
  }

  .move-button:active,
  .move-button.is-pressed {
    color: #f2dfc0;
    border-color: rgba(201, 169, 117, 0.6);
    background: rgba(201, 169, 117, 0.16);
  }

  .move-forward { grid-column: 2; grid-row: 1; }
  .move-left { grid-column: 1; grid-row: 2; }
  .move-right { grid-column: 3; grid-row: 2; }
  .move-back { grid-column: 2; grid-row: 3; }

  .move-core {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(201, 169, 117, 0.42);
    border-radius: 50%;
    opacity: 0.6;
  }

  .free-vertical {
    position: absolute;
    right: 17px;
    bottom: calc(19px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
  }

  .free-vertical .move-button {
    width: 55px;
    height: 77px;
    gap: 4px;
    font-size: 17px;
  }

  .free-vertical .move-button span { font-size: 7.5px; }

  .is-free-mode .chapter { opacity: 0; visibility: hidden; }
  .is-free-mode .ui-layer .topbar { opacity: 1; }

  .center-hint {
    top: auto;
    bottom: calc(257px + var(--safe-bottom));
    width: auto;
    max-width: calc(100vw - 34px);
    white-space: normal;
    text-align: center;
    font-size: 8.5px;
    line-height: 1.6;
  }

  .crawl-hint {
    bottom: calc(250px + var(--safe-bottom));
    width: max-content;
    max-width: calc(100vw - 34px);
    white-space: normal;
    text-align: center;
    font-size: 8.5px;
    line-height: 1.55;
  }
}

@media (max-width: 900px) {
  .chapter-rail { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 600px) {
  .chamber-nav {
    top: calc(57px + var(--safe-top));
    right: 101px;
  }

  .is-free-mode .topbar {
    top: calc(18px + var(--safe-top));
  }

  .free-pad {
    left: 13px;
    bottom: calc(15px + var(--safe-bottom));
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    width: 154px;
    height: 154px;
  }

  .move-button { width: 48px; height: 48px; }
  .free-vertical { right: 13px; bottom: calc(15px + var(--safe-bottom)); }
  .free-vertical .move-button { width: 52px; height: 74px; }
  .center-tools { right: 13px; bottom: calc(204px + var(--safe-bottom)); }
  .center-button { min-height: 32px; font-size: 8px; }

  .free-exit {
    top: calc(57px + var(--safe-top));
    right: 13px;
    height: 32px;
    font-size: 7.5px;
  }

  .chamber-nav { right: 87px; }
}

@media (max-height: 560px) and (max-width: 900px) {
  .is-free-mode .free-pad {
    bottom: calc(10px + var(--safe-bottom));
    transform: scale(0.78);
    transform-origin: bottom left;
  }

  .is-free-mode .free-vertical {
    bottom: calc(10px + var(--safe-bottom));
    transform: scale(0.78);
    transform-origin: bottom right;
  }

  .center-tools {
    bottom: calc(143px + var(--safe-bottom));
    transform: scale(0.82);
    transform-origin: bottom right;
  }

  .chamber-nav { display: none; }
  .free-exit { top: calc(50px + var(--safe-top)); }
  .is-free-mode .topbar { opacity: 0.7; }
}

/* --------------------------------------------------------------------------
   Module loading — shown only when a new cave is unfolded at runtime
   -------------------------------------------------------------------------- */

.module-loader {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 8, 0.64);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.module-loader.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.module-loader-card {
  position: relative;
  width: min(390px, calc(100vw - 42px));
  padding: 27px 28px 22px;
  border: 1px solid rgba(201, 169, 117, 0.18);
  background: linear-gradient(160deg, rgba(11, 20, 20, 0.92), rgba(5, 11, 12, 0.88));
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.module-loader-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  width: 44px;
  height: 1px;
  background: var(--gold);
}

.module-kicker {
  margin: 0 0 12px;
  color: rgba(201, 169, 117, 0.58);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.24em;
}

.module-loader h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.module-step {
  margin: 9px 0 24px;
  color: rgba(231, 220, 201, 0.48);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
}

.module-track {
  height: 1px;
  background: rgba(231, 220, 201, 0.12);
  overflow: hidden;
}

.module-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(201, 169, 117, 0.5), var(--gold-bright));
  transition: width 0.35s ease;
}

.module-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: rgba(231, 220, 201, 0.3);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.module-meta span:last-child { color: rgba(201, 169, 117, 0.68); }

.sound-prompt {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(201, 169, 117, 0.2);
  background: rgba(4, 10, 11, 0.62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: rgba(231, 220, 201, 0.62);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.12em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 7px);
  transition: opacity 0.5s ease, transform 0.5s var(--ease), visibility 0.5s;
}

.sound-prompt.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.sound-prompt-glyph {
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
  animation: sound-breathe 2.4s ease-in-out infinite;
}

.sound-prompt.is-started { opacity: 0; visibility: hidden; }

@keyframes sound-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}

@media (max-width: 600px) {
  .module-loader-card { padding: 23px 21px 19px; width: calc(100vw - 34px); }
  .module-loader h2 { font-size: 23px; }
  .sound-prompt { bottom: calc(83px + var(--safe-bottom)); font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .film-grain { display: none; }
  .hero-title span { opacity: 1; filter: none; transform: none; }
}

/* --------------------------------------------------------------------------
   Interaction v2 — sight-centre chapters and first-person viewing
   -------------------------------------------------------------------------- */

.chapter-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  gap: 0;
}

.chapter-rail .rail-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
}

.chapter-rail .rail-heading #rail-chamber {
  color: rgba(201, 169, 117, 0.64);
  letter-spacing: 0.16em;
}

.chapter.is-empty {
  opacity: 0.56;
}

.chapter.is-empty .chapter-cn::after {
  content: " +";
  color: rgba(201, 169, 117, 0.7);
  font-size: 9px;
}

.chapter.is-empty:hover {
  opacity: 0.88;
}

.chapter.is-custom.is-set .chapter-index {
  color: rgba(201, 169, 117, 0.9);
}

.chapter-actions {
  position: fixed;
  top: calc(50% + 132px);
  right: clamp(23px, 4.1vw, 64px);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.rail-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px 0 7px;
  border: 1px solid rgba(231, 220, 201, 0.15);
  background: rgba(5, 12, 13, 0.3);
  color: rgba(231, 220, 201, 0.56);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  pointer-events: auto;
  transition: color 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.rail-action > span:first-child {
  color: var(--gold);
  font-size: 11px;
  line-height: 1;
}

.rail-action:hover,
.rail-action.is-picking {
  color: rgba(245, 233, 214, 0.9);
  border-color: rgba(201, 169, 117, 0.45);
  background: rgba(20, 17, 12, 0.5);
}

.rail-action-strong {
  color: rgba(241, 230, 212, 0.78);
  border-color: rgba(201, 169, 117, 0.25);
}

.is-focus-picking #scene {
  cursor: crosshair;
}

.is-focus-picking .rail-action.is-picking {
  box-shadow: 0 0 20px rgba(201, 169, 117, 0.12);
}

/* The full-viewport walk layer is deliberately quiet: a crosshair, a small
   mode mark, and controls at the edges. */
.walk-hud {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.is-walk-mode .walk-hud {
  display: block;
}

.is-walk-mode .title-block,
.is-walk-mode .footer-bar,
.is-walk-mode .chapter-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.is-walk-mode .topbar {
  opacity: 0.62;
}

.is-walk-mode .chapter-rail {
  opacity: 0.58;
  pointer-events: none;
}

.is-walk-mode .chapter-rail .rail-heading::after {
  content: "移动中";
  color: rgba(201, 169, 117, 0.5);
  letter-spacing: 0.12em;
}

.is-walk-mode .chapter {
  pointer-events: none;
}

.is-walk-mode #scene {
  cursor: crosshair;
}

.is-walk-mode.is-pointer-locked #scene {
  cursor: none;
}

.walk-mark {
  position: absolute;
  top: calc(78px + var(--safe-top));
  left: clamp(23px, 4.1vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.walk-mark-kicker {
  color: rgba(231, 220, 201, 0.42);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.24em;
}

.walk-chamber {
  color: rgba(238, 225, 204, 0.72);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.walk-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  opacity: 0.94;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 5px rgba(0, 0, 0, 0.42));
}

.walk-crosshair::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.2), transparent 66%);
}

.walk-crosshair i {
  position: absolute;
  z-index: 1;
  display: block;
  background: rgba(255, 247, 229, 0.94);
  transition: opacity 0.25s ease;
}

.crosshair-v {
  left: 50%;
  top: 1px;
  width: 1px;
  height: 8px;
  box-shadow: 0 22px 0 rgba(255, 247, 229, 0.94);
}

.crosshair-h {
  top: 50%;
  left: 1px;
  width: 8px;
  height: 1px;
  box-shadow: 22px 0 0 rgba(255, 247, 229, 0.94);
}

.crosshair-dot {
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  margin: -1px;
  border-radius: 50%;
  background: rgba(201, 169, 117, 0.95);
  box-shadow: 0 0 7px rgba(224, 192, 140, 0.8);
}

.walk-footer {
  position: absolute;
  left: 50%;
  bottom: calc(25px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.walk-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(231, 220, 201, 0.1);
  background: rgba(4, 11, 12, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(231, 220, 201, 0.48);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.walk-hint span + span {
  padding-left: 12px;
  border-left: 1px solid rgba(231, 220, 201, 0.1);
}

.walk-lock-hint {
  color: rgba(201, 169, 117, 0.54);
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.12em;
}

.sensitivity {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border: 1px solid rgba(231, 220, 201, 0.1);
  background: rgba(4, 11, 12, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(231, 220, 201, 0.42);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  pointer-events: auto;
}

.sensitivity-label {
  color: rgba(201, 169, 117, 0.6);
}

.sensitivity input {
  width: 92px;
  height: 14px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.sensitivity-value {
  width: 28px;
  color: rgba(231, 220, 201, 0.62);
  text-align: right;
}

.walk-exit {
  position: absolute;
  top: calc(74px + var(--safe-top));
  right: 16px;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(231, 220, 201, 0.24);
  background: rgba(4, 11, 12, 0.28);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: rgba(241, 230, 212, 0.7);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  pointer-events: auto;
}

.walk-exit > span:first-child {
  color: var(--gold);
  font-size: 12px;
}

.walk-mobile {
  display: none;
}

.walk-pad {
  position: absolute;
  left: 17px;
  bottom: calc(19px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 5px;
  width: 160px;
  height: 160px;
  pointer-events: auto;
}

.walk-mobile .move-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(231, 220, 201, 0.18);
  background: rgba(5, 13, 14, 0.34);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: rgba(239, 226, 205, 0.72);
  font-family: var(--mono);
  font-size: 16px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.walk-mobile .move-button:active,
.walk-mobile .move-button.is-pressed {
  border-color: rgba(201, 169, 117, 0.5);
  background: rgba(29, 23, 14, 0.55);
  color: var(--gold-bright);
}

.walk-mobile .move-forward { grid-column: 2; grid-row: 1; }
.walk-mobile .move-left { grid-column: 1; grid-row: 2; }
.walk-mobile .move-right { grid-column: 3; grid-row: 2; }
.walk-mobile .move-back { grid-column: 2; grid-row: 3; }

.walk-mobile .move-core {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(201, 169, 117, 0.42);
  border-radius: 50%;
  opacity: 0.6;
}

.walk-vertical {
  position: absolute;
  right: 17px;
  bottom: calc(19px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
}

.walk-vertical .move-button {
  width: 55px;
  height: 77px;
  gap: 4px;
  font-size: 17px;
}

.walk-vertical .move-button span {
  font-size: 7.5px;
}

.is-walk-mode .crawl-hint {
  bottom: calc(196px + var(--safe-bottom));
}

.chapter-toast {
  position: fixed;
  left: 50%;
  top: calc(78px + var(--safe-top));
  z-index: 32;
  padding: 7px 13px;
  border: 1px solid rgba(201, 169, 117, 0.22);
  background: rgba(4, 11, 12, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(241, 230, 212, 0.78);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -5px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease), visibility 0.35s;
  pointer-events: none;
}

.chapter-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (max-width: 900px), (pointer: coarse) {
  .chapter-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .chapter-rail {
    display: block;
  }

  .chapter-actions {
    top: calc(57px + var(--safe-top));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    gap: 7px;
  }

  .rail-action {
    min-height: 26px;
    padding: 0 9px;
    font-size: 6.8px;
  }

  .walk-mark {
    top: calc(57px + var(--safe-top));
    left: 15px;
  }

  .walk-chamber { font-size: 10px; }

  .walk-exit {
    display: flex;
    top: calc(57px + var(--safe-top));
    right: 13px;
    min-height: 30px;
    padding: 0 9px;
    font-size: 6.8px;
  }

  .walk-footer {
    bottom: calc(196px + var(--safe-bottom));
    gap: 7px;
    width: calc(100vw - 30px);
    max-width: 360px;
  }

  .walk-hint { display: none; }

  .walk-lock-hint {
    padding: 5px 9px;
    background: rgba(4, 11, 12, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 7px;
    letter-spacing: 0.08em;
  }

  .sensitivity {
    gap: 8px;
    padding: 4px 9px;
    font-size: 6.5px;
  }

  .sensitivity input { width: 96px; }

  .walk-mobile { display: block; }

  .walk-pad {
    left: 13px;
    bottom: calc(15px + var(--safe-bottom));
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    width: 154px;
    height: 154px;
  }

  .walk-mobile .move-button {
    width: 48px;
    height: 48px;
  }

  .walk-vertical {
    right: 13px;
    bottom: calc(15px + var(--safe-bottom));
  }

  .walk-vertical .move-button {
    width: 52px;
    height: 74px;
  }

  .is-walk-mode .chapter-rail { display: none; }

  .is-walk-mode .chapter-actions { display: none; }

  .is-walk-mode .crawl-hint {
    bottom: calc(180px + var(--safe-bottom));
    font-size: 8px;
  }

  .chapter-toast {
    top: calc(100px + var(--safe-top));
    font-size: 8px;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  .walk-pad {
    bottom: calc(10px + var(--safe-bottom));
    transform: scale(0.78);
    transform-origin: bottom left;
  }

  .walk-vertical {
    bottom: calc(10px + var(--safe-bottom));
    transform: scale(0.78);
    transform-origin: bottom right;
  }

  .walk-footer {
    top: calc(48px + var(--safe-top));
    bottom: auto;
    width: auto;
    max-width: none;
    gap: 0;
  }

  .walk-lock-hint { display: none; }
  .walk-mark { top: calc(48px + var(--safe-top)); }
  .walk-exit { top: calc(48px + var(--safe-top)); }
  .chapter-actions { top: calc(48px + var(--safe-top)); }
}
