:root {
  --paper: #f4eee2;
  --paper-2: #ebe2d1;
  --paper-3: #e2d7c3;
  --ink: #25231e;
  --ink-soft: #4c473d;
  --muted: #7a7365;
  --line: #d5c9b5;
  --line-strong: #bcae96;
  --accent: #9b3a2a;
  --accent-2: #b85a45;
  --accent-soft: rgba(155, 58, 42, 0.1);
  --green: #4e6b52;
  --shadow: 0 10px 30px rgba(70, 55, 35, 0.08);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 253, 245, 0.9), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(226, 206, 174, 0.35), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.025) 0 1px, transparent 1px 4px),
    var(--paper);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(120, 90, 50, 0.045), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(120, 90, 50, 0.04), transparent 40%);
  mix-blend-mode: multiply;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 22px 64px;
  flex: 1;
}

.screen.hidden, .hidden { display: none !important; }

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.masthead strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.hero {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0 30px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 8.6vw, 72px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.hero h1 span {
  display: block;
  font-size: 0.36em;
  letter-spacing: 0.34em;
  color: var(--accent);
  margin-top: 18px;
  font-weight: 400;
}

.lede {
  max-width: 560px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.9;
}

.lede em {
  font-style: normal;
  border-bottom: 1px solid var(--accent-2);
  padding-bottom: 1px;
}

.title-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}
.toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--paper-3);
  transition: background 160ms ease, border-color 160ms ease;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 160ms ease;
}
.toggle[aria-pressed="true"] .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle[aria-pressed="true"] .toggle-knob { transform: translateX(16px); }
.toggle-note {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 38px;
}

.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.ghost:hover { background: rgba(155, 58, 42, 0.06); border-color: var(--accent); color: var(--accent); }

.btn.small { padding: 8px 14px; font-size: 12px; }

.text-link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.text-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.fineprint {
  margin-top: 26px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
  max-width: 560px;
}

.fineprint strong { color: var(--ink-soft); font-weight: 600; }

.how {
  margin-top: 18px;
  max-width: 560px;
}
.how summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  width: fit-content;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "＋"; color: var(--accent); margin-right: 8px; }
.how[open] summary::before { content: "－"; }
.how-body p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.9;
}

/* ---------- setup ---------- */

