:root {
  --ink: #080808;
  --ink-soft: #151515;
  --paper: #f4f0e8;
  --paper-dim: #d6d1c7;
  --red: #ff304f;
  --red-dark: #ba1732;
  --blue: #2f6bff;
  --acid: #d8ff3e;
  --amber: #ffbf2f;
  --line: #3a3a3a;
  --display: "Black Han Sans", "Arial Black", "Apple SD Gothic Neo", sans-serif;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --top-h: 52px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
summary {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

[tabindex="-1"]:focus {
  outline: none;
}

button:not(:disabled),
summary,
a {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: calc(8px + var(--safe-t));
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  transform: translateY(-200%);
  border: 2px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* ---------- top bar ---------- */

.app-top {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-t);
  border-bottom: 2px solid var(--paper);
  background: var(--ink);
}

.app-top-inner {
  display: flex;
  width: 100%;
  max-width: 620px;
  min-height: var(--top-h);
  margin-inline: auto;
  align-items: stretch;
  justify-content: space-between;
  padding-inline: max(var(--safe-l), 0px) max(var(--safe-r), 0px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark-mark {
  color: var(--red);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
}

.top-meta {
  display: flex;
  align-items: stretch;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.top-meta > span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
}

.top-meta b {
  color: var(--acid);
  font-weight: 700;
}

/* ---------- frame ---------- */

.app-frame {
  width: 100%;
  max-width: 620px;
  margin-inline: auto;
  padding-inline: max(var(--safe-l), 0px) max(var(--safe-r), 0px);
}

/* ---------- cover ---------- */

.cover-art {
  position: relative;
  max-height: 62vh;
  overflow: hidden;
  border-bottom: 2px solid var(--paper);
  background: var(--ink-soft);
}

.cover-art img {
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  object-position: center 30%;
  filter: contrast(1.06) saturate(0.98);
}

.cover-art::after {
  position: absolute;
  inset: 0;
  border: 10px solid var(--ink);
  content: "";
  pointer-events: none;
}

.cover-stamp {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  padding: 12px 14px 10px;
  transform: rotate(-3deg);
  border: 2px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.cover-copy {
  position: relative;
  padding: 38px 20px 46px;
  background: var(--paper);
  color: var(--ink);
}

.cover-copy::before {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-top: 4px solid var(--red);
  border-right: 4px solid var(--red);
  content: "";
}

.kicker,
.eyebrow,
.analysis-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--red-dark);
}

.kicker::before {
  width: 26px;
  height: 3px;
  background: currentColor;
  content: "";
}

.cover h1 {
  margin: 16px 0 20px;
  font-family: var(--display);
  font-size: clamp(58px, 17vw, 104px);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

.cover h1 span {
  color: var(--red);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 5px 5px 0 var(--ink);
}

.cover-lede {
  margin: 0;
  font-size: clamp(19px, 5.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.45;
}

.content-note {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin: 28px 0 22px;
  padding: 15px 16px;
  border: 2px solid var(--ink);
  background: #e8e2d7;
}

.content-note svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--red-dark);
  stroke-width: 2;
}

.content-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--red);
  color: var(--paper);
  font-size: 17px;
  font-weight: 900;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--red);
}

.primary-button svg,
.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.micro-copy {
  margin: 16px 0 0;
  color: #54504a;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ---------- status strip ---------- */

.status-strip {
  position: sticky;
  top: calc(var(--top-h) + var(--safe-t));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--paper);
  background: var(--ink-soft);
}

.stat-cell {
  padding: 9px 12px 8px;
  border-right: 1px solid var(--line);
}

.stat-cell:nth-child(3n) {
  border-right: 0;
}

.stat-cell:nth-child(-n + 3) {
  border-bottom: 1px solid var(--line);
}

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

.stat-name span {
  font-size: 13px;
  font-weight: 700;
}

