/* learnwith.games – kid-friendly design system. System fonts only, no external assets.
   Colours are checked for WCAG AA: dark ink on light year/subject tints, white only on the dark subject shades. */
:root {
  --ink: #1b1f3b;
  --ink-soft: #474d70;
  --bg: #fffaf0;
  --card: #ffffff;
  --line: #e6e1d3;
  --brand: #3b5bdb;
  --brand-dark: #2b44b0;
  --brand-soft: #e5ebff;
  --sun: #ffd23f;
  --sun-dark: #e0a800;
  --good: #2b8a3e;
  --good-dark: #1f6b2f;
  --good-soft: #e3f9e5;
  --bad: #c92a2a;
  --bad-dark: #a51f1f;
  --bad-soft: #ffe3e3;
  --focus: #ff8a00;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 2px 0 rgba(27, 31, 59, .06), 0 8px 24px rgba(27, 31, 59, .08);
  /* years: light, cheerful, dark text on top */
  --y1: #ffe066; --y1-d: #c99a00;
  --y2: #ffc078; --y2-d: #d9711c;
  --y3: #8ce99a; --y3-d: #2f9e44;
  --y4: #74c0fc; --y4-d: #1c7ed6;
  --y5: #b197fc; --y5-d: #7048e8;
  --y6: #faa2c1; --y6-d: #d6336c;
  /* subjects: base (white text OK), tint (background), */
  --maths: #2563eb; --maths-t: #e0ecff;
  --english: #c2255c; --english-t: #ffe3ee;
  --science: #2b8a3e; --science-t: #e3f9e5;
  --geography: #0b7285; --geography-t: #dff7fa;
  --history: #a85300; --history-t: #fff0db;
  --computing: #6741d9; --computing-t: #ede7ff;
  --languages: #b8400b; --languages-t: #ffe8d9;
  --font-kid: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1.125rem; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--brand-dark); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-kid); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); letter-spacing: -.01em; font-weight: 800; }
