/* The font: Nunito (SIL OFL 1.1, web/fonts/OFL.txt), vendored and subset by tools/subset_font.py.
   Named "Bazibo Sans" so a later typeface is a new file here and nothing else. */
@font-face {
  font-family: "Bazibo Sans";
  src: url("../fonts/bazibo-sans.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- design tokens (docs/design/v2-proposal.md, section 1) ----------
   Everything a screen is built from lives here. The colours are the brand of round 3
   (design/brand/tokens.css, Mark 24 Nov 2026: the cut-paper b in five colours with Kralen's
   palette); tests/brand.test.js checks them against design/brand/tokens.json and the contrast
   rules. The old names further down are aliases, so the games keep working on the --bz- names. */
:root {
  /* colour: the brand (design/brand/tokens.json) */
  --bz-base: #fbf7f0;         /* the page: warm paper */
  --bz-surface: #ffffff;      /* cards, tiles, sheets */
  --bz-ink: #28245c;          /* text: 14.0:1 on white, 13.1:1 on the paper */
  --bz-ink-soft: #5a5585;     /* secondary text: 6.8:1 on white, 6.4:1 on the paper */
  --bz-ink-quiet: #635e8e;    /* locked / inactive text and padlocks: 6.0:1 on white, 5.6:1 on the paper */
  --bz-brand: #4f43c4;        /* buttons and links; white on it 7.2:1 */
  --bz-brand-dark: #382e9c;   /* pressed edge of a brand button, headings (9.6:1 on the paper) */
  --bz-brand-tint: #edeafb;   /* selected tint, quiet borders */
  --bz-brand-edge: #c8c2f0;   /* pressed edge of a white button or tile */
  --bz-accent: #f08a5e;       /* the warm accent (the board scrap's night shade): shapes and fills; text on it is ink (5.7:1), never white */
  --bz-accent-dark: #d9663f;  /* pressed edge of an accent button: the board scrap */
  --bz-on-accent: var(--bz-ink);
  --bz-star: #ffc531;         /* an earned star */
  --bz-star-edge: #c98a00;    /* its thin outline, so a gold star still reads as a shape on white */
  --bz-star-empty: var(--bz-ink-quiet); /* an empty star is an outline in this colour, never only a paler fill */
  --bz-focus: var(--bz-ink);  /* focus ring: ink with a gap */
  --bz-scrim: rgba(40, 36, 92, 0.45);

  /* colour: one scrap per game group, as in the mark (design/brand/logo/mark-<group>.svg).
     -acc for shapes and borders (3:1 or more on white and on the paper), -tint for backgrounds,
     -ink for text on the tint (5.3:1 or more). Text never sits on an accent. A game screen gets
     its group from main.js (data-group). */
  --bz-learning-acc: #b97f0a; --bz-learning-tint: #f7edd4; --bz-learning-ink: #7d5606;
  --bz-puzzles-acc: #2a8f88;  --bz-puzzles-tint: #e2f1ef;  --bz-puzzles-ink: #1d6b66;
  --bz-board-acc: #d9663f;    --bz-board-tint: #fbe8de;    --bz-board-ink: #9d4524;
  --bz-creative-acc: #c8508a; --bz-creative-tint: #fae4ef; --bz-creative-ink: #993963;
  --bz-action-acc: #3f86d0;   --bz-action-tint: #e4eefa;   --bz-action-ink: #2a5f94;
  /* the group of the screen in view; outside a game, the brand */
  --bz-group-acc: var(--bz-brand);
  --bz-group-tint: var(--bz-brand-tint);
  --bz-group-ink: var(--bz-brand-dark);

  /* type: one vendored rounded family, a 1.25 scale on 16 px. Nothing a child must read under
     16 px; 13-14 px only for parent small print */
  --bz-font: "Bazibo Sans", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bz-text-xs: 0.8125rem;    /* 13 */
  --bz-text-s: 0.875rem;      /* 14 */
  --bz-text-m: 1rem;          /* 16 */
  --bz-text-l: 1.25rem;       /* 20 */
  --bz-text-xl: 1.5625rem;    /* 25 */
  --bz-text-2xl: 1.9375rem;   /* 31 */
  --bz-text-3xl: 2.4375rem;   /* 39 */
  --bz-weight-text: 700;
  --bz-weight-head: 800;
  --bz-weight-brand: 900;     /* the brand name, titles and the big letters */

  /* spacing on a 4 px grid */
  --bz-space-1: 4px;
  --bz-space-2: 8px;
  --bz-space-3: 12px;
  --bz-space-4: 16px;
  --bz-space-5: 24px;
  --bz-space-6: 32px;
  --bz-space-7: 48px;

  /* five radii */
  --bz-radius-s: 8px;         /* chips, small badges */
  --bz-radius-m: 14px;        /* inputs, cells, swatches */
  --bz-radius-l: 22px;        /* tiles, option cards, icon buttons */
  --bz-radius-xl: 32px;       /* cards and sheets */
  --bz-radius-pill: 999px;

  /* touch: 48 px is the floor for anything a child taps */
  --bz-target: 48px;
  --bz-target-main: 56px;
  --bz-target-icon: 60px;     /* back, settings, hint: the shell's icon buttons */
  --bz-target-big: 76px;      /* the big buttons on the home screen and cards */

  /* depth: a pressed edge and one soft shadow */
  --bz-edge: 0 6px 0;         /* + a colour: the pressed edge of a button */
  --bz-edge-s: 0 5px 0;       /* tiles and icon buttons */
  --bz-shadow: 0 10px 22px rgba(40, 36, 92, 0.22);
  --bz-shadow-s: 0 8px 16px rgba(40, 36, 92, 0.15);
  --bz-motion: 0.08s ease;

  /* the old names, kept as aliases (used across the 23 game stylesheets) */
  --sky: var(--bz-base);      /* the 1.0 page was a sky-lilac-pink gradient; now one paper colour */
  --lilac: var(--bz-base);
  --pink: var(--bz-base);
  --ink: var(--bz-ink);
  --ink-soft: var(--bz-ink-soft);
  --primary: var(--bz-brand);
  --primary-dark: var(--bz-brand-dark);
  --primary-light: var(--bz-brand-tint);
  --accent: var(--bz-accent);
  --gold: var(--bz-star);
  --card: var(--bz-surface);
  --radius: 24px;
  --font: var(--bz-font);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bz-base);
  color: var(--bz-ink);
  font-family: var(--bz-font);
  line-height: 1.2; /* Nunito's own line gap is 1.36; this keeps the layouts measured with the system font */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app { position: fixed; inset: 0; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; }

/* ---------- components: buttons ----------
   .btn: pill, brand fill and white text; .secondary: white with brand text; .orange: the accent
   with ink text (white on orange is 2.35:1); .icon: a square that never shrinks next to a title. */
.btn {
  font: inherit;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-3);
  color: #fff;
  background: var(--bz-brand);
  border-radius: var(--bz-radius-pill);
  box-shadow: var(--bz-edge) var(--bz-brand-dark), var(--bz-shadow);
  transition: transform var(--bz-motion), box-shadow var(--bz-motion);
  touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--bz-brand-dark), 0 4px 10px rgba(40, 36, 92, 0.25); }
