/* ============================================================
   灰港线：第一案 — 卷宗视觉系统 v2
   "案卷夹在金属桌上，一盏钠灯下被翻阅"
   ------------------------------------------------------------
   tokens → primitives → panels → motion → media
   ============================================================ */

:root {
  color-scheme: dark;

  /* INK & PAPER ——————————————————————————————— */
  --void: #05060a;
  --tar: #0b0c08;
  --coal: #131309;
  --paper: #ead7a7;
  --paper-hot: #fff1c2;
  --paper-cold: #d5c69e;
  --faded: #a89370;
  --dim: #786849;

  /* RULES & DIVIDERS ——————————————————————————— */
  --rule: rgba(238, 217, 164, 0.13);
  --rule-hard: rgba(238, 217, 164, 0.32);
  --rule-bright: rgba(255, 240, 189, 0.62);

  /* ACCENTS — used sparingly ——————————————————— */
  --sodium: #f0c64a;
  --sodium-hot: #ffd95a;
  --sodium-deep: #b07c1d;
  --rust: #b54931;
  --rust-deep: #6f2018;
  --institution: #4f8fa6;
  --port-blue: #2a6976;
  --bayou: #5a7e62;
  --sick-green: #97a849;
  --violet-smoke: #5d3a5a;
  --bruise: #2c2731;

  /* STAMPS ——————————————————————————————————— */
  --stamp-ink: rgba(181, 73, 49, 0.78);
  --stamp-paper: rgba(255, 240, 189, 0.94);

  /* SHADOW ——————————————————————————————————— */
  --shadow-deep: 0 30px 60px -22px rgba(0, 0, 0, 0.72), 0 8px 18px -10px rgba(0, 0, 0, 0.5);
  --shadow-flat: 0 1px 0 rgba(255, 244, 207, 0.04), 0 12px 28px -16px rgba(0, 0, 0, 0.7);
  --shadow-stamp: 12px 14px 0 rgba(0, 0, 0, 0.36);

  /* SPATIAL SCALE ——————————————————————————————— */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 28px;
  --s-7: 36px;
  --s-8: 48px;

  /* TYPOGRAPHY ——————————————————————————————— */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "FangSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;

  /* TYPE SIZES ——————————————————————————————— */
  --t-2xs: 10px;
  --t-xs: 11px;
  --t-sm: 12px;
  --t-base: 13px;
  --t-md: 14px;
  --t-lg: 15px;
  --t-xl: 17px;
  --t-2xl: 22px;
  --t-3xl: 30px;
  --t-4xl: 42px;
  --t-5xl: 56px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--paper);
  font-family: var(--sans);
  font-size: var(--t-md);
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

button {
  font: inherit;
  letter-spacing: 0;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* text selection — sodium ink on paper */
::selection {
  background: rgba(240, 198, 74, 0.32);
  color: var(--paper-hot);
  text-shadow: none;
}

/* unified focus ring — sodium accent with offset */
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

button:focus-visible,
.choice:focus-visible,
.tab:focus-visible,
.icon-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(240, 198, 74, 0.16);
}

/* webkit scrollbars — thin paper rail */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: rgba(5, 6, 4, 0.62);
  border-left: 1px solid rgba(234, 220, 185, 0.06);
}
*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(240, 198, 74, 0.42), rgba(180, 73, 49, 0.42));
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 1px;
}
*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(240, 198, 74, 0.62), rgba(180, 73, 49, 0.6));
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
/* firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 198, 74, 0.4) rgba(5, 6, 4, 0.5);
}

/* ============================================================
   PROTAGONIST THEMING
   ============================================================ */

