:root {
  color-scheme: light;
  --paper: #f4eee3;
  --sheet: #fffaf0;
  --ink: #253b31;
  --quiet: #505e51;
  --line: #d9d3c2;
  --forest: #18352e;
  --forest-deep: #142e25;
  --gold: #f2c881;
  --rust: #963f2f;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 1rem / 1.6 var(--sans);
}
button, input { font: inherit; }
button { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #a54a32;
  outline-offset: 4px;
}
h1:focus, h2[tabindex]:focus, main:focus { outline: none; }
h1, h2, p, dl, dd { margin: 0; }
h2 { font: 400 1.85rem / 1.13 var(--serif); }
p + p { margin-top: .75rem; }
.frame { width: min(100% - 2rem, 75rem); margin-inline: auto; }
main { flex: 1; }
.site-header { border-bottom: 1px solid var(--line); background: #faf5e9; }
.header-row, .site-footer { display: flex; align-items: center; justify-content: space-between; }
.header-row { min-height: 3.65rem; }
.wordmark, .nav-button {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 44px;
  padding: .25rem;
  background: transparent;
  color: inherit;
  border: 0;
}
.wordmark { font: 700 1.1rem / 1.2 var(--serif); }
.mark {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--forest);
  color: var(--gold);
}
.mark::before, .mark::after { content: ''; position: absolute; background: currentColor; }
.mark::before { inset: 4px 8px; border-radius: 60%; transform: rotate(29deg); }
.mark::after { inset: 8px 4px; border-radius: 60%; transform: rotate(29deg); }
.nav-button { font-size: .875rem; font-weight: 650; }
.nav-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer {
  margin-top: 2.1rem;
  min-height: 4rem;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: .875rem;
}
.skip {
  position: fixed;
  z-index: 4;
  top: .5rem;
  left: .5rem;
  padding: .6rem 1rem;
  transform: translateY(-160%);
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
}
.skip:focus { transform: translateY(0); }
.load-message { padding-block: 2rem; }
.save-notice {
  margin-block: .85rem 0;
  padding: .65rem 1rem;
  border-left: 3px solid var(--rust);
  background: #f4ddcc;
  color: #612d22;
}
.display {
  font: 400 clamp(2.6rem, 6.5vw, 4.45rem) / 1.03 var(--serif);
  letter-spacing: -.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.eyebrow {
  margin-bottom: .75rem;
  color: var(--rust);
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .095em;
  line-height: 1.4;
  text-transform: uppercase;
}
.lead { max-width: 60ch; margin-top: 1rem; color: var(--quiet); font-size: 1.06rem; }
.button {
  min-height: 48px;
  padding: .68rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 720;
  text-align: center;
  transition: background-color .16s ease, border-color .16s ease;
}
.primary { background: var(--forest); color: #fff8e9; }
.primary:hover { background: #2c5142; }
.primary:disabled { opacity: .65; cursor: default; }
.secondary { border-color: #a7a898; background: transparent; color: var(--ink); }
.secondary:hover { background: #ebe8da; }
.danger { background: #8f3528; color: #fff8e9; }
.danger:hover { background: #72261c; }
.ghost { border-color: #93a297; background: transparent; color: #fff8e9; }
.ghost:hover { background: #315044; }
.landing { margin-top: 1.15rem; }
.hero {
  display: grid;
  overflow: hidden;
  border-radius: 20px;
  background: var(--forest);
  color: #fff6e5;
  box-shadow: 0 18px 40px #40371d13;
}
.hero-copy { padding: clamp(1.5rem, 4.4vw, 4.1rem); align-self: center; container-type: inline-size; }
.hero .eyebrow { color: var(--gold); }
.hero .display { font-size: clamp(3.45rem, 11vw, 5.4rem); line-height: .91; }
.hero em { display: block; color: var(--gold); font-weight: 400; padding-bottom: .1em; white-space: nowrap; }
.hero-description { margin-top: 1.2rem; max-width: 32ch; font-size: clamp(1.05rem, 2vw, 1.22rem); color: #f1e9d9; }
.hero-actions, .ending-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.hero .primary { background: var(--gold); color: #1c3228; min-width: 9.2rem; }
.hero .primary:hover { background: #ffdda5; }
.hero button:focus-visible { outline-color: var(--gold); }
.hero-visual { min-width: 0; position: relative; background: #a76a46; }
.hero-art {
  display: block;
  width: 100%;
  height: clamp(13rem, 51vw, 20rem);
  object-fit: cover;
  object-position: center 57%;
}
.chapter-trail, .progress-chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}
.chapter-trail { margin: 1.1rem 0 0; border: 1px solid var(--line); border-radius: 12px; background: #f9f3e7; }
.chapter-trail li { min-width: 0; padding: .8rem .55rem; text-align: center; font: 400 1rem / 1.3 var(--serif); }
.chapter-trail li + li { border-left: 1px solid var(--line); }
.surface {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px #40371d0b;
}
.setup, .error-screen { max-width: 48rem; margin: 1.4rem auto 0; padding: clamp(1.1rem, 5vw, 3rem); }
.style-form { margin-top: 1.4rem; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: .7rem; padding: 0; font-weight: 700; }
.style-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  margin-bottom: .6rem;
  padding: .75rem;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.style-option:has(input:checked) { border-color: #668474; background: #eaf0e4; }
.style-option:hover { border-color: #668474; }
.style-option input { width: 1.12rem; height: 1.12rem; margin: 0; accent-color: var(--forest); }
.style-description { display: block; font-size: .925rem; color: var(--quiet); }
.style-option small {
  padding: .15rem .45rem;
  border: 1px solid #a5b29e;
  border-radius: 4px;
  font-size: .78rem;
}
.style-form > .button { margin-top: .7rem; }
.game { max-width: 66rem; margin: 1.15rem auto 0; }
.progress { margin-bottom: .85rem; padding: .75rem .9rem; border-radius: 12px; background: #fff9ec; border: 1px solid var(--line); }
.progress-chapters { margin: 0 0 .65rem; gap: .35rem; }
.progress-chapters li {
  padding: .45rem .1rem .1rem;
  border-top: 3px solid #cfc9b9;
  color: var(--quiet);
  font-size: .875rem;
  line-height: 1.25;
}
.progress-chapters .done { border-color: #859a84; }
.progress-chapters [aria-current="step"] { border-color: var(--forest); color: var(--forest); font-weight: 750; }
.decision-progress { display: flex; align-items: center; gap: .8rem; }
.decision-count { color: var(--quiet); font-size: .875rem; white-space: nowrap; }
.decision-track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .23rem; }
.decision-track span { height: .29rem; border-radius: 3px; background: #e3dac8; }
.decision-track .filled { background: #397360; }
.decision-track .next { background: #b76240; }
.game-grid, .sidebar { display: grid; gap: .75rem; }
.game-grid { align-items: start; }
.event {
  --accent: #235349;
  min-width: 0;
  overflow: hidden;
}
.event-art { position: relative; border-bottom: 4px solid var(--accent); background: #995c43; }
.scene-image { display: block; width: 100%; height: clamp(8.8rem, 42vw, 17rem); object-fit: cover; }
.event[data-scene="anchor"] .scene-image { height: clamp(10.5rem, 47vw, 20rem); }
.event[data-scene="callback"] .event-art { border-bottom-color: #aa7048; }
.event[data-scene="outcome"] .scene-image { height: clamp(5.25rem, 24vw, 8.5rem); }
.event[data-tone="hard"] { box-shadow: 0 10px 24px #663c2526; }
.event-copy { padding: clamp(1rem, 4vw, 2.15rem); }
.event[data-theme="money"] { --accent: #974c36; }
.event[data-theme="work"] { --accent: #2e5379; }
.event[data-theme="relationships"] { --accent: #8b4b58; }
.event .eyebrow { color: var(--accent); }
.event .display { font-size: clamp(2.35rem, 6.5vw, 3.65rem); }
.story-text { max-width: 66ch; font: 400 clamp(1.15rem, 2vw, 1.33rem) / 1.58 var(--serif); }
.event .story-text { margin-top: 1.05rem; }
.transition { margin-top: .8rem; padding: .55rem .8rem; background: #f3e9d6; border-radius: 0 8px 8px 0; border-left: 3px solid var(--accent); color: var(--quiet); font: italic 1rem / 1.45 var(--serif); }
.choices { display: grid; gap: .55rem; margin-top: 1.35rem; }
.choice {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .72rem .85rem;
  border: 1px solid #c6c5b4;
  border-radius: 10px;
  background: #fbf7ea;
  color: var(--ink);
  text-align: left;
  line-height: 1.38;
  transition: background-color .16s ease, border-color .16s ease;
}
.choice:hover { border-color: #638675; background: #eef1e7; }
.choices .choice {
  padding: .88rem 1rem .88rem 1.15rem;
  border-left: 4px solid var(--accent);
  box-shadow: 0 2px 4px #3b35280b;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
@media (hover: hover) { .choices .choice:hover { transform: translateX(2px); } }
.choices .choice strong { font-size: 1.03rem; }
.choice span { display: block; margin-top: .24rem; color: var(--quiet); font-size: .9rem; }
.choice .readiness { color: #365749; font-style: italic; }
.feedback { margin-top: 1rem; padding: .62rem .8rem; background: #eee9d7; border-left: 3px solid #947537; }
.changes {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  padding: 0;
  margin: .9rem 0 0;
  list-style: none;
  font-size: .875rem;
}
.changes li { padding: .2rem .65rem; border: 1px solid #bec8b6; border-radius: 1rem; background: #edf1e6; }
.changes .loss { border-color: #dec1ae; background: #f9e8dc; color: #703b29; }
.changes .work-change { border-color: #bfcbd3; background: #eaf0f3; color: #294453; }
.reflection { margin-top: .72rem; color: var(--quiet); font-style: italic; }
.outcome .button { margin-top: 1.25rem; }
.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ede9da;
}
.meter dt { font-weight: 730; font-size: .875rem; }
.meter dd { color: var(--quiet); font-size: .875rem; }
.meter-track { display: block; height: .31rem; margin-top: .44rem; background: #d6d2c3; border-radius: 8px; }
.meter-track span { display: block; width: var(--fill); height: 100%; border-radius: inherit; background: #42766b; }
.energy .meter-track span { background: #967127; }
.momentum .meter-track span { background: #536d8a; }
.journal { border: 1px solid var(--line); border-radius: 9px; background: var(--sheet); }
.journal summary { min-height: 44px; padding: .67rem .9rem; font-weight: 730; cursor: pointer; }
.journal-body { padding: 0 .9rem .8rem; }
.relationships > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .6rem; }
.relationships dt { font-weight: 650; }
.relationships dd, .journal-note { color: var(--quiet); }
.journal-note, .moment-list { margin-top: .55rem; font-size: .875rem; }
.moment-list { padding-left: 1.1rem; margin-bottom: 0; }
.moment-list li + li { margin-top: .35rem; }
.ending-layout { max-width: 66rem; margin: 1.4rem auto 0; }
.ending { display: grid; overflow: hidden; }
.ending-art { display: block; width: 100%; height: clamp(12rem, 51vw, 24rem); object-fit: cover; background: var(--forest); }
.ending-copy, .ending-moments { padding: clamp(1.1rem, 5vw, 3rem); }
.ending .story-text { margin-top: 1.1rem; }
.ending-moments { background: var(--forest); color: #fff5e6; }
.ending-moments .eyebrow { color: var(--gold); }
.recaps, .history-list { padding: 0; list-style: none; }
.recaps { margin: 1.15rem 0 0; }
.recaps li { padding: .75rem 0; border-top: 1px solid #879b8b; }
.recaps li p { font: 400 1.15rem / 1.45 var(--serif); }
.result-share { display: grid; gap: 1.2rem; align-items: center; margin-top: 1.1rem; padding: clamp(1rem, 4vw, 2rem); }
.result-visual { display: grid; place-items: center; min-height: 11rem; padding: 1rem; border-radius: 11px; background: #274337; color: #fff6e7; }
.result-image { display: block; width: min(100%, 11rem); height: auto; border-radius: 6px; box-shadow: 0 8px 22px #0f2019a6; }
.result-placeholder { text-align: center; }
.share-intro { margin-top: .5rem; color: var(--quiet); }
.share-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.save-result { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.share-status { margin-top: .65rem; color: var(--forest); font-size: .9rem; }
.share-status:empty { margin: 0; }
.manual-link { width: 100%; margin-top: .65rem; padding: .55rem; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.social-link { display: inline-flex; min-height: 44px; align-items: center; margin-top: .4rem; color: var(--forest); font-weight: 680; text-underline-offset: 3px; }
.share-help { color: var(--quiet); font-size: .9rem; line-height: 1.5; }
.public-game-links { margin-top: .6rem; }
dialog {
  width: min(34rem, 100% - 2rem);
  max-height: 88vh;
  padding: 1.25rem;
  border: 1px solid #a7a898;
  border-radius: 12px;
  background: var(--sheet);
  color: var(--ink);
}
dialog::backdrop { background: #172b25ba; }
dialog h2 { margin-bottom: .8rem; }
dialog > .button { margin: .75rem .45rem 0 0; }
.history-list { display: grid; gap: .55rem; margin: .8rem 0 0; }
.error-screen p { margin-block: .8rem; }
@media (min-width: 40rem) {
  .frame { width: min(100% - 3rem, 75rem); }
  .landing { margin-top: 2rem; }
  .chapter-trail li { padding: 1rem .5rem; }
  .game { margin-top: 1.65rem; }
  .progress-chapters li { padding-inline: .25rem; }
  .result-share { grid-template-columns: minmax(11rem, 29%) minmax(0, 1fr); }
}
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); min-height: 28rem; }
  .hero-art { position: absolute; inset: 0; height: 100%; object-position: center; }
  .hero .display { font-size: clamp(3rem, 24cqi, 7.25rem); }
}
@media (min-width: 56rem) {
  .hero { min-height: clamp(28rem, 67vh, 37rem); }
  .game-grid { grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; }
  .meters { grid-template-columns: minmax(0, 1fr); gap: .85rem; padding: 1rem; }
  .meter { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: .12rem .25rem; }
  .meter-track { grid-column: 1 / -1; }
  .ending { grid-template-columns: minmax(0, 1fr) minmax(15rem, .57fr); }
  .ending-art { grid-column: 1 / -1; }
}
@media (max-width: 25rem) {
  .chapter-trail li { padding-inline: .3rem; }
  .style-option { grid-template-columns: auto 1fr; }
  .style-option small { grid-column: 2; justify-self: start; }
  .hero-actions, .ending-actions, .share-actions { display: grid; }
}
@media (prefers-reduced-motion: no-preference) {
  .event, .setup, .ending { animation: enter .24s ease-out both; }
  .event[data-scene="anchor"] .event-art { animation: enter-chapter .5s ease-out both; }
  @keyframes enter { from { opacity: .7; transform: translateY(4px); } }
  @keyframes enter-chapter { from { opacity: .55; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
