/* ==========================================================================
   Focus Games Lab — single stylesheet (claymorphism)
   Soft-moulded clay surfaces: pastel gradients, 20–30px radii, layered
   drop-highlight + inset-highlight shadows, bouncy-but-restrained motion.
   Self-hosted Nunito, no third-party requests. Mobile-first, dark mode, print.

   Shadow recipes are expensive on large grids, so small game tiles use a cheap
   2-layer shadow while cards and buttons get the full 4-layer clay treatment.

   Sections: 1 tokens · 2 font · 3 base · 4 layout · 5 buttons/chips · 6 cards
             7 article typography · 8 FAQ · 9 ads · 10 game shells
             11 per-game · 12 modal/consent · 13 utilities · 14 print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* palette — checked for AA contrast by tools/contrast-check.mjs
     Dominant accent is candy pink/raspberry; the reference's lilac is demoted to a
     single pastel tile so the brand reads "clay toy", not "SaaS violet gradient". */
  --bg-a: #fbf1f6;
  --bg-b: #ffe6ef;
  --bg-c: #f6f1ff;

  --ink: #2d1b4e;
  --ink-soft: #45306e;
  --muted: #5f4d82;
  --line: rgba(150, 105, 140, .20);
  --line-strong: rgba(150, 105, 140, .32);

  --brand: #bd1e6a;
  --brand-deep: #9c1b5c;
  --brand-soft: rgba(189, 30, 106, .10);
  --pink: #c62868;
  --accent: #0f766e;
  --warn: #92400e;
  --danger: #b91c1c;
  --ok: #146c37;

  --tile-pink: linear-gradient(135deg, #ff8fb8, #f65c92);
  --tile-purple: linear-gradient(135deg, #c9a6ff, #b388ff);
  --tile-violet: linear-gradient(135deg, #b79bff, #8b5cf6);
  --tile-blue: linear-gradient(135deg, #a5d8ff, #5eb6f2);
  --tile-yellow: linear-gradient(135deg, #ffe08a, #fdba74);
  /* state colours: flat, no gradient - completion green and error coral read as a pair */
  --state-done: #a5ecc3;
  --state-wrong: #ffb3bd;

  /* Reference button ramp, pink -> lilac. The pink end is one notch deeper than
     #ff6b9d so white labels clear 3:1 (large-text AA): 3.06 / 3.55. */
  --brand-fill: linear-gradient(135deg, #f65c92, #9d6bff);
  /* Small text needs 4.5:1, so pills reuse the SAME two hues, darkened */
  --pill-fill: linear-gradient(135deg, #d13c75, #7a45e0);
  /* Clipped text (headline word, timer digits) on the pale page: large text, 3:1 */
  --text-fill: linear-gradient(135deg, #ed4580, #c62868);
  --btn-ink: #ffffff;

  /* clay: drop shadow (bottom-right), outer highlight (top-left),
     inset highlight, inset shade — tinted warm mauve, not blue-violet */
  --clay-sm:
    5px 6px 12px rgba(136, 92, 122, .26),
    -4px -4px 9px rgba(255, 255, 255, .92);
  --clay:
    9px 10px 22px rgba(136, 92, 122, .32),
    -7px -7px 18px rgba(255, 255, 255, .98),
    inset 2px 2px 6px rgba(255, 255, 255, .9),
    inset -2px -2px 7px rgba(136, 92, 122, .16);
  --clay-lg:
    14px 16px 38px rgba(136, 92, 122, .32),
    -9px -9px 26px rgba(255, 255, 255, 1),
    inset 3px 3px 8px rgba(255, 255, 255, .95),
    inset -3px -3px 10px rgba(136, 92, 122, .14);
  --clay-hover:
    16px 20px 46px rgba(136, 92, 122, .36),
    -9px -9px 28px rgba(255, 255, 255, 1),
    inset 3px 3px 8px rgba(255, 255, 255, .98),
    inset -3px -3px 10px rgba(136, 92, 122, .18);
  --clay-pressed:
    inset 6px 6px 14px rgba(136, 92, 122, .28),
    inset -6px -6px 14px rgba(255, 255, 255, .94);
  --clay-well:
    inset 4px 4px 10px rgba(136, 92, 122, .2),
    inset -4px -4px 10px rgba(255, 255, 255, .88);

  --surface: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(251, 241, 246, .92));
  --surface-flat: rgba(255, 255, 255, .8);
  --surface-deep: rgba(255, 255, 255, .64);

  --on-tint: #ffffff;
  /* small labels that sit on the bright gradient need a dark ink (4.9-5.7:1) */
  --ink-on-fill: #1f1140;
  --focus: #bd1e6a;

  --r-xl: 38px;
  --r-card: 30px;
  --r-md: 22px;
  --r-sm: 15px;
  --r-pill: 999px;

  color-scheme: light;

  --font-sans: 'Nunito', ui-rounded, 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1080px;
  --header-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tap: 44px;
  --spring: cubic-bezier(.175, .885, .32, 1.275);
  --ease: cubic-bezier(.34, 1.56, .64, 1);
}

/* Dark theme tokens live in two blocks on purpose:
   1. the OS preference, unless the visitor has explicitly chosen light
   2. an explicit dark choice from the header toggle
   tools/logic-test.mjs asserts the two blocks are byte-identical, so they cannot
   drift apart. JS resolves the choice before first paint (no flash). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-a: #241d2b;
    --bg-b: #19141f;
    --bg-c: #2a2134;

    --ink: #fdf0f6;
    --ink-soft: #f2d7e4;
    --muted: #d6b4c6;
    --line: rgba(255, 170, 205, .18);
    --line-strong: rgba(255, 170, 205, .32);

    --brand: #ffb0cd;
    --brand-deep: #ffd3e2;
    --brand-soft: rgba(255, 158, 196, .16);
    --pink: #ffa3c4;
    --accent: #5eead4;
    --warn: #fcd34d;
    --danger: #fca5a5;
    --ok: #86efac;

    --brand-fill: linear-gradient(135deg, #ff9ec4, #ffc98b);
    --pill-fill: linear-gradient(135deg, #ff9ec4, #ffc98b);
    --text-fill: linear-gradient(135deg, #ffb0cd, #ffd08a);
    --btn-ink: #2a0f1c;

    --clay-sm:
      5px 6px 12px rgba(0, 0, 0, .55),
      -4px -4px 9px rgba(255, 255, 255, .06);
    --clay:
      9px 10px 22px rgba(0, 0, 0, .6),
      -6px -6px 16px rgba(255, 255, 255, .07),
      inset 2px 2px 6px rgba(255, 255, 255, .09),
      inset -2px -2px 7px rgba(0, 0, 0, .38);
    --clay-lg:
      14px 16px 38px rgba(0, 0, 0, .65),
      -8px -8px 22px rgba(255, 255, 255, .07),
      inset 3px 3px 8px rgba(255, 255, 255, .1),
      inset -3px -3px 10px rgba(0, 0, 0, .36);
    --clay-hover:
      16px 20px 46px rgba(0, 0, 0, .7),
      -8px -8px 24px rgba(255, 255, 255, .09),
      inset 3px 3px 8px rgba(255, 255, 255, .11),
      inset -3px -3px 10px rgba(0, 0, 0, .38);
    --clay-pressed:
      inset 6px 6px 14px rgba(0, 0, 0, .6),
      inset -6px -6px 14px rgba(255, 255, 255, .08);
    --clay-well:
      inset 4px 4px 10px rgba(0, 0, 0, .5),
      inset -4px -4px 10px rgba(255, 255, 255, .07);

    --surface: linear-gradient(145deg, rgba(58, 46, 74, .96), rgba(33, 26, 43, .94));
    --surface-flat: rgba(58, 46, 74, .74);
    --surface-deep: rgba(26, 20, 34, .62);

    --state-done: #2f6a4f;
    --state-wrong: #6b2a30;
    --on-tint: #2a0f1c;
    --ink-on-fill: #2a0f1c;
    --focus: #ffc2da;
  }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-a: #241d2b;
    --bg-b: #19141f;
    --bg-c: #2a2134;

    --ink: #fdf0f6;
    --ink-soft: #f2d7e4;
    --muted: #d6b4c6;
    --line: rgba(255, 170, 205, .18);
    --line-strong: rgba(255, 170, 205, .32);

    --brand: #ffb0cd;
    --brand-deep: #ffd3e2;
    --brand-soft: rgba(255, 158, 196, .16);
    --pink: #ffa3c4;
    --accent: #5eead4;
    --warn: #fcd34d;
    --danger: #fca5a5;
    --ok: #86efac;

    --brand-fill: linear-gradient(135deg, #ff9ec4, #ffc98b);
    --pill-fill: linear-gradient(135deg, #ff9ec4, #ffc98b);
    --text-fill: linear-gradient(135deg, #ffb0cd, #ffd08a);
    --btn-ink: #2a0f1c;

    --clay-sm:
      5px 6px 12px rgba(0, 0, 0, .55),
      -4px -4px 9px rgba(255, 255, 255, .06);
    --clay:
      9px 10px 22px rgba(0, 0, 0, .6),
      -6px -6px 16px rgba(255, 255, 255, .07),
      inset 2px 2px 6px rgba(255, 255, 255, .09),
      inset -2px -2px 7px rgba(0, 0, 0, .38);
    --clay-lg:
      14px 16px 38px rgba(0, 0, 0, .65),
      -8px -8px 22px rgba(255, 255, 255, .07),
      inset 3px 3px 8px rgba(255, 255, 255, .1),
      inset -3px -3px 10px rgba(0, 0, 0, .36);
    --clay-hover:
      16px 20px 46px rgba(0, 0, 0, .7),
      -8px -8px 24px rgba(255, 255, 255, .09),
      inset 3px 3px 8px rgba(255, 255, 255, .11),
      inset -3px -3px 10px rgba(0, 0, 0, .38);
    --clay-pressed:
      inset 6px 6px 14px rgba(0, 0, 0, .6),
      inset -6px -6px 14px rgba(255, 255, 255, .08);
    --clay-well:
      inset 4px 4px 10px rgba(0, 0, 0, .5),
      inset -4px -4px 10px rgba(255, 255, 255, .07);

    --surface: linear-gradient(145deg, rgba(58, 46, 74, .96), rgba(33, 26, 43, .94));
    --surface-flat: rgba(58, 46, 74, .74);
    --surface-deep: rgba(26, 20, 34, .62);

    --state-done: #2f6a4f;
    --state-wrong: #6b2a30;
    --on-tint: #2a0f1c;
    --ink-on-fill: #2a0f1c;
    --focus: #ffc2da;
}

/* 2. Font ------------------------------------------------------------------ */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-basic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* 3. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg-a);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--bg-a);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
/* A fixed layer instead of background-attachment: fixed, which iOS Safari
   handles badly (it repaints the whole viewport on scroll). */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1000px 700px at 8% -8%, color-mix(in srgb, var(--bg-c) 70%, transparent) 0%, transparent 62%),
    radial-gradient(900px 600px at 100% 0%, color-mix(in srgb, var(--bg-b) 75%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 58%, var(--bg-c) 100%);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.022em;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.85rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
h3 { font-size: clamp(1.12rem, 2.5vw, 1.36rem); }
p { margin: 0 0 1.05em; }
a { color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}
hr { border: 0; height: 2px; border-radius: 2px; background: var(--line); margin: 2rem 0; }
small { font-size: .86rem; }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }
abbr[title] { text-decoration: underline dotted; cursor: help; }
::selection { background: color-mix(in srgb, var(--pink) 32%, transparent); }

.skip-link {
  position: absolute; left: 10px; top: -70px; z-index: 200;
  background: var(--brand-fill); color: var(--btn-ink);
  padding: 12px 20px; font-size: 1.18rem;
 border-radius: var(--r-pill);
  font-weight: 800; text-decoration: none;
  box-shadow: var(--clay);
  transition: top .2s var(--spring);
}
.skip-link:focus { top: 10px; }

/* 4. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(14px, 4vw, 26px); }
.container-narrow { max-width: 780px; }
main { display: block; padding-bottom: 3rem; }
section { margin-block: clamp(2rem, 5vw, 3.6rem); }
section:first-child { margin-top: 0; }

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg-a) 76%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 8px 20px -14px rgba(120, 94, 168, .55);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header { background: var(--bg-a); }
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.logo {
  display: inline-flex; align-items: center; gap: 11px; margin-right: auto;
  font-weight: 900; font-size: 1.04rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 38px; height: 38px; flex: 0 0 auto; padding: 5px;
  border-radius: 13px;
  /* deeper candy pair so the white glyph clears 3:1 (the button gradient is too
     pale at its pink end for a white mark) */
  background: linear-gradient(135deg, #f65c92, #9b6bff);
  color: #fff;
  box-shadow: var(--clay-sm);
}
.logo-sub {
  display: block; font-size: .66rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); line-height: 1.3;
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); padding: 0;
  color: var(--ink); background: var(--surface-flat);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--clay-sm); cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--brand-fill); color: var(--btn-ink); box-shadow: var(--clay-pressed); }
