:root {
  color-scheme: light;
  --docs-ink: var(--ink);
  --docs-muted: var(--muted);
  --docs-quiet: var(--muted);
  --docs-paper: var(--paper);
  --docs-surface: #ffffff;
  --docs-line: var(--line);
  --docs-primary: var(--forest);
  --docs-primary-strong: var(--forest);
  --docs-success: #0f8f66;
  --docs-warning: #b7791f;
  --docs-radius: 16px;
  --docs-shadow: 0 12px 36px #16382d08;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--docs-paper);
  color: var(--docs-ink);
  font-family: var(--brand-font);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--docs-primary-strong);
  outline-offset: 4px;
}

.docs-skip {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 12px;
  padding: 12px;
  background: var(--docs-surface);
  transform: translateY(-160%);
}

.docs-skip:focus {
  transform: none;
}

.docs-languages {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
}

.docs-languages a[aria-current="page"] {
  font-weight: 800;
}

.docs-header,
.docs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
}

.docs-header {
  padding: 18px 0;
}

.docs-brand,
.docs-nav,
.docs-footer {
  text-decoration: none;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.docs-brand img {
  border-radius: var(--docs-radius);
}

.docs-nav,
.docs-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--docs-muted);
  font-weight: 700;
}

.docs-nav a,
.docs-footer a {
  text-decoration: none;
}

.docs-nav a[aria-current="page"] {
  color: var(--docs-primary-strong);
}

.docs-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 64px;
}

.docs-shell--single {
  display: block;
  max-width: 960px;
}

.docs-shell--wide {
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  width: min(1360px, calc(100% - 48px));
}

.docs-shell--release-index {
  display: block;
}

.docs-toc {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  background: var(--docs-surface);
}

.docs-toc a {
  color: var(--docs-muted);
  text-decoration: none;
}

.docs-article {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  background: var(--docs-surface);
  box-shadow: var(--docs-shadow);
}

.docs-article--flat {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.docs-release-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--docs-line);
}

.docs-kicker {
  margin: 0 0 8px;
  color: var(--docs-primary-strong);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.docs-article h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

.docs-subtitle {
  margin: 0 0 24px;
  color: var(--docs-muted);
  font-size: 1.05rem;
}

.docs-search {
  position: relative;
  margin: 0 0 28px;
}

/* Reserve the label and field before the script renders them, so hash targets do not shift. */
.docs-search:empty {
  min-height: 78px;
}

.docs-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  color: var(--docs-ink);
  font: inherit;
}

.docs-search-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.docs-search-result {
  display: block;
  padding: 12px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  background: #fff;
  text-decoration: none;
}

.docs-search-result small {
  display: block;
  color: var(--docs-muted);
  font-weight: 750;
  text-transform: uppercase;
}

.docs-search-title,
.docs-search-summary {
  display: block;
}

.docs-search-title {
  margin-top: 4px;
}

.docs-search-summary {
  margin-top: 2px;
  color: var(--docs-muted);
}

.docs-section {
  padding-top: 18px;
  border-top: 1px solid var(--docs-line);
}

.docs-section h2 {
  font-size: 1.55rem;
}

.docs-section-meta {
  margin-top: -8px;
  color: var(--docs-quiet);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.docs-release-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.docs-card,
.docs-highlight {
  padding: 18px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  background: #fff;
}

.docs-card h2,
.docs-card h3,
.docs-highlight h2 {
  margin-top: 0;
}

.docs-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 800;
}

.docs-jump {
  display: none;
  width: 100%;
  min-height: 44px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid var(--docs-line);
  border-radius: var(--docs-radius);
  background: #fff;
  color: var(--docs-ink);
  font: inherit;
}

.docs-footer {
  padding: 24px 0 42px;
  border-top: 1px solid var(--docs-line);
}

@media (max-width: 760px) {
  .docs-header,
  .docs-footer {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 24px, 680px);
  }

  .docs-shell {
    display: block;
    width: min(100% - 24px, 680px);
  }

  .docs-toc {
    display: none;
  }

  .docs-jump {
    display: block;
  }

  .docs-article {
    padding: 20px;
  }

  .docs-article--flat {
    padding: 0;
  }

  .docs-release-hero {
    display: block;
  }

  .docs-release-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Shared reading surfaces inherit the marketing identity without its display density.
   .docs-hero is the dark illustrated opening shared by Support and How to play. */
