:root {
  color-scheme: dark;
  --ink: #0a0a0a;
  --paper: #f4ead5;
  --gold: #d6a947;
  --signal: #80ffdb;
  --danger: #ef4444;
  --panel: rgba(14, 12, 10, 0.84);
  --line: rgba(244, 234, 213, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(214, 169, 71, 0.22), transparent 26rem),
    linear-gradient(145deg, #030303 0%, #16120d 48%, #0c1110 100%);
  color: var(--paper);
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}

button {
  min-height: 44px;
  border: 1px solid rgba(244, 234, 213, 0.24);
  background: rgba(244, 234, 213, 0.08);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

button:hover,
button:focus-visible {
  border-color: var(--signal);
  background: rgba(128, 255, 219, 0.13);
  outline: none;
  transform: translateY(-1px);
}

#game {
  width: min(1180px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 28px);
  display: grid;
  grid-template-rows: auto minmax(176px, auto) auto auto;
  gap: 12px;
}

.stage-shell {
  position: relative;
  border: 1px solid var(--line);
  background: #050505;
  overflow: hidden;
}

#stage {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

.ledger {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, auto));
  gap: 8px;
  font-family: Menlo, Consolas, monospace;
}

.ledger div {
  padding: 8px 10px;
  border: 1px solid rgba(244, 234, 213, 0.24);
  background: rgba(0, 0, 0, 0.62);
}

.ledger span {
  display: block;
  font-size: 10px;
  color: rgba(244, 234, 213, 0.62);
}

.ledger strong {
  font-size: 22px;
}

.play-guide {
  padding: 12px 14px;
  border: 1px solid rgba(128, 255, 219, 0.28);
  background:
    linear-gradient(135deg, rgba(128, 255, 219, 0.1), rgba(214, 169, 71, 0.07)),
    rgba(6, 14, 13, 0.76);
  font-family: Menlo, Consolas, monospace;
}

.play-guide header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.play-guide strong,
.play-guide small {
  display: block;
}

.play-guide strong {
  color: #ecfeff;
  font-size: 13px;
  line-height: 1.35;
}

.play-guide small,
.play-guide p,
.play-guide li {
  color: rgba(244, 234, 213, 0.68);
  font-size: 11px;
  line-height: 1.5;
}

.play-guide code {
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(128, 255, 219, 0.26);
  background: rgba(0, 0, 0, 0.32);
  color: var(--signal);
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}

.play-guide p {
  margin: 0 0 8px;
}

.play-guide ol {
  margin: 0 0 8px;
  padding-left: 20px;
}

.play-guide li {
  margin-bottom: 4px;
}

.dialogue {
  border-left: 4px solid var(--gold);
  background: var(--panel);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.line-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(244, 234, 213, 0.55);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

#speaker {
  margin: 8px 0 10px;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0;
}

#line {
  min-height: 4.9em;
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.62;
}