.nav-toggle svg { width: 22px; height: 22px; }

.nav { display: none; }
.nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  padding: 10px clamp(14px, 4vw, 26px) 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: var(--clay-lg);
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; min-height: var(--tap);
  padding: 0 14px; border-radius: var(--r-pill);
  color: var(--ink-soft); text-decoration: none; font-weight: 800; font-size: .95rem;
  transition: background .25s ease, box-shadow .25s ease, color .25s ease;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-flat);
  box-shadow: var(--clay-sm);
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav, .nav.is-open {
    display: block; position: static; padding: 0; background: none;
    border: 0; box-shadow: none; border-radius: 0;
  }
  /* the nav itself is a clay pill, the way the reference composes it */
  .nav ul {
    flex-direction: row; gap: 2px;
    padding: 6px;
    background: var(--surface-flat);
    border-radius: var(--r-pill);
    box-shadow: var(--clay-sm);
  }
  .nav a { padding: 0 15px; font-size: .93rem; border-radius: var(--r-pill); }
  .nav a:hover, .nav a[aria-current="page"] { box-shadow: none; background: var(--surface); }
}

.breadcrumbs { font-size: .86rem; color: var(--muted); padding-block: 16px 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: 7px; }
.breadcrumbs li + li::before { content: "/"; opacity: .45; }
.breadcrumbs a { color: var(--muted); text-decoration: none; font-weight: 700; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); font-weight: 800; }

