/* site/site.css — the public pages (/welcome/, /boardgames/<slug>/).
 *
 * Its own small sheet, not the app's: the public pages carry no app bundle, no
 * Tailwind and no DaisyUI, so they paint on first byte for a reader and for a
 * crawler. The tokens are the app's (styles.css, :root[data-bgb=…]) under the
 * same lever, so a reader who set Light in the app gets light here too.
 */

:root {
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-score: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 14px; --r-xl: 18px;
  --col-max: 1160px;
}

:root, :root[data-bgb="dark"] {
  color-scheme: dark;
  --bg-0: #1A1310; --bg-1: #251C16; --bg-2: #2A2019; --band: #211813;
  --ink: #F0E7D8; --ink-muted: #CDBFAB; --ink-faint: #9A8B78;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #E0A94A; --accent-hover: #F0C276; --accent-quiet: rgba(224, 169, 74, 0.14);
  --accent-fill: #E0A94A; --on-accent: #2B1E06;
  --guide-fill: #7FB2E0; --on-guide: #0E1B27;
  --paper: #F8F2E5; --paper-ink: #211A12; --paper-muted: #6F6556; --paper-line: rgba(36, 28, 20, 0.12);
  --paper-accent: #8E5F10;
  --shadow: 0 2px 10px -2px rgba(12, 5, 0, 0.62);
}

:root[data-bgb="light"] {
  color-scheme: light;
  --bg-0: #F7F0E1; --bg-1: #FFFBF2; --bg-2: #FFFFFF; --band: #F1E8D5;
  --ink: #2A2016; --ink-muted: #5E5243; --ink-faint: #7A6C58;
  --line: rgba(36, 28, 20, 0.11); --line-strong: rgba(36, 28, 20, 0.24);
  --accent: #8E5F10; --accent-hover: #6F4A0C; --accent-quiet: rgba(168, 114, 21, 0.13);
  --accent-fill: #8E5F10; --on-accent: #FFFFFF;
  --guide-fill: #2F6690; --on-guide: #FFFFFF;
  --paper: #FFFFFF; --paper-ink: #2A2016; --paper-muted: #6F6556; --paper-line: rgba(36, 28, 20, 0.12);
  --paper-accent: #8E5F10;
  --shadow: 0 2px 10px -2px rgba(120, 88, 44, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
}
a { color: var(--accent); }
@media (hover: hover) { a:hover { color: var(--accent-hover); } }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; }
h3 { font-family: var(--font-sans); }
p { margin: 0; }

.wrap { max-width: var(--col-max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }

/* ── Header / footer ──────────────────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; flex-grow: 1; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand span { font-family: var(--font-display); font-weight: 600; font-size: 21px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 24px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-top: 28px; padding-bottom: 40px; font-size: 13.5px; color: var(--ink-faint); }
.site-foot .grow { flex-grow: 1; }
.site-foot a { color: var(--ink-faint); }
/* BGG's licence wants its lockup on every public page. Navy on white and never
   recoloured, so it keeps the white plate it was drawn for in both themes. */
.bgg-credit { display: inline-block; padding: 6px 10px; background: #FFFFFF; border-radius: var(--r-sm); line-height: 0; }
.bgg-credit img { width: 110px; height: auto; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-md);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .08s ease;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent-fill); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); font-weight: 500; }
@media (hover: hover) {
  .btn--primary:hover { color: var(--on-accent); filter: brightness(1.06); }
  .btn--ghost:hover { color: var(--ink); background: var(--accent-quiet); }
}
.btn[hidden] { display: none; }

/* ── Home ─────────────────────────────────────────────────────────────────── */
.hero .wrap { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 80px; padding-bottom: 56px; }
.hero__copy { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); line-height: 1.02; letter-spacing: -0.01em; }
.hero__lede { font-size: 19px; color: var(--ink-muted); max-width: 600px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero__note { font-size: 14px; color: var(--ink-faint); }
.hero__art { flex: 1 1 260px; display: flex; justify-content: center; }
.hero__art img { width: min(260px, 60vw); border-radius: 28px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding-bottom: 28px; }
.stat { background: var(--bg-1); border-radius: var(--r-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-score); font-size: 30px; font-weight: 600; color: var(--accent); }
.stat span { font-size: 14.5px; color: var(--ink-muted); }
.game-stats .stat b { font-size: 24px; color: var(--ink); }

.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 40px; }
.tabs a {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-md);
  min-height: 56px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); text-decoration: none; font-weight: 600; text-align: center; padding: 0 8px;
}
.tabs a:active { transform: scale(0.985); }
@media (hover: hover) { .tabs a:hover { color: var(--ink); border-color: var(--line-strong); } }

