/* Online Games for Couples – design system
   Warm paper background, one rose accent, a teal second-player color, serif display type.
   One block per component, in page order. Media queries sit next to the component they change. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee7;
  --ink: #1e1917;
  --ink-2: #4a413d;
  --muted: #7a6f69;
  --line: #e8e0d7;
  --line-2: #d9cfc4;
  --accent: #c4405f;
  --accent-2: #a83352;
  --accent-soft: #fbe9ee;
  --accent-ink: #8c2a45;
  --p1: #c4405f;
  --p1-soft: #fbe9ee;
  --p1-ink: #8c2a45;
  --p2: #2e7d6b;
  --p2-soft: #e2f2ed;
  --p2-ink: #1f5a4c;
  --match: #b57e1b;
  --match-soft: #fbf1dc;
  --match-ink: #7a5311;
  --shadow: 0 1px 2px rgba(30, 25, 23, 0.04), 0 18px 44px -22px rgba(30, 25, 23, 0.28);
  --shadow-sm: 0 1px 2px rgba(30, 25, 23, 0.05), 0 6px 18px -10px rgba(30, 25, 23, 0.18);
  --radius: 22px;
  --radius-sm: 12px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171412;
    --surface: #1f1b18;
    --surface-2: #27221f;
    --ink: #f2ece6;
    --ink-2: #cfc5bd;
    --muted: #a3978f;
    --line: #2f2925;
    --line-2: #3d3630;
    --accent: #e26a88;
    --accent-2: #f08aa3;
    --accent-soft: #3a1f28;
    --accent-ink: #f4b3c3;
    --p1: #e26a88;
    --p1-soft: #3a1f28;
    --p1-ink: #f4b3c3;
    --p2: #4fb39d;
    --p2-soft: #17302a;
    --p2-ink: #a8e2d3;
    --match: #d9a441;
    --match-soft: #3a2d14;
    --match-ink: #f3d597;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -22px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px -10px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171412;
  --surface: #1f1b18;
  --surface-2: #27221f;
  --ink: #f2ece6;
  --ink-2: #cfc5bd;
  --muted: #a3978f;
  --line: #2f2925;
  --line-2: #3d3630;
  --accent: #e26a88;
  --accent-2: #f08aa3;
  --accent-soft: #3a1f28;
  --accent-ink: #f4b3c3;
  --p1: #e26a88;
  --p1-soft: #3a1f28;
  --p1-ink: #f4b3c3;
  --p2: #4fb39d;
  --p2-soft: #17302a;
  --p2-ink: #a8e2d3;
  --match: #d9a441;
  --match-soft: #3a2d14;
  --match-ink: #f3d597;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -22px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px -10px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 0.4em; }
.prose ol li, .prose ul li { margin-bottom: 0.5em; }

/* ---------- Header: brand, All games link, theme toggle ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; flex: none;
}
.brand span { white-space: nowrap; }
.brand[aria-current="page"] span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.header-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; }
.theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; } }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-all {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px 6px 12px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.9rem; font-weight: 600; line-height: 1.2; color: var(--ink-2); background: var(--surface);
  text-decoration: none; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nav-all:hover { border-color: var(--accent); color: var(--accent-ink); }
.nav-all[aria-current="page"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.nav-all-icon { width: 16px; height: 16px; flex: none; }
@media (max-width: 480px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .brand-mark { width: 34px; height: 34px; }
}

/* ---------- Page top: breadcrumbs, H1 and one line ---------- */
.breadcrumbs { font-size: 0.88rem; color: var(--muted); padding-top: 14px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line-2); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-ink); }
.hero { padding: clamp(20px, 3vw, 36px) 0 8px; }
.hero-inner { max-width: 720px; margin-inline: auto; text-align: center; }
.lead { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem); color: var(--ink-2); max-width: 60ch; margin: 0 auto; }
@media (max-width: 720px) { .hero { padding-top: 16px; } .lead { font-size: 0.98rem; } }
.hero-min { padding: clamp(18px, 3vw, 30px) 0 4px; }
.hero-min h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 0.25em; }
.hero-min .lead { font-size: 0.95rem; color: var(--muted); }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
body.page-home {
  background-image: radial-gradient(55% 38% at 12% -4%, rgba(196, 64, 95, 0.10), transparent 70%), radial-gradient(45% 32% at 92% 6%, rgba(46, 125, 107, 0.09), transparent 70%);
  background-repeat: no-repeat;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.page-home { background-image: radial-gradient(55% 38% at 12% -4%, rgba(226, 106, 136, 0.12), transparent 70%), radial-gradient(45% 32% at 92% 6%, rgba(79, 179, 157, 0.10), transparent 70%); } }