.page-head { padding-block: 1.1rem 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .42em 1em; margin-bottom: 14px;
  font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase;
  color: var(--on-tint);
  background: var(--pill-fill);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-sm);
}
.lead, .page-head .lead {
  font-size: clamp(1.03rem, 2.2vw, 1.17rem);
  color: var(--ink-soft);
  max-width: 68ch;
  line-height: 1.7;
}

/* The footer is a floating clay card rather than a full-bleed strip. */
.site-footer {
  width: min(100% - 28px, var(--container));
  margin: 4rem auto calc(1.5rem + var(--safe-b));
  padding: clamp(22px, 4vw, 34px) clamp(18px, 4vw, 30px);
  font-size: .93rem;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
}
.site-footer .container { max-width: none; padding-inline: 0; }
.footer-grid { display: grid; gap: 1.7rem 2.4rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.site-footer h2 {
  font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .8rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom {
  margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .84rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; justify-content: space-between;
}

/* 5. Buttons & chips ------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand-fill);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 24px;
  font: inherit; font-weight: 900; font-size: 1.18rem; line-height: 1;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border: 0; border-radius: var(--r-md);
  box-shadow: var(--clay);
  cursor: pointer; text-decoration: none;
  transition: transform .3s var(--spring), box-shadow .3s var(--spring), filter .2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--clay-hover); }
.btn:active { transform: translateY(0) scale(.985); box-shadow: var(--clay-pressed); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--clay-sm); }
.btn-ghost {
  --btn-bg: var(--surface-flat);
  color: var(--ink);
  box-shadow: var(--clay);
}
.btn-ghost:hover { color: var(--brand); }
.btn-lg { min-height: 56px; padding: 0 32px; font-size: 1.26rem; border-radius: 22px; }
.btn-sm { min-height: var(--tap); padding: 0 18px; font-size: 1.18rem; border-radius: 16px; }
.btn-block { width: 100%; }

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; flex: 0 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 16px;
  font: inherit; font-size: .95rem; font-weight: 900; white-space: nowrap;
  color: var(--ink-soft);
  background: var(--surface-flat);
  border: 0; border-radius: var(--r-pill);
  box-shadow: var(--clay-sm);
  cursor: pointer; text-decoration: none;
  transition: transform .25s var(--spring), box-shadow .25s var(--spring), color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chip:hover { color: var(--brand); transform: translateY(-2px); box-shadow: var(--clay); }
.chip[aria-pressed="true"] {
  color: var(--on-tint);
  background: var(--pill-fill);
  box-shadow: var(--clay-pressed);
  transform: none;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .34em 1em; border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 900; letter-spacing: .02em;
  color: var(--on-tint); background: var(--pill-fill);
  box-shadow: var(--clay-sm);
}
.badge-accent { background: var(--surface-flat); color: var(--ink-soft); }
.badge-warn { background: var(--tile-yellow); color: #3f2a06; }

/* 6. Cards ----------------------------------------------------------------- */
.card {
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
}
.card-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
/* game hub grid: flows from 1 column on a phone to 4+ on a desktop, so adding game
   21 later is a markup change, not a layout change */
.game-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
@media (min-width: 640px) { .card-grid.cols-2, .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.game-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 12px 14px;
  color: inherit; text-decoration: none;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
  transition: transform .35s var(--spring), box-shadow .35s var(--spring);
}
.game-card:hover { transform: translateY(-5px); box-shadow: var(--clay-hover); }
.game-card:active { transform: translateY(-1px) scale(.995); }
.game-card h3 { margin: 0; font-size: .98rem; line-height: 1.25; }
.game-card p {
  margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.game-card .meta {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; padding-top: 6px;
  font-size: .72rem; font-weight: 800; color: var(--muted);
}
.game-icon {
  width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center; color: #1b1030;
  background: var(--tile-purple);
  box-shadow: var(--clay-sm);
}
.game-icon svg { width: 27px; height: 27px; }
/* rotate the pastel tile per card so the grid reads as a set, not a repeat */
.card-grid > :nth-child(4n+1) .game-icon { background: var(--tile-purple); }
.card-grid > :nth-child(4n+2) .game-icon { background: var(--tile-blue); }
.card-grid > :nth-child(4n+3) .game-icon { background: var(--tile-violet); }
.card-grid > :nth-child(4n+4) .game-icon { background: var(--tile-pink); }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; color: var(--ink-soft); }
.feature-list svg {
  width: 22px; height: 22px; flex: 0 0 auto; padding: 3px; margin-top: 1px;
  color: var(--ink); background: var(--state-done);
  border-radius: 8px; box-shadow: var(--clay-sm);
}

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  padding: 16px 18px; border-radius: var(--r-md);
  background: var(--surface-flat); box-shadow: var(--clay-sm);
}
.stat .k { display: block; font-size: 1.55rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); }