body[data-protagonist="lin"]    { --accent: var(--sodium);       --accent-rust: #b04a32; --accent-cool: #4d8fa4; }
body[data-protagonist="asu"]    { --accent: #d6c84e;             --accent-rust: #d15437; --accent-cool: #56926d; }
body[data-protagonist="gu"]     { --accent: #e2b95b;             --accent-rust: #9c3f38; --accent-cool: #5a9f83; }
body[data-protagonist="han"]    { --accent: #f2d36b;             --accent-rust: #c14a34; --accent-cool: #63a3bb; }
body[data-protagonist="meng"]   { --accent: #e6c05a;             --accent-rust: #9f4434; --accent-cool: #7f8fa9; }
body[data-protagonist="bai"]    { --accent: #d8b242;             --accent-rust: #7e3327; --accent-cool: #436277; }
body[data-protagonist="zhou"]   { --accent: #cf9b3a;             --accent-rust: #8d3a2e; --accent-cool: #5e7e6c; }
body[data-protagonist="ending"] { --accent: var(--sodium);       --accent-rust: #6f2018; --accent-cool: #304f58; }
body { --accent: var(--sodium); --accent-rust: var(--rust); --accent-cool: var(--institution); }

/* ============================================================
   ATMOSPHERIC LAYERS — fixed background plates
   ============================================================ */

#city-map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  filter: contrast(1.18) saturate(0.72) brightness(0.78);
}

.vignette,
.grain,
.lamp {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.vignette {
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 60% at 64% 22%, rgba(255, 220, 130, 0.13), transparent 62%),
    radial-gradient(ellipse 110% 80% at 50% 110%, rgba(0, 0, 0, 0.78), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.55));
}

.grain {
  z-index: 2;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image:
    repeating-radial-gradient(circle at 17% 23%, rgba(234, 220, 185, 0.35) 0 0.6px, transparent 0.6px 2.4px),
    repeating-radial-gradient(circle at 71% 78%, rgba(0, 0, 0, 0.4) 0 0.5px, transparent 0.5px 2.6px);
  background-size: 220px 220px, 280px 280px;
}

.lamp {
  z-index: 1;
  opacity: 0.55;
  background:
    radial-gradient(circle at 78% 8%, rgba(255, 211, 110, 0.34) 0%, rgba(255, 211, 110, 0.12) 22%, transparent 50%),
    radial-gradient(circle at 78% 8%, rgba(255, 235, 170, 0.5) 0%, transparent 9%);
  mix-blend-mode: screen;
  animation: lampFlicker 8s ease-in-out infinite;
}

/* ============================================================
   SHELL & GRID
   ============================================================ */

.game-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  background:
    linear-gradient(180deg, rgba(8, 9, 7, 0.62), rgba(7, 8, 6, 0.78) 38%, rgba(5, 6, 4, 0.86)),
    repeating-linear-gradient(0deg, rgba(234, 220, 185, 0.024) 0 1px, transparent 1px 6px);
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 312px) minmax(420px, 1fr) minmax(304px, 392px);
  gap: var(--s-4);
}

.left-rail,
.right-rail {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-width: 0;
}

/* ============================================================
   TOPBAR — case folder cover strip
   ============================================================ */

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr auto;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--rule-hard);
  border-left: 6px solid var(--accent-rust);
  border-radius: 3px;
  background:
    linear-gradient(95deg, rgba(117, 35, 24, 0.18), transparent 18%, rgba(39, 106, 120, 0.1) 78%, rgba(91, 56, 89, 0.12)),
    linear-gradient(180deg, rgba(38, 33, 22, 0.94), rgba(14, 15, 11, 0.94));
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 244, 207, 0.07);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 6px 6px 6px 6px;
  pointer-events: none;
  border: 1px solid rgba(234, 220, 185, 0.07);
  border-radius: 2px;
}

.topbar-id {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.filing-id {
  color: var(--paper);
  font-size: var(--t-sm);
  font-weight: 500;
}

.filing-class {
  color: var(--accent);
  font-size: var(--t-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.topbar-title .eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin: 4px 0 4px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.06;
  color: var(--paper-hot);
  letter-spacing: 0.04em;
  text-shadow:
    0 1px 0 rgba(255, 244, 207, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(255, 211, 110, 0.06);
}

.topbar-title .subtitle {
  margin: 0;
  color: var(--faded);
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
}

.top-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--rule-hard);
  border-radius: 3px;
  color: var(--paper);
  background: rgba(234, 220, 185, 0.04);
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.22);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button .icon-glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: rgba(240, 198, 74, 0.12);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.icon-button .icon-label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.icon-button:hover {
  border-color: var(--accent);
  background: rgba(240, 198, 74, 0.1);
  transform: translateY(-1px);
}

.icon-button.ghost {
  background: transparent;
}

/* ============================================================
   PROGRESS STRIP — case timeline
   ============================================================ */

.progress-strip {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: 10px var(--s-5);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(20, 18, 12, 0.92), rgba(8, 9, 6, 0.95)),
    repeating-linear-gradient(90deg, rgba(234, 220, 185, 0.04) 0 1px, transparent 1px 8px);
  box-shadow: var(--shadow-flat), inset 0 0 22px rgba(0, 0, 0, 0.6);
}

.prog-cap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
}

