:root {
  --ink: #2c211a;
  --ink-soft: #5c4938;
  --paper: #f7edcf;
  --paper-deep: #edd8a4;
  --cream: #fff8df;
  --pine: #254838;
  --pine-2: #35624a;
  --leaf: #6f8b45;
  --star: #f5c94b;
  --star-deep: #d99c2b;
  --river: #4d9297;
  --river-light: #83c7c2;
  --berry: #b64d3c;
  --clay: #b96845;
  --night: #18313a;
  --line: rgba(44, 33, 26, 0.2);
  --shadow: 0 8px 0 rgba(44, 33, 26, 0.14);
  --shadow-lg: 0 16px 0 rgba(44, 33, 26, 0.16), 0 28px 56px rgba(44, 33, 26, 0.13);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --content: min(1240px, calc(100vw - 48px));
  --display: "Cabinet Grotesk", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 201, 75, 0.18), transparent 30rem),
    radial-gradient(circle at 90% 22%, rgba(77, 146, 151, 0.15), transparent 28rem),
    var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

body.dialog-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

code,
kbd {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

code {
  padding: 0.12rem 0.42rem;
  color: #fff5d3;
  background: var(--pine);
  border-radius: 4px;
  white-space: nowrap;
}

::selection {
  color: var(--ink);
  background: var(--star);
}

:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.grain {
  position: fixed;
  z-index: 999;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(1280px, calc(100vw - 36px));
  min-height: 68px;
  padding: 8px 10px 8px 14px;
  border: 2px solid rgba(255, 248, 223, 0.48);
  border-bottom-color: rgba(44, 33, 26, 0.38);
  border-radius: 18px;
  background: rgba(37, 72, 56, 0.94);
  box-shadow: 0 8px 0 rgba(44, 33, 26, 0.18), 0 20px 44px rgba(44, 33, 26, 0.14);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  line-height: 1.05;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--pine);
  background: var(--star);
  border: 2px solid var(--cream);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 900;
  clip-path: polygon(50% 0, 62% 29%, 94% 25%, 70% 48%, 80% 82%, 50% 64%, 20% 82%, 30% 48%, 6% 25%, 38% 29%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 4px;
  color: rgba(255, 248, 223, 0.68);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 32px);
}

.desktop-nav a {
  position: relative;
  padding: 10px 0;
  color: rgba(255, 248, 223, 0.82);
  font-size: 14px;
  text-decoration: none;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 2px;
  background: var(--star);
  content: "";
  transform: scaleX(0);
  transition: transform 220ms ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--cream);
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
  transform: scaleX(1);
}

.search-trigger,
.menu-trigger {
  border: 0;
  cursor: pointer;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px 8px 13px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 10px;
  box-shadow: inset 0 -3px 0 var(--paper-deep);
}

.search-trigger > span:first-child {
  font-size: 22px;
  line-height: 1;
}

.search-trigger kbd {
  padding: 3px 7px;
  color: var(--ink-soft);
  background: rgba(44, 33, 26, 0.08);
  border: 1px solid rgba(44, 33, 26, 0.18);
  border-radius: 5px;
  font-size: 11px;
}

.menu-trigger {
  display: none;
  width: 46px;
  height: 46px;
  padding: 11px;
  background: transparent;
}

.menu-trigger > span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--cream);
}

.mobile-menu {
  position: fixed;
  z-index: 99;
  top: 94px;
  right: 18px;
  left: 18px;
  padding: 14px;
  color: var(--cream);
  background: var(--pine);
  border: 2px solid rgba(255, 248, 223, 0.4);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.mobile-menu a {
  display: block;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.section-shell {
  width: var(--content);
  margin-inline: auto;
  padding-block: clamp(110px, 14vw, 188px);
}

.section-heading {
  max-width: 920px;
  margin-bottom: 58px;
}

.section-heading.compact {
  margin-bottom: 34px;
}

.section-heading h2,
.story-pin h2,
.closing-cta h2,
.search-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.3rem, 4.4vw, 4.8rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.section-heading p:not(.kicker),
.story-pin > p:not(.kicker) {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.16rem);
}

.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: end;
  gap: 54px;
  max-width: none;
}

.kicker {
  margin: 0 0 14px;
  color: var(--berry);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  align-items: center;
  gap: clamp(42px, 6vw, 100px);
  width: min(1400px, calc(100vw - 48px));
  min-height: 920px;
  margin: 0 auto;
  padding: 142px 26px 80px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 108px;
  right: -12vw;
  width: 52vw;
  height: 52vw;
  max-width: 760px;
  max-height: 760px;
  background: radial-gradient(circle, rgba(245, 201, 75, 0.24), transparent 68%);
  content: "";
}

.hero-copy {
  max-width: 680px;
}

