:root {
  --paper: #f3efe5;
  --sheet: #fcfaf3;
  --ink: #263d49;
  --quiet: #67736f;
  --muted: #8d958b;
  --line: #d3d4c6;
  --sage: #e5e9e1;
  --green: #527063;
  --stamp: #a96442;
  --warning: #9f4c3b;
  --focus: #95633d;
  --input: #eae8dd;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
#music-toggle {
  background: transparent;
  font-size: 11px;
  padding: 6px 12px;
  font-weight: 500;
  white-space: nowrap;
}
#music-toggle[aria-pressed="true"] {
  color: var(--green);
  border-color: var(--green);
}
.welcome h1 span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--quiet);
  margin-top: 6px;
  letter-spacing: 0;
}
.life-scene {
  margin: 0 0 22px;
}
.scene-window {
  height: 154px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--paper);
}
.scene-window img {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.life-scene figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 10px;
}
.scene-progress {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.life-scene i {
  display: block;
  width: 12px;
  height: 3px;
  background: var(--line);
}
.life-scene i.passed {
  background: var(--green);
}
.atlas-paper .scene-window {
  height: 220px;
}
.atlas-paper .scene-window img {
  width: 100%;
  margin-left: 0;
  object-position: center 68%;
}
.atlas-paper .life-scene {
  margin-bottom: 18px;
}
.atlas-paper canvas {
  max-height: 260px;
  object-fit: contain;
}
.birth-map .scene-window {
  height: 170px;
}
.life-result .scene-window {
  height: 160px;
}
.birth-heading .country-mark {
  animation: stamp-arrive 0.4s ease-out both;
}
.feedback {
  animation: record-arrive 0.3s ease-out both;
}
.choices button {
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.choices button:not(:disabled):hover {
  transform: translateX(3px);
}
.game-guide {
  border-top: 1px solid var(--line);
  margin-top: 52px;
  padding-top: 28px;
  max-width: 780px;
}
.game-guide h2 {
  font-size: 23px;
}
.game-guide > p:not(.eyebrow) {
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.95;
}
.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
}
.guide-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@keyframes stamp-arrive {
  from {
    opacity: 0;
    transform: scale(1.15) rotate(-9deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes record-arrive {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 680px) {
  .header-actions {
    gap: 10px;
  }
  .header-actions > a {
    font-size: 10px;
  }
  #music-toggle {
    font-size: 10px;
    padding-inline: 8px;
  }
  .scene-window {
    height: 112px;
  }
  .atlas-paper .scene-window {
    height: 180px;
  }
  .atlas-paper canvas {
    max-height: 170px;
  }
  .game-guide {
    margin-top: 36px;
  }
  .game-guide h2 {
    font-size: 20px;
  }
  .game-guide > p:not(.eyebrow) {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
  .choices button:not(:disabled):hover {
    transform: none;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.65 system-ui,
    -apple-system,
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    sans-serif;
  word-break: keep-all;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sheet);
  padding: 10px 16px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover {
  border-color: var(--green);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.large {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  font-size: 15px;
}
.primary:hover {
  background: #344e58;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
a {
  transition:
    background 0.12s,
    border-color 0.12s;
}
img,
canvas {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.35;
  letter-spacing: -0.8px;
}
h1 {
  font-size: 38px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 15px;
}
p {
  margin-bottom: 16px;
}
small {
  font-size: 12px;
}
input,
select {
  min-height: 44px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  width: 100%;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  font-weight: 600;
}
details > p {
  font-size: 13px;
  color: var(--quiet);
}
.quiet {
  color: var(--quiet);
}
.eyebrow {
  color: var(--stamp);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.3px;
}
.skip {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 20;
  background: var(--sheet);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.site-header {
  max-width: 1140px;
  margin: auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.site-header a {
  font-size: 12px;
  text-decoration: none;
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.brand img {
  object-fit: contain;
}
.site-header > a:last-child {
  color: var(--quiet);
}
main {
  max-width: 1100px;
  margin: auto;
  padding: 32px 24px 0;
}
#notice {
  font-size: 13px;
  color: var(--warning);
  margin: 0;
}
#notice:not(:empty) {
  padding-bottom: 20px;
}
#game {
  min-height: 450px;
}
.welcome {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 60px;
  min-height: 510px;
}
.welcome h1 {
  font-size: 17px;
  letter-spacing: 0;
  margin-bottom: 14px;
  font-weight: 500;
  color: var(--quiet);
}
.welcome .intro-line {
  font-size: 44px;
  line-height: 1.35;
  letter-spacing: -1.8px;
  font-weight: 720;
  margin-bottom: 22px;
}
.welcome-copy .quiet {
  margin-bottom: 28px;
}
.welcome-copy .large {
  width: 300px;
  max-width: 100%;
}
.welcome-copy > small {
  display: block;
  color: var(--quiet);
  margin-top: 18px;
}
.resume {
  background: transparent;
  border: 0;
  padding-left: 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.atlas-paper {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: var(--sheet);
  transform: rotate(1.5deg);
}
.atlas-caption,
.atlas-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--quiet);
}
.atlas-caption {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.atlas-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.atlas-foot b {
  font-size: 12px;
  color: var(--ink);
  font-weight: 550;
}
.atlas-paper canvas {
  width: 100%;
  display: block;
}
.intro-bottom {
  border-top: 1px solid var(--line);
  margin: 26px 0 0;
  max-width: 100%;
}
.intro-bottom > details {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.intro-bottom summary {
  font-size: 13px;
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 12px;
}
.settings-row label {
  font-size: 12px;
  display: grid;
  gap: 6px;
}
.backup {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  font-size: 11px;
  color: var(--quiet);
}
.backup button {
  font-size: 12px;
  background: transparent;
}
.saved-lives {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.saved-lives button {
  text-align: left;
}
.saved-lives span {
  display: block;
  font-size: 11px;
  color: var(--quiet);
  font-weight: 450;
}
.birth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 930px;
  margin: auto;
}
.birth-paper {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 26px 30px;
  border-radius: 4px;
}
.document-top {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  font-size: 11px;
  color: var(--quiet);
}
.birth-heading {
  padding: 26px 0 18px;
}
.country-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--stamp);
  border-radius: 50%;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--stamp);
  flex-shrink: 0;
}
.birth-heading p {
  margin: 14px 0 0;
  color: var(--quiet);
  font-size: 16px;
}
.birth-heading h1 {
  font-size: 36px;
  margin: 2px 0 0;
}
.name-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--quiet);
}
.name-label input {
  font-size: 19px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.birth-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 26px 0;
}
.birth-facts dt {
  font-size: 11px;
  color: var(--quiet);
}
.birth-facts dd {
  font-size: 13px;
  margin: 4px 0 0;
}
.birth-note {
  font-size: 11px;
  color: var(--quiet);
  margin: 24px 0;
}
.birth-paper > .large {
  width: 100%;
}
.birth-map canvas {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
}
.source-snapshot {
  padding: 18px 0;
}
.source-snapshot h2 {
  font-size: 23px;
  margin-bottom: 14px;
}
.source-snapshot dl {
  margin: 0;
}
.source-snapshot dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 12px;
}
.source-snapshot dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.source-snapshot > p:not(.eyebrow) {
  font-size: 11px;
  color: var(--quiet);
  margin: 16px 0 8px;
}
.source-snapshot > a {
  font-size: 11px;
}
.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.identity > div:first-child {
  display: flex;
  gap: 12px;
  align-items: center;
}
.identity p {
  font-size: 12px;
  color: var(--quiet);
  margin-bottom: 2px;
}
.identity h1 {
  font-size: 25px;
  margin: 0;
}
.identity h1 span {
  margin-left: 8px;
  font-weight: 500;
  color: var(--stamp);
}
.identity-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--quiet);
}
.identity-actions button {
  font-size: 11px;
  background: transparent;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
}
.main-life,
.life-rail {
  min-width: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.stat > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.stat b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.stat meter {
  width: 100%;
  height: 8px;
  display: block;
  margin-top: 6px;
  appearance: none;
  border: 0;
  background: var(--line);
  border-radius: 0;
}
.stat meter::-webkit-meter-bar {
  background: var(--line);
  border: 0;
  border-radius: 0;
}
.stat meter::-webkit-meter-optimum-value {
  background: var(--green);
  border-radius: 0;
}
.stat meter::-moz-meter-bar {
  background: var(--green);
}
.story {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}
.story-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--quiet);
  margin-bottom: 22px;
}
.story.decision .story-top > span:last-child {
  color: var(--stamp);
}
.story h2 {
  font-size: 25px;
  margin-bottom: 16px;
  scroll-margin-top: 24px;
}
.story-body {
  font-size: 14px;
  line-height: 1.85;
  margin-bottom: 22px;
}
.choices {
  display: grid;
  gap: 8px;
}
.choices button {
  display: grid;
  grid-template-columns: 20px 1fr 14px;
  gap: 10px;
  text-align: left;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  background: transparent;
  align-items: start;
}
.choices button:hover {
  border-color: var(--green);
  background: var(--sage);
}
.choice-number {
  font-size: 11px;
  color: var(--muted);
  padding-top: 1px;
}
.choices b {
  display: block;
  font-size: 14px;
  font-weight: 650;
}
.choices small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--quiet);
  margin-top: 4px;
}
.choices em {
  display: block;
  font-size: 10px;
  font-style: normal;
  color: var(--stamp);
  margin-top: 6px;
  font-weight: 450;
}
.choice-note {
  font-size: 10px;
  color: var(--quiet);
  margin: 16px 0 0;
}
.feedback {
  font-size: 12px;
  border-left: 2px solid var(--stamp);
  padding: 8px 12px;
  background: var(--paper);
}
.year-focus > p {
  font-size: 12px;
  margin: 0 0 10px;
}
.year-focus > div {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.year-focus button {
  min-height: 42px;
  padding: 8px 2px;
  font-size: 12px;
}
.year-focus button[aria-pressed="true"] {
  background: var(--sage);
  border-color: var(--green);
}
.year-focus > small {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  margin: 8px 0 18px;
}
.year-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.year-actions > button:last-child {
  font-size: 12px;
  padding: 8px 12px;
}
.year-actions .large span {
  font-size: 13px;
  font-weight: 450;
}
.auto-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.auto-row button {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 11px;
  color: var(--quiet);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auto-row span {
  font-size: 10px;
  color: var(--muted);
}
.projects {
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.projects summary {
  font-size: 12px;
}
.projects > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.projects button {
  font-size: 11px;
}
.projects p {
  font-size: 10px;
  margin: 8px 0 0;
}
.goal-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--quiet);
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.goal-line b {
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}
.year-map {
  padding: 20px 0;
}
.year-map > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.year-map h2 {
  font-size: 14px;
  letter-spacing: 0;
  margin: 0;
}
.year-map span {
  font-size: 11px;
  color: var(--quiet);
}
.year-squares {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  gap: 4px;
  margin: 12px 0;
}
.year-squares i {
  display: block;
  aspect-ratio: 1;
  background: #e2dfd3;
  border-radius: 1px;
}
.year-squares .lived {
  background: #829488;
}
.year-squares .moment.lived {
  background: var(--stamp);
}
.year-map > p {
  font-size: 10px;
  color: var(--quiet);
  margin: 8px 0 0;
}
.year-map b {
  color: #829488;
}
.year-map b.accent {
  color: var(--stamp);
}
.life-rail > details {
  border-top: 1px solid var(--line);
}
.life-rail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  list-style: none;
}
.life-rail summary:after {
  content: "+";
  font-size: 16px;
  order: 2;
}
.life-rail details[open] > summary:after {
  content: "−";
}
.life-rail summary > b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-left: auto;
}
.life-rail summary > span:last-child {
  font-size: 10px;
  color: var(--quiet);
  margin-left: auto;
}
.ledger-lines {
  margin: 12px 0;
}
.ledger-lines > div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 7px 0;
}
.ledger-lines dt {
  color: var(--quiet);
}
.ledger-lines dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger-lines .out {
  color: var(--warning);
}
.ledger-lines .total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 5px;
  font-weight: 650;
}
.ledger h3 {
  margin: 24px 0 0;
  font-size: 12px;
}
.unit-note {
  font-size: 10px;
  color: var(--quiet);
  line-height: 1.8;
}
.memories ol,
.ending-log ol {
  list-style: none;
  padding: 0;
  margin: 10px 0 16px;
  max-height: 430px;
  overflow-y: auto;
}
.memories li,
.ending-log li {
  display: flex;
  gap: 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  line-height: 1.7;
}
.memories time,
.ending-log time {
  color: var(--stamp);
  min-width: 34px;
  font-size: 11px;
}
.save-state {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.save-state p {
  font-size: 11px;
  color: var(--quiet);
  margin-bottom: 10px;
}
.save-state button {
  font-size: 11px;
  background: transparent;
}
.save-state small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  line-height: 1.8;
  margin-top: 14px;
}
.life-result {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 36px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.result-kicker {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--stamp);
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.life-result h1 {
  font-size: 36px;
  margin-bottom: 26px;
}
.result-origin {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.result-origin p {
  font-size: 13px;
  color: var(--quiet);
  margin: 0;
}
.result-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.result-facts dt {
  font-size: 11px;
  color: var(--quiet);
}
.result-facts dd {
  font-size: 17px;
  font-weight: 600;
  margin: 4px 0 0;
}
.result-line {
  font-size: 13px;
  line-height: 1.9;
  margin: 24px 0;
  color: var(--quiet);
}
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-actions button {
  font-size: 12px;
  flex: 1;
}
.result-actions .primary {
  flex: 1 0 100%;
}
.life-result #share-status {
  font-size: 12px;
  color: var(--green);
  margin: 12px 0;
}
.ending-log {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.ending-log summary {
  font-size: 12px;
}
.restart-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.restart-row button {
  font-size: 11px;
  background: transparent;
}
.copy-fallback {
  width: 100%;
  font-size: 12px;
  min-height: 90px;
}
.about-game {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin-top: 58px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-no {
  font-size: 11px;
  color: var(--stamp);
  font-variant-numeric: tabular-nums;
}
.about-game h2 {
  font-size: 17px;
  margin: 10px 0;
}
.about-game p {
  font-size: 12px;
  color: var(--quiet);
  margin: 0;
  line-height: 1.9;
}
.rules {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  padding: 38px 0;
}
.rules h2 {
  font-size: 20px;
  margin-bottom: 16px;
}
.rules p {
  font-size: 12px;
  color: var(--quiet);
  line-height: 1.9;
}
.rules details {
  border-bottom: 1px solid var(--line);
}
.rules summary {
  font-size: 12px;
}
.source-links {
  font-size: 12px;
  padding-left: 20px;
}
.source-links li {
  margin: 8px 0;
}
.ad-zone {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  text-align: center;
  min-height: 96px;
  margin: 12px 0 32px;
}
.ad-zone > small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.related {
  padding: 6px 0 24px;
}
.related h2 {
  font-size: 16px;
}
.related > a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 12px;
  text-decoration: none;
}
.related span {
  color: var(--quiet);
  font-size: 11px;
}
footer {
  max-width: 1100px;
  margin: auto;
  padding: 20px 24px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--quiet);
  font-size: 10px;
}
footer span {
  margin-left: auto;
}
.load-error {
  padding: 30px 0;
}
.load-error h1 {
  font-size: 25px;
}
.loading {
  color: var(--quiet);
  padding: 30px 0;
}
@media (max-width: 850px) {
  .welcome {
    gap: 28px;
  }
  .welcome .intro-line {
    font-size: 35px;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
  }
  .story {
    padding: 20px;
  }
  .stats {
    gap: 10px;
  }
  .birth-layout {
    gap: 28px;
  }
  .birth-paper {
    padding: 22px;
  }
  .settings-row {
    grid-template-columns: 1fr 1fr;
  }
  .settings-row > button {
    grid-column: 1/-1;
  }
  .saved-lives {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .site-header {
    padding: 14px 16px;
  }
  .site-header a {
    font-size: 11px;
  }
  main {
    padding: 20px 16px 0;
  }
  h1 {
    font-size: 28px;
  }
  .welcome {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: stretch;
    min-height: 0;
  }
  .welcome-copy {
    padding: 14px 4px 0;
  }
  .welcome .eyebrow {
    font-size: 11px;
    margin-bottom: 18px;
  }
  .welcome h1 {
    font-size: 14px;
  }
  .welcome .intro-line {
    font-size: 35px;
    letter-spacing: -1.5px;
    margin-bottom: 18px;
  }
  .welcome-copy .quiet {
    font-size: 13px;
    margin-bottom: 22px;
  }
  .welcome-copy .large {
    width: 100%;
    min-height: 54px;
  }
  .welcome-copy > small {
    font-size: 10px;
    margin-top: 12px;
  }
  .atlas-paper {
    transform: none;
    padding: 14px;
  }
  .atlas-paper canvas {
    max-height: 230px;
    object-fit: contain;
  }
  .atlas-caption,
  .atlas-foot {
    font-size: 10px;
  }
  .atlas-foot b {
    font-size: 11px;
  }
  .intro-bottom {
    margin-top: 22px;
  }
  .settings-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .saved-lives {
    grid-template-columns: 1fr;
  }
  .backup {
    align-items: start;
    gap: 10px;
  }
  .backup span {
    font-size: 10px;
    flex: 1;
    padding-top: 7px;
  }
  .birth-layout {
    display: block;
  }
  .birth-paper {
    padding: 18px 20px;
  }
  .birth-heading {
    padding: 20px 0 16px;
  }
  .birth-heading h1 {
    font-size: 32px;
  }
  .birth-heading p {
    font-size: 14px;
  }
  .birth-facts {
    gap: 16px;
    margin: 20px 0;
  }
  .birth-note {
    font-size: 10px;
    margin: 20px 0;
  }
  .birth-map {
    margin-top: 24px;
  }
  .birth-map canvas {
    max-height: 190px;
    width: 100%;
    object-fit: contain;
  }
  .source-snapshot {
    padding-top: 4px;
  }
  .identity {
    padding-bottom: 14px;
    margin-bottom: 18px;
    gap: 10px;
    align-items: start;
  }
  .identity > div:first-child {
    gap: 9px;
    align-items: start;
  }
  .identity .country-mark {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }
  .identity p {
    font-size: 10px;
    line-height: 1.6;
    max-width: 180px;
  }
  .identity h1 {
    font-size: 21px;
  }
  .identity h1 span {
    font-size: 20px;
    margin-left: 5px;
  }
  .identity-actions {
    flex-direction: column;
    gap: 3px;
    align-items: end;
    flex-shrink: 0;
    font-size: 10px;
  }
  .identity-actions button {
    font-size: 10px;
    min-height: 32px;
    padding: 3px 6px;
  }
  .play-layout {
    display: block;
  }
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .stat > div {
    font-size: 11px;
  }
  .stat b {
    font-size: 12px;
  }
  .stat meter {
    margin-top: 5px;
    height: 6px;
  }
  .story {
    padding: 18px 16px;
  }
  .story-top {
    font-size: 10px;
    margin-bottom: 18px;
    gap: 8px;
  }
  .story h2 {
    font-size: 22px;
    margin-bottom: 14px;
    scroll-margin-top: 16px;
  }
  .story-body {
    font-size: 13px;
    line-height: 1.85;
    margin-bottom: 18px;
  }
  .choices button {
    padding: 13px 10px;
    gap: 7px;
    grid-template-columns: 16px 1fr 12px;
  }
  .choices b {
    font-size: 13px;
  }
  .choices small {
    font-size: 11px;
  }
  .choices em {
    font-size: 10px;
  }
  .choice-note {
    font-size: 9px;
  }
  .year-focus > p {
    font-size: 11px;
  }
  .year-focus > div {
    gap: 4px;
  }
  .year-focus button {
    font-size: 11px;
    min-height: 44px;
  }
  .year-actions {
    grid-template-columns: 1fr;
  }
  .year-actions .large {
    font-size: 14px;
    min-height: 52px;
  }
  .year-actions > button:last-child {
    background: transparent;
    min-height: 40px;
  }
  .auto-row {
    gap: 8px;
    align-items: start;
  }
  .auto-row span {
    padding-top: 10px;
    font-size: 9px;
  }
  .auto-row button {
    font-size: 10px;
    flex-shrink: 0;
  }
  .projects button {
    font-size: 10px;
    padding: 10px 6px;
  }
  .projects p {
    font-size: 9px;
  }
  .goal-line {
    font-size: 10px;
    padding: 14px 0;
  }
  .year-map {
    padding: 18px 0;
  }
  .year-squares {
    gap: 3px;
  }
  .life-rail {
    margin-top: 14px;
  }
  .life-rail summary {
    font-size: 12px;
    min-height: 50px;
  }
  .save-state {
    padding: 12px 0;
  }
  .save-state small {
    font-size: 9px;
  }
  .life-result {
    padding: 22px 18px;
  }
  .life-result h1 {
    font-size: 28px;
  }
  .result-kicker {
    font-size: 10px;
    margin-bottom: 22px;
    padding-bottom: 14px;
  }
  .result-facts {
    gap: 18px 12px;
  }
  .result-facts dd {
    font-size: 15px;
  }
  .result-facts dt {
    font-size: 10px;
  }
  .result-line {
    font-size: 12px;
  }
  .result-actions button {
    font-size: 11px;
    padding: 10px 8px;
  }
  .restart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .restart-row button {
    font-size: 10px;
    padding: 8px;
  }
  .about-game {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 36px;
    padding: 24px 0;
  }
  .about-game h2 {
    font-size: 16px;
    margin: 6px 0;
  }
  .about-game p {
    font-size: 11px;
  }
  .rules {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 0;
  }
  .rules h2 {
    font-size: 19px;
  }
  .rules p {
    font-size: 11px;
  }
  .rules summary {
    font-size: 11px;
  }
  .related > a {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
  .related span {
    font-size: 10px;
  }
  footer {
    padding: 18px 16px 26px;
    gap: 14px;
  }
  footer span {
    width: 100%;
    margin: 0;
  }
  .unit-note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Keep age and place visible while a mobile story card is being read. */
@media (max-width: 680px) {
  .identity {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--paper);
    padding-top: 8px;
  }
  .story {
    scroll-margin-top: 96px;
  }
  .birth-paper,
  .life-result {
    scroll-margin-top: 16px;
  }
}

@media (max-width: 680px) {
  .stats {
    position: sticky;
    top: var(--identity-height, 74px);
    z-index: 4;
    background: var(--paper);
    padding: 8px 0 10px;
    margin-bottom: 10px;
  }
  .story {
    scroll-margin-top: calc(var(--identity-height, 74px) + 60px);
  }
}

.result-preview {
  display: inline-block;
  padding: 8px 0;
  font-size: 11px;
  color: var(--quiet);
}

.identity > div:first-child,
.identity > div:first-child > div {
  min-width: 0;
}
.identity h1,
.life-result h1,
.result-facts dd,
.ledger-lines dd {
  overflow-wrap: anywhere;
}

/* The calendar and ledger share the existing paper / passport palette. */
.life-length {
  border: 0;
  padding: 0;
  margin: 24px 0 20px;
}
.life-length legend {
  font-size: 12px;
  margin-bottom: 8px;
}
.life-length > div {
  display: flex;
  gap: 8px;
}
.life-length button {
  padding: 8px 16px;
  font-size: 13px;
}
.life-length button[aria-pressed="true"],
.time-buttons [data-speed][aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.life-length p {
  color: var(--quiet);
  font-size: 11px;
  margin: 8px 0 0;
}
.birth-time {
  font-size: 12px;
  color: var(--green);
}
.identity {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  padding-top: 8px;
}
.story {
  scroll-margin-top: calc(
    var(--identity-height, 74px) + var(--clock-height, 140px) +
      var(--stats-height, 50px) + 16px
  );
}
.stats {
  position: sticky;
  top: calc(var(--identity-height, 74px) + var(--clock-height, 140px));
  z-index: 4;
  background: var(--paper);
  padding: 8px 0 12px;
}
.time-controls {
  position: sticky;
  top: var(--identity-height, 74px);
  z-index: 4;
  background: var(--paper);
  border-block: 1px solid var(--line);
  padding: 14px 0 10px;
  margin-bottom: 20px;
}
.time-now {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.time-now > span {
  color: var(--quiet);
}
.time-now b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.year-progress {
  height: 5px;
  margin: 10px 0 12px;
  background: var(--line);
  overflow: hidden;
  border-radius: 2px;
}
.year-progress i {
  display: block;
  height: 100%;
  background: var(--green);
  transform-origin: left;
  will-change: transform;
}
.time-buttons,
.time-buttons > div {
  display: flex;
  gap: 6px;
}
.time-buttons {
  justify-content: space-between;
}
.time-buttons button {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 44px;
}
.time-buttons #pause {
  flex: 1;
  max-width: 110px;
}
.time-controls > p {
  margin: 8px 0 0;
  color: var(--quiet);
  font-size: 11px;
}
.money-overview {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 12px;
}
.money-overview > p {
  color: var(--quiet);
  font-size: 11px;
  margin-bottom: 8px;
}
.money-overview dl {
  margin: 0;
}
.money-overview dl > div {
  padding: 8px 0;
}
.money-overview dt {
  font-size: 11px;
  color: var(--quiet);
}
.money-overview dd {
  font-size: 20px;
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.money-overview > a,
.country-sources > a {
  font-size: 11px;
  color: var(--quiet);
  display: inline-block;
  padding: 6px 0;
}
.country-sources .ledger-lines dt {
  max-width: 60%;
}
.country-sources .ledger-lines a {
  text-decoration-color: var(--line);
}
.country-sources .ledger-lines dd {
  font-size: 12px;
}
.year-squares .current {
  border: 1px solid var(--green);
  background: linear-gradient(
    to right,
    var(--green) var(--year-fill, 0%),
    var(--sage) var(--year-fill, 0%)
  );
}
@media (max-width: 680px) {
  .time-controls {
    position: sticky;
    top: var(--identity-height, 74px);
    z-index: 4;
    background: var(--paper);
    padding: 10px 0 8px;
    margin-bottom: 12px;
  }
  .story {
    scroll-margin-top: calc(
      var(--identity-height, 74px) + var(--clock-height, 140px) +
        var(--stats-height, 50px) + 16px
    );
  }
  .time-now b {
    font-size: 16px;
  }
  .time-buttons {
    gap: 4px;
  }
  .time-buttons > div {
    gap: 3px;
  }
  .time-buttons button {
    padding: 6px 8px;
    font-size: 11px;
  }
  .time-buttons #pause {
    min-width: 52px;
    padding-inline: 4px;
  }
  .stats {
    position: sticky;
    top: calc(var(--identity-height, 74px) + var(--clock-height, 140px));
  }
  .money-overview {
    margin-bottom: 8px;
    padding-bottom: 12px;
  }
  .money-overview dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .money-overview dd {
    font-size: 17px;
  }
}

/* GIF pixels contain the movement; CSS never substitutes zooming for a walk cycle. */
.life-scene [data-motion-toggle] {
  min-height: 32px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
  white-space: nowrap;
}
.life-scene [data-motion-toggle]:hover {
  border-color: var(--line);
}
@media (max-width: 680px) {
  .life-scene [data-motion-toggle] {
    min-height: 44px;
    padding: 6px;
  }
  .scene-progress {
    margin-top: 0;
  }
}
.choice-receipt {
  margin: 0 0 24px;
  padding: 16px 18px;
  background: #edf0e7;
  border-left: 3px solid #527063;
  border-radius: 0 4px 4px 0;
  color: #263d49;
}
.choice-receipt > small {
  color: #527063;
  font-size: 12px;
  line-height: 1.6;
}
.choice-receipt:focus {
  outline: none;
}
.choice-receipt p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.choice-receipt ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.choice-receipt li {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The character and live notebook share the existing paper/ink palette. */
.character-settings {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-top: 16px;
}
.character-settings label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--quiet);
}
.character-settings select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  padding: 8px;
  font: inherit;
}
.character-note {
  font-size: 11px;
  color: var(--quiet);
  line-height: 1.7;
  margin: 8px 0 18px;
}
.personal-scene .scene-window {
  height: 204px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9e9df;
  border-bottom: 1px solid var(--line);
}
.personal-scene .scene-window img {
  width: auto;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.birth-map .personal-scene .scene-window {
  height: 224px;
}
.live-life-log {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 16px 0 24px;
}
.live-life-log summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 0;
  font-size: 12px;
  list-style: none;
}
.live-life-log summary::-webkit-details-marker {
  display: none;
}
.live-life-log summary > span:first-child {
  color: var(--green);
  font-weight: 700;
}
.live-life-log summary > span:first-child:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--green);
}
#live-log-summary {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.live-life-log[open] summary {
  border-bottom: 1px solid var(--line);
}
#live-log-state {
  font-size: 11px;
  color: var(--quiet);
  margin: 12px 0;
}
#live-log-entries {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 14px;
}
#live-log-entries li {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  font-size: 12px;
  line-height: 1.75;
}
#live-log-entries time {
  font-size: 11px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