.prog-cap.right {
  color: var(--accent);
}

.prog-cap i {
  font-style: normal;
  color: var(--dim);
  margin: 0 2px;
}

.prog-rail {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 26px;
}

.prog-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-hard) 4%, var(--rule-hard) 96%, transparent);
  transform: translateY(-0.5px);
  z-index: 0;
}

/* visited-portion progress fill — set by inline width via CSS variable */
.prog-rail::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  width: var(--prog-fill, 0%);
  background: linear-gradient(90deg, var(--rust-deep), var(--accent) 60%, var(--accent));
  filter: drop-shadow(0 0 6px rgba(240, 198, 74, 0.42));
  transform: translateY(-1px);
  transition: width 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.prog-mark {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 5px;
  height: 14px;
  background: rgba(7, 8, 6, 0.92);
  border: 1px solid var(--dim);
  border-radius: 1px;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease, height 220ms ease;
}

/* per-protagonist accents */
.prog-mark[data-protagonist="lin"]    { --pm: #f0c64a; }
.prog-mark[data-protagonist="asu"]    { --pm: #d6c84e; }
.prog-mark[data-protagonist="gu"]     { --pm: #97c87a; }
.prog-mark[data-protagonist="han"]    { --pm: #63a3bb; }
.prog-mark[data-protagonist="meng"]   { --pm: #b4a07a; }
.prog-mark[data-protagonist="bai"]    { --pm: #b54931; }
.prog-mark[data-protagonist="zhou"]   { --pm: #8d3a2e; }

.prog-mark.visited {
  background: var(--pm, var(--sodium-deep));
  border-color: color-mix(in srgb, var(--pm, var(--sodium-deep)) 60%, transparent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.prog-mark.current {
  width: 4px;
  height: 24px;
  background: var(--pm, var(--sodium-hot));
  border-color: var(--pm, var(--sodium-hot));
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 14px var(--pm, var(--sodium-hot)),
    0 0 22px color-mix(in srgb, var(--pm, var(--sodium)) 40%, transparent);
  animation: progPulse 2.4s ease-in-out infinite;
}

.prog-mark.current::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--pm, var(--sodium));
  filter: drop-shadow(0 0 4px var(--pm, var(--sodium)));
}

@keyframes progPulse {
  0%, 100% { box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 12px var(--pm, var(--sodium-hot)),
    0 0 18px color-mix(in srgb, var(--pm, var(--sodium)) 36%, transparent); }
  50%      { box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 18px var(--pm, var(--sodium-hot)),
    0 0 30px color-mix(in srgb, var(--pm, var(--sodium)) 56%, transparent); }
}

/* ============================================================
   PANEL — shared chrome
   ============================================================ */

.identity-panel,
.psyche-panel,
.meter-panel,
.story-panel,
.right-rail {
  position: relative;
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(38, 35, 25, 0.94), rgba(15, 16, 11, 0.94)),
    repeating-linear-gradient(0deg, rgba(234, 220, 185, 0.026) 0 1px, transparent 1px 7px);
  box-shadow: var(--shadow-flat);
  border-radius: 4px;
}

.identity-panel::after,
.story-panel::after,
.right-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 244, 207, 0.06), transparent 26%),
    linear-gradient(315deg, rgba(111, 43, 36, 0.1), transparent 38%);
  mix-blend-mode: screen;
}

.panel-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px dashed var(--rule);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kicker-tag {
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 1px;
  color: var(--faded);
  font-family: var(--sans);
  font-size: var(--t-2xs);
  letter-spacing: 0.16em;
}

.kicker-tag.mono {
  font-family: var(--mono);
}

/* ============================================================
   IDENTITY PANEL
   ============================================================ */

.identity-panel {
  padding: var(--s-4);
  border-top: 3px solid var(--accent);
}

.portrait {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1 / 1.18;
  display: grid;
  place-items: center;
  margin-bottom: var(--s-3);
  overflow: hidden;
  border-radius: 2px;
  color: rgba(255, 240, 189, 0.92);
  background:
    /* four ID-photo corner brackets */
    linear-gradient(var(--accent), var(--accent)) top    9px left   9px  / 14px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top    9px left   9px  / 1.5px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top    9px right  9px  / 14px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top    9px right  9px  / 1.5px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 9px left   9px  / 14px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 9px left   9px  / 1.5px 14px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 9px right  9px  / 14px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 9px right  9px  / 1.5px 14px no-repeat,
    /* base sodium-rust split */
    linear-gradient(126deg, rgba(240, 198, 74, 0.55) 0%, rgba(180, 73, 49, 0.42) 38%, rgba(20, 22, 16, 0.92) 78%);
  border: 1px solid rgba(255, 240, 189, 0.22);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.28), inset 0 0 80px rgba(0, 0, 0, 0.48);
  font-family: var(--serif);
  font-size: clamp(72px, 8vw, 108px);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.42);
}

/* photograph filing serial — bottom-left, mono, faded */
.portrait::before {
  content: "ID/" attr(data-glyph) " · 灰港-001";
  position: absolute;
  left: 14px;
  bottom: 8px;
  z-index: 2;
  color: rgba(255, 240, 189, 0.45);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  /* clear the previous blur duties — the parent gradient already does that */
  background: none;
  filter: none;
  inset: auto auto 8px 14px;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 240, 189, 0.16) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 10px),
    linear-gradient(transparent 0 56%, rgba(7, 8, 6, 0.42) 100%);
  mix-blend-mode: overlay;
}

