/* ==========================================================================
   gamenook.ai marketing site.
   Tokens are copied from the Gamenook design system (tokens.json v3,
   phaseA-1.1), the same values the web app and the approved layout page use.
   If a token changes there, mirror it here.
   ========================================================================== */

:root {
  --surface: #faf6ef; --surface-raised: #ffffff; --surface-sunken: #f2ebdf;
  --ink: #1f1b16; --ink-muted: #5f574c; --ink-subtle: #6e6559;
  --line: #e2d8c7; --line-strong: #837867;
  --primary: #1b2a47; --primary-hover: #24365a; --on-primary: #efe6d6;
  --secondary: #efe6d6; --secondary-hover: #e6dbc8; --on-secondary: #1b2a47;
  --accent: #d0603a; --accent-text: #a5441f;
  --focus: #c0532c;
  --brand-navy: #1b2a47; --brand-terracotta: #d0603a; --brand-oat: #efe6d6;
  --table-felt: #20304f; --table-rail: #5a3a22; --table-inlay: #b8955a;
  --team-a: #17707a; --team-b: #a86a00; --team-c: #a5441f; --team-d: #2f5596;
  --shadow-1: 0 1px 2px rgba(31,27,22,0.08), 0 1px 1px rgba(31,27,22,0.04);
  --shadow-2: 0 4px 12px rgba(31,27,22,0.10), 0 1px 3px rgba(31,27,22,0.06);
  --shadow-3: 0 12px 32px rgba(31,27,22,0.14), 0 2px 6px rgba(31,27,22,0.08);

  --font-display: Gabarito, system-ui, sans-serif;
  --font-ui: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-pill: 999px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --max: 1160px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f1626; --surface-raised: #172036; --surface-sunken: #0a101d;
    --ink: #f3eee6; --ink-muted: #aab3c5; --ink-subtle: #8f9ab0;
    --line: #26314a; --line-strong: #6d7b98;
    --primary: #efe6d6; --primary-hover: #ffffff; --on-primary: #1b2a47;
    --secondary: #26314a; --secondary-hover: #2f3b57; --on-secondary: #f3eee6;
    --accent: #e57a52; --accent-text: #f0956f;
    --focus: #f0956f;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.45);
    --shadow-3: 0 12px 32px rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font-ui); font-size: 1.0625rem; line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-text); }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 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 { position: absolute; left: var(--gutter); top: -60px; z-index: 60; background: var(--surface-raised); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
.skip:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter); }
.container--prose { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter); }
.eyebrow { display: inline-block; font-family: var(--font-ui); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill);
  font-family: var(--font-ui); font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--secondary); color: var(--on-secondary); border-color: var(--line); }
.btn--secondary:hover { background: var(--secondary-hover); }
.btn--l { min-height: 52px; padding: 0 26px; font-size: 1.0625rem; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 160ms var(--ease); }
.nav.scrolled { border-bottom-color: var(--line); }
.nav__inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter); min-height: 68px; display: flex; align-items: center; gap: 24px; }
.nav__logo { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.nav__logo img { height: 30px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__links a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: var(--radius-sm); }
.nav__links a:not(.btn):hover { background: var(--surface-sunken); }
.nav__links .btn { margin-left: 8px; }
.nav__toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: var(--ink); }
.nav__toggle span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2);
    padding: 8px var(--gutter-r) 16px var(--gutter);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a:not(.btn) { min-height: 48px; padding: 0 8px; }
  .nav__links .btn { margin: 8px 0 0; }
}