.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; scroll-margin-top: 12px; }
.section h2 { font-size: clamp(30px, 4vw, 40px); }
.section__lede { font-size: 17px; color: var(--ink-muted); max-width: 640px; margin-top: 8px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.feature { background: var(--bg-2); border-radius: var(--r-lg); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.feature__n {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-quiet); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 18px;
}
.feature h3 { font-size: 19px; }
.feature p { color: var(--ink-muted); font-size: 15.5px; }

/* Game tiles: the app's rail game tile (styles.css .game-polaroid--rail). A
   plain UI card, so it follows the ground (theming.md §6, chrome): a raised
   step off the page in dark, white in light. Full-bleed art, the caption
   left-aligned under it. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.tile {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px;
  box-shadow: var(--shadow); text-decoration: none; transition: transform .12s ease, border-color .12s ease;
}
.tile:active { transform: scale(0.985); }
@media (hover: hover) {
  .tile:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--line-strong); }
}
.tile__art {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; margin-bottom: 6px;
  background: var(--tile-color, #5B4A3A); display: flex; align-items: flex-end; padding: 12px;
  color: #FFF8EC; font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.05;
}
.tile__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* One row that sweeps instead of truncating, as in the app's rail: site.js
   measures the overflow into --sweep-shift and --sweep-dur. */
.tile__name { font-weight: 600; margin: 0 12px; overflow: hidden; white-space: nowrap; }
.tile__name-text { display: inline-block; }
.tile__name.is-sweeping .tile__name-text { animation: tileTitleSweep var(--sweep-dur, 8s) ease-in-out infinite; will-change: transform; }
@keyframes tileTitleSweep {
  0%, 20%   { transform: translateX(0); }
  45%, 65%  { transform: translateX(var(--sweep-shift, 0px)); }
  90%, 100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tile__name.is-sweeping .tile__name-text { animation: none; }
  .tile__name { text-overflow: ellipsis; }
}
.tile__meta { font-size: 13.5px; color: var(--ink-muted); padding: 0 12px; }

/* Games by category. The chip row scrolls sideways on a phone and wraps on a
   wide screen; the panels are one scroll-snap strip, so a swipe moves a whole
   category and works with no script. Each panel is three equal columns, so
   the cards are one size whatever their names. */
.cats { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cats__row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink);
  display: inline-flex; align-items: center; font-weight: 600; font-size: 15px; text-decoration: none;
}
.chip[aria-current="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .chip:hover { color: var(--ink); border-color: var(--line-strong); }
  .chip[aria-current="true"]:hover { color: var(--on-accent); }
}
/* The strip sits between the two category arrows, the podium centred in it. */
.cats__stage {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 16px;
  width: 100%; max-width: calc(760px + 2 * (44px + 16px)); margin: 0 auto;
}
.cats__stage > .cats__panels { grid-column: 2; grid-row: 1; }
.cats__arrow { grid-row: 1; margin-bottom: 30px; }
.cats__arrow--prev { grid-column: 1; }
.cats__arrow--next { grid-column: 3; }
.cats__arrow {
  flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-1); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
.cats__arrow[hidden] { display: none; }
.cats__arrow svg { width: 22px; height: 22px; }
.cats__arrow:disabled { opacity: .35; cursor: default; box-shadow: none; }
.cats__arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .cats__arrow:not(:disabled):hover { border-color: var(--line-strong); background: var(--bg-2); } }
.cats__panels { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.cats__panels::-webkit-scrollbar { display: none; }
.cats__panel { position: relative; flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; padding: 4px 2px 12px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 760px; margin: 0 auto; }
.tile__rank {
  position: absolute; z-index: 1; top: 8px; left: 8px; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px;
  background: rgba(20, 12, 6, 0.72); color: #FFF8EC; font-family: var(--font-score); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.podium__item:first-child .tile__rank { background: #E0A94A; color: #2B1E06; }
.cats__dots { display: none; justify-content: center; gap: 6px; }
.cats__dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line-strong); transition: width .2s ease, background-color .2s ease; }
.cats__dots i.on { width: 18px; background: var(--accent); }
/* The row under each podium card: Scoring and Guide, side by side, always
   both. A lit pill is a solid fill (gold for a scoring grid, blue for guide
   sections); a grey outline means the game has none. */