.setup-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.setup-head h2 {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.setup-head p {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.setup-section {
  margin: 0 0 30px;
  padding: 22px;
  background: rgba(255, 252, 244, 0.55);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.setup-section h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.setup-section .section-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.field-label {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  min-width: 64px;
}

input[type="text"] {
  width: min(320px, 100%);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  padding: 8px 4px;
  outline: none;
}
input[type="text"]:focus { border-bottom-color: var(--accent); }

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.selected { background: var(--ink); color: var(--paper); }

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.6);
  color: var(--ink);
  padding: 13px 14px;
  cursor: pointer;
  font-family: var(--serif);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.option:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.option .name { display: block; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.option .desc { display: block; margin-top: 2px; color: var(--muted); font-family: var(--sans); font-size: 11px; line-height: 1.6; }

.talent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.talent {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.6);
  padding: 14px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--serif);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.talent:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.talent.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.talent .name { display: block; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.talent .desc { display: block; margin-top: 4px; color: var(--muted); font-family: var(--sans); font-size: 11px; line-height: 1.6; }

.talent-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.attrs { display: grid; gap: 12px; }
.attr-row {
  display: grid;
  grid-template-columns: 76px 1fr 44px;
  align-items: center;
  gap: 12px;
}
.attr-row .attr-name { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.attr-bar { display: flex; gap: 3px; }
.attr-bar span {
  flex: 1;
  height: 10px;
  background: var(--paper-3);
  transition: background 120ms ease;
}
.attr-bar span.on { background: var(--accent); }
.attr-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.attr-controls button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.attr-controls button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.attr-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
.attr-controls .val { width: 20px; text-align: center; font-family: var(--sans); font-size: 13px; }

.points-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}
.points-line strong { color: var(--accent); font-weight: 600; }

.setup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

/* ---------- game ---------- */

.game-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.stage-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

.stage-title {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.stage-title .age { color: var(--muted); font-size: 15px; margin-left: 10px; letter-spacing: 0.02em; }

.progress-wrap { text-align: right; }
.progress-text { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.dots { display: flex; gap: 4px; justify-content: flex-end; margin-top: 7px; }
.dots span { width: 6px; height: 6px; flex: 0 0 auto; background: #cfc3ad; border-radius: 50%; }
.dots span.done { background: var(--accent); }
.dots span.now { background: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
}
.stat { min-width: 0; }
.stat .k { display: flex; justify-content: space-between; gap: 4px; font-family: var(--sans); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.stat .k b { color: var(--ink-soft); font-weight: 600; }
.stat .bar { height: 4px; background: var(--paper-3); margin-top: 5px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--accent); transition: width 420ms cubic-bezier(.2,.8,.2,1); }
.stat.warn .bar i { background: #a8642e; }
.stat.low .bar i { background: #8d2f22; }

.narrative {
  padding: 30px 0 8px;
}
.event-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 8px;
}
.narrative h2 {
  margin: 0 0 14px;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.narrative p {
  margin: 0;
  font-size: 17px;
  line-height: 2;
  color: var(--ink-soft);
}

.choices { display: grid; gap: 10px; margin-top: 26px; }

.free-action {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.free-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}
.free-badge {
  padding: 2px 6px;
  border: 1px solid rgba(155, 58, 42, 0.3);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.free-action textarea {
  width: 100%;
  min-height: 64px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.62);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.free-action textarea:focus { border-color: var(--accent); }
.free-action textarea:disabled { opacity: 0.6; }
.free-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.free-note {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}
.free-error {
  margin: 8px 0 0;
  color: #8d2f22;
  font-family: var(--sans);
  font-size: 12px;
}
.ai-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 5px;
  border: 1px solid rgba(155, 58, 42, 0.3);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.ai-ending-label {
  margin: 18px 0 0;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.achievement-toast {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.achievement-chip {
  padding: 4px 9px;
  border: 1px solid rgba(155, 58, 42, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.achievement-list {
  display: grid;
  gap: 0;
}
.achievement-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(213, 201, 181, 0.55);
}
.achievement-item:last-child { border-bottom: 0; }
.achievement-item .name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.achievement-item .age {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 11px;
}
.achievement-item .desc {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.8;
}


.choice {
  appearance: none;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.62);
  color: var(--ink);
  padding: 15px 16px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.choice:hover { border-color: var(--accent); background: #fffdf7; transform: translateX(3px); }
.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.choice:hover .num { border-color: var(--accent); color: var(--accent); }

.hint {
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
}

.result-panel {
  margin-top: 26px;
  padding: 20px 22px;
  background: rgba(255, 252, 244, 0.75);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  animation: rise 260ms ease both;
}
.result-panel .chosen {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.result-panel .chosen b { color: var(--ink-soft); font-weight: 600; }
.result-panel .outcome {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
}
.deltas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.delta {
  font-family: var(--sans);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}
.delta.up { color: var(--green); border-color: rgba(78, 107, 82, 0.35); }
.delta.down { color: #8d2f22; border-color: rgba(141, 47, 34, 0.3); }

.result-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- stage card ---------- */

.stage-card {
  margin: 46px auto 0;
  max-width: 560px;
  text-align: center;
  padding: 38px 26px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.7);
  box-shadow: var(--shadow);
  animation: rise 320ms ease both;
}
.stage-card .range {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.stage-card h2 {
  margin: 10px 0 16px;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.stage-card .summary {
  margin: 0 auto;
  max-width: 430px;
  color: var(--ink-soft);
  font-size: 16px;
}
.stage-card .transition {
  margin: 14px auto 0;
  max-width: 430px;
  color: var(--muted);
  font-size: 14px;
}
.stage-card .next-label {
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.stage-card .btn { margin-top: 12px; }

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

.ending-hero {
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--line);
  animation: rise 400ms ease both;
}
.ending-hero .eyebrow { margin-bottom: 10px; }
.ending-hero h1 {
  margin: 0;
  font-size: clamp(36px, 8vw, 58px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.epitaph {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.9;
  color: var(--accent);
  max-width: 620px;
}
.ending-text {
  margin: 18px 0 0;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 2;
}
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.keyword {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

.panel {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.55);
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.panel .panel-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
}

.axis-list { display: grid; gap: 10px; }
.axis-row {
  display: grid;
  grid-template-columns: 72px 1fr 58px;
  gap: 12px;
  align-items: center;
}
.axis-row .name { font-family: var(--sans); font-size: 12px; color: var(--ink-soft); }
.axis-track { display: flex; gap: 3px; }
.axis-track span { flex: 1; height: 9px; background: var(--paper-3); }
.axis-track span.on { background: var(--accent); }
.axis-row .label { font-family: var(--sans); font-size: 11px; color: var(--muted); text-align: right; }

.radar-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: center;
}
.radar { width: 100%; max-width: 380px; }
.radar svg { width: 100%; height: auto; display: block; }

.psych-table, .axis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.psych-table th, .axis-table th {
  text-align: left;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--line);
}
.psych-table td, .axis-table td {
  padding: 11px 8px 11px 0;
  border-bottom: 1px solid rgba(213, 201, 181, 0.55);
  vertical-align: top;
}
.psych-table tr:last-child td, .axis-table tr:last-child td { border-bottom: 0; }
.psych-table .dim { font-weight: 600; white-space: nowrap; }
.psych-table .score { font-family: var(--sans); font-size: 12px; color: var(--accent); white-space: nowrap; }
.psych-table .tendency { font-family: var(--sans); font-size: 12px; white-space: nowrap; color: var(--ink-soft); }
.psych-table .evidence { margin: 0; padding: 0; list-style: none; color: var(--muted); font-family: var(--sans); font-size: 11px; line-height: 1.8; }
.psych-table .evidence li { margin: 0 0 3px; }
.psych-table .evidence span { color: var(--accent); margin-right: 4px; }
.psych-table .none { color: var(--muted); font-family: var(--sans); font-size: 11px; }

.timeline { margin-top: 4px; }
.timeline-group { border-bottom: 1px solid var(--line); }
.timeline-group:last-child { border-bottom: 0; }
.timeline-group summary {
  cursor: pointer;
  padding: 12px 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  list-style: none;
}
.timeline-group summary::-webkit-details-marker { display: none; }
.timeline-group summary::before { content: "＋"; color: var(--accent); margin-right: 8px; font-family: var(--sans); }
.timeline-group[open] summary::before { content: "－"; }
.timeline-items { padding: 0 0 14px 18px; }
.tl-item { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 7px 0; }
.tl-item .age { font-family: var(--sans); font-size: 11px; color: var(--accent); padding-top: 2px; }
.tl-item .body { font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
.tl-item .body b { font-weight: 600; color: var(--ink); }
.tl-item .body span { display: block; color: var(--muted); font-family: var(--sans); font-size: 11px; }

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.site-footer {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 22px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 25, 15, 0.48);
}
.feedback-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 70px rgba(40, 30, 15, 0.28);
}
.feedback-dialog h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.feedback-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
}
.feedback-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.feedback-close:hover { color: var(--accent); }
.feedback-field {
  display: block;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
}
.feedback-field span {
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}
.feedback-field select,
.feedback-field input,
.feedback-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.7);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  padding: 9px 10px;
  outline: none;
}
.feedback-field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}
.feedback-field select:focus,
.feedback-field input:focus,
.feedback-field textarea:focus { border-color: var(--accent); }
.feedback-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
#feedback-status {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
}


.footer-note {
  margin-top: 36px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.03em;
}

/* ---------- responsive ---------- */

@media (max-width: 680px) {
  .screen { padding: 20px 16px 50px; }
  .hero { min-height: auto; padding-top: 24px; }
  .lede { font-size: 16px; }
  .option-grid { grid-template-columns: 1fr; }
  .talent-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
  .narrative h2 { font-size: 23px; }
  .narrative p { font-size: 16px; }
  .game-top { align-items: flex-start; }
  .stage-title { font-size: 22px; }
  .dots { display: none; }
  .radar-wrap { grid-template-columns: 1fr; }
  .axis-row { grid-template-columns: 62px 1fr 54px; }
  .psych-table .evidence { display: none; }
  .psych-table th:nth-child(4), .psych-table td:nth-child(4) { display: none; }
  .panel { padding: 18px; }
  .setup-section { padding: 18px; }
  .setup-actions { flex-direction: column-reverse; align-items: stretch; }
  .setup-actions .btn { width: 100%; }
}

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