/* 7. Article typography ---------------------------------------------------- */
.prose { max-width: 72ch; color: var(--ink-soft); }
.prose > h2 { margin-top: 2.1em; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 14px); }
.prose > h3 { margin-top: 1.7em; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 14px); }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--pink); font-weight: 900; }
.prose strong { color: var(--ink); font-weight: 900; }
.prose blockquote {
  margin: 1.5em 0; padding: 1.1em 1.3em;
  color: var(--ink);
  font-style: italic;
  background: var(--surface-flat);
  border-radius: var(--r-md);
  box-shadow: var(--clay-well);
}
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.4em 0; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th {
  background: var(--brand-soft);
  font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em;
  color: var(--brand-deep);
}
.prose thead th:first-child { border-radius: 12px 0 0 12px; }
.prose thead th:last-child { border-radius: 0 12px 12px 0; }
.prose tbody tr:last-child td { border-bottom: 0; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--clay);
  padding: 4px 2px;
}
.prose sup a { text-decoration: none; font-weight: 900; }
.sources { font-size: .87rem; color: var(--muted); }
.sources ol { padding-left: 1.2em; }
.sources li { margin-bottom: .55em; }

.answer-box {
  padding: 18px 22px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
  position: relative;
  overflow: hidden;
}
.answer-box::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 8px;
  background: var(--brand-fill);
}
.answer-box > :first-child { margin-top: 0; }
.answer-box > :last-child { margin-bottom: 0; }
.answer-box .answer-label {
  display: inline-flex; align-items: center;
  padding: .3em .9em; margin-bottom: 10px;
  font-size: .74rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-tint); background: var(--pill-fill);
  border-radius: var(--r-pill); box-shadow: var(--clay-sm);
}