.btn:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 4px; }
.btn svg { width: 30px; height: 30px; fill: currentColor; flex: none; }

.btn.big {
  min-width: 240px;
  min-height: var(--bz-target-big);
  padding: 0 36px;
  font-size: 1.8rem;
  font-weight: var(--bz-weight-head);
  letter-spacing: 0.02em;
}
.btn.secondary { background: var(--bz-surface); color: var(--bz-brand); box-shadow: var(--bz-edge) var(--bz-brand-edge), var(--bz-shadow); }
.btn.secondary:active { box-shadow: 0 2px 0 var(--bz-brand-edge); }
.btn.orange { background: var(--bz-accent); color: var(--bz-on-accent); box-shadow: var(--bz-edge) var(--bz-accent-dark), 0 10px 22px rgba(217, 102, 63, 0.25); }
.btn.icon {
  flex: none;
  width: var(--bz-target-icon);
  height: var(--bz-target-icon);
  padding: 0;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  color: var(--bz-brand);
  box-shadow: var(--bz-edge-s) var(--bz-brand-edge), var(--bz-shadow-s);
}
.btn.icon:active { box-shadow: 0 1px 0 var(--bz-brand-edge); }

/* ---------- home ---------- */
#screen-home { overflow-y: auto; -webkit-overflow-scrolling: touch; } /* short phones scroll to the last tiles */
.home-inner {
  position: relative;
  max-width: 100%; /* margin: auto sizes it to its content; without this the widest section (7 fixed-width tiles) pushed it past the screen on tablets */
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 84px 16px 16px; /* the top 84px belong to .home-top (the gear) */
  text-align: center;
}
/* the brand: the cut-paper b beside the drawn name (web/js/logo.js). The h1 keeps the name as
   words for screen readers and tests (.logo-text, from brand.js); the drawing is aria-hidden. */
.logo { margin: 0; line-height: 0; color: var(--bz-ink); font-size: 1rem; }
.logo-word { display: block; height: clamp(46px, 14vw, 74px); aspect-ratio: 410 / 130; }
.logo-word svg { width: 100%; height: 100%; display: block; overflow: visible; }
.logo-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; max-width: 100%; }
.brand-mark { width: clamp(56px, 17vw, 88px); height: clamp(56px, 17vw, 88px); flex: none; filter: drop-shadow(0 4px 6px rgba(40, 36, 92, 0.16)); }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.tagline {
  margin: -4px 0 18px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-wrap: balance;
}
.promise {
  margin: 14px 0 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 800;
  color: var(--primary-dark);
}

/* the store links under the promise: website only (js/store-links.js shows them, never in the app) */
.store-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; max-width: 100%; }
.store-links[hidden] { display: none; }
.store-btn { min-height: 52px; max-width: 100%; padding: 8px 24px; font-size: 1.1rem; font-weight: 800; text-decoration: none; text-align: center; }
.store-soon {
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---------- home: brand and game tiles ---------- */
.home-top {
  position: absolute;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  z-index: 1;
}
/* The tiles sit in sections (a group per kind of game, built by main.js), like the folders on a
   phone's home screen. The sections are stacked, all as wide as the widest, and each one is a grid
   of balanced rows (js/home-grid.js; Mark, 27 Nov 2026): with room for c tiles of at least
   --tile-min, n tiles get ceil(n / ceil(n / c)) columns, so 8 where 7 fit are 2 rows of 4. main.js
   sets --cols and --tracks per section and --tile and --groups-w here, again on every resize.
   Phones: 3 tiles a row on most, 2 on 320 px, filling the row (--tile-max none); wider screens:
   tiles of exactly --tile-min (--tile-max below). */
.tile-groups {
  --tile-min: 96px;
  --tile-max: none;
  --tile-gap: 10px;
  --group-pad: 10px;
  --art: 0.66; /* the 92 px drawings on the tiles, scaled */
  width: var(--groups-w, 100%);
  max-width: 560px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0 0 4px;
}
.tile-group {
  flex: 1 1 100%;
  min-width: 0;
  padding: 8px var(--group-pad) 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
  text-align: left;
}
/* each section in its group's tint, its name in the group's ink (the colour the game's menus use) */
.tile-group[data-group] { background: var(--bz-group-tint); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }
.tile-group[data-group] .group-name { color: var(--bz-group-ink); }
/* a section's name beside its own mark (the b on the group's scrap): colour is never the only cue */
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; }
.group-mark { width: 26px; height: 26px; flex: none; }
.group-mark svg { width: 100%; height: 100%; display: block; }
.group-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--primary-dark);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), var(--tile, minmax(0, 1fr)));
  justify-content: center; /* a section with fewer columns than the widest keeps its tiles together in the middle */
  gap: var(--tile-gap);
}
/* when one tile would stand alone in the last row (7 in 3 columns), the last rows take one tile
   less and stand centred (3, 2, 2): half-width tracks, each tile spans two, a shorter row starts
   one track in (.row-in, set by main.js) */