/* corner crops — like a filed photograph */
.portrait {
  background-clip: padding-box;
}

.identity-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--s-3);
}

.identity-name h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: var(--t-2xl);
  line-height: 1.18;
  color: var(--paper-hot);
  letter-spacing: 0.04em;
}

.identity-name p {
  margin: 0;
  color: var(--faded);
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
}

.identity-panel .pressure {
  margin: 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule-hard);
  color: var(--paper-cold);
  font-family: var(--serif);
  font-size: var(--t-md);
  font-style: italic;
  line-height: 1.7;
}

/* ============================================================
   PSYCHE PANEL — voices
   ============================================================ */

.psyche-panel {
  padding: var(--s-4);
  border-left: 3px solid var(--violet-smoke);
  background:
    linear-gradient(180deg, rgba(42, 31, 47, 0.86), rgba(13, 14, 11, 0.94)),
    repeating-linear-gradient(115deg, rgba(255, 240, 189, 0.026) 0 1px, transparent 1px 10px);
}

.psyche-voice {
  margin-top: var(--s-2);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(240, 198, 74, 0.07), rgba(91, 56, 89, 0.08) 70%),
    rgba(7, 8, 6, 0.32);
}

.psyche-voice:nth-child(1) { border-left-color: var(--sodium); }
.psyche-voice:nth-child(2) { border-left-color: var(--sick-green); }
.psyche-voice:nth-child(3) { border-left-color: var(--rust); }
.psyche-voice:nth-child(4) { border-left-color: var(--institution); }

.voice-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.voice-head strong {
  color: var(--paper-hot);
  font-family: var(--serif);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.voice-head span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 700;
}

.voice-bar {
  height: 4px;
  margin: 8px 0 6px;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 999px;
  overflow: hidden;
}

.voice-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--sodium) 64%, var(--institution));
  transition: width 320ms ease;
}

.psyche-voice p {
  margin: 0;
  color: var(--paper-cold);
  font-size: var(--t-sm);
  line-height: 1.62;
}

/* ============================================================
   METER PANEL — system pressure
   ============================================================ */

.meter-panel {
  padding: var(--s-4);
  border-left: 3px solid var(--bayou);
}

.meter {
  margin-top: var(--s-3);
}

.meter:first-of-type {
  margin-top: 0;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--faded);
  font-size: var(--t-sm);
  letter-spacing: 0.02em;
}

.meter-label .meter-num {
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
}

.meter-track {
  height: 7px;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid rgba(234, 220, 185, 0.1);
  border-radius: 1px;
  background: rgba(5, 6, 4, 0.62);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.62);
}

.meter-track span {
  display: block;
  height: 100%;
  background:
    linear-gradient(90deg, var(--bayou), var(--sodium) 60%, var(--rust)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 7px);
  background-size: auto, 80px 100%;
  transition: width 300ms ease;
}