.callout {
  padding: 16px 20px;
  font-size: .94rem; color: var(--ink-soft);
  background: var(--surface-flat);
  border-radius: var(--r-md);
  box-shadow: var(--clay-well);
}
.callout-warn {
  background: linear-gradient(145deg, rgba(255, 240, 200, .95), rgba(255, 226, 175, .9));
  color: #4a2c05;
  box-shadow: var(--clay);
}
@media (prefers-color-scheme: dark) {
  .callout-warn { background: linear-gradient(145deg, #4a3320, #38251a); color: #ffe6c4; }
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* 8. FAQ ------------------------------------------------------------------- */
.faq { display: grid; gap: 12px; margin-top: 1.5rem; }
.faq details {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--clay-sm);
  transition: box-shadow .3s var(--spring);
}
.faq details[open] { box-shadow: var(--clay); }
.faq summary {
  display: flex; align-items: center; gap: 14px;
  min-height: var(--tap); padding: 15px 20px;
  font-weight: 900; font-size: .99rem; color: var(--ink);
  list-style: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto;
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  font-size: 1.3rem; font-weight: 900; line-height: 1;
  color: var(--on-tint); background: var(--brand-fill);
  border-radius: 10px; box-shadow: var(--clay-sm);
  transition: transform .3s var(--spring);
}
.faq details[open] summary::after { content: "\2013"; }
.faq .faq-body { padding: 0 20px 18px; color: var(--ink-soft); font-size: .95rem; }
.faq .faq-body > :last-child { margin-bottom: 0; }

/* 9. Ads ------------------------------------------------------------------- */
.ad-slot {
  display: grid; place-items: center; width: 100%;
  min-height: 100px; margin: 1.9rem auto;
  border-radius: var(--r-md);
}
.ad-slot.is-off { display: none; }   /* no network configured: no empty box on the page */
.ad-slot[data-ad="top"], .ad-slot[data-ad="bottom"] { min-height: 100px; }
@media (min-width: 728px) { .ad-slot[data-ad="top"], .ad-slot[data-ad="bottom"] { min-height: 110px; } }
.ad-slot[data-ad="mid"], .ad-slot[data-ad="inArticle"] { min-height: 260px; max-width: 400px; }
.ad-slot.is-empty {
  background: repeating-linear-gradient(45deg,
    transparent 0 14px,
    color-mix(in srgb, var(--brand) 6%, transparent) 14px 28px);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}
.ad-placeholder {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 900; color: var(--muted);
}
.ad-slot ins { display: block; }
.ad-label {
  display: block; margin-bottom: 6px;
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 900; color: var(--muted); text-align: center;
}

/* 10. Game shells ---------------------------------------------------------- */
.game-layout { display: grid; gap: clamp(18px, 3vw, 28px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .game-layout.split { grid-template-columns: minmax(0, 1fr) 330px; } }

.game-frame {
  padding: clamp(15px, 3vw, 24px);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
}
.game-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 15px; }
.game-toolbar .spacer { margin-left: auto; }
/* Option groups: "how to play" and "how big" are different kinds of choice, so they
   get their own labelled cluster instead of one undifferentiated row of chips. */
.option-group {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  flex: 0 0 auto;            /* never squeeze: the toolbar wraps between groups */
  min-width: 0;
}
.option-label {
  font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

.scorebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 9px; margin-bottom: 15px; }
.score {
  padding: 9px 11px; text-align: center;
  background: var(--surface-flat);
  border-radius: var(--r-sm);
  box-shadow: var(--clay-well);
}
.score .k {
  display: block;
  font-family: var(--font-mono); font-size: 1.14rem; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.35; color: var(--ink);
}
.score .l { display: block; font-size: .68rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.score.is-best .k { color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center; padding: 0;
  width: var(--tap); height: var(--tap);
  color: var(--ink-soft); background: var(--surface-flat);
  border: 0; border-radius: 14px;
  box-shadow: var(--clay-sm); cursor: pointer;
  transition: transform .25s var(--spring), box-shadow .25s var(--spring), color .2s ease;
}
.icon-btn:hover { color: var(--brand); transform: translateY(-2px); box-shadow: var(--clay); }
.icon-btn:active { transform: none; box-shadow: var(--clay-pressed); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed="false"] { opacity: .6; color: var(--muted); }

.board-wrap { position: relative; display: grid; place-items: center; }
.board-note { text-align: center; font-size: .87rem; font-weight: 700; color: var(--muted); margin: 12px 0 0; min-height: 1.4em; }
.board-note.is-good { color: var(--ok); }
.board-note.is-bad { color: var(--danger); }

/* 11a. Schulte grid -------------------------------------------------------- */
.schulte-table {
  display: grid; gap: clamp(5px, 1.4vw, 11px); width: 100%;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  max-width: min(100%, calc(var(--n, 5) * 76px));
  margin-inline: auto; touch-action: manipulation;
}
.schulte-cell {
  display: grid; place-items: center; aspect-ratio: 1;
  min-width: var(--tap); min-height: var(--tap);
  font: inherit; font-size: clamp(1rem, 4.4vw, 1.5rem); font-weight: 900;
  font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--surface-flat);
  border: 0; border-radius: var(--r-sm);
  box-shadow: var(--clay-sm);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--spring), box-shadow .18s var(--spring), background .18s ease, color .18s ease;
}
.schulte-cell:hover { transform: translateY(-2px); box-shadow: var(--clay); }
.schulte-cell:active { transform: scale(.96); box-shadow: var(--clay-pressed); }
.schulte-cell.is-done { background: var(--state-done); color: var(--ink); transform: none; }
.schulte-cell.is-miss { animation: fg-shake .34s ease; background: var(--state-wrong); color: var(--ink); }
.schulte-cell.is-flash { background: var(--state-done); color: var(--ink); }

/* 11b. Spot the difference ------------------------------------------------- */
.diff-pair { display: grid; gap: clamp(7px, 2vw, 13px); grid-template-columns: 1fr 1fr; width: 100%; }
.diff-board {
  display: grid; gap: clamp(3px, .8vw, 7px);
  grid-template-columns: repeat(var(--n, 4), 1fr);
  padding: clamp(5px, 1.3vw, 11px);
  background: var(--surface-deep);
  border-radius: var(--r-md);
  box-shadow: var(--clay-well);
}
.diff-item {
  display: grid; place-items: center; aspect-ratio: 1; padding: 0;
  min-width: 0; min-height: 0;
  background: var(--surface-flat);
  border: 0; border-radius: 10px;
  box-shadow: var(--clay-sm); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--spring), box-shadow .16s var(--spring), background .16s ease;
}
.diff-item svg { width: 74%; height: 74%; display: block; pointer-events: none; }
.diff-item:hover { transform: translateY(-2px); box-shadow: var(--clay); }
.diff-item:active { transform: scale(.95); box-shadow: var(--clay-pressed); }
.diff-item.is-found { background: var(--state-done); transform: none; }
.diff-item.is-found svg { opacity: .55; }
.diff-item.is-wrong { animation: fg-shake .34s ease; background: var(--state-wrong); }
.pair-label {
  margin-bottom: 6px; text-align: center;
  font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* 11c. Visual search ------------------------------------------------------- */
.vs-target {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 9px 16px;
  font-weight: 900; font-size: .95rem; color: var(--ink);
  background: var(--surface-flat);
  border-radius: var(--r-pill);
  box-shadow: var(--clay);
}
.vs-target svg { width: 28px; height: 28px; }
.vs-field {
  display: grid; gap: clamp(5px, 1.2vw, 9px); width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(clamp(44px, 11vw, 62px), 1fr));
  margin-top: 15px; touch-action: manipulation;
}
.vs-tile {
  display: grid; place-items: center; aspect-ratio: 1; padding: 0;
  min-width: var(--tap); min-height: var(--tap);
  background: var(--surface-flat);
  border: 0; border-radius: 12px;
  box-shadow: var(--clay-sm); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--spring), box-shadow .16s var(--spring), background .16s ease, opacity .25s ease;
}
.vs-tile svg { width: 64%; height: 64%; display: block; pointer-events: none; }
.vs-tile:hover { transform: translateY(-2px); box-shadow: var(--clay); }
.vs-tile:active { transform: scale(.95); box-shadow: var(--clay-pressed); }
.vs-tile.is-hit { background: var(--state-done); transform: none; }
.vs-tile.is-hit svg { opacity: .55; }
.vs-tile.is-wrong { animation: fg-shake .32s ease; background: var(--state-wrong); }
.vs-tile.is-all-done { opacity: .62; }