h2 { font-size: 1.5rem; margin-top: 1.6em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6em 1em; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.icon { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }
.icon-wrap { display: inline-flex; }

/* ---------- Header ---------- */
.site-header { background: var(--card); position: relative; box-shadow: 0 2px 0 var(--line); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px;
  background: linear-gradient(90deg, var(--y1) 0 16.6%, var(--y2) 0 33.3%, var(--y3) 0 50%, var(--y4) 0 66.6%, var(--y5) 0 83.3%, var(--y6) 0); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 72px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { font-family: var(--font-kid); font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4em; min-height: 48px; }
.logo-mascot { width: 48px; height: 48px; }
.logo-tld { color: var(--brand); }
.site-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { display: inline-flex; align-items: center; gap: .4em; min-height: 48px; padding: .35em .85em; border-radius: 999px; text-decoration: none;
  font-family: var(--font-kid); font-weight: 700; color: var(--ink); background: #f4f2ec; border: 2px solid transparent; }
.site-nav a:hover { background: var(--brand-soft); }
.site-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.site-nav .nav-maths .icon { color: var(--maths); } .site-nav .nav-english .icon { color: var(--english); }
.site-nav .nav-star .icon { color: var(--sun-dark); }
.site-nav a[aria-current="page"] .icon { color: inherit; }
.nl-short { display: none; }
.nav-count { background: var(--sun); color: var(--ink); border-radius: 999px; font-size: .8rem; padding: 0 .5em; min-width: 1.6em; text-align: center; line-height: 1.6; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; padding: 36px 0 48px; background: #f3efe3; border-top: 4px solid var(--line); color: var(--ink-soft); font-size: 1rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 32px; margin-bottom: 1.2em; }
.foot-h { font-size: 1.05rem; margin: 0 0 .4em; color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-footer li a { display: inline-block; padding: .55em .5em .55em 0; min-height: 44px; color: var(--ink); }
.foot-small { font-size: .9rem; }

main { padding-top: 28px; }
.breadcrumbs { font-size: .95rem; margin-bottom: .8em; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3em; }
.breadcrumbs span[aria-current] { display: inline-block; padding: .3em 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: .3em; color: var(--ink-soft); }
.breadcrumbs a { display: inline-block; padding: .3em 0; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46em; }
.section-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); margin: 1.4em 0 .6em; }
.callout { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 14px 18px; }
.soon-tag { background: #e9ecef; color: var(--ink-soft) !important; }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; background: linear-gradient(135deg, #fff3bf, #ffe3ee 55%, #e0ecff);
  border-radius: 28px; padding: 26px 28px; box-shadow: var(--shadow); }
.hero h1 { margin-bottom: .25em; }
.hero-hello { display: inline-block; font-family: var(--font-kid); font-weight: 800; font-size: 1.15rem; background: var(--card); border-radius: 18px 18px 18px 4px; padding: .3em .9em; margin-bottom: .6em; box-shadow: var(--shadow); }
.hero-ask { font-family: var(--font-kid); font-size: 1.35rem; font-weight: 700; margin: 0; }
.hero-mascot { width: clamp(110px, 22vw, 210px); height: auto; display: block; animation: bob 3.5s ease-in-out infinite; }
/* Mascot: Jigby (inline SVG from icons.js mascot()) */
.m-wave { transform-box: view-box; transform-origin: 0 0; animation: m-wave 1.6s ease-in-out infinite; }
@keyframes m-wave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(-18deg); } 30% { transform: rotate(10deg); } }
.fb-mascot { flex: none; display: inline-block; width: 2.8em; height: 2.8em; margin: -.5em 0; }
.fb-mascot svg { width: 100%; height: 100%; display: block; }
.feedback.is-correct .fb-mascot { animation: m-hop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.feedback.is-wrong .fb-mascot { animation: m-tilt .6s ease-in-out both; }
@keyframes m-hop { 0% { transform: translateY(6px) scale(.8); } 60% { transform: translateY(-5px) scale(1.05); } 100% { transform: none; } }
@keyframes m-tilt { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-8deg); } 70% { transform: rotate(5deg); } }
.result-art { display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin: 0 auto 4px; }
.result-mascot { width: 104px; height: 104px; animation: m-hop .7s .1s cubic-bezier(.2, 1.6, .4, 1) both; }
.result-mascot svg { width: 100%; height: 100%; display: block; }
.result-art .result-trophy { margin: 0 0 6px; width: 70px; height: 70px; }
.stars-mascot { flex: none; width: 92px; }
.stars-mascot svg { width: 100%; height: auto; display: block; }
.mascot-say { display: inline-block; font-family: var(--font-kid); font-weight: 800; background: var(--card); border-radius: 18px 18px 18px 4px; padding: .3em .9em; margin: .2em 0 0; box-shadow: var(--shadow); }
.meet-mascot { display: flex; gap: 16px; align-items: center; }
.meet-mascot-svg { flex: none; width: 110px; height: auto; }
.meet-mascot p { margin: 0; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

/* ---------- Subject tiles ---------- */
.subject-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.subject-tile { --c: var(--brand); --t: var(--brand-soft); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: 100%; min-height: 150px; padding: 16px; border-radius: var(--radius);
  background: var(--t); border: 3px solid var(--c); color: var(--ink); text-decoration: none; box-shadow: 0 5px 0 var(--c); transition: transform .12s ease, box-shadow .12s ease; }
a.subject-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--c); }
a.subject-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--c); }
.st-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--c); color: #fff; margin-bottom: 4px; }
.st-icon .icon { width: 36px; height: 36px; }
.st-name { font-family: var(--font-kid); font-weight: 800; font-size: 1.4rem; }
.st-kid { font-size: .95rem; color: var(--ink-soft); line-height: 1.35; }
.st-count { margin-top: auto; font-weight: 700; font-size: .9rem; background: var(--card); border-radius: 999px; padding: .1em .7em; }
.subject-tile.is-soon { background: #f6f5f1; border: 3px dashed #c9c4b5; box-shadow: none; }
.subject-tile.is-soon .st-icon { background: #8a8fa8; }
.subj-maths { --c: var(--maths); --t: var(--maths-t); } .subj-english { --c: var(--english); --t: var(--english-t); }
.subj-science { --c: var(--science); --t: var(--science-t); } .subj-geography { --c: var(--geography); --t: var(--geography-t); }
.subj-history { --c: var(--history); --t: var(--history-t); } .subj-computing { --c: var(--computing); --t: var(--computing-t); }
.subj-languages { --c: var(--languages); --t: var(--languages-t); }

/* ---------- Year tiles ---------- */
.year-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.year-tile { --c: var(--y1); --d: var(--y1-d); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%; padding: 14px 10px 16px; border-radius: var(--radius);
  background: var(--c); color: var(--ink); text-decoration: none; box-shadow: 0 6px 0 var(--d); transition: transform .12s ease, box-shadow .12s ease; font-family: var(--font-kid); }
a.year-tile:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 9px 0 var(--d); }
a.year-tile:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--d); }
.yt-label { font-weight: 700; font-size: 1.05rem; }
.yt-num { font-weight: 900; font-size: 3.4rem; line-height: 1; }
.yt-ages { font-weight: 700; font-size: .95rem; }
.yt-count { margin-top: 8px; font-weight: 700; font-size: .85rem; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: .1em .7em; }
.year-tile.is-soon { box-shadow: none; opacity: 1; background: #f1f0ea; }
.y1 { --c: var(--y1); --d: var(--y1-d); } .y2 { --c: var(--y2); --d: var(--y2-d); } .y3 { --c: var(--y3); --d: var(--y3-d); }
.y4 { --c: var(--y4); --d: var(--y4-d); } .y5 { --c: var(--y5); --d: var(--y5-d); } .y6 { --c: var(--y6); --d: var(--y6-d); }

/* ---------- Page heads (year / subject banners) ---------- */
.page-head { display: flex; align-items: center; gap: 18px; background: var(--c, var(--brand-soft)); border-radius: 24px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 6px 0 var(--d, #c5cdf5); }
.page-head.subj-maths, .page-head.subj-english { background: var(--t); box-shadow: 0 6px 0 var(--c); }
.page-head.y1, .page-head.y2, .page-head.y3, .page-head.y4, .page-head.y5, .page-head.y6 { background: var(--c); box-shadow: 0 6px 0 var(--d); }
.page-head h1 { margin: 0 0 .15em; }
.page-head .lead { margin: 0; color: var(--ink); font-size: 1.1rem; }
.ph-num { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #fff; font-family: var(--font-kid); font-weight: 900; font-size: 2.6rem; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08); }
.ph-icon { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: var(--c, var(--brand)); color: #fff; }
.ph-icon .icon { width: 48px; height: 48px; }
.stars-head { background: #fff3bf; box-shadow: 0 6px 0 var(--sun-dark); }
.stars-head .ph-icon { background: var(--sun-dark); color: #fff; }
.subject-head { display: flex; align-items: center; gap: .5em; font-size: 1.6rem; margin: 1.2em 0 .6em; }
.sh-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--c); color: #fff; }
.sh-icon .icon { width: 30px; height: 30px; }
.more-link { margin: 12px 0 0; font-weight: 700; }
.more-link a { display: inline-block; padding: .4em 0; }
.soon-note { color: var(--ink-soft); background: #f6f5f1; border: 2px dashed #c9c4b5; border-radius: var(--radius-sm); padding: 14px 18px; }

/* ---------- Topic cards ---------- */
.topic-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.topic-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; align-items: center; height: 100%; min-height: 96px;
  padding: 14px 16px; border-radius: var(--radius); background: var(--card); color: var(--ink); text-decoration: none; border: 3px solid transparent; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.topic-card:hover { border-color: var(--c); transform: translateY(-2px); }
.tc-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--t); color: var(--c); }
.tc-icon .icon { width: 36px; height: 36px; }
.tc-body { display: flex; flex-direction: column; gap: 2px; }
.tc-title { font-family: var(--font-kid); font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.tc-meta { font-size: .9rem; color: var(--ink-soft); }
.tc-stars { margin-top: 4px; }
.star-row { display: inline-flex; gap: 2px; color: #b8b2a0; }
.star-row .icon { width: 1.35em; height: 1.35em; }
.star-row .is-on { color: var(--sun-dark); }
.topic-meta { font-size: .9rem; color: var(--ink-soft); }
.soon-list { columns: 2 260px; padding-left: 1.2em; color: var(--ink-soft); }
.soon-list li { break-inside: avoid; margin-bottom: .5em; }
.soon-list .cc { font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn { --b: var(--ink); font: inherit; font-family: var(--font-kid); font-weight: 800; border: 3px solid var(--b); background: var(--card); color: var(--ink); border-radius: 16px; padding: .55em 1.1em; cursor: pointer; min-height: 52px;
  touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; gap: .45em; box-shadow: 0 4px 0 var(--b); transition: transform .08s ease, box-shadow .08s ease, background .12s; text-decoration: none; line-height: 1.2; }
.btn:hover:not(:disabled) { background: #fff8db; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--b); }
.btn:disabled { cursor: default; }
.btn-primary { --b: var(--brand-dark); background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-big { font-size: 1.35rem; padding: .6em 1.6em; min-height: 64px; border-radius: 20px; }
.btn-big .icon { width: 1.3em; height: 1.3em; }
.btn-small { font-size: 1rem; min-height: 48px; padding: .4em .9em; }
.btn-icon { min-width: 52px; padding: .35em; }
.btn-link { display: inline-flex; }

/* ---------- Topic page ---------- */
.topic-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; }
.topic-head h1 { margin: 0; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.5rem); }
.topic-chip { display: inline-flex; align-items: center; gap: .4em; background: var(--t); color: var(--ink); border: 2px solid var(--c); border-radius: 999px; padding: .15em .8em .15em .5em; font-family: var(--font-kid); font-weight: 800; font-size: .95rem; }
.topic-chip .icon { color: var(--c); }
.lead-short { font-size: 1.05rem; margin: 14px 0 .8em; }

/* ---------- Game ---------- */
.game { position: relative; overflow: hidden; background: var(--card); border-radius: 26px; border: 4px solid var(--c); box-shadow: 0 8px 0 var(--c), var(--shadow); padding: 0 0 18px; max-width: 860px; }
.game-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: var(--t); border-bottom: 3px solid var(--c); }
.game-type { display: inline-flex; align-items: center; gap: .45em; font-family: var(--font-kid); font-weight: 800; font-size: 1.05rem; margin-right: auto; }
.game-type .icon { width: 1.5em; height: 1.5em; color: var(--c); }
.streak { display: inline-flex; align-items: center; gap: .3em; background: #fff; border: 2px solid #ff922b; color: #a63c00; border-radius: 999px; padding: .1em .7em; font-weight: 800; font-family: var(--font-kid); }
.streak .icon { color: #f76707; }
.streak[hidden] { display: none; }
.sound-toggle { min-height: 48px; min-width: 48px; border-radius: 14px; box-shadow: 0 3px 0 var(--b); }
.sound-toggle[aria-pressed="true"] { background: var(--sun); }
.sound-toggle .icon { width: 26px; height: 26px; }
.game-stage { min-height: 340px; display: flex; flex-direction: column; padding: 14px 18px 0; }
.game-panel { margin: auto; text-align: center; padding: 16px 8px; max-width: 36em; }
.start-icon { display: grid; place-items: center; width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 28px; background: var(--t); color: var(--c); animation: bob 3s ease-in-out infinite; }
.start-icon .icon { width: 60px; height: 60px; }
.game-help { color: var(--ink); font-size: 1.1rem; }
.game-best { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--ink-soft); margin-bottom: 10px; }
.game-best .stars { font-size: 1.4rem; margin: 0; }
.pace { border: 0; margin: 0 auto 16px; padding: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pace legend { width: 100%; font-weight: 700; margin-bottom: 6px; font-family: var(--font-kid); }
.pace-opt { position: relative; }
.pace-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pace-opt span { display: inline-flex; align-items: center; min-height: 48px; padding: .3em 1em; border-radius: 999px; border: 3px solid var(--ink); background: #fff; font-family: var(--font-kid); font-weight: 800; }
.pace-opt input:checked + span { background: var(--ink); color: #fff; }
.pace-opt input:focus-visible + span { outline: 4px solid var(--focus); outline-offset: 3px; }
.btn-start { padding-left: 2em; padding-right: 2.2em; }
.game-result-title { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.1rem); margin-bottom: .2em; }
.game-result-title:focus { outline: none; }
.result-trophy { width: 86px; height: 86px; margin: 0 auto 4px; color: var(--sun-dark); animation: trophy .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.result-trophy .icon { width: 100%; height: 100%; }
.is-perfect .result-trophy { color: #f59f00; filter: drop-shadow(0 4px 0 #e0a800); }
.stars { display: flex; justify-content: center; gap: 6px; margin: .2em 0 .5em; color: #b8b2a0; }
.stars .icon { width: 1.6em; height: 1.6em; }
.star-slot.is-on { color: var(--sun-dark); }
.stars-big .icon { width: 64px; height: 64px; }
.stars-big .star-slot.is-on { animation: star-in .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.stars-big .star-slot:nth-child(2) { animation-delay: .25s; transform: translateY(-10px); }
.stars-big .star-slot:nth-child(3) { animation-delay: .5s; }
.game-result-msg { font-size: 1.2rem; font-weight: 700; }
.game-newbest { display: inline-flex; align-items: center; gap: .4em; font-weight: 800; color: var(--good-dark); background: var(--good-soft); border-radius: 999px; padding: .2em .9em; }
.game-prev { color: var(--ink-soft); }
.new-badges { background: #fff3bf; border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px auto 12px; max-width: 26em; }
.new-badges-title { font-family: var(--font-kid); font-weight: 800; margin: 0 0 6px; }
.new-badges ul { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.badge-chip { display: inline-flex; align-items: center; gap: .35em; background: #fff; border: 2px solid var(--sun-dark); border-radius: 999px; padding: .15em .8em; font-weight: 800; }
.badge-chip .icon { color: var(--sun-dark); }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.result-back { margin-top: 14px; }
.result-back a { display: inline-block; padding: .5em; }

.hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; font-family: var(--font-kid); color: var(--ink); flex-wrap: wrap; }
.hud-item { background: #f4f2ec; border-radius: 999px; padding: .15em .8em; }
.hud-time { font-variant-numeric: tabular-nums; background: var(--ink); color: #fff; min-width: 4em; text-align: center; }
.timebar { height: 12px; background: #ece8dc; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.timebar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #51cf66, #ffd43b); border-radius: 99px; transition: width .2s linear; }
.timebar.is-low .timebar-fill { background: #ff6b6b; }
.qdots { list-style: none; display: flex; justify-content: center; gap: 6px; padding: 0; margin: 6px 0 0; flex-wrap: wrap; }
.qdots li { width: 14px; height: 14px; border-radius: 50%; background: #e6e1d3; }
.qdots li.is-current { background: var(--c); box-shadow: 0 0 0 3px var(--t); }
.qdots li.is-good { background: var(--good); }
.qdots li.is-bad { background: var(--bad); }
.prompt { font-family: var(--font-kid); font-size: clamp(1.8rem, 1.2rem + 2.8vw, 2.8rem); font-weight: 800; text-align: center; margin: 16px 0; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.prompt-ins { display: block; font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--ink-soft); margin-bottom: .4em; }
.prompt-main { display: block; }
.prompt-sm { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.75rem); }
.prompt-xs { font-size: clamp(1.15rem, 1rem + .8vw, 1.45rem); }
.missing { display: inline-block; min-width: 1.6em; padding: 0 .2em; border: 3px dashed var(--brand); border-radius: 10px; color: var(--brand-dark); line-height: 1.2; background: var(--brand-soft); }
.gap { display: inline-block; min-width: 3.2em; height: 1.1em; border-bottom: 4px solid var(--brand); vertical-align: -.1em; margin: 0 .1em; }
.gap-box { min-width: 1.1em; height: 1.1em; border: 3px dashed var(--brand); border-radius: 6px; background: var(--brand-soft); vertical-align: -.15em; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choices-long { grid-template-columns: minmax(0, 1fr); }
.choice { font-size: 1.6rem; min-height: 76px; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; padding: .5em 1em .5em 1.8em; overflow-wrap: anywhere; }
.choices-long .choice { font-size: 1.2rem; min-height: 60px; justify-content: flex-start; text-align: left; font-family: var(--font-body); font-weight: 700; }
.choice .key { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: rgba(255, 255, 255, .8); font-size: .8rem; color: var(--ink); font-weight: 800; }
.choice.c1 { --b: #e8a500; background: #fff3bf; } .choice.c2 { --b: #2f9e44; background: #d3f9d8; }
.choice.c3 { --b: #1c7ed6; background: #d0ebff; } .choice.c4 { --b: #d6336c; background: #ffdeeb; }
.choice:hover:not(:disabled) { filter: brightness(1.04); }
.is-correct { background: var(--good) !important; border-color: var(--good-dark) !important; color: #fff !important; --b: var(--good-dark) !important; }
.is-wrong { background: var(--bad) !important; border-color: var(--bad-dark) !important; color: #fff !important; --b: var(--bad-dark) !important; }
.choice:disabled:not(.is-correct):not(.is-wrong) { opacity: .55; }
.feedback { min-height: 2.2em; display: flex; align-items: center; justify-content: center; gap: .45em; text-align: center; font-family: var(--font-kid); font-weight: 800; font-size: 1.15rem; margin: 14px 0 0; padding: .3em .8em; border-radius: 14px; }
.feedback.is-correct { background: var(--good-soft) !important; color: var(--good-dark) !important; border: 0 !important; }
.feedback.is-wrong { background: var(--bad-soft) !important; color: var(--bad-dark) !important; border: 0 !important; }
.feedback .icon { width: 1.5em; height: 1.5em; }
.sprint-target { text-align: center; color: var(--ink-soft); font-size: .95rem; margin: 4px 0 0; }
.sprint-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.answer-input { font: inherit; font-family: var(--font-kid); font-size: 2rem; font-weight: 800; width: 6.5em; max-width: 100%; text-align: center; border: 4px solid var(--ink); border-radius: 16px; padding: .15em .4em; min-height: 64px; background: #fffdf5; }
.answer-input:focus-visible { outline-offset: 3px; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.match-col { display: flex; flex-direction: column; gap: 12px; }
.card { font-size: 1.35rem; min-height: 64px; }
.match-col:first-child .card { background: #d0ebff; --b: #1c7ed6; }
.match-col:last-child .card { background: #fff3bf; --b: #e8a500; }
.card[aria-pressed="true"] { background: var(--sun) !important; --b: var(--ink) !important; transform: scale(1.04); box-shadow: 0 0 0 4px var(--ink), 0 4px 0 var(--ink); }
.card.is-matched { background: var(--good-soft) !important; --b: var(--good) !important; border-color: var(--good) !important; color: var(--good-dark); border-style: dashed; box-shadow: none; }
.order-list { list-style: none; padding: 0; margin: 0 auto; max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: 10px; counter-reset: ord; }
.order-item { display: flex; gap: 8px; align-items: stretch; }
.order-item::before { counter-increment: ord; content: counter(ord); align-self: center; display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: #f4f2ec; font-weight: 800; color: var(--ink); flex: none; }
.order-card { flex: 1; font-size: 1.45rem; background: #d0ebff; --b: #1c7ed6; }
.order-item.is-selected .order-card { background: var(--sun); --b: var(--ink); }
.order-arrows { display: flex; gap: 6px; }
.order-list.is-correct, .order-list.is-wrong { background: none !important; border: 0 !important; color: inherit !important; }
.order-list.is-correct .order-card { --b: var(--good-dark); border-color: var(--good-dark); background: var(--good-soft); color: var(--good-dark); }
.order-list.is-wrong .order-card { --b: var(--bad); border-color: var(--bad); }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.numline-wrap { margin: 8px 0; touch-action: none; border-radius: 16px; background: #fffdf5; }
.numline { width: 100%; height: auto; display: block; cursor: pointer; user-select: none; }
.nl-axis { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.nl-tick { stroke: var(--ink); stroke-width: 2.5; }
.nl-major { stroke-width: 4.5; }
.nl-label { font: 700 40px system-ui, sans-serif; fill: var(--ink); }
.nl-marker polygon { fill: var(--brand); }
.nl-marker line { stroke: var(--brand); stroke-width: 5; }
.nl-answer polygon { fill: var(--good); }
.nl-hit { fill: transparent; }
.numline-slider { width: 100%; height: 48px; accent-color: var(--brand); }
.game noscript p { padding: 20px; }

/* ---------- Animations ---------- */
.pop { animation: pop .35s cubic-bezier(.2, 1.8, .4, 1); }
.shake { animation: shake .4s ease; }
.pop-in { animation: pop-in .3s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pop-in { from { transform: translateY(6px) scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
@keyframes trophy { from { transform: translateY(20px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.game-bar, .game-stage { position: relative; z-index: 1; }
.game-result .result-actions, .game-result h3, .game-result p { position: relative; }
.confetti-piece { position: absolute; top: -16px; width: 10px; height: 16px; border-radius: 2px; animation: confetti-fall linear forwards; }
.confetti-piece.is-round { width: 12px; height: 12px; border-radius: 50%; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 720px) rotate(var(--spin)); opacity: .9; } }

/* ---------- Grown-ups section ---------- */
.grownups { margin-top: 40px; background: #f7f8fc; border: 3px solid #dfe3f0; border-radius: 26px; padding: 22px clamp(16px, 3vw, 32px) 28px; }
.grownups-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.grownups-head .icon { width: 44px; height: 44px; padding: 8px; border-radius: 14px; background: var(--ink); color: #fff; }
.grownups-head h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.grownups-lead { color: var(--ink-soft); }
.toc ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: .2em .9em; border-radius: 999px; background: #fff; border: 2px solid #dfe3f0; text-decoration: none; font-weight: 700; font-size: .95rem; }
.grownups-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .grownups-grid { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); align-items: start; }
  .grownups-grid .curriculum { grid-column: 2; grid-row: 1; position: sticky; top: 16px; margin-top: 1.5em; }
  .grownups-grid .guide { grid-column: 1; grid-row: 1; }
}
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; list-style: none; padding: 0; }
.how li { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.how .icon { color: var(--brand); width: 1.5em; height: 1.5em; margin-top: .1em; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h3:first-child { margin-top: 0; }
.curriculum dl { margin: 0; }
.curriculum dt { font-weight: 700; margin-top: .8em; }
.curriculum dd { margin: .2em 0 0; color: var(--ink-soft); font-size: .98rem; }
.curriculum .nc-quote { font-style: italic; }
.prose { max-width: 46em; }
.prose li { margin-bottom: .4em; }
.guide h2 { margin-top: 1.5em; font-size: 1.4rem; }
.guide .steps li, .guide .mistakes li { margin-bottom: .6em; }
.example { background: var(--card); border-left: 6px solid var(--sun); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.example h3 { margin-bottom: .4em; font-size: 1.1rem; }
.example p { margin-bottom: .3em; }
.faq h3 { margin-top: 1em; font-size: 1.1rem; }
.related li { margin-bottom: .5em; }
.year-overview h3 { font-size: 1.25rem; margin-top: 1em; }
.ad-slot:empty { display: none; }
.ad-slot { margin: 24px 0; min-height: 0; }

/* ---------- My stars ---------- */
.stats { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; align-items: center; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); font-family: var(--font-kid); }
.stat .icon { width: 36px; height: 36px; color: var(--sun-dark); }
.stat-n { font-size: 2.4rem; font-weight: 900; line-height: 1.1; }
.stat-l { font-weight: 700; color: var(--ink-soft); }
.badge-wall { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 12px; border-radius: var(--radius); background: #f1f0ea; border: 3px dashed #c9c4b5; color: var(--ink-soft); }
.badge-medal .icon { width: 56px; height: 56px; color: #9a9fb5; }
.badge-name { font-family: var(--font-kid); font-weight: 800; color: var(--ink); font-size: 1.1rem; }
.badge-how { font-size: .92rem; }
.badge-state { font-weight: 800; font-size: .85rem; border-radius: 999px; padding: .05em .7em; background: #fff; }
.badge.is-earned { background: #fff3bf; border: 3px solid var(--sun-dark); color: var(--ink); }
.badge.is-earned .badge-medal .icon { color: #e8590c; }
.notfound { text-align: center; margin: 0 auto; }
.notfound .hero-mascot { margin: 0 auto; }

/* Stacked fractions */
.frac { display: inline-flex; align-items: center; vertical-align: middle; gap: .12em; }
.frac-v { display: inline-flex; flex-direction: column; align-items: center; font-size: .78em; line-height: 1.05; }
.frac-n { border-bottom: .09em solid currentColor; padding: 0 .12em; }
.frac-d { padding: 0 .12em; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .site-header .wrap { justify-content: center; gap: 4px; padding-top: 4px; }
  .logo { font-size: 1.15rem; min-height: 44px; }
  .logo-mascot { width: 40px; height: 40px; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; gap: 4px; flex-wrap: nowrap; }
  .site-nav li { flex: 1 1 0; min-width: 0; }
  .site-nav a span:not(.nav-count) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .breadcrumbs li { display: none; }
  .breadcrumbs li:nth-last-child(2) { display: block; }
  .breadcrumbs li:nth-last-child(2)::before { content: "‹"; margin-right: .35em; display: inline; color: var(--ink-soft); }
  .breadcrumbs li:nth-last-child(2) a { padding: .55em 0; }
  .site-nav a { flex-direction: column; gap: 0; width: 100%; padding: .25em .15em; border-radius: 14px; font-size: .74rem; min-height: 54px; justify-content: center; position: relative; }
  .site-nav a .icon { width: 22px; height: 22px; }
  .nl-short { display: none; }
.nav-count { position: absolute; top: 2px; right: 6px; font-size: .7rem; }
  main { padding-top: 18px; }
  h1 { margin-bottom: .3em; }
  .hero { grid-template-columns: minmax(0, 1fr) auto; padding: 18px; border-radius: 22px; }
  .hero-mascot { width: 96px; }
  .result-mascot { width: 80px; height: 80px; }
  .result-art .result-trophy { width: 54px; height: 54px; }
  .stars-mascot { width: 64px; }
  .meet-mascot-svg { width: 84px; }
  .hero-ask { font-size: 1.15rem; }
  .breadcrumbs { margin-bottom: .4em; font-size: .9rem; }
  .page-head { padding: 14px; gap: 12px; border-radius: 20px; }
  .ph-num, .ph-icon { width: 58px; height: 58px; font-size: 2rem; }
  .ph-icon .icon { width: 36px; height: 36px; }
  .subject-grid, .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .subject-tile { min-height: 132px; padding: 12px; }
  .yt-num { font-size: 2.8rem; }
  .game { border-radius: 20px; }
  .game-stage { padding: 10px 12px 0; min-height: 300px; }
  .game-panel { padding: 8px 4px; }
  .start-icon { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 6px; }
  .start-icon .icon { width: 40px; height: 40px; }
  .topic-head h1 { font-size: 1.55rem; }
  .topic-head { margin-bottom: 8px; }
  .game-help { margin-bottom: .7em; }
  .game-help { font-size: 1rem; }
  .choices { gap: 10px; }
  .hud { font-size: .9rem; gap: 6px; }
  .hud-item { padding: .1em .6em; }
  .hud-time { min-width: 3.4em; }
  .nl-long { display: none; }
  .nl-short { display: inline !important; }
  .choice { font-size: 1.35rem; min-height: 68px; }
  .choices-long .choice { font-size: 1.05rem; }
  .card { font-size: 1.1rem; }
  .btn-big { font-size: 1.2rem; min-height: 60px; }
  .grownups { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .confetti { display: none; } }

/* ---------- tiles always fit their card (fluid type + container queries, 2026-10-18) ---------- */
.subject-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.subject-grid > li, .year-grid > li, .topic-grid > li, .badge-wall > li, .pack-grid > * { min-width: 0; }
.subject-tile, .year-tile, .topic-card, .badge, .pack-card, .pack-promo { min-width: 0; container-type: inline-size; overflow-wrap: break-word; hyphens: manual; }
.st-name { font-size: clamp(1rem, 14cqi, 1.4rem); max-width: 100%; overflow-wrap: break-word; hyphens: auto; line-height: 1.15; }
.st-kid { max-width: 100%; hyphens: manual; overflow-wrap: normal; }
.st-count, .yt-count, .badge-state, .soon-tag { white-space: nowrap; max-width: 100%; font-size: clamp(.72rem, 8.5cqi, .9rem); padding: .12em .55em; }
.yt-label, .yt-ages { max-width: 100%; }
.tc-title, .badge-name { overflow-wrap: break-word; hyphens: auto; min-width: 0; }
.tc-body { min-width: 0; }
@container (max-width: 130px) { .st-icon { width: 46px; height: 46px; } .st-icon .icon { width: 30px; height: 30px; } .st-kid { font-size: .85rem; } }
@media (max-width: 700px) {
  .subject-grid, .year-grid { grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr)); }
  .site-nav .nav-bag { display: none; } /* shop stays in the footer and grown-ups sections on phones */
}

/* ---------- shop (grown-ups) ---------- */
.site-nav .nav-bag { font-size: .9rem; } .site-nav .nav-bag .icon { color: var(--brand); }
.pack-promo { display: flex; gap: 16px; align-items: center; background: var(--card); border: 3px solid var(--line, #e7e3d7); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.pack-promo img { flex: none; width: 110px; height: auto; border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.pack-promo .pp-title { margin: 0 0 .3em; font-size: 1.15rem; }
.pack-promo p { margin: 0 0 .5em; }
.pp-actions { margin: 0 !important; }
.pp-actions .btn, .pc-actions .btn { display: inline-flex; align-items: center; gap: .45em; text-decoration: none; }
@container (max-width: 420px) { .pack-promo img { width: 80px; } }
@media (max-width: 520px) { .pack-promo { flex-direction: column; align-items: flex-start; } }
.shop-head .ph-art { flex: none; width: 110px; } .shop-head .ph-art svg { width: 110px; height: 110px; }
.shop-points { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.shop-points li { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.shop-points .icon { flex: none; width: 28px; height: 28px; color: var(--brand); }
.shop-samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 16px; margin-bottom: 22px; }
.shop-samples figure { margin: 0; text-align: center; font-weight: 700; }
.shop-samples img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.15); background: #fff; }
.shop-year { margin: 0 0 26px; }
.ph-num-sm { display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--c, var(--y1)); margin-right: .4em; font-weight: 900; }
.ph-num-sm.y1 { background: var(--y1); } .ph-num-sm.y2 { background: var(--y2); } .ph-num-sm.y3 { background: var(--y3); } .ph-num-sm.y4 { background: var(--y4); } .ph-num-sm.y5 { background: var(--y5); } .ph-num-sm.y6 { background: var(--y6); }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.pack-card { display: flex; gap: 16px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 3px solid transparent; scroll-margin-top: 16px; }
.pack-card:target { border-color: var(--brand); }
.pack-card.is-bundle { border-color: var(--sun-dark, #e0a200); }
.pc-cover { flex: none; width: 120px; height: auto; align-self: flex-start; border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.pc-body { min-width: 0; flex: 1; }
.pc-title { margin: 0 0 .2em; font-size: 1.25rem; }
.pc-tag { display: inline-block; margin: 0 0 .4em; background: #fff3bf; border-radius: 999px; padding: .1em .7em; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.pc-list { list-style: none; padding: 0; margin: 0 0 .5em; font-size: .95rem; }
.pc-list li { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 3px; }
.pc-list .icon { flex: none; width: 18px; height: 18px; color: var(--good, #2b8a3e); margin-top: 2px; }
.pack-card details { font-size: .92rem; margin: 0 0 .6em; } .pack-card summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.pc-price { margin: 0 0 .4em; } .pc-amount { font-family: var(--font-kid); font-weight: 900; font-size: 1.6rem; } .pc-licence { color: var(--ink-soft); font-size: .9rem; }
.pc-actions { margin: 0 0 .4em; }
.pc-classroom { font-size: .92rem; margin: 0; }
.pc-classroom a { display: inline-block; min-height: 44px; line-height: 44px; }
@container (max-width: 360px) { .pc-cover { width: 84px; } }
@media (max-width: 420px) { .pack-card { flex-direction: column; } .pc-cover { width: 110px; } }
.download-page .dl-list { list-style: none; padding: 0; }
.dl-item { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin: 0 0 14px; }
.dl-item img { width: 100px; height: auto; border-radius: 8px; flex: none; }
.dl-item h2 { margin: 0 0 .3em; font-size: 1.2rem; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-buttons .btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 700px) {
  .site-nav a { font-size: clamp(.6rem, 3vw, .8rem); padding: .25em .05em; letter-spacing: -.01em; }
  .site-nav a span:not(.nav-count) { text-overflow: clip; }
}

/* shop entry points for grown-ups (2026-10-18) */
.header-shop { display: none; }
.shop-card { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, #fff3bf, #ffe3ee 60%, #e0ecff); border: 3px solid var(--ink); border-radius: 24px; padding: 16px 20px; margin: 0 0 20px; box-shadow: 0 6px 0 var(--ink); min-width: 0; container-type: inline-size; }
.shop-card img { flex: none; width: 110px; height: auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.18); transform: rotate(-3deg); }
.shop-card .sc-body { min-width: 0; }
.shop-card .sc-title { margin: 0 0 .25em; font-size: clamp(1.3rem, 6cqi, 1.8rem); }
.shop-card p { margin: 0 0 .6em; }
.shop-card .sc-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.shop-card .sc-actions .btn { display: inline-flex; align-items: center; gap: .45em; text-decoration: none; }
.sc-from { font-weight: 800; white-space: nowrap; }
.prose .shop-card { margin-top: 10px; }
@container (max-width: 420px) { .shop-card img { width: 72px; } }
@media (max-width: 700px) {
  .header-shop { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 999px;
    font-family: var(--font-kid); font-weight: 800; font-size: .78rem; color: var(--ink-soft); text-decoration: none; background: #f4f2ec; }
  .header-shop .icon { width: 16px; height: 16px; color: var(--brand); }
  .shop-card { gap: 12px; padding: 14px; }
}
@media (max-width: 360px) { .header-shop span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .header-shop { padding: 0; } }
@media (max-width: 520px) {
  .shop-card { align-items: flex-start; }
  .shop-card img { width: 58px; margin-top: 4px; }
}
@media (max-width: 400px) { .shop-card img { display: none; } }

/* header row: desktop keeps the original flex layout; phones get a 3-column row (spacer | logo | Shop)
   inside the same .wrap padding as the nav, so the Shop pill lines up with the nav's right edge */
.header-row { display: contents; }
@media (max-width: 700px) {
  .header-row { display: grid; grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr); align-items: center; width: 100%; column-gap: 6px; }
  .header-row .logo { grid-column: 2; }
  .header-row .header-shop { grid-column: 3; justify-self: end; }
}

/* home subject tiles: balanced rows (build sets --cols, e.g. 7 tiles -> 4 + 3), last row centred */
.subject-grid { --gap: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.subject-grid > li { flex: 0 0 calc((100% - (var(--cols, 4) - 1) * var(--gap)) / var(--cols, 4)); }
@media (min-width: 1024px) { .subject-grid { --gap: 18px; } .subject-tile { min-height: 180px; padding: 20px 22px; } .st-icon { width: 64px; height: 64px; } .st-icon .icon { width: 40px; height: 40px; } .st-name { font-size: clamp(1.1rem, 11cqi, 1.6rem); } .st-kid { font-size: 1.02rem; } }
@media (max-width: 700px) { .subject-grid { --gap: 12px; } .subject-grid > li { flex-basis: calc((100% - var(--gap)) / 2); } }
/* --cols via class (CSP forbids inline style attributes) */
.subject-grid.cols-1 { --cols: 1; } .subject-grid.cols-2 { --cols: 2; } .subject-grid.cols-3 { --cols: 3; } .subject-grid.cols-4 { --cols: 4; }