.hero h1 {
  max-width: 960px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.9rem, 4.1vw, 4.6rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 630px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 22px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.button-primary {
  color: var(--cream);
  background: var(--pine);
}

.button-secondary {
  color: var(--ink);
  background: var(--cream);
}

.button-light {
  color: var(--pine);
  background: var(--cream);
}

.hero-note {
  margin-top: 24px;
  color: rgba(44, 33, 26, 0.62);
  font-size: 13px;
}

.hero-scene {
  position: relative;
  min-width: 0;
}

.hero-scene svg {
  display: block;
  width: 100%;
  filter: drop-shadow(0 24px 24px rgba(44, 33, 26, 0.2));
}

.scene-sky { fill: url("#sky"); stroke: var(--ink); stroke-width: 5px; }
.scene-sun { fill: var(--star); stroke: #d99c2b; stroke-width: 5px; }
.cloud rect { fill: rgba(255, 248, 223, 0.84); stroke: var(--ink); stroke-width: 4px; }
.hill-back { fill: #6d8a59; }
.hill-front { fill: #416f4c; stroke: var(--ink); stroke-width: 5px; }
.scene-river { fill: url("#river"); stroke: var(--ink); stroke-width: 5px; }
.farm-fields path:not(.field-line) { fill: #c9864e; stroke: var(--ink); stroke-width: 4px; }
.farm-fields .field-line { fill: none; stroke: #8b5539; stroke-width: 5px; }
.mill-body { fill: #f0d69a; stroke: var(--ink); stroke-width: 5px; }
.mill-door { fill: #8b5539; }
.mill-hub { fill: var(--star); stroke: var(--ink); stroke-width: 5px; }
.mill-blade { fill: #fff3ce; stroke: var(--ink); stroke-width: 4px; }
.town-houses .roof { fill: var(--berry); stroke: var(--ink); stroke-width: 5px; }
.town-houses .roof.alt { fill: #4f6d86; }
.town-houses .house { fill: #f4d995; stroke: var(--ink); stroke-width: 5px; }
.town-houses .house.alt { fill: #d9c38b; }
.town-houses .door { fill: #765038; }
.dock path:first-child { fill: #9b673e; stroke: var(--ink); stroke-width: 4px; }
.dock path:nth-child(2), .dock path:nth-child(3) { fill: #704a32; }
.dock .boat { fill: #c65b46; stroke: var(--ink); stroke-width: 4px; }
.starfruit-tree .trunk { fill: #805439; stroke: var(--ink); stroke-width: 4px; }
.starfruit-tree .canopy { fill: #4f7b48; stroke: var(--ink); stroke-width: 5px; }
.starfruit-tree .starfruit { fill: var(--star); stroke: var(--ink); stroke-width: 3px; }

.scene-caption {
  position: absolute;
  right: 6%;
  bottom: 3%;
  left: 6%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  color: var(--cream);
  background: rgba(24, 49, 58, 0.86);
  border: 2px solid rgba(255, 248, 223, 0.55);
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.route-finder {
  padding-top: 48px;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-tabs button,
.filter-button,
.track-switcher button {
  min-height: 46px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.route-tabs button:hover,
.filter-button:hover,
.track-switcher button:hover {
  transform: translateY(-2px);
}

.route-tabs button[aria-selected="true"],
.filter-button.is-active,
.track-switcher button[aria-selected="true"] {
  color: var(--cream);
  background: var(--pine);
}

.route-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 34px;
  margin-top: 18px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.route-panel h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.route-panel p {
  margin: 0;
  color: var(--ink-soft);
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 9px 13px;
  color: var(--cream);
  background: var(--pine);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "Cascadia Mono", Consolas, monospace;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.command-chip:hover {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.command-chip small {
  color: rgba(255, 248, 223, 0.65);
  font-family: var(--body);
  font-size: 10px;
}

.command-large {
  min-width: 180px;
  min-height: 58px;
  padding: 12px 18px;
  font-size: 18px;
}

.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tutorial-step {
  position: relative;
  grid-column: span 4;
  min-height: 276px;
  padding: 28px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tutorial-step:nth-child(1),
.tutorial-step:nth-child(6) {
  color: var(--cream);
  background: var(--pine);
}

.tutorial-step:nth-child(2),
.tutorial-step:nth-child(5) {
  background: #e8d78b;
}

.tutorial-step:nth-child(3) {
  background: #d8e2bd;
}

.tutorial-step:nth-child(4) {
  background: #b7d9d2;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 26px;
  border: 2px solid currentColor;
  border-radius: 5px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
}

.tutorial-step h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.2;
}

.tutorial-step p {
  margin: 0 0 18px;
  color: inherit;
  opacity: 0.8;
}

.step-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-commands button {
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid currentColor;
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
}

.starter-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 18px;
  padding: 24px 28px;
  color: var(--cream);
  background: var(--night);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.starter-callout strong {
  font-family: var(--display);
  font-size: 22px;
}

.starter-callout p {
  margin: 4px 0 0;
  color: rgba(255, 248, 223, 0.72);
}

.story-section {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(56px, 9vw, 140px);
  width: var(--content);
  margin: 0 auto;
  padding-block: clamp(120px, 16vw, 220px);
}

.story-pin {
  align-self: start;
  padding-top: 30px;
}

.day-meter {
  width: 100%;
  height: 12px;
  margin-top: 34px;
  padding: 2px;
  background: rgba(44, 33, 26, 0.12);
  border: 2px solid var(--ink);
  border-radius: 4px;
}

.day-meter span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--star);
  transform: scaleX(0.08);
  transform-origin: left center;
}

.story-cards {
  display: grid;
  gap: 34px;
}

.day-card {
  position: sticky;
  top: 130px;
  min-height: 360px;
  padding: clamp(28px, 5vw, 58px);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.day-card:nth-child(1) { background: #f0d98e; transform: rotate(-0.6deg); }
.day-card:nth-child(2) { background: #d8e2bd; transform: rotate(0.5deg); }
.day-card:nth-child(3) { background: #b8dcd5; transform: rotate(-0.4deg); }
.day-card:nth-child(4) { color: var(--cream); background: #426a55; transform: rotate(0.4deg); }
.day-card:nth-child(5) { color: var(--cream); background: #253f48; transform: rotate(-0.3deg); }

.day-time {
  display: inline-block;
  margin-bottom: 50px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.day-card h3 {
  max-width: 560px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.day-card p {
  max-width: 620px;
  margin: 22px 0;
  opacity: 0.82;
  font-size: 17px;
}

.day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
}

.species-card {
  position: relative;
  min-height: 255px;
  padding: 22px;
  background: rgba(255, 248, 223, 0.76);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 300ms ease, background 300ms ease;
}

.species-card:hover {
  z-index: 2;
  background: var(--cream);
  transform: translateY(-6px) rotate(0.4deg);
}

.species-card[hidden] {
  display: none;
}

.species-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  color: var(--cream);
  background: var(--pine);
  border: 2px solid var(--ink);
  border-radius: 6px 16px 6px 16px;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 900;
}

.species-card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 21px;
}

.species-stamina {
  color: var(--berry);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.species-card p {
  display: -webkit-box;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.guide-details {
  margin-top: 18px;
  background: rgba(255, 248, 223, 0.64);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

.guide-details summary {
  min-height: 58px;
  padding: 15px 22px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.profession-grid,
.lifestyle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 22px;
}

.profession-card,
.lifestyle-card {
  padding: 18px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.profession-card h4,
.lifestyle-card h4 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 18px;
}

.profession-card p,
.lifestyle-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.map-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(150px, auto));
  grid-auto-flow: dense;
  gap: 12px;
}

.location-card {
  position: relative;
  grid-column: span 3;
  grid-row: span 2;
  min-width: 0;
  padding: 24px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.location-card:first-child {
  grid-column: span 6;
  grid-row: span 4;
  color: var(--cream);
  background:
    linear-gradient(rgba(24, 49, 58, 0.12), rgba(24, 49, 58, 0.64)),
    radial-gradient(circle at 72% 22%, var(--star) 0 9%, transparent 9.5%),
    linear-gradient(145deg, var(--river-light), var(--pine));
}

.location-card:nth-child(3n + 2) { background: #e9d891; }
.location-card:nth-child(3n + 3) { background: #b9d9d2; }

.location-card:hover {
  z-index: 2;
  transform: scale(1.025);
}

.location-card h3 {
  max-width: 360px;
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.5vw, 2.5rem);
  line-height: 1.05;
}

.location-card p {
  margin: 0 0 18px;
  opacity: 0.8;
  font-size: 14px;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.location-actions button {
  min-height: 36px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  cursor: pointer;
}

.npc-strip {
  max-width: 100%;
  margin-top: 22px;
  padding-block: 14px;
  overflow: hidden;
  overflow: clip;
  contain: inline-size paint;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.npc-track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: npc-marquee 38s linear infinite;
}

.npc-set {
  display: flex;
  gap: 12px;
}

.npc-strip:hover .npc-track,
.npc-strip:focus-within .npc-track {
  animation-play-state: paused;
}

.npc-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 14px 8px 8px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  white-space: nowrap;
}

.npc-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--cream);
  background: var(--clay);
  border-radius: 4px;
  font-weight: 900;
}

@keyframes npc-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.track-switcher {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.track-switcher button {
  flex: 0 0 auto;
}

.track-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.track-stage {
  position: relative;
  min-height: 300px;
  padding: 26px;
  background: var(--cream);
  border-right: 2px solid var(--ink);
}

.track-stage:last-child {
  border-right: 0;
}

.track-stage:nth-child(2) { background: #e9d992; }
.track-stage:nth-child(3) { background: #b8d9d2; }
.track-stage:nth-child(4) { color: var(--cream); background: var(--pine); }

.stage-points {
  display: block;
  margin-bottom: 38px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
}

.track-stage h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
}

.track-stage p {
  margin: 0 0 20px;
  opacity: 0.78;
  font-size: 14px;
}

.life-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 72px;
}

.life-card {
  min-height: 430px;
  padding: clamp(28px, 5vw, 54px);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.fishing-card {
  color: var(--cream);
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 201, 75, 0.8) 0 7%, transparent 7.5%),
    linear-gradient(145deg, #5b9da0, #294e59);
}

.farming-card {
  background:
    repeating-linear-gradient(100deg, rgba(121, 82, 48, 0.14) 0 8px, transparent 8px 30px),
    #e9d08a;
}

.life-card h3 {
  max-width: 520px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.05;
}

.life-card > p {
  max-width: 620px;
  margin: 22px 0 32px;
  opacity: 0.82;
}

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

.life-fact {
  padding: 12px;
  background: rgba(255, 248, 223, 0.78);
  border: 1px solid currentColor;
  border-radius: 7px;
  color: var(--ink);
  font-size: 13px;
}

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

.goal-card {
  display: flex;
  flex-direction: column;
  min-height: 390px;
  padding: 26px;
  background: rgba(255, 248, 223, 0.78);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 360ms ease, background 360ms ease;
}

.goal-card:hover {
  background: var(--cream);
  transform: translateY(-6px);
}

.goal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 30px;
  color: var(--cream);
  background: var(--pine);
  border: 2px solid var(--ink);
  border-radius: 6px 16px 6px 16px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.goal-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 23px;
}

.goal-card > p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

.goal-check {
  margin: 0 0 22px;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

.goal-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.goal-commands button {
  min-height: 36px;
  padding: 6px 10px;
  color: var(--cream);
  background: var(--pine);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  cursor: pointer;
}

.system-accordions {
  display: flex;
  min-height: 560px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.system-panel {
  position: relative;
  flex: 1;
  min-width: 76px;
  padding: 26px;
  color: var(--cream);
  background: var(--pine);
  border: 0;
  border-right: 2px solid var(--ink);
  text-align: left;
  overflow: hidden;
  transition: flex 600ms cubic-bezier(0.22, 1, 0.36, 1), background 400ms ease;
}

.system-toggle {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.system-panel:nth-child(2) { background: #365d55; }
.system-panel:nth-child(3) { background: #4b6f59; }
.system-panel:nth-child(4) { background: #85643d; }
.system-panel:nth-child(5) { background: #8f4c3d; border-right: 0; }

.system-panel.is-active,
.system-panel:hover,
.system-panel:focus-within {
  flex: 4;
}

.system-panel > h3 {
  margin: 0;
}

.system-title {
  display: block;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 3.2rem);
  line-height: 1.1;
  writing-mode: vertical-rl;
  transition: writing-mode 0s 300ms;
}

.system-panel.is-active .system-title,
.system-panel:hover .system-title,
.system-toggle:focus-visible .system-title {
  writing-mode: horizontal-tb;
}

.system-content {
  width: min(460px, calc(100vw - 180px));
  margin-top: 38px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 280ms ease 160ms, transform 280ms ease 160ms;
}

.system-panel.is-active .system-content,
.system-panel:hover .system-content,
.system-panel:focus-within .system-content {
  opacity: 1;
  transform: translateY(0);
}

.system-content p {
  margin: 0 0 20px;
  color: rgba(255, 248, 223, 0.78);
}

.encyclopedia-shell {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.encyclopedia-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: #dbe5c4;
  border-bottom: 2px solid var(--ink);
}

.encyclopedia-search {
  min-width: 0;
  box-shadow: none;
}

.encyclopedia-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.encyclopedia-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 22px;
  background: var(--paper-deep);
  border-bottom: 2px solid var(--ink);
}

.encyclopedia-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.encyclopedia-tabs button:hover,
.encyclopedia-tabs button[aria-selected="true"] {
  color: var(--cream);
  background: var(--pine);
}

.encyclopedia-tabs small {
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 22px;
  padding-inline: 4px;
  color: inherit;
  background: rgba(255, 248, 223, 0.2);
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.encyclopedia-panel {
  min-width: 0;
  min-height: 440px;
  padding: clamp(18px, 3vw, 34px);
  outline-offset: -5px;
}

.encyclopedia-note {
  margin: 0 0 20px;
  padding: 13px 15px;
  color: var(--ink-soft);
  background: #f3df9e;
  border: 1px solid var(--ink);
  border-left-width: 5px;
  border-radius: 6px;
  font-size: 13px;
}

.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.encyclopedia-card {
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  padding: 20px;
  background: rgba(255, 248, 223, 0.78);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.encyclopedia-card:hover,
.encyclopedia-card:focus,
.encyclopedia-card.is-targeted {
  background: #fffaf0;
  box-shadow: 5px 5px 0 rgba(44, 33, 26, 0.16);
  transform: translateY(-3px);
}

.encyclopedia-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(44, 33, 26, 0.25);
}

.encyclopedia-kind {
  display: block;
  margin-bottom: 6px;
  color: var(--clay);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.encyclopedia-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
}

.encyclopedia-card header code {
  max-width: 150px;
  padding: 4px 6px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-radius: 4px;
  overflow-wrap: anywhere;
  font-size: 10px;
  text-align: right;
}

.encyclopedia-card dl {
  display: grid;
  gap: 0;
  margin: 10px 0 18px;
}

.encyclopedia-card dl > div {
  display: grid;
  grid-template-columns: minmax(76px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(44, 33, 26, 0.18);
}

.encyclopedia-card dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.encyclopedia-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.encyclopedia-card > footer {
  margin-top: auto;
}

.encyclopedia-card > footer button {
  max-width: 100%;
  min-height: 38px;
  overflow-wrap: anywhere;
  text-align: left;
}

.encyclopedia-empty {
  padding: 52px 24px;
  color: var(--ink-soft);
  border: 2px dashed var(--ink-soft);
  border-radius: var(--radius);
  text-align: center;
}

.help-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.inline-search,
.global-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 15px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 3px 3px 0 rgba(44, 33, 26, 0.14);
}

.inline-search input,
.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.inline-search > span:last-child,
.global-search > span {
  font-size: 24px;
}

.help-stats {
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 250px;
  min-height: 640px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.help-topic-list {
  padding: 14px;
  border-right: 2px solid var(--ink);
  background: var(--paper-deep);
  overflow-y: auto;
}

.help-topic-list button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.help-topic-list button:hover,
.help-topic-list button[aria-selected="true"] {
  color: var(--cream);
  background: var(--pine);
}

.help-reader {
  padding: clamp(26px, 4vw, 48px);
  overflow-y: auto;
}

.help-reader h3 {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.15;
}

.help-reader p {
  margin: 0 0 15px;
  color: var(--ink-soft);
  white-space: pre-line;
}

.help-reader .help-command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.command-index {
  padding: 24px;
  border-left: 2px solid var(--ink);
  background: #dbe5c4;
  overflow-y: auto;
}

.command-index h3 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 20px;
}

.command-index [data-command-index] {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.command-index button {
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  cursor: pointer;
}

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

.trouble-item {
  padding: 24px;
  background: rgba(255, 248, 223, 0.72);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

.trouble-item summary {
  min-height: 42px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.trouble-item p {
  color: var(--ink-soft);
}

.trouble-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.closing-cta {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: center;
  gap: 44px;
  width: min(1320px, calc(100vw - 32px));
  margin-bottom: 80px;
  padding: clamp(38px, 6vw, 72px);
  color: var(--cream);
  background: var(--pine);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.closing-cta h2 {
  max-width: 760px;
  font-size: clamp(2.4rem, 4.5vw, 5rem);
}

.closing-cta p:not(.kicker) {
  max-width: 720px;
  margin: 20px 0 0;
  color: rgba(255, 248, 223, 0.74);
}

.closing-illustration {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  background: #3b6650;
  border: 3px solid var(--cream);
  border-radius: 12px 34px 12px 34px;
  transform: rotate(-3deg);
}

.pixel-starfruit {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  color: var(--pine);
  background: var(--star);
  font-family: var(--display);
  font-size: 38px;
  font-weight: 900;
  clip-path: polygon(50% 0, 62% 29%, 94% 25%, 70% 48%, 80% 82%, 50% 64%, 20% 82%, 30% 48%, 6% 25%, 38% 29%);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 42px max(24px, calc((100vw - 1240px) / 2));
  color: rgba(255, 248, 223, 0.82);
  background: var(--night);
  border-top: 3px solid var(--ink);
}

.site-footer strong {
  color: var(--cream);
  font-family: var(--display);
  font-size: 20px;
}

.site-footer p {
  margin: 5px 0 0;
  font-size: 12px;
}

.site-footer a {
  color: var(--cream);
}

.build-meta {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  text-align: right;
}

.mobile-dock {
  display: none;
}

.search-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
}

.search-dialog::backdrop {
  background: rgba(24, 49, 58, 0.76);
  backdrop-filter: blur(8px);
}

.search-shell {
  padding: clamp(24px, 5vw, 52px);
}

.search-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.search-head h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
  font-size: 30px;
  cursor: pointer;
}

.global-search {
  min-height: 68px;
}

.global-search input {
  font-size: 18px;
}

.search-hint {
  margin: 12px 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 10px;
  max-height: 390px;
  overflow-y: auto;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  color: var(--ink);
  background: var(--cream);
  text-align: left;
  cursor: pointer;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 4px;
  color: var(--ink-soft);
}

.search-result code {
  white-space: nowrap;
}

.empty-search {
  padding: 30px;
  border: 2px dashed var(--ink-soft);
  border-radius: 10px;
  color: var(--ink-soft);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 1200;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 17px;
  color: var(--cream);
  background: var(--ink);
  border: 2px solid var(--cream);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .desktop-nav {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr auto auto;
  }

  .menu-trigger {
    display: block;
  }

  .hero {
    grid-template-columns: 1fr 0.92fr;
    gap: 30px;
  }

  .species-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .location-card:first-child {
    grid-column: span 3;
    grid-row: span 2;
  }

  .location-card {
    grid-column: span 3;
  }

  .help-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .command-index {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --content: min(100% - 28px, 720px);
  }

  body {
    padding-bottom: 72px;
  }

  .site-header {
    top: 10px;
    width: calc(100vw - 20px);
    min-height: 60px;
    border-radius: 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .search-trigger {
    width: 46px;
    padding: 8px;
    justify-content: center;
  }

  .search-trigger > span:nth-child(2),
  .search-trigger kbd {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    width: var(--content);
    min-height: 0;
    padding: 128px 0 72px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero h1 {
    max-width: 12ch;
    font-size: clamp(3rem, 13vw, 5.6rem);
  }

  .hero-scene {
    margin-top: 10px;
  }

  .section-shell,
  .story-section {
    padding-block: 100px;
  }

  .split-heading {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .route-panel {
    grid-template-columns: 1fr;
  }

  .tutorial-steps {
    grid-template-columns: 1fr;
  }

  .tutorial-step {
    grid-column: auto;
    min-height: 230px;
  }

  .story-section {
    display: block;
  }

  .story-pin {
    margin-bottom: 48px;
  }

  .day-card {
    top: 92px;
  }

  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profession-grid,
  .lifestyle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .map-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }

  .location-card,
  .location-card:first-child {
    grid-column: auto;
    grid-row: auto;
    min-height: 290px;
  }

  .track-timeline {
    grid-template-columns: 1fr 1fr;
  }

  .track-stage:nth-child(2) {
    border-right: 0;
  }

  .track-stage:nth-child(-n + 2) {
    border-bottom: 2px solid var(--ink);
  }

  .life-duo,
  .goal-grid {
    grid-template-columns: 1fr;
  }

  .system-accordions {
    display: grid;
    min-height: 0;
  }

  .system-panel {
    min-height: 84px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .system-panel:last-child {
    border-bottom: 0;
  }

  .system-title,
  .system-panel.is-active .system-title,
  .system-panel:hover .system-title,
  .system-toggle:focus-visible h3 {
    writing-mode: horizontal-tb;
  }

  .system-panel.is-active,
  .system-panel:hover,
  .system-panel:focus-within {
    min-height: 300px;
  }

  .system-content {
    width: 100%;
  }

  .encyclopedia-toolbar {
    grid-template-columns: 1fr;
  }

  .encyclopedia-status {
    white-space: normal;
  }

  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-topic-list {
    display: flex;
    gap: 7px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
    overflow-x: auto;
  }

  .help-topic-list button {
    flex: 0 0 auto;
    width: auto;
  }

  .help-reader {
    min-height: 440px;
  }

  .trouble-list {
    grid-template-columns: 1fr;
  }

  .closing-cta {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .closing-cta .command-large {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .closing-illustration {
    width: 100px;
    height: 100px;
  }

  .pixel-starfruit {
    width: 66px;
    height: 66px;
    font-size: 26px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding-bottom: 94px;
    text-align: left;
  }

  .build-meta {
    text-align: left;
  }

  .mobile-dock {
    position: fixed;
    z-index: 110;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 60px;
    padding: 5px;
    color: var(--cream);
    background: rgba(37, 72, 56, 0.96);
    border: 2px solid rgba(255, 248, 223, 0.5);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
  }

  .mobile-dock a,
  .mobile-dock button {
    display: grid;
    place-items: center;
    gap: 0;
    min-height: 46px;
    color: var(--cream);
    background: transparent;
    border: 0;
    text-decoration: none;
  }

  .mobile-dock span {
    font-size: 19px;
    line-height: 1;
  }

  .mobile-dock small {
    font-size: 10px;
  }

  .toast {
    right: 16px;
    bottom: 84px;
  }
}

@media (max-width: 540px) {
  .hero h1 {
    font-size: clamp(2.65rem, 13vw, 4.2rem);
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .hero-scene svg {
    margin-inline: -8px;
    width: calc(100% + 16px);
  }

  .scene-caption {
    font-size: 9px;
  }

  .starter-callout {
    display: grid;
  }

  .species-grid,
  .profession-grid,
  .lifestyle-grid,
  .map-bento,
  .track-timeline,
  .life-facts {
    grid-template-columns: 1fr;
  }

  .species-card {
    min-height: 215px;
  }

  .location-card,
  .location-card:first-child {
    min-height: 250px;
  }

  .track-stage {
    min-height: 240px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .track-stage:nth-child(2) {
    border-bottom: 2px solid var(--ink);
  }

  .track-stage:last-child {
    border-bottom: 0;
  }

  .help-toolbar {
    grid-template-columns: 1fr;
  }

  .help-stats {
    white-space: normal;
  }

  .encyclopedia-toolbar,
  .encyclopedia-tabs {
    padding-inline: 14px;
  }

  .encyclopedia-panel {
    padding: 14px;
  }

  .encyclopedia-card > header,
  .encyclopedia-card dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .encyclopedia-card header code {
    max-width: 100%;
    text-align: left;
  }

  .closing-cta {
    grid-template-columns: 1fr;
  }

  .closing-illustration {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .npc-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }

  .npc-set[aria-hidden="true"] {
    display: none;
  }

  .day-card {
    position: relative;
    top: auto;
  }
}

@media print {
  .site-header,
  .mobile-dock,
  .search-dialog,
  .toast,
  .grain,
  .hero-scene,
  .hero-actions,
  .npc-strip {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .hero,
  .section-shell,
  .story-section {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 24px 0;
  }

  .day-card,
  .tutorial-step,
  .location-card,
  .goal-card,
  .life-card,
  .track-stage,
  .encyclopedia-card,
  .help-layout,
  .trouble-item {
    break-inside: avoid;
    color: #000;
    background: #fff;
    box-shadow: none;
  }
}

/* Paginated manual layout -------------------------------------------------- */

[data-guide-page][hidden] {
  display: none !important;
}

body.menu-open {
  overflow: hidden;
}

.manual-topbar {
  position: fixed;
  z-index: 120;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 9px max(22px, calc((100vw - 1440px) / 2 + 24px));
  color: var(--cream);
  background: rgba(37, 72, 56, 0.97);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 5px 0 rgba(44, 33, 26, 0.13);
  backdrop-filter: blur(14px);
}

.manual-topbar .brand {
  min-width: max-content;
}

.manual-topbar .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 19px;
}

.manual-topbar .brand strong {
  font-family: var(--display);
  font-size: 17px;
}

.manual-topbar .brand small {
  margin-top: 3px;
  color: rgba(255, 248, 223, 0.68);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-topbar .search-trigger {
  min-height: 42px;
  padding-block: 7px;
}

.manual-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 32px;
  width: min(1440px, calc(100vw - 44px));
  margin-inline: auto;
  padding-top: 92px;
}

.chapter-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 108px);
  padding: 18px;
  background: rgba(255, 248, 223, 0.8);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(44, 33, 26, 0.12);
  overflow-y: auto;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
}

.sidebar-heading span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  color: var(--cream);
  background: var(--pine);
  border-radius: 5px;
  font-size: 11px;
}

.chapter-nav {
  display: grid;
  gap: 3px;
  margin-top: 9px;
}

.chapter-nav a {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  padding: 7px 8px;
  border-radius: 7px;
  text-decoration: none;
}

.chapter-nav a span {
  color: var(--ink-soft);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.chapter-nav a strong {
  font-size: 13px;
}

.chapter-nav a:hover,
.chapter-nav a[aria-current="page"] {
  color: var(--cream);
  background: var(--pine);
}

.chapter-nav a:hover span,
.chapter-nav a[aria-current="page"] span {
  color: rgba(255, 248, 223, 0.66);
}

.sidebar-commands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.sidebar-commands strong {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-size: 11px;
}

.sidebar-commands button {
  min-width: 0;
  min-height: 34px;
  padding: 5px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  cursor: pointer;
}

.manual-main {
  min-width: 0;
}

.chapter-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  margin-bottom: 30px;
  padding: 4px 2px 18px;
  border-bottom: 3px solid var(--ink);
  outline: none;
}

.chapter-position {
  display: block;
  margin-bottom: 4px;
  color: var(--berry);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.chapter-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.2vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.chapter-meta code {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.guide-pages,
.guide-page {
  min-width: 0;
}

.guide-page .section-shell,
.guide-page .story-section {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0 0 46px;
  padding: 0;
}

.guide-page .section-shell + .section-shell {
  padding-top: 8px;
}

.content-heading {
  display: block;
  max-width: 880px;
  margin: 0 0 22px;
}

.content-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.35vw, 1.82rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.content-heading p {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 14px;
  margin-bottom: 18px;
}

.quick-start-panel,
.guide-coverage {
  padding: 24px;
  background: rgba(255, 248, 223, 0.82);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(44, 33, 26, 0.11);
}

.quick-start-panel h2,
.guide-coverage h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 24px;
}

.quick-start-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-start-panel li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.quick-start-panel li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.quick-start-panel li strong {
  color: var(--pine);
}

.quick-start-panel li span,
.guide-coverage p {
  color: var(--ink-soft);
  font-size: 13px;
}

.quick-command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.quick-command-row .button {
  min-height: 42px;
  padding: 8px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
}

.guide-coverage dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.guide-coverage dl > div {
  padding: 9px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guide-coverage dt {
  color: var(--ink-soft);
  font-size: 10px;
}

.guide-coverage dd {
  margin: 1px 0 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.guide-coverage p {
  margin: 12px 0 0;
}

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

.chapter-directory a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 9px;
  min-height: 86px;
  padding: 13px;
  background: rgba(255, 248, 223, 0.68);
  border: 2px solid var(--ink);
  border-radius: 9px;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.chapter-directory a:hover {
  background: var(--cream);
  transform: translateY(-2px);
}

.chapter-directory a > span {
  grid-row: span 2;
  color: var(--berry);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.chapter-directory strong {
  font-family: var(--display);
  font-size: 15px;
}

.chapter-directory small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.route-finder {
  margin-top: 28px;
  padding: 22px;
  background: rgba(237, 216, 164, 0.55);
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.route-finder .content-heading {
  margin-bottom: 13px;
}

.route-panel {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
  gap: 22px;
  margin-top: 12px;
  padding: 20px;
  border-width: 2px;
  box-shadow: none;
}

.route-panel h3 {
  font-size: 21px;
}

.route-panel p {
  font-size: 13px;
}

.tutorial-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tutorial-step,
.tutorial-step:nth-child(n) {
  grid-column: auto;
  min-height: 218px;
  padding: 20px;
}

.step-index {
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  font-size: 14px;
}

.tutorial-step h3 {
  font-size: 19px;
}

.tutorial-step p {
  margin-bottom: 13px;
  font-size: 13px;
}

.starter-callout {
  padding: 17px 20px;
}

.starter-callout strong {
  font-size: 18px;
}

.starter-callout p {
  font-size: 13px;
}

.rule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 18px;
}

.rule-summary > div {
  padding: 13px 15px;
  background: var(--paper-deep);
  border: 1px solid var(--ink);
  border-radius: 7px;
}

.rule-summary dt {
  color: var(--ink-soft);
  font-size: 10px;
}

.rule-summary dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.story-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.day-card,
.day-card:nth-child(n) {
  position: relative;
  top: auto;
  min-height: 226px;
  padding: 22px;
  border-width: 2px;
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(44, 33, 26, 0.13);
  transform: none;
}

.day-time {
  margin-bottom: 15px;
  padding: 4px 8px;
  font-size: 11px;
}

.day-card h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.day-card p {
  margin: 10px 0 15px;
  font-size: 13px;
}

.choice-toolbar {
  margin-bottom: 12px;
}

.species-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.species-card {
  min-height: 190px;
  padding: 18px;
}

.species-card:hover {
  transform: translateY(-2px);
}

.profession-grid,
.lifestyle-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.map-bento {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: none;
  gap: 10px;
}

.location-card,
.location-card:first-child {
  grid-column: auto;
  grid-row: auto;
  min-height: 210px;
  padding: 19px;
  color: var(--ink);
  background: var(--cream);
}

.location-card:nth-child(3n + 2) { background: #e9d891; }
.location-card:nth-child(3n + 3) { background: #b9d9d2; }

.location-card h3 {
  font-size: 22px;
}

.npc-heading {
  margin-top: 28px;
}

.npc-strip {
  margin-top: 0;
  padding: 0;
  overflow: visible;
  contain: none;
  mask-image: none;
}

.npc-track {
  display: block;
  width: auto;
  animation: none;
}

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

.npc-set[aria-hidden="true"] {
  display: none;
}

.npc-pill {
  min-width: 0;
  white-space: normal;
  font-size: 12px;
}

.track-timeline {
  margin-top: 12px;
  border-width: 2px;
  box-shadow: 4px 4px 0 rgba(44, 33, 26, 0.12);
}

.track-stage {
  min-height: 230px;
  padding: 20px;
}

.stage-points {
  margin-bottom: 22px;
  font-size: 34px;
}

.life-duo {
  gap: 12px;
  margin-top: 0;
}

.life-card {
  min-height: 300px;
  padding: 26px;
  border-width: 2px;
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(44, 33, 26, 0.15);
}

.life-card h3 {
  font-size: 30px;
}

.life-card > p {
  margin: 12px 0 20px;
  font-size: 13px;
}

.life-facts {
  margin-bottom: 18px;
}

.reference-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.reference-columns > article {
  padding: 19px;
  background: rgba(255, 248, 223, 0.72);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.reference-columns h3,
.reference-columns p {
  margin-top: 0;
}

.reference-columns p {
  color: var(--ink-soft);
  font-size: 13px;
}

.reference-columns button,
.quick-command-row > button:not(.button) {
  min-height: 35px;
  padding: 6px 9px;
  color: var(--cream);
  background: var(--pine);
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  cursor: pointer;
}

.goal-grid {
  gap: 10px;
}

.goal-card {
  min-height: 315px;
  padding: 19px;
}

.goal-card:hover {
  transform: translateY(-2px);
}

.goal-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  font-size: 16px;
}

.goal-card h3 {
  font-size: 19px;
}

.system-accordions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.system-panel,
.system-panel:nth-child(n),
.system-panel.is-active,
.system-panel:hover,
.system-panel:focus-within {
  min-width: 0;
  min-height: 210px;
  padding: 21px;
  color: var(--ink);
  background: rgba(255, 248, 223, 0.76);
  border: 2px solid var(--ink);
  border-radius: 11px;
  overflow: visible;
}

.system-panel:nth-child(2n) {
  background: #dbe5c4;
}

.system-title,
.system-panel.is-active .system-title,
.system-panel:hover .system-title {
  margin: 0;
  font-size: 20px;
  writing-mode: horizontal-tb;
}

.system-content,
.system-panel.is-active .system-content,
.system-panel:hover .system-content,
.system-panel:focus-within .system-content {
  width: auto;
  margin-top: 10px;
  opacity: 1;
  transform: none;
}

.system-content p {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 13px;
}

.encyclopedia-shell,
.help-layout {
  border-width: 2px;
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(44, 33, 26, 0.12);
}

.encyclopedia-panel {
  min-height: 360px;
  padding: 20px;
}

.encyclopedia-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}

.encyclopedia-card {
  min-height: 235px;
  padding: 16px;
}

.help-layout {
  grid-template-columns: 190px minmax(0, 1fr) 225px;
  min-height: 560px;
}

.help-reader {
  padding: 24px;
}

.help-reader h3 {
  margin-bottom: 15px;
  font-size: 25px;
}

.command-index {
  padding: 17px;
}

.trouble-list {
  gap: 10px;
}

.trouble-item {
  padding: 18px;
}

.page-turner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}

.page-turner button {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 11px 15px;
  color: var(--ink);
  background: rgba(255, 248, 223, 0.72);
  border: 2px solid var(--ink);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.page-turner button:last-child {
  text-align: right;
}

.page-turner button:disabled {
  opacity: 0.42;
  cursor: default;
}

.page-turner span {
  color: var(--ink-soft);
  font-size: 10px;
}

.page-turner strong {
  font-size: 14px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  width: auto;
  margin-top: 40px;
  padding: 20px 2px 30px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  text-align: left;
}

.site-footer strong {
  color: var(--ink);
  font-size: 13px;
}

.site-footer p {
  margin: 2px 0 0;
  font-size: 10px;
}

.site-footer a {
  font-size: 12px;
}

.mobile-pager,
.menu-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .manual-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
  }

  .chapter-sidebar {
    padding: 14px;
  }

  .map-bento,
  .goal-grid,
  .chapter-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-layout {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .command-index {
    grid-column: 1 / -1;
    border-top: 2px solid var(--ink);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: 76px;
  }

  .manual-topbar {
    min-height: 62px;
    padding-inline: 14px;
  }

  .manual-topbar .search-trigger kbd {
    display: none;
  }

  .manual-topbar .menu-trigger {
    display: block;
  }

  .manual-shell {
    display: block;
    width: min(100% - 24px, 780px);
    padding-top: 80px;
  }

  .chapter-sidebar {
    position: fixed;
    z-index: 150;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 340px);
    max-height: none;
    padding: 82px 18px 22px;
    border-width: 0 3px 0 0;
    border-radius: 0;
    box-shadow: 18px 0 44px rgba(24, 49, 58, 0.24);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform 180ms ease, visibility 0s linear 180ms;
  }

  .chapter-sidebar.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .menu-overlay:not([hidden]) {
    position: fixed;
    z-index: 140;
    inset: 0;
    display: block;
    background: rgba(24, 49, 58, 0.46);
    border: 0;
  }

  .chapter-header {
    min-height: 76px;
    margin-bottom: 22px;
    padding-bottom: 14px;
  }

  .chapter-meta {
    display: none;
  }

  .page-turner {
    display: none;
  }

  .mobile-pager {
    position: fixed;
    z-index: 130;
    right: 10px;
    bottom: 9px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 58px;
    padding: 5px;
    color: var(--cream);
    background: rgba(37, 72, 56, 0.97);
    border: 2px solid rgba(255, 248, 223, 0.55);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(24, 49, 58, 0.25);
  }

  .mobile-pager button {
    display: grid;
    place-items: center;
    gap: 1px;
    min-height: 44px;
    color: inherit;
    background: transparent;
    border: 0;
  }

  .mobile-pager button:disabled {
    opacity: 0.35;
  }

  .mobile-pager span {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-pager small {
    font-size: 9px;
  }

  .overview-grid,
  .route-panel {
    grid-template-columns: 1fr;
  }

  .story-cards,
  .system-accordions,
  .reference-columns {
    grid-template-columns: 1fr;
  }

  .track-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .track-stage:nth-child(2) {
    border-right: 0;
  }

  .track-stage:nth-child(1),
  .track-stage:nth-child(2) {
    border-bottom: 2px solid var(--ink);
  }

  .track-stage:nth-child(3) {
    border-right: 2px solid var(--ink);
  }
}

@media (max-width: 680px) {
  .manual-topbar .brand small,
  .manual-topbar .search-trigger > span:nth-child(2) {
    display: none;
  }

  .chapter-header h1 {
    font-size: 30px;
  }

  .chapter-directory,
  .tutorial-steps,
  .map-bento,
  .goal-grid,
  .npc-set,
  .life-duo,
  .trouble-list,
  .rule-summary {
    grid-template-columns: 1fr;
  }

  .quick-start-panel,
  .guide-coverage,
  .route-finder {
    padding: 18px;
  }

  .quick-start-panel li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .chapter-directory a {
    min-height: 68px;
  }

  .tutorial-step,
  .tutorial-step:nth-child(n),
  .day-card,
  .day-card:nth-child(n),
  .location-card,
  .location-card:first-child,
  .goal-card,
  .system-panel,
  .system-panel:nth-child(n) {
    min-height: 0;
  }

  .track-timeline {
    grid-template-columns: 1fr;
  }

  .track-stage,
  .track-stage:nth-child(n) {
    min-height: 0;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .track-stage:last-child {
    border-bottom: 0;
  }

  .help-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .help-topic-list {
    display: flex;
    gap: 5px;
    padding: 10px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
    overflow-x: auto;
  }

  .help-topic-list button {
    flex: 0 0 auto;
    width: auto;
  }

  .help-reader {
    min-height: 340px;
    padding: 18px;
  }

  .command-index {
    grid-column: auto;
  }

  .encyclopedia-toolbar,
  .encyclopedia-tabs,
  .encyclopedia-panel {
    padding-inline: 12px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media print {
  .manual-topbar,
  .chapter-sidebar,
  .mobile-pager,
  .menu-overlay,
  .page-turner,
  .search-dialog,
  .toast,
  .grain {
    display: none !important;
  }

  .manual-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  [data-guide-page][hidden] {
    display: block !important;
  }

  .guide-page {
    break-before: page;
  }
}