/* 11d. Focus timer --------------------------------------------------------- */
.timer-panel { text-align: center; }
.timer-digits {
  margin: .18em 0 .1em;
  font-family: var(--font-mono);
  font-size: clamp(3.2rem, 13vw, 5.2rem);
  font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  /* keep a solid fallback colour: if the gradient-text trick is unsupported the
     digits stay readable instead of turning transparent */
  color: var(--brand-deep);
  background: var(--text-fill);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.timer-phase {
  display: inline-flex; align-items: center;
  padding: .34em 1.1em;
  font-size: .78rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase;
  color: var(--on-tint); background: var(--pill-fill);
  border-radius: var(--r-pill); box-shadow: var(--clay-sm);
}
.timer-progress {
  height: 14px; margin: 1.3rem 0 1.5rem; overflow: hidden;
  background: var(--surface-deep);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-well);
}
.timer-progress span {
  display: block; height: 100%; width: 0;
  background: var(--brand-fill);
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset;
  transition: width .4s linear;
}
.timer-actions { display: flex; flex-wrap: wrap; gap: 11px; justify-content: center; }
.timer-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 24px;
  margin-top: 1.5rem; font-size: .88rem; font-weight: 700; color: var(--muted);
}
.timer-meta > div { display: grid; gap: 5px; justify-items: center; }
.timer-meta label { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.timer-meta strong {
  display: block; font-family: var(--font-mono); font-size: 1.12rem;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.num-input {
  width: 82px; min-height: var(--tap); padding: 0 12px;
  font: inherit; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center;
  color: var(--ink); background: var(--surface-flat);
  border: 0; border-radius: var(--r-sm);
  box-shadow: var(--clay-well);
}
.num-input:focus-visible { box-shadow: var(--clay-well), 0 0 0 3px var(--focus); }

/* 12. Modal & consent ------------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: center; padding: 16px;
  padding-bottom: calc(16px + var(--safe-b));
  background: rgba(22, 16, 30, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-backdrop.is-open { display: grid; }
.modal {
  width: 100%; max-width: 470px; max-height: 92dvh; overflow: auto;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg), 0 30px 60px -20px rgba(22, 16, 30, .45);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 {
  margin: 0; font-size: .82rem; font-weight: 900;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.modal-body { min-height: 250px; display: grid; place-items: center; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.modal-foot .countdown { font-size: .84rem; font-weight: 800; color: var(--muted); }

.consent {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 250;
  display: none; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 16px 18px; font-size: .88rem;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg), 0 24px 48px -18px rgba(22, 16, 30, .4);
}
.consent.is-open { display: flex; }
.consent-actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* In the bar itself refusal comes first and uses .btn-ghost (a white clay control), while
   allowing keeps the primary ramp. The footer reopening control stays a quiet text link. */
.consent-reopen {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .84rem; color: var(--muted); text-decoration: underline;
}
.consent-reopen:hover { color: var(--brand); }
.consent p { margin: 0; flex: 1 1 260px; color: var(--ink-soft); }
.consent p a { color: var(--brand); font-weight: 800; }
/* The bar is fixed over the bottom edge. While it is open, reserve its measured height so a
   visitor who ignores it can still scroll to the last row of the page. */
body.has-consent { padding-bottom: calc(var(--consent-h, 0px) + 18px); }


/* Pomodoro-style timer app: modes on top, one big clock, one primary button, then the
   task list that the pomodoros fill up. Layout borrowed from pomofocus, skin kept clay. */
.timer-app {
  padding: clamp(16px, 3vw, 26px);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--clay-lg);
  text-align: center;
}
.timer-modes { justify-content: center; margin-bottom: 12px; }
.timer-app .timer-digits { margin: .06em 0 .12em; font-size: clamp(3.4rem, 15vw, 5.6rem); }
.timer-app .timer-progress { margin: 0 auto 18px; max-width: 420px; }
.timer-start {
  display: flex; margin: 0 auto; width: min(100%, 300px);
  min-height: 60px; font-size: 1.26rem; letter-spacing: .05em; text-transform: uppercase;
}
.timer-finish { margin: 10px 0 0; font-size: .85rem; font-weight: 800; color: var(--muted); }
.timer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.timer-stats > div { padding: 8px 6px; background: var(--surface-flat); border-radius: var(--r-sm); box-shadow: var(--clay-well); }
.timer-stats strong { display: block; font-family: var(--font-mono); font-size: 1.1rem; color: var(--ink); }
.timer-stats span { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.task-panel { margin-top: 20px; padding-top: 16px; border-top: 2px dashed var(--line); text-align: left; }
.task-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.task-head h2 { margin: 0; font-size: 1rem; }
.task-active { margin: 0; font-size: .82rem; font-weight: 800; color: var(--muted); }
.task-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.task-input { flex: 1 1 140px; width: auto; text-align: left; }
.task-est { width: 62px; flex: 0 0 auto; }
.task-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--surface-flat);
  border-radius: var(--r-sm); box-shadow: var(--clay-sm);
}
.task-item.is-active { box-shadow: var(--clay-sm), inset 0 0 0 2px var(--brand); }
.task-item.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 9px; background: var(--surface-deep); box-shadow: var(--clay-well);
  color: var(--muted); cursor: pointer;
}
.task-check svg { width: 15px; height: 15px; }
.task-check[aria-pressed="true"] { background: var(--state-done); color: var(--ink); }
.task-title {
  flex: 1 1 auto; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: .9rem; font-weight: 800; color: var(--ink);
}
.task-title:hover { color: var(--brand); }
.task-count { flex: 0 0 auto; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.task-del {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
}
.task-del svg { width: 13px; height: 13px; }
.task-del:hover { color: var(--danger); background: var(--surface-deep); }
.task-empty { margin: 12px 0 0; font-size: .84rem; color: var(--muted); }

.timer-settings { margin-top: 14px; text-align: left; }
.timer-settings summary {
  display: flex; align-items: center; min-height: 40px;
  font-size: .84rem; font-weight: 900; color: var(--muted); cursor: pointer;
}
.timer-settings summary::marker { color: var(--brand); }
.timer-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; align-items: end; }
.timer-fields > div { display: grid; gap: 4px; }
.timer-fields label { font-size: .68rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.timer-fields .num-input { width: 78px; }

/* 13. Utilities ------------------------------------------------------------ */
.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;
}
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack-sm > * + * { margin-top: .6rem; }
.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

.related { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .related { grid-template-columns: repeat(2, 1fr); } }
.related a {
  display: block; padding: 16px 18px;
  color: inherit; text-decoration: none;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--clay-sm);
  transition: transform .3s var(--spring), box-shadow .3s var(--spring);
}
.related a:hover { transform: translateY(-3px); box-shadow: var(--clay); }
.related .t { display: block; font-weight: 900; color: var(--ink); }
.related .d { display: block; margin-top: 2px; font-size: .87rem; color: var(--muted); }