.stat-name output {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-clout output::after {
  content: "%";
  margin-left: 1px;
  font-size: 9px;
}

.stat-track {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  background: #373737;
}

.stat-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--paper);
  transition: width 320ms ease-out;
}

.stat-calm .stat-track i { background: var(--acid); }
.stat-clout .stat-track i { background: var(--amber); }
.stat-spread .stat-track i { background: var(--blue); }
.stat-archive .stat-track i { background: var(--red); }
.stat-mental .stat-track i { background: var(--acid); }
.stat-allies .stat-track i { background: var(--paper); }

.stat-cell small {
  display: none;
  color: #8f8f8f;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.stat-cell.is-changing {
  animation: stat-flash 360ms ease-out;
}

/* ---------- sheets ---------- */

.sheet {
  border-bottom: 2px solid var(--paper);
  background: var(--ink-soft);
}

.sheet summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  list-style: none;
}

.sheet summary::-webkit-details-marker {
  display: none;
}

.sheet-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--paper-dim);
  border-bottom: 2px solid var(--paper-dim);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.sheet[open] .sheet-caret {
  transform: rotate(-135deg);
}

.sheet-side {
  color: var(--acid);
}

.sheet-body {
  border-top: 1px solid var(--line);
}

/* ---------- player card / field note ---------- */

.player-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #101010;
}

.player-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
}

.player-avatar-wrap img {
  width: 100%;
  height: 100%;
  border: 2px solid var(--paper);
  object-fit: cover;
}

.player-avatar-wrap span {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 3px 5px;
  border: 1px solid var(--ink);
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.player-copy {
  min-width: 0;
}

.player-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-copy p {
  margin: 5px 0 7px;
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.55;
}

.player-copy > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.player-copy > div span {
  padding: 4px 7px;
  border: 1px solid #6a6a6a;
  color: #c0bbb1;
  font-family: var(--mono);
  font-size: 11px;
}

.field-note {
  padding: 14px 16px 16px;
}

.field-note h2 {
  margin: 0 0 10px;
  color: var(--acid);
  font-size: 14px;
}

.field-note ul {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.6;
}

.field-note li::marker {
  color: var(--red);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-links a {
  padding: 9px 11px;
  border: 1px solid #4a4a4a;
  color: #b6cbff;
  font-size: 13px;
  text-decoration: none;
}

/* ---------- timeline ---------- */

.timeline {
  background: var(--paper);
  color: var(--ink);
}

.timeline-topbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border-bottom: 2px solid var(--ink);
}

.timeline-topbar > div {
  min-width: 0;
}

.timeline-topbar .eyebrow {
  color: var(--red-dark);
  font-size: 10px;
}

.timeline-topbar h2 {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button:active {
  background: var(--ink);
  color: var(--paper);
}

.scene-content.is-entering > * {
  animation: scene-enter 300ms ease-out both;
}

.scene-content.is-entering > *:nth-child(2) { animation-delay: 45ms; }
.scene-content.is-entering > *:nth-child(3) { animation-delay: 90ms; }
.scene-content.is-entering > *:nth-child(4) { animation-delay: 135ms; }
.scene-content.is-entering > *:nth-child(5) { animation-delay: 180ms; }

/* ---------- comic cut ---------- */

.scene-cut {
  margin: 0;
  padding: 14px 16px 0;
  border-bottom: 2px solid var(--ink);
  background: #e7e0d5;
}

.scene-cut-frame {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(8, 8, 8, 0.55);
  background: var(--ink);
}

.scene-cut img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: contrast(1.04);
}

.scene-cut figcaption {
  position: absolute;
  top: 0;
  left: 0;
  padding: 6px 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.scene-cut::after {
  display: block;
  height: 14px;
  content: "";
}

/* ---------- post ---------- */

.post {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 2px solid var(--ink);
  background: #fffdf8;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: white;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.avatar.has-image {
  overflow: hidden;
  background: var(--red);
}

.avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 9px;
}

.post-name {
  font-weight: 900;
  font-size: 16px;
}

.post-handle,
.post-time {
  color: #5d574f;
  font-family: var(--mono);
  font-size: 12px;
}

.post-copy {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.6;
  white-space: pre-line;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  color: #524d46;
  font-family: var(--mono);
  font-size: 12px;
}

.post-actions span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-actions svg,
.system-message svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* ---------- events ---------- */

.event-stack {
  border-bottom: 2px solid var(--ink);
  background: #fffdf8;
}

.event-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid #aaa49b;
  font-size: 15px;
  line-height: 1.55;
}

