/* Quizocracy — design tokens, light and dark themes, motion. */
:root {
  --violet:#4F46E5; --violet-2:#4338CA; --coral:#F43F5E; --sun:#F59E0B; --mint:#14B8A6; --sky:#0EA5E9;
  --good:#0F9F76; --bad:#E11D48;
  --bg:#F7F8FC; --bg-2:#EEF0F7; --card:#FFFFFF; --card-2:#F9FAFD; --line:#E3E6EF; --ink:#111827; --mut:#5B6475;
  --field:#FFFFFF; --shadow:0 1px 2px rgba(27,24,53,.06), 0 10px 30px -12px rgba(17,24,39,.12);
  --shadow-lg:0 2px 6px rgba(27,24,53,.06), 0 24px 60px -20px rgba(17,24,39,.18);
  --glow:radial-gradient(1200px 600px at 10% -10%, rgba(79,70,229,.10), transparent 60%),
         radial-gradient(900px 500px at 110% 10%, rgba(14,165,233,.08), transparent 60%),
         radial-gradient(800px 600px at 50% 120%, rgba(20,184,166,.07), transparent 60%);
  --board:#111827; --board-line:#273046;
  --r:16px; --r-sm:10px;
  --display:"Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --body:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg:#0B1020; --bg-2:#131A2E; --card:#141B2F; --card-2:#19213A; --line:#263049; --ink:#EEF1F8; --mut:#98A2B8;
  --field:#0F1528; --shadow:0 1px 2px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.7);
  --shadow-lg:0 2px 8px rgba(0,0,0,.4), 0 30px 70px -24px rgba(79,70,229,.25);
  --glow:radial-gradient(1200px 600px at 10% -10%, rgba(79,70,229,.20), transparent 60%),
         radial-gradient(900px 500px at 110% 10%, rgba(14,165,233,.08), transparent 60%),
         radial-gradient(800px 600px at 50% 120%, rgba(20,184,166,.07), transparent 60%);
  color-scheme: dark;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; min-height:100vh; background:var(--glow), var(--bg); background-attachment:fixed; color:var(--ink);
  font:16px/1.55 var(--body); padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom);
  transition:background-color .35s ease, color .35s ease; }
