:root {
  color-scheme: dark;
  --ink: #0b0d10;
  --panel: #111419;
  --panel-raised: #181c22;
  --paper: #ece7dc;
  --muted: #949087;
  --line: rgba(236, 231, 220, .14);
  --line-strong: rgba(236, 231, 220, .28);
  --gold: #c8a665;
  --gold-pale: #e0c58e;
  --danger: #a05d52;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 80% 10%, rgba(200, 166, 101, .07), transparent 28rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button { font: inherit; }

.app-shell { min-height: 100vh; }

.cover {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1160px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(22px, 6vw, 72px) max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.cover__rule {
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .22em;
  padding-top: 11px;
}

.cover__body { align-self: center; max-width: 720px; padding: 9vh 0 7vh; }

.eyebrow {
  margin: 0 0 24px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 11vw, 112px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.07em;
}

h1 i {
  display: inline-block;
  margin: 0 .14em;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: .3em;
  font-weight: 400;
  letter-spacing: 0;
  transform: translateY(-.8em);
}

.cover__question {
  margin: 34px 0 0;
  font-family: var(--serif);
  font-size: clamp(25px, 4vw, 42px);
  line-height: 1.38;
}

.cover__intro {
  margin: 22px 0 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.primary-button {
  width: min(100%, 360px);
  min-height: 58px;
  border: 1px solid var(--gold);
  border-radius: 0;
  padding: 0 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #17130d;
  background: var(--gold);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .08em;
  transition: background .2s ease, transform .2s ease;
}

.primary-button:hover { background: var(--gold-pale); }
.primary-button:active { transform: translateY(1px); }
.primary-button b { font-size: 22px; font-weight: 400; }

.access-gate { width: min(100%, 480px); margin-top: 6px; }
.access-gate > label { display: block; margin-bottom: 8px; color: #8e8a82; font-size: 10px; letter-spacing: .14em; }
.access-gate__row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.access-gate input {
  width: 100%; min-height: 58px; border: 1px solid var(--line-strong); border-radius: 0; padding: 0 16px;
  color: var(--paper); background: rgba(13,15,18,.82); font: 22px/1 Georgia, serif; letter-spacing: .28em; outline: none;
}
.access-gate input::placeholder { color: #56534e; letter-spacing: .15em; }
.access-gate input:focus { border-color: var(--gold); }
.access-gate .primary-button { width: 100%; }
.access-gate > p { margin: 8px 0 0; color: #605e58; font-size: 9px; line-height: 1.5; }
.access-gate .access-gate__error { min-height: 15px; margin-top: 3px; color: #bd776c; }
.access-gate.is-shaking { animation: gate-shake .28s ease; }
@keyframes gate-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.cover__footer {
  display: flex;
  gap: clamp(18px, 5vw, 52px);
  border-top: 1px solid var(--line);
  padding: 17px 0;
  color: #aaa59b;
  font-size: 11px;
  letter-spacing: .08em;
}

.disclaimer { margin: 0; color: #65635e; font-size: 10px; line-height: 1.5; }

@media (max-width: 560px) {
  .cover__body { padding: 8vh 0 5vh; }
  h1 { font-size: clamp(52px, 18vw, 76px); line-height: 1.02; }
  h1 span { display: block; }
  h1 i { position: absolute; margin: .58em 0 0 .3em; font-size: .24em; }
  .cover__question { margin-top: 28px; }
  .cover__footer { justify-content: space-between; gap: 8px; }
  .cover__footer span:nth-child(2) { display: none; }
  .primary-button { width: 100%; }
  .access-gate__row { grid-template-columns: 94px minmax(0, 1fr); }
}

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

/* ---------- Story ---------- */

.app-shell--game { min-height: 100vh; background: linear-gradient(90deg, rgba(255,255,255,.015), transparent 30%, transparent 70%, rgba(255,255,255,.015)); }

.game-frame {
  width: min(100%, 1180px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) clamp(20px, 5vw, 64px) max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.game-header, .result-topbar {
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
}

.wordmark {
  border: 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.wordmark b { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .08em; }
.wordmark span { color: #66645e; font: 9px/1 var(--sans); letter-spacing: .18em; }
.wordmark--static { cursor: default; }

.game-header__meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.game-header__meta i { width: 18px; height: 1px; background: var(--gold); }

.progress-track { height: 2px; background: rgba(255,255,255,.045); }
.progress-track span { display: block; height: 100%; background: var(--gold); transition: width .45s cubic-bezier(.2,.7,.2,1); }

.story-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 720px);
  justify-content: space-between;
  gap: clamp(44px, 9vw, 130px);
  padding: clamp(50px, 9vh, 96px) 0 56px;
}

.story-index { align-self: start; position: sticky; top: 24px; color: var(--muted); }
.story-index > p:first-child { margin: 0 0 2px; color: #77746e; font-size: 10px; letter-spacing: .18em; }
.story-index > strong { display: block; margin: 4px 0 38px; color: var(--paper); font: 500 clamp(48px, 6vw, 72px)/1 var(--serif); }
.story-index > strong small { color: #5e5c57; font: 12px/1 var(--sans); letter-spacing: .12em; }
.story-index dl { margin: 0; border-top: 1px solid var(--line); }
.story-index dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.story-index dt { color: #66645f; font-size: 10px; letter-spacing: .12em; }
.story-index dd { margin: 0; color: #aaa59c; font-size: 11px; text-align: right; }
.story-index .story-index__note { margin: 24px 0 0; color: #605e59; font-size: 10px; line-height: 1.75; }

.story-card { align-self: start; }
.story-card__chapter { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: .15em; }
.story-card__chapter i { width: 32px; height: 1px; background: rgba(200, 166, 101, .55); }
.story-card__kicker { margin: 28px 0 10px; color: #77736b; font-family: var(--serif); font-size: 14px; }
.story-card h2 { max-width: 680px; margin: 0; font-family: var(--serif); font-size: clamp(30px, 4.3vw, 50px); font-weight: 500; line-height: 1.28; letter-spacing: -.025em; }
.story-card__body { max-width: 670px; margin: 24px 0 36px; color: #a6a198; font-size: 14px; line-height: 1.95; }

.choice-list { display: grid; gap: 10px; }
.choice {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  background: rgba(18, 21, 26, .74);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.choice:hover, .choice:focus-visible { border-color: rgba(200,166,101,.65); background: #181b20; transform: translateX(4px); outline: none; }
.choice__letter { color: var(--gold); font-family: Georgia, serif; font-size: 12px; }
.choice__copy { display: grid; gap: 6px; }
.choice__copy b { font-size: 14px; font-weight: 570; letter-spacing: .02em; }
.choice__copy small { color: #77746d; font-size: 11px; line-height: 1.55; }
.choice__arrow { color: #69665f; font-size: 16px; transition: color .2s ease; }
.choice:hover .choice__arrow { color: var(--gold); }

.game-footer { min-height: 34px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 13px; color: #56544f; font-size: 9px; letter-spacing: .1em; }

.story-enter { animation: story-in .46s cubic-bezier(.2,.75,.2,1) both; }
@keyframes story-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Consequence ---------- */

.consequence-frame { min-height: 100svh; }
.consequence { width: min(100%, 720px); margin: auto; padding: 70px 0; position: relative; }
.consequence .eyebrow { margin-bottom: 24px; }
.consequence__mark { position: absolute; right: 2%; top: 44px; width: 82px; height: 82px; border: 2px solid rgba(160,93,82,.5); border-radius: 50%; display: grid; place-items: center; color: rgba(160,93,82,.68); font-family: var(--serif); font-size: 38px; transform: rotate(-11deg); }
.consequence__choice { margin: 0 0 20px; color: #77736b; font-size: 12px; letter-spacing: .08em; }
.consequence blockquote { margin: 0; max-width: 650px; font-family: var(--serif); font-size: clamp(27px, 4vw, 42px); line-height: 1.55; }
.consequence__route { margin: 44px 0 26px; border-block: 1px solid var(--line); padding: 16px 0; display: flex; justify-content: space-between; align-items: center; }
.consequence__route span { color: #66635d; font-size: 10px; letter-spacing: .12em; }
.consequence__route b { color: var(--gold-pale); font-size: 12px; font-weight: 550; }
.primary-button--wide { width: 100%; max-width: none; }
.consequence__hint { margin: 14px 0 0; color: #5e5b55; font-size: 10px; text-align: center; }

/* ---------- Result ---------- */

.app-shell--result {
  min-height: 100vh;
  background: radial-gradient(circle at 70% 0%, rgba(200,166,101,.075), transparent 32rem);
}

.result-shell { width: min(100%, 1100px); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) clamp(20px, 5vw, 56px) max(36px, env(safe-area-inset-bottom)); }
.result-topbar { color: #68655f; font-size: 9px; letter-spacing: .12em; }

.result-hero { position: relative; padding: clamp(72px, 12vh, 128px) 0 clamp(74px, 10vh, 112px); border-bottom: 1px solid var(--line-strong); }
.result-hero .eyebrow { margin-bottom: 15px; }
.result-badge { margin: 0 0 18px; color: #928c80; font-size: 11px; letter-spacing: .12em; }
.result-hero h1 { max-width: 850px; font-size: clamp(58px, 11vw, 124px); letter-spacing: -.075em; }
.result-hero blockquote { max-width: 780px; margin: 34px 0 22px; padding-left: 18px; border-left: 2px solid var(--gold); color: #dad3c5; font-family: var(--serif); font-size: clamp(20px, 3vw, 30px); line-height: 1.55; }
.result-summary { max-width: 740px; margin: 0; color: #8f8a81; font-size: 14px; line-height: 2; }
.result-hero__stamp { position: absolute; right: 2%; top: 22%; width: 90px; height: 90px; border: 2px solid rgba(160,93,82,.42); border-radius: 50%; display: grid; place-items: center; color: rgba(160,93,82,.56); font-family: var(--serif); font-size: 24px; line-height: 1.05; text-align: center; transform: rotate(-13deg); }

.report-section { padding: clamp(64px, 9vw, 94px) 0; border-bottom: 1px solid var(--line-strong); }
.section-heading { display: grid; grid-template-columns: 50px 1fr; gap: 18px; align-items: start; margin-bottom: 44px; }
.section-heading > span { color: var(--gold); font: 12px/1.4 Georgia, serif; }
.section-heading p { margin: 0 0 6px; color: #716e67; font-size: 10px; letter-spacing: .16em; }
.section-heading h2, .insight-card h2, .result-actions h2 { margin: 0; font-family: var(--serif); font-size: clamp(25px, 3.3vw, 38px); font-weight: 500; line-height: 1.4; }

.fit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(30px, 6vw, 76px); }
.fit-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.fit-item > div > span { color: #b8b2a7; font-size: 13px; }
.fit-item > div > b { color: var(--paper); font: 500 clamp(44px, 6vw, 68px)/1 var(--serif); }
.fit-item > div > b small { color: var(--gold); font: 11px/1 var(--sans); }
.fit-item > i, .rank-list i { display: block; height: 3px; margin: 17px 0 12px; background: #22262b; overflow: hidden; }
.fit-item > i em, .rank-list i em { display: block; height: 100%; background: linear-gradient(90deg, #80683f, var(--gold)); }
.fit-item p { margin: 0; color: #6d6a63; font-size: 10px; line-height: 1.6; }
.report-note { margin: 38px 0 0; color: #5c5954; font-size: 10px; }

.ability-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(300px, 1.1fr); gap: clamp(30px, 7vw, 84px); align-items: center; }
.radar-wrap { display: grid; place-items: center; }
.radar { width: min(100%, 390px); overflow: visible; }
.radar__grid polygon, .radar__grid line { fill: none; stroke: rgba(236,231,220,.12); stroke-width: 1; }
.radar__area { fill: rgba(200,166,101,.17); stroke: var(--gold); stroke-width: 1.6; }
.radar__dots circle { fill: var(--gold-pale); }
.radar__labels text { fill: #8b877f; font: 10px var(--sans); }
.rank-list { display: grid; gap: 11px; }
.rank-list > div { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 12px; }
.rank-list span { color: #88847c; font-size: 10px; letter-spacing: .08em; }
.rank-list b { color: #c2bbaf; font: 500 18px/1 var(--serif); }
.rank-list i { grid-column: 1 / -1; height: 2px; margin: 8px 0 0; }
.extra-traits { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 20px; display: flex !important; gap: 10px; }
.extra-traits p { flex: 1; margin: 0; border: 1px solid var(--line); padding: 14px; display: flex; justify-content: space-between; }
.extra-traits p b { color: var(--gold-pale); }

.ledger-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ledger-card { min-height: 245px; border: 1px solid var(--line); padding: 18px 15px; display: grid; grid-template-rows: auto 1fr auto; }
.ledger-card > div { display: flex; justify-content: space-between; align-items: baseline; }
.ledger-card > div span { font-size: 12px; }
.ledger-card > div b { color: var(--gold-pale); font: 500 26px/1 var(--serif); }
.ledger-card > i { align-self: end; justify-self: center; width: 3px; height: 104px; background: #26292d; display: flex; align-items: end; }
.ledger-card > i em { display: block; width: 100%; background: var(--gold); }
.ledger-card p { margin: 18px 0 0; color: #66635d; font-size: 9px; line-height: 1.55; }

.insight-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.insight-card { border: 1px solid var(--line); padding: clamp(24px, 4vw, 42px); }
.insight-card > span { display: block; margin-bottom: 14px; color: var(--gold); font-size: 9px; letter-spacing: .14em; }
.insight-card > p { margin: 22px 0 0; color: #969188; font-size: 13px; line-height: 1.9; }
.insight-card .contrast { border-top: 1px solid var(--line); padding-top: 18px; color: #c1baad; font-family: var(--serif); font-size: 17px; }
.alternate-card { background: rgba(200,166,101,.045); }

.life-timeline { list-style: none; margin: 0; padding: 0; }
.life-timeline li { position: relative; display: grid; grid-template-columns: 86px 1fr 36px; gap: 22px; border-top: 1px solid var(--line); padding: 24px 0; }
.timeline-year b { display: block; color: #aaa59b; font: 500 20px/1.2 var(--serif); }
.timeline-year span { color: #5f5c56; font-size: 9px; }
.timeline-copy small { color: #6b6862; font-size: 9px; letter-spacing: .1em; }
.timeline-copy h3 { margin: 7px 0 7px; font-family: var(--serif); font-size: 19px; font-weight: 500; }
.timeline-copy p { margin: 0; color: #77736c; font-size: 11px; line-height: 1.7; }
.timeline-route { align-self: center; width: 30px; height: 30px; border: 1px solid rgba(200,166,101,.32); border-radius: 50%; display: grid; place-items: center; color: var(--gold); font-family: var(--serif); font-size: 12px; }

.result-actions { padding: clamp(80px, 12vw, 130px) 0; text-align: center; }
.result-actions .eyebrow { margin-bottom: 12px; }
.result-actions > div { margin-top: 30px; display: flex; justify-content: center; gap: 10px; }
.result-actions .primary-button { width: 230px; }
.secondary-button { min-height: 58px; border: 1px solid var(--line-strong); padding: 0 24px; color: #aaa59c; background: transparent; cursor: pointer; font-size: 12px; }
.secondary-button:hover { border-color: var(--gold); color: var(--paper); }
.copy-status { min-height: 18px; color: var(--gold); font-size: 10px; }
.result-footer { border-top: 1px solid var(--line-strong); padding-top: 22px; color: #55534e; font-size: 9px; line-height: 1.7; }
.result-footer b { color: #716d65; font-size: 10px; letter-spacing: .12em; }
.result-footer p { max-width: 700px; margin: 8px 0 0; }

.fatal { min-height: 100vh; display: grid; place-content: center; padding: 30px; text-align: center; }
.fatal h1 { font-size: 40px; }
.fatal p { color: var(--muted); }

@media (max-width: 760px) {
  .game-header { min-height: 44px; }
  .wordmark span { display: none; }
  .story-layout { display: block; padding: 34px 0 44px; }
  .story-index { position: static; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 34px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
  .story-index > p:first-child { display: none; }
  .story-index > strong { margin: 0; font-size: 34px; }
  .story-index dl { border: 0; display: flex; gap: 15px; }
  .story-index dl div { border: 0; padding: 0; display: block; text-align: right; }
  .story-index dt { margin-bottom: 3px; }
  .story-index dd { max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .story-index dl div:first-child { display: none; }
  .story-index__note { display: none; }
  .story-card__kicker { margin-top: 23px; }
  .story-card h2 { font-size: clamp(29px, 8.5vw, 40px); }
  .story-card__body { margin: 18px 0 28px; line-height: 1.8; }
  .choice { min-height: 82px; padding: 15px 13px; grid-template-columns: 25px 1fr 15px; gap: 8px; }
  .choice:hover { transform: none; }
  .game-footer span:last-child { display: none; }
  .consequence { padding: 60px 0; }
  .consequence__mark { width: 64px; height: 64px; top: 35px; right: 0; font-size: 28px; }
  .consequence blockquote { font-size: clamp(25px, 7vw, 34px); }
  .result-topbar > span { display: none; }
  .result-hero__stamp { top: 13%; width: 64px; height: 64px; font-size: 18px; }
  .result-hero h1 { font-size: clamp(52px, 17vw, 80px); max-width: 85%; }
  .section-heading { grid-template-columns: 30px 1fr; gap: 8px; }
  .fit-grid, .ability-grid, .insight-grid { grid-template-columns: 1fr; }
  .fit-grid { gap: 34px; }
  .radar-wrap { padding: 0 14px; }
  .ledger-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-card:last-child { grid-column: 1 / -1; min-height: 190px; }
  .life-timeline li { grid-template-columns: 62px 1fr 28px; gap: 12px; }
  .timeline-copy p { display: none; }
  .timeline-route { width: 26px; height: 26px; }
  .result-actions > div { display: grid; }
  .result-actions .primary-button, .secondary-button { width: min(100%, 320px); }
}

@media (max-width: 380px) {
  .story-index dl div:last-child { display: none; }
  .choice__copy small { font-size: 10px; }
  .ledger-grid { gap: 7px; }
  .ledger-card { padding: 15px 12px; }
}