.event-item:last-child {
  border-bottom: 0;
}

.event-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.event-item.is-danger .event-icon { background: var(--red); }
.event-item.is-blue .event-icon { background: var(--blue); }

.event-item time {
  color: #5d574f;
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- narrative / system ---------- */

.narrative {
  padding: 22px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.narrative-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.narrative p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.7;
  white-space: pre-line;
}

.system-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.system-message svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ---------- issue deck ---------- */

.issue-deck {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.issue-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #555;
}

.issue-deck-head strong {
  font-size: 14px;
}

.issue-deck-head span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.issue-cards {
  display: grid;
}

.issue-card {
  display: grid;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid #555;
  color: var(--paper);
  text-decoration: none;
}

.issue-card:last-child {
  border-bottom: 0;
}

.issue-card:active {
  background: var(--blue);
}

.issue-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
}

.issue-card h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.issue-card small {
  color: #aba69c;
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- mission ---------- */

.mission {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--amber);
  color: var(--ink);
}

.mission strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.mission p {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}

.mission b {
  align-self: center;
  padding: 6px 9px;
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- choices ---------- */

.choice-block {
  padding: 20px 16px calc(28px + var(--safe-b));
  background: #e7e0d5;
}

.choice-prompt {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.choice-prompt h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.choice-prompt span {
  flex: 0 0 auto;
  margin-top: 6px;
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 4px 4px 0 rgba(8, 8, 8, 0.28);
  transition: transform 110ms ease, box-shadow 110ms ease;
}

.choice-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(8, 8, 8, 0.28);
}

.choice-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.choice-copy {
  display: grid;
  gap: 3px;
}

.choice-copy b {
  font-size: 17px;
  line-height: 1.4;
}

.choice-copy small {
  color: #55504a;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.choice-arrow {
  display: none;
}

/* ---------- ending ---------- */

.ending {
  background: var(--ink);
  color: var(--paper);
}

.ending-visual {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--paper);
}

.ending-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: contrast(1.06) saturate(0.92);
}

.ending-code {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ending.is-happy .ending-code {
  background: var(--acid);
  color: var(--ink);
}

.ending-copy {
  padding: 26px 16px calc(38px + var(--safe-b));
}

.ending-kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.ending.is-happy .ending-kicker {
  color: var(--acid);
}

.ending h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 13vw, 72px);
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.ending-summary {
  margin: 18px 0 0;
  color: var(--paper-dim);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
  white-space: pre-line;
}

.ending-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0 0;
  border: 1px solid #515151;
}

.ending-scoreboard div {
  padding: 12px 10px;
  border-right: 1px solid #515151;
}

.ending-scoreboard div:last-child {
  border-right: 0;
}

.ending-scoreboard span {
  display: block;
  margin-bottom: 5px;
  color: #aeaaa0;
  font-family: var(--mono);
  font-size: 10px;
}

.ending-scoreboard strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 19px;
}

.trait-report {
  margin: 18px 0 20px;
  padding: 15px;
  border: 1px solid #515151;
}

.trait-report > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.trait-row {
  display: grid;
  grid-template-columns: 92px 1fr 32px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: var(--paper-dim);
  font-size: 13px;
}

.trait-row i {
  height: 4px;
  background: #353535;
}

.trait-row i::after {
  display: block;
  width: var(--trait-width);
  height: 100%;
  background: var(--red);
  content: "";
}