:root[data-theme="dark"] body.page-home { background-image: radial-gradient(55% 38% at 12% -4%, rgba(226, 106, 136, 0.12), transparent 70%), radial-gradient(45% 32% at 92% 6%, rgba(79, 179, 157, 0.10), transparent 70%); }

/* ---------- Tool card and shared game UI ---------- */
.tool { padding: 12px 0 18px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(20px, 3vw, 36px);
  max-width: 860px; margin-inline: auto;
}
@media (max-width: 720px) { .tool-card { padding: 16px 14px 18px; } }
.prompt-label { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 8px; text-align: center; }
.badge {
  display: inline-block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; vertical-align: middle; }
.tag-p1 { background: var(--p1-soft); color: var(--p1-ink); }
.tag-p2 { background: var(--p2-soft); color: var(--p2-ink); }

/* A-or-B options (the choice card styles them further below) */
.option-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 18px; }
.or { align-self: center; font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 1.1rem; }
.opt {
  position: relative; background: var(--surface-2); border: 2px solid transparent; border-radius: 16px; padding: 22px 18px;
  font-size: 1.05rem; line-height: 1.4; text-align: center; cursor: pointer; min-height: 110px;
  display: flex; align-items: center; justify-content: center; transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
/* hover only where there is a real pointer: on touch screens a tapped option keeps :hover and looks picked */
@media (hover: hover) { .opt:hover:not(:disabled):not(.no-hover) { border-color: var(--accent); transform: translateY(-2px); } }
.opt:disabled { cursor: default; }
.opt .picks { position: absolute; top: -10px; right: 10px; display: flex; gap: 4px; }
@media (max-width: 720px) {
  .option-grid { grid-template-columns: 1fr; }
  .or { text-align: center; }
}

.status { text-align: center; color: var(--ink-2); margin: 0 0 16px; min-height: 1.6em; }
.status b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.1s, border-color 0.15s;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.86rem; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent); color: #fff; }
.btn-icon { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-quiet { background: transparent; font-weight: 500; color: var(--muted); border-color: transparent; }
.btn-quiet:hover { color: var(--accent-ink); border-color: var(--line-2); }

/* Lists that open under the questions deck (saved questions, a 21 questions list) */
.panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel h3 { font-size: 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel ol, .panel ul { margin: 0 0 12px; padding-left: 1.4em; }
.panel li { margin-bottom: 8px; }
.panel .btn { min-height: 36px; padding: 6px 14px; font-size: 0.86rem; }
.fav-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fav-list button { flex: none; }
.empty { color: var(--muted); font-size: 0.92rem; }

/* Home: one choice question under an illustrated cover */
.choice-shell { padding: 0; overflow: hidden; }
.choice-cover { position: relative; height: 300px; background: var(--surface-2); }
.choice-cover picture, .choice-cover img { display: block; width: 100%; height: 100%; }
.choice-cover img {
  object-fit: cover; object-position: center 22%; border: 0; border-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,0.6) 80%, transparent 100%); mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,0.6) 80%, transparent 100%);
}
.choice-cover .img-placeholder { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.choice-body { position: relative; margin-top: -40px; padding: 0 clamp(18px, 3vw, 32px) clamp(18px, 2.4vw, 24px); }
.choice-body .prompt-label { font-family: var(--font-display); font-style: italic; font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: var(--accent-ink); margin-bottom: 14px; }
.choice-body .option-grid { transition: opacity 0.18s ease, transform 0.18s ease; }
.choice-body .option-grid.is-switching { opacity: 0; transform: translateY(6px); pointer-events: none; }
/* Colors change slowly on purpose: the first pick lights up instantly (.is-locking) and then eases back to the unselected
   look, and the reveal fades the two picks in. A new card swaps colors with transitions off (.is-switching). */
.choice-body .opt {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: 20px; min-height: 150px; padding: 26px 24px;
  font-family: var(--font-display); font-size: clamp(1.2rem, 1rem + 0.9vw, 1.75rem); line-height: 1.28; color: var(--ink);
  transition: background-color 0.6s ease, border-color 0.6s ease, color 0.6s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.choice-body .option-grid.is-switching .opt { transition: none; }
/* same rule for the home card, where a leftover :hover would give away the hidden first pick */
@media (hover: hover) { .choice-body .opt:hover:not(:disabled):not(.no-hover) { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); background: var(--surface); transition-duration: 0.15s; } }
.choice-body .opt.is-locking { background: var(--p1-soft); border-color: var(--p1); color: var(--p1-ink); transition-duration: 0s; }
.choice-body .opt.is-p1 { background: var(--p1-soft); border-color: var(--p1); color: var(--p1-ink); }
.choice-body .opt.is-p2 { background: var(--p2-soft); border-color: var(--p2); color: var(--p2-ink); }
.choice-body .opt.is-both { background: var(--match-soft); border-color: var(--match); color: var(--match-ink); }
.choice-body .picks .tag { animation: tag-in 0.4s ease both; }
@keyframes tag-in { from { opacity: 0; transform: translateY(4px); } }
.choice-body .or { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font-size: 1rem; justify-self: center; }
/* Nothing below the status line keeps empty space: the tally opens the first time there is something to count,
   and OGC.say() glides the status height when a message wraps to another number of lines. */
.choice-body .status { margin: 16px 0 10px; color: var(--ink-2); transition: opacity 0.14s ease, height 0.25s ease; }
.choice-body .status.is-fading { opacity: 0; }
.choice-body .status.is-match b { color: var(--match-ink); }
.choice-body .status.is-diff b { color: var(--accent-ink); }
.choice-body .tally { display: grid; grid-template-rows: 0fr; text-align: center; color: var(--muted); margin: 0; opacity: 0; transition: grid-template-rows 0.3s ease, opacity 0.3s ease, margin 0.3s ease; }
.choice-body .tally > span { min-height: 0; overflow: hidden; }
.choice-body .tally.is-on { grid-template-rows: 1fr; opacity: 1; margin: -4px 0 10px; }
/* "Skip this one" and "Next question" share one slot of the same height, so the card does not jump between steps */
.choice-actions { align-items: center; gap: 6px 10px; }
.choice-actions [data-act] { min-height: 48px; }
@media (max-width: 480px) { .choice-actions { flex-direction: column; } }
/* On the would-you-rather and this-or-that pages the same card has no cover picture and a small category menu */
.choice-shell.no-cover .choice-body { margin-top: 0; padding-top: clamp(20px, 3vw, 30px); }
.choice-cat { position: relative; display: inline-flex; align-items: center; }
.choice-cat select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 0.86rem; font-weight: 500; color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 999px; min-height: 36px; padding: 6px 34px 6px 14px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.choice-cat select:hover, .choice-cat select:focus-visible { color: var(--accent-ink); border-color: var(--line-2); }
.choice-cat .icon-chevron { position: absolute; right: 12px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
@media (max-width: 720px) {
  .choice-cover { height: 200px; }
  .choice-cover img { object-position: center 30%; }
  .choice-body { margin-top: -30px; }
  .choice-body .opt { min-height: 100px; padding: 18px 16px; }
}

/* ---------- The other game cards: same shell as the choice card, one interaction each ---------- */
/* Truth or dare: a wheel that slows down on truth or dare, beside the card it deals */
.tod-stage { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; margin: 6px 0 4px; }
.wheel { position: relative; width: 230px; aspect-ratio: 1; }
.wheel-pointer { position: absolute; top: -8px; left: 50%; z-index: 2; transform: translateX(-50%); width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 19px solid var(--ink); }
.wheel-button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: var(--shadow); }
.wheel-button:disabled { cursor: default; }
.wheel-disc { display: block; width: 100%; height: 100%; border-radius: 50%; transition: transform 2.6s cubic-bezier(0.12, 0.8, 0.2, 1); }
.seg { stroke: var(--surface); stroke-width: 2; }
.seg-truth { fill: var(--p2-soft); }
.seg-dare { fill: var(--accent-soft); }
.seg-label { font: 600 10px var(--font-body); letter-spacing: 0.14em; }
.seg-truth + .seg-label { fill: var(--p2-ink); }
.seg-dare + .seg-label { fill: var(--accent-ink); }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 66px; height: 66px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: var(--accent-ink); transition: opacity 0.2s, border-color 0.2s;
}
.wheel-button:disabled .wheel-hub { opacity: 0.45; }
@media (hover: hover) { .wheel-button:not(:disabled):hover .wheel-hub { border-color: var(--accent); } }
.tod-card { min-height: 180px; display: grid; align-content: center; gap: 10px; padding: 22px 24px; border-radius: 18px; border: 1px solid transparent; background: var(--surface-2); transition: opacity 0.15s ease; }
.tod-card.is-switching { opacity: 0; }
.tod-card.is-prompt { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.tod-kicker { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tod-text { margin: 0; font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); line-height: 1.35; color: var(--muted); text-wrap: balance; }
.tod-card.is-prompt .tod-text { color: var(--ink); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem); }
.badge-truth { background: var(--p2-soft); color: var(--p2-ink); }
@media (max-width: 720px) {
  .tod-stage { grid-template-columns: 1fr; justify-items: center; gap: 20px; }
  .wheel { width: 190px; }
  .tod-card { width: 100%; min-height: 150px; text-align: center; }
}