a { color:var(--violet); text-decoration:none; } a:hover { text-decoration:underline; }
:root[data-theme="dark"] a { color:#A5B4FC; }
h1, h2, h3, .display { font-family:var(--display); letter-spacing:-.01em; line-height:1.15; }
h1 { font-size:clamp(1.6rem, 4vw, 2.3rem); margin:.3em 0 .35em; } h2 { font-size:1.3rem; margin:1.4em 0 .5em; }
.mut { color:var(--mut); } .small { font-size:.88rem; }
.wrap { max-width:960px; margin:0 auto; padding:18px 18px 40px; }

/* header */
header.top { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 18px; background:color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter:saturate(1.4) blur(14px);
  -webkit-backdrop-filter:saturate(1.4) blur(14px); border-bottom:1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand { display:flex; align-items:center; gap:9px; font-family:var(--display); font-weight:800; font-size:1.25rem; letter-spacing:-.02em; color:var(--ink); text-decoration:none!important; }
.brand img { display:none; height:38px; width:auto; transition:transform .3s ease; }
.brand:hover img { transform:scale(1.04); }
.brand .full.lt { display:block; }
:root[data-theme="dark"] .brand .full.lt { display:none; }
:root[data-theme="dark"] .brand .full.dk { display:block; }
nav.links { display:flex; gap:4px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
nav.links a, nav.links button.linkish { white-space:nowrap; color:var(--mut); font-weight:600; font-size:.93rem; padding:7px 10px; border-radius:8px;
  background:none; border:0; cursor:pointer; font-family:var(--body); text-decoration:none; transition:background .2s,color .2s; }
nav.links a:hover, nav.links button.linkish:hover { background:var(--bg-2); color:var(--ink); }
.who { font-weight:800; color:var(--ink); padding:0 6px; }
.theme-btn { width:36px; height:36px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--ink);
  cursor:pointer; display:grid; place-items:center; font-size:1.05rem; transition:transform .4s cubic-bezier(.34,1.56,.64,1), background .3s; }
.theme-btn:hover { transform:scale(1.05); } .theme-btn svg { width:18px; height:18px; }

/* cards and layout */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:20px; margin:14px 0; box-shadow:var(--shadow);
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s; }
a.card:hover, .card.lift:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:color-mix(in srgb, var(--violet) 40%, var(--line)); text-decoration:none; }
.grid { display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:14px; }
.kid { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.kid .name { font-family:var(--display); font-weight:700; font-size:1.2rem; }
.pct { font-family:var(--display); font-weight:800; font-size:1.6rem; font-variant-numeric:tabular-nums; }

/* buttons */
.btn { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:12px; padding:11px 20px; font-weight:800;
  font-family:var(--body); cursor:pointer; font-size:1rem; text-decoration:none!important; background:var(--card); color:var(--ink);
  transition:transform .15s ease, box-shadow .2s ease, background .2s; }
.btn:hover { transform:translateY(-1px); box-shadow:var(--shadow); }
.btn:active { transform:translateY(1px) scale(.98); }
.btn.primary { background:linear-gradient(135deg,var(--violet),var(--violet-2)); color:#fff; border:0; box-shadow:0 6px 16px -8px rgba(79,70,229,.6); }
:root[data-theme="dark"] a.btn.primary { color:#fff; }          /* a link styled as the main button: white text, as in light mode (the dark link colour is 3:1 on violet) */
.btn.primary:hover { box-shadow:0 10px 24px -8px rgba(79,70,229,.7); }
.btn.danger { background:#FFE8EC; color:#B3123A; border-color:#FFC9D3; }
:root[data-theme="dark"] .btn.danger { background:#3A1020; color:#FFB3C3; border-color:#5C1A31; }
.btn.big { padding:15px 26px; font-size:1.1rem; } .btn:disabled { opacity:.5; cursor:default; transform:none; }

/* forms */
form .field { margin:14px 0; } label { display:block; font-weight:800; margin-bottom:6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width:100%; max-width:440px; background:var(--field); border:2px solid var(--line); border-radius:12px; color:var(--ink);
  font:inherit; font-size:1.05rem; padding:11px 14px; transition:border-color .2s, box-shadow .2s; }
textarea { max-width:100%; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--violet); box-shadow:0 0 0 4px color-mix(in srgb, var(--violet) 22%, transparent); }
input.inline { width:auto; }
.check { display:flex; gap:10px; align-items:flex-start; } .check input { margin-top:5px; width:18px; height:18px; accent-color:var(--violet); }
.err { background:#FFE8EC; border:1px solid #FFC9D3; color:#A3112F; padding:12px 14px; border-radius:14px; margin:12px 0; animation:shake .45s; }
.ok { background:#E3FBF2; border:1px solid #B5EED8; color:#0B6B4A; padding:12px 14px; border-radius:14px; margin:12px 0; animation:pop-in .45s; }
:root[data-theme="dark"] .err { background:#3A1020; border-color:#5C1A31; color:#FFB3C3; }
:root[data-theme="dark"] .ok { background:#0D2E24; border-color:#18533F; color:#9FF0CF; }

/* progress */
.bar { height:10px; background:var(--bg-2); border-radius:999px; overflow:hidden; position:relative; }
.bar > i { display:block; height:100%; width:0; border-radius:999px; background:linear-gradient(90deg,var(--violet),var(--sky));
  transition:width 1.1s cubic-bezier(.22,1,.36,1); position:relative; overflow:hidden; }
.bar > i::after { content:""; position:absolute; inset:0; background:linear-gradient(110deg,transparent 30%,rgba(255,255,255,.45) 50%,transparent 70%);
  transform:translateX(-100%); animation:shimmer 2.4s ease-in-out infinite 1.2s; }
.bar.done > i { background:linear-gradient(90deg,var(--mint),var(--good)); }
.chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.chip { display:inline-flex; align-items:center; gap:5px; font-size:.8rem; font-weight:600; border:1px solid var(--line); border-radius:8px;
  padding:4px 10px 4px 6px; color:var(--mut); background:var(--card-2); }
.chip img { width:18px; height:18px; }
.chip.done { color:var(--good); border-color:color-mix(in srgb, var(--good) 45%, var(--line)); background:color-mix(in srgb, var(--mint) 10%, var(--card)); }
.hist { display:flex; gap:4px; align-items:flex-end; height:44px; margin-top:12px; }
.hist i { flex:1; background:linear-gradient(180deg,var(--violet),var(--sky)); border-radius:6px 6px 2px 2px; min-height:3px; transform-origin:bottom;
  animation:grow .8s cubic-bezier(.22,1,.36,1) both; }
table.t { width:100%; border-collapse:collapse; font-size:.93rem; }
table.t th, table.t td { text-align:left; padding:8px 8px; border-bottom:1px solid var(--line); }

/* tiles */
.tile { display:block; color:var(--ink); text-decoration:none!important; position:relative; overflow:hidden; }
.tile .ico { width:56px; height:56px; transition:transform .3s ease; }
.tile:hover .ico { transform:translateY(-2px); }
.tile .ttl { font-family:var(--display); font-weight:700; font-size:1.12rem; margin-top:8px; }
.tile.complete::before { content:"✓"; position:absolute; top:14px; right:16px; width:30px; height:30px; border-radius:50%; display:grid; place-items:center;
  background:var(--good); color:#fff; font-weight:900; animation:pop-in .5s cubic-bezier(.34,1.56,.64,1); }

/* hero */
.hero { display:grid; grid-template-columns:1.2fr 1fr; gap:24px; align-items:center; padding:20px 0 10px; }
.hero h1 { font-size:clamp(2rem, 5.4vw, 3.2rem); letter-spacing:-.025em; }
.grad { background:linear-gradient(90deg,var(--violet),var(--coral) 60%,var(--sun)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.lead { font-size:1.15rem; color:var(--mut); max-width:34em; }
.orbit { position:relative; aspect-ratio:1; max-width:420px; width:100%; margin:auto; }
.orbit .blob { position:absolute; inset:12%; border-radius:42% 58% 63% 37% / 41% 44% 56% 59%;
  background:linear-gradient(135deg,color-mix(in srgb,var(--violet) 30%,transparent),color-mix(in srgb,var(--coral) 25%,transparent));
  animation:morph 12s ease-in-out infinite; filter:blur(2px); }
.orbit img { position:absolute; width:26%; filter:drop-shadow(0 12px 18px rgba(17,24,39,.18)); animation:bob 8s ease-in-out infinite; }
.orbit img.center { width:46%; left:27%; top:27%; animation-duration:6s; }
.orbit img:nth-child(3) { left:2%; top:4%; animation-delay:-1s; } .orbit img:nth-child(4) { right:2%; top:2%; animation-delay:-2s; }
.orbit img:nth-child(5) { left:0; bottom:4%; animation-delay:-3s; } .orbit img:nth-child(6) { right:0; bottom:2%; animation-delay:-4s; }
.feature { display:flex; gap:14px; align-items:center; }
.feature img { width:64px; height:64px; flex:none; }
.badge-note { display:inline-flex; gap:8px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:10px;
  padding:6px 14px 6px 8px; font-weight:800; box-shadow:var(--shadow); }
.badge-note img { width:26px; height:26px; }

/* reward */
.reward { display:flex; align-items:center; gap:12px; border:2px dashed color-mix(in srgb,var(--sun) 70%,var(--line)); color:var(--ink);
  border-radius:var(--r); padding:12px 16px; margin:14px 0; background:color-mix(in srgb,var(--sun) 8%,var(--card)); font-weight:700; }
.reward img { width:44px; height:44px; }
.reward.earned { border-style:solid; background:linear-gradient(135deg,color-mix(in srgb,var(--sun) 35%,var(--card)),color-mix(in srgb,var(--coral) 18%,var(--card)));
  animation:pop-in .6s cubic-bezier(.34,1.56,.64,1); }
.reward.earned img { animation:pop-in .6s ease; }
.reward[hidden] { display:none; }
.reward.slim { padding:5px 12px; margin:6px 0; gap:8px; font-size:.9rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; animation:none; }
.skill-bar { height:6px; border-radius:6px; background:#2C3650; margin:6px 0 2px; max-width:240px; overflow:hidden; }   /* act_maths.html */
.skill-bar > i { display:block; height:100%; width:0; border-radius:6px; background:linear-gradient(90deg,var(--violet),var(--sky)); transition:width .6s ease; }
.skill-bar.done > i { background:linear-gradient(90deg,var(--mint),#3BE2A8); }
.grow-line { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; margin-top:10px; }     /* streak, this week (me.html) */
.streak { font-weight:800; color:var(--coral); }
.win-moment { margin-top:8px; padding:8px 12px; border-radius:12px; background:rgba(59,226,168,.14); color:#3BE2A8; font-weight:800; }   /* skill secure, mistake put right (drill.js) */
.reward.slim img { width:22px; height:22px; animation:none; } .reward.slim span { overflow:hidden; text-overflow:ellipsis; }

/* drills */
.stage { background:var(--board); color:#EDEBFF; border-radius:var(--r); padding:22px; border:1px solid var(--board-line); box-shadow:var(--shadow-lg); }
.stage .mut { color:#9AA4BB; }
.q { font-family:var(--display); font-size:clamp(2rem, 6vw, 2.8rem); font-weight:700; font-variant-numeric:tabular-nums; margin:6px 0 18px; letter-spacing:.5px; }
.q.words { font-size:clamp(1.3rem, 4vw, 1.7rem); }
.q.enter { animation:slide-in .45s cubic-bezier(.22,1,.36,1); }
.stage input[type=text], .stage input.answer, input.m-input { background:#0B1120; border:2px solid #2C3650; color:#fff; border-radius:12px; }
input.answer { font-size:1.6rem; max-width:340px; text-align:center; font-family:var(--display); font-weight:700; }
.feedback { min-height:32px; font-size:1.1rem; font-weight:800; margin-top:12px; }
.netmsg[hidden] { display:none; } .netmsg { font-size:1rem; }     /* "No connection — your answer is safe" (drill.js) */
.feedback.yes { color:#3BE2A8; animation:pop-in .45s cubic-bezier(.34,1.56,.64,1); } .feedback.no { color:#FF8FA6; } .feedback.warn { color:var(--sun); }
.stage.shake { animation:shake .45s; } .stage.flash { animation:flash .6s ease-out; }
.daybar { margin:6px 0 16px; }
.day-extra { white-space:nowrap; }     /* the day line is one short line in one colour (drill.js setDay) */
.btn.idk { font-size:.95rem; }         /* "I don't know", beside Check (drill.js opts.idk) */
.act-head { display:flex; align-items:center; gap:12px; } .act-head img { width:48px; height:48px; }
.m-prompt { font-size:1.2rem; font-weight:700; margin:10px 0 14px; } .m-host { margin:8px 0 14px; } .m-sol { color:#9AA4BB; font-size:.88rem; margin-top:6px; }
.stage .chip { background:#1B2338; border-color:#2C3650; color:#C7CFE2; }
svg { touch-action:none; max-width:100%; }
.foot { color:var(--mut); font-size:.88rem; text-align:center; padding:34px 16px; }

/* confetti */
.confetti { position:fixed; inset:0; pointer-events:none; z-index:50; overflow:hidden; }
.confetti i { position:absolute; width:10px; height:14px; border-radius:3px; top:-20px; opacity:.95; animation:fall linear forwards; }

/* entrance */
.rise { animation:rise .6s cubic-bezier(.22,1,.36,1) both; }
.rise-2 { animation-delay:.08s; } .rise-3 { animation-delay:.16s; } .rise-4 { animation-delay:.24s; } .rise-5 { animation-delay:.32s; }

@keyframes rise { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }
@keyframes pop-in { 0% { transform:scale(.6); opacity:0; } 70% { transform:scale(1.06); opacity:1; } 100% { transform:scale(1); } }
@keyframes shake { 0%,100% { transform:translateX(0); } 20% { transform:translateX(-9px); } 40% { transform:translateX(8px); } 60% { transform:translateX(-6px); } 80% { transform:translateX(4px); } }
@keyframes flash { 0% { box-shadow:0 0 0 0 rgba(59,226,168,.7); } 100% { box-shadow:0 0 0 22px rgba(59,226,168,0); } }
@keyframes bob { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@keyframes wiggle { 0%,100% { transform:rotate(0); } 25% { transform:rotate(-10deg); } 75% { transform:rotate(10deg); } }
@keyframes morph { 0%,100% { border-radius:42% 58% 63% 37% / 41% 44% 56% 59%; transform:rotate(0); } 50% { border-radius:63% 37% 38% 62% / 55% 61% 39% 45%; transform:rotate(25deg); } }
@keyframes shimmer { to { transform:translateX(100%); } }
@keyframes grow { from { transform:scaleY(0); } }
@keyframes slide-in { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:none; } }
@keyframes fall { to { transform:translateY(110vh) rotate(720deg); } }
@media (max-width:720px) { .hero { grid-template-columns:1fr; } .orbit { max-width:300px; } }
@media (max-width:640px) { header.signed .brand .full { display:none!important; } header.signed .brand .mark.lt { display:block; }
  :root[data-theme="dark"] header.signed .brand .mark.lt { display:none; } :root[data-theme="dark"] header.signed .brand .mark.dk { display:block; } header.signed nav.links { flex-wrap:nowrap; gap:0; }
  header.signed nav.links a, header.signed nav.links button.linkish { padding:6px 6px; font-size:.86rem; } header.signed .theme-btn { width:32px; height:32px; font-size:.9rem; margin-left:2px; } header.signed .who { padding:0 4px; } }
@media (max-width:520px) { nav.links a, nav.links button.linkish { padding:6px 7px; font-size:.88rem; } .brand img { height:34px; } .wrap { padding:14px 14px 36px; } }
/* a parent's five links on a 390 px phone: one tight row, and a second row rather than a page wider than the screen */
@media (max-width:440px) { header.top { padding:10px 10px; gap:6px; } header.signed nav.links { flex-wrap:wrap; min-width:0; }
  header.signed nav.links a, header.signed nav.links button.linkish { padding:6px 4px; font-size:.84rem; } header.signed .theme-btn { width:30px; height:30px; } }
/* a wide table scrolls inside its own box; on a phone a line under it says so */
.scroll-hint { display:none; }
@media (max-width:640px) { .scroll-hint { display:block; margin:6px 0 0; color:var(--mut); font-size:.85rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation:none!important; transition:none!important; } }

/* landing: how it works + benefit lists */
.steps { counter-reset:step; list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.steps li { counter-increment:step; position:relative; background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:14px 16px 14px 58px; box-shadow:var(--shadow); }
.steps li::before { content:counter(step); position:absolute; left:16px; top:50%; transform:translateY(-50%); width:30px; height:30px;
  border-radius:50%; background:var(--violet); color:#fff; font-weight:800; display:grid; place-items:center; }
.ticks { list-style:none; padding:0; margin:10px 0 0; }
.ticks li { position:relative; padding-left:24px; margin:7px 0; color:var(--mut); font-size:.95rem; }
.ticks li::before { content:"✓"; position:absolute; left:0; color:var(--good); font-weight:800; }
.grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width:620px) { .grid.two { grid-template-columns:1fr; } }

/* parent: mistakes to go over */
details.mistakes summary { cursor:pointer; }
ul.mlist { list-style:none; padding:0; margin:10px 0 0; }
ul.mlist li { display:flex; gap:10px; align-items:flex-start; padding:10px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
ul.mlist li img { width:26px; height:26px; flex:none; margin-top:2px; }
.bad-ans { color:var(--bad); }

/* grammar and science questions */
.bq { font-size:clamp(1.15rem, 3.6vw, 1.45rem); font-weight:700; line-height:1.4; margin:6px 0 16px; }
.opts { display:grid; gap:10px; }
.opt, .word { font:inherit; color:#EDEBFF; background:#1B2338; border:2px solid #2C3650; border-radius:12px; cursor:pointer; }
.opt { text-align:left; padding:12px 14px; font-size:1.05rem; font-weight:600; }
.words { display:flex; flex-wrap:wrap; gap:8px; font-size:1.25rem; }
.word { padding:6px 10px; font-weight:600; }
.opt.sel, .word.sel { border-color:#8B7CFF; background:#2A2560; }
.opt.right, .word.right { border-color:#22c55e; background:#123524; }
.opt.wrong, .word.wrong { border-color:#f85149; background:#3A1620; }
.opt:disabled, .word:disabled { cursor:default; }
textarea.write { width:100%; font:inherit; font-size:1.15rem; padding:10px 12px; background:#0B1120; border:2px solid #2C3650; color:#fff; border-radius:12px; resize:vertical; }
input.answer.wide { max-width:420px; text-align:left; font-size:1.25rem; }
.unit { font-weight:700; font-size:1.2rem; align-self:center; }
.why { font-weight:600; font-size:.98rem; color:#C7CFE2; margin-top:6px; }
.tofix { color:var(--bad); font-weight:800; }
#fixMsg { color:var(--mut); margin-top:4px; min-height:0; }
.tips details summary { cursor:pointer; list-style:none; }
.tips details summary::-webkit-details-marker { display:none; }
.tips details[open] summary { margin-bottom:6px; }

/* read-aloud button (speak.js): big, top right of the question card; "Tap to hear" until the first tap */
.speak-btn { float:right; margin:-6px -6px 8px 12px; min-width:56px; height:56px; padding:0 12px; border-radius:28px; border:2px solid #3B4A72;
  background:#1B2338; color:#fff; font:inherit; font-size:1.6rem; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.speak-btn b { display:none; font-size:1rem; font-weight:800; }
.speak-btn.first { border-color:var(--sun); animation:speak-pulse 1.6s ease-in-out infinite; }
.speak-btn.first b { display:inline; }
.speak-btn.on { border-color:#8B7CFF; background:#2A2560; }
@keyframes speak-pulse { 0%,100% { box-shadow:0 0 0 0 rgba(245,158,11,.55); } 50% { box-shadow:0 0 0 10px rgba(245,158,11,0); } }
/* "Correct": a star for Years 1-3, a tick after that (quiet from Year 7); kind words after a run of misses */
.feedback.yes.joy { font-size:1.7rem; display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
.joy-star { display:inline-grid; place-items:center; width:58px; height:58px; border-radius:50%; background:var(--sun); color:#fff;
  font-size:2.2rem; line-height:1; animation:star-pop .8s cubic-bezier(.34,1.56,.64,1); box-shadow:0 0 0 6px rgba(245,158,11,.25); }
.joy-praise { color:#FFD37A; }
.feedback.joy .why { flex-basis:100%; }
.feedback .tick { display:inline-block; animation:pop-in .45s cubic-bezier(.34,1.56,.64,1); }
.feedback .tick.quiet { animation:none; }
.feedback .kind { color:var(--sun); font-size:1.15rem; margin-top:8px; }
@keyframes star-pop { 0% { transform:scale(0) rotate(-120deg); } 60% { transform:scale(1.3) rotate(12deg); } 100% { transform:scale(1) rotate(0); } }
/* a few fixed words to tap instead of typing ("Yes" / "No") */
.opts.choices { grid-template-columns:repeat(auto-fit, minmax(110px, 1fr)); max-width:520px; margin-top:10px; }
.opts.choices .opt { text-align:center; font-size:1.25rem; font-weight:800; padding:14px; }
/* "Put spaces between the words": letters with a tap target between each pair */
.gaps { display:flex; flex-wrap:wrap; align-items:stretch; font-family:var(--display); font-size:2rem; font-weight:700; margin:6px 0 8px;
  padding:10px 8px; border:2px solid #2C3650; border-radius:12px; background:#0B1120; }
.gaps .letter { padding:4px 0; line-height:1.3; }
.gaps .gap { width:20px; padding:0; margin:0; border:0; background:transparent; cursor:pointer; position:relative; transition:width .15s; }
.gaps .gap::after { content:""; position:absolute; left:50%; top:22%; bottom:22%; border-left:2px dotted #3B4A72; }
.gaps .gap.on { width:34px; }
.gaps .gap.on::after { top:auto; bottom:6px; left:5px; right:5px; border-left:0; border-bottom:4px solid #8B7CFF; border-radius:2px; }
.gaps.right { border-color:#22c55e; } .gaps.wrong { border-color:#f85149; }
textarea.answer.grow { width:100%; max-width:100%; resize:none; overflow:hidden; text-align:left; line-height:1.3; background:#0B1120;
  border:2px solid #2C3650; color:#fff; border-radius:12px; font-size:1.5rem; font-family:var(--display); font-weight:700; }

/* "Something wrong with this question?" (_drill_buttons.html): small and quiet under the buttons */
.report { margin-top:14px; }
.report-link { background:none; border:0; padding:6px 0; color:#9AA4BB; font:inherit; font-size:.85rem; text-decoration:underline; cursor:pointer; }
.report-link[hidden] { display:none; }
.report-box { margin-top:6px; padding:12px; border:1px solid #2C3650; border-radius:12px; background:#141B2F; max-width:520px; }
.report-box[hidden] { display:none; }
.report-ttl { font-weight:800; }
.report-why { display:grid; gap:8px; margin:8px 0 10px; } .report-why .opt { font-size:.98rem; padding:10px 12px; }
.report-lbl { font-weight:600; font-size:.9rem; color:#C7CFE2; margin-bottom:4px; }
.report-box textarea { background:#0B1120; border:2px solid #2C3650; color:#fff; font-size:1rem; }
.report-box .row { margin-top:10px; } .report-box .btn { padding:9px 16px; }
.report-msg { font-size:.92rem; font-weight:700; color:#3BE2A8; }

/* Year 4 check practice (tables_check.html) */
.mtc-rules { margin:6px 0 4px; padding-left:20px; } .mtc-rules li { margin:4px 0; }
.mtc-q { font-size:clamp(2.4rem, 11vw, 3.4rem); margin:14px 0 16px; min-height:1.2em; }
.mtc-sec { font-family:var(--display); font-weight:800; font-size:1.6rem; font-variant-numeric:tabular-nums; min-width:2ch; text-align:right; }
.mtc-time { height:12px; background:#1B2338; border-radius:999px; overflow:hidden; margin-top:8px; }
.mtc-time > i { display:block; height:100%; width:100%; background:linear-gradient(90deg,var(--sun),var(--coral)); border-radius:999px; }
.keypad { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; max-width:340px; margin-top:14px; }
.keypad[hidden] { display:none; }
.keypad button { font:700 1.6rem var(--display); height:58px; border-radius:12px; background:#1B2338; color:#fff; border:2px solid #2C3650; cursor:pointer;
  touch-action:manipulation; }
.keypad button:active { background:#2A2560; }
.keypad .ent { background:var(--violet); border-color:var(--violet); }
.mtc-missed { list-style:none; padding:0; margin:8px 0 0; display:grid; gap:6px; }
.mtc-missed li { font-size:1.15rem; font-weight:700; } .mtc-missed .mut { font-weight:600; font-size:.95rem; }

/* text and display settings (_a11y.html): per device, as classes on <html> (set early in base.html) */
.head-btns { display:flex; gap:8px; align-items:center; }
.a11y { position:relative; display:inline-block; }
.a11y-btn { min-width:44px; height:44px; padding:0 10px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--ink);
  font:800 1.05rem/1 Georgia, "Times New Roman", serif; cursor:pointer; }
.a11y-btn[aria-expanded="true"] { border-color:var(--violet); }
/* open, the panel sits on <body>, fixed under the Aa button (placed by _a11y.html), above the header and every card */
.a11y-panel { position:fixed; right:16px; top:64px; z-index:60; width:min(300px, calc(100vw - 32px)); max-height:calc(100vh - 80px); overflow:auto;
  overscroll-behavior:contain; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:var(--r); padding:14px 16px;
  box-shadow:var(--shadow-lg); text-align:left; }
.a11y-panel[hidden] { display:none; }
@media (max-width:640px) { .a11y-panel { left:16px; right:16px; width:auto; } }
.a11y-panel .check { margin:10px 0; font-weight:600; } .a11y-panel .check input { flex:none; }
.a11y-ttl { font-family:var(--display); font-weight:800; font-size:1.05rem; }
.a11y-float { float:right; margin:.5em 0 0 10px; position:relative; z-index:6; }
.head-btns .a11y { z-index:6; }
:root.a11y-big { font-size:118.75%; }
:root.a11y-big body { font-size:19px; }
/* the header keeps its size and spacing, so the child's links still fit on one line on a phone */
:root.a11y-dys header.top, :root.a11y-space header.top { letter-spacing:normal; word-spacing:normal; }
@media (max-width:640px) { :root.a11y-big header.signed nav.links a, :root.a11y-big header.signed nav.links button.linkish,
  :root.a11y-dys header.signed nav.links a, :root.a11y-dys header.signed nav.links button.linkish { font-size:13px; padding:6px 4px; }
  :root.a11y-big .brand, :root.a11y-dys .brand { font-size:17px; } }
:root.a11y-dys { --body:Verdana, Tahoma, "DejaVu Sans", "Trebuchet MS", sans-serif; --display:Verdana, Tahoma, "DejaVu Sans", "Trebuchet MS", sans-serif; }
:root.a11y-dys body { letter-spacing:.04em; word-spacing:.1em; line-height:1.7; }
:root.a11y-dys h1, :root.a11y-dys h2, :root.a11y-dys .display, :root.a11y-dys .q { letter-spacing:.02em; }
:root.a11y-space body { line-height:1.9; letter-spacing:.05em; word-spacing:.16em; }
:root.a11y-space p, :root.a11y-space .card { margin-top:1.1em; margin-bottom:1.1em; }
:root.a11y-space .row, :root.a11y-space .opts, :root.a11y-space .words, :root.a11y-space .grid { gap:16px; }
:root.a11y-space .bq, :root.a11y-space .m-prompt { line-height:1.8; }
:root.a11y-dys input, :root.a11y-dys textarea, :root.a11y-dys button, :root.a11y-space input, :root.a11y-space textarea { letter-spacing:inherit; word-spacing:inherit; }
:root.a11y-calm *, :root.a11y-calm *::before, :root.a11y-calm *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
:root.a11y-calm .confetti { display:none; }
/* "Calm screen": a quieter top line (a reward earned before is on My day, not on every question), plain colours */
:root.a11y-calm .reward.slim, :root.a11y-calm #dayReward.slim { display:none; }
:root.a11y-calm .win-moment { background:none; color:inherit; padding:0; font-weight:700; }
:root.a11y-calm .stage.flash, :root.a11y-calm .stage.shake { box-shadow:none; }
@media (prefers-reduced-motion: reduce) { .confetti { display:none; } }
:root.a11y-contrast { --ink:#000; --mut:#1F2937; --line:#111827; --bg:#FFFFFF; --bg-2:#E5E7EB; --card:#FFFFFF; --card-2:#FFFFFF; --field:#FFFFFF;
  --violet:#3730A3; --good:#065F46; --bad:#9F1239; --glow:none; --board:#000; --board-line:#FFFFFF; }
:root.a11y-contrast[data-theme="dark"] { --ink:#FFFFFF; --mut:#E5E7EB; --line:#E5E7EB; --bg:#000; --bg-2:#1F2937; --card:#000; --card-2:#000; --field:#000;
  --violet:#A5B4FC; --good:#6EE7B7; --bad:#FDA4AF; }
:root.a11y-contrast a { text-decoration:underline; }
:root.a11y-contrast .stage, :root.a11y-contrast .stage .mut, :root.a11y-contrast .why, :root.a11y-contrast .m-sol, :root.a11y-contrast .report-link,
  :root.a11y-contrast .report-lbl { color:#FFFFFF; }
:root.a11y-contrast .stage input[type=text], :root.a11y-contrast .stage input.answer, :root.a11y-contrast input.m-input, :root.a11y-contrast .opt,
  :root.a11y-contrast .word, :root.a11y-contrast textarea.write, :root.a11y-contrast .gaps, :root.a11y-contrast .keypad button,
  :root.a11y-contrast .report-box, :root.a11y-contrast .speak-btn { border-color:#FFFFFF; background:#000; color:#FFFFFF; }
:root.a11y-contrast .opt.sel, :root.a11y-contrast .word.sel { background:#3730A3; border-color:#FFFF00; }
:root.a11y-contrast .feedback.yes { color:#6EE7B7; } :root.a11y-contrast .feedback.no { color:#FDA4AF; } :root.a11y-contrast .feedback.warn { color:#FDE047; }
:root.a11y-contrast input:focus, :root.a11y-contrast textarea:focus, :root.a11y-contrast button:focus-visible, :root.a11y-contrast a:focus-visible { outline:3px solid #FACC15; outline-offset:2px; }
:root.a11y-contrast .btn.primary { background:#3730A3; color:#fff; border:2px solid #000; }
:root.a11y-contrast[data-theme="dark"] .btn.primary { border-color:#fff; }