/* ============================================================
   STORY PANEL — main reading plate
   ============================================================ */

.story-panel {
  min-width: 0;
  min-height: 640px;
  padding: var(--s-6) var(--s-6) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  border-top: 4px solid var(--accent-rust);
  background:
    linear-gradient(132deg, rgba(117, 35, 24, 0.12), transparent 32%, rgba(39, 106, 120, 0.1) 70%, rgba(91, 56, 89, 0.08)),
    linear-gradient(180deg, rgba(31, 28, 20, 0.96), rgba(13, 14, 10, 0.97));
}

/* document inner border */
.story-panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(234, 220, 185, 0.07);
  border-radius: 2px;
}

/* filing-folder index tab — extrudes upward from top-right, per-protagonist tinted */
.folio-tab {
  position: absolute;
  top: -18px;
  right: 36px;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 16px 8px;
  border: 1px solid var(--rule-hard);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 14%, rgba(31, 28, 20, 0.95)),
      rgba(15, 16, 11, 0.96));
  color: var(--paper-cold);
  font-family: var(--serif);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 207, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 -3px 0 var(--accent-rust),
    0 -8px 12px -8px var(--accent-rust);
  transition: background 320ms ease, box-shadow 320ms ease;
}

/* a thin staple at the tab's left edge — implies it's pinched into the folder */
.folio-tab::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 30%, transparent 30%, transparent 50%, var(--accent) 50%, var(--accent) 70%, transparent 70%);
}

.folio-tab em[data-system] {
  color: var(--accent);
  font-family: var(--serif);
  font-style: normal;
  font-weight: 900;
  font-size: var(--t-md);
  letter-spacing: 0.06em;
}

.folio-tab span[data-num] {
  color: var(--paper);
  font-family: var(--serif);
  font-size: var(--t-sm);
  font-weight: 600;
}

.folio-tab small {
  margin-left: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

/* staple/punch-hole marks at left edge */
.story-panel > .story-head::before,
.story-panel > .story-head::after {
  content: "";
  position: absolute;
  left: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 0 1px rgba(234, 220, 185, 0.18);
}
.story-panel > .story-head::before { top: 12px; }
.story-panel > .story-head::after  { top: 36px; }

.story-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-4);
  align-items: center;
  padding: 0 0 var(--s-3);
  border-bottom: 1px solid var(--rule);
}

.folio {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--rule-hard);
  border-radius: 2px;
  background: rgba(7, 8, 6, 0.4);
  color: var(--paper-cold);
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.folio-num {
  color: var(--accent);
  font-size: var(--t-md);
  font-weight: 700;
}

.folio-divider {
  color: var(--dim);
}

.folio-total {
  color: var(--faded);
  font-size: var(--t-sm);
}

.scene-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
}

.scene-meta span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(234, 220, 185, 0.18);
  border-radius: 1px;
  color: var(--faded);
  background: rgba(6, 7, 5, 0.4);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
}

.scene-meta span:first-child {
  color: var(--paper);
  border-color: rgba(240, 198, 74, 0.36);
}

.stamp {
  position: relative;
  align-self: center;
  display: inline-block;
  padding: 6px 14px;
  border: 2px solid var(--stamp-ink);
  border-radius: 2px;
  color: var(--stamp-ink);
  font-family: var(--serif);
  font-size: var(--t-xs);
  font-weight: 900;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  background: transparent;
  filter: contrast(1.1);
  /* a slight noise / distress */
  background-image:
    repeating-linear-gradient(33deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(112deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 5px);
  background-blend-mode: multiply;
  text-shadow: 0 0 0 var(--stamp-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 189, 0.06);
}

.story-panel h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.04;
  letter-spacing: 0.04em;
  color: var(--paper-hot);
  text-shadow:
    0 1px 0 rgba(255, 244, 207, 0.05),
    0 3px 14px rgba(0, 0, 0, 0.62),
    0 0 36px rgba(240, 198, 74, 0.05);
}

/* a hairline rule beneath the title — combines a thick accent stroke with a hair line */
.story-panel h2::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: var(--s-3);
  background:
    linear-gradient(90deg, var(--accent) 0 56px, transparent 56px 60px, var(--rule-hard) 60px 100%);
}

/* ============================================================
   THOUGHT STACK — three voices in the head
   ============================================================ */