/* Never have I ever: tap your own hand to put a finger down */
.nh-statement { font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.3; text-align: center; max-width: 26ch; min-height: 2.6em; margin: 0 auto 22px; text-wrap: balance; transition: opacity 0.16s ease, transform 0.16s ease; }
.nh-statement.is-switching { opacity: 0; transform: translateY(6px); }
.hands { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hand { display: grid; justify-items: center; gap: 10px; padding: 16px 12px 14px; border-radius: 18px; border: 2px solid transparent; font: inherit; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.hand.p1 { color: var(--p1); background: color-mix(in srgb, var(--p1-soft) 55%, var(--surface)); }
.hand.p2 { color: var(--p2); background: color-mix(in srgb, var(--p2-soft) 55%, var(--surface)); }
.hand.p1[aria-pressed="true"] { border-color: var(--p1); }
.hand.p2[aria-pressed="true"] { border-color: var(--p2); }
@media (hover: hover) { .hand:not([aria-pressed="true"]):hover { border-color: var(--line-2); } }
.hand-name { font-weight: 600; color: var(--ink); }
.hand-fingers { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.hand .finger { width: 9px; height: 32px; border-radius: 5px; background: currentColor; transition: height 0.35s ease, opacity 0.35s ease; }
.hand .finger.gap { margin-right: 10px; }
.hand .finger.down { height: 10px; opacity: 0.3; }
.hand-left { font-size: 0.82rem; color: var(--muted); }
@media (max-width: 480px) {
  .hands { gap: 10px; }
  .hand { padding: 14px 8px 12px; }
  .hand-fingers { gap: 3px; height: 28px; }
  .hand .finger { width: 7px; height: 26px; }
  .hand .finger.gap { margin-right: 6px; }
  .hand .finger.down { height: 8px; }
}

/* Questions: a small deck; swipe the top card away or tap Next */
.q-stack { position: relative; height: 250px; margin: 4px 0 22px; }
.q-card { position: absolute; inset: 0; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.q-back1 { transform: translateY(12px) scale(0.95); opacity: 0.85; }
.q-back2 { transform: translateY(24px) scale(0.9); opacity: 0.55; }
.q-top {
  display: grid; align-content: center; justify-items: center; gap: 12px; padding: 28px 58px; text-align: center; box-shadow: var(--shadow);
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.26s ease, opacity 0.26s ease;
}
.q-top.is-dragging { transition: none; cursor: grabbing; }
.q-top.is-leaving { opacity: 0; }
.q-top.is-arriving { transition: none; opacity: 0; transform: translateY(16px) scale(0.95); }
.q-cat { margin: 0; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); }
.q-text { margin: 0; max-width: 26ch; font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.3; text-wrap: balance; }
.q-heart {
  position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.q-heart svg { width: 20px; height: 20px; }
.q-heart[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.q-heart[aria-pressed="true"] svg { fill: currentColor; }
.q-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 6px 0 0; }
@media (max-width: 720px) { .q-stack { height: 270px; } .q-top { padding: 30px 22px 26px; } }

/* How well do you know me: a 0–10 slider; both marks appear on the reveal */
.km-q { font-family: var(--font-display); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.3; text-align: center; max-width: 24ch; min-height: 2.6em; margin: 0 auto 4px; text-wrap: balance; transition: opacity 0.16s ease, transform 0.16s ease; }
.km-q.is-switching { opacity: 0; transform: translateY(6px); }
.scale { position: relative; max-width: 620px; margin: 0 auto; padding-top: 62px; }
.scale-input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.scale-input::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, color-mix(in srgb, var(--p2) 35%, var(--surface)), color-mix(in srgb, var(--accent) 35%, var(--surface))); }
.scale-input::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, color-mix(in srgb, var(--p2) 35%, var(--surface)), color-mix(in srgb, var(--accent) 35%, var(--surface))); }
.scale-input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); transition: opacity 0.2s; }
.scale-input::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); }
.scale-input:focus-visible { outline: none; }
.scale-input:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale.is-revealed .scale-input { cursor: default; }
.scale.is-revealed .scale-input::-webkit-slider-thumb { opacity: 0; }
.scale.is-revealed .scale-input::-moz-range-thumb { opacity: 0; }
.scale-ends { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 0.86rem; color: var(--muted); }
.scale-ends span:last-child { text-align: right; }
.scale-value { min-width: 2ch; font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; color: var(--ink); text-align: center; }
.scale-marks { position: absolute; top: 0; left: 0; right: 0; height: 76px; }
.scale-mark { position: absolute; top: 30px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 500; white-space: nowrap; animation: tag-in 0.4s ease both; }
.scale-mark b { font-weight: 600; }
.scale-mark::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 22px; margin-left: -1px; background: currentColor; opacity: 0.55; }
.scale-mark.raise { top: 2px; }
.scale-mark.raise::after { height: 50px; }
.scale-mark.p1 { background: var(--p1-soft); color: var(--p1-ink); }
.scale-mark.p2 { background: var(--p2-soft); color: var(--p2-ink); }
.scale-mark.both { background: var(--match-soft); color: var(--match-ink); }