.podium__item, .catalog__item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.podium__item .tile, .catalog__item .tile { flex: 1 1 auto; }
.tile-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pill {
  box-sizing: border-box; min-width: 0; height: 24px; padding: 0 4px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid transparent;
}
.pill--grid { background: var(--accent-fill); color: var(--on-accent); }
.pill--guide { background: var(--guide-fill); color: var(--on-guide); }
.pill--off { border-color: var(--line); color: var(--ink-faint); }
.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; }
@media (prefers-reduced-motion: reduce) { .cats__dots i { transition: none; } }

.about { background: var(--bg-1); border-radius: var(--r-xl); padding: 40px; display: flex; flex-direction: column; gap: 12px; }
.about h2 { font-size: 32px; }
.about__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.about__links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }

.section__more { display: flex; justify-content: center; }

/* ── /boardgames/ ─────────────────────────────────────────────────────────── */
.catalog { padding-top: 24px; }
.catalog h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; }
/* The title search (site/catalog.js), above the rows. 16px text, so focusing
   it never zooms iOS. */
.catalog__search { position: relative; max-width: 480px; }
.catalog__search[hidden] { display: none; }
.catalog__search svg {
  position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none;
}
.catalog__search input {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 0 16px 0 46px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink);
  font: inherit; font-size: 16px;
}
.catalog__search input::placeholder { color: var(--ink-faint); }
.catalog__search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.catalog__group { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 12px; }
.catalog__group[hidden], .catalog__item[hidden] { display: none; }
/* One sideways-scrolling row per category, bled to the column's edges so a
   tile scrolls out under the gutter rather than being cut at it. */
.catalog__rail {
  display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 24px;
  margin: 0 -24px; padding: 4px 24px 14px;
}
.catalog__rail > .catalog__item { flex: 0 0 200px; scroll-snap-align: start; }
@media (hover: none) {
  .catalog__rail { scrollbar-width: none; }
  .catalog__rail::-webkit-scrollbar { display: none; }
}
.catalog__group h2 { font-size: clamp(24px, 3vw, 30px); }
.catalog__count { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--ink-faint); margin-left: 6px; }