.thought-stack {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin: 0;
}

.thought-stack article {
  position: relative;
  min-height: 90px;
  padding: 12px 14px 12px 14px;
  border: 1px solid rgba(238, 217, 164, 0.14);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(240, 198, 74, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(7, 8, 6, 0.46), rgba(28, 24, 30, 0.16)),
    repeating-linear-gradient(100deg, rgba(238, 217, 164, 0.035) 0 1px, transparent 1px 6px);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.32);
}

.thought-stack article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.thought-stack article:nth-child(2) { border-color: rgba(39, 106, 120, 0.28); }
.thought-stack article:nth-child(2)::before { background: var(--port-blue); }
.thought-stack article:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(39, 106, 120, 0.18), transparent 46%),
    rgba(7, 8, 6, 0.42);
}

.thought-stack article:nth-child(3) { border-color: rgba(180, 73, 49, 0.28); }
.thought-stack article:nth-child(3)::before { background: var(--rust); }
.thought-stack article:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(180, 73, 49, 0.2), transparent 46%),
    rgba(7, 8, 6, 0.42);
}

.thought-stack strong {
  display: block;
  margin-bottom: 6px;
  color: var(--paper-hot);
  font-family: var(--serif);
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.thought-stack p {
  margin: 0;
  color: var(--paper-cold);
  font-size: var(--t-sm);
  line-height: 1.62;
}

/* ============================================================
   STORY COPY — the body of the case
   ============================================================ */

.story-copy {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 220px;
  color: #eedeb1;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-xl);
  line-height: 1.95;
  letter-spacing: 0.02em;
  column-fill: balance;
}

.story-copy p {
  margin: 0 0 var(--s-3);
  padding: 6px 0 6px 16px;
  border-left: 3px solid rgba(240, 198, 74, 0.24);
}

.story-copy p:first-child::first-letter {
  float: left;
  margin: 6px 14px 0 -4px;
  padding: 4px 10px 0;
  color: var(--paper-hot);
  background: linear-gradient(180deg, rgba(240, 198, 74, 0.18), rgba(180, 73, 49, 0.12));
  border: 1px solid rgba(240, 198, 74, 0.32);
  border-radius: 1px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 24px rgba(240, 198, 74, 0.18);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.32);
}

.story-copy p:nth-child(2) { border-left-color: rgba(79, 143, 166, 0.42); }
.story-copy p:nth-child(3) { border-left-color: rgba(181, 73, 49, 0.5); }
.story-copy p:nth-child(4) { border-left-color: rgba(154, 168, 73, 0.36); }

.consequence {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(180, 73, 49, 0.32);
  border-left: 4px solid var(--rust);
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(111, 43, 36, 0.28), rgba(111, 43, 36, 0.06)),
    rgba(6, 7, 5, 0.32);
  color: #f1cdbe;
  font-family: var(--serif);
  font-size: var(--t-md);
  line-height: 1.7;
}

.consequence::before {
  content: "结果记录 · CONSEQUENCE";
  display: block;
  margin-bottom: 4px;
  color: var(--rust);
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ============================================================
   CHOICES — case ledger entries
   ============================================================ */

.choices {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-2);
}

.choice {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(234, 220, 185, 0.16);
  border-left: 4px solid rgba(240, 198, 74, 0.42);
  border-radius: 2px;
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(240, 198, 74, 0.06), rgba(91, 56, 89, 0.05) 70%, rgba(6, 7, 5, 0.34)),
    rgba(234, 220, 185, 0.02);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 244, 207, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.choice::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg, transparent, rgba(255, 240, 189, 0.13), transparent);
  transform: translateX(-120%);
}

.choice:hover {
  border-color: rgba(240, 198, 74, 0.7);
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, rgba(240, 198, 74, 0.14), rgba(240, 198, 74, 0.04) 60%, rgba(6, 7, 5, 0.34)),
    rgba(234, 220, 185, 0.04);
  transform: translateX(2px);
  box-shadow: inset 0 1px 0 rgba(255, 244, 207, 0.06), -2px 0 0 rgba(240, 198, 74, 0.18);
}

.choice:hover .choice-index {
  background: var(--paper-hot);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.36);
}

.choice:hover::after {
  opacity: 1;
  transform: translateX(120%);
  transition: transform 520ms ease, opacity 220ms ease;
}