/* Long distance: one code, share it, or enter your partner's */
.ld-code { margin: 2px 0 0; text-align: center; font-family: var(--font-display); font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 600; letter-spacing: 0.08em; color: var(--ink); }
.ld-code.is-empty { font-size: 1.5rem; font-weight: 500; font-style: italic; letter-spacing: 0; color: var(--muted); }
.link-quiet { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.ld-enter { display: grid; justify-items: center; gap: 6px; margin: 16px 0 0; font-size: 0.88rem; color: var(--muted); }
.ld-enter-row { display: flex; gap: 8px; }
.ld-enter input { width: min(220px, 55vw); padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: inherit; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.ld-more { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.ld-sub { margin: 0; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ld-games { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0 0 12px; padding: 0; list-style: none; }
.ld-games li { margin: 0; }
.ld-games a { font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.ld-daily { max-width: 30ch; margin: 0 auto; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.35; }

/* Facts bar under the tool card */
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; max-width: 860px; margin: 0 auto 8px; padding: 0 8px; }
.facts > div { display: grid; grid-template-columns: auto auto; gap: 6px; align-items: baseline; }
.facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 500; font-size: 0.9rem; max-width: 30ch; }
@media (max-width: 720px) { .facts { justify-content: flex-start; } }

/* ---------- Game rows: "Keep playing" on game pages ---------- */
.tile {
  position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; margin: 0;
  padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color 0.18s, background 0.18s;
}
.tile:hover { background: var(--surface-2); border-color: var(--line-2); }
.tile:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile-icon-wrap { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-ink); }
.tile-icon { width: 20px; height: 20px; color: inherit; flex: none; }
.tile-body { display: grid; gap: 2px; min-width: 0; }
.tile-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 500; line-height: 1.3; margin: 0; }
.tile-name a { color: inherit; text-decoration: none; }
.tile-name a::after { content: ""; position: absolute; inset: 0; }
.tile-name a:focus-visible { outline: none; }
.tile-text { font-size: 0.88rem; color: var(--muted); margin: 0; }
.tile-meta { display: grid; justify-items: end; gap: 1px; margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--muted); white-space: nowrap; text-align: right; }
.tile-best { color: var(--ink-2); }
@media (max-width: 560px) {
  .tile { grid-template-columns: 40px 1fr; }
  .tile-meta { display: block; grid-column: 2; text-align: left; white-space: normal; margin-top: -2px; }
  .tile-best::before { content: " · "; color: var(--muted); }
}
.related { padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.related ul { list-style: none; margin: 0 auto 18px; padding: 0; display: grid; gap: 6px; grid-template-columns: 1fr; max-width: 860px; }
.related h2 { text-align: center; }
.related .all-link { display: block; text-align: center; margin-top: 18px; font-weight: 500; }

/* ---------- All games page: every game once, grouped by kind of play ---------- */
/* Two cards per row; the picture is the game's own tool screenshot cropped to a wide strip, the whole card is the link. */
.gallery-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gallery-card {
  position: relative; margin: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
@media (hover: hover) { .gallery-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); } }
.gallery-card:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.gallery-shot { aspect-ratio: 2 / 1; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.gallery-shot picture, .gallery-shot img { display: block; width: 100%; height: 100%; }
.gallery-shot img { object-fit: cover; }
.gallery-body { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 18px 18px; }
.gallery-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.3; margin: 0 0 4px; }
.gallery-name a { color: inherit; text-decoration: none; }
.gallery-name a::after { content: ""; position: absolute; inset: 0; }
.gallery-name a:focus-visible { outline: none; }
.gallery-text p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.gallery-text .gallery-meta { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
/* A group with one game: picture and text side by side on one full-width card */
.gallery-grid.is-single { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .gallery-grid.is-single .gallery-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .gallery-grid.is-single .gallery-shot { border-bottom: 0; border-right: 1px solid var(--line); }
  .gallery-grid.is-single .gallery-body { padding: 20px 24px; }
}
@media (max-width: 719px) { .gallery-grid { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- Content sections ---------- */
.section { padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.section-tight { padding-top: 12px; }
.section h2 { margin-bottom: 0.6em; }
.section-intro { color: var(--ink-2); max-width: 66ch; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 70ch; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 0.9rem; font-family: var(--font-display);
}
.rules-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rules-grid h3 { margin-bottom: 0.3em; }
.rules-grid p { margin: 0; color: var(--ink-2); }
.faq h3 { font-size: 1.15rem; margin-top: 1.2em; }
.faq p { max-width: 70ch; }
.refs { font-size: 0.82rem; color: var(--muted); margin: 18px 0 0; padding-left: 1.2em; }
.refs a { color: var(--muted); }

/* Tool screenshot, always in a column beside the text it illustrates */
.with-figure { display: grid; gap: 24px 44px; align-items: start; }
@media (min-width: 900px) { .with-figure { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.shot { margin: 0; }
.shot img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2); }
.shot figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 12px; max-width: 70ch; }
.why-text p { font-size: 1.06rem; color: var(--ink-2); max-width: 60ch; }

/* Tips follow the rules inside "Ways to play" */
.tips-heading { font-size: 1.12rem; margin: 30px 0 10px; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 70ch; }
.tips li { position: relative; margin: 0; padding-left: 22px; color: var(--ink-2); }
.tips li::before { content: ""; position: absolute; left: 3px; top: 0.66em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Question decks as cards, grouped by category */
.qgroup { margin-top: 30px; }
.qgroup-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.qgroup-head h3 { margin: 0; }
.qgroup-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.qcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-family: var(--font-display); font-size: 1.02rem; line-height: 1.35; display: grid; gap: 6px; align-content: start; margin: 0; }
.qcard .badge { justify-self: start; font-family: var(--font-body); }
.qcard-ab .q-or { font-style: italic; color: var(--muted); font-size: 0.9rem; }
.qcard .q-prefix, .qcard .q-opts { font-family: var(--font-body); font-size: 0.78rem; color: var(--muted); }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; list-style: none; display: inline-flex; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " ↓"; }
details.more[open] summary::after { content: " ↑"; }
details.more summary:hover { border-color: var(--accent); color: var(--accent-ink); }
details.more[open] summary { margin-bottom: 10px; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.9rem; margin: 0; }
.pills em { font-style: italic; color: var(--muted); font-size: 0.8rem; }

/* Home themes: one occasion per screen (art band + three playable game cards), each followed by an ad slot */
.themes-label { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 30px 0 0; text-align: center; }
.theme { padding: clamp(28px, 4vw, 48px) 0 clamp(44px, 5vw, 64px); }
.theme .art-band { min-height: 400px; }
.theme .art-media img { object-position: center 30%; }
.theme .art-text h2 { margin-bottom: 0.4em; }
.theme-intro { font-size: 1.08rem; color: var(--ink-2); margin: 0; }
.theme-games { position: relative; z-index: 1; list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-card {
  margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.game-card-head { display: flex; align-items: center; gap: 12px; }
.game-card-head .tile-icon-wrap { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.game-card-kicker { margin: 0 0 2px; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.game-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.25; }
.sample {
  flex: 1; min-height: 132px; display: grid; align-content: center; gap: 6px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2);
  font-family: var(--font-display); font-size: 1.14rem; line-height: 1.35; color: var(--ink); transition: opacity 0.16s ease;
}
.sample.is-switching { opacity: 0; }
.sample .badge { justify-self: start; font-family: var(--font-body); }
.sample .q-or { font-style: italic; color: var(--muted); font-size: 0.9rem; }
.sample .q-prefix, .sample .q-opts { font-family: var(--font-body); font-size: 0.8rem; line-height: 1.45; color: var(--muted); }
.sample-code { font-size: 1.45rem; font-weight: 600; letter-spacing: 0.06em; }
.game-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.game-card-foot .btn-soft { margin-left: auto; }
@media (max-width: 899px) {
  .theme .art-band { min-height: 0; }
  .theme .art-band .art-media { margin-bottom: -56px; }
  .theme-games { grid-template-columns: 1fr; margin-top: 22px; }
  .sample { min-height: 0; }
}

/* Art band: the illustration is a background layer that bleeds to the viewport edge and dissolves toward the text */
.art-band { position: relative; display: flex; align-items: center; min-height: 380px; }
.art-band.art-none { min-height: 0; }
.art-media { position: absolute; top: -10%; bottom: -10%; z-index: 0; pointer-events: none; }
.art-right .art-media { left: 36%; right: calc(50% - 50vw); }
.art-left .art-media { right: 36%; left: calc(50% - 50vw); }
.art-media picture { display: block; width: 100%; height: 100%; }
.art-media img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
  -webkit-mask-composite: source-in; mask-composite: intersect; -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.art-right .art-media img {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 26%, #000 50%, #000 100%), linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%), radial-gradient(ellipse 90% 100% at 60% 50%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 26%, #000 50%, #000 100%), linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%), radial-gradient(ellipse 90% 100% at 60% 50%, #000 60%, transparent 100%);
}
.art-left .art-media img {
  -webkit-mask-image: linear-gradient(to left, transparent 0%, rgba(0,0,0,0.35) 26%, #000 50%, #000 100%), linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%), radial-gradient(ellipse 90% 100% at 40% 50%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to left, transparent 0%, rgba(0,0,0,0.35) 26%, #000 50%, #000 100%), linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%), radial-gradient(ellipse 90% 100% at 40% 50%, #000 60%, transparent 100%);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .art-media img { mix-blend-mode: multiply; } }
:root[data-theme="light"] .art-media img { mix-blend-mode: multiply; }
/* the text needs a definite width so grids inside it (steps) do not collapse to min-content */
.art-text { position: relative; z-index: 1; width: min(560px, 100%); max-width: 560px; flex: 0 0 auto; }
.art-left .art-text { margin-left: auto; }
/* contrast scrim in the page colour so copy always sits on solid ground */
.art-text::before { content: ""; position: absolute; inset: -40px -140px -40px -60px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 40% 50%, var(--bg) 38%, transparent 76%); }
.art-left .art-text::before { inset: -40px -60px -40px -140px; background: radial-gradient(ellipse at 60% 50%, var(--bg) 38%, transparent 76%); }
.scene.art-band { padding: 0; margin: 12px 0; }
.scene .art-text h2 { margin-top: 0; }
.scene .art-text h3 { margin-top: 1.1em; font-size: 1.12rem; }
.scene .art-text p { color: var(--ink-2); margin-bottom: 0.4em; }
.scene .art-text .scene-intro { font-size: 1.06rem; margin-bottom: 0.2em; }
@media (max-width: 899px) {
  .art-band { flex-direction: column; align-items: stretch; }
  .art-media, .art-right .art-media, .art-left .art-media { position: relative; top: auto; right: auto; bottom: auto; left: auto; width: calc(100% + var(--gutter) * 2); margin-left: calc(var(--gutter) * -1); height: auto; aspect-ratio: 3 / 2; }
  .scene.art-band .art-media { margin-bottom: -56px; }
  .art-right .art-media img, .art-left .art-media img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 62%, transparent 100%);
  }
  .art-text { width: auto; max-width: none; }
  .art-text::before { display: none; }
}

/* Missing-illustration placeholder (preview builds only) */
.img-placeholder {
  aspect-ratio: 3 / 2; width: 100%; border: 1px dashed var(--line-2); border-radius: var(--radius); display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 0.82rem; padding: 16px; background: var(--surface-2); overflow: hidden; overflow-wrap: anywhere;
}
.img-placeholder code { font-size: 0.76rem; }

/* Ad slots – reserved height prevents layout shift; kept away from game controls */
.ad-slot { margin: 8px auto 0; max-width: var(--wrap); min-height: 280px; display: grid; place-items: center; }
.ad-slot .ad-label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 4px; }
.ad-slot .adsbygoogle { display: block; width: 100%; min-height: 250px; }
.ad-placeholder {
  width: 100%; min-height: 250px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted); font-size: 0.82rem; text-align: center; padding: 16px;
}
.ad-placeholder code { font-size: 0.78rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; margin-top: 24px; font-size: 0.92rem; color: var(--muted); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-heading { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); }
.site-footer a[aria-current="page"] { color: var(--accent-ink); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.85rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 500;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Utility pages and 404 */
.page-narrow { max-width: 72ch; padding: clamp(24px, 4vw, 48px) 0 40px; }
.page-narrow h2 { margin-top: 1.4em; font-size: 1.5rem; }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: 0.95rem; }
.error-page { text-align: center; padding: 80px 0; }

/* ---------- Showcase mode (used only for screenshots via ?showcase=) ---------- */
html.is-showcase body { background: linear-gradient(160deg, #fbf3ec 0%, #faf7f2 45%, #f1ebe3 100%); }
/* Only the tool card, zoomed per game (--sc-zoom, set in each games/*.js) to fill the frame: the screenshot sits in a
   half-width column beside the how-to steps, so it has to stay legible at about 540px wide. */
html.is-showcase .site-header, html.is-showcase .site-footer, html.is-showcase .section, html.is-showcase .related,
html.is-showcase .ad-slot, html.is-showcase .shot, html.is-showcase .theme, html.is-showcase .themes-label, html.is-showcase .breadcrumbs,
html.is-showcase .hero, html.is-showcase .toast, html.is-showcase .facts { display: none !important; }
html.is-showcase main { min-height: calc(100vh / var(--sc-zoom, 1.5)); display: grid; align-content: center; padding: 40px 0; zoom: var(--sc-zoom, 1.5); }
html.is-showcase .tool { padding: 0; }
html.is-showcase .tool-card { max-width: 900px; }
html.is-showcase *, html.is-showcase *::before, html.is-showcase *::after { transition: none !important; }

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