.tiles.brick { grid-template-columns: repeat(var(--tracks), calc((var(--tile) - var(--tile-gap)) / 2)); }
.tiles.brick > .tile { grid-column: span 2; }
.tiles.brick > .tile.row-in { grid-column: 2 / span 2; }
.tile {
  font: inherit;
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 10px 5px;
  border: 0;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  color: var(--bz-brand);
  box-shadow: var(--bz-edge-s) var(--bz-brand-edge), var(--bz-shadow-s);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  container-type: inline-size; /* the name's size follows the tile's width (cqi) */
}
.tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bz-brand-edge), 0 3px 8px rgba(40, 36, 92, 0.18); }
.tile:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.tile-art { width: 92px; height: 92px; display: block; flex: none; zoom: var(--art); }
.tile-art > span { flex: none; } /* the drawn mini boards keep their shape */
/* the longest single words ("Kleurplaten", "Ganzenbord") must fit whole in a 3-column tile at 360 px */
.tile-name { font-size: min(1rem, 14.6cqi); font-weight: 900; line-height: 1.15; overflow-wrap: break-word; hyphens: manual; }
/* a small second line under a name (meta.subKey), e.g. Pachisi's "the original game from India" */
.tile-sub { margin-top: -4px; font-size: min(0.7rem, 10.5cqi); font-weight: 800; line-height: 1.1; color: var(--ink-soft); }
.tile.soon { background: rgba(255, 255, 255, 0.72); color: var(--ink-soft); }
.tile.soon .tile-art { opacity: 0.6; }

/* ---------- home: Mijn spelletjes (js/favorites.js, main.js renderFavorites) ----------
   "Mijn spelletjes kiezen" turns the tiles into star toggles until Klaar: the bar then stays at the
   top while scrolling, every tile shows its star (an outline, or gold when starred) and a tap
   stars it instead of opening the game. Outside that mode a starred game has a small gold star
   in its own section; the section Mijn spelletjes (brand tint) stands at the top of the tiles. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.fav-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; max-width: 100%; margin: -14px 0 -6px; }
.fav-edit { min-height: var(--bz-target); max-width: 100%; padding: 6px 22px; font-size: 1.05rem; font-weight: 800; gap: 8px; }
/* while choosing, a tile reached by the keyboard never hides under the bar at the top */
#screen-home.fav-choosing { scroll-padding-top: 150px; }
.fav-edit svg { width: 24px; height: 24px; }
.fav-bar.editing {
  position: sticky;
  top: 8px;
  z-index: 5;
  padding: 8px 14px;
  border-radius: var(--bz-radius-xl);
  background: var(--bz-surface);
  box-shadow: 0 0 0 3px var(--bz-star-edge), var(--bz-shadow);
}
.fav-hint { margin: 0; font-weight: 800; color: var(--bz-ink); text-wrap: balance; }
.fav-hint[hidden] { display: none; }
.fav-mark svg { fill: var(--bz-star); stroke: var(--bz-star-edge); stroke-width: 1.5; stroke-linejoin: round; }
.fav-empty { margin: 2px 6px 4px; font-weight: 700; color: var(--bz-ink-soft); }
/* the words that make a tile's name "Zet Treintje bij Mijn spelletjes": only while choosing, for screen readers */
.fav-words { display: none; }
.tile-groups.fav-editing .fav-words { display: block; position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fav-star { display: none; position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; pointer-events: none; }
.fav-star svg { width: 100%; height: 100%; display: block; fill: var(--bz-star); stroke: var(--bz-star-edge); stroke-width: 1.5; stroke-linejoin: round; }
.tile.fav:not(.fav-copy) .fav-star { display: block; }
.tile-groups.fav-editing .fav-star {
  display: block;
  top: 4px;
  right: 4px;
  width: 34px;
  height: 34px;
  padding: 4px;
  border-radius: 50%;
  background: var(--bz-surface);
  box-shadow: 0 1px 4px rgba(40, 36, 92, 0.28);
}
.tile-groups.fav-editing .tile:not(.fav) .fav-star svg { fill: none; stroke: var(--bz-star-empty); stroke-width: 2; }
.tile-groups.fav-editing .tile.fav { box-shadow: 0 0 0 3px var(--bz-star-edge), var(--bz-edge-s) var(--bz-brand-edge), var(--bz-shadow-s); }
.badge {
  position: absolute;
  top: -10px;
  right: -8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bz-accent);
  color: var(--bz-on-accent);
  font-size: var(--bz-text-s);
  font-weight: var(--bz-weight-brand);
  box-shadow: 0 3px 0 var(--bz-accent-dark);
  transform: rotate(6deg);
}