.trait-row b {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.ending-verdict {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid #515151;
  font-size: 15px;
  line-height: 1.65;
}

.ending-verdict b {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
}

.ending-actions {
  display: grid;
  gap: 10px;
}

.ending-button {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 2px solid var(--paper);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  transition: transform 110ms ease;
}

.ending-button:active {
  transform: scale(0.98);
}

.ending-button.is-secondary {
  background: transparent;
  color: var(--paper);
}

/* ---------- history / analysis ---------- */

.history-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  position: relative;
  padding: 14px 16px 14px 48px;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.55;
}

.history-list li::before {
  position: absolute;
  top: 15px;
  left: 16px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  content: attr(data-index);
}

.history-list .history-empty {
  padding-left: 16px;
  color: #8b8b8b;
  font-family: var(--mono);
  font-size: 10px;
}

.history-list .history-empty::before {
  content: none;
}

.analysis-card {
  position: relative;
  margin: 16px;
  overflow: hidden;
  border: 1px solid #515151;
  background: #101010;
}

.analysis-label {
  display: block;
  padding: 11px 13px;
  border-bottom: 1px solid #515151;
  color: var(--blue);
  font-size: 9px;
}

.analysis-card p {
  margin: 0;
  padding: 14px 13px 20px;
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.65;
}

.scan-line {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--blue);
  animation: scan 3s linear infinite;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 16px 18px;
  color: #aeaaa0;
  font-family: var(--mono);
  font-size: 11px;
}

.legend > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
}

.legend-red { background: var(--red); }
.legend-blue { background: var(--blue); }
.legend-paper { background: var(--paper); }
.legend-acid { background: var(--acid); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: calc(16px + var(--safe-b));
  left: 50%;
  z-index: 100;
  width: max-content;
  max-width: min(92vw, 560px);
  padding: 13px 16px;
  transform: translate(-50%, 160%);
  border: 2px solid var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--red);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  opacity: 0;
  transition: transform 220ms ease-out, opacity 220ms ease-out;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink);
}

.site-footer-inner {
  display: flex;
  max-width: 620px;
  margin-inline: auto;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px calc(14px + var(--safe-b));
  color: #9c9c9c;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------- animation ---------- */

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

@keyframes stat-flash {
  0%, 100% { background: transparent; }
  45% { background: #2c2c2c; }
}

/* ---------- wider screens ---------- */

@media (min-width: 640px) {
  .app-frame,
  .app-top-inner {
    max-width: 620px;
  }

  .app-frame {
    border-inline: 2px solid var(--line);
  }

  .cover-copy {
    padding: 46px 32px 54px;
  }

  .post,
  .narrative,
  .event-item,
  .system-message,
  .mission,
  .choice-block,
  .issue-card,
  .issue-deck-head,
  .timeline-topbar,
  .scene-cut {
    padding-inline: 24px;
  }

  .choice-block {
    padding-bottom: calc(34px + var(--safe-b));
  }

  .ending-copy {
    padding-inline: 24px;
  }

  .stat-cell small {
    display: block;
    margin-top: 4px;
  }

  .post-copy {
    font-size: 19px;
  }

  .narrative p {
    font-size: 17px;
  }
}

@media (hover: hover) {
  .primary-button:hover {
    background: var(--blue);
  }

  .icon-button:hover {
    background: var(--ink);
    color: var(--paper);
  }

  .choice-button:hover {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 5px 5px 0 var(--red);
  }

  .choice-button:hover small {
    color: var(--paper-dim);
  }

  .issue-card:hover {
    background: var(--blue);
    color: white;
  }

  .issue-card:hover small {
    color: white;
  }

  .ending-button:hover {
    background: var(--acid);
    color: var(--ink);
  }

  .ending-button.is-secondary:hover {
    background: var(--blue);
    color: white;
  }

  .source-links a:hover {
    color: var(--acid);
  }
}

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