:root {
  --bg: oklch(0.965 0.012 220);
  --surface: oklch(0.998 0.002 220);
  --surface-2: oklch(0.935 0.025 210);
  --surface-3: oklch(0.9 0.04 92);
  --ink: oklch(0.18 0.035 246);
  --ink-soft: oklch(0.36 0.045 246);
  --muted: oklch(0.43 0.036 246);
  --line: oklch(0.62 0.045 230);
  --line-soft: oklch(0.78 0.026 230);
  --blue: oklch(0.42 0.14 255);
  --blue-dark: oklch(0.27 0.09 255);
  --blue-soft: oklch(0.89 0.055 245);
  --red: oklch(0.52 0.17 28);
  --red-dark: oklch(0.33 0.13 28);
  --red-soft: oklch(0.92 0.056 28);
  --green: oklch(0.47 0.12 151);
  --green-soft: oklch(0.9 0.055 151);
  --amber: oklch(0.79 0.15 78);
  --amber-soft: oklch(0.93 0.08 84);
  --violet: oklch(0.46 0.14 306);
  --violet-soft: oklch(0.9 0.06 306);
  --shadow: 5px 5px 0 oklch(0.18 0.035 246 / 0.2);
  --shadow-strong: 7px 7px 0 oklch(0.18 0.035 246 / 0.28);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "Bahnschrift", "Aptos", "Segoe UI", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Arial Black", "Bahnschrift", "Arial", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, oklch(0.86 0.025 230 / 0.42) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(0deg, oklch(0.86 0.025 230 / 0.42) 1px, transparent 1px) 0 0 / 38px 38px,
    radial-gradient(circle at 82% 6%, oklch(0.86 0.08 84 / 0.75), transparent 25rem),
    radial-gradient(circle at 10% 18%, oklch(0.88 0.07 245 / 0.72), transparent 27rem),
    var(--bg);
  font-family: var(--font-sans);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--red) 0 10px, transparent 10px calc(100% - 10px), var(--red) calc(100% - 10px) 100%),
    linear-gradient(0deg, var(--blue) 0 7px, transparent 7px calc(100% - 7px), var(--blue) calc(100% - 7px) 100%);
  opacity: 0.9;
  z-index: 20;
}

button {
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.app {
  width: min(1180px, calc(100% - 30px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 48px) 0 68px;
}

.screen {
  min-height: calc(100vh - 82px);
}

.start-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
}

.start-copy {
  display: grid;
  gap: 18px;
}

.game-mark {
  width: fit-content;
  padding: 7px 10px;
  color: var(--surface);
  background: var(--red);
  border: 3px solid var(--red-dark);
  border-radius: var(--radius-sm);
  box-shadow: 4px 4px 0 oklch(0.18 0.035 246 / 0.2);
  font-weight: 950;
}

.start-title {
  max-width: 9ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 13vw, 9.2rem);
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.lead {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: clamp(1.03rem, 1.7vw, 1.18rem);
}

.start-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.mini-btn,
.choice-card {
  border-radius: var(--radius-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-btn,
.secondary-btn,
.mini-btn {
  min-height: 46px;
  padding: 11px 16px;
  border: 3px solid var(--blue-dark);
  font-weight: 950;
}

.primary-btn {
  color: var(--surface);
  background: var(--blue);
  box-shadow: var(--shadow);
}

.secondary-btn,
.mini-btn {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 4px 4px 0 oklch(0.18 0.035 246 / 0.16);
}

.primary-btn:hover,
.primary-btn:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible,
.mini-btn:hover,
.mini-btn:focus-visible,
.choice-card:hover,
.choice-card:focus-visible {
  transform: translate(-2px, -2px);
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.start-board {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 3vw, 28px);
  background: var(--surface);
  border: 4px solid var(--blue-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--line-soft);
}

.board-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.board-stamp {
  padding: 7px 9px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 3px solid var(--red);
  border-radius: var(--radius-sm);
  font-weight: 950;
  transform: rotate(2deg);
}

.timeline-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.start-note {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--ink);
  background: var(--surface-2);
  border: 3px solid var(--line);
  border-radius: var(--radius-sm);
}

.start-note strong {
  font-size: 1.18rem;
  line-height: 1.15;
}

.start-note span {
  color: var(--ink-soft);
}

.tape-year {
  min-width: 66px;
  padding: 7px 8px;
  color: var(--surface);
  background: var(--blue-dark);
  border: 2px solid var(--blue);
  border-radius: 999px;
  text-align: center;
  font-weight: 900;
}

.tape-year:nth-child(1),
.tape-year:nth-child(8),
.tape-year:nth-child(10) {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--red);
}

.methodology-panel {
  display: none;
  margin-top: 18px;
  padding: 18px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.methodology-panel.is-open {
  display: block;
}

.methodology-panel h2 {
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1;
}

.methodology-panel li + li {
  margin-top: 6px;
}

.game-screen {
  display: grid;
  gap: 16px;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 280px);
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.turn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  color: var(--surface);
  background: var(--blue);
  border: 2px solid var(--blue-dark);
  border-radius: var(--radius-sm);
  font-weight: 950;
}

.meta-pill.red {
  background: var(--red);
  border-color: var(--red-dark);
}

.progress-rail {
  height: 16px;
  padding: 2px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  border-radius: inherit;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.55fr);
  gap: 16px;
}