/* ---------- Voortgang overzetten ---------- */
.transfer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.transfer-tabs { margin-bottom: 4px; flex-wrap: nowrap; width: 100%; max-width: 420px; }
.transfer-tabs .seg-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; white-space: nowrap; }
.transfer-pane { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.transfer-pane[hidden] { display: none; }
.transfer-qr {
  width: min(78vw, 46vh, 340px);
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(40, 36, 92, 0.18);
}
.transfer-part { margin: 0; min-height: 1.4em; font-weight: 900; color: var(--primary-dark); }
.transfer-msg { margin: 0; min-height: 1.4em; font-weight: 700; color: var(--ink-soft); line-height: 1.4; }
.transfer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.transfer-code {
  width: 100%;
  min-height: 90px;
  font: 600 0.85rem/1.35 ui-monospace, monospace;
  border: 3px solid var(--primary-light);
  border-radius: 14px;
  padding: 10px;
  resize: vertical;
  background: #fff;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.transfer-cam {
  position: relative;
  width: min(78vw, 42vh, 340px);
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #2b2560;
}
.transfer-cam[hidden] { display: none; }
.transfer-cam video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; }
.transfer-cam.on video { opacity: 1; }
.transfer-frame {
  position: absolute;
  inset: 14%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  pointer-events: none;
}
.transfer-pane .btn { min-height: 56px; padding: 0 20px; font-size: 1.05rem; font-weight: 800; }
.transfer-pane .btn.secondary[aria-pressed='true'] { background: var(--primary); color: #fff; box-shadow: 0 6px 0 var(--primary-dark); }
.transfer-paste-head { margin: 8px 0 0; font-size: 1.1rem; font-weight: 900; color: var(--primary-dark); }
@media (orientation: landscape) and (max-height: 500px) {
  /* short and wide: the code (or camera) on the left, the text and buttons beside it */
  .transfer-pane:not([hidden]) {
    max-width: 760px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    text-align: left;
  }
  .transfer-pane > .transfer-qr, .transfer-pane > .transfer-cam { grid-row: 1 / span 6; align-self: start; }
  .transfer-pane > :not(.transfer-qr):not(.transfer-cam) { grid-column: 2; }
  .transfer-pane:not([hidden]) { align-content: start; row-gap: 6px; }
  .transfer-pane .setting-text { margin: 0; font-size: 0.95rem; }
  .transfer-pane .btn { min-height: 46px; }
  .transfer-scroll { padding-top: 4px; gap: 8px; }
  .transfer-tabs .seg-btn { min-height: 42px; }
  .transfer-qr, .transfer-cam { width: min(40vw, calc(100vh - 168px)); }
  .transfer-actions { justify-content: flex-start; }
}

/* ---------- Over Bazibo (from the settings): Mark's own words, one calm sheet ---------- */
.about-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--bz-space-2) var(--bz-space-4) var(--bz-space-6);
}
.about-text {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--bz-space-5) var(--bz-space-5) var(--bz-space-4);
  border-radius: var(--bz-radius-xl);
  background: var(--bz-surface);
  color: var(--bz-ink);
  font-size: var(--bz-text-m);
  font-weight: var(--bz-weight-text);
  line-height: 1.55;
  overflow-wrap: break-word;
}
.about-text p { margin: 0 0 var(--bz-space-4); }
.about-text .about-hello { font-size: var(--bz-text-l); font-weight: var(--bz-weight-head); color: var(--bz-brand-dark); }
.about-text .about-sign { font-size: var(--bz-text-l); font-weight: var(--bz-weight-brand); color: var(--bz-brand-dark); }
.about-links { margin: var(--bz-space-2) 0 0; }
.about-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--bz-target);
  color: var(--bz-brand);
  font-weight: var(--bz-weight-head);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 360px) {
  .about-text { padding: var(--bz-space-4); }
}

