:root {
  --paper: #f4ebd9;
  --paper-2: #ece0c8;
  --ink: #201914;
  --muted: #705f4b;
  --line: rgba(46, 34, 23, 0.16);
  --coal: #1b160f;
  --coal-2: #2b2116;
  --rust: #b85c2d;
  --gold: #c78d2b;
  --moss: #596b32;
  --danger: #9e392b;
  --radius: 8px;
  --shadow: 0 18px 44px rgba(42, 30, 18, 0.18);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(32, 25, 20, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(32, 25, 20, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link,
.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:focus {
  z-index: 20;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 10px 14px;
  background: var(--coal);
  color: var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 235, 217, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--coal);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}

.top-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--rust);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

main {
  min-height: 60vh;
}

.hero,
.game-hero,
.page-hero {
  display: grid;
  gap: clamp(22px, 4vw, 48px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(46px, 7vw, 90px) clamp(18px, 4vw, 56px);
}

.hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  min-height: calc(100vh - 68px);
  align-items: center;
}

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

.game-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: center;
  color: var(--game-ink, var(--paper));
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.68)),
    var(--surface, var(--coal));
  max-width: none;
  padding-left: max(clamp(18px, 4vw, 56px), calc((100vw - 1180px) / 2 + 56px));
  padding-right: max(clamp(18px, 4vw, 56px), calc((100vw - 1180px) / 2 + 56px));
}

.game-hero img,
.hero-media img,
.game-card img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-hero.compact {
  max-width: 1180px;
  padding-bottom: 28px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", Georgia, "Times New Roman", "Songti SC", serif;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  font-size: clamp(42px, 7.5vw, 88px);
}

.compact h1 {
  font-size: clamp(36px, 6vw, 72px);
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
}

h3 {
  font-size: 24px;
}

p {
  margin: 0;
}

.lead {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
}

.game-hero .lead {
  color: rgba(255, 245, 224, 0.78);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  max-width: 660px;
  margin-top: 28px;
  border: 2px solid var(--coal);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--coal);
  overflow: hidden;
}

.search-bar input,
.filter-panel input,
.lookup-tool select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search-bar input {
  padding: 17px 18px;
}

.search-bar button {
  border: 0;
  padding: 0 22px;
  background: var(--moss);
  color: var(--paper);
  font-weight: 800;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.hero-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  transform: rotate(-1deg);
}

.hero-media img:nth-child(2n) {
  transform: translateY(28px);
}

.band {
  padding: clamp(42px, 6vw, 80px) clamp(18px, 4vw, 56px);
}

.band > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.band.muted {
  background: rgba(32, 25, 20, 0.055);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -10px;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
}

.section-head.tight {
  display: block;
}

.feature-grid,
.game-grid,
.tool-grid,
.path-grid,
.path-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.all-games {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-item,
.tool-item,
.path-card,
.game-card,
.path-table article,
.note-panel,
.quality-box,
.filter-panel,
.lookup-tool,
.profile-output article,
.timeline article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.feature-item,
.tool-item,
.path-card,
.path-table article,
.note-panel,
.quality-box,
.filter-panel,
.lookup-tool,
.profile-output article,
.timeline article {
  padding: 20px;
}

.feature-item p,
.tool-item p,
.path-card p,
.path-table p,
.note-panel p,
.quality-box p,
.timeline p {
  margin-top: 10px;
  color: var(--muted);
}

.game-card {
  overflow: hidden;
  background: var(--surface, rgba(255, 250, 239, 0.72));
  color: var(--game-ink, var(--paper));
}

.game-card-body {
  padding: 16px;
}

.game-card h3 a {
  color: inherit;
  text-decoration: none;
}

.game-card p {
  margin-top: 8px;
  color: rgba(255, 245, 224, 0.76);
}

.game-card .eyebrow {
  color: var(--accent, var(--gold));
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 245, 224, 0.25);
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.pill.strong,
.pill.light {
  border-color: var(--line);
  background: rgba(255, 250, 239, 0.78);
  color: var(--ink);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--coal);
  color: var(--paper);
}