#live-log-entries .recorded time {
  color: var(--stamp);
}
.personal-projects {
  margin: 24px 0;
  border: 1px solid var(--line);
  padding: 0 20px;
  border-radius: 3px;
  background: var(--sheet);
}
.personal-projects > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  min-height: 56px;
  font-size: 13px;
  list-style: none;
}
.personal-projects > summary::-webkit-details-marker {
  display: none;
}
.personal-projects > summary b {
  color: var(--green);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.personal-projects p {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.8;
}
.project-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.project-options button {
  display: grid;
  text-align: left;
  gap: 5px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.project-options b {
  font-size: 13px;
}
.project-options span,
.project-options small {
  font-size: 11px;
  color: var(--quiet);
  line-height: 1.6;
}
.project-options button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.active-project > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.active-project h3 {
  font-size: 15px;
  font-weight: 600;
}
.active-project b {
  font-size: 12px;
  color: var(--green);
}
.active-project progress {
  width: 100%;
  height: 6px;
  accent-color: var(--green);
}
.project-book {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 10px;
}
.project-book li {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.7;
}
.project-book span {
  color: var(--green);
}
.project-book time {
  margin-left: auto;
  color: var(--quiet);
  font-size: 11px;
}
@media (max-width: 680px) {
  .personal-scene .scene-window {
    height: 160px;
  }
  .birth-map .personal-scene .scene-window {
    height: 180px;
  }
  .live-life-log summary,
  #live-log-entries li {
    grid-template-columns: 76px 1fr;
    gap: 8px;
  }
  .personal-projects {
    padding-inline: 14px;
  }
}

.live-life-log summary > span:first-child {
  white-space: nowrap;
}
@media (max-width: 680px) {
  .live-life-log summary,
  #live-log-entries li {
    grid-template-columns: 88px 1fr;
  }
  .live-life-log summary > span:first-child {
    font-size: 11px;
  }
}

.story .live-life-log {
  margin: 12px 0 16px;
}
.story .live-life-log summary {
  min-height: 48px;
  padding-block: 6px;
}