/* ---------- settings ---------- */
.settings-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 32px;
}
.setting {
  max-width: 480px;
  margin: 0 auto 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
}
.setting h3 { margin: 0 0 12px; font-size: 1.3rem; font-weight: 900; color: var(--primary-dark); }
.setting-text { margin: 0 0 14px; font-weight: 700; color: var(--ink-soft); line-height: 1.4; }
.seg { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.seg-btn {
  font: inherit;
  min-height: var(--bz-target-main);
  min-width: 130px;
  padding: 0 18px;
  border: 3px solid var(--bz-brand-tint);
  border-radius: var(--bz-radius-pill);
  background: var(--bz-surface);
  color: var(--bz-brand);
  font-size: 1.15rem;
  font-weight: var(--bz-weight-head);
  cursor: pointer;
  touch-action: manipulation;
}
.seg-btn[aria-pressed="true"] { background: var(--bz-brand); border-color: var(--bz-brand); color: #fff; }
.seg-btn:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.btn.wide { width: 100%; max-width: 360px; min-height: 60px; padding: 0 20px; font-size: 1.15rem; font-weight: 800; }
.btn[hidden] { display: none; }

/* ---------- components: the bar ----------
   One header for every screen: back left, the title in the middle, one action (or a spacer) right */
.bar {
  display: flex;
  align-items: center;
  gap: var(--bz-space-3);
  padding: var(--bz-space-3) var(--bz-space-4) var(--bz-space-2);
  flex: none;
}
/* the back button keeps its 60 px next to a long title (Verstoppertje squeezed it to 33 px at 320) */
.bar > .btn.icon:first-child { flex: none; }
.bar h2 { flex: 1; margin: 0; text-align: center; font-size: 1.6rem; font-weight: var(--bz-weight-brand); line-height: 1.15; }
.bar-spacer { width: var(--bz-target-icon); flex: none; }
/* a title with a small line under it (Piano, Drumstel: the song and its age) */
.bar-title { flex: 1; min-width: 0; text-align: center; }
.bar .bar-title h2 {
  flex: none;
  font-size: clamp(1.1rem, 5.4vw, 1.5rem); /* a long song name stays two lines and leaves the keys their room */
  line-height: 1.1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.bar-sub { margin: 2px 0 0; font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); line-height: 1.2; color: var(--bz-ink-soft); }
.bar-sub:empty { display: none; }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bz-scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10;
}
.overlay[hidden] { display: none; }
.card {
  width: min(380px, 100%);
  background: var(--bz-surface);
  border-radius: var(--bz-radius-xl);
  padding: 28px 22px 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(30, 20, 90, 0.35);
  animation: pop-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.card h2 { margin: 6px 0 6px; font-size: 2.2rem; font-weight: var(--bz-weight-brand); color: var(--bz-brand); }
.card p { margin: 0 0 20px; font-size: 1.15rem; font-weight: var(--bz-weight-text); color: var(--bz-ink-soft); line-height: 1.4; }
.card p:empty { display: none; }
/* numbered steps under a card's text (the website's "how it works" before the payment page) */
.ov-steps { margin: -8px 0 20px; padding: 0 0 0 1.6em; text-align: left; font-size: 1.05rem; font-weight: var(--bz-weight-text); color: var(--bz-ink-soft); line-height: 1.4; }
.ov-steps[hidden] { display: none; }
.ov-steps li + li { margin-top: 6px; }
/* a line under the steps (where the website's code works) */
.card p.ov-note { margin-top: -8px; font-size: 1.05rem; text-align: left; }
/* Settings: the website's "I have a code" under "More about the full version" */
#btn-code { margin-top: 12px; }
.ov-buttons { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ov-buttons .btn.big { min-width: 0; width: 100%; max-width: 300px; font-size: 1.5rem; min-height: 68px; }
.ov-art { display: flex; justify-content: center; gap: 6px; min-height: 8px; }
/* stars: an empty one is an outline, an earned one is filled with a darker edge, so the difference is
   the shape and never colour alone (the style audit measured 1.09:1 between the two) */
.ov-art .star { width: 64px; height: 64px; fill: none; stroke: var(--bz-star-empty); stroke-width: 1.6; stroke-linejoin: round; }
.ov-art .star.on { fill: var(--bz-star); stroke: var(--bz-star-edge); stroke-width: 1; filter: drop-shadow(0 4px 0 #e0a100); animation: star-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.ov-art .star:nth-child(2) { margin-top: -14px; }
.ov-art .star:nth-child(2).on { animation-delay: 0.15s; }
.ov-art .star:nth-child(3).on { animation-delay: 0.3s; }
.ov-art .lock { width: 84px; height: 84px; fill: var(--bz-brand); }
.card { max-height: 100%; overflow-y: auto; }
.gate-input {
  width: 100%;
  max-width: 300px;
  min-height: 64px;
  border: 3px solid var(--bz-brand-tint);
  border-radius: var(--bz-radius-l);
  font: var(--bz-weight-brand) 2rem var(--bz-font);
  color: var(--bz-ink);
  text-align: center;
  background: var(--bz-surface);
}
.gate-input:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 2px; border-color: var(--bz-brand); }
/* the website's unlock code (unlock-code.js): long, pasted, so small type that wraps nowhere */
.code-input {
  width: 100%;
  max-width: 300px;
  min-height: 56px;
  padding: 0 12px;
  border: 3px solid var(--bz-brand-tint);
  border-radius: var(--bz-radius-l);
  font: var(--bz-weight-text) 1rem var(--bz-font);
  color: var(--bz-ink);
  background: var(--bz-surface);
}
.code-input:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 2px; border-color: var(--bz-brand); }
/* under the child's OK: a quiet way in for parents (website only), still a 48 px target */
.ov-parents { display: flex; justify-content: center; margin-top: 12px; }
.ov-parents[hidden] { display: none; }
.btn.link.ov-parents-btn {
  min-height: 48px;
  padding: 0 16px;
  background: none;
  box-shadow: none;
  color: var(--bz-ink-soft);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.link.ov-parents-btn:active { transform: none; box-shadow: none; }
.small-links { margin: 28px 0 8px; text-align: center; font-size: 0.95rem; font-weight: 700; }
.small-links a { color: var(--bz-ink-soft); }

@keyframes pop-in { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes star-in { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  .card, .ov-art .star.on { animation: none; }
}

/* short screens (small phones, sideways): a compact card, so every button stays on screen */
@media (max-height: 600px) {
  .card { padding: 18px 18px 18px; }
  .card h2 { font-size: 1.8rem; }
  .card p { margin-bottom: 12px; font-size: 1.05rem; }
  .ov-buttons { gap: 10px; }
  .ov-buttons .btn.big { min-height: 54px; font-size: 1.3rem; }
  .ov-art .star { width: 48px; height: 48px; }
  .ov-art .lock { width: 60px; height: 60px; }
}

/* short landscape screens: keep buttons reachable */
@media (max-height: 520px) {
  .home-inner { gap: 12px; padding-top: 16px; } /* wide enough that the gear sits beside the name */
  .logo-word { height: 42px; }
  .brand-mark { width: 52px; height: 52px; }
  .btn.big { min-height: 60px; font-size: 1.4rem; }
  .tagline { margin-bottom: 4px; }
  .promise { display: none; }
  .tile-groups { --tile-min: 92px; --tile-gap: 8px; --group-pad: 8px; --art: 0.62; }
  .tile { min-height: 108px; padding: 8px 4px; }
  .tile-name { font-size: min(0.92rem, 14.6cqi); }
  .group-head { margin-bottom: 6px; }
  .group-name { font-size: 1rem; }
}

/* narrow phones (320 px): two tiles a row, so the names stay whole; the drawings a bit bigger */
@media (max-width: 359px) {
  .tile-groups { --art: 0.78; --tile-gap: 10px; }
}

/* wider screens: tiles of exactly --tile-min (as before), the sections as wide as the widest one's tiles */
@media (min-width: 560px) {
  .tile-groups { --tile-max: var(--tile-min); max-width: 1180px; gap: 16px; }
}
/* tablets and desktop (tall enough): bigger tiles */
@media (min-width: 720px) and (min-height: 521px) {
  .tile-groups { --tile-min: 124px; --tile-gap: 12px; --group-pad: 12px; --art: 0.86; }
  .tile { min-height: 150px; border-radius: 26px; gap: 8px; }
  .tile-name { font-size: 1.1rem; }
  .group-name { font-size: 1.15rem; }
}
@media (min-width: 1100px) and (min-height: 521px) {
  .tile-groups { --tile-min: 140px; --art: 0.95; }
  .tile { min-height: 166px; }
  .tile-name { font-size: 1.15rem; }
}

/* ---------- components: menus (js/menu.js; v2-proposal.md, section 1) ----------
   Every game menu is built from these: a heading, option cards (a picture, a title, one line), a
   card with segmented choices (the computer's levels), level cells, and the Play bar. Selected is
   the group's tint with a 3 px border in the group's accent; text stays ink, never on the accent. */
[data-group="learning"] { --bz-group-acc: var(--bz-learning-acc); --bz-group-tint: var(--bz-learning-tint); --bz-group-ink: var(--bz-learning-ink); }
[data-group="puzzles"] { --bz-group-acc: var(--bz-puzzles-acc); --bz-group-tint: var(--bz-puzzles-tint); --bz-group-ink: var(--bz-puzzles-ink); }
[data-group="board"] { --bz-group-acc: var(--bz-board-acc); --bz-group-tint: var(--bz-board-tint); --bz-group-ink: var(--bz-board-ink); }
[data-group="creative"] { --bz-group-acc: var(--bz-creative-acc); --bz-group-tint: var(--bz-creative-tint); --bz-group-ink: var(--bz-creative-ink); }
[data-group="action"] { --bz-group-acc: var(--bz-action-acc); --bz-group-tint: var(--bz-action-tint); --bz-group-ink: var(--bz-action-ink); }

.levels-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--bz-space-2) var(--bz-space-4) var(--bz-space-6);
}
.menu { max-width: 560px; margin: 0 auto; padding-bottom: var(--bz-space-4); }
.menu-head {
  margin: var(--bz-space-5) var(--bz-space-1) var(--bz-space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--bz-space-1) var(--bz-space-3);
  font-size: var(--bz-text-l);
  font-weight: var(--bz-weight-brand);
  line-height: 1.2;
  color: var(--bz-ink);
}
.menu-head:first-child, .menu-continue + .menu-head { margin-top: var(--bz-space-1); }
.menu-head.with-art { flex-wrap: nowrap; align-items: center; margin-top: var(--bz-space-6); }
.menu-head.with-art:first-child, .menu-continue + .menu-head.with-art { margin-top: var(--bz-space-1); }
.menu-head-art { flex: none; width: 64px; height: 48px; }
.menu-head-art > svg { width: 100%; height: 100%; display: block; }
.menu-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-head-sub { font-size: var(--bz-text-s); font-weight: var(--bz-weight-text); color: var(--bz-ink-soft); }
.menu-age {
  padding: 2px 10px;
  border-radius: var(--bz-radius-pill);
  background: rgba(255, 255, 255, 0.8);
  font-size: var(--bz-text-s);
  font-weight: var(--bz-weight-head);
  color: var(--bz-ink-soft);
}
.menu-line { margin: var(--bz-space-4) var(--bz-space-1) var(--bz-space-2); font-size: var(--bz-text-m); font-weight: var(--bz-weight-head); line-height: 1.25; color: var(--bz-ink-soft); }
.menu-continue { display: flex; margin: var(--bz-space-1) auto var(--bz-space-5); min-width: 220px; }

/* option card */
.option-row { display: flex; flex-wrap: wrap; gap: var(--bz-space-3); }
.option-card, .option-box {
  font: inherit;
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: var(--bz-space-3);
  padding: var(--bz-space-2) var(--bz-space-4) var(--bz-space-2) var(--bz-space-3);
  border: 3px solid transparent;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  color: var(--bz-ink);
  box-shadow: 0 3px 0 var(--bz-brand-edge), var(--bz-shadow-s);
  text-align: left;
}
.option-card { cursor: pointer; touch-action: manipulation; transition: transform var(--bz-motion), box-shadow var(--bz-motion); }
.option-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bz-brand-edge); }
.option-card:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.option-card[aria-pressed="true"], .option-box.on {
  border-color: var(--bz-group-acc);
  background: var(--bz-group-tint);
  box-shadow: 0 3px 0 var(--bz-group-acc);
}
.option-card.wide { width: 100%; flex-basis: 100%; }
.option-card + .option-card.wide, .option-card.wide + .option-card.wide { margin-top: var(--bz-space-3); }
.option-art { flex: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.option-art > svg, .option-art > img { width: 100%; height: 100%; display: block; }
.option-card.wide .option-art { width: 76px; height: 60px; }
.option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option-title { font-size: var(--bz-text-l); font-weight: var(--bz-weight-brand); line-height: 1.15; color: var(--bz-ink); }
.option-sub { font-size: var(--bz-text-s); font-weight: var(--bz-weight-text); line-height: 1.25; color: var(--bz-ink-soft); }
.option-age { font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); color: var(--bz-group-ink); }
[aria-pressed="true"] > .option-text > .option-title, .option-box.on > .option-title { color: var(--bz-group-ink); }
.option-card.locked, .option-box.locked { background: rgba(255, 255, 255, 0.6); box-shadow: 0 3px 0 var(--bz-brand-tint); }
.option-card.locked .option-title { color: var(--bz-ink-quiet); }
.option-card > .lock { flex: none; width: 22px; height: 22px; fill: var(--bz-ink-quiet); }
.option-card.lead { background: var(--bz-group-tint); box-shadow: 0 3px 0 var(--bz-group-acc); } /* the first, open choice (free play) */
.option-card > .stars { flex: none; display: flex; gap: 1px; }
.option-card > .stars svg { width: 18px; height: 18px; fill: none; stroke: var(--bz-star-empty); stroke-width: 2; stroke-linejoin: round; }
.option-card > .stars svg.on { fill: var(--bz-star); stroke: var(--bz-star-edge); stroke-width: 1.2; }

/* a picture card: the picture big on top, the name under it (places, puzzles, colouring pages) */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--bz-space-3); }
.option-card.pic {
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--bz-space-1);
  min-height: 0;
  padding: var(--bz-space-2) var(--bz-space-2) var(--bz-space-2);
  text-align: center;
}
.option-card.pic .option-art { width: 100%; height: auto; }
.option-card.pic .option-art > svg, .option-card.pic .option-art > img, .option-card.pic .option-art > canvas { width: 100%; height: auto; border-radius: var(--bz-radius-m); }
.option-card.pic .option-text { align-items: center; }
.option-card.pic .option-title { font-size: var(--bz-text-m); }
.option-card.pic > .lock { position: absolute; top: var(--bz-space-2); right: var(--bz-space-2); width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--bz-surface); }