.result-panel {
  margin-top: 16px; padding: 18px;
  background: var(--surface-flat);
  border-radius: var(--r-md);
  box-shadow: var(--clay);
  animation: fg-pop .26s var(--spring);
}
.result-panel h3 { margin: 0 0 8px; font-size: 1.06rem; }
.result-list { list-style: none; margin: .7rem 0 1.1rem; padding: 0; display: grid; gap: 8px; font-size: .94rem; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 2px dashed var(--line); }
.result-list li:last-child { border-bottom: 0; }
.result-list .v { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.new-best {
  display: inline-flex; align-items: center;
  padding: .2em .7em; margin-left: 6px;
  font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--state-done);
  border-radius: var(--r-pill); box-shadow: var(--clay-sm);
}

@keyframes fg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
}
@keyframes fg-pop {
  from { transform: scale(.93); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes fg-float-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
/* entrance choreography for above-the-fold blocks (below-the-fold items use the
   JS-driven scroll reveal instead); skipped entirely under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .page-head { animation: fg-float-up .55s var(--ease) both; }
  .hero-copy { animation: fg-float-up .6s var(--ease) both; }
  .hero-board { animation: fg-bounce-in .7s var(--ease) .12s both; }
  .hero-float-a { animation: fg-bounce-in .55s var(--ease) .34s both, fg-drift 7s ease-in-out 1s infinite; }
  .hero-float-b { animation: fg-bounce-in .55s var(--ease) .46s both, fg-drift 9s ease-in-out 1.6s infinite reverse; }
}

/* 15. Clay flourish: hero composition, section tags, motion, scroll reveal ----- */

/* --- hero: asymmetric two-column with a live-looking board and floating chips */
.hero { margin-top: 0; padding-top: clamp(.8rem, 2.6vw, 1.8rem); }
.hero-grid {
  display: grid; gap: clamp(26px, 5vw, 54px);
  grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.06fr .94fr; align-items: center; }
}
.hero-copy h1 { margin-bottom: .55rem; }
.hero-copy .lead { margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.1rem; }
.hero-badges { font-size: .88rem; }

/* headline highlight: gradient-clipped word, with a solid colour fallback */
.accent-word {
  color: var(--pink);
  background: var(--text-fill);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-visual {
  position: relative; display: grid; place-items: center;
  min-height: 280px; padding: 8px;
}
.hero-board {
  width: min(100%, 330px);
  padding: clamp(14px, 2.4vw, 18px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--clay-lg);
  transform: rotate(-2deg);
}
.hero-board-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: .74rem; font-weight: 900;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.hero-board-time {
  padding: .25em .8em; border-radius: var(--r-pill);
  color: var(--on-tint); background: var(--pill-fill);
  box-shadow: var(--clay-sm); font-family: var(--font-mono); letter-spacing: 0;
}
.mini-schulte { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.4vw, 10px); }
.mini-cell {
  display: grid; place-items: center; aspect-ratio: 1;
  font-size: clamp(1rem, 3.2vw, 1.28rem); font-weight: 900;
  font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--surface-flat);
  border-radius: var(--r-sm);
  box-shadow: var(--clay-sm);
}
.mini-cell.is-lit { background: var(--state-done); color: var(--ink); }

.hero-float {
  position: absolute; display: grid; gap: 2px;
  padding: 11px 15px; border-radius: var(--r-md);
  box-shadow: var(--clay);
  line-height: 1.25;
}
.hero-float .float-icon {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 9px;
  background: rgba(255, 255, 255, .55);
  font-size: .95rem; font-weight: 900;
}
.hero-float .float-text { font-size: .8rem; font-weight: 900; letter-spacing: .02em; }
.hero-float .float-sub { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; opacity: .9; }
.hero-float-a {
  top: 2px; right: 2px;
  color: var(--ink); background: var(--tile-purple);
  transform: rotate(4deg);
}
.hero-float-b {
  bottom: 2px; left: 2px;
  color: var(--ink); background: var(--tile-pink);
  transform: rotate(-3deg);
}
@media (max-width: 479px) {
  .hero-float-b { display: none; }
  .hero-board { transform: rotate(-1.5deg); }
}

/* --- section headers with a gradient pill tag ------------------------------- */
.section-head { margin-bottom: clamp(1.4rem, 3vw, 2rem); }
.section-head.is-center { text-align: center; }
.section-head.is-center .section-tag { margin-inline: auto; }
.section-head h2 { margin: .55rem 0 .4rem; }
.section-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.section-head.is-center p { margin-inline: auto; }
.section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .38em 1.05em;
  font-size: .74rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase;
  color: var(--on-tint); background: var(--pill-fill);
  border-radius: var(--r-pill); box-shadow: var(--clay-sm);
}