.choices {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.choices button {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  display: grid;
  gap: 5px;
}

.choices button.selected {
  border-color: var(--gold);
  background: rgba(214, 169, 71, 0.16);
}

.choice-label {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.choice-consequence {
  display: block;
  color: rgba(244, 234, 213, 0.68);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.signal-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(128, 255, 219, 0.36);
  background:
    linear-gradient(90deg, rgba(128, 255, 219, 0.13), rgba(239, 68, 68, 0.08)),
    rgba(0, 0, 0, 0.32);
  font-family: Menlo, Consolas, monospace;
}

.signal-card span {
  display: block;
  margin-bottom: 6px;
  color: rgba(128, 255, 219, 0.78);
  font-size: 11px;
  text-transform: uppercase;
}

.signal-card strong {
  display: block;
  color: #fff7ed;
  font-size: 15px;
  line-height: 1.35;
}

.signal-card p {
  margin: 7px 0 0;
  color: rgba(244, 234, 213, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.signal-card small {
  display: block;
  margin-top: 8px;
  color: rgba(244, 234, 213, 0.54);
  font-size: 11px;
  line-height: 1.45;
}

.review-gate {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(128, 255, 219, 0.34);
  background:
    linear-gradient(135deg, rgba(128, 255, 219, 0.1), rgba(214, 169, 71, 0.08)),
    rgba(6, 18, 17, 0.68);
  font-family: Menlo, Consolas, monospace;
}

.review-gate header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.review-gate strong {
  color: #ecfeff;
  font-size: 12px;
  line-height: 1.4;
}

.review-gate small,
.review-gate p,
.review-gate li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.review-gate p {
  margin: 0 0 8px;
}

.review-gate ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.review-gate li {
  padding: 8px 9px;
  border-left: 3px solid rgba(128, 255, 219, 0.5);
  background: rgba(0, 0, 0, 0.24);
}

.review-gate li strong,
.review-gate li span {
  display: block;
}

.review-gate li span {
  margin-top: 3px;
}

.route-promise {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(214, 169, 71, 0.34);
  background:
    linear-gradient(135deg, rgba(214, 169, 71, 0.11), rgba(128, 255, 219, 0.06)),
    rgba(18, 14, 10, 0.7);
  font-family: Menlo, Consolas, monospace;
}

.route-promise header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.route-promise strong {
  color: #fff7ed;
  font-size: 12px;
  line-height: 1.4;
}

.route-promise small,
.route-promise p,
.route-promise li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.route-promise p {
  margin: 0 0 8px;
}

.route-promise ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.route-promise li {
  padding: 8px 9px;
  border-left: 3px solid rgba(214, 169, 71, 0.56);
  background: rgba(0, 0, 0, 0.24);
}

.preview-pacing {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(244, 234, 213, 0.28);
  background:
    linear-gradient(135deg, rgba(214, 169, 71, 0.1), rgba(128, 255, 219, 0.08)),
    rgba(8, 8, 8, 0.5);
  font-family: Menlo, Consolas, monospace;
}

.preview-pacing header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.preview-pacing strong {
  color: #fff7ed;
  font-size: 12px;
  line-height: 1.4;
}

.preview-pacing small,
.preview-pacing p,
.preview-pacing li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.preview-pacing p {
  margin: 0 0 8px;
}

.preview-pacing ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.preview-pacing li {
  padding: 8px 9px;
  border-left: 3px solid rgba(214, 169, 71, 0.52);
  background: rgba(0, 0, 0, 0.22);
}

.preview-pacing li strong,
.preview-pacing li span {
  display: block;
}

.preview-pacing li span {
  margin-top: 3px;
}

.preview-focus-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preview-focus-options button {
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.preview-focus-options button.selected {
  border-color: var(--signal);
  background: rgba(128, 255, 219, 0.15);
}

#preview-focus-summary {
  margin-top: 8px;
}

.visual-proof {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(128, 255, 219, 0.3);
  background:
    linear-gradient(135deg, rgba(128, 255, 219, 0.09), rgba(239, 68, 68, 0.08)),
    rgba(7, 13, 13, 0.62);
  font-family: Menlo, Consolas, monospace;
}

.visual-proof header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.visual-proof strong {
  color: #ecfeff;
  font-size: 12px;
  line-height: 1.4;
}

.visual-proof small,
.visual-proof p,
.visual-proof li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.visual-proof p {
  margin: 0 0 8px;
}

.visual-proof ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.visual-proof li {
  padding: 8px 9px;
  border-left: 3px solid rgba(128, 255, 219, 0.52);
  background: rgba(0, 0, 0, 0.24);
}

.visual-proof li strong,
.visual-proof li span {
  display: block;
}

.visual-proof li span {
  margin-top: 3px;
}

.visual-proof-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.visual-proof-options button {
  min-height: 70px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.visual-proof-options button.selected {
  border-color: var(--signal);
  background: rgba(128, 255, 219, 0.15);
}

#visual-proof-vote-summary {
  margin-top: 8px;
}

.asset-approval {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(128, 255, 219, 0.08)),
    rgba(17, 8, 8, 0.64);
  font-family: Menlo, Consolas, monospace;
}

.asset-approval header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.asset-approval strong {
  color: #fee2e2;
  font-size: 12px;
  line-height: 1.4;
}

.asset-approval small,
.asset-approval p,
.asset-approval li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.asset-approval p {
  margin: 0 0 8px;
}

.asset-storyboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 8px;
}

.asset-storyboard p {
  grid-column: 1 / -1;
  padding: 8px 9px;
  border: 1px solid rgba(128, 255, 219, 0.18);
  background: rgba(0, 0, 0, 0.22);
}

.asset-storyboard article {
  padding: 8px 9px;
  border: 1px solid rgba(128, 255, 219, 0.18);
  background: rgba(4, 14, 15, 0.34);
}

.asset-storyboard article strong,
.asset-storyboard article span {
  display: block;
}

.asset-storyboard article span {
  margin-top: 3px;
  color: rgba(244, 234, 213, 0.62);
  font-size: 10px;
  line-height: 1.45;
}

.asset-decision-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 8px;
}

.asset-decision-options button {
  min-height: 56px;
  padding: 8px 9px;
  text-align: left;
  color: rgba(244, 234, 213, 0.78);
  font-family: Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
}

.asset-decision-options button.selected {
  border-color: var(--signal);
  background: rgba(128, 255, 219, 0.14);
}

.asset-approval ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.asset-approval li {
  padding: 8px 9px;
  border-left: 3px solid rgba(239, 68, 68, 0.52);
  background: rgba(0, 0, 0, 0.24);
}

.asset-approval li strong,
.asset-approval li span {
  display: block;
}

.asset-approval li span {
  margin-top: 3px;
}

.value-probe {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(214, 169, 71, 0.34);
  background: rgba(32, 25, 13, 0.56);
  font-family: Menlo, Consolas, monospace;
}

.value-probe header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.value-probe strong {
  color: #fff7ed;
  font-size: 12px;
  line-height: 1.4;
}

.value-probe small,
.value-probe p {
  margin: 0;
  color: rgba(244, 234, 213, 0.58);
  font-size: 11px;
  line-height: 1.45;
}

.value-probe-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.value-probe-options button {
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.value-probe-options button.selected {
  border-color: var(--gold);
  background: rgba(214, 169, 71, 0.18);
}

.value-probe p {
  margin-top: 8px;
}

.conversion-probe {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(128, 255, 219, 0.28);
  background: rgba(5, 24, 23, 0.58);
  font-family: Menlo, Consolas, monospace;
}

.conversion-probe header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.conversion-probe strong {
  color: #ecfeff;
  font-size: 12px;
  line-height: 1.4;
}

.conversion-probe small,
.conversion-probe p {
  margin: 0;
  color: rgba(244, 234, 213, 0.58);
  font-size: 11px;
  line-height: 1.45;
}

.conversion-probe-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.conversion-probe-options button {
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.conversion-probe-options button.selected {
  border-color: var(--signal);
  background: rgba(128, 255, 219, 0.16);
}

.conversion-probe p {
  margin-top: 8px;
}

.chapter-package {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  background: rgba(33, 9, 9, 0.54);
  font-family: Menlo, Consolas, monospace;
}

.chapter-package header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chapter-package strong {
  color: #fee2e2;
  font-size: 12px;
  line-height: 1.4;
}

.chapter-package small,
.chapter-package p,
.chapter-package li {
  color: rgba(244, 234, 213, 0.66);
  font-size: 11px;
  line-height: 1.5;
}

.chapter-package p {
  margin: 0 0 8px;
}

.chapter-package ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.chapter-readiness-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chapter-readiness-options button {
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.chapter-readiness-options button.selected {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.16);
}

.price-copy-probe {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(216, 180, 254, 0.34);
  background: rgba(28, 15, 44, 0.58);
  font-family: Menlo, Consolas, monospace;
}

.price-copy-probe header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.price-copy-probe strong {
  color: #f3e8ff;
  font-size: 12px;
  line-height: 1.4;
}

.price-copy-probe small,
.price-copy-probe p {
  margin: 0;
  color: rgba(244, 234, 213, 0.62);
  font-size: 11px;
  line-height: 1.45;
}

.price-copy-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.price-copy-options button {
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.price-copy-options button.selected {
  border-color: #d8b4fe;
  background: rgba(216, 180, 254, 0.16);
}

.price-copy-probe p {
  margin-top: 8px;
}

.evidence-dossier {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(244, 234, 213, 0.32);
  background:
    linear-gradient(135deg, rgba(244, 234, 213, 0.1), rgba(128, 255, 219, 0.07)),
    rgba(13, 12, 10, 0.72);
  font-family: Menlo, Consolas, monospace;
}

.evidence-dossier header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.evidence-dossier strong {
  color: #fff7ed;
  font-size: 12px;
  line-height: 1.4;
}

.evidence-dossier small,
.evidence-dossier p,
.evidence-dossier li {
  color: rgba(244, 234, 213, 0.64);
  font-size: 11px;
  line-height: 1.5;
}

.evidence-dossier p {
  margin: 0 0 8px;
}

.evidence-dossier ol {
  margin: 0 0 8px;
  padding-left: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.evidence-dossier li {
  padding: 8px 9px;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(0, 0, 0, 0.26);
}

.evidence-dossier li.collected {
  border-color: rgba(128, 255, 219, 0.42);
  background: rgba(128, 255, 219, 0.09);
}

.evidence-dossier li.locked {
  opacity: 0.62;
}

.evidence-dossier li strong,
.evidence-dossier li span {
  display: block;
}

.evidence-dossier li span {
  margin-top: 3px;
}

.feedback-panel {
  border: 1px solid rgba(128, 255, 219, 0.28);
  background: rgba(4, 12, 11, 0.82);
  padding: 12px;
  font-family: Menlo, Consolas, monospace;
}

.feedback-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.feedback-panel strong {
  color: var(--signal);
  font-size: 12px;
  text-transform: uppercase;
}

.feedback-panel textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(0, 0, 0, 0.46);
  color: var(--paper);
  padding: 10px;
  font: 12px/1.5 Menlo, Consolas, monospace;
}

.feedback-panel p {
  min-height: 1.4em;
  margin: 6px 0 0;
  color: rgba(244, 234, 213, 0.62);
  font-size: 11px;
}

.toolbar,
.slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.toolbar button,
.slots button {
  font-family: Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0;
}

.toolbar button.active {
  border-color: var(--danger);
  color: #fecaca;
}

.slots {
  grid-template-columns: repeat(3, 1fr);
}

.history-panel {
  position: fixed;
  inset: clamp(12px, 5vw, 70px);
  z-index: 10;
  overflow: auto;
  border: 1px solid rgba(244, 234, 213, 0.28);
  background: rgba(10, 10, 10, 0.96);
  padding: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.76);
}

.history-panel header {
  position: sticky;
  top: -18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
  background: rgba(10, 10, 10, 0.98);
}

.history-panel ol {
  padding-left: 22px;
}

.history-panel li {
  margin: 0 0 16px;
  line-height: 1.55;
}

.history-panel li strong {
  display: block;
  color: var(--signal);
}

@media (max-width: 720px) {
  #game {
    padding: 8px;
    gap: 8px;
  }

  .ledger {
    position: static;
    grid-template-columns: repeat(3, 1fr);
    background: #050505;
  }

  .ledger div {
    border-left: 0;
    border-right: 0;
  }

  .play-guide header {
    display: grid;
  }

  .toolbar {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .value-probe header {
    display: grid;
  }

  .review-gate header {
    display: grid;
  }

  .review-gate ol {
    grid-template-columns: 1fr;
  }

  .route-promise header {
    display: grid;
  }

  .preview-pacing header {
    display: grid;
  }

  .preview-pacing ol {
    grid-template-columns: 1fr;
  }

  .visual-proof header {
    display: grid;
  }

  .visual-proof ol,
  .visual-proof-options {
    grid-template-columns: 1fr;
  }

  .asset-approval header {
    display: grid;
  }

  .asset-storyboard,
  .asset-decision-options,
  .asset-approval ol {
    grid-template-columns: 1fr;
  }

  .value-probe-options {
    grid-template-columns: 1fr;
  }

  .conversion-probe header {
    display: grid;
  }

  .conversion-probe-options {
    grid-template-columns: 1fr;
  }

  .chapter-package header {
    display: grid;
  }

  .chapter-readiness-options {
    grid-template-columns: 1fr;
  }

  .price-copy-probe header {
    display: grid;
  }

  .price-copy-options {
    grid-template-columns: 1fr;
  }

  .evidence-dossier header {
    display: grid;
  }

  #line {
    min-height: 7em;
  }
}