/* a card with segmented choices: the computer and its levels */
.option-box { flex-wrap: wrap; flex-basis: 260px; }
.option-box > .option-title { flex: 1 1 0; }
.seg-cards { flex: 1 1 100%; display: flex; gap: var(--bz-space-2); }
.seg-card {
  font: inherit;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  min-height: var(--bz-target-main);
  padding: 6px 4px;
  border: 3px solid var(--bz-brand-tint);
  border-radius: var(--bz-radius-m);
  background: var(--bz-surface);
  color: var(--bz-ink);
  font-size: var(--bz-text-m);
  font-weight: var(--bz-weight-head);
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
}
.seg-card[aria-pressed="true"] { border-color: var(--bz-group-acc); background: var(--bz-group-tint); color: var(--bz-group-ink); }
.option-box.on .seg-card[aria-pressed="true"] { background: var(--bz-surface); } /* on the tinted card the chosen one is white */
.seg-card:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 2px; }
.seg-card .dots { display: flex; gap: 4px; }
.seg-card .dots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bz-ink-quiet); display: block; }
.seg-card .dots i.on { background: var(--bz-group-acc); border-color: var(--bz-group-acc); }
.seg-card.locked { color: var(--bz-ink-quiet); background: rgba(255, 255, 255, 0.6); }
.seg-card.locked .dots i.on { background: var(--bz-ink-quiet); border-color: var(--bz-ink-quiet); }
.seg-card > .lock { position: absolute; top: -8px; right: -6px; width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--bz-surface); fill: var(--bz-ink-quiet); }
.seg-card .lv-wins { display: inline-flex; align-items: center; gap: 2px; font-size: var(--bz-text-s); }
.seg-card .lv-wins svg { width: 18px; height: 18px; color: var(--bz-ink); }