.choice-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 1px;
  color: #15130d;
  background: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--t-md);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
}

.choice-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.choice-tone {
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.choice strong {
  display: block;
  font-family: var(--serif);
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: 0.02em;
  color: var(--paper-hot);
  overflow-wrap: anywhere;
}

.choice em {
  display: block;
  margin-top: 2px;
  color: var(--faded);
  font-size: var(--t-sm);
  font-style: normal;
  line-height: 1.5;
}

.choice-risk {
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 1px;
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.choice-risk[data-risk="red"]    { color: #e07058; }
.choice-risk[data-risk="danger"] { color: #d9aa46; }
.choice-risk[data-risk="grey"]   { color: var(--faded); }
.choice-risk[data-risk="safe"]   { color: var(--bayou); }

.choice.primary {
  grid-template-columns: 1fr;
  border-color: rgba(240, 198, 74, 0.55);
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, rgba(240, 198, 74, 0.16), rgba(86, 115, 107, 0.08)),
    rgba(6, 7, 5, 0.28);
  text-align: center;
}

.choice.primary .choice-tone {
  letter-spacing: 0.32em;
}

.choice.primary strong {
  font-size: var(--t-xl);
}

/* ============================================================
   RIGHT RAIL — folio dossier
   ============================================================ */

.right-rail {
  overflow: hidden;
  border-top: 4px solid var(--accent-cool);
  background:
    linear-gradient(180deg, rgba(26, 25, 19, 0.96), rgba(11, 12, 9, 0.97));
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--rule-hard);
  background: rgba(0, 0, 0, 0.34);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--rule);
  color: var(--faded);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.tab:last-child {
  border-right: 0;
}

.tab .tab-zh {
  font-family: var(--serif);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.tab .tab-en {
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.22em;
  color: var(--dim);
}

.tab:hover {
  color: var(--paper);
  background: rgba(234, 220, 185, 0.04);
}

.tab.active {
  color: var(--paper-hot);
  background:
    linear-gradient(180deg, rgba(169, 68, 50, 0.22), rgba(6, 7, 5, 0.18)),
    rgba(234, 220, 185, 0.05);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.tab.active .tab-en {
  color: var(--accent);
}

.intel-panel {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: var(--s-4);
}

.intel-panel.active {
  display: block;
}

.board-column {
  margin-bottom: var(--s-5);
}

.board-column:last-child {
  margin-bottom: 0;
}

.board-column h3,
.person h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 var(--s-2);
  color: var(--paper-hot);
  font-family: var(--serif);
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.board-en {
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

li {
  position: relative;
  padding: 10px 0 10px 18px;
  border-bottom: 1px solid rgba(234, 220, 185, 0.1);
  color: var(--paper-cold);
  font-size: var(--t-sm);
  line-height: 1.6;
  animation: evidenceDrop 260ms ease both;
}

li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sodium-deep);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.42), 0 0 8px rgba(240, 198, 74, 0.32);
}

li:last-child {
  border-bottom: 0;
}

li.empty {
  color: var(--dim);
  font-style: italic;
}

li.empty::before {
  background: var(--bruise);
  box-shadow: none;
}

.wire-list li {
  color: #c9dccd;
  padding-left: 22px;
}

.wire-list li::before {
  background: var(--bayou);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.42), 0 0 8px rgba(90, 126, 98, 0.36);
}

.wire-list li::after {
  content: "▶";
  position: absolute;
  left: 1px;
  top: 12px;
  color: var(--bayou);
  font-size: 8px;
  line-height: 1;
}

/* ============================================================
   PEOPLE TAB
   ============================================================ */

.person {
  padding: var(--s-3);
  margin-bottom: var(--s-2);
  border: 1px solid rgba(234, 220, 185, 0.12);
  border-left: 3px solid var(--bruise);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(234, 220, 185, 0.045), rgba(5, 6, 4, 0.18));
  transition: border-color 160ms ease;
}

.person.active {
  border-color: rgba(240, 198, 74, 0.5);
  border-left-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(240, 198, 74, 0.12), rgba(111, 43, 36, 0.06)),
    rgba(234, 220, 185, 0.03);
  box-shadow: inset 0 0 0 1px rgba(240, 198, 74, 0.06);
}

.person-head {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
}