/* ---------- hero ---------- */
.hero { padding: 56px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.hero__title { font-size: clamp(2.5rem, 5.6vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.025em; margin: 14px 0 20px; }
.hero__lead { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-muted); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__note { margin-top: 16px; font-size: 0.9375rem; color: var(--ink-subtle); }
.hero__art { position: relative; }
.hero__frame { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-3); background: var(--table-felt); aspect-ratio: 16 / 10; }
.hero__frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__badge { position: absolute; left: -18px; bottom: -22px; width: 88px; height: 88px; border-radius: 22px; background: var(--surface-raised); box-shadow: var(--shadow-2); display: grid; place-items: center; }
.hero__badge svg { width: 64px; height: 64px; }
@media (max-width: 900px) {
  .hero { padding: 32px 0 56px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__badge { left: 12px; bottom: -20px; width: 72px; height: 72px; border-radius: 18px; }
  .hero__badge svg { width: 52px; height: 52px; }
}

/* the mark's seats light up one at a time (decorative) */
.mark-anim .seat { animation: seat 6s var(--ease) infinite; }
.mark-anim .seat[data-seat="1"] { animation-delay: 1.5s; }
.mark-anim .seat[data-seat="2"] { animation-delay: 3s; }
.mark-anim .seat[data-seat="3"] { animation-delay: 4.5s; }
@keyframes seat { 0%, 20%, 100% { fill: var(--seat-fill, #7f8ba4); } 8% { fill: var(--brand-terracotta); } }

/* ---------- sections ---------- */
.section { padding: 80px 0; }
.section--sunken { background: var(--surface-sunken); }
.section__head { max-width: 720px; margin-bottom: 40px; }
.section__title { font-size: clamp(1.875rem, 3.6vw, 2.75rem); font-weight: 750; line-height: 1.1; margin-top: 10px; }
.section__lead { margin-top: 14px; font-size: 1.125rem; color: var(--ink-muted); }
@media (max-width: 640px) { .section { padding: 56px 0; } }

/* ---------- devices ---------- */
.devices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .devices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .devices { grid-template-columns: 1fr; } }
.device { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.device__art { aspect-ratio: 16 / 10; background: var(--table-felt); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.device__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.device figcaption { font-size: 0.9375rem; color: var(--ink-muted); line-height: 1.45; }
.device figcaption strong { display: block; color: var(--ink); font-size: 1rem; }

/* ---------- games ---------- */
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 980px) { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .games { grid-template-columns: 1fr; } }
.game { display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.game__art { aspect-ratio: 16 / 10; background: var(--table-felt); }
.game__art img { width: 100%; height: 100%; object-fit: cover; }
.game__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 22px; flex: 1; }
.game__name { font-size: 1.375rem; font-weight: 700; }
.game__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink-muted); font-size: 0.875rem; font-weight: 600; }
.game__blurb { color: var(--ink-muted); font-size: 1rem; line-height: 1.55; }
.game__link { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.game__link:hover { text-decoration: underline; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; margin-bottom: 14px; }
.feature__icon svg { width: 24px; height: 24px; }
.feature__title { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.feature__body { color: var(--ink-muted); }

/* ---------- tables at once ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.tables { display: grid; gap: 12px; }
.tablerow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.tablerow img { width: 88px; height: 55px; border-radius: 8px; object-fit: cover; flex: none; }
.tablerow__text { flex: 1; min-width: 0; }
.tablerow__name { font-weight: 700; }
.tablerow__sub { font-size: 0.9375rem; color: var(--ink-muted); }
.tag { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 0.875rem; font-weight: 700; }
.tag--turn { background: #e3f1f1; color: #0f5a62; }
.tag--wait { background: var(--surface-sunken); color: var(--ink-muted); }
@media (prefers-color-scheme: dark) { .tag--turn { background: #12313a; color: #5cc3c9; } }
@media (max-width: 420px) { .tablerow img { width: 64px; height: 40px; } }
.checklist { display: grid; gap: 12px; margin-top: 20px; }
.checklist li { display: flex; gap: 10px; }
.checklist li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: var(--brand-terracotta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }

/* ---------- platforms ---------- */
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .platforms { grid-template-columns: 1fr; } }
.platform { padding: 24px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.platform svg { width: 28px; height: 28px; color: var(--ink); margin-bottom: 12px; }
.platform__name { font-size: 1.25rem; font-weight: 700; }
.platform__meta { color: var(--ink-muted); margin-top: 4px; }

/* ---------- call to action ---------- */
.cta { background: var(--brand-navy); color: var(--brand-oat); border-radius: var(--radius-xl); padding: 56px 40px; text-align: center; position: relative; overflow: hidden; }
.cta h2 { color: var(--brand-oat); font-size: clamp(1.875rem, 4vw, 2.75rem); font-weight: 800; }
.cta p { margin: 14px auto 0; max-width: 34em; color: #d9cfbd; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.cta .btn--primary { background: var(--brand-terracotta); color: #1f1b16; }
.cta .btn--primary:hover { background: #e57a52; }
.cta .btn--secondary { background: transparent; color: var(--brand-oat); border-color: rgba(239,230,214,0.4); }
.cta .btn--secondary:hover { background: rgba(239,230,214,0.08); }
@media (max-width: 560px) { .cta { padding: 40px 20px; } }

/* ---------- prose (support, privacy, terms, contact) ---------- */
.page { padding: 48px 0 80px; }
.page__head { margin-bottom: 28px; }
.page__title { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 800; margin-top: 8px; }
.prose h2 { font-size: 1.625rem; font-weight: 700; margin: 40px 0 12px; }
.prose h3 { font-size: 1.1875rem; font-weight: 700; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul { list-style: disc; padding-left: 1.4em; margin: 0 0 14px; }
.prose ol { list-style: decimal; padding-left: 1.4em; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose code { font-size: 0.9em; background: var(--surface-sunken); padding: 1px 6px; border-radius: 4px; }
.notice p { margin: 0; }
.section--flush { padding-top: 0; }
.btn--spaced { margin-top: 8px; }
.notice { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 28px; border-radius: var(--radius-md); background: #fbefd6; color: #5c3900; border: 1px solid #ecd3a0; }
@media (prefers-color-scheme: dark) { .notice { background: #3a2c12; color: #f2d79b; border-color: #5a4520; } }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 24px; }
@media (max-width: 600px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { padding: 20px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.contact-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.contact-card p { margin: 0 0 8px; color: var(--ink-muted); }
.contact-card a { display: inline-block; padding: 10px 0; min-height: 44px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; margin-top: 24px; }
.footer__inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter); display: grid; grid-template-columns: auto 1fr; gap: 16px 32px; align-items: center; }
.footer__logo { display: inline-flex; align-items: center; min-height: 44px; }
.footer__logo img { height: 26px; width: auto; }
.footer__tag { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; margin-top: 2px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink-muted); text-decoration: none; font-weight: 600; }
.footer__links a:hover { color: var(--ink); text-decoration: underline; }
.footer__copy { grid-column: 1 / -1; font-size: 0.9375rem; color: var(--ink-subtle); }
@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr; }
  .footer__links { justify-content: flex-start; margin-left: -10px; }
}

/* ---------- rules pages (generated by scripts/dev/build_rules_site.py in the gamenook repo) ---------- */
.nav__links a[aria-current="page"]:not(.btn) { background: var(--surface-sunken); }
a.game__art { display: block; }
.crumbs { margin-bottom: 12px; font-size: 0.9375rem; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.rules__head { margin-bottom: 24px; }
.rules__sub { margin-top: 10px; max-width: 40em; font-size: 1.1875rem; color: var(--ink-muted); }
.rules__meta { margin-top: 14px; }
.rules__layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.rules__text { max-width: 760px; min-width: 0; }
.rules__text > :first-child { margin-top: 0; }
.rules__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.rules__text h2 { scroll-margin-top: 84px; }
.rules__text h3, .rules__text .example, .rules__text dt, .rules__text .comps li { scroll-margin-top: 84px; }

/* "On this page": a sticky rail on wide screens, a collapsed block above the text on phones. */
.toc { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.toc summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; font-family: var(--font-display); font-weight: 700; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms var(--ease); }
.toc details[open] > summary::after { transform: rotate(-135deg); }
.toc__list { padding: 0 8px 10px; margin: 0; list-style: none; }
.toc__list ul { list-style: none; margin: 0 0 4px; padding-left: 14px; }
.toc__list a { display: flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); line-height: 1.3; }
.toc__list ul a { color: var(--ink-muted); font-size: 0.9375rem; }
.toc__list a:hover { background: var(--surface-sunken); }
@media (min-width: 1024px) {
  .toc__list a { min-height: 32px; padding: 4px 8px; }
  .toc summary { cursor: default; pointer-events: none; }
  .toc summary::after { display: none; }
}
@media (max-width: 1023px) {
  .rules__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; max-height: none; }
  .toc__details:not([open]) .toc__list { display: none; }
}

.glance { margin: 0 0 24px; padding: 18px 20px; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-md); }
.glance__label, .callout__label, .example__title span { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.prose .glance ul { list-style: none; padding: 0; margin: 0; }
.prose .glance li { margin: 0 0 6px; }
.prose .glance li:last-child { margin: 0; }
.callout { margin: 20px 0; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); }
.callout--tip { border-left-color: var(--team-a); }
.callout--watchout { border-left-color: var(--accent); }
.callout > :last-child { margin-bottom: 0; }
.prose .callout p.callout__label { margin-bottom: 6px; }
.example { margin: 20px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.prose .example p { margin: 0 0 10px; }
.prose .example p.example__title { font-weight: 700; }
.example__title span { display: block; margin-bottom: 2px; }
.example__state { font-style: italic; color: var(--ink-muted); }
.prose .example ol { margin-bottom: 10px; }
.prose .example p.example__outcome { margin-bottom: 0; font-weight: 600; }
/* The inventory that opens every rules page: one picture of each card type with its count (engine-sourced, see the generator). */
.prose ul.cards { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.cards .card { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); scroll-margin-top: 84px; }
.card__face { display: block; width: 96px; max-width: 100%; height: auto; justify-self: center; border-radius: 6px; }
.prose .cards p { margin: 0 0 6px; }
.prose .cards p:last-child { margin: 0; }
.comps li.comp--pic { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.comp__pic { display: block; width: 96px; max-width: 100%; height: auto; justify-self: center; border-radius: 6px; }
.chip--screen { margin-left: 2px; background: transparent; border: 1px dashed var(--line-strong); }
.rules__text .anchor-alias { display: block; height: 0; scroll-margin-top: 84px; }
@media (max-width: 400px) { .comps li.comp--pic { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } .comp__pic { width: 72px; } }
.prose p.cards__side { margin: 18px 0 8px; color: var(--ink-muted); }
.prose p.cards__total { margin: 0 0 18px; font-weight: 700; }
@media (max-width: 400px) {
  .cards .card { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .card__face { width: 72px; }
}
.prose ul.comps { list-style: none; padding: 0; display: grid; gap: 12px; }
.comps li { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.prose .comps p { margin: 0 0 6px; }
.prose .comps p:last-child { margin: 0; }
.comp__name { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.glossary dt { margin-top: 18px; font-weight: 700; font-family: var(--font-display); }
.glossary dd { margin: 4px 0 0; }
.prose a.term { text-decoration-style: dotted; text-underline-offset: 0.2em; }

.rtable { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 1rem; }
.rtable th, .rtable td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rtable th { font-size: 0.9375rem; background: var(--surface-sunken); }
@media (max-width: 700px) {
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
  .rtable td { border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .rtable td:last-child { border-bottom: 0; }
  .rtable td::before { content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 700; color: var(--ink-subtle); }
}

/* ---------- rules hub (rules/index.html, maintained by hand) ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-muted); }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--ink-subtle); }
.crumbs [aria-current="page"] { font-weight: 600; color: var(--ink); }
.rules-hub .rules__head { margin-bottom: 20px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.quick a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; }
.quick a:hover { background: var(--surface-sunken); border-color: var(--line-strong); }
.hub-game { scroll-margin-top: 84px; }
.hub-game--editions { margin-bottom: 24px; padding: 24px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.hub-game__head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.hub-game__name { font-size: 1.5rem; font-weight: 700; }
.editions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.edition { display: flex; flex-direction: column; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.edition .game__body { padding: 16px 16px 18px; }
.edition .chip { background: var(--surface-raised); }
.edition__name { font-size: 1.25rem; font-weight: 700; }
.hub-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.hub-games .hub-game { display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); }
@media (max-width: 980px) {
  .editions, .hub-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .editions, .hub-games { grid-template-columns: 1fr; }
  .hub-game--editions { padding: 16px; }
}

/* ---------- phones and tablets: store badges instead of "Launch app" (js/site.js adds .handheld and the badges) ---------- */
.store-badges { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.store-badge { display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; min-height: 44px; padding: 6px 16px; border-radius: var(--radius-md, 12px); border: 1px solid var(--line); background: var(--surface-sunken); color: var(--ink); text-decoration: none; font-family: var(--font-ui); }
.store-badge strong { font-size: 1rem; line-height: 1.25rem; }
.store-badge small { font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-muted); }
/* Only the Launch buttons (exactly https://app.gamenook.ai); the Read the rules links go to https://app.gamenook.ai/rules/<id> and stay. */
.handheld a[href="https://app.gamenook.ai"] { display: none; }
@media (scripting: enabled) { html:not(.desk):not(.handheld) a[href="https://app.gamenook.ai"] { visibility: hidden; } }
.hero__note .note-handheld { display: none; }
.handheld .hero__note .note-desktop { display: none; }
.handheld .hero__note .note-handheld { display: inline; }
@media (hover: none) and (pointer: coarse) { html:not(.desk) .hero__note .note-desktop { display: none; } html:not(.desk) .hero__note .note-handheld { display: inline; } }
.nav__links .store-badges { margin-left: 8px; }
@media (max-width: 860px) { .nav__links .store-badges { margin: 8px 0 0; flex-direction: column; align-items: stretch; } }

/* ---------- /open hand-off page (js/open.js) ---------- */
.open-actions { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; margin-top: 20px; }
.open-actions .store-badges { list-style: none; padding: 0; margin: 0; }

/* In-app screenshots: a bounded row with native scrolling and no animation. */
.app-shots { display: flex; gap: 24px; overflow-x: auto; max-width: 100%; padding: 6px 4px 18px; scroll-behavior: auto; }
.app-shots:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.app-shot { flex: 0 0 min(240px, 80vw); min-width: 0; margin: 0; }
.app-shot img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--line); }
.app-shot figcaption { margin-top: 12px; font-size: 1rem; line-height: 1.5; color: var(--ink); }
