/* games.bodydex.app: calm, fast, no third-party requests. Fonts: Nunito + Fredoka (SIL OFL 1.1, fonts/LICENSE.txt).
   RULE: every colour comes from a token below. Each token has a light value and a dark value; nothing is set for one theme
   only. Per-game accents arrive as --a-l / --a-d / --s-l / --s-d (light/dark accent and soft tint) on <body> or a card, and
   the theme blocks pick one. Dark applies by system setting, or forced with <html data-theme="dark|light">. */
@font-face { font-family: "Nunito"; src: url(./fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(./fonts/fredoka.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

/* ---------------------------------------------------------------- tokens: light */
:root {
  color-scheme: light;
  --a-l: #9b4613; --a-d: #ffb58a; --s-l: #fbe3cc; --s-d: #3b2a1e;
  --bg: #fff8ee; --bg-glow: #fbeedb;
  --surface: #fffdf9; --surface-2: #fdf2e4; --surface-3: #f6e6d2;
  --ink: #2b1d14; --ink-2: #5a4232; --line: #e6d0b4; --line-2: #d8bc98;
  --on-accent: #ffffff;
  --mark-bg: #fff0a6; --mark-ink: #3f2d00; --mark-line: #d9b300;
  --ok-ink: #1d6a35;
  --shadow: 0 1px 0 rgba(120, 80, 40, .10), 0 12px 30px rgba(91, 58, 30, .10);
}
body, .game { --accent: var(--a-l); --soft: var(--s-l); }

/* ---------------------------------------------------------------- tokens: dark (system setting, unless forced light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17110d; --bg-glow: #241a13;
    --surface: #211912; --surface-2: #2b2018; --surface-3: #35281e;
    --ink: #f7ecdf; --ink-2: #d8c3ad; --line: #46372a; --line-2: #5c4837;
    --on-accent: #1a120d;
    --mark-bg: #5c4700; --mark-ink: #fff3c4; --mark-line: #a88600;
    --ok-ink: #8fd6a2;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .35);
  }
  :root:not([data-theme="light"]) body, :root:not([data-theme="light"]) .game { --accent: var(--a-d); --soft: var(--s-d); }
}
/* ---------------------------------------------------------------- tokens: dark (forced) — same values as above */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17110d; --bg-glow: #241a13;
  --surface: #211912; --surface-2: #2b2018; --surface-3: #35281e;
  --ink: #f7ecdf; --ink-2: #d8c3ad; --line: #46372a; --line-2: #5c4837;
  --on-accent: #1a120d;
  --mark-bg: #5c4700; --mark-ink: #fff3c4; --mark-line: #a88600;
  --ok-ink: #8fd6a2;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .35);
}
:root[data-theme="dark"] body, :root[data-theme="dark"] .game { --accent: var(--a-d); --soft: var(--s-d); }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background-color: var(--bg); color: var(--ink); scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(1200px 520px at 50% -8%, var(--bg-glow), var(--bg) 72%);
  background-repeat: no-repeat;
  font: 500 18px/1.65 "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); font-weight: 800; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: "Fredoka", "Nunito", ui-rounded, sans-serif; font-weight: 600; line-height: 1.2; color: var(--ink); }
b, strong { font-weight: 850; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 12px; padding: 8px 14px; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- header + footer */
.top { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 600 21px/1.2 "Fredoka", sans-serif; }
.brand .paw { color: var(--accent); display: flex; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 800; padding: 6px 10px; border-radius: 10px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: var(--surface-3); }
main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
footer { border-top: 1px solid var(--line); margin-top: 40px; color: var(--ink-2); background-color: var(--bg); }
footer .in { max-width: 1120px; margin: 0 auto; padding: 22px 16px 36px; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; font-size: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer a { color: var(--ink); }
footer p { margin: 0; }

/* ---------------------------------------------------------------- landing */
.hero { text-align: center; padding: 28px 0 16px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); margin: 0 0 10px; }
.hero p { font-size: 20px; color: var(--ink-2); max-width: 640px; margin: 0 auto; }
.games { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-top: 26px; }
.game { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.game .art { background: var(--soft); display: flex; justify-content: center; padding: 22px 0 6px; border-bottom: 2px solid var(--line); }
.game .art img { width: 200px; filter: drop-shadow(0 10px 14px rgba(40, 20, 10, .2)); }
.game .txt { padding: 18px 22px 22px; }
.game h2 { font-size: 30px; margin: 0; color: var(--accent); }
.tag { font-weight: 900; margin: 4px 0 8px; color: var(--ink); }
.game p { margin: 6px 0; }
.pill { display: inline-block; background: var(--soft); color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 900; font-size: 16px; }
.btn { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 14px; padding: 10px 18px; text-decoration: none; font-weight: 900; }
.links { font-size: 16px; color: var(--ink-2); }
.promise { margin: 44px auto 0; max-width: 780px; background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 22px 26px; }
.promise h2 { margin: 0 0 8px; font-size: 26px; }
.promise ul { margin: 0; padding-left: 20px; } .promise li { margin: 8px 0; }

/* ---------------------------------------------------------------- game page */
.hero.solo { display: flex; gap: 26px; align-items: center; text-align: left; background: var(--soft); color: var(--ink); border: 2px solid var(--line); border-radius: 26px; padding: 24px; margin-top: 10px; }
.hero.solo img { width: 200px; flex: none; }
.hero.solo h1 { color: var(--accent); margin-bottom: 6px; }
.hero.solo p { margin: 6px 0; font-size: 19px; color: var(--ink); }
.panels { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 22px; }
.panel { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 22px; padding: 20px 24px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 8px; font-size: 24px; }
.panel ul { margin: 0; padding-left: 20px; } .panel li { margin: 6px 0; }
.linklist { list-style: none; padding: 0 !important; }
.linklist li { margin: 0; border-top: 1px solid var(--line); }
.linklist li:first-child { border-top: 0; }
.linklist a { display: flex; flex-direction: column; gap: 0; padding: 10px 2px; text-decoration: none; }
.linklist a span { color: var(--ink-2); font-weight: 600; font-size: 15px; }
.linklist a:hover span { text-decoration: none; }

/* ---------------------------------------------------------------- legal + support documents */
.legal-wrap { display: grid; gap: 24px; margin-top: 12px; }
@media (min-width: 1000px) { .legal-wrap { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; } }
.toc { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 18px; padding: 4px 16px; font-size: 15.5px; line-height: 1.4; }
@media (min-width: 1000px) { .toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; } }
.toc summary { cursor: pointer; font: 600 17px/1.3 "Fredoka", sans-serif; color: var(--ink); padding: 10px 0; }
.toc ol { margin: 0 0 12px; padding-left: 0; list-style: none; counter-reset: t; }
.toc li { margin: 0; }
.toc a { display: block; color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 5px 8px; border-radius: 8px; }
.toc a:hover { color: var(--ink); background: var(--surface-3); }
.toc .n { display: inline-block; min-width: 1.6em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.toc .extra { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }

.legal { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 30px clamp(18px, 4vw, 44px) 36px; min-width: 0; }
.legal > * { max-width: 70ch; }
.legal > .wide, .legal > section, .legal > .glance { max-width: none; }
.legal section > * { max-width: 70ch; }
.legal section > .table-wrap, .legal section > .label-grid, .legal section > .callout { max-width: none; }
.doc-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.kicker { display: inline-block; margin: 0 0 10px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink); border-radius: 999px; padding: 3px 12px; font-weight: 900; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
.legal h1 { font-size: clamp(30px, 4.6vw, 44px); margin: 0 0 8px; }
.dates { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0 0; font-size: 15.5px; color: var(--ink-2); }
.dates div { display: flex; gap: 6px; }
.dates dt { font-weight: 800; color: var(--ink); }
.dates dd { margin: 0; }
.lede { font-size: 19px; color: var(--ink); }

.glance { background: var(--surface-2); color: var(--ink); border: 2px solid var(--line-2); border-radius: 20px; padding: 6px 22px 12px; margin: 20px 0 8px; }
.glance h2 { font-size: 22px; margin: 14px 0 6px; }
.glance ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px 28px; }
@media (min-width: 760px) { .glance ul { grid-template-columns: 1fr 1fr; } }
.legal .glance li { position: relative; padding: 4px 0 4px 30px; margin: 2px 0; line-height: 1.5; }
.glance li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 9px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }
.glance .more { margin: 8px 0 6px; font-size: 16px; color: var(--ink-2); }

.legal section { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 6px; }
.legal h2 { font-size: clamp(23px, 3vw, 27px); margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.legal h2 .n { flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--soft); color: var(--ink); border: 1px solid var(--line-2); font: 700 17px/1 "Nunito", sans-serif; transform: translateY(-3px); }
.legal h2 a.self { color: inherit; text-decoration: none; font-weight: inherit; }
.legal h3 { font-size: 20px; margin: 22px 0 4px; }
.legal p, .legal li { color: var(--ink); }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin: 6px 0; }
.inshort { background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 8px 14px; margin: 10px 0 12px; color: var(--ink); }
.inshort b:first-child { color: var(--ink); }
.callout { background: var(--surface-2); color: var(--ink); border: 2px solid var(--line-2); border-radius: 16px; padding: 4px 18px; margin: 14px 0; }
.conspicuous { font-weight: 800; }
.note { font-size: 16px; color: var(--ink-2); }
.backtop { display: inline-block; margin-top: 26px; font-size: 15.5px; }

/* tables: stacked cards on phones, a real table from 700px */
.table-wrap { margin: 14px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; color: var(--ink); }
table.data caption { text-align: left; font-weight: 800; padding: 0 0 6px; color: var(--ink); }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--surface-3); color: var(--ink); font-weight: 900; font-size: 14.5px; letter-spacing: .3px; }
table.data tbody th { font-weight: 850; color: var(--ink); }
@media (max-width: 699px) {
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data, table.data tbody, table.data tr, table.data th, table.data td { display: block; width: 100%; }
  table.data caption { display: block; width: 100%; font-size: 17px; padding-bottom: 10px; }
  table.data tr { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; margin: 0 0 10px; padding: 6px 4px; }
  table.data th, table.data td { border: 0; padding: 4px 12px; }
  table.data tbody th { font-size: 17px; padding-top: 8px; }
  table.data td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-2); }
}