.person-head > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 1px;
  color: #15130d;
  background: var(--accent);
  font-family: var(--serif);
  font-weight: 900;
  font-size: var(--t-xl);
}

.person-head h3 {
  margin: 0;
}

.person-head p {
  margin: 2px 0 0;
  color: var(--faded);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
}

dl {
  margin: var(--s-2) 0 0;
  padding: 0;
}

dl div {
  padding-top: var(--s-2);
  border-top: 1px dashed rgba(234, 220, 185, 0.14);
}

dl div:first-child {
  border-top: 0;
}

dt {
  color: var(--accent-cool);
  font-family: var(--mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  color: var(--paper-cold);
  font-size: var(--t-sm);
  line-height: 1.6;
}

/* ============================================================
   MOTION
   ============================================================ */

@keyframes sceneLift {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes evidenceDrop {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes lampFlicker {
  0%,
  18%,
  21%,
  100% { opacity: 0.55; }
  19%   { opacity: 0.32; }
  20%   { opacity: 0.62; }
  72%   { opacity: 0.46; }
  73%   { opacity: 0.6; }
}

.scene-enter .story-panel h2,
.scene-enter .thought-stack article,
.scene-enter .story-copy p,
.scene-enter .consequence,
.scene-enter .choice {
  animation: sceneLift 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.scene-enter .thought-stack article:nth-child(2),
.scene-enter .story-copy p:nth-child(2),
.scene-enter .choice:nth-child(2) { animation-delay: 70ms; }

.scene-enter .thought-stack article:nth-child(3),
.scene-enter .story-copy p:nth-child(3),
.scene-enter .choice:nth-child(3) { animation-delay: 140ms; }

.scene-enter .story-copy p:nth-child(4) { animation-delay: 210ms; }
.scene-enter .choice:nth-child(4)       { animation-delay: 210ms; }
.scene-enter .choice:nth-child(5)       { animation-delay: 280ms; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: minmax(220px, 268px) 1fr;
  }

  .right-rail {
    grid-column: 1 / -1;
    min-height: 360px;
  }
}

@media (max-width: 820px) {
  .game-shell { padding: var(--s-3); gap: var(--s-3); }

  .topbar {
    grid-template-columns: 1fr;
    gap: var(--s-3);
    text-align: left;
  }

  .topbar-id, .top-actions { justify-content: flex-start; }
  .topbar-title { text-align: left; }
  .topbar-title h1 { font-size: 28px; }

  .layout { grid-template-columns: 1fr; }

  .story-panel {
    min-height: auto;
    padding: var(--s-5) var(--s-4) var(--s-4);
  }
  .story-panel h2 { font-size: 32px; }
  .thought-stack { grid-template-columns: 1fr; }
  .story-copy { font-size: var(--t-md); line-height: 1.84; }
  .story-copy p:first-child::first-letter { font-size: 42px; }

  .choice {
    grid-template-columns: 30px 1fr;
  }
  .choice-risk { display: none; }

  .stamp { display: none; }
  .folio-tab { display: none; }
}

@media (max-width: 460px) {
  .scene-meta { gap: 4px; }
  .scene-meta span { font-size: 10px; padding: 0 6px; height: 22px; }
  .icon-button .icon-label { display: none; }
  .icon-button { padding: 6px; }
  .progress-strip { grid-template-columns: 1fr; padding: 8px var(--s-3); }
  .prog-cap { display: none; }
}

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

/* Back-to-portfolio overlay (added by site host page) */
.back-to-portfolio {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px 7px 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(234, 215, 167, 0.65);
  background: rgba(5, 6, 4, 0.55);
  border: 1px solid rgba(234, 215, 167, 0.16);
  border-radius: 2px;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, padding 0.25s ease;
}
.back-to-portfolio:hover {
  color: rgba(234, 215, 167, 1);
  border-color: rgba(234, 215, 167, 0.45);
  background: rgba(5, 6, 4, 0.82);
  padding-left: 14px;
}
.back-to-portfolio .btp-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}
.back-to-portfolio:hover .btp-arrow {
  transform: translateX(-3px);
}

@media (max-width: 720px) {
  .back-to-portfolio {
    top: 8px;
    left: 8px;
    padding: 5px 9px;
    font-size: 10px;
  }
  .back-to-portfolio .btp-label { display: none; }
}