/* --- pastel tile utilities (icon squares) ----------------------------------- */
.tile-pink { background: var(--tile-pink); color: #3b0b1f; }
.tile-purple { background: var(--tile-purple); color: #1b1030; }
.tile-violet { background: var(--tile-violet); color: #1b1030; }
.tile-blue { background: var(--tile-blue); color: #08243a; }
.tile-mint { background: var(--state-done); color: var(--ink); }
.tile-yellow { background: var(--tile-yellow); color: #3f2a06; }

/* --- tactile interactions --------------------------------------------------- */
@keyframes fg-squish {
  0%, 100% { transform: scale(1, 1); }
  45% { transform: scale(.955, 1.045); }
  70% { transform: scale(1.02, .98); }
}
@keyframes fg-wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes fg-drift {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, 3deg)); }
  50% { transform: translateY(-9px) rotate(calc(var(--tilt, 3deg) * -0.6)); }
}
@keyframes fg-bounce-in {
  0% { opacity: 0; transform: scale(.5) rotate(-6deg); }
  55% { opacity: 1; transform: scale(1.06) rotate(2deg); }
  75% { transform: scale(.97) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn:active { animation: fg-squish .28s var(--ease); }
  .logo:hover .logo-mark { animation: fg-wiggle .5s ease-in-out; }
  .game-card:hover .game-icon { transform: scale(1.14) rotate(-8deg); }
  .related a:hover .t { text-decoration: underline; }
  .badge, .section-tag { transition: transform .3s var(--spring); }
  .badge:hover, .section-tag:hover { transform: translateY(-2px) rotate(-1.5deg); }
}
.game-icon { transition: transform .35s var(--spring); }
.feature-list li, .result-list li { transition: transform .3s var(--spring); }
.feature-list li:hover, .result-list li:hover { transform: translateX(4px); }

/* --- scroll reveal (JS adds .reveal only when motion is welcome) ------------ */
html.fg-motion .reveal {
  opacity: 0;
  transform: translateY(30px) scale(.985);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
html.fg-motion .reveal.revealed { opacity: 1; transform: none; will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  html.fg-motion .reveal { opacity: 1; transform: none; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-board, .hero-float-a, .hero-float-b { transform: none; }
}

/* 18. Theme toggle ---------------------------------------------------------- */
/* Icon reflects what you will GET, not the current state: a moon in light mode
   (tap for dark), a sun in dark mode. Handles system preference too, so the right
   icon shows even before JS has run. */
.theme-toggle { flex: 0 0 auto; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }


/* 20. Card thumbnails: live mini-boards built from the game's own tokens --------- */
/* A preview is the real game at small scale, not a screenshot: same state colours,
   same clay shadow, same shapes. Nothing to load, and it follows dark mode. */
.card-thumb {
  display: grid; place-items: center;
  aspect-ratio: 16 / 9; width: 100%;
  padding: clamp(6px, 1.4vw, 9px);
  border-radius: var(--r-sm);
  background: var(--surface-deep);
  box-shadow: var(--clay-well);
  overflow: hidden;
}
.thumb-board {
  display: grid; gap: clamp(3px, .7vw, 5px); width: 100%;
  grid-template-columns: repeat(6, 1fr);
}
.thumb-cell {
  display: grid; place-items: center; aspect-ratio: 1;
  font-family: var(--font-mono); font-size: clamp(.54rem, 1.3vw, .68rem); font-weight: 700;
  color: var(--ink-soft); background: var(--surface-flat);
  border-radius: 5px; box-shadow: var(--clay-sm);
}
.thumb-cell.is-lit { background: var(--state-done); color: var(--ink); }
.thumb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(5px, 1.1vw, 8px); width: 100%; }
.thumb-panel {
  display: grid; gap: clamp(3px, .8vw, 5px);
  grid-template-columns: repeat(3, 1fr);
  padding: clamp(3px, .8vw, 6px);
  background: var(--surface-deep); border-radius: 8px; box-shadow: var(--clay-well);
}
.thumb-shape {
  display: grid; place-items: center; aspect-ratio: 1;
  background: var(--surface-flat); border-radius: 5px; box-shadow: var(--clay-sm);
}
.thumb-shape svg { width: 62%; height: 62%; display: block; }
/* colour variety without extra classes: cycle the shape palette */
.thumb-shape:nth-child(3n+1) { color: #4f46e5; }
.thumb-shape:nth-child(3n+2) { color: #0d9488; }
.thumb-shape:nth-child(3n+3) { color: #db2777; }
.thumb-shape:nth-child(4n) { color: #ea580c; }
.thumb-shape.is-diff { color: #7c3aed; }
.thumb-field {
  display: grid; gap: clamp(3px, .8vw, 5px); width: 100%;
  grid-template-columns: repeat(6, 1fr);
}
.thumb-tile {
  display: grid; place-items: center; aspect-ratio: 1;
  background: var(--surface-flat); border-radius: 7px; box-shadow: var(--clay-sm);
}
.thumb-tile svg { width: 60%; height: 60%; display: block; }
.thumb-tile:nth-child(4n+1) { color: #4f46e5; }
.thumb-tile:nth-child(4n+2) { color: #7c3aed; }
.thumb-tile:nth-child(4n+3) { color: #0d9488; }
.thumb-tile:nth-child(4n) { color: #db2777; }
.thumb-tile.is-hit { background: var(--state-done); }
.thumb-tile.is-hit svg { opacity: .55; }
.thumb-timer { display: grid; gap: 8px; justify-items: center; width: 100%; }
.thumb-digits {
  font-family: var(--font-mono); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem); line-height: 1;
  color: var(--brand-deep);
}
.thumb-bar {
  width: 82%; height: 8px; border-radius: var(--r-pill);
  background: var(--surface-deep); box-shadow: var(--clay-well); overflow: hidden;
}
.thumb-bar span { display: block; height: 100%; width: 62%; background: var(--brand-fill); border-radius: inherit; }
@media (prefers-reduced-motion: no-preference) {
  .game-card:hover .thumb-cell.is-lit,
  .game-card:hover .thumb-tile.is-hit { background: var(--state-done); filter: brightness(1.04); }
  .game-card:hover .thumb-digits { animation: fg-squish .5s var(--ease); }
}

/* 19. Print (teachers print grids and guides) ------------------------------ */
@media print {
  .site-header, .site-footer, .ad-slot, .nav-toggle, .theme-toggle, .game-toolbar,
  .skip-link, .consent, .modal-backdrop, .related { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .game-frame, .prose table, .table-wrap, .answer-box, .callout, .faq details {
    background: #fff !important; box-shadow: none !important; border: 1px solid #bbb;
  }
  h1, h2, h3 { color: #000; }
  .timer-digits {
    background: none !important; color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .82em; word-break: break-all; }
  .schulte-cell, .diff-item, .vs-tile {
    background: #fff !important; box-shadow: none !important;
    border: 1px solid #666; color: #000;
  }
  .badge, .eyebrow, .answer-label, .timer-phase, .faq summary::after {
    background: none !important; color: #000 !important; box-shadow: none !important;
    border: 1px solid #999;
  }
  h2, h3 { break-after: avoid; }
  table, .faq details { break-inside: avoid; }
}