/* App Store label mirror */
.label-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0; }
.label-card { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 16px; }
.label-card h4 { margin: 0 0 6px; font: 800 16px/1.3 "Nunito", sans-serif; color: var(--ink); }
.label-card ul { margin: 0; padding-left: 18px; font-size: 15.5px; }
.label-card li { margin: 3px 0; }
.label-card .why { color: var(--ink-2); }

/* placeholders he must fill (highlighted so they can't ship unnoticed) */
mark.ph { background: var(--mark-bg); color: var(--mark-ink); border: 1px dashed var(--mark-line); border-radius: 6px; padding: 0 5px; font-weight: 800; }

/* click-to-reveal email */
.email { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; vertical-align: middle; }
.email .addr { font-weight: 900; }
.email-btn { font: 800 16px/1.2 "Nunito", sans-serif; cursor: pointer; border-radius: 12px; padding: 8px 14px; border: 2px solid var(--accent); background: var(--surface); color: var(--ink); }
.email-btn.primary { background: var(--accent); color: var(--on-accent); }
.email-btn:hover { background: var(--surface-3); }
.email-btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.email .status { font-size: 15px; color: var(--ok-ink); font-weight: 800; }
.email .fallback { font-weight: 800; color: var(--ink); }
.contact-card { background: var(--surface-2); color: var(--ink); border: 2px solid var(--line-2); border-radius: 18px; padding: 14px 20px; margin: 14px 0; }
.contact-card p { margin: 6px 0; }

/* numbered clauses: 15.1, 15.2 … */
.legal ol.sub { list-style: none; padding-left: 0; }
.legal ol.sub > li { position: relative; padding-left: 3.1em; margin: 12px 0; }
.legal ol.sub > li::before { content: attr(data-n); position: absolute; left: 0; top: 0; font-weight: 900; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* support FAQ */
.faq h3 { margin-top: 24px; }
.faq p { margin: 6px 0 10px; }
.path { font-weight: 850; white-space: nowrap; }

@media (max-width: 620px) { .hero.solo { flex-direction: column; text-align: center; } .hero.solo img { width: 170px; } }
@media (max-width: 480px) {
  body { font-size: 17px; }
  .top { padding: 12px 16px; } .brand { font-size: 19px; } .top nav a { padding: 6px 8px; }
  .legal { border-radius: 20px; }
  .glance { padding: 4px 16px 10px; }
  .path { white-space: normal; }
}
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .top nav, .toc, .backtop, .email-btn, footer nav { display: none !important; }
  .legal, .glance, .callout, .inshort { box-shadow: none; border-color: #999; background: #fff; }
  a { color: #000; }
}