/* ── Game page ────────────────────────────────────────────────────────────── */
.crumbs { font-size: 14px; color: var(--ink-faint); display: flex; gap: 8px; padding-top: 24px; }
.crumbs a { text-decoration: none; }
.game-head { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-top: 24px; padding-bottom: 40px; }
.game-head__art { flex: 0 1 300px; background: var(--paper); border-radius: var(--r-sm); padding: 12px 12px 20px; box-shadow: var(--shadow); }
.game-head__art .tile__art { font-size: 26px; border-radius: 4px; margin-bottom: 0; }
.game-head__copy { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.game-head h1 { font-size: clamp(38px, 6vw, 56px); }
.game-head__facts { color: var(--ink-muted); }
.game-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.sheet { background: var(--paper); color: var(--paper-ink); border-radius: var(--r-md); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { font-size: 28px; }
.sheet__by { font-size: 13.5px; color: var(--paper-muted); }
.sheet__scroll { overflow-x: auto; }
.sheet table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 15px; }
.sheet th { text-align: left; font-weight: 500; font-size: 13px; color: var(--paper-muted); padding: 8px 10px; border-bottom: 1px solid var(--paper-line); }
.sheet td { padding: 6px; border-bottom: 1px solid var(--paper-line); vertical-align: middle; }
/* An empty score cell, drawn as the well the app's scorepad types into. */
.sheet td.blank::before {
  content: ""; display: block; height: 32px; border-radius: 6px;
  background: color-mix(in srgb, var(--paper-ink) 5%, var(--paper));
}

/* Row labels in the app's row palette (styles.css --row-*): a 3px rule on the
   left and a 14% wash, over paper, which is light in both themes. The slug is
   whitelisted by the template; anything else renders neutral. */
.sheet { --row-red: #B03028; --row-pink: #C2557E; --row-rust: #A65D2C; --row-brown: #6B4423;
  --row-gold: #C9922A; --row-yellow: #B5A800; --row-green: #4A7A4A; --row-blue: #4A6F94; --row-purple: #7A5293; }
.sheet__row { --row-accent: var(--paper-muted); }
.sheet tbody th.sheet__row {
  text-align: left; font-size: 15px; font-weight: 600; color: var(--paper-ink);
  padding: 0 12px; height: 44px;
  background: color-mix(in srgb, var(--row-accent) 14%, var(--paper));
  box-shadow: inset 3px 0 0 var(--row-accent);
  border-bottom: 1px solid var(--paper-line);
}
.sheet__row[data-row-color="red"]    { --row-accent: var(--row-red); }
.sheet__row[data-row-color="pink"]   { --row-accent: var(--row-pink); }
.sheet__row[data-row-color="rust"]   { --row-accent: var(--row-rust); }
.sheet__row[data-row-color="brown"]  { --row-accent: var(--row-brown); }
.sheet__row[data-row-color="gold"]   { --row-accent: var(--row-gold); }
.sheet__row[data-row-color="yellow"] { --row-accent: var(--row-yellow); }
.sheet__row[data-row-color="green"]  { --row-accent: var(--row-green); }
.sheet__row[data-row-color="blue"]   { --row-accent: var(--row-blue); }
.sheet__row[data-row-color="purple"] { --row-accent: var(--row-purple); }
/* A row with a note: the whole label is the button (44px tall, the cell's
   width), and the glyph is the marker, as in the app. */
.sheet__note {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px;
  margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  /* The :active fade below is the press feedback; a phone's own tap flash and
     a long-press text selection would paint the whole label blue. */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.sheet__note svg { flex: none; width: 15px; height: 15px; color: var(--paper-muted); }
.sheet__note:active { opacity: 0.55; }
.sheet__note:focus-visible { outline: 2px solid var(--paper-accent); outline-offset: 2px; border-radius: 4px; }

/* A section the game has nothing for yet. */
.empty-sec {
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.empty-sec h2 { font-size: 24px; }
.empty-sec p { color: var(--ink-muted); }
.empty-sec a { color: var(--accent); }
.chapters { display: flex; flex-direction: column; gap: 14px; }
.chapter { background: var(--bg-1); border-radius: var(--r-md); }
.chapter summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary b { font-size: 17px; }
.chapter summary span { font-size: 14px; color: var(--ink-faint); }
.chapter__body { padding: 0 20px 20px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 10px; }
.chapter__body h2, .chapter__body h3, .chapter__body h4 { font-family: var(--font-sans); font-size: 16px; color: var(--ink); margin-top: 6px; }
.chapter__body ul { margin: 0; padding-left: 20px; }
.chapter__body table { border-collapse: collapse; font-size: 14.5px; }
.chapter__body th, .chapter__body td { border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; text-align: left; }
.chapter__body code { font-family: var(--font-score); font-size: 0.92em; }

/* ── Legal pages (/legal/privacy/, /legal/terms/) ─────────────────────────────
   The body is the app's own markup (web/views/*-view.js), which carries
   Tailwind classes this sheet does not load; these rules style it by element. */
.legal { max-width: 42rem; margin: 0 auto; padding: 40px 0 24px; display: flex; flex-direction: column; gap: 6px; }
.legal h1 { font-size: clamp(32px, 5vw, 44px); }
.legal__updated { color: var(--ink-faint); font-size: 14px; }
.legal__body { margin-top: 18px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 12px; }
.legal__body h2 { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin-top: 22px; }
.legal__body h3 { font-family: var(--font-sans); font-size: 17px; color: var(--ink); margin-top: 8px; }
.legal__body ul, .legal__body ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal__body strong, .legal__body b { color: var(--ink); }
.legal__body code { font-family: var(--font-score); font-size: 0.92em; }
.legal__body .alert { padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-quiet); color: var(--ink); }
.legal__more { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }

/* ── Install sheet (iOS steps) ────────────────────────────────────────────── */
.install-help {
  position: fixed; inset: 0; z-index: 90; background: rgba(12, 5, 0, 0.55);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
}
.install-help[hidden] { display: none; }
.install-help__card {
  width: 100%; max-width: 420px; background: var(--bg-1); color: var(--ink);
  border-radius: var(--r-xl); padding: 24px; display: flex; flex-direction: column; gap: 14px;
  margin-bottom: max(0px, env(safe-area-inset-bottom));
}
.install-help__card h2 { font-size: 24px; }
.install-help__card ol { margin: 0; padding-left: 22px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 6px; }
.install-help__card ol[hidden] { display: none; }

/* ── Row note popup ───────────────────────────────────────────────────────── */
.note-pop {
  position: fixed; inset: 0; z-index: 90; background: rgba(12, 5, 0, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.note-pop[hidden] { display: none; }
.note-pop__card {
  width: 100%; max-width: 380px; background: var(--paper); color: var(--paper-ink);
  border-radius: var(--r-xl); padding: 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.note-pop__card h2 { font-size: 24px; }
.note-pop__body { color: var(--paper-muted); white-space: pre-line; }

/* ── Game sheet (/welcome/, site/game-sheet.js) ──────────────────────────────
   A game's page shown over the home page: a bottom sheet on a phone, a centred
   card on a wide screen. Below the note popup and install steps (z 90), which
   can open over it. Chrome, so ground tokens. */
.gsheet {
  position: fixed; inset: 0; z-index: 80; background: rgba(12, 5, 0, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.gsheet[hidden] { display: none; }
:root.gsheet-open, :root.gsheet-open body { overflow: hidden; }
.gsheet__card {
  box-sizing: border-box; width: 100%; max-width: 760px;
  height: calc(100% - 24px - env(safe-area-inset-top));
  background: var(--bg-0); color: var(--ink);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.gsheet__card.is-dragging { transition: none; }
.gsheet__card.is-entering { animation: gsheetIn .26s cubic-bezier(.2, .8, .2, 1); }
.gsheet__card.is-leaving { transform: translateY(100%) !important; transition-duration: .2s; }
@keyframes gsheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.gsheet__bar {
  flex: none; position: relative; display: flex; align-items: center; gap: 4px;
  padding: 14px 8px 6px; border-bottom: 1px solid var(--line); touch-action: none;
}
.gsheet__grab {
  position: absolute; top: 6px; left: 50%; width: 44px; height: 4px; margin-left: -22px;
  border-radius: 2px; background: var(--line-strong);
}
.gsheet__btn {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 999px; background: none;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.gsheet__btn svg { width: 22px; height: 22px; }
.gsheet__btn:active { background: var(--accent-quiet); }
.gsheet__btn:disabled { color: var(--ink-faint); opacity: .45; cursor: default; }
.gsheet__btn[hidden] { display: none; }
.gsheet__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) { .gsheet__btn:not(:disabled):hover { background: var(--accent-quiet); } }
.gsheet__count { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-muted); min-width: 44px; text-align: center; }
.gsheet__count[hidden] { display: none; }
.gsheet__close { margin-left: auto; }
.gsheet__track {
  position: relative; flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none;
}
.gsheet__track::-webkit-scrollbar { display: none; }
.gsheet__slide {
  flex: 0 0 100%; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; overflow-anchor: none;
  scroll-snap-align: start; scroll-snap-stop: always; padding: 0 24px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  /* No scrollbar: a desktop's classic bar squares off the card's right
     corners, and the wheel, trackpad and touch scroll it all the same. */
  scrollbar-width: none;
}
.gsheet__slide::-webkit-scrollbar { display: none; }
/* In the sheet the head is one centred column: the art, then the title. */
.gsheet__slide .game-head { flex-direction: column; flex-wrap: nowrap; align-items: center; text-align: center; padding-top: 20px; padding-bottom: 24px; gap: 20px; }
.gsheet__slide .game-head h1 { font-size: clamp(30px, 6vw, 44px); }
.gsheet__slide .game-head__art { flex: none; width: 220px; max-width: 100%; box-sizing: border-box; }
.gsheet__slide .game-head__copy { flex: none; width: 100%; align-items: center; }
.gsheet__slide .game-stats { width: 100%; text-align: left; }
.gsheet__slide .sheet__scroll { overscroll-behavior-x: contain; }
.gsheet__msg { padding: 40px 0; color: var(--ink-muted); text-align: center; }
/* A wide screen is one centred card with the arrows on its edges. The card
   box spans the screen so the arrows can sit outside the track; the track is
   the card. */
@media (min-width: 720px) {
  .gsheet { align-items: center; padding: 24px 0; }
  .gsheet__card {
    --gs-w: min(760px, 100vw - 220px);
    position: relative; max-width: none; height: min(100%, 900px);
    background: none; box-shadow: none; border-radius: 0;
  }
  .gsheet__grab { display: none; }
  .gsheet__bar {
    position: static; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
    width: var(--gs-w); margin: 0 auto; padding: 0 0 12px; border-bottom: 0;
  }
  .gsheet__count { grid-column: 2; justify-self: center; min-width: 0; padding: 6px 14px; border-radius: 999px; background: var(--bg-0); }
  .gsheet__close { grid-column: 3; margin: 0; background: var(--bg-0); box-shadow: var(--shadow); }
  .gsheet__step {
    position: absolute; z-index: 2; top: calc(50% + 28px); transform: translateY(-50%);
    border: 1px solid var(--line); background: var(--bg-1); box-shadow: var(--shadow);
  }
  .gsheet__step--prev { left: calc(50% - var(--gs-w) / 2 - 22px); }
  .gsheet__step--next { right: calc(50% - var(--gs-w) / 2 - 22px); }
  .gsheet__step:disabled { opacity: .35; box-shadow: none; }
  @media (hover: hover) { .gsheet__step:not(:disabled):hover { background: var(--bg-2); border-color: var(--line-strong); } }
  .gsheet__track {
    width: var(--gs-w); margin: 0 auto;
    background: var(--bg-0); border-radius: var(--r-xl); box-shadow: var(--shadow);
  }
  .gsheet__card.is-leaving { transform: translateY(24px) !important; opacity: 0; transition: transform .2s ease, opacity .2s ease; }
  @keyframes gsheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .gsheet__card, .gsheet__card.is-leaving { transition: none; }
  .gsheet__card.is-entering { animation: none; }
}

@media (max-width: 560px) {
  /* Use in browser and Install web app share one row, half each. */
  .hero__ctas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero__ctas .btn { padding: 0 12px; white-space: nowrap; }
  .hero__ctas:has(> [data-install][hidden]) { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { padding-top: 40px; gap: 0; }
  .hero__art { display: none; }
  /* A phone stacks the head, so it centres: the art, then the title. */
  .game-head { gap: 20px; flex-direction: column; flex-wrap: nowrap; align-items: center; text-align: center; }
  .game-head__art { flex: none; width: 220px; max-width: 100%; box-sizing: border-box; }
  .game-head__copy { flex: none; width: 100%; align-items: center; }
  .game-stats { width: 100%; text-align: left; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog__rail { gap: 12px; }
  .catalog__rail > .catalog__item { flex-basis: 150px; }
  .tile__art { font-size: 16px; }
  .tabs { gap: 8px; }
  .cats__row {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -24px; padding: 2px 24px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .cats__row::-webkit-scrollbar { display: none; }
  .cats__row[data-end] { -webkit-mask-image: none; mask-image: none; }
  .chip { font-size: 14.5px; padding: 0 16px; }
  .cats__stage { display: block; max-width: none; }
  .cats__arrow { display: none; }
  .cats__panels { margin: 0 -24px; }
  .cats__panel { padding: 4px 24px 12px; }
  .podium { gap: 10px; }
  .podium .tile { padding-bottom: 9px; gap: 2px; }
  .podium .tile__art { font-size: 13px; padding: 8px; margin-bottom: 5px; }
  .podium .tile__name { font-size: 14px; line-height: 1.3; margin: 0 8px; }
  .podium .tile__meta { padding: 0 8px; }
  .tile__rank { top: 6px; left: 6px; min-width: 26px; height: 26px; padding: 0 6px; font-size: 12px; }
  .cats__dots { display: flex; }
  .podium__item { gap: 6px; }
  .tile-pills { gap: 3px; }
  .pill { height: 22px; padding: 0 2px; font-size: 11px; }
  .tabs a { font-size: 14px; }
  .about { padding: 28px; }
  .sheet { padding: 20px; }
}