.docs-header {
  width: 100%;
  padding: max(22px, env(safe-area-inset-top)) max(24px, calc((100vw - 1240px) / 2)) 22px;
  color: var(--cream);
  background: var(--forest-deep);
  gap: 24px;
}
.docs-brand { font-size: 1.3rem; letter-spacing: -.04em; }
.docs-header .docs-nav { margin-left: auto; color: #c4d4bd; }
.docs-header .docs-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.docs-header .docs-nav a[aria-current="page"] { color: var(--gold); }
.docs-header :focus-visible { outline-color: var(--gold); }
.docs-play {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 12px 20px; border-radius: 12px;
  background: var(--gold); color: var(--forest-deep); text-decoration: none;
  font-size: .88rem; font-weight: 800; line-height: 1.4;
}
.docs-play:hover { background: var(--gold-hover); }
.docs-shell { margin-top: 48px; }
.docs-article h1, .docs-hero h1 { letter-spacing: -.055em; font-weight: 750; text-wrap: balance; }
.docs-kicker { letter-spacing: .12em; font-size: .7rem; }
.docs-toc { background: transparent; border: 0; border-left: 1px solid var(--docs-line); border-radius: 0; }
.docs-toc a { padding: 6px 0; }
.docs-highlight { background: #e5ebd9; border: 1px solid #becbac; padding: 28px; }
.docs-card { padding: 24px; }
.docs-card h2 a { text-decoration-thickness: 1px; text-underline-offset: .18em; }
.docs-release-grid { gap: 20px; margin-top: 24px; }
.docs-section { margin-top: 28px; }
.docs-languages a { min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: .2em; }
.docs-languages { flex-wrap: wrap; }
.docs-shell--support { display: block; max-width: 1240px; }
.docs-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px;
  background: var(--forest-deep); color: var(--cream); border-radius: 28px;
}
.docs-hero > div:first-child { position: relative; z-index: 1; padding: 52px; }
.docs-hero .docs-kicker { color: var(--gold); }
.docs-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); line-height: 1.08; margin: 16px 0 24px; }
.docs-hero p:not(.docs-kicker) { color: #c4d4bd; max-width: 46ch; }
.docs-hero .docs-languages { margin: 24px 0 0; }
.docs-hero :focus-visible { outline-color: var(--gold); }
.docs-hero-art {
  background: linear-gradient(90deg, var(--forest-deep), transparent 42%), url('../atlas/library.webp') center / cover;
  min-height: 340px;
}
.support-shortcuts { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 20px 0 42px; }
.support-shortcuts a { flex: 1; min-width: 150px; padding: 18px 12px; text-decoration: none; font-weight: 750; text-align: center; }
.support-shortcuts a:hover { background: #e5ebd9; }
.support-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 60px; }
.support-columns > * { min-width: 0; }
.support-answers h2, .support-contact h2 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -.04em; margin: 12px 0 24px; }
.support-answer { border-top: 1px solid var(--line); padding: 12px 0; scroll-margin-top: 24px; }
.support-answer:last-child { border-bottom: 1px solid var(--line); }
.support-answer summary, .support-template summary { min-height: 48px; padding: 12px 4px; cursor: pointer; font-weight: 750; }
.support-answer p { color: var(--muted); margin: 8px 0 20px; }
.support-store-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.support-store-links a { color: var(--forest); min-height: 44px; display: inline-flex; align-items: center; }
.support-contact { padding: 32px; background: #e5ebd9; border: 1px solid #c5d1b8; border-radius: 22px; align-self: start; }
.support-contact p { color: var(--muted); }
.support-email { width: 100%; margin: 12px 0; text-align: center; }
.support-address { display: block; overflow-wrap: anywhere; font-size: .9rem; min-height: 44px; text-align: center; }
.support-template { margin-top: 12px; border-top: 1px solid #c5d1b8; }
.support-template pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .85rem/1.7 var(--brand-font); margin: 12px 0; }
.support-guide { margin-top: 24px; padding-top: 20px; border-top: 1px solid #c5d1b8; }
.support-guide h3 { font-size: 1.1rem; }
.support-guide a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 750; }
@media (max-width: 960px) {
  .docs-header { flex-wrap: wrap; gap: 12px 20px; }
  .docs-header .docs-nav { order: 3; flex-basis: 100%; justify-content: center; margin: 0; }
  .docs-header .docs-play { margin-left: auto; }
  .docs-hero > div:first-child { padding: 36px; }
  .support-columns { gap: 28px; }
}
@media (max-width: 760px) {
  .docs-header { flex-direction: row; align-items: center; padding: max(18px, env(safe-area-inset-top)) 18px 12px; }
  .docs-header .docs-nav { justify-content: space-between; gap: 4px 12px; font-size: .8rem; }
  .docs-brand { font-size: 1.15rem; gap: 8px; }
  .docs-brand img { width: 30px; height: 30px; }
  .docs-play { padding: 10px 12px; font-size: .76rem; }
  .docs-shell { width: calc(100% - 32px); margin-top: 28px; }
  .docs-article { padding: 22px 18px; }
  .docs-article--flat { padding: 0; }
  .docs-article h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.1; }
  .docs-footer { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .docs-hero { display: block; border-radius: 20px; }
  .docs-hero > div:first-child { padding: 28px 24px 8px; }
  .docs-hero h1 { font-size: clamp(2.15rem, 8.2vw, 3rem); }
  .docs-hero-art { min-height: 160px; background-position: center 62%; background-image: linear-gradient(180deg, var(--forest-deep), transparent 70%), url('../atlas/library.webp'); }
  .support-shortcuts { margin-bottom: 30px; }
  .support-shortcuts a { flex-basis: 100%; padding: 14px; border-bottom: 1px solid var(--line); }
  .support-columns { grid-template-columns: 1fr; gap: 32px; }
  .support-contact { padding: 24px; }
}

/* How to play: an illustrated guide. Scoped to .docs-shell--guide; shares the docs hero and letter tiles. */
.docs-shell--guide {
  --guide-panel: #e5ebd9;
  --guide-ledge: #b9c6aa;
  --guide-rule-how: #d7e1cb;
  --guide-rule-goal: var(--gold);
  --guide-rule-end: #b7a6e2;
  --guide-heading: clamp(1.6rem, 2.6vw, 2rem);
  grid-template-columns: 220px minmax(0, 1fr); gap: 40px;
}
.docs-shell--guide .guide-hero { grid-column: 1 / -1; }
.guide-hero .docs-languages { margin-bottom: 0; }
.guide-hero .docs-hero-art { background-image: linear-gradient(90deg, var(--forest-deep), transparent 42%), url('../atlas/garden.webp'); }
.docs-shell--guide .docs-toc { top: 24px; gap: 0; padding: 4px 0 4px 18px; }
.docs-shell--guide .docs-toc a { position: relative; display: flex; align-items: center; min-height: 44px; padding: 6px 0; font-weight: 650; transition: color .2s; }
.docs-shell--guide .docs-toc a:hover { color: var(--docs-ink); }
.docs-shell--guide .docs-toc a[aria-current="location"] { color: var(--forest); font-weight: 800; }
/* The active entry lights up its stretch of the rule beside the list. */
.docs-shell--guide .docs-toc a[aria-current="location"]::before { content: ""; position: absolute; left: -20px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold); }
.docs-shell--guide .docs-article--flat { padding: 0; }
.guide-tools { max-width: 640px; }
.guide-section { scroll-margin-top: 24px; margin-top: 56px; }
.guide-section h2, .guide-directory h2 { margin: 0 0 18px; font-size: var(--guide-heading); letter-spacing: -.035em; line-height: 1.15; }
.guide-section > p { max-width: 68ch; color: var(--docs-muted); }
.guide-section--panel { padding: 28px 32px; border: 1px solid var(--docs-line); border-radius: var(--docs-radius); background: #fff; }

/* Quick start: four numbered tiles. */
.guide-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: grid; align-content: start; gap: 18px; padding: 24px 22px 22px; border: 1px solid var(--docs-line); border-radius: var(--docs-radius); background: #fff; }
.guide-steps .letter-tile { --tile-size: 48px; }
.guide-steps p { margin: 0; }

/* Game directory: every game's art and name, one tap from its rules. */
.guide-directory { scroll-margin-top: 24px; margin-top: 48px; padding: 32px; border-radius: var(--docs-radius); background: var(--guide-panel); }
.guide-directory h3 { margin: 26px 0 12px; color: var(--docs-muted); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.guide-directory ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.guide-game { display: grid; gap: 10px; min-height: 44px; color: var(--docs-ink); font-size: .9rem; font-weight: 750; line-height: 1.25; text-decoration: none; }
/* Pressable tiles get the tactile ledge; the rules-card art below stays flat. */
.guide-game-art { display: block; overflow: hidden; aspect-ratio: 3 / 4; border-radius: var(--docs-radius); background: var(--forest-deep); box-shadow: 0 4px 0 var(--guide-ledge), 0 10px 22px #16382d1f, inset 0 1px #fff3; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.guide-game:active .guide-game-art { transform: translateY(2px); box-shadow: 0 2px 0 var(--guide-ledge), 0 6px 12px #16382d1f, inset 0 1px #fff3; }
@media (hover: hover) {
  .guide-game:hover .guide-game-art { transform: translateY(-3px); box-shadow: 0 7px 0 var(--guide-ledge), 0 16px 28px #16382d29, inset 0 1px #fff3; }
}
.guide-game:focus-visible .guide-game-art { transform: translateY(-3px); }
.guide-game-art img, .guide-mode-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.guide-mode-art { display: block; overflow: hidden; aspect-ratio: 9 / 16; border-radius: var(--docs-radius); background: var(--forest-deep); box-shadow: 0 8px 18px #16382d1a; }
/* Picture Link shows its four clues; declared after both art boxes so the grid wins. */
.guide-game-art.guide-art--clues, .guide-mode-art.guide-art--clues { display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 3px; padding: 3px; }
.guide-mode-art.guide-art--clues { aspect-ratio: 1; align-self: start; }
.guide-art--clues img { border-radius: 10px; object-position: center; }

/* Game rules: art beside three labelled rules. */
.guide-mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 18px; margin-top: 24px; }
.guide-mode { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px; border: 1px solid var(--docs-line); border-radius: var(--docs-radius); background: #fff; scroll-margin-top: 24px; }
.guide-mode:target, .guide-mode:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #f4c76166; outline: none; }
.guide-mode h3 { margin: 0 0 14px; font-size: 1.3rem; letter-spacing: -.025em; }
.guide-rules { display: grid; gap: 12px; margin: 0; }
.guide-rules div { padding: 0 0 0 14px; border-left: 3px solid var(--guide-rule-how); }
.guide-rules div:nth-child(2) { border-left-color: var(--guide-rule-goal); }
.guide-rules div:nth-child(3) { border-left-color: var(--guide-rule-end); }
.guide-rules dt { color: var(--docs-muted); font-size: .75rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.guide-rules dd { margin: 2px 0 0; font-size: .95rem; line-height: 1.5; }
.guide-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--docs-muted); font-size: .85rem; font-weight: 700; text-underline-offset: .2em; }

@media (max-width: 1100px) {
  .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .docs-shell--guide { grid-template-columns: 1fr; gap: 0; }
  /* The table of contents becomes a sticky row of section chips. */
  .docs-shell--guide .docs-toc {
    display: flex; gap: 8px; position: sticky; top: 0; z-index: 5;
    margin: 20px -16px 0; padding: 10px 16px; overflow-x: auto; scrollbar-width: none;
    border: 0; border-bottom: 1px solid var(--docs-line); border-radius: 0; background: var(--docs-paper);
  }
  .docs-shell--guide .docs-toc::-webkit-scrollbar { display: none; }
  .docs-shell--guide .docs-toc a { flex: none; padding: 8px 14px; border: 1px solid var(--docs-line); border-radius: 999px; background: #fff; white-space: nowrap; font-size: .85rem; }
  .docs-shell--guide .docs-toc a[aria-current="location"] { border-color: var(--forest); background: var(--forest); color: var(--cream); }
  .docs-shell--guide .docs-toc a[aria-current="location"]::before { content: none; }
  .guide-section, .guide-mode, .guide-directory { scroll-margin-top: 80px; }
  .guide-tools { margin-top: 24px; }
}
@media (max-width: 760px) {
  .docs-shell--guide .docs-toc { display: flex; }
  .guide-hero .docs-hero-art { min-height: 110px; background-image: linear-gradient(180deg, var(--forest-deep), transparent 70%), url('../atlas/garden.webp'); }
  .guide-section { margin-top: 40px; }
  .guide-section--panel { padding: 22px 20px; }
  .guide-steps { grid-template-columns: 1fr; gap: 12px; }
  .guide-steps li { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px; }
  .guide-steps .letter-tile { --tile-size: 40px; }
  .guide-directory { margin: 32px -16px 0; padding: 26px 16px; border-radius: 0; }
  .guide-directory ul { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
  /* Art and title share the first row; the rules use the full card width below. */
  .guide-mode { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; padding: 18px 16px; }
  .guide-mode-body { display: contents; }
  .guide-mode-art { grid-row: 1 / span 2; }
  .guide-mode h3 { margin: 0; align-self: center; }
  .guide-rules, .guide-back { grid-column: 1 / -1; }
  .guide-rules { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-game-art, .docs-shell--guide .docs-toc a { transition: none; }
}