.file-panel,
.scene-card,
.ending-card,
.review-card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.file-panel {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.file-panel h2,
.file-panel h3,
.scene-card h1,
.result-card h2,
.ending-card h1,
.review-card h1 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.file-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1;
}

.household-notes {
  display: grid;
  gap: 7px;
}

.note-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.note-row strong {
  color: var(--ink);
}

.stat-list {
  display: grid;
  gap: 10px;
}

.stat {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 950;
}

.stat-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.track {
  height: 13px;
  overflow: hidden;
  background: oklch(0.88 0.02 220);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
}

.fill.health {
  background: var(--red);
}

.fill.money {
  background: var(--green);
}

.fill.care {
  background: var(--amber);
}

.fill.ties {
  background: var(--violet);
}

.fill.autonomy {
  background: var(--blue);
}

.scene-card {
  overflow: hidden;
}

.scene-copy {
  padding: 20px 22px 8px;
}

.scene-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.kicker-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--red-dark);
  border-radius: var(--radius-sm);
  font-weight: 950;
}

.scene-copy h1 {
  margin-bottom: 10px;
  max-width: 24ch;
  font-size: clamp(1.65rem, 2.9vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.scene-body {
  max-width: 74ch;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.choice-list {
  display: grid;
  gap: 12px;
  padding: 16px 22px 24px;
}

.choice-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px 14px;
  width: 100%;
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 3px solid var(--blue-dark);
  box-shadow: 5px 5px 0 oklch(0.18 0.035 246 / 0.18);
}

.choice-card:nth-child(2) {
  border-color: var(--green);
}

.choice-card:nth-child(3) {
  border-color: var(--red);
}

.choice-no {
  grid-row: 1 / span 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--ink);
  background: var(--amber);
  border: 3px solid var(--red-dark);
  border-radius: 50%;
  font-weight: 950;
}

.choice-title {
  font-size: 1.08rem;
  font-weight: 950;
}

.choice-detail {
  color: var(--ink-soft);
}

.effect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.effect {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--surface);
  background: var(--blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.effect.good {
  background: var(--green);
}

.effect.bad {
  background: var(--red);
}

.effect.care {
  color: var(--ink);
  background: var(--amber);
}

.result-card {
  margin: 16px 22px 24px;
  padding: 18px;
  background: var(--surface-2);
  border: 3px solid var(--line);
  border-radius: var(--radius);
}

.result-card h2 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
}

.result-card p {
  max-width: 74ch;
  color: var(--ink-soft);
}

.event-card {
  position: relative;
  margin-top: 16px;
  padding: 16px;
  background: var(--amber-soft);
  border: 3px solid var(--red-dark);
  border-radius: var(--radius-sm);
  box-shadow: 5px 5px 0 oklch(0.18 0.035 246 / 0.18);
}

.event-card[data-severity="life"] {
  background: var(--green-soft);
  border-color: var(--green);
}

.event-card[data-severity="policy"] {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.event-card[data-severity="sensitive"] {
  background: var(--red-soft);
  border-color: var(--red);
}

.event-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  color: var(--surface);
  background: var(--red);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.event-card[data-severity="life"] .event-label {
  background: var(--green);
}

.event-card[data-severity="policy"] .event-label {
  background: var(--blue);
}

.event-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.event-card p {
  color: var(--ink-soft);
}

.ending-card,
.review-card {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px);
}

.ending-card h1,
.review-card h1 {
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1;
}

.ending-card p,
.review-card p,
.review-card li {
  color: var(--ink-soft);
}

.ending-narrative {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.ending-narrative section,
.review-note {
  padding: 14px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.ending-narrative h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.ending-narrative p,
.review-note {
  margin-bottom: 0;
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.ending-stat {
  padding: 14px;
  color: var(--surface);
  background: var(--blue);
  border: 3px solid var(--blue-dark);
  border-radius: var(--radius-sm);
}

.ending-stat strong,
.ending-stat span {
  display: block;
}

.ending-stat strong {
  font-size: 1.7rem;
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.history-item strong {
  color: var(--ink);
}

.history-item span {
  color: var(--muted);
}

.research-screen {
  display: grid;
  gap: clamp(18px, 3vw, 28px);
}

.research-hero,
.research-section {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.research-hero {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 5vw, 46px);
  background:
    linear-gradient(135deg, oklch(0.94 0.05 84), transparent 54%),
    var(--surface);
}

.research-hero h1,
.research-section h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.research-hero h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 8vw, 6rem);
  line-height: 0.9;
}

.research-hero p {
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: clamp(1.03rem, 1.8vw, 1.2rem);
}

.research-section {
  padding: clamp(18px, 4vw, 32px);
}

.section-copy {
  max-width: 78ch;
}

.section-copy h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.96;
}

.section-copy p,
.research-footnote,
.issue-card p,
.method-box p,
.source-item p {
  color: var(--ink-soft);
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.frame-card,
.issue-card,
.method-box {
  padding: 15px;
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.frame-card h3,
.issue-card h3,
.method-box h3,
.source-item h3 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.frame-card p,
.issue-card p,
.method-box p,
.source-item p {
  margin-bottom: 12px;
}

.frame-bars {
  display: grid;
  gap: 10px;
}

.frame-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 850;
}

.frame-track {
  height: 14px;
  overflow: hidden;
  background: oklch(0.86 0.024 220);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.frame-fill {
  height: 100%;
  min-width: 4px;
  background: var(--blue);
  border-radius: inherit;
}

.frame-card.grassroots .frame-fill {
  background: var(--red);
}

.frame-card.legal .frame-fill {
  background: var(--green);
}

.frame-card.population .frame-fill {
  background: var(--violet);
}

.research-footnote {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.source-timeline {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.source-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.source-year {
  width: fit-content;
  height: fit-content;
  padding: 7px 9px;
  color: var(--surface);
  background: var(--blue-dark);
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  font-weight: 950;
}

.source-item a,
.issue-card a {
  color: var(--blue-dark);
  font-weight: 950;
  text-underline-offset: 3px;
}

.research-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr);
  gap: 18px;
}

.issue-grid {
  display: grid;
  gap: 12px;
}

.method-box {
  margin-top: 16px;
}

@media (max-width: 940px) {
  .start-screen,
  .game-grid,
  .game-header,
  .research-split {
    grid-template-columns: 1fr;
  }

  .file-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  body::before {
    background:
      linear-gradient(90deg, var(--red) 0 6px, transparent 6px calc(100% - 6px), var(--red) calc(100% - 6px) 100%),
      linear-gradient(0deg, var(--blue) 0 5px, transparent 5px calc(100% - 5px), var(--blue) calc(100% - 5px) 100%);
  }

  .app {
    width: min(100% - 18px, 1180px);
    padding-top: 18px;
  }

  .start-title {
    font-size: clamp(3.2rem, 18vw, 5.6rem);
  }

  .timeline-tape {
    max-height: 108px;
    overflow: hidden;
  }

  .scene-copy,
  .choice-list {
    padding-inline: 14px;
  }

  .choice-card {
    grid-template-columns: 1fr;
  }

  .choice-no {
    grid-row: auto;
  }

  .result-card {
    margin-inline: 14px;
  }

  .source-item {
    grid-template-columns: 1fr;
  }

  .frame-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