.metric-strip div {
  padding: 18px;
  background: var(--coal-2);
}

.metric-strip span {
  display: block;
  color: rgba(244, 235, 217, 0.64);
  font-size: 12px;
}

.metric-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.path-card {
  color: var(--ink);
  text-decoration: none;
}

.path-card span {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--rust);
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 700;
}

.tool-item a,
.text-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--rust);
  font-weight: 800;
}

.center-row {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.46fr);
  gap: 24px;
  align-items: start;
}

.two-col.wide {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

.plain-list,
.check-list,
.source-list,
.number-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.check-list li,
.number-list li {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.check-list span,
.number-list span {
  color: var(--muted);
}

.source-list li a {
  font-weight: 800;
}

.quality-box {
  background: var(--coal);
  color: var(--paper);
}

.quality-box .eyebrow,
.quality-box strong {
  color: var(--gold);
}

.quality-box strong {
  display: block;
  font-size: 46px;
  line-height: 1;
}

.quality-box.small strong {
  font-size: 32px;
}

.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.mini-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.72);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.mini-list span {
  color: var(--muted);
  font-weight: 600;
}

.achievement-list {
  display: grid;
  gap: 10px;
}

.achievement-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.74);
}

.achievement-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--moss);
}

.achievement-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

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

.path-table.single {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

code {
  display: block;
  margin: 14px 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #2b2116;
  color: #f4ebd9;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--coal);
  border-radius: var(--radius);
  background: transparent;
  color: var(--coal);
  font-weight: 800;
}

.settings-tool {
  max-width: 920px;
  margin: 0 auto;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.segmented button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.74);
  color: var(--ink);
  font-weight: 800;
}

.segmented button.active {
  background: var(--moss);
  color: var(--paper);
}

.profile-output article {
  display: none;
}

.profile-output article.active {
  display: block;
}

.filter-panel,
.lookup-tool {
  max-width: 760px;
  margin-top: 28px;
}

.filter-panel label,
.lookup-tool label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.filter-panel input,
.lookup-tool select {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.78);
}

.empty-state {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline time {
  color: var(--rust);
  font-weight: 900;
}

.policy-body {
  max-width: 820px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 239, 0.74);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: rgba(32, 25, 20, 0.08);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px) 88px;
  border-top: 1px solid var(--line);
  background: var(--coal);
  color: var(--paper);
}

.site-footer p {
  max-width: 760px;
  margin-top: 8px;
  color: rgba(244, 235, 217, 0.68);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: start;
  justify-content: end;
}

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

.mobile-dock {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 12;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(244, 235, 217, 0.18);
  border-radius: var(--radius);
  background: rgba(27, 22, 15, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.mobile-dock a {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1060px) {
  .hero,
  .game-hero,
  .section-head,
  .two-col,
  .two-col.wide {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .tool-grid,
  .path-grid,
  .all-games,
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .site-header {
    min-height: 62px;
    padding: 10px 14px;
  }

  .brand small {
    display: none;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .top-nav {
    position: absolute;
    top: 62px;
    right: 14px;
    left: 14px;
    display: none;
    grid-template-columns: 1fr;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .top-nav.open {
    display: grid;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }

  .hero-media {
    grid-template-columns: 1fr;
    transform: none;
  }

  .hero-media img:nth-child(n + 4) {
    display: none;
  }

  .hero-media img:nth-child(2n) {
    transform: none;
  }

  .search-bar {
    grid-template-columns: 1fr;
    box-shadow: 5px 5px 0 var(--coal);
  }

  .search-bar button {
    min-height: 48px;
  }

  .feature-grid,
  .tool-grid,
  .path-grid,
  .all-games,
  .game-grid,
  .path-table,
  .segmented {
    grid-template-columns: 1fr;
  }

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

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

  .site-footer nav {
    justify-content: start;
  }

}

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