/* a player slot: who plays with which piece; a tap changes who (a child, the computer, nobody) */
.player-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bz-space-3); }
.player-slot {
  font: inherit;
  position: relative;
  min-width: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: var(--bz-space-2);
  padding: var(--bz-space-2) 30px var(--bz-space-2) var(--bz-space-2);
  border: 3px solid transparent;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  color: var(--bz-ink);
  box-shadow: 0 3px 0 var(--bz-brand-edge), var(--bz-shadow-s);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.player-slot:disabled { cursor: default; opacity: 1; }
.player-slot:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.player-slot.kind-kid, .player-slot.kind-cpu { border-color: var(--bz-group-acc); background: var(--bz-group-tint); box-shadow: 0 3px 0 var(--bz-group-acc); }
.player-slot.kind-off, .player-slot.locked { background: rgba(255, 255, 255, 0.6); box-shadow: 0 3px 0 var(--bz-brand-tint); }
.player-slot.kind-off .slot-face, .player-slot.locked .slot-face { opacity: 0.5; }
.player-slot .slot-face { flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.player-slot .slot-face svg { width: 100%; height: 100%; display: block; }
.player-slot .slot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.player-slot .slot-name { font-size: var(--bz-text-m); font-weight: var(--bz-weight-brand); line-height: 1.15; color: var(--bz-ink); overflow-wrap: break-word; }
.player-slot.kind-kid .slot-name, .player-slot.kind-cpu .slot-name { color: var(--bz-group-ink); }
.player-slot.locked .slot-name { color: var(--bz-ink-quiet); }
.player-slot .slot-kind { display: flex; align-items: center; gap: 4px; font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); line-height: 1.15; color: var(--bz-ink-soft); }
.player-slot .slot-kind svg { width: 22px; height: 22px; flex: none; }
.player-slot .swap { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; font-size: 1.1rem; line-height: 1; color: var(--bz-group-ink); }
.player-slot > .lock { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; fill: var(--bz-ink-quiet); }

/* phones: a list of players one a row (Ganzenbord, Ludo), room for "Blauwe gans" and "de computer" side by side */
@media (max-width: 420px) {
  .player-slots.list { grid-template-columns: 1fr; gap: var(--bz-space-2); }
  .player-slots.list .player-slot { min-height: 60px; padding: 4px 34px 4px 8px; }
  .player-slots.list .slot-face { width: 46px; height: 46px; }
  .player-slots.list .slot-text { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; }
  .player-slots.list .swap, .player-slots.list .player-slot > .lock { top: 50%; margin-top: -10px; right: 10px; }
}

/* level cell */
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--bz-space-3);
  max-width: 560px;
  margin: 0 auto;
}
@media (min-width: 600px) { .level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.level-cell {
  font: inherit;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 64px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: var(--bz-radius-m);
  background: var(--bz-surface);
  color: var(--bz-ink);
  box-shadow: 0 3px 0 var(--bz-brand-edge), var(--bz-shadow-s);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--bz-motion), box-shadow var(--bz-motion);
}
.level-cell:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bz-brand-edge); }
.level-cell:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.level-cell .num { font-size: var(--bz-text-xl); font-weight: var(--bz-weight-brand); line-height: 1; }
/* quiet stars: small, only once played; an empty one is an outline, an earned one filled */
.level-cell .stars { display: flex; gap: 1px; }
.level-cell .stars svg { width: 13px; height: 13px; fill: none; stroke: var(--bz-star-empty); stroke-width: 2; stroke-linejoin: round; }
.level-cell .stars svg.on { fill: var(--bz-star); stroke: var(--bz-star-edge); stroke-width: 1.2; }
.level-cell.next { border-color: var(--bz-group-acc); background: var(--bz-group-tint); color: var(--bz-group-ink); box-shadow: 0 3px 0 var(--bz-group-acc); }
/* a choice shown as a cell (Legpuzzel's sizes): its picture, the number, a short line */
.level-grid.size-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 600px) { .level-grid.size-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.level-cell.size-cell { aspect-ratio: auto; min-height: 96px; padding: var(--bz-space-2) var(--bz-space-1); gap: 2px; }
.level-cell .cell-art { width: 30px; height: 30px; display: block; }
.level-cell .cell-art > svg { width: 100%; height: 100%; display: block; }
.level-cell .cell-sub { font-size: var(--bz-text-xs); font-weight: var(--bz-weight-head); line-height: 1.15; color: var(--bz-ink-soft); white-space: nowrap; }
.level-cell[aria-pressed="true"] { border-color: var(--bz-group-acc); background: var(--bz-group-tint); color: var(--bz-group-ink); box-shadow: 0 3px 0 var(--bz-group-acc); }
.level-cell.locked { background: rgba(255, 255, 255, 0.6); color: var(--bz-ink-quiet); box-shadow: 0 3px 0 var(--bz-brand-tint); }
.level-cell.locked > .lock { width: 20px; height: 20px; fill: currentColor; }

/* a saved picture with its own bin (menu.js withTrash: Tekenen's "my drawings", Kleurplaten's
   "my pictures"): a separate 48 px button on the card's lower corner, a small white disc inside it.
   It hangs out below the card (into the wider row gap of .keep-grid) and a little to the right
   (less than the column gap), so the card's middle third, even 88 px at 320 wide, stays free for
   opening the picture and the bin never reaches the next card. */
.level-grid.keep-grid { row-gap: 30px; }
.keep-item { position: relative; min-width: 0; }
.keep-item > :first-child { width: 100%; }
.trash-btn {
  position: absolute;
  right: -8px;
  bottom: -24px;
  z-index: 1;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.trash-disc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bz-surface);
  color: var(--bz-ink-soft);
  box-shadow: 0 0 0 2px var(--bz-brand-edge), 0 3px 8px rgba(40, 36, 92, 0.22);
}
.trash-disc > svg { width: 22px; height: 22px; display: block; }
.trash-btn:active .trash-disc { transform: translateY(1px); background: var(--bz-brand-tint); }
.trash-btn:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 0; }

/* the "random" card (full version), one per tier in a level list (js/random.js): a whole row */
.level-grid .level-cell.random-btn {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  justify-items: start;
  column-gap: var(--bz-space-3);
  row-gap: 2px;
  padding: var(--bz-space-2) var(--bz-space-3) var(--bz-space-2) var(--bz-space-4);
  overflow: hidden;
  text-align: left;
  border-style: dashed;
  border-color: var(--bz-group-acc);
}
.level-grid .level-cell.random-btn .dice { grid-row: 1 / span 2; grid-column: 1; width: 36px; height: 36px; fill: none; color: var(--bz-group-acc); }
.level-grid .level-cell.random-btn .random-label { grid-row: 1; grid-column: 2; align-self: end; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bz-text-l); font-weight: var(--bz-weight-brand); line-height: 1.1; }
.level-grid .level-cell.random-btn .random-sub { grid-row: 2; grid-column: 2; align-self: start; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bz-text-s); font-weight: var(--bz-weight-text); color: var(--bz-ink-soft); }
.level-grid .level-cell.random-btn .lock { grid-row: 1 / span 2; grid-column: 3; width: 20px; height: 20px; fill: currentColor; }
.level-grid .level-cell.random-btn.locked { border-color: var(--bz-brand-tint); }
.level-grid .level-cell.random-btn.locked .dice { color: var(--bz-ink-quiet); }

/* Play stays in reach at the bottom of a setup menu, also before the child scrolls; the scroll
   area's bottom padding moves into the bar, so it sits flush on the bottom edge */
.levels-scroll.with-actions { padding-bottom: 0; } /* set in index.html on the setup menus with a Play bar */
.menu-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bz-space-3);
  justify-content: center;
  margin-top: var(--bz-space-5);
  padding: var(--bz-space-4) 0 var(--bz-space-4);
  background: linear-gradient(180deg, rgba(251, 247, 240, 0), var(--bz-base) 30%);
}
.menu-actions .btn.big { min-width: 180px; }
/* short screens: a pinned bar would cover the choices, so it scrolls with the menu */
@media (max-height: 600px) {
  .menu-actions { position: static; background: none; padding-bottom: var(--bz-space-5); }
}

/* ---------- components: the "Volledige versie" fold (js/fold.js) ----------
   The locked choices of a menu, gathered at its end and closed by default: the child sees the
   free games first, a parent finds what the full version adds in one place. */
.full-fold { width: 100%; max-width: 560px; margin: var(--bz-space-6) auto var(--bz-space-4); text-align: left; }
.full-fold-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-2);
  min-height: var(--bz-target-main);
  padding: 0 var(--bz-space-5);
  border-radius: var(--bz-radius-pill);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 2px var(--bz-brand-tint);
  color: var(--bz-ink-soft);
  font-size: var(--bz-text-m);
  font-weight: var(--bz-weight-head);
  cursor: pointer;
  touch-action: manipulation;
}
.full-fold-head::-webkit-details-marker { display: none; }
.full-fold-head:focus-visible { outline: 4px solid var(--bz-focus); outline-offset: 3px; }
.full-fold-lock { width: 20px; height: 20px; fill: currentColor; flex: none; }
.full-fold-chevron { width: 22px; height: 22px; flex: none; transition: transform var(--bz-motion); }
.full-fold[open] .full-fold-chevron { transform: rotate(180deg); }
.full-fold-body { padding-top: var(--bz-space-4); }
.full-fold-body > [hidden] { display: none; }
/* a section the fold emptied (its heading too); a class, so no display rule of a game can beat it */
.fold-emptied { display: none !important; }
/* inside the fold the one padlock on the fold says it all: no padlock on every button */
.full-fold .level-cell.locked:not(.random-btn) > svg,
.full-fold .locked > .lock,
.full-fold .locked .kleur-badge.lock { display: none; }
@media (prefers-reduced-motion: reduce) { .full-fold-chevron { transition: none; } }
/* the app that sells nothing (the iOS app with its App Store purchase off, js/free-only.js): the free part is the whole app,
   so no fold, no locked choice, no padlock, no word about buying, no jump to the random boards */
.free-only .full-fold,
.free-only .locked,
.free-only [data-sales],
.free-only .kleur-badge.lock,
.free-only #btn-random-jump { display: none !important; }
.full-fold-sub { margin: var(--bz-space-3) var(--bz-space-1) var(--bz-space-2); font-size: var(--bz-text-l); font-weight: var(--bz-weight-brand); color: var(--bz-brand-dark); }
