/*
 * site.css — Easypeasy Learning Club times-tables site.
 * Night-sky hero bands over a soft lavender paper page; gold is the one
 * call-to-action colour, coral/mint/sky are accents.
 */

:root {
  --space-1: #0e0b33;
  --space-2: #231a63;
  --space-3: #3b2a8f;
  --paper: #f7f5ff;
  --card: #ffffff;
  --ink: #1b1747;
  --muted: #5d5a85;
  --line: #e3def7;
  --gold: #ffc83d;
  --gold-dark: #d99a00;
  --coral: #ff6b6b;
  --mint: #2fd39a;
  --sky: #5fd0ff;
  --violet: #7b61ff;
  --soft: #efeaff;      /* pale tint for alternate sections, chips and soft buttons */
  --radius: 22px;
  --head: "Baloo 2", ui-rounded, "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; }
a { color: var(--violet); }
h1, h2, h3 { font-family: var(--head); line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 18px; }
.eyebrow {
  display: inline-block;
  font: 800 13px/1 var(--body);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
}

/* ---- header ---------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14, 11, 51, .92);
  background: color-mix(in srgb, var(--space-1) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 21px/1 var(--head); }
.logo img { width: 30px; height: 40px; }
.logo small { display: block; font: 700 11px/1.2 var(--body); color: var(--gold); letter-spacing: .04em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a { color: #dcd6ff; text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a.btn { color: var(--ink); margin-left: 6px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

.site-nav a { white-space: nowrap; }
@media (max-width: 1360px) { .site-nav a { padding: 8px 9px; font-size: 14.5px; } }
/* the menu grew (Stage 3, Stage 4, Topics, Mock tests…): the ☰ button takes over sooner */
@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 12px 16px 20px;
    background: var(--space-1); border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .site-nav.open { display: flex; }
  .site-nav a.btn { margin: 8px 0 0; text-align: center; }
}

/* ---- buttons --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 18px/1 var(--head);
  padding: 15px 28px 13px;
  border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 5px 0 var(--gold-dark); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--gold-dark); }
.btn-gold:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-small { font-size: 15px; padding: 10px 18px 9px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- space bands ----------------------------------------------------- */

.space {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff 60%, transparent),
    radial-gradient(1px 1px at 90px 120px, #fff 60%, transparent),
    radial-gradient(2px 2px at 160px 60px, #fff8d0 60%, transparent),
    radial-gradient(1px 1px at 230px 170px, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 300px 20px, #d8f4ff 60%, transparent),
    radial-gradient(600px 400px at 85% 10%, rgba(123,97,255,.45), transparent 70%),
    radial-gradient(500px 360px at 5% 90%, rgba(255,107,107,.22), transparent 70%),
    linear-gradient(160deg, var(--space-1), var(--space-2) 60%, var(--space-3));
  background-size: 320px 200px, 320px 200px, 320px 200px, 320px 200px, 320px 200px, auto, auto, auto;
}
.space p { color: #dcd6ff; }
.space .eyebrow { color: var(--gold); }

.hero { padding: 64px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.hero h1 b { color: var(--gold); }
.hero .lead { font-size: 20px; max-width: 560px; }
.hero-badge {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,200,61,.15); color: var(--gold);
  font: 800 13px/1 var(--body); letter-spacing: .08em; margin-bottom: 16px;
}
.hero-note { font-size: 14px; margin-top: 14px; opacity: .8; }
.hero-art { position: relative; height: 380px; }
.hero-art img { position: absolute; }
.hero-art .a-rocket { width: 130px; left: 38%; top: 40px; animation: float 4s ease-in-out infinite; }
.hero-art .a-planet1 { width: 170px; right: 0; top: 0; animation: float 6s ease-in-out infinite reverse; }
.hero-art .a-planet2 { width: 110px; left: 0; bottom: 30px; animation: float 5s ease-in-out infinite; }
.hero-art .a-astro { width: 70px; right: 22%; bottom: 10px; animation: drift 7s ease-in-out infinite; }
.hero-art .a-meteor { width: 70px; left: 8%; top: 20px; animation: float 3.5s ease-in-out infinite; }

@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes drift { 50% { transform: translate(-10px, -18px) rotate(-8deg); } }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { height: 240px; order: -1; }
  .hero-art .a-rocket { width: 90px; }
  .hero-art .a-planet1 { width: 120px; }
  .hero-art .a-planet2 { width: 80px; }
}

.crumbs { font-size: 14px; margin-bottom: 18px; }
.crumbs a { color: #bfb6ff; text-decoration: none; }
.crumbs span { opacity: .6; margin: 0 6px; }

/* ---- cards & grids --------------------------------------------------- */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(27,23,71,.06);
}
.card p:last-child { margin-bottom: 0; }

.mission { padding: 0; overflow: hidden; }
.mission .scene {
  height: 170px; position: relative;
  background: linear-gradient(170deg, var(--space-1), var(--space-3));
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.mission .scene img { height: 90px; }
/* a real screenshot as the card picture (Spin the Wheel: galaxy or neon, as chosen in the game) */
.mission .scene.scene-photo { padding: 0; background: #0b0a2a; }
.mission .scene.scene-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.mission .scene .q {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: #fffaf0; color: var(--ink); font: 800 20px/1 var(--head);
  padding: 8px 14px 6px; border-radius: 12px;
}
.mission .body { padding: 20px 22px 24px; }
.mission .tag { font: 800 12px/1 var(--body); letter-spacing: .1em; color: var(--coral); text-transform: uppercase; }

.steps { counter-reset: step; }
.step { position: relative; padding-top: 58px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 18px; left: 24px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--violet); color: #fff; font: 800 17px/32px var(--head); text-align: center;
}

.order { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order .stage { display: flex; gap: 6px; padding: 10px; border-radius: 18px; background: var(--soft); }
.order .arrow { color: var(--muted); font-weight: 800; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 44px; padding: 0 12px; border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
  font: 800 19px/1 var(--head); box-shadow: 0 3px 0 var(--line);
}
.chip:hover { background: var(--gold); }

.tables { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
@media (max-width: 820px) { .tables { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .tables { grid-template-columns: repeat(3, 1fr); } }
.table-card {
  display: block; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: 18px; padding: 18px 8px 14px;
  box-shadow: 0 4px 0 var(--line); transition: transform .15s;
}
.table-card:hover { transform: translateY(-4px); }
.table-card b { display: block; font: 800 34px/1 var(--head); color: var(--violet); }
.table-card span { font-size: 13px; color: var(--muted); font-weight: 700; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
.callout { display: flex; flex-direction: column; align-items: flex-start; }
.callout .btn { margin-top: auto; }
.callout.dark { background: linear-gradient(160deg, var(--space-2), var(--space-3)); color: #fff; }
.callout.dark p { color: #dcd6ff; }

/* ---- times-table page ------------------------------------------------ */

.chart { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .chart { grid-template-columns: repeat(2, 1fr); } }
.fact {
  display: flex; align-items: baseline; justify-content: space-between;
  background: var(--card); border-radius: 16px; padding: 14px 18px;
  font: 700 24px/1 var(--head); box-shadow: 0 3px 0 var(--line);
}
.fact b { color: var(--violet); font-weight: 800; }
.fact.square { background: #fff6d9; }

.skip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.skip span {
  min-width: 48px; text-align: center; padding: 8px 10px; border-radius: 12px;
  background: var(--space-2); color: #fff; font: 800 18px/1 var(--head);
}

/* "say it aloud" list: keeps the card's inner padding (it is also a .card) */
.aloud { columns: 2; column-gap: 48px; column-rule: 1px solid var(--line); padding: 20px 32px; margin: 0; list-style: none; }
@media (max-width: 560px) { .aloud { columns: 1; padding: 12px 20px; } }
.aloud li { padding: 9px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.aloud li b { color: var(--violet); }

.tip { border-top: 5px solid var(--sky); }
.tip:nth-child(2) { border-color: var(--coral); }
.tip:nth-child(3) { border-color: var(--mint); }
.tip:nth-child(4) { border-color: var(--gold); }
.pattern { margin-top: 20px; font-weight: 700; }
.pattern code { font: 800 18px var(--head); background: var(--soft); padding: 3px 8px; border-radius: 8px; }

.game-poster {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  border-radius: 28px; padding: 32px;
}
.game-poster .poster-art { display: flex; gap: 8px; align-items: flex-end; }
.game-poster .poster-art img { height: 110px; }
@media (max-width: 720px) {
  .game-poster { grid-template-columns: 1fr; }
  .game-poster .poster-art { order: -1; justify-content: center; }
  .game-poster .poster-art img { height: 80px; }
}
.small-link { display: inline-block; margin-top: 14px; color: #bfb6ff; font-weight: 700; font-size: 15px; }

.quiz { background: var(--card); border-radius: var(--radius); padding: 28px; max-width: 560px; box-shadow: 0 10px 30px rgba(27,23,71,.08); }
.quiz-q { font: 800 46px/1.1 var(--head); text-align: center; margin-bottom: 18px; }
.quiz-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 420px) { .quiz-opts { grid-template-columns: repeat(2, 1fr); } }
.quiz-opts button {
  font: 800 26px/1 var(--head); padding: 16px 0 12px; border-radius: 16px; cursor: pointer;
  border: 0; background: var(--soft); color: var(--ink); box-shadow: 0 4px 0 #d5ccff;
}
.quiz-opts button:hover { background: #e2dbff; }
.quiz-opts button.ok { background: var(--mint); color: #fff; box-shadow: 0 4px 0 #1f9c70; }
.quiz-opts button.no { background: var(--coral); color: #fff; box-shadow: 0 4px 0 #c94a4a; }
.quiz-foot { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); font-weight: 700; }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.faq details { background: var(--card); border-radius: 16px; padding: 4px 20px; margin-bottom: 10px; box-shadow: 0 2px 0 var(--line); }
.faq summary { cursor: pointer; font: 700 19px/1.3 var(--head); padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--violet); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); }

/* ---- worksheets ------------------------------------------------------ */

.ws-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 24px; }
.ws-controls label { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; gap: 6px; }
.ws-controls select {
  font: 700 16px var(--body); padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}
.sheet { background: #fff; color: #111; border-radius: 12px; padding: 36px 40px; box-shadow: 0 10px 30px rgba(27,23,71,.1); max-width: 820px; }
.sheet-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 20px; font-weight: 700; }
.sheet h2 { font-size: 28px; margin-bottom: 4px; }
.sheet-qs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; list-style: none; padding: 0; margin: 0; counter-reset: q; }
.sheet-qs li { font: 600 22px/1.4 var(--head); counter-increment: q; }
.sheet-qs li::before { content: counter(q) ".  "; color: #888; font-size: 15px; }
.sheet-qs .blank { display: inline-block; min-width: 64px; border-bottom: 2px solid #333; text-align: center; color: #c33; }
.sheet:not(.show-answers) .blank em { visibility: hidden; }
.sheet-foot { margin-top: 24px; font-size: 13px; color: #666; display: flex; justify-content: space-between; }
@media (max-width: 560px) { .sheet { padding: 24px 18px; } .sheet-qs { grid-template-columns: 1fr; } }

@media print {
  .site-header, .site-footer, .no-print, .space { display: none !important; }
  body { background: #fff; }
  .section { padding: 0; }
  .sheet { box-shadow: none; padding: 0; max-width: none; }
}

/* ---- embed ----------------------------------------------------------- */

.code {
  position: relative; background: var(--space-1); color: #d8f4ff; border-radius: 16px;
  padding: 20px; font: 14px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all;
}
.code button { position: absolute; top: 10px; right: 10px; }
.embed-demo { display: flex; justify-content: center; }
.embed-demo iframe { width: 390px; max-width: 100%; height: 720px; border: 0; border-radius: 18px; box-shadow: 0 20px 50px rgba(27,23,71,.25); }

/* ---- game overlay ---------------------------------------------------- */

.game-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(7,6,26,.94);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .25s ease;
}
.game-overlay iframe { width: min(100vw, calc(100vh * .56)); height: 100vh; height: 100dvh; border: 0; }
.game-close {
  position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 22px; cursor: pointer;
}
.game-close:hover { background: rgba(255,255,255,.28); }
@keyframes fade-in { from { opacity: 0; } }

/* ---- create (teacher) page ------------------------------------------- */

.create { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .create { grid-template-columns: 1fr; } }
.create-form { display: flex; flex-direction: column; gap: 18px; }
.create-form h2 { font-size: 24px; }
.create-form label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.field {
  display: block; width: 100%; margin-top: 6px; font: 600 16px var(--body); color: var(--ink);
  padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.field:focus { outline: none; border-color: var(--violet); }
textarea.field { font: 15px/1.5 ui-monospace, Consolas, monospace; resize: vertical; }
.muted { color: var(--muted); font-size: 14px; }
.step-head, .samples-head, .preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { background: #e2dbff; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.seg button { border: 0; background: none; font: 800 15px var(--body); color: var(--muted); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--violet); color: #fff; }
.topic-options fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.topic-options legend { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check input { position: absolute; opacity: 0; }
.check span {
  display: inline-block; min-width: 44px; text-align: center; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  background: var(--soft); font-weight: 800; font-size: 15px;
}
.check input:checked + span { background: var(--violet); color: #fff; }
.check input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.status { font-weight: 700; font-size: 14px; }
.status.ok { color: #1f9c70; }
.status.bad, .samples .bad { color: #c94a4a; }
.samples { list-style: none; padding: 0; margin: 10px 0 0; }
.samples li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.samples span { color: #1f9c70; font-weight: 800; }
.samples em { color: var(--muted); font-size: 13px; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mission-pick { position: relative; display: flex !important; flex-direction: column; gap: 4px; margin: 0 !important; padding: 12px; border-radius: 16px; border: 2px solid var(--line); cursor: pointer; }
.mission-pick input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; accent-color: var(--violet); }
.mission-pick img { height: 44px; width: 44px; object-fit: contain; }
.mission-pick b { font-family: var(--head); font-size: 17px; }
.mission-pick span { font-weight: 400; font-size: 13px; color: var(--muted); line-height: 1.35; }
.mission-pick:has(input:checked) { border-color: var(--violet); background: #f6f3ff; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.link-out { margin-top: 18px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .field { margin-top: 6px; }
.copy-row .btn { flex: none; margin-top: 6px; }
.link-out a { display: inline-block; margin: 0 0 14px; font-weight: 700; }
.create-preview { position: sticky; top: 84px; }
.create-preview iframe { display: block; width: 100%; height: 720px; margin: 10px 0; border: 0; border-radius: 22px; background: #0b0930; box-shadow: 0 20px 50px rgba(27,23,71,.25); }
@media (max-width: 960px) { .create-preview { position: static; } .create-preview iframe { max-width: 400px; margin: 10px auto; } }
.my-game h3 { overflow-wrap: anywhere; }

/* ---- footer ---------------------------------------------------------- */

.site-footer { background: var(--space-1); color: #bfb6ff; padding: 40px 0; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.site-footer a { color: #fff; text-decoration: none; margin-right: 16px; }
.site-footer .tagline { color: var(--gold); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- student log in, my page, teacher dashboard ------------------------ */

.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.narrow-wrap { max-width: 560px; }
.btn-danger { background: #ffe4e4; color: #b03030; }
.btn-danger:hover { background: #ffd2d2; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.demo-note { background: #fff6d6; border: 2px dashed var(--gold); border-radius: 16px; padding: 12px 16px; font-size: 15px; }
.demo-note code, .muted code { background: #fff; padding: 1px 6px; border-radius: 6px; }
.login-form label { display: block; font-weight: 800; margin-bottom: 14px; }
.login-form .btn { width: 100%; margin: 6px 0 10px; }
.code-field { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }

.board { list-style: none; padding: 0; margin: 8px 0 14px; }
.board li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 64px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; }
.board li:nth-child(odd):not(.muted) { background: #f6f3ff; }
.board li.me { background: #fff1c2 !important; box-shadow: inset 0 0 0 2px var(--gold); }
.board li.muted { display: block; }
.board .rank { font: 800 20px var(--head); text-align: center; }
.board .who { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .games { color: var(--muted); font-size: 14px; }
.board .pts { font: 800 20px var(--head); text-align: right; color: var(--violet); }
.board.history li { grid-template-columns: 56px minmax(0, 1fr) auto 56px; }
.board .when { color: var(--muted); font-size: 14px; }

.t-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.class-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.class-tabs button { border: 2px solid var(--line); background: #fff; font: 800 15px var(--body); color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.class-tabs button.on { border-color: var(--violet); background: var(--violet); color: #fff; }
.t-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.class-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.class-head > div:first-child { flex: 1 1 340px; }
.class-code { font: 800 26px var(--head); letter-spacing: .14em; color: var(--violet); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 0 var(--line); }
.stat b { display: block; font: 800 28px var(--head); }
.stat span { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data .mono { font-family: ui-monospace, Consolas, monospace; }
table.data .actions { white-space: nowrap; }
table.data .actions .btn { padding: 6px 10px; font-size: 13px; margin: 2px; }
.idle-tag { display: block; color: #b46a00; font-size: 12px; font-weight: 700; }
.field.narrow { max-width: 280px; margin-bottom: 14px; }
.spaced { margin: 14px 0; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.login-card { border: 2px dashed #9b8cff; border-radius: 16px; padding: 14px 16px; background: #fff; break-inside: avoid; }
.lc-brand { font: 800 14px var(--head); color: var(--violet); }
.lc-name { font: 800 24px var(--head); margin: 2px 0 8px; }
.lc-row { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 5px 0; font-size: 14px; }
.lc-row b { font-family: ui-monospace, Consolas, monospace; font-size: 16px; letter-spacing: .05em; }
.lc-tag { margin-top: 6px; font-size: 11px; color: var(--muted); }
@media print {
  .cards-section { padding: 0; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
.class-head .btn-row { align-self: flex-start; align-items: flex-start; }
.card .step-head { flex-wrap: wrap; }
.grid-2 .card h2 { font-size: 30px; }

/* ---- worksheet hub and category pages ---------------------------------- */
.ws-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .15s; }
.ws-card:hover { transform: translateY(-4px); }
.ws-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--violet); color: #fff; display: grid; place-items: center; font: 800 30px var(--head); margin-bottom: 14px; }
.ws-card p { color: var(--muted); flex: 1; }
.ws-go { font-weight: 800; color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.chip { background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px; padding: 7px 14px; border-radius: 999px; }
.chip:hover { background: #e2dbff; }
.narrow-faq { max-width: 820px; }
.sheet-qs.families { grid-template-columns: 1fr; gap: 18px; }
.sheet-qs.families li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 26px; font-size: 19px; padding-bottom: 12px; border-bottom: 1px dashed #ccc; }
.family-nums { display: inline-block; min-width: 120px; font-weight: 800; background: #f1edff; border-radius: 10px; padding: 2px 12px; }
.sheet-qs .blank.short { min-width: 40px; }
@media print { .family-nums { background: none; border: 2px solid #111; } }
@media (max-width: 480px) {
  .board li, .board.history li { grid-template-columns: 36px minmax(0, 1fr) 56px; }
  .board .games { display: none; }
}

/* ---- typing answers on the worksheet ------------------------------------ */
.sheet-qs .blank { border-bottom: 0; min-width: 0; vertical-align: baseline; }
.sheet-qs .blank em { display: none; }
.sheet.show-answers .blank em { display: inline-block; visibility: visible; min-width: 64px; border-bottom: 2px solid #333; font-style: normal; }
.sheet.show-answers .blank.short em { min-width: 40px; }
.sheet.show-answers .blank .ans { display: none; }
.ans {
  width: 72px; font: 700 22px/1.2 var(--head); color: var(--violet); text-align: center;
  border: 0; border-bottom: 2px solid #333; border-radius: 8px 8px 0 0; background: #f4f1ff; padding: 2px 4px;
}
.blank.short .ans { width: 48px; font-size: 19px; }
.ans:focus { outline: none; background: #fff6d6; border-bottom-color: var(--violet); }
.ans.ok { background: #dcf7ec; border-bottom-color: #1f9c70; color: #157a56; }
.ans.no { background: #ffe1e1; border-bottom-color: #c94a4a; color: #b03030; }
.ws-check { max-width: 820px; margin-top: 18px; }
.ws-result { font: 800 20px var(--head); margin: 12px 0 4px; min-height: 1.2em; }
.ws-result.ok { color: #1f9c70; }
.ws-save { font: 700 15px var(--body); color: var(--muted); }
@media print {
  .ans { background: none !important; color: #111 !important; border-radius: 0; }
  .ans:placeholder-shown { color: transparent; }
}

/* fact families: numbers on the left, × facts on top, ÷ facts lined up beneath */
.sheet-qs.families li {
  display: grid; grid-template-columns: 150px repeat(2, max-content); grid-template-rows: auto auto;
  align-items: center; gap: 12px 40px;
}
.sheet-qs.families .family-nums { grid-row: 1 / span 2; align-self: center; justify-self: start; }
.sheet-qs.families .fact {
  display: inline-flex; align-items: baseline; justify-content: flex-start; gap: 8px;
  background: none; box-shadow: none; border-radius: 0; padding: 0; font: 600 21px/1.4 var(--head);
}
@media (max-width: 640px) {
  .sheet-qs.families li { grid-template-columns: repeat(2, max-content); gap: 10px 20px; }
  .sheet-qs.families .family-nums { grid-row: auto; grid-column: 1 / -1; }
}
/* fixed places: number | family | × × on row 1, ÷ ÷ right under them on row 2 */
.sheet-qs.families li { grid-template-columns: 28px 140px max-content max-content; }
.sheet-qs.families li::before { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
.sheet-qs.families .family-nums { grid-column: 2; grid-row: 1 / span 2; }
.sheet-qs.families .fact:nth-child(2) { grid-column: 3; grid-row: 1; }
.sheet-qs.families .fact:nth-child(3) { grid-column: 4; grid-row: 1; }
.sheet-qs.families .fact:nth-child(4) { grid-column: 3; grid-row: 2; }
.sheet-qs.families .fact:nth-child(5) { grid-column: 4; grid-row: 2; }
@media (max-width: 640px) {
  .sheet-qs.families li { grid-template-columns: 24px max-content max-content; }
  .sheet-qs.families li::before { grid-row: 1; }
  .sheet-qs.families .family-nums { grid-column: 2 / -1; grid-row: 1; }
  .sheet-qs.families .fact:nth-child(2) { grid-column: 2; grid-row: 2; }
  .sheet-qs.families .fact:nth-child(3) { grid-column: 3; grid-row: 2; }
  .sheet-qs.families .fact:nth-child(4) { grid-column: 2; grid-row: 3; }
  .sheet-qs.families .fact:nth-child(5) { grid-column: 3; grid-row: 3; }
}
@media (max-width: 640px) {
  .sheet-qs.families li { grid-template-columns: 24px max-content; }
  .sheet-qs.families .family-nums { grid-column: 2; }
  .sheet-qs.families .fact:nth-child(n) { grid-column: 2; }
  .sheet-qs.families .fact:nth-child(2) { grid-row: 2; }
  .sheet-qs.families .fact:nth-child(3) { grid-row: 3; }
  .sheet-qs.families .fact:nth-child(4) { grid-row: 4; }
  .sheet-qs.families .fact:nth-child(5) { grid-row: 5; }
}

/* ---- diamonds, ranks and stickers --------------------------------------- */
.rewards, .stickers-card { margin-bottom: 20px; }
.rank-box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.rank-gem .gem { filter: drop-shadow(0 6px 10px rgba(27,23,71,.18)); }
.rank-text h2 { margin: 0 0 8px; }
.rank-text .eyebrow { margin-bottom: 4px; }
.rank-bar { height: 14px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.rank-text .muted { margin: 6px 0 0; }
.wallet { text-align: center; background: #f6f3ff; border-radius: 18px; padding: 12px 18px; }
.wallet b { display: block; font: 800 34px/1 var(--head); color: var(--violet); }
.wallet span { font-size: 13px; font-weight: 700; color: var(--muted); }
.rank-ladder { list-style: none; padding: 0; margin: 20px 0 12px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rank-ladder li { text-align: center; padding: 8px 2px; border-radius: 12px; opacity: .55; }
.rank-ladder li.done { opacity: .85; }
.rank-ladder li.here { opacity: 1; background: #fff1c2; box-shadow: inset 0 0 0 2px var(--gold); }
.rank-ladder span { display: block; font: 800 13px var(--head); }
.rank-ladder small { display: block; font-size: 11px; color: var(--muted); }
@media (max-width: 700px) {
  .rank-box { grid-template-columns: auto minmax(0, 1fr); }
  .wallet { grid-column: 1 / -1; }
  .rank-ladder { grid-template-columns: repeat(5, 1fr); }
}
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 18px; background: #f6f3ff; }
.sticker img { width: 86px; height: 86px; object-fit: contain; filter: grayscale(1) opacity(.45); }
.sticker.owned { background: #fff; box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(27,23,71,.08); }
.sticker.owned img { filter: drop-shadow(0 0 0 #fff) drop-shadow(3px 3px 0 #fff) drop-shadow(-3px -3px 0 #fff) drop-shadow(0 6px 8px rgba(27,23,71,.25)); }
.sticker b { font: 800 15px var(--head); }
.sticker .got { font-weight: 800; color: #1f9c70; font-size: 14px; }
.ws-reward { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: #fff6d6; border: 2px solid var(--gold); border-radius: 18px; padding: 12px 18px; margin: 8px 0 14px; }
.ws-reward .gain { font: 800 30px var(--head); color: var(--violet); animation: gem-pop .5s cubic-bezier(.34,1.56,.64,1); }
.ws-reward > div:nth-child(2) { display: flex; align-items: center; gap: 8px; font-weight: 700; flex: 1 1 260px; }
.ws-reward a { font-weight: 800; }
.ws-reward.rank-up { background: #e6fff4; border-color: var(--mint); }
@keyframes gem-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.rank-cell { white-space: nowrap; }
.rank-cell .gem { vertical-align: middle; margin-right: 4px; }
.sticker-cell { cursor: help; }
.site-footer .disclaimer { margin-top: 8px; font-size: 13px; color: #9a91d6; max-width: 560px; }

/* home: rewards promo */
.promo-stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 380px; margin: 0 auto; }
.promo-stickers img {
  width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 24px; padding: 14px;
  box-shadow: 0 0 0 2px var(--gold), 0 10px 20px rgba(27,23,71,.1);
}
.promo-stickers img:nth-child(odd) { transform: rotate(-6deg); }
.promo-stickers img:nth-child(even) { transform: rotate(5deg); }
.rewards-promo .btn-soft { background: #fff; box-shadow: 0 0 0 2px var(--line); }
.rewards-promo { overflow-x: clip; }   /* floating aliens never make the page scroll sideways */

/* the 12 aliens playing and learning together round a chalkboard */
.promo-party {
  position: relative; width: 100%; max-width: 480px; aspect-ratio: 1 / .86; margin: 0 auto;
  /* no frame (user): the aliens sit straight on the section */
}
.pa-board {
  position: absolute; left: 23%; top: 7%; width: 54%; height: 40%; z-index: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2%;
  /* a show-time board: rainbow frame, starry purple screen, neon numbers, marquee bulbs, bunting */
  border: 7px solid transparent; border-radius: 20px;
  background:
    radial-gradient(1.5px 1.5px at 18% 22%, #fff 99%, transparent) padding-box,
    radial-gradient(1px 1px at 72% 30%, #fff 99%, transparent) padding-box,
    radial-gradient(1.5px 1.5px at 84% 78%, #fff 99%, transparent) padding-box,
    radial-gradient(1px 1px at 30% 82%, #fff 99%, transparent) padding-box,
    radial-gradient(120% 120% at 50% 0%, #5b3fd1 0%, #2b1f78 60%, #1b1650 100%) padding-box,
    linear-gradient(90deg, #ff6b9a, #ffb84d, #ffe45c, #5fdc9a, #4cc3ff, #a77bff, #ff6b9a) border-box;
  box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(91,63,209,.35), 0 0 26px rgba(167,123,255,.45);
  font: 800 clamp(13px, 3.4vw, 22px)/1.15 var(--head); color: #fff; letter-spacing: .03em;
  text-shadow: 0 0 6px #ff7ad9, 0 0 14px rgba(255,122,217,.6);
}
.pa-board span:nth-child(3) { color: #fff6b0; text-shadow: 0 0 6px #ffcb3d, 0 0 14px rgba(255,203,61,.7); }
.pa-board span:nth-child(4) { text-shadow: 0 0 6px #4cc3ff, 0 0 14px rgba(76,195,255,.6); }
/* little light bulbs round the screen, twinkling */
.pa-board::before {
  content: ''; position: absolute; inset: 5px; border-radius: 13px; pointer-events: none;
  border: 4px dotted #fff3a8; filter: drop-shadow(0 0 3px #ffd84d); animation: pa-twinkle 1.2s steps(2) infinite;
}
@keyframes pa-twinkle { 50% { border-color: #ffb3e1; filter: drop-shadow(0 0 3px #ff7ad9); } }
/* bunting flags across the top */
.pa-flags { position: absolute; left: 4%; right: 4%; top: -14px; display: flex; justify-content: space-between; pointer-events: none; }
.pa-flags::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #b98bff; border-radius: 2px; }
.pa-flags i { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 13px solid var(--f); }
.pa-alien {
  position: absolute; height: auto; aspect-ratio: 1; object-fit: contain; cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 4px 3px rgba(27,23,71,.18));
  /* floating like balloons: a slow loop of its own, swaying gently from the top */
  animation: pa-float var(--fd, 18s) ease-in-out infinite var(--d, 0s), pa-sway 5s ease-in-out infinite var(--sd, 0s);
  transform-origin: 50% 10%;
}
@keyframes pa-float {
  0%, 100% { translate: 0 0; }
  25% { translate: var(--x1) var(--y1); }
  50% { translate: var(--x2) var(--y2); }
  75% { translate: var(--x3) var(--y3); }
}
@keyframes pa-sway { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
/* drag and drop: picked up, dropped somewhere on the page (floating), flying home */
.pa-alien.dragging { cursor: grabbing; scale: 1.12; animation: pa-sway 1.2s ease-in-out infinite; filter: drop-shadow(0 16px 12px rgba(27,23,71,.3)); }
.pa-alien.dropped { animation: pa-bob-here 3s ease-in-out infinite, pa-sway 5s ease-in-out infinite; }
.pa-alien.going-home { animation: pa-sway 5s ease-in-out infinite; pointer-events: none; }
@keyframes pa-bob-here { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.pa-bubble {
  position: absolute; z-index: 6; white-space: nowrap; padding: 5px 10px 4px; border-radius: 14px;
  background: #fff; color: var(--violet); font: 800 clamp(11px, 2.6vw, 15px)/1 var(--head);
  box-shadow: 0 0 0 2px var(--violet), 0 4px 8px rgba(27,23,71,.12);
  animation: pa-pop 3.2s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.pa-bubble::after { content: ''; position: absolute; bottom: -7px; width: 10px; height: 10px; background: #fff; box-shadow: 2px 2px 0 0 var(--violet); rotate: 45deg; }
.pa-l::after { left: 16px; } .pa-r::after { right: 16px; } .pa-c::after { left: calc(50% - 5px); }
@keyframes pa-pop { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
.pa-star { position: absolute; z-index: 7; font-size: clamp(14px, 3vw, 20px); animation: pa-pop 2.4s ease-in-out infinite; }
.pa-star.s1 { left: 21%; top: 3%; } .pa-star.s2 { right: 20%; top: 46%; animation-delay: -.8s; } .pa-star.s3 { left: 47%; bottom: 3%; animation-delay: -1.6s; }
@media (prefers-reduced-motion: reduce) { .pa-alien, .pa-bubble, .pa-star { animation: none; } }

/* ---- Design Studio options (site.json → build.py) ----------------------- */
.tint { background: var(--soft); }
/* hero layouts: split (default), center, photo */
.hero-center .wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.hero-center .lead { margin-left: auto; margin-right: auto; }
.hero-center .btn-row { justify-content: center; }
.hero-center .hero-art { display: none; }
.hero-center .hero-photo-side { max-width: 420px; margin-top: 8px; }
.hero-photo { background-size: cover !important; background-position: center !important; }
.hero-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--space-1) 88%, transparent), color-mix(in srgb, var(--space-1) 35%, transparent)); }
.hero-photo .wrap { position: relative; grid-template-columns: 1fr; }
.hero-photo .hero-art, .hero-photo .hero-photo-side { display: none; }
.hero-photo-side { width: 100%; max-height: 380px; object-fit: contain; border-radius: 24px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }

/* ---- admin bar (owner's computer only, see site.js) ---------------------- */
.admin-bar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 90;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100% - 24px);
  padding: 8px 10px; border-radius: 16px; background: #1d1a3a; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); font: 700 13px/1.2 "Segoe UI", system-ui, sans-serif;
}
.admin-tag { color: var(--gold); padding: 0 6px; }
.admin-view { color: #bfb6ff; padding: 0 2px 0 8px; }
.admin-btn {
  border: 0; border-radius: 10px; padding: 7px 11px; background: rgba(255,255,255,.1); color: #fff;
  font: inherit; cursor: pointer; text-decoration: none;
}
.admin-btn:hover { background: rgba(255,255,255,.2); }
.admin-btn.on { background: #fff; color: #1d1a3a; }
.admin-btn.primary { background: var(--gold); color: #1d1a3a; }
.admin-btn.ghost { background: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.admin-pill {
  position: fixed; left: 14px; bottom: 14px; z-index: 90; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(29,26,58,.92); color: #fff;
  font: 600 13px/1.2 "Segoe UI", system-ui, sans-serif; box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.admin-pill button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--gold); color: #1d1a3a; font: 700 13px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
body.has-admin-bar .site-footer { padding-bottom: 90px; }
@media print { .admin-bar, .admin-pill { display: none !important; } }

/* ---- "Count the Aliens" picture chart (times-table pages) ---------------- */
.count-chart { background: var(--card); border-radius: var(--radius); padding: 6px 22px; box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(27,23,71,.06); }
.count-row { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.count-row:last-child { border-bottom: 0; }
.count-row.square .count-sum { background: #fff6d9; }
.count-words { display: grid; grid-template-columns: 1fr 1fr 1fr .7fr 1.6fr; gap: 4px; font-size: 12px; color: #6aa83a; text-align: center; margin-bottom: 2px; white-space: nowrap; }
.count-words { align-items: end; }
/* the answer word in full, wrapping onto a second line when long ("twenty-four", "one hundred and forty-four") */
.count-words span:last-child { white-space: normal; overflow: visible; line-height: 1.05; overflow-wrap: break-word; }
.count-sum { display: grid; grid-template-columns: 1fr 1fr 1fr .7fr 1.6fr; gap: 4px; align-items: center; text-align: center; border-radius: 14px; padding: 2px 0; }
.count-sum b { font: 800 32px/1 var(--head); color: var(--ink); }
.count-sum i { font: 800 26px/1 var(--head); font-style: normal; color: var(--ink); }
.count-sum b.ans { color: var(--violet); border: 3px solid #8bc34a; border-radius: 12px; padding: 4px 0 2px; }
.count-groups { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: center; }
.grp { display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); justify-items: center; align-content: center; gap: 1px; aspect-ratio: var(--c) / var(--r); }
.grp img { width: 100%; height: auto; display: block; }
.grp:not(.on) img { opacity: .55; }
@media (max-width: 760px) {
  .count-chart { padding: 4px 12px; }
  .count-row { grid-template-columns: 1fr; gap: 8px; }
  .count-sum b { font-size: 28px; }
  .count-groups { gap: 3px; }
}
.sheet-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; padding: 14px 18px; border-radius: 18px; background: var(--soft); }
.sheet-dl span { flex: 1 1 260px; font-weight: 700; }

/* flashcard answers: "?" until tapped */
.flash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.flash-bar span { flex: 1 1 260px; font-weight: 700; }
.count-sum .flip {
  position: relative; display: grid; place-items: center; height: 46px; padding: 0; cursor: pointer;
  font: 800 30px/1 var(--head); color: var(--violet); background: #fff; border: 3px solid #8bc34a; border-radius: 12px;
  box-shadow: 0 4px 0 #6aa83a; transition: transform .12s, box-shadow .12s, background .2s;
}
.count-sum .flip:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #6aa83a; }
.count-sum .flip:active { transform: translateY(3px); box-shadow: 0 1px 0 #6aa83a; }
.count-sum .flip:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.count-sum .flip em { font-style: normal; color: #6aa83a; animation: wiggle 2.4s ease-in-out infinite; }
.count-sum .flip span, .count-words .w-ans span { display: none; }
.count-row.revealed .flip { background: #f2fbe9; animation: flip-in .35s ease; }
.count-row.revealed .flip em, .count-row.revealed .count-words .w-ans em { display: none; }
.count-row.revealed .flip span, .count-row.revealed .count-words .w-ans span { display: inline; }
.count-words .w-ans em { font-style: normal; font-weight: 800; }
@keyframes flip-in { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-10deg) scale(1.1); } 92% { transform: rotate(10deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .count-sum .flip em, .count-row.revealed .flip { animation: none; } }

/* tap a sum to hear it */
.count-eq { position: relative; cursor: pointer; border-radius: 14px; padding: 4px 4px 4px 26px; transition: background .2s; }
.count-eq:hover { background: var(--soft); }
.say-icon { position: absolute; left: 2px; top: 50%; transform: translateY(-20%); font-size: 15px; opacity: .55; transition: transform .2s, opacity .2s; }
.count-eq:hover .say-icon { opacity: 1; }
.count-row.speaking .count-eq { background: #fff3c4; }
.count-row.speaking .say-icon { opacity: 1; animation: speak .5s ease-in-out infinite alternate; }
@keyframes speak { to { transform: translateY(-20%) scale(1.25); } }
@media (max-width: 760px) { .count-row { grid-template-columns: 1fr; } }

/* Learn / Flashcards switch */
.mode-switch { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); }
.mode-switch button { border: 0; background: none; border-radius: 999px; padding: 9px 16px; font: 800 15px var(--head); color: var(--muted); cursor: pointer; }
.mode-switch button.on { background: var(--violet); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.mode-switch button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* flashcard peek: a bar on the card runs down over 5 s, then the card flips back */
.count-sum .flip { overflow: hidden; }
.count-row.peeking .flip::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: 100%;
  background: #8bc34a; transform-origin: left; animation: peek-bar 13s linear forwards;
}
@keyframes peek-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* running aliens: pale outlines in every slot, colour crews on top that wander or sit at home */
.grp { display: block; position: relative; }
.grp .ghosts, .grp .crew {
  display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); justify-items: center; align-content: center;
  gap: 1px; width: 100%; height: 100%;
}
.grp .ghosts img { opacity: .5; }
.grp:not(.on) img { opacity: .5; }
.grp .crew { position: absolute; inset: 0; z-index: 1; will-change: transform; }
.grp .crew img { opacity: 1 !important; filter: drop-shadow(0 2px 2px rgba(27,23,71,.25)); }
.count-groups { position: relative; overflow: visible; }
/* once the aliens are home, each group gets a ring, one after another, so children see
   "b groups of n" (user: circle every group) */
.count-row.circled .grp.on::after {
  content: ''; position: absolute; inset: -6px -5px; z-index: 2; pointer-events: none;
  border: 2.5px solid var(--ring, #ff5fa2); border-radius: 40%;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), 0 0 8px color-mix(in srgb, var(--ring, #ff5fa2) 45%, transparent);
  animation: grp-ring .35s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--gi, 0) * 110ms);
}
@keyframes grp-ring { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
/* room for the rings: wider gaps between the groups and a little space above and below */
.count-groups { column-gap: 14px; padding: 7px 4px; }
@media (max-width: 760px) {
  .count-groups { column-gap: 7px; padding: 4px 2px; }
  .count-row.circled .grp.on::after { inset: -4px -3px; border-width: 2px; }
}
@media (prefers-reduced-motion: reduce) { .count-row.circled .grp.on::after { animation: none; } }

/* ---- worksheet: alien look, aligned columns, numbers running down ---------- */
.sheet { --ws-c: #7c5cff; position: relative; overflow: hidden; border-top: 10px solid var(--ws-c); }
.sheet::before, .sheet::after { content: '✦'; position: absolute; color: color-mix(in srgb, var(--ws-c) 45%, #fff); font-size: 22px; pointer-events: none; }
.sheet::before { top: 70px; right: 22px; }
.sheet::after { bottom: 46px; left: 14px; font-size: 16px; }
.sheet-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.sheet-badge {
  flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  font: 800 40px/1 var(--head); color: #fff; background: var(--ws-c);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.15), 0 0 0 5px color-mix(in srgb, var(--ws-c) 22%, #fff);
}
.sheet-badge:empty { display: none; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-titles h2 { margin: 0 0 2px; }
.sheet-titles p { margin: 0; color: #666; font-weight: 700; }
.sheet-aliens { flex: none; display: flex; align-items: flex-end; }
.sheet-aliens img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(27,23,71,.2)); }
.sheet-aliens[data-n="2"] img, .sheet-aliens[data-n="3"] img, .sheet-aliens[data-n="4"] img { width: 62px; height: 62px; margin-left: -8px; }
.sheet-aliens[data-n="11"] { flex-wrap: wrap; justify-content: flex-end; max-width: 210px; }
.sheet-aliens[data-n="11"] img { width: 38px; height: 38px; margin: -3px; }

.sheet-qs.down { grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 12), auto); gap: 10px 34px; }
.sheet-qs li.q {
  --wa: 1.5em; --wb: 1.5em;
  display: grid; grid-template-columns: 2em var(--wa) 1.4em var(--wb) 1.4em max-content; align-items: center;
  padding: 3px 14px 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--ws-c) 9%, #fff);
}
.sheet-qs[data-kind="divide"] li.q, .sheet-qs[data-kind="mixed"] li.q { --wa: 2.1em; }
.sheet-qs[data-kind="missing"] li.q, .sheet-qs[data-kind="mixed"] li.q { --wb: 80px; }
.sheet-qs li.q::before { content: counter(q) "."; text-align: right; padding-right: 8px; color: color-mix(in srgb, var(--ws-c) 70%, #333); font: 800 15px var(--head); }
.sheet-qs .q-a, .sheet-qs .q-b { text-align: center; }   /* even gaps either side of × */
.sheet-qs .q-op, .sheet-qs .q-eq { text-align: center; color: color-mix(in srgb, var(--ws-c) 75%, #222); }
.sheet-qs .q-c { padding-left: 4px; }
.sheet-qs .q-b .blank, .sheet-qs .q-c .blank { display: block; }
.sheet-qs .q-b .ans { width: 72px; }
.sheet-qs .q-c .ans { width: 72px; }
@media (max-width: 560px) {
  .sheet-qs.down { grid-auto-flow: row; grid-template-rows: none; }
  .sheet-aliens img { width: 64px; height: 64px; }
  .sheet-badge { width: 54px; height: 54px; font-size: 28px; }
  .sheet-titles h2 { font-size: 22px; }
  .sheet-aliens[data-n="11"] { display: none; }
}
/* alien helpers walking the sheet */
#sheet-aliens img.away { visibility: hidden; }
.ws-walker { position: absolute; left: 0; top: 0; width: 52px; height: 52px; z-index: 5; pointer-events: none; }
.ws-walker img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(27,23,71,.25)); transition: filter .25s; }
.ws-walker.walking img { animation: ws-step .42s linear infinite; }
.ws-walker.happy img { animation: ws-hop .32s ease; }
.ws-walker.party img { animation: ws-party .5s ease-in-out infinite; }
.ws-walker.sad img { filter: grayscale(.7) brightness(.85) drop-shadow(0 3px 2px rgba(27,23,71,.25)); animation: ws-droop .5s ease forwards; }
.ws-bubble {
  position: absolute; left: 62%; top: -18px; font-size: 22px; line-height: 1; opacity: 0; transform: scale(.4);
  transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
}
.ws-bubble:not(:empty) { opacity: 1; transform: none; }
.ws-confetti { position: absolute; z-index: 6; font-size: 20px; pointer-events: none; }
/* a step: lean on one foot, bob up, lean on the other foot, bob up */
@keyframes ws-step {
  0%   { rotate: -7deg; translate: 0 0;    scale: 1.03 .97; }
  25%  { rotate: 0deg;  translate: 0 -5px; scale: 1 1; }
  50%  { rotate: 7deg;  translate: 0 0;    scale: 1.03 .97; }
  75%  { rotate: 0deg;  translate: 0 -5px; scale: 1 1; }
  100% { rotate: -7deg; translate: 0 0;    scale: 1.03 .97; }
}
.ws-walker img { transform-origin: 50% 90%; }
@keyframes ws-hop { 50% { translate: 0 -14px; rotate: -10deg; } }
@keyframes ws-party { 0%, 100% { translate: 0 0; rotate: 0deg; } 30% { translate: 0 -18px; rotate: -12deg; } 60% { translate: 0 -10px; rotate: 10deg; } }
@keyframes ws-droop { to { translate: 0 5px; scale: 1 .9; rotate: 8deg; } }
.sheet-qs li.q, .sheet-qs .fact { position: relative; }
.ws-sticker { position: absolute; right: 12px; top: 50%; margin-top: -12px; font-size: 24px; line-height: 1; pointer-events: none; animation: ws-stick .45s cubic-bezier(.34,1.56,.64,1); }
/* the right answer beside a wrong one, so the child sees and remembers it */
.ws-fix {
  position: absolute; right: 8px; top: 50%; translate: 0 -50%; pointer-events: none;
  font: 800 18px/1 var(--head); color: #157a56; background: #dcf7ec; border: 2px solid #1f9c70;
  border-radius: 999px; padding: 4px 10px 3px; animation: ws-stick .45s cubic-bezier(.34,1.56,.64,1);
}
.ws-fix::before { content: '✓ '; }
.sheet-qs .fact .ws-fix { top: 100%; right: auto; left: 0; translate: 0 2px; font-size: 13px; padding: 2px 8px; z-index: 2; white-space: nowrap; }
@media print { .ws-fix { background: none; } }
@keyframes ws-stick { from { scale: 2.4; opacity: 0; } to { scale: 1; opacity: 1; } }
.sheet .blank.revealed em { display: inline-block; visibility: visible; min-width: 64px; border-bottom: 2px solid #333; font-style: normal; animation: ws-drop .35s cubic-bezier(.34,1.56,.64,1); }
.sheet .blank.short.revealed em { min-width: 40px; }
.sheet .blank.revealed .ans { display: none; }
@keyframes ws-drop { from { translate: 0 -16px; opacity: 0; scale: .6; } to { translate: 0 0; opacity: 1; scale: 1; } }
@media print { .ws-walker, .ws-confetti { display: none !important; } #sheet-aliens img.away { visibility: visible; } }

@media print {
  .sheet { border-top-width: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-qs li.q { padding-top: 5px; padding-bottom: 5px; }
}
/* idea 2: aliens stay inside the answer box until the card is tapped */
.count-chart.idea2 .count-row:not(.revealed):not(.returning) .crew img { visibility: hidden; }
.count-chart.idea2 .count-row { position: relative; }
.count-chart.idea2 .crew img { z-index: 3; }
.count-chart.idea2 .flip { position: relative; z-index: 2; }
.grp .crew img { cursor: pointer; }
/* every alien moves on its own now (not the whole group) */
.grp .crew { will-change: auto; }
.grp .crew img { will-change: transform; position: relative; z-index: 1; }

/* ==== times-table pages (2026-11-09) ===================================== */
/* 1. hero: the table's alien playing chase round a big glowing number */
.th-art { height: 380px; }
.th-art .th-glow { position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,200,61,.35), rgba(123,97,255,.18) 45%, transparent 70%); animation: th-pulse 4s ease-in-out infinite; }
.th-art .th-num { position: absolute; left: 50%; top: 50%; translate: -50% -52%; z-index: 2; pointer-events: none;
  font: 800 230px/1 var(--head); color: var(--gold); -webkit-text-stroke: 4px #fff6c8;
  text-shadow: 0 8px 0 #a2470d, 0 0 30px rgba(255,200,61,.7), 0 0 60px rgba(255,200,61,.35); }
.th-art .th-peek { position: absolute; left: 50%; top: 50%; width: 86px; z-index: 1; translate: 10px -20px;
  animation: th-peek 5s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
@keyframes th-peek { 0%, 100% { translate: 10px 10px; rotate: 8deg; } 40%, 60% { translate: 40px -110px; rotate: -10deg; } }
.th-orbit { position: absolute; inset: 0; z-index: 3; animation: th-orbit var(--dur) linear infinite var(--dir); }
.th-orbit:nth-of-type(even) { z-index: 1; }               /* these dash behind the number: hide and seek */
.th-spin { position: absolute; left: calc(50% + var(--r)); top: 50%; translate: -50% -50%; animation: th-counter var(--dur) linear infinite var(--dir); }
.th-spin img { display: block; height: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); animation: th-wiggle var(--bob) ease-in-out infinite alternate; }
@keyframes th-orbit { from { rotate: var(--a); } to { rotate: calc(var(--a) + 360deg); } }
@keyframes th-counter { from { rotate: calc(0deg - var(--a)); } to { rotate: calc(0deg - var(--a) - 360deg); } }
@keyframes th-wiggle { from { rotate: -14deg; translate: 0 6px; } to { rotate: 14deg; translate: 0 -8px; } }
@keyframes th-pulse { 50% { scale: 1.12; opacity: .8; } }
@media (max-width: 820px) {
  .th-art { height: 260px; }
  .th-art .th-glow { width: 200px; height: 200px; }
  .th-art .th-num { font-size: 150px; -webkit-text-stroke-width: 3px; }
  .th-art .th-peek { width: 60px; }
  .th-spin { scale: .68; }
}
@media (prefers-reduced-motion: reduce) { .th-orbit, .th-spin, .th-spin img, .th-peek, .th-glow { animation: none; } }

/* 2. say it aloud: a small speaker on the right of every line */
.aloud li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.say-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font-size: 16px; line-height: 1;
  background: var(--soft); box-shadow: 0 2px 0 var(--line); transition: transform .15s, background .15s; }
.say-btn:hover { transform: scale(1.1); background: #e2dbff; }
.say-btn.playing { background: var(--gold); animation: say-pulse .5s ease-in-out infinite alternate; }
@keyframes say-pulse { to { transform: scale(1.15); } }

/* 3. game banner: no pictures, just shooting stars, and now and then a meteor or a rocket going by */
.game-poster { grid-template-columns: 1fr; }
.game-poster > div:first-child { position: relative; z-index: 1; }
.poster-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.poster-sky .shoot { position: absolute; width: 120px; height: 2px; border-radius: 2px; opacity: 0; rotate: -28deg;
  background: linear-gradient(90deg, transparent, #fff); filter: drop-shadow(0 0 4px #fff); animation: p-shoot 7s ease-in infinite; }
.poster-sky .shoot::after { content: ''; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px #fff8d0; }
.poster-sky .s1 { left: 72%; top: 6%; }
.poster-sky .s2 { left: 88%; top: 22%; animation-delay: -2.1s; animation-duration: 8.5s; width: 90px; }
.poster-sky .s3 { left: 60%; top: 2%; animation-delay: -4.3s; animation-duration: 9.5s; background: linear-gradient(90deg, transparent, #ffb3e1); }
.poster-sky .s4 { left: 95%; top: 45%; animation-delay: -5.6s; animation-duration: 6.5s; width: 80px; }
.poster-sky .s5 { left: 80%; top: 12%; animation-delay: -1s; animation-duration: 11s; background: linear-gradient(90deg, transparent, #bfe8ff); }
@keyframes p-shoot { 0% { opacity: 0; translate: 0 0; } 4% { opacity: 1; } 18% { opacity: 0; translate: -260px 140px; } 100% { opacity: 0; translate: -260px 140px; } }
.poster-sky .sky-meteor { position: absolute; width: 74px; right: -90px; top: -90px; opacity: 0; animation: p-meteor 14s linear infinite 3s; }
@keyframes p-meteor { 0% { opacity: 0; translate: 0 0; rotate: 0deg; } 3% { opacity: 1; } 32% { opacity: 1; translate: -520px 420px; rotate: -220deg; } 34%, 100% { opacity: 0; translate: -520px 420px; } }
.poster-sky .sky-rocket { position: absolute; width: 64px; left: 40%; bottom: -120px; rotate: 35deg; opacity: 0; animation: p-rocket 19s ease-in infinite 9s; }
@keyframes p-rocket { 0% { opacity: 0; translate: 0 0; } 3% { opacity: 1; } 28% { opacity: 1; translate: 520px -560px; } 30%, 100% { opacity: 0; translate: 520px -560px; } }
@media (prefers-reduced-motion: reduce) { .poster-sky * { animation: none !important; opacity: 0; } }

/* 4. quick quiz: 30 questions, centred; the worksheet note under "All tables 1–12" */
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head.center p { margin-left: auto; margin-right: auto; }
.quiz.quiz-30 { margin: 0 auto; }
.quiz-progress { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; margin-bottom: 18px; }
.quiz-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--gold)); transition: width .4s ease; }
.quiz-count { font: 800 22px var(--head); color: var(--violet); }
.quiz-later { color: var(--coral); }
.quiz-done { text-align: center; padding: 6px 0 4px; }
.quiz-done h3 { font: 800 30px var(--head); margin: 0 0 6px; }
.quiz-done p { color: var(--muted); margin: 0 0 16px; }
.quiz-done .btn-row { justify-content: center; }
.pager { justify-content: center; }
.paper-note { margin-top: 24px; text-align: center; }

/* the chart in its alien's colour (user): the words, the answer box and its "?" (--tc set per table) */
.count-chart[style*="--tc"] .count-words { color: color-mix(in srgb, var(--tc) 85%, #000); }
.count-chart[style*="--tc"] .count-sum .flip { border-color: var(--tc); box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 70%, #000); }
.count-chart[style*="--tc"] .count-sum .flip:hover { box-shadow: 0 6px 0 color-mix(in srgb, var(--tc) 70%, #000); }
.count-chart[style*="--tc"] .count-sum .flip:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--tc) 70%, #000); }
.count-chart[style*="--tc"] .count-sum .flip em { color: var(--tc); }
.count-chart[style*="--tc"] .count-sum .flip span { color: color-mix(in srgb, var(--tc) 75%, #000); }
.count-chart[style*="--tc"] .count-row.revealed .flip { background: color-mix(in srgb, var(--tc) 10%, #fff); }
.count-chart[style*="--tc"] .count-row.peeking .flip::after { background: var(--tc); }

/* "tricks" cards: each title in the colour of its card's top border */
.tip:nth-child(1) h3 { color: var(--sky, #1e88d6); }
.tip:nth-child(2) h3 { color: var(--coral); }
.tip:nth-child(3) h3 { color: var(--mint); }
.tip:nth-child(4) h3 { color: color-mix(in srgb, var(--gold) 80%, #7a4a00); }

/* the 12 table cards: each one is that table's alien (cute, in the alien's colour) */
.table-card.alien-card { position: relative; overflow: hidden; padding: 12px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tc) 22%, #fff), #fff 70%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 35%, transparent), 0 5px 0 color-mix(in srgb, var(--tc) 55%, #fff); }
.alien-card .tc-pic { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; margin-bottom: 4px;
  background: radial-gradient(circle at 40% 35%, #fff, color-mix(in srgb, var(--tc) 30%, #fff)); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--tc) 55%, #fff); }
.alien-card .tc-pic img { width: 88%; height: auto; transition: transform .25s; animation: tc-bob 3s ease-in-out infinite; }
.alien-card:nth-child(odd) .tc-pic img { animation-delay: -1.5s; }
.alien-card:hover .tc-pic img { animation: tc-wiggle .6s ease-in-out infinite alternate; }
.table-card.alien-card b { color: var(--tc); font-size: 32px; text-shadow: 0 2px 0 color-mix(in srgb, var(--tc) 25%, #fff); }
.table-card.alien-card span:last-child { color: color-mix(in srgb, var(--tc) 55%, var(--muted)); }
@keyframes tc-bob { 50% { translate: 0 -4px; rotate: -4deg; } }
@keyframes tc-wiggle { from { rotate: -12deg; scale: 1.05; } to { rotate: 12deg; scale: 1.15; } }
@media (max-width: 480px) { .alien-card .tc-pic { width: 58px; height: 58px; } .table-card.alien-card b { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { .alien-card .tc-pic img { animation: none; } }

/* ==== word problems page ================================================ */
.wp-routine { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; counter-reset: r; }
.wp-routine li { counter-increment: r; background: var(--card); border-radius: 18px; padding: 12px 10px; text-align: center; box-shadow: 0 4px 0 var(--line); }
.wp-routine li span { font-size: 26px; display: block; }
.wp-routine li b { display: block; font: 800 17px var(--head); color: var(--violet); }
.wp-routine li b::before { content: counter(r) ". "; }
.wp-routine li small { color: var(--muted); font-weight: 700; font-size: 12.5px; line-height: 1.3; display: block; }
.wp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.wp-progress { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.wp-progress b { font: 800 18px var(--head); color: var(--violet); white-space: nowrap; }
.wp-track { flex: 1; height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.wp-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--gold)); transition: width .4s; }
.wp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-filters button { border: 0; border-radius: 999px; padding: 7px 14px; font: 800 14px var(--body); background: var(--soft); color: var(--ink); cursor: pointer; }
.wp-filters button.on { background: var(--violet); color: #fff; }
.wp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .wp-grid { grid-template-columns: 1fr; } .wp-routine { grid-template-columns: repeat(5, minmax(0,1fr)); } .wp-routine li small { display: none; } }
.wp-card { position: relative; background: var(--card); border-radius: 22px; padding: 18px 20px 16px; overflow: hidden;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 30%, transparent), 0 6px 0 color-mix(in srgb, var(--tc) 45%, #fff); }
.wp-card[hidden] { display: none; }
.wp-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.wp-num { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font: 800 20px var(--head); color: #5a3a00;
  background: var(--gold); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); padding-top: 4px; }
.wp-head h3 { margin: 0; font-size: 19px; line-height: 1.2; color: color-mix(in srgb, var(--tc) 70%, #1d1a3a); }
.wp-skill { display: inline-block; font: 800 11.5px var(--body); letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 85%, #000);
  background: color-mix(in srgb, var(--tc) 14%, #fff); padding: 3px 9px; border-radius: 999px; margin-bottom: 4px; }
.wp-emoji { margin-left: auto; font-size: 38px; line-height: 1; }
.wp-text { margin: 0 0 6px; font-size: 16.5px; }
.wp-q { margin: 0 0 12px; font: 800 17px var(--head); color: var(--ink); }
.wp-work { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--tc) 7%, #fff); }
.wp-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.wp-label { flex: none; width: 108px; font: 800 14px var(--body); color: color-mix(in srgb, var(--tc) 70%, #1d1a3a); }
.wp-ops { display: flex; gap: 6px; }
.wp-ops button { border: 2px solid color-mix(in srgb, var(--tc) 40%, #fff); background: #fff; border-radius: 12px; padding: 5px 12px; font: 800 15px var(--body); cursor: pointer; }
.wp-ops button.ok { background: #dcf7ec; border-color: #1f9c70; color: #157a56; }
.wp-ops button.no { background: #ffe1e1; border-color: #c94a4a; color: #b03030; }
.wp-hint { flex-basis: 100%; font-size: 13.5px; font-weight: 700; padding-left: 118px; }
.wp-hint.ok { color: #157a56; } .wp-hint.no { color: #b03030; }
.wp-work input, .wp-pick { font: 700 16px var(--body); border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; color: var(--ink); }
.wp-working, .wp-sentence { flex: 1 1 200px; min-width: 0; }
.wp-answer { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wp-ans { width: 90px; text-align: center; font: 800 20px var(--head) !important; color: var(--violet) !important; }
.wp-unit { font-weight: 800; color: var(--muted); }
.wp-work .ok { background: #dcf7ec; border-color: #1f9c70; }
.wp-work .no { background: #ffe1e1; border-color: #c94a4a; }
.wp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.wp-msg { font-weight: 800; font-size: 14.5px; }
.wp-msg.ok { color: #157a56; } .wp-msg.no { color: #b03030; }
.wp-show.glow { box-shadow: 0 0 0 3px var(--gold); animation: say-pulse .6s ease-in-out infinite alternate; }
.wp-solution { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #fffaf0; border: 2px dashed color-mix(in srgb, var(--gold) 70%, #fff); }
.wp-solution h4 { margin: 8px 0 4px; font-size: 15px; color: var(--violet); }
.wp-solution .wp-sol-title { margin-top: 0; }
.wp-solution p { margin: 2px 0; }
.wp-model { margin-top: 8px !important; color: #157a56; }
.wp-note { color: var(--muted); font-weight: 700; }
.wp-alien { position: absolute; right: 10px; bottom: 8px; width: 62px; opacity: .9; pointer-events: none; transition: filter .3s; }
.wp-card .wp-actions { padding-right: 62px; }
.wp-card.solved { box-shadow: 0 0 0 3px #1f9c70, 0 6px 0 #9fe0c4; }
.wp-card.solved .wp-num { background: #3fd29a; color: #fff; }
.wp-card.happy .wp-alien { animation: wp-happy .45s ease-in-out 4 alternate; }
.wp-card.sad .wp-alien { filter: grayscale(.7) brightness(.85); animation: wp-sad .5s ease-in-out 2 alternate; }
@keyframes wp-happy { to { translate: 0 -16px; rotate: -12deg; scale: 1.12; } }
@keyframes wp-sad { to { translate: 4px 4px; rotate: 10deg; } }
.wp-vocab { margin-top: 22px; }
.wp-vocab summary { font: 800 18px var(--head); cursor: pointer; }
.wp-vocab ul { columns: 2; margin: 12px 0 0; padding-left: 18px; }
.wp-vocab li { margin-bottom: 4px; }
.print-only, .wp-print-lines { display: none; }
@media (max-width: 560px) { .wp-label { width: 100%; } .wp-hint { padding-left: 0; } .wp-vocab ul { columns: 1; } }
@media print {
  .wp-work, .wp-solution, .wp-bar, .wp-alien { display: none !important; }
  .wp-sheet-top.print-only { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
  .wp-print-lines { display: grid; grid-template-columns: auto 1fr; gap: 14px 8px; margin-top: 8px; font-weight: 700; }
  .wp-print-lines i { border-bottom: 1.5px solid #555; height: 18px; }
  .wp-print-lines i:nth-of-type(2) { grid-column: 2; }
  .wp-card { break-inside: avoid; box-shadow: none; border: 2px solid #ccc; }
  .wp-routine li { box-shadow: none; border: 1px solid #ccc; }
}

/* hero aliens roaming freely round the number: up/down, left/right, in front (bigger, over the
   number) and behind (smaller, under it) — z-index steps inside each loop */
.th-roamers { position: absolute; inset: 0; pointer-events: none; }   /* no z-index: roamers share the number's stacking layer */
.th-roam { --k: .82; position: absolute; left: 50%; top: 50%; translate: -50% -50%; animation: var(--path) var(--dur) ease-in-out infinite var(--dl); }
.th-roam img { display: block; max-width: none; height: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35));
  animation: th-wiggle var(--bob) ease-in-out infinite alternate; }
.roam-a { --path: roam-a; } .roam-b { --path: roam-b; } .roam-c { --path: roam-c; } .roam-d { --path: roam-d; } .roam-e { --path: roam-e; }
@keyframes roam-a {
  0%   { transform: translate(calc(-170px * var(--k, 1)), calc(-40px * var(--k, 1))) scale(.75); z-index: 1; }
  18%  { transform: translate(calc(-40px * var(--k, 1)), calc(-150px * var(--k, 1))) scale(.8);  z-index: 1; }
  36%  { transform: translate(calc(150px * var(--k, 1)), calc(-90px * var(--k, 1))) scale(1);    z-index: 3; }
  55%  { transform: translate(calc(110px * var(--k, 1)), calc(80px * var(--k, 1))) scale(1.25);  z-index: 3; }
  72%  { transform: translate(calc(-30px * var(--k, 1)), calc(120px * var(--k, 1))) scale(1.15); z-index: 3; }
  88%  { transform: translate(calc(-150px * var(--k, 1)), calc(70px * var(--k, 1))) scale(.85);  z-index: 1; }
  100% { transform: translate(calc(-170px * var(--k, 1)), calc(-40px * var(--k, 1))) scale(.75); z-index: 1; }
}
@keyframes roam-b {
  0%   { transform: translate(calc(160px * var(--k, 1)), calc(30px * var(--k, 1))) scale(.7);  z-index: 1; }
  25%  { transform: translate(calc(20px * var(--k, 1)), calc(-60px * var(--k, 1))) scale(.6);  z-index: 1; }
  45%  { transform: translate(calc(-150px * var(--k, 1)), calc(-110px * var(--k, 1))) scale(.9); z-index: 3; }
  65%  { transform: translate(calc(-90px * var(--k, 1)), calc(40px * var(--k, 1))) scale(1.2); z-index: 3; }
  82%  { transform: translate(calc(60px * var(--k, 1)), calc(130px * var(--k, 1))) scale(1.05); z-index: 3; }
  100% { transform: translate(calc(160px * var(--k, 1)), calc(30px * var(--k, 1))) scale(.7);  z-index: 1; }
}
@keyframes roam-c {
  0%   { transform: translate(0px, calc(-160px * var(--k, 1))) scale(.9);   z-index: 3; }
  20%  { transform: translate(calc(170px * var(--k, 1)), calc(-10px * var(--k, 1))) scale(1.1); z-index: 3; }
  40%  { transform: translate(calc(40px * var(--k, 1)), calc(30px * var(--k, 1))) scale(.6);  z-index: 1; }
  60%  { transform: translate(calc(-60px * var(--k, 1)), calc(-20px * var(--k, 1))) scale(.55); z-index: 1; }
  80%  { transform: translate(calc(-175px * var(--k, 1)), calc(-120px * var(--k, 1))) scale(.9); z-index: 3; }
  100% { transform: translate(0px, calc(-160px * var(--k, 1))) scale(.9);   z-index: 3; }
}
@keyframes roam-d {
  0%   { transform: translate(calc(-120px * var(--k, 1)), calc(140px * var(--k, 1))) scale(1);  z-index: 3; }
  30%  { transform: translate(calc(30px * var(--k, 1)), calc(10px * var(--k, 1))) scale(1.3);   z-index: 3; }
  50%  { transform: translate(calc(170px * var(--k, 1)), calc(-140px * var(--k, 1))) scale(.8); z-index: 1; }
  70%  { transform: translate(calc(-20px * var(--k, 1)), calc(-40px * var(--k, 1))) scale(.55); z-index: 1; }
  100% { transform: translate(calc(-120px * var(--k, 1)), calc(140px * var(--k, 1))) scale(1);  z-index: 3; }
}
@keyframes roam-e {
  0%   { transform: translate(calc(120px * var(--k, 1)), calc(-150px * var(--k, 1))) scale(.8); z-index: 1; }
  30%  { transform: translate(calc(-30px * var(--k, 1)), calc(60px * var(--k, 1))) scale(.6);   z-index: 1; }
  55%  { transform: translate(calc(-180px * var(--k, 1)), calc(20px * var(--k, 1))) scale(1);   z-index: 3; }
  80%  { transform: translate(calc(-10px * var(--k, 1)), calc(-60px * var(--k, 1))) scale(1.3); z-index: 3; }
  100% { transform: translate(calc(120px * var(--k, 1)), calc(-150px * var(--k, 1))) scale(.8); z-index: 1; }
}
@media (max-width: 820px) { .th-roam { --k: .6; } .th-roam img { scale: .7; } }
@media (prefers-reduced-motion: reduce) { .th-roam, .th-roam img { animation: none; } }

/* skip-count row in the alien's colour, with an alien hopping along it (site.js) */
.skip.skip-hop { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; padding: 84px 0 44px; margin-top: 8px; }
.skip-hop .sk { position: relative; min-width: 0; padding: 10px 2px 8px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--tc) 14%, #fff); color: color-mix(in srgb, var(--tc) 75%, #1d1a3a);
  border: 2px solid color-mix(in srgb, var(--tc) 55%, #fff); box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 60%, #fff);
  font: 800 18px/1 var(--head); transition: background .25s, color .25s, transform .25s; }
.skip-hop .sk b { font: inherit; }
.skip-hop .sk.lit { background: var(--tc); color: #fff; border-color: var(--tc); box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 65%, #000); }
.skip-hop .sk.bump { animation: sk-bump .35s ease; }
@keyframes sk-bump { 40% { transform: translateY(5px) scaleY(.88); } }
.skip-hop .sk-x { position: absolute; left: 50%; bottom: calc(100% + 58px); translate: -50% 0; opacity: 0; font: 800 15px var(--head); font-style: normal;
  color: #fff; background: var(--tc); padding: 3px 8px 2px; border-radius: 999px; white-space: nowrap; transition: opacity .25s, bottom .4s ease; }
.skip-hop .sk.shown .sk-x { opacity: 1; }
.skip-hop .sk.settled .sk-x { bottom: calc(100% + 8px); }
.skip-hop .sk-arrow { position: absolute; top: calc(100% + 6px); right: 50%; width: calc(100% + 12px); color: var(--tc);
  opacity: 0; transition: opacity .3s; pointer-events: none; text-align: center; font-style: normal; }
.skip-hop .sk-arrow svg { display: block; width: 100%; height: 16px; }
.skip-hop .sk-arrow small { display: block; font: 800 12.5px var(--head); margin-top: -2px; }
.skip-hop .sk.arrowed .sk-arrow { opacity: 1; }
.sk-hopper { position: absolute; left: 0; top: 0; width: 50px; z-index: 2; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
@media (max-width: 760px) {
  .skip.skip-hop { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 104px 10px; padding-top: 84px; }
  .skip-hop .sk[data-b="7"] .sk-arrow { display: none; }
  .sk-hopper { width: 42px; }
}
@media (prefers-reduced-motion: reduce) { .skip-hop .sk-x { opacity: 1; bottom: calc(100% + 8px); } .skip-hop .sk-arrow { opacity: 1; } }

/* the big hero number in its alien's colour (user), with a light rim and a glow of the same colour */
.th-art[style*="--tc"] .th-num { color: var(--tc); -webkit-text-stroke-color: color-mix(in srgb, var(--tc) 25%, #fff);
  text-shadow: 0 8px 0 color-mix(in srgb, var(--tc) 55%, #000), 0 0 30px color-mix(in srgb, var(--tc) 70%, transparent), 0 0 60px color-mix(in srgb, var(--tc) 35%, transparent); }
.th-art[style*="--tc"] .th-glow { background: radial-gradient(circle, color-mix(in srgb, var(--tc) 40%, transparent), rgba(123,97,255,.15) 45%, transparent 70%); }

/* tap an alien on the home page: a soap bubble with one of its facts floats up and pops */
.fact-bubble { position: absolute; z-index: 300; pointer-events: none; white-space: nowrap;
  padding: 14px 18px; border-radius: 999px; font: 800 20px/1 var(--head); color: color-mix(in srgb, var(--c) 75%, #1d1a3a);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.95) 0 10%, rgba(255,255,255,.55) 22%, color-mix(in srgb, var(--c) 18%, rgba(255,255,255,.35)) 60%, color-mix(in srgb, var(--c) 35%, transparent));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, #fff), inset -6px -8px 14px color-mix(in srgb, var(--c) 30%, transparent), 0 6px 16px rgba(27,23,71,.15);
  backdrop-filter: blur(1px); }
.fact-bubble::after { content: ''; position: absolute; right: 16%; top: 18%; width: 9px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.9); rotate: 35deg; }
.fact-bubble.pop { animation: bubble-pop .36s ease-out forwards; }
@keyframes bubble-pop { 40% { scale: 1.25; opacity: .8; filter: blur(.5px); } 100% { scale: 1.6; opacity: 0; filter: blur(3px); } }

/* the aliens' names: a little name tag in the alien's own colour (home stage + table cards) */
.pa-alien { display: block; }
.pa-alien img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.pa-name, .tc-name {
  position: absolute; left: 50%; translate: -50% 0; z-index: 1; white-space: nowrap; pointer-events: none;
  font: 800 13px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; color: #fff;
  background: var(--c, var(--tc)); padding: 4px 10px 3px; border-radius: 999px;
  border: 2px solid #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--c, var(--tc)) 60%, #000), 0 4px 10px rgba(27,23,71,.18);
}
.pa-name { bottom: -4%; font-size: clamp(9px, 1.25vw, 13px); }
.alien-card .tc-pic { position: relative; margin-bottom: 14px; }
.tc-name { bottom: -12px; font-size: 12.5px; padding: 4px 11px 3px; }
.alien-card:hover .tc-name { animation: tc-name-pop .4s ease; }
@keyframes tc-name-pop { 50% { scale: 1.15; } }
@media (max-width: 480px) { .tc-name { font-size: 11px; padding: 3px 8px 2px; bottom: -10px; } }
.table-card.alien-card .tc-pic span.tc-name { color: #fff; font-size: 12.5px; font-weight: 800; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
@media (max-width: 480px) { .table-card.alien-card .tc-pic span.tc-name { font-size: 11px; } }
.pa-name { text-shadow: 0 1px 0 rgba(0,0,0,.25); }

/* times-table headers use their own galaxy picture: hide the site-wide moving background layer there */
.space.table-hero::before { display: none !important; }

/* ==== curriculum frame: Stage pages, unit pages, topics, mock tests ===================== */
.stage-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.unit-search { flex: 1 1 260px; font: 700 16px var(--body); padding: 11px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.unit-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-filters button { border: 0; border-radius: 999px; padding: 8px 14px; font: 800 14px var(--body); background: var(--soft); color: var(--ink); cursor: pointer; }
.unit-filters button.on { background: var(--violet); color: #fff; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.unit-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--tc) 18%, #fff), #fff 65%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 30%, transparent), 0 5px 0 color-mix(in srgb, var(--tc) 50%, #fff); transition: transform .15s; }
.unit-card[hidden] { display: none; }
.unit-card:hover { transform: translateY(-4px); }
.uc-pic { position: absolute; right: 10px; top: 10px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tc) 20%, #fff); }
.uc-pic img { width: 88%; height: auto; }
.uc-num { font: 800 13px var(--body); letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 80%, #1d1a3a); }
.uc-title { font: 800 19px/1.2 var(--head); padding-right: 58px; min-height: 46px; }
.uc-strand { align-self: flex-start; font: 800 12px var(--body); padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 14%, #fff); color: color-mix(in srgb, var(--tc) 80%, #000); }
.uc-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line);
  font: 800 13px var(--body); color: var(--violet); }
.uc-guide { font-weight: 700; color: var(--muted); }
.unit-card.soon .uc-title { color: var(--muted); }
.unit-card.soon .uc-foot { color: var(--muted); }
.unit-none { margin-top: 14px; font-weight: 700; color: var(--muted); }
.mock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mock-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; background: #fff8e6; box-shadow: 0 0 0 2px #ffd88a, 0 5px 0 #f5c25a; }
.mock-card b { font: 800 19px var(--head); color: #7a4a00; }
.mock-card span { font-weight: 700; color: #8a6420; }
.mock-card em { font-style: normal; font-weight: 800; color: var(--muted); margin-top: 4px; }
.mock-stage { margin-bottom: 30px; }
.mock-stage h2 { margin-bottom: 14px; }
.mock-how ol { margin: 8px 0 0; padding-left: 20px; }
/* unit page */
.unit-hero-in { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.unit-guide { position: relative; width: 180px; }
.unit-guide img { width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); animation: tc-bob 3.2s ease-in-out infinite; }
.unit-guide .tc-name { bottom: -6px; font-size: 15px; }
.unit-tabs { position: sticky; top: 64px; z-index: 20; background: var(--card); box-shadow: 0 1px 0 var(--line), 0 6px 16px rgba(27,23,71,.06); }
.unit-tabs .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; }
.unit-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; text-decoration: none; font: 800 15px var(--body);
  color: color-mix(in srgb, var(--tc) 75%, #1d1a3a); background: color-mix(in srgb, var(--tc) 12%, #fff); }
.unit-tabs a:hover { background: var(--tc); color: #fff; }
.unit-body { padding-top: 28px; padding-bottom: 48px; }
.unit-sec { scroll-margin-top: 140px; margin-bottom: 18px; padding: 20px 22px; border-radius: 22px; background: var(--card);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 22%, transparent); }
.unit-sec-head { display: flex; gap: 14px; align-items: flex-start; }
.unit-sec-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--tc) 16%, #fff); }
.unit-sec h2 { margin: 0; font-size: 24px; color: color-mix(in srgb, var(--tc) 70%, #1d1a3a); }
.unit-sec-head p { margin: 2px 0 0; color: var(--muted); font-weight: 700; }
.unit-soon { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--tc) 35%, #fff); font-weight: 800; color: var(--muted); }
/* topics */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.topic-card { padding: 20px 22px; border-radius: 22px; background: radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--tc) 16%, #fff), #fff 60%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 30%, transparent), 0 6px 0 color-mix(in srgb, var(--tc) 45%, #fff); }
.topic-head { display: flex; gap: 12px; align-items: flex-start; }
.topic-head img { width: 64px; margin-left: auto; }
.topic-icon { font-size: 30px; }
.topic-head h2 { margin: 0; font-size: 22px; color: color-mix(in srgb, var(--tc) 70%, #1d1a3a); }
.topic-head p { margin: 4px 0 0; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.topic-card ul { margin: 14px 0 0; padding-left: 18px; }
.topic-card li { margin-bottom: 6px; font-weight: 700; }
@media (max-width: 700px) {
  .unit-hero-in { grid-template-columns: 1fr; }
  .unit-guide { width: 120px; order: -1; }
  .unit-tabs { top: 56px; }
}

/* ==== Version 2: hub, maths, my lessons, coming soon ===================================== */
.hub-hero .hub-art { height: 340px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hub-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px; min-height: 170px; border-radius: 24px; overflow: hidden;
  text-decoration: none; color: var(--ink); background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--tc) 22%, #fff), #fff 62%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 32%, transparent), 0 6px 0 color-mix(in srgb, var(--tc) 50%, #fff); transition: transform .15s; }
.hub-card:hover { transform: translateY(-4px); }
.hub-card .hc-icon { font-size: 30px; }
.hub-card b { font: 800 24px var(--head); color: color-mix(in srgb, var(--tc) 72%, #1d1a3a); padding-right: 70px; }
.hub-card > span:not(.hc-icon):not(.hc-soon) { font-weight: 700; color: var(--muted); padding-right: 64px; }
.hub-card .hc-alien { position: absolute; right: 10px; bottom: 8px; width: 82px; filter: drop-shadow(0 6px 6px rgba(27,23,71,.18)); transition: transform .25s; }
.hub-card:hover .hc-alien { transform: rotate(-8deg) scale(1.08); }
.hc-soon { position: absolute; right: 12px; top: 12px; font: 800 11.5px var(--body); letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--tc); padding: 4px 9px; border-radius: 999px; }
.hub-card.soon b { color: var(--muted); }
.unit-grid-mini .unit-card { min-height: 0; }
.uc-vi { font-weight: 700; font-size: 13px; color: var(--muted); padding-right: 58px; }
.unit-vi { opacity: .85; margin-top: -6px; }
.unit-link { margin: 12px 0 0; font-weight: 800; }
.soon-in { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 700px) { .soon-in { grid-template-columns: 1fr; } }
/* My lessons */
.my-page .wrap { display: grid; gap: 18px; }
.my-row { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
@media (max-width: 900px) { .my-row { grid-template-columns: 1fr; } }
.my-card { background: var(--card); border-radius: 22px; padding: 18px 20px; box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(27,23,71,.06); min-width: 0; }
.my-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.my-head h2 { margin: 0; font-size: 21px; }
.my-head p { margin: 2px 0 0; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.my-edit { border: 0; background: var(--soft); border-radius: 10px; padding: 6px 9px; cursor: pointer; }
.goal-tiles, .exam-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.exam-tiles { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .goal-tiles { grid-template-columns: 1fr 1fr; } }
.goal-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
.goal-tile span { font-weight: 700; color: var(--muted); font-size: 13.5px; }
.goal-tile b { font: 800 26px var(--head); color: var(--ink); }
.goal-tile.big { background: #fff1ec; border-color: #ffd5c6; }
.goal-tile.big b { font-size: 40px; color: #f05a28; }
.goal-tile b.met { color: #1f9c70; }
.goal-tile input { font: 800 20px var(--head); width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 4px 8px; color: var(--ink); background: #fff; }
.goal-save { margin-top: 10px; }
.cal-legend { font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2ec27e; vertical-align: -1px; }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
.cal-nav b { font: 800 19px var(--head); min-width: 170px; text-align: center; }
.cal-nav button { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-weight: 800; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.cal-d { position: relative; border: 0; background: none; border-radius: 12px; padding: 10px 0; font: 700 16px var(--body); color: var(--ink); cursor: pointer; }
.cal-d:hover { background: var(--soft); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--violet); }
.cal-d.on { background: #e8faf1; color: #157a56; }
.cal-d i { position: absolute; left: 50%; bottom: 3px; translate: -50% 0; width: 6px; height: 6px; border-radius: 50%; background: #2ec27e; }
.cal-day { min-height: 1.4em; margin: 10px 0 0; font-weight: 700; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.week-table, .hist-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.week-table th, .week-table td, .hist-table th, .hist-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.week-table thead th, .hist-table thead th { background: var(--soft); font-weight: 800; }
.week-table tbody th { text-align: left; font-weight: 700; }
.week-table tfoot th, .week-table tfoot td { border-top: 2px solid var(--ink); font-weight: 800; }
.hist-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hist-tabs button { border: 0; border-radius: 999px; padding: 8px 14px; font: 800 14px var(--body); background: var(--soft); color: var(--ink); cursor: pointer; }
.hist-tabs button.on { background: #ffe8e0; color: #e04a1a; }
.hist-table .h-ok { background: #1f9c70; color: #fff; }
.hist-table td.h-name { text-align: left; white-space: normal; min-width: 220px; font-weight: 700; }
.hist-table td small { display: block; color: var(--muted); font-size: 12px; }
.h-kind { display: block; font: 800 11px var(--body); letter-spacing: .05em; text-transform: uppercase; color: var(--violet); }
.pill { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 50%; font-weight: 800; background: #f1f1f5; color: var(--muted); }
.pill.ok { background: #e3f8ee; color: #1f9c70; }
.pill.no { background: #ffe6e1; color: #e0573a; }
.h-pct { min-width: 110px; }
.h-pct .bar { display: block; height: 7px; border-radius: 999px; background: #eceef3; margin-top: 4px; overflow: hidden; }
.h-pct .bar i { display: block; height: 100%; background: #3fbf7f; border-radius: inherit; }
.hist-empty { font-weight: 700; color: var(--muted); }
.hub-hero .hub-art { height: auto; }
.hub-hero .hub-art .promo-party { max-width: 460px; margin-left: auto; }
.hub-hero .pa-bubble { color: var(--violet); }
@media (max-width: 820px) { .hub-hero .hub-art { order: -1; } .hub-hero .hub-art .promo-party { margin: 0 auto; max-width: 360px; } }

/* Maths hub: the five areas in one row */
.hub-grid.hub-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.hub-grid-5 .hub-card { padding: 16px 14px 92px; min-height: 230px; }
.hub-grid-5 .hub-card b { font-size: 20px; padding-right: 0; }
.hub-grid-5 .hub-card > span:not(.hc-icon):not(.hc-soon) { padding-right: 0; font-size: 14px; }
.hub-grid-5 .hub-card .hc-alien { width: 74px; right: 50%; translate: 50% 0; }
@media (max-width: 1000px) { .hub-grid.hub-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hub-grid.hub-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* header: "Times tables" opens a small menu (all 12 tables, word problems, worksheets) */
.nav-drop { position: relative; }
.nav-menu { display: none; position: absolute; left: 0; top: 100%; z-index: 60; min-width: 230px; padding: 8px; border-radius: 16px;
  background: var(--space-1); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.nav-menu a { display: block; padding: 9px 12px !important; border-radius: 10px; }
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu { display: block; }
@media (max-width: 1180px) {
  .nav-drop .nav-menu { display: block; position: static; box-shadow: none; padding: 0 0 0 14px; background: none; min-width: 0; }
}

/* ==== unit Practise / Revise (practice.js) ============================================= */
.practice { margin-top: 14px; }
.pr-loading { font-weight: 700; color: var(--muted); }
.pr-head, .pr-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; }
.pr-head b, .pr-intro b { font: 800 18px var(--head); color: color-mix(in srgb, var(--tc) 70%, #1d1a3a); }
.pr-head span, .pr-intro span { font-weight: 700; color: var(--muted); flex: 1 1 260px; }
.pr-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pr-levels-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 14px; }
.pr-level { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border-radius: 16px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--tc) 30%, #fff); background: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 35%, #fff); font: inherit; color: var(--ink); }
.pr-level:hover { transform: translateY(-2px); }
.pr-level.basic { background: #f2fbf6; } .pr-level.developing { background: #fffaee; } .pr-level.advanced { background: #fff2f4; }
.pr-level.current { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, #fff); }
.pr-ln { font: 800 17px var(--head); }
.pr-band { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pr-best { margin-top: 4px; font-weight: 800; font-size: 13.5px; color: var(--violet); }
.pr-level.passed { border-color: #1f9c70; }
.pr-level.passed .pr-best { color: #1f9c70; }
.pr-level.locked { opacity: .55; cursor: not-allowed; }
.pr-level.shake { animation: shake .42s; }
.pr-round { border-radius: 18px; padding: 16px 18px; background: color-mix(in srgb, var(--tc) 6%, #fff); border: 2px solid color-mix(in srgb, var(--tc) 22%, #fff); }
.pr-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pr-top b { font: 800 18px var(--head); }
.pr-count { color: var(--muted); font-weight: 700; flex: 1; }
.pr-quit { border: 0; background: none; color: var(--muted); font-weight: 800; cursor: pointer; }
.pr-bar { height: 8px; border-radius: 999px; background: #fff; margin: 10px 0 14px; overflow: hidden; }
.pr-bar i { display: block; height: 100%; width: 0; background: var(--tc); transition: width .3s; }
.pr-type { display: inline-block; font: 800 11.5px var(--body); letter-spacing: .05em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 80%, #000); background: color-mix(in srgb, var(--tc) 14%, #fff); padding: 3px 9px; border-radius: 999px; }
.pr-text { font: 800 21px/1.35 var(--head); margin: 10px 0 12px; }
.pr-in { width: 100%; max-width: 420px; font: 800 20px var(--head); padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
textarea.pr-in { max-width: 100%; font-size: 17px; resize: vertical; }
.pr-in.pr-empty { border-color: var(--coral); }
.pr-in.ok { border-color: #1f9c70; background: #e9f9f1; } .pr-in.no { border-color: #e0573a; background: #fff0ec; }
.pr-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pr-opts button { padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font: 800 18px var(--head); cursor: pointer; color: var(--ink); }
.pr-opts button.ok { border-color: #1f9c70; background: #e9f9f1; color: #157a56; }
.pr-opts button.no { border-color: #e0573a; background: #fff0ec; color: #b03030; }
.pr-actions { margin-top: 12px; }
.pr-feedback:empty { display: none; }
.pr-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pr-feedback.ok { background: #e9f9f1; color: #157a56; } .pr-feedback.no { background: #fff0ec; color: #8a2a1a; } .pr-feedback.model { background: #fffaee; color: #6a4a00; }
.pr-why { flex-basis: 100%; font-weight: 600; color: var(--ink); opacity: .8; }
.pr-self { flex-basis: 100%; display: flex; gap: 8px; align-items: center; }
.pr-next { margin-left: auto; }
.pr-done { text-align: center; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--tc) 8%, #fff); }
.pr-done.pass { background: #eefaf3; }
.pr-score { font: 800 60px/1 var(--head); color: var(--tc); }
.pr-score small { font-size: 26px; color: var(--muted); }
.pr-done h3 { margin: 6px 0; font-size: 24px; }
.pr-done p { color: var(--muted); font-weight: 700; }
.pr-done .btn-row { justify-content: center; }
.ex-list { display: grid; gap: 12px; }
.ex-card { padding: 14px 16px; border-radius: 16px; background: #fff; border: 2px solid color-mix(in srgb, var(--tc) 22%, #fff); }
.ex-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 6px; }
.ex-n { font: 800 12px var(--body); letter-spacing: .05em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 80%, #000); }
.ex-card header b { font: 800 18px var(--head); flex: 1; }
.ex-lvl { font-weight: 800; font-size: 12.5px; color: var(--muted); }
.ex-card p { margin: 3px 0; font-weight: 600; }
.ex-card details { margin-top: 8px; }
.ex-card summary { font-weight: 800; color: var(--violet); cursor: pointer; }
.ex-ans { padding: 8px 12px; border-radius: 12px; background: #e9f9f1; color: #157a56; font-weight: 700; }

/* ---- unit worksheets online (unit-sheets.js), like the times-table sheets */
.us-tools select { max-width: 340px; }
.us-dl { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.us-dl[hidden], .us-count[hidden] { display: none; }
.us-sheet { max-width: 900px; color: #2b2346; }
.us-sheet .sheet-titles h2 { color: #2b2346; }
.us-badge { font-size: 22px !important; letter-spacing: -2px; }
.us-body { counter-reset: uq; font-family: var(--head); }
.us-h { font: 800 18px var(--head); color: var(--ws-c); margin: 18px 0 10px; }
.us-tip { font-weight: 700; color: #5b5277; margin: 4px 0 10px; }
.us-grid { display: grid; gap: 12px; }
.us-grid.g4 { grid-template-columns: repeat(4, 1fr); } .us-grid.g3 { grid-template-columns: repeat(3, 1fr); } .us-grid.g2 { grid-template-columns: repeat(2, 1fr); }
.us-q { position: relative; }
.us-cell { border: 2px solid color-mix(in srgb, var(--ws-c) 40%, #fff); border-radius: 16px; padding: 28px 8px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.us-cell::before, .us-eq::before { counter-increment: uq; content: counter(uq); position: absolute; left: 8px; top: 7px; background: var(--ws-c); color: #fff;
  font: 800 12px/20px var(--head); border-radius: 99px; min-width: 20px; height: 20px; text-align: center; padding: 0 5px; }
.us-eq { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px 10px 38px; border-radius: 14px; background: color-mix(in srgb, var(--ws-c) 9%, #fff); font-size: 20px; }
.us-eq::before { top: 50%; translate: 0 -50%; }
.us-eq b { white-space: nowrap; }
.us-of { white-space: nowrap; font-weight: 800; }
.us-body .fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; font-weight: 800; margin: 0 .15em; font-size: 20px; }
.us-body .fr > b:first-child, .us-body .fr > .blank:first-child { border-bottom: 2.5px solid currentColor; padding: 0 .2em 2px; margin-bottom: 2px; }
.us-frac { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.us-frac i { display: block; width: 64px; border-top: 3px solid #2b2346; }
.us-pic { height: 110px; display: grid; place-items: center; } .us-pic svg { max-width: 100%; max-height: 104px; }
.us-cell.cmp { flex-direction: row; gap: 14px; flex-wrap: wrap; }
.us-bars { display: flex; flex-direction: column; gap: 8px; } .us-bars svg { width: 150px; height: auto; }
.us-cmp { display: flex; align-items: center; gap: 8px; }
.us-say { font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.us-clock { max-width: 100%; height: auto; }
.us-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 2px solid var(--ws-c); border-radius: 16px; overflow: hidden; }
.us-table th, .us-table td { padding: 8px 10px; text-align: center; border-right: 1.5px solid color-mix(in srgb, var(--ws-c) 30%, #fff); border-bottom: 1.5px solid color-mix(in srgb, var(--ws-c) 30%, #fff); }
.us-table tr > :last-child { border-right: 0; } .us-table tbody tr:last-child > * { border-bottom: 0; }
.us-table thead th { background: var(--ws-c); color: #fff; font: 800 15px var(--head); }
.us-table tbody th { background: color-mix(in srgb, var(--ws-c) 9%, #fff); text-align: left; }
.us-table td.clue { width: 34%; font-weight: 700; } .us-table td.clue small { display: block; color: #5b5277; font-weight: 800; }
.us-table .given { font-size: 19px; color: var(--ws-c); }
.us-table td .us-q { display: inline-block; }
/* in tables, timelines and question lines the right answer goes just under the child's answer */
.us-table td .us-q > .ws-fix, .us-trail .us-q > .ws-fix, .us-line > .ws-fix, .us-bank li > .ws-fix {
  position: static; display: table; translate: none; margin: 6px auto 0; font-size: 15px; padding: 3px 10px; white-space: nowrap; }
.us-line > .ws-fix, .us-bank li > .ws-fix { margin: 6px 0 0; white-space: normal; }
.us-table td .us-q > .ws-sticker, .us-trail .us-q > .ws-sticker { top: 50%; right: -28px; translate: 0 -50%; }
.us-two { display: grid; grid-template-columns: 280px 1fr; gap: 22px; align-items: start; }
.us-lines { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 14px; font-weight: 700; }
.us-line { padding-right: 40px; }
.us-write { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.us-line > .ws-sticker, .us-bank li > .ws-sticker { top: 8px; right: 10px; margin: 0; }
.us-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; }
.us-trail .stop { border: 2.5px solid var(--ws-c); border-radius: 16px; padding: 12px 10px; min-width: 150px; text-align: center; font: 800 18px var(--head); }
.us-trail .stop.first { background: var(--ws-c); color: #fff; } .us-trail .stop small { display: block; font-size: 12px; }
.us-trail .hop { font: 800 14px var(--head); color: var(--ws-c); white-space: nowrap; }
.us-cell.col { padding-top: 24px; }
.us-carry-lab { font: 800 11px var(--head); color: #8a83a3; }
.us-col { border-collapse: collapse; font: 800 26px var(--head); }
.us-col td { width: 40px; height: 44px; text-align: center; padding: 0; }
.us-col tr.carry td { height: 26px; }
.us-col input.carry { width: 22px; height: 22px; border: 0; border-bottom: 1.5px dashed #cfc8e3; border-radius: 0; text-align: center; font: 700 14px var(--head); color: #8a83a3; background: transparent; }
.us-col tr.op td { border-bottom: 3px solid #2b2346; } .us-col .sign { color: var(--ws-c); }
.us-col tr.res td { padding-top: 6px; }
.us-body .ans.digit { width: 34px !important; height: 42px; padding: 0; font-size: 24px; border: 2px solid #2b2346; border-radius: 8px; }
.us-body .blank { display: inline-block; position: relative; }
.us-body .blank em { display: none; font-style: normal; }
.us-sheet.show-answers .us-body .blank em { display: inline-block; min-width: 48px; padding: 2px 8px; border-bottom: 2px solid #333; color: #157a56; font: 800 20px var(--head); text-align: center; }
.us-sheet.show-answers .us-body .blank .ans { display: none; }
.us-body select.ans { width: auto; font: 800 20px var(--head); padding: 2px 6px; border: 0; border-bottom: 2px solid #333; border-radius: 8px 8px 0 0; background: #f4f1ff; color: var(--violet); }
.us-body select.ans.ok { background: #dcf7ec; color: #157a56; } .us-body select.ans.no { background: #ffe1e1; color: #b03030; }
.us-body textarea.ans { width: min(100%, 520px) !important; font: 600 16px/1.4 var(--body); text-align: left; border-radius: 10px; border: 2px solid #d8d2ec; }
.us-bank { list-style: none; counter-reset: bq; margin: 0; padding: 0; display: grid; gap: 10px; }
.us-bank li { counter-increment: bq; position: relative; padding: 10px 50px 12px 46px; border-radius: 16px; background: color-mix(in srgb, var(--ws-c) 8%, #fff); }
.us-bank li::before { content: counter(bq); position: absolute; left: 12px; top: 11px; background: var(--ws-c); color: #fff; font: 800 13px/24px var(--head); border-radius: 99px; min-width: 24px; height: 24px; text-align: center; }
.us-bank li p { margin: 0; font: 700 17px/1.45 var(--body); }
.us-q > .ws-sticker { right: 6px; top: 4px; margin: 0; font-size: 24px; z-index: 3; }
.us-cell > .ws-fix { top: 5px; bottom: auto; right: 8px; translate: none; font-size: 15px; padding: 3px 8px; z-index: 3; white-space: nowrap; }
.us-eq > .ws-sticker { top: -10px; right: 4px; }
.us-eq > .ws-fix { top: -12px; bottom: auto; right: 6px; translate: none; font-size: 14px; padding: 2px 8px; z-index: 3; white-space: nowrap; }
.ws-fix.model { position: static; display: block; margin-top: 8px; translate: none; font-size: 15px; border-radius: 12px; background: #eef3ff; color: #2b4a9c; border-color: #8fa6e0; white-space: normal; }
.ws-fix.model::before { content: ''; }
.us-ex .ex-card { margin-bottom: 12px; }
.us-sheet:not(.show-answers) .us-ex .ex-ans { display: none; }
@media (max-width: 760px) {
  .us-grid.g4 { grid-template-columns: repeat(2, 1fr); } .us-grid.g3 { grid-template-columns: repeat(2, 1fr); }
  .us-two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .us-grid.g2, .us-grid.g3 { grid-template-columns: 1fr; } .us-table th, .us-table td { padding: 6px 4px; } }
@media print {
  body.us-printing .unit-tabs, body.us-printing .pager, body.us-printing .unit-sec:not(.print-me), body.us-printing .unit-sec-head { display: none !important; }
  .us-sheet { border-top-width: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .us-cell, .us-eq, .us-bank li, .us-table tr { break-inside: avoid; }
  .us-col input.carry { border-color: #ddd; }
}

/* ---- unit worksheets: straighter numbers, exercises, rainbows, Venn diagrams (2026-11-10) */
.us-body { font-variant-numeric: tabular-nums; }
.us-eq.cmpq { display: grid; grid-template-columns: 1fr auto 1fr; justify-items: stretch; }
.us-eq.cmpq > b:first-of-type { text-align: right; } .us-eq.cmpq > b:last-of-type { text-align: left; }
.us-eq.divq { display: grid; grid-template-columns: 1fr auto; } .us-eq.divq > b { text-align: right; }
.us-words { flex-basis: 100%; font: 700 16px/1.4 var(--body); }
.us-eq.wide { flex-wrap: wrap; }
.us-comma { font: 800 20px var(--head); margin: 0 1px; align-self: flex-end; }
.us-mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--ws-c) 8%, #fff); margin-bottom: 12px; }
.us-mlab { min-width: 230px; font: 800 17px var(--head); }
.us-mrow > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.us-given { display: inline-grid; place-items: center; width: 58px; height: 40px; border: 2px solid var(--ws-c); border-radius: 8px; font: 800 20px var(--head); color: var(--ws-c); background: #fff; }
.us-mb { display: inline-block; }
.us-mb > .ws-fix, .ex-b > .ws-fix { top: 100%; right: auto; left: 0; translate: 0 2px; font-size: 13px; padding: 1px 7px; z-index: 3; white-space: nowrap; }
.us-mb > .ws-sticker, .ex-b > .ws-sticker { top: -12px; right: -10px; font-size: 18px; }
.us-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 800 20px var(--head); }
.us-pic.wide { width: 100%; height: auto; }
.us-vis { margin: 6px 0 4px; }
.us-nl { max-width: 380px; display: block; }
.us-gridm { border-collapse: collapse; }
.us-gridm th, .us-gridm td { border: 2px solid #2b2346; padding: 6px 16px; font: 800 18px var(--head); text-align: center; }
.us-gridm th { background: color-mix(in srgb, var(--ws-c) 12%, #fff); }
/* factor rainbow */
.us-rainbow { position: relative; margin: 6px auto 0; max-width: 100%; }
.us-rainbow svg { display: block; }
.rb-target { position: absolute; bottom: 8px; translate: -50% 0; background: var(--ws-c); color: #fff; border-radius: 10px; padding: 2px 8px; font: 800 18px var(--head); }
.rb-box { position: absolute; }
.rb-box .pairbox { width: 34px; height: 34px; text-align: center; font: 800 16px var(--head); border: 2px solid #2b2346; border-radius: 7px; padding: 0; background: #f4f1ff; color: var(--violet); }
.us-sheet.show-answers .rb-box .pairbox { display: none; }
.us-sheet.show-answers .us-body .rb-box em { min-width: 34px; padding: 6px 0; font-size: 15px; border: 2px solid #1f9c70; border-radius: 7px; background: #dcf7ec; }
.us-cell.rb { overflow-x: auto; }
.us-rainbow .ans.ok ~ * , .us-rainbow:has(.ans.ok) .pairbox { background: #dcf7ec; border-color: #1f9c70; color: #157a56; }
.us-rainbow:has(.ans.no) .pairbox { background: #ffe1e1; border-color: #c94a4a; color: #b03030; }
/* Venn diagram: tap a card, then tap where it goes */
.us-venn { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.us-cell.vn { overflow-x: auto; align-items: center; }
.us-vq { margin: 0; align-self: flex-start; font-weight: 800; }
.vd { position: relative; width: 380px; flex: none; }
.vd svg { display: block; }
.vz { position: absolute; translate: -50% -50%; width: 78px; min-height: 56px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-content: center; border-radius: 14px; cursor: pointer; }
.vz:hover, .vz:focus-visible { background: color-mix(in srgb, var(--ws-c) 14%, transparent); outline: none; }
.us-venn.three .vz { width: 58px; min-height: 40px; }
.vz.out { position: static; translate: none; width: min(380px, 100%); min-height: 48px; border: 2px dashed #b9b2cf; padding: 6px; }
.vz.out span { width: 100%; text-align: center; font: 700 12px var(--body); color: #8a83a3; }
.v-tray { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px; border: 2px solid color-mix(in srgb, var(--ws-c) 40%, #fff); border-radius: 12px; min-height: 48px; width: min(380px, 100%); background: #fff; }
.v-tray:empty::after { content: 'All cards placed ✓'; font: 700 13px var(--body); color: #8a83a3; align-self: center; }
.v-tile { font: 800 16px var(--head); border: 2px solid #2b2346; background: #fff; color: #2b2346; border-radius: 8px; padding: 3px 9px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.vz .v-tile { font-size: 13px; padding: 1px 6px; }
.v-tile.picked { background: #fff6d6; border-color: var(--ws-c); transform: translateY(-3px); box-shadow: 0 4px 0 var(--ws-c); }
.us-venn:has(.ans.ok) .vz .v-tile { border-color: #1f9c70; background: #dcf7ec; }
.us-venn:has(.ans.no) .vz .v-tile { border-color: #c94a4a; }
.venn-key { display: none; }
.us-sheet.show-answers .venn-key { display: block; font: 700 14px var(--body); font-style: normal; color: #157a56; text-align: center; }
.us-cell.vn > .ws-fix { position: static; display: block; translate: none; margin: 6px auto 0; white-space: normal; font-size: 14px; }
/* exercise cards with boxes */
.us-ex .ex-card p { line-height: 1.9; }
.ex-line { line-height: 2.5 !important; }
.ex-write { margin: 8px 0 12px; } .ex-write > p { margin: 0 0 4px; }
.ex-b { display: inline-block; vertical-align: middle; margin: 2px 4px; }
.ex-b .ans { font-size: 18px; }
.ex-table td .us-q { display: inline-block; }
.ex-b.open textarea.ans, .ex-write textarea.ans { width: min(100%, 560px) !important; }
.us-sheet.checked:not(.show-answers) .us-ex .ex-card.has-open .ex-ans { display: block; }
@media print {
  @page { size: A4; margin: 10mm; }
  body.us-pdf .sheet { box-shadow: none; }
  body.us-pdf .ws-walker { display: none; }
  .us-cell, .us-mrow, .ex-card, .us-venn { break-inside: avoid; }
}

.us-rainbow .rb-box { position: absolute; display: block; }
.us-cell.rb { overflow: visible; }

.ex-line.ex-cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; max-width: 640px; }
.ex-line.ex-cmp > span:first-child { text-align: right; }
.ex-write .ex-b.open, .ex-write .ex-b.open .blank { display: block; }
.ex-write .ex-b.open .ans { width: min(100%, 560px) !important; }

@media print {
  body.us-printing .unit-body.wrap { max-width: none; padding: 0; margin: 0; }
  body.us-printing .unit-sec { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  body.us-printing .us-sheet { max-width: 100%; width: 100%; padding: 14px 16px; border-radius: 0; }
  .us-cell.rb .us-rainbow { zoom: .78; }
  .us-cell.vn .us-venn { zoom: .82; }
  .us-cell.vn { padding-top: 22px; }
}

.us-mrow .ans { height: 40px; border: 2px solid #2b2346; border-radius: 8px; }

/* ---- 2026-11-10 (2): number badges on the first line, red underlined digits, tick-box choices, aligned gaps */
.us-eq { padding-left: 44px; }
.us-eq::before { top: 13px; translate: none; }
.us-eq.wide { align-items: flex-start; }
.us-body u, .us-ex u { color: #e11d48; text-decoration-color: #e11d48; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.mc { display: block; }
.mc-opts { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.mc-opts label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 2px solid #d8d2ec; border-radius: 999px; background: #fff; font: 700 17px var(--body); cursor: pointer; }
.mc-opts input { width: 20px; height: 20px; accent-color: var(--ws-c); margin: 0; }
.mc-opts label:has(input:checked) { border-color: var(--ws-c); background: color-mix(in srgb, var(--ws-c) 10%, #fff); }
.mc:has(.ans.ok) label:has(input:checked) { border-color: #1f9c70; background: #dcf7ec; color: #157a56; }
.mc:has(.ans.no) label:has(input:checked) { border-color: #c94a4a; background: #ffe1e1; color: #b03030; }
.us-sheet.show-answers .us-body .mc em { display: block; margin-top: 6px; width: max-content; }
.ex-b.mcq { display: block; margin: 4px 0; }
.ex-items { border-collapse: collapse; margin: 4px 0 8px; }
.ex-items td { padding: 6px 6px; vertical-align: middle; }
.ex-items td.t { white-space: nowrap; }
.ex-items td.b { padding-right: 22px; }
.ex-items td.after { color: #5b5277; }
@media (max-width: 700px) { .ex-items td.t { white-space: normal; } .ex-items, .ex-items tbody, .ex-items tr { display: block; } .ex-items td { display: inline-block; } }
.us-eq { padding-left: 12px; }
.us-eq::before { position: static; translate: none; flex: none; align-self: center; margin-right: 2px; }
.us-eq.wide::before { align-self: flex-start; margin-top: 1px; }
.us-eq.wide .us-words { flex-basis: calc(100% - 40px); flex-grow: 1; }
.us-eq.wide > .blank { margin-left: 36px; }
.us-eq.cmpq { grid-template-columns: auto 1fr auto 1fr; }
.us-eq.divq { grid-template-columns: auto 1fr auto; }

.us-hint { margin: 2px 0 0 !important; font: 700 14px var(--body) !important; color: #5b5277; }
.us-table thead th small { display: block; font: 700 11px var(--body); opacity: .9; }

.us-table thead th small { color: #fff; font-size: 12px; }

/* clue column: one text style for words, clock labels and 'look along the row' (user: same format in a table) */
.us-table td.clue { display: table-cell; text-align: center; }
.us-table td.clue b, .us-table td.clue small, .us-table .given { display: block; font: 700 16px/1.4 var(--head); color: #2b2346; text-align: center; }
.us-table td.clue .us-clock { display: block; margin: 0 auto 4px; }

/* ---- unit test mode (unit-sheets.js data-mode="test") */
.usheet.is-test .us-pick, .usheet.is-test .us-count, .usheet.is-test [data-act="answers"] { display: none !important; }
.us-timer { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: #fff; border: 2px solid var(--line, #d8d2ec); font: 800 18px var(--head); color: #2b2346; }
.us-timer[hidden] { display: none; }
.us-timer.low { border-color: #e11d48; color: #e11d48; animation: us-pulse 1s ease-in-out infinite; }
@keyframes us-pulse { 50% { transform: scale(1.06); } }

/* ---- unit tests: school-paper layout (Question n, a/b/c parts, marks) */
.usheet.is-test .us-pick { display: inline-flex !important; }
.ut-sec { border: 2px solid color-mix(in srgb, var(--ws-c) 40%, #fff); border-radius: 16px; margin: 0 0 16px; overflow: hidden; break-inside: avoid; }
.ut-h { margin: 0; padding: 10px 16px; background: color-mix(in srgb, var(--ws-c) 12%, #fff); font: 800 17px var(--head); color: #2b2346; }
.ut-h span { color: var(--ws-c); font-size: 14px; }
.ut-parts { display: grid; }
.ut-parts.two { grid-template-columns: 1fr 1fr; }
.ut-part { display: flex; gap: 10px; padding: 12px 16px; border-top: 1.5px solid color-mix(in srgb, var(--ws-c) 22%, #fff); }
.ut-parts.two .ut-part:nth-child(even) { border-left: 1.5px solid color-mix(in srgb, var(--ws-c) 22%, #fff); }
.ut-l { font: 800 16px var(--head); color: var(--ws-c); min-width: 22px; }
.ut-in { flex: 1; min-width: 0; }
.ut-in p { margin: 0 0 8px; font: 700 16px/1.45 var(--body); }
.ut-big { font: 800 22px var(--head); margin-right: 10px; }
.ut-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ut-squares { display: flex; align-items: flex-end; gap: 18px; margin: 6px 0 10px; }
.ut-next { display: grid; place-items: center; width: 60px; height: 60px; border: 2px dashed var(--ws-c); border-radius: 8px; font: 800 26px var(--head); color: var(--ws-c); }
.ut-part > .ws-fix { top: 8px; bottom: auto; right: 10px; translate: none; font-size: 14px; padding: 2px 8px; }
.ut-part > .ws-sticker { top: 6px; right: 8px; }
.ut-part.open > .ws-fix.model { position: static; }
.ut-help { margin-top: 10px; padding: 10px 14px; border: 2px dashed color-mix(in srgb, var(--ws-c) 40%, #fff); border-radius: 14px; }
.ut-help .us-nl { max-width: 100%; }
.ut-mk { color: var(--ws-c); font-weight: 800; font-size: 14px; white-space: nowrap; }
.ut-pool .ut-item { padding-right: 16px; }
.ut-pool .ut-ans { position: relative; margin-top: 6px; }
.ut-pool .ut-ans > .ws-fix { top: auto; bottom: 4px; right: 4px; translate: none; }
@media (max-width: 700px) { .ut-parts.two { grid-template-columns: 1fr; } .ut-parts.two .ut-part:nth-child(even) { border-left: 0; } }

.ut-help .us-nl { max-width: 560px; margin: 4px auto 0; }

@media print { .ut-sec { break-inside: auto; } .ut-part, .ut-h { break-inside: avoid; } .ut-h { break-after: avoid; } }
.us-score[hidden] { display: none; }

/* ---- reading font for worksheets and tests (user: the old text was too bold) — Lexend, made for easy reading */
.us-sheet .us-body, .us-sheet .us-how, .us-bank li p, .ut-in p, .us-ex .ex-card p, .us-lines, .ex-items td, .us-table td, .us-table tbody th,
.mc-opts label, .us-hint, .us-tip, .us-words, .ws-result, .us-help { font-family: "Lexend", system-ui, sans-serif !important; font-weight: 400 !important; }
.us-sheet .us-body b, .us-sheet .us-body strong, .us-eq, .us-seq, .us-say, .us-of, .us-mlab, .ut-big, .us-given, .us-col, .us-body .fr,
.us-table .given, .us-table td.clue b, .us-table td.clue small, .us-trail .stop, .v-tile, .rb-target { font-family: "Lexend", system-ui, sans-serif !important; font-weight: 600 !important; }
.us-sheet .ans, .us-body select.ans, .pairbox { font-family: "Lexend", system-ui, sans-serif !important; font-weight: 500 !important; }
.us-bank li p, .ut-in p { font-size: 17px; line-height: 1.55; }
.ws-result { font-weight: 600 !important; }
/* the green right answer goes under a multiple-choice question, never on top of the choices */
.ut-pool .ut-ans > .ws-fix, .us-q:has(> .blank.mc) > .ws-fix, .us-bank li:has(.mc) > .ws-fix { position: static; display: table; translate: none; margin: 8px 0 0; }
.ut-part > .ws-fix { position: static; translate: none; align-self: flex-start; margin-left: auto; white-space: nowrap; }
.usheet.is-test [data-act="answers"] { display: inline-flex !important; }

.us-vis .us-nl { max-width: min(100%, 560px); }

/* ---- thinner, child-friendly text (user: "too bold"): only the light weights are loaded (Baloo 2 500–600,
   Lexend 300–500) and the browser must not fake bold, so every heading and label is lighter, nothing else changes */
html { font-synthesis: none; font-synthesis-weight: none; }
body { font-weight: 400; }
/* the green right answer: the same size as the child's answer box */
.ws-fix { font: 500 18px/1.25 "Lexend", system-ui, sans-serif !important; padding: 6px 12px !important; border-radius: 10px !important; border-width: 2px !important; }
.us-body .ans, .sheet .ans { font-size: 18px; }
.ws-fix.model { font-size: 15px !important; }
/* "Two ones are two. (1 + 1 = 2)" */
.aloud-sum { color: var(--muted, #6b6585); font-weight: 400; white-space: nowrap; }

/* ---- word problems: one problem at a time, 5 per challenge; one Choose row + one Calculate line per step */
.wp-grid.wp-one { grid-template-columns: minmax(0, 760px); justify-content: center; }
.wp-play { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 14px; font: 600 16px var(--head); }
.wp-dots { display: inline-flex; gap: 8px; }
.wp-dots i { width: 16px; height: 16px; border-radius: 50%; background: #e6e1f5; border: 2px solid #cfc8e3; }
.wp-dots i.now { border-color: var(--violet); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 25%, transparent); }
.wp-dots i.ok { background: #1f9c70; border-color: #1f9c70; } .wp-dots i.no { background: #e46c6c; border-color: #c94a4a; }
.wp-gems { padding: 4px 12px; border-radius: 999px; background: #fff6d6; border: 2px solid var(--gold); }
.wp-setpick { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.wp-setpick select { padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line, #d8d2ec); font: 500 15px var(--body); max-width: 340px; }
.wp-ops { display: grid; gap: 8px; flex: 1 1 100%; }
.wp-oprow { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px; align-items: center; }
.wp-ops.multi .wp-oprow { grid-template-columns: 64px repeat(4, 118px); }   /* × in one column, ÷ in the next, then + and − */
.wp-oprow > b { font: 600 15px var(--head); color: var(--tc); }
.wp-ops button { font: 500 15px var(--body) !important; }
.wp-ops button.picked { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, #fff); box-shadow: 0 0 0 2px var(--tc); }
.wp-ops button.should { background: #dcf7ec; border-color: #1f9c70; color: #157a56; border-style: dashed; }
.wp-ops button:disabled { cursor: default; }
.wp-calc { display: grid; gap: 8px; flex: 1 1 100%; }
.wp-calc .wp-working { width: 100%; }
.wp-next { display: flex; justify-content: center; margin: 16px 0; }
.wp-summary { max-width: 760px; margin: 0 auto; text-align: center; }
.wp-summary .wp-score { font: 600 20px var(--head); }
.wp-summary .btn-row { justify-content: center; }
@media (max-width: 640px) { .wp-ops.multi .wp-oprow { grid-template-columns: 52px repeat(2, 1fr); } .wp-ops.multi .wp-oprow > b { grid-row: span 2; } }
@media print {
  .wp-grid.wp-one { grid-template-columns: 1fr; }
  .wp-card[hidden] { display: none !important; }
  .wp-card { break-inside: avoid; }
}

#wp-nextbtn[hidden], .wp-summary[hidden] { display: none !important; }

/* ---- unit page: 5 big step cards; a card opens only that step (user) */
.unit-menu { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 26px; margin-bottom: 30px; }
.unit-step-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 14px 22px; border-radius: 22px;
  background: #fff; border: 3px solid color-mix(in srgb, var(--tc) 30%, #fff); text-decoration: none; color: var(--ink); box-shadow: 0 8px 20px rgba(27,23,71,.08); transition: transform .15s, box-shadow .15s; }
.unit-step-card:hover, .unit-step-card:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 26px rgba(27,23,71,.14); border-color: var(--tc); outline: none; }
.usc-icon { font-size: 44px; line-height: 1; }
.unit-step-card b { font: 600 22px var(--head); color: var(--tc); }
.unit-step-card small { font: 400 14px/1.4 var(--body); color: var(--muted, #6b6585); }
body:not(.unit-open) .unit-tabs, body:not(.unit-open) .unit-body .unit-sec { display: none; }
body.unit-open .unit-menu { display: none; }
.unit-tabs a.on { background: var(--tc); color: #fff; }
.unit-back { font-weight: 600; }
.unit-sec[hidden] { display: none !important; }
@media (max-width: 900px) { .unit-menu { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .unit-menu { grid-template-columns: 1fr 1fr; } }
/* bigger worksheet text and boxes so children can focus (user) */
.us-sheet .us-body { font-size: 19px; }
.us-bank li p, .ut-in p { font-size: 20px !important; }
.us-sheet .ans { font-size: 20px !important; min-height: 40px; }
.us-eq { font-size: 22px; }
.us-ex .ex-card p, .ex-items td { font-size: 19px !important; }
.mc-opts label { font-size: 19px !important; padding: 8px 16px 8px 10px; }
.us-words { font-size: 19px !important; }
.us-hint { font-size: 16px !important; }

/* ---- unit test: Start button, every answer shown after Submit, "why" for wrong ones */
.us-start[hidden] { display: none !important; }
.us-timer:not(.run) { opacity: .75; }
.ws-fix.right-ans { position: static !important; display: inline-block; margin: 6px 0 0 8px; translate: none !important; background: #f0fbf6 !important; border-style: dashed !important; }
.ws-fix.right-ans::before { content: '✓ '; }
.ws-why { margin: 8px 0 0 !important; padding: 8px 12px; border-radius: 10px; background: #fff8e6; border-left: 4px solid var(--gold, #ffc83d); font: 400 16px/1.45 "Lexend", system-ui, sans-serif !important; color: #4a3d1a; flex-basis: 100%; }
.ut-part { flex-wrap: wrap; }
.ut-part > .ws-why { margin-left: 32px !important; }

/* ---- Unit 6 shapes: shape cards, the dot grid you draw on, perimeter & area grids */
.us-cell.shape { gap: 10px; }
.us-shape { display: block; }
.us-table.shapes td { padding: 6px; }
.dd { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 100%; overflow-x: auto; }
.dd svg { display: block; touch-action: manipulation; }
.dd-dot { fill: #2b2346; pointer-events: none; }
.dd-dot.from { fill: var(--ws-c); r: 8; }
.dd-hit { fill: transparent; cursor: pointer; }
.dd-hit:hover { fill: color-mix(in srgb, var(--ws-c) 18%, transparent); }
.dd line { stroke-width: 4; stroke-linecap: round; }
.dd .given { stroke: #2b2346; }
.dd .dd-user line { stroke: var(--ws-c); cursor: pointer; stroke-width: 5; }
.dd .dd-user line:hover { stroke: #e46c6c; }
.dd-key { display: none; }
.dd .key { stroke: #1f9c70; stroke-dasharray: 7 5; opacity: .85; }
.us-sheet.show-answers .dd-key, .us-q.wrong .dd-key { display: inline; }
.dd-mirror, .dd-split { stroke: var(--ws-c) !important; stroke-width: 3 !important; stroke-dasharray: 3 7; stroke-linecap: round; }
.dd-split { stroke: #b9b2cf !important; stroke-dasharray: none; }
.dd-tools { display: flex; gap: 8px; }
.dd-tools button { border: 2px solid #d8d2ec; background: #fff; border-radius: 999px; padding: 4px 12px; font: 500 14px var(--body); cursor: pointer; }
.us-q.draw.right .dd-user line { stroke: #1f9c70; } .us-q.draw.wrong .dd-user line { stroke: #e46c6c; }
.us-cell.draw.wide { margin-bottom: 12px; }
.us-cell.pa { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px; }
.pa-ans { display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.pa-q { display: flex; align-items: center; gap: 6px; }
.pa-q > .ws-fix { position: static !important; translate: none !important; }

@media print { .unit-menu { display: none !important; } body.us-printing .unit-sec.print-me { display: block !important; } }

/* ---- shapes & angles: 2 per row, bigger pictures, choices under the picture */
.us-grid.g2.big { gap: 16px; }
.us-grid.big .us-cell.shape { padding: 30px 14px 18px; gap: 14px; }
.us-grid.big .mc-opts { justify-content: center; }
.us-shape.angle { max-width: 100%; height: auto; }
.two-ang { gap: 10px !important; }
.two-ang .ta-q { display: flex; justify-content: center; position: relative; }
.two-ang .ta-q > .ws-fix, .two-ang .ta-q > .ws-why { position: static !important; translate: none !important; }
.us-cell.shape > .ws-fix { position: static !important; translate: none !important; }
.us-cell.draw > .ws-why, .us-cell.shape > .ws-why { margin: 6px 0 0 !important; }
@media (max-width: 640px) { .us-grid.g2.big { grid-template-columns: 1fr; } }

@media print { .us-grid.g2.big { display: block; } .us-grid.g2.big > * { display: inline-flex; width: calc(50% - 10px); margin: 0 4px 12px; vertical-align: top; break-inside: avoid; } }

@media print { .us-grid.g2.big .us-shape { width: 170px !important; height: auto !important; } .us-grid.big .us-cell.shape { padding: 18px 10px 10px !important; gap: 8px !important; } }

/* ---- long exercise lines: the full sentence, then the answer box on the next line (user) */
.ex-stack { margin: 6px 0 14px; }
.ex-stack > p { margin: 0 0 6px !important; line-height: 1.5 !important; }
.ex-stack-ans { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 22px; }
.ex-after { font: 400 18px var(--body); color: #5b5277; }
.ex-items { max-width: 100%; }
.ex-items td.t { white-space: normal !important; }
.us-ex .ex-card { overflow-wrap: anywhere; }

/* ---- 2 questions per row on every worksheet (user), so nothing is cut off at the side */
.us-body .us-grid.g3, .us-body .us-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.us-body .us-cell { min-width: 0; }
@media (max-width: 520px) { .us-body .us-grid.g2, .us-body .us-grid.g3, .us-body .us-grid.g4 { grid-template-columns: 1fr; } }

/* ---- tables: first-column labels centred like the rest (user) */
.us-table tbody th, .us-table td { text-align: center !important; }
.us-table td.clue { text-align: center !important; }
.ex-stack-ans .mc { width: 100%; }

/* a missing digit: a big red ? in a rounded box (user: the small square was hard to see) */
.miss { display: inline-grid; place-items: center; min-width: 1.1em; height: 1.25em; padding: 0 .08em; margin: 0 .06em; border: 2px solid #e11d48; border-radius: 6px; color: #e11d48; font-weight: 700 !important; line-height: 1; vertical-align: baseline; background: #fff1f3; }

.usc-pic { display: block; width: 100%; max-width: 176px; height: auto; aspect-ratio: 220 / 170; margin: -6px auto 4px; transition: transform .2s; }
.unit-step-card:hover .usc-pic { transform: scale(1.06) rotate(-2deg); }

/* ---- previous / next unit on the two sides of the screen (user) */
.unit-side { position: fixed; top: 50%; translate: 0 -50%; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px; min-width: 64px; border-radius: 18px; background: #fff; color: var(--tc); text-decoration: none;
  border: 3px solid color-mix(in srgb, var(--tc) 45%, #fff); box-shadow: 0 8px 22px rgba(27,23,71,.16); transition: transform .15s, box-shadow .15s; }
.unit-side.prev { left: 10px; } .unit-side.next { right: 10px; }
.unit-side span { font-size: 26px; line-height: 1; }
.unit-side b { font: 600 14px var(--head); white-space: nowrap; }
.unit-side:hover, .unit-side:focus-visible { transform: scale(1.06); box-shadow: 0 12px 28px rgba(27,23,71,.22); outline: none; }
.unit-side.prev:hover span { translate: -3px 0; } .unit-side.next:hover span { translate: 3px 0; }
@media (max-width: 1100px) { .unit-side { top: auto; bottom: 14px; translate: none; flex-direction: row; gap: 6px; padding: 8px 12px; min-width: 0; } .unit-side span { font-size: 18px; } }
@media print { .unit-side { display: none !important; } }

/* ---- a shorter unit header, so the header and the 5 step cards fit on one screen (user) */
.space.section.unit-hero { padding-top: 18px; padding-bottom: 18px; }
.unit-hero .crumbs { margin-bottom: 6px; }
.unit-hero .hero-badge { margin-bottom: 6px; padding: 4px 12px; font-size: 12px; }
.unit-hero h1 { font-size: clamp(28px, 3.6vw, 42px); margin: 0 0 6px; }
.unit-hero .lead { font-size: 16px; margin: 0; }
.unit-guide { width: 112px; }
.unit-hero-in { gap: 16px; }
.unit-menu { margin-top: 18px; margin-bottom: 18px; }
.unit-step-card { padding: 16px 12px 16px; gap: 6px; }
.usc-pic { max-width: 150px; margin: -4px auto 0; }
.unit-step-card b { font-size: 20px; }
.unit-step-card small { font-size: 13.5px; }

.my-row:has(> .my-card:only-child) { grid-template-columns: 1fr; }

/* ---- Maths → Worksheets: every unit's sheets with downloads (user) */
.mw-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.mw-jump .chip { border-color: color-mix(in srgb, var(--tc, var(--violet)) 40%, #fff); }
.mw-unit { margin: 0 0 30px; padding: 18px; border-radius: 22px; background: #fff; border: 2px solid color-mix(in srgb, var(--tc) 30%, #fff); scroll-margin-top: 80px; }
.mw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mw-head h2 { margin: 0; font-size: 24px; } .mw-head .eyebrow { color: var(--tc); }
.mw-head .btn { margin-left: auto; }
.mw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.mw-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--tc) 7%, #fff); }
.mw-thumb { display: block; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 6px 14px rgba(27,23,71,.12); transition: transform .15s; }
.mw-thumb:hover { transform: translateY(-3px); }
.mw-thumb img { display: block; width: 100%; height: auto; }
.mw-pack { display: grid; place-items: center; aspect-ratio: 210 / 297; font-size: 56px; }
.mw-level { font: 600 12px var(--head); color: var(--tc); text-transform: uppercase; letter-spacing: .04em; }
.mw-card b { font: 600 16px/1.3 var(--head); }
.mw-btns { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.mw-btns .btn { justify-content: center; }
@media (max-width: 560px) { .mw-head { flex-wrap: wrap; } .mw-head .btn { margin-left: 0; } .mw-grid { grid-template-columns: 1fr 1fr; } }

/* ---- level-by-level links (Worksheets) and the revision / tests lists */
.mw-sub { font: 600 17px var(--head); margin: 18px 0 10px; color: var(--ink); }
.mw-sub small { font: 400 13px var(--body); color: var(--muted, #6b6585); margin-left: 6px; }
.mw-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-lv { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: #fff; border: 2px solid color-mix(in srgb, var(--tc) 35%, #fff);
  color: var(--ink); text-decoration: none; font: 500 14px var(--body); transition: background .15s, border-color .15s; }
.mw-lv:hover { background: color-mix(in srgb, var(--tc) 12%, #fff); border-color: var(--tc); }
.rv-list { display: grid; gap: 14px; }
.rv-unit { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: #fff; border: 2px solid color-mix(in srgb, var(--tc) 30%, #fff); }
.rv-unit .eyebrow { color: var(--tc); display: block; }
.rv-unit b { display: block; font: 600 18px var(--head); margin: 2px 0 10px; }
.rv-h { font: 600 15px var(--head); margin: 14px 0 8px; }
.rv-papers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rv-paper { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--tc) 7%, #fff); }
.rv-paper b { margin: 0 auto 0 0; font-size: 15px; }
.rv-paper a { font: 500 13px var(--body); text-decoration: none; }
.rv-soon { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted, #6b6585); }

/* units with nothing yet: 'Coming soon' in its own colour so it stands out (user) */
.uc-soon { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #fff1e6; color: #c2410c; border: 1.5px solid #fdba74; font: 600 13px var(--body); }
.uc-go { color: var(--tc); font-weight: 600; }

.uc-soon { white-space: nowrap; flex-shrink: 0; font-size: 12px; padding: 2px 8px; gap: 3px; }
.uc-foot .uc-guide { min-width: 0; text-align: right; }

/* every card foot is one line and the same height, so Start / Coming soon and the dashed line sit level (user) */
.uc-foot { flex-wrap: nowrap; min-height: 38px; box-sizing: border-box; }
.uc-foot .uc-guide { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-go { white-space: nowrap; line-height: 22px; }

/* ---- 2026-11-12 (user feedback round) ---- */
/* time trail: a train ride with stations */
.tt-wrap { overflow-x: auto; margin: 6px 0 4px; }
.tt-scene { position: relative; width: 100%; min-width: 640px; border-radius: 22px; background: linear-gradient(#f3fbff, #f7f3ff); border: 2px solid color-mix(in srgb, var(--ws-c) 35%, #fff); }
.tt-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tt-train { position: absolute; z-index: 3; transform: translate(-50%, -80%); pointer-events: none; filter: drop-shadow(0 3px 2px rgba(27,23,71,.25)); }
.tt-train .puff { animation: tt-puff 1.4s ease-out infinite; transform-origin: center; }
@keyframes tt-puff { from { opacity: .9; transform: translate(0, 0) scale(.6); } to { opacity: 0; transform: translate(-6px, -10px) scale(1.4); } }
.tt-stop { position: absolute; z-index: 2; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.tt-stop .tt-name { font: 600 12px "Lexend", system-ui, sans-serif; color: #2b2346; background: #fff; border-radius: 99px; padding: 1px 8px; box-shadow: 0 1px 0 rgba(0,0,0,.08); white-space: nowrap; }
.tt-stop .tt-hop { font: 600 12px "Lexend", system-ui, sans-serif; color: var(--ws-c); white-space: nowrap; }
.tt-stop.first b { background: var(--ws-c); color: #fff; border-radius: 14px; padding: 4px 12px; font: 600 17px "Lexend", system-ui, sans-serif; }
.tt-stop.first small { font: 600 11px "Lexend", system-ui, sans-serif; color: var(--ws-c); }
.tt-stop .us-q.stop { position: relative; background: #fff; border: 2.5px solid var(--ws-c); border-radius: 14px; padding: 4px 6px; }
.tt-stop .us-q.stop::before { content: ""; position: absolute; left: 50%; top: -8px; translate: -50% 0; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--ws-c); }
.tt-stop .us-q > .ws-fix { position: absolute; top: 100%; left: 50%; translate: -50% 4px; white-space: nowrap; z-index: 4; }
.tt-stop .us-q > .ws-sticker { top: -10px; right: -14px; }
@media print { .tt-wrap { overflow: visible; } .tt-scene { min-width: 0; } .tt-train .puff { animation: none; } }

/* number line to label */
.us-nltool { max-width: 560px; margin: 6px 0; }
.us-nltool svg { display: block; }
.us-nltool .nl-boxes { display: grid; grid-template-columns: repeat(var(--n), 1fr); justify-items: center; margin-top: 4px; }
.us-nltool .nl-boxes input.ans { width: 54px !important; text-align: center; }
.us-nltool .nl-given { font: 600 20px "Lexend", system-ui, sans-serif; padding-top: 6px; }

/* written answers: how close to the model answer */
.ws-match { display: table; margin: 8px 0 0; padding: 4px 12px; border-radius: 99px; font: 600 14px "Lexend", system-ui, sans-serif; }
.ws-match.hi { background: #e3f8ea; color: #17733a; } .ws-match.mid { background: #fff4d6; color: #8a5a00; } .ws-match.lo { background: #ffe7e3; color: #b42318; }
.ws-why.eq { background: #f3ecff; border-left-color: var(--ws-c); color: #3d2a66; }
.ws-why .fr, .ws-fix .fr, .ws-match .fr { font-size: .95em !important; }
.ex-ans .fr, .us-hint .fr { font-size: 1em; }

/* print: bank questions two to a row, so a sheet ends on a full page (no lone question on page 2) */
@media print {
  .us-bank { grid-template-columns: 1fr 1fr; gap: 8px; }
  .us-bank li { padding: 8px 12px 10px 40px; }
  .us-bank li p { font-size: 15px !important; line-height: 1.4; }
  .us-bank li:has(.us-nltool, .us-rainbow, .us-venn, .us-vis) { grid-column: 1 / -1; }
}

.tt-stop .us-q.stop { margin-top: 4px; } .tt-stop .us-q.stop::before { display: none; }

@media print { .us-bank li:has(.us-nltool) { grid-column: auto; } .us-nltool { max-width: 100%; } .us-nltool .nl-boxes input.ans, .us-nltool .nl-boxes .blank { width: 40px !important; min-width: 0; } }

@media print { .us-bank li:has(.us-vis) { grid-column: auto; } .us-nltool .nl-boxes .blank { width: 34px !important; } .us-nltool .nl-boxes input.ans { width: 30px !important; } }

@media print { .us-bank li { padding-bottom: 6px; } .us-nltool svg { height: 26px; } .us-nltool { margin: 2px 0; } .us-sheet .sheet-foot { margin-top: 4px; } }

/* time trail on the user's picture: bubbles over its speech bubbles (2026-11-12) */
.tt-scene.pic { background: none; border: 0; border-radius: 18px; overflow: hidden; min-width: 560px; max-width: 760px; margin: 0 auto; }
.tt-scene.pic .tt-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tt-scene.pic .tt-bg { z-index: 1; }
.tt-scene.pic .tt-train { z-index: 3; }
.tt-scene.pic .tt-train svg { width: 62px; height: 40px; }
.tt-bub { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tt-bub .tt-hop { font: 600 12px "Lexend", system-ui, sans-serif; color: #fff; background: #a43de1; border-radius: 99px; padding: 1px 9px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tt-bub .us-q.stop { position: relative; background: #fff; border: 2.5px solid #2b2346; border-radius: 14px; padding: 3px 6px; box-shadow: 0 2px 0 rgba(27,23,71,.2); margin: 0; min-width: 0; }
.tt-bub .us-q.stop input.ans { font-size: 16px !important; }
.tt-bub.first { background: #fff; border: 2.5px solid #2b2346; border-radius: 14px; padding: 3px 14px 5px; text-align: center; box-shadow: 0 2px 0 rgba(27,23,71,.2); }
.tt-bub.first small { display: block; font: 600 11px "Lexend", system-ui, sans-serif; color: #a43de1; }
.tt-bub.first b { font: 600 20px "Lexend", system-ui, sans-serif; color: #2b2346; white-space: nowrap; }
.tt-bub .us-q > .ws-fix { position: absolute; top: 100%; left: 50%; translate: -50% 4px; white-space: nowrap; z-index: 4; }
.tt-bub .us-q > .ws-sticker { top: -12px; right: -14px; }
@media print { .tt-scene.pic { min-width: 0; max-width: 560px; } }

/* the sheet picker: its arrow sits a little in from the right edge (user) */
.ws-controls select { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5l5.5 5.5 5.5-5.5' fill='none' stroke='%232b2346' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 14px 9px; }

.tt-scene.pic.bike { max-width: 100%; min-width: 620px; } .tt-scene.pic.bike .tt-train svg { width: 58px; height: 48px; }
@media print { .tt-scene.pic.bike { max-width: 100%; min-width: 0; } .us-body h3.us-h:has(+ .tt-wrap):not(:first-child) { break-before: page; } }

@media print { .us-two { display: grid !important; grid-template-columns: 1fr 1.15fr; gap: 14px; align-items: start; } .us-two .us-lines { margin: 0; } .us-two .us-lines li { font-size: 14px !important; line-height: 1.35; margin-bottom: 8px; } .us-two .us-table th, .us-two .us-table td { padding: 5px 6px; font-size: 13px; } }

/* hub cards: the alien carries its name tag (user) */
.hub-card .hc-pal { position: absolute; right: 10px; bottom: 18px; width: 82px; z-index: 1; }
.hub-grid-5 .hub-card .hc-pal { width: 74px; right: 50%; translate: 50% 0; }
.hub-card .hc-pal .hc-alien { position: static !important; translate: none !important; width: 100% !important; display: block; }
.hub-card .hc-pal .tc-name { bottom: -12px; font-size: 11px; padding: 3px 9px 2px; }
.hub-grid-5 .hub-card { padding-bottom: 128px; }

.hub-card .hc-pal { bottom: 34px; }

/* online: 4 questions at a time; print shows every question (user) */
@media screen { .us-sheet .us-more { display: none !important; } }

/* ---- rewards 2026-11-12: space journey + alien sticker book (user) ---- */
.rank-ladder li { position: relative; }
.rank-ladder li .rocket { position: absolute; top: -10px; right: 4px; font-style: normal; font-size: 18px; animation: rk-bob 1.6s ease-in-out infinite; }
@keyframes rk-bob { 50% { transform: translateY(-4px) rotate(-8deg); } }
.sticker.alien img { width: 92px; height: 92px; filter: grayscale(1) brightness(1.15) opacity(.35); }
.sticker.alien.owned img { filter: drop-shadow(3px 3px 0 #fff) drop-shadow(-3px -3px 0 #fff) drop-shadow(0 6px 8px rgba(27,23,71,.25)); }
/* a gold statue: the alien in shining gold on a little stand */
.sticker.alien.gold { background: linear-gradient(160deg, #fff8dc, #ffe9a8); box-shadow: 0 0 0 2px #e0a81c, 0 8px 18px rgba(160,110,0,.2); }
.sticker.alien.gold img { filter: sepia(1) saturate(3.2) hue-rotate(-12deg) brightness(1.05) contrast(1.15) drop-shadow(0 0 6px rgba(255,200,61,.9)); border-bottom: 8px solid #b5852a; border-radius: 0 0 6px 6px; padding-bottom: 2px; }
.sticker.alien.gold .got { color: #a8740a; }
.champion { margin-top: 18px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #fff8dc, #f3ecff); border: 2px dashed #e0a81c; }
.champion.locked { filter: grayscale(.8); opacity: .75; }
.champion .champ-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.champion .champ-head > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.champion .champ-head b { font: 800 18px var(--head); }
.champion .got { font-weight: 800; color: #a8740a; }
.gold-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.gold-pick > span { font-weight: 800; margin-right: 4px; }
.gold-alien { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; border: 2px solid #e0a81c; background: #fff; cursor: pointer; font: 600 11px var(--body); }
.gold-alien img { width: 40px; height: 40px; object-fit: contain; }
.gold-alien:disabled { opacity: .45; cursor: not-allowed; }
.gold-alien:not(:disabled):hover { background: #fff3c4; }

.ws-result .ws-save { font-size: 15px; } .ws-result .us-gain { display: inline-block; background: #e9f6ff; color: #1d6fb8; border-radius: 99px; padding: 2px 10px; font-weight: 800; }

.sticker.alien.ready { background: #fff; box-shadow: 0 0 0 2px #ffc83d; animation: st-ready 1.6s ease-in-out infinite; }
.sticker.alien.ready img { filter: grayscale(.25) opacity(.9); }
@keyframes st-ready { 50% { box-shadow: 0 0 0 4px #ffc83d, 0 0 18px rgba(255,200,61,.6); } }
@media (prefers-reduced-motion: reduce) { .sticker.alien.ready { animation: none; } }

.stickers-card .step-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .stickers-card .step-head h2 { margin-right: auto; } .stickers-card .wallet { padding: 8px 18px; }

/* statue hall: gold statues, then sparkling rainbow diamonds (user) */
.statue-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 14px; }
.statue { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 14px; background: #fff; border: 2px solid #e6e1f5; font: 600 12px var(--body); color: #2b2346; }
.statue img { width: 56px; height: 56px; object-fit: contain; filter: grayscale(1) opacity(.35); }
.statue.gold { background: linear-gradient(160deg, #fff8dc, #ffe39a); border-color: #e0a81c; }
.statue.gold img { filter: sepia(1) saturate(3.2) hue-rotate(-12deg) brightness(1.05) contrast(1.15) drop-shadow(0 0 5px rgba(255,200,61,.9)); }
.statue.diamond { background: linear-gradient(135deg, #ffe0f0, #e0f2ff, #e8ffe0, #fff6d0, #f0e0ff); background-size: 300% 300%; border-color: #9b6bdf; animation: dia-bg 4s ease infinite; position: relative; overflow: hidden; }
.statue.diamond img { filter: brightness(1.25) saturate(1.8) contrast(1.1) drop-shadow(0 0 6px rgba(255,255,255,.95)); animation: dia-hue 3s linear infinite; }
.statue.diamond::after { content: "✦"; position: absolute; top: 4px; right: 8px; color: #fff; text-shadow: 0 0 6px #b48cff; animation: dia-twinkle 1.2s ease-in-out infinite; }
@keyframes dia-hue { to { filter: brightness(1.25) saturate(1.8) contrast(1.1) drop-shadow(0 0 6px rgba(255,255,255,.95)) hue-rotate(360deg); } }
@keyframes dia-bg { 50% { background-position: 100% 100%; } }
@keyframes dia-twinkle { 50% { opacity: .2; transform: scale(.6); } }
.statue.pick { cursor: pointer; border-style: dashed; border-color: #e0a81c; }
.statue.pick img { filter: none; }
.statue.pick:not(:disabled):hover { background: #fff3c4; transform: translateY(-2px); }
.statue.pick:disabled { opacity: .55; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .statue.diamond, .statue.diamond img, .statue.diamond::after { animation: none; } }

.champion.locked { filter: none; opacity: 1; } .champion.locked .champ-head svg { filter: grayscale(.8); opacity: .6; } .statue-row { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }

/* toolbar: every control the same height, lined up along one line (user) */
.usheet .ws-controls { align-items: flex-end; gap: 12px; }
.usheet .ws-controls > .btn, .usheet .ws-controls .us-dl > .btn, .usheet .ws-controls select, .usheet .ws-controls .us-timer {
  height: 46px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; margin: 0; line-height: 1; }
.usheet .ws-controls .us-dl { display: inline-flex; gap: 12px; align-items: flex-end; }
.usheet .ws-controls .us-timer { padding: 0 16px; border-radius: 14px; }
.usheet .ws-controls select { padding-top: 0; padding-bottom: 0; }
.usheet .ws-controls label { margin: 0; }

.usheet .ws-controls [hidden] { display: none !important; }
.usheet .ws-controls .us-pick { font-size: 0; gap: 0; } .usheet .ws-controls .us-pick select { font-size: 16px; }

.usheet .ws-controls { margin-top: 12px; }


/* the English / Tiếng Việt switch in the header (user) */
.site-header .lang-switch { order: 2; margin-left: auto; margin-right: 10px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; border-radius: 99px; padding: 6px 14px; font: 700 14px var(--body); cursor: pointer; white-space: nowrap; }
.site-header .lang-switch:hover { background: rgba(255,255,255,.18); }

/* the teacher's fixed unit tests (Unit 4 Test 1 … 20, user 2026-11-16) */
.ut-form .ut-parts { margin: 6px 0 0; padding-left: 22px; }
.ut-form .ut-parts > li { margin: 6px 0; }
.ut-form .ut-parts .ut-ans { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 17px; line-height: 1.6; }
.ut-form .ut-rolls { margin: 6px 0 10px; padding: 8px 12px; border-radius: 12px; background: #f6f3ff; font: 700 17px/1.7 var(--body); letter-spacing: .02em; }
.ut-tally-t { border-collapse: collapse; margin: 4px 0 6px; min-width: 300px; }
.ut-tally-t th, .ut-tally-t td { border: 2px solid #2b2457; padding: 6px 12px; text-align: center; font-size: 17px; }
.ut-tally-t th { background: #f1eefe; }
.ut-tally-t td.ut-tally { min-width: 120px; font-size: 22px; letter-spacing: .12em; color: #2b2457; }
.ut-tally-t .ut-ans { margin: 0; }
@media print { .ut-tally-t td.ut-tally { min-width: 200px; height: 34px; } }
/* fixed tests: the test's own numbers (1., 2. … and a., b. …) only, no extra badges; the parts sit plainly inside */
.us-bank.ut-form > li::before { content: none; }
.us-bank.ut-form > li { padding-left: 16px; counter-increment: none; }
.us-bank.ut-form .ut-parts > li { counter-increment: none; padding: 2px 0; background: none; border-radius: 0; }
.us-bank.ut-form .ut-parts > li::before { content: none; }
.us-bank.ut-form .ut-parts { list-style: lower-alpha; }
.us-bank.ut-form .ut-parts > li::marker { font-weight: 800; color: color-mix(in srgb, var(--ws-c) 70%, #333); }
/* fixed tests: tick-box answers under each sentence, tally marks the child makes (user 2026-11-16) */
.ut-form .ut-parts .ut-ans.ut-mc { display: block; }
.ut-form .ut-stem { margin: 0 0 6px; font-size: 17px; }
.ut-form .ut-gap { display: inline-block; min-width: 70px; border-bottom: 2px solid #2b2457; color: transparent; }
.ut-tally-cell { min-width: 190px; }
.ut-tally-cell { display: table-cell; }
.ut-tally-cell .ut-tally { display: inline-flex; gap: 10px; align-items: center; min-height: 30px; min-width: 96px; vertical-align: middle; }
.ut-tally .tg, .ut-tally .tg5 { position: relative; display: inline-flex; gap: 4px; height: 26px; align-items: stretch; }
.ut-tally i { width: 3px; border-radius: 2px; background: #2b2457; }
.ut-tally .tg5::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 3px; border-radius: 2px; background: #e8475b; transform: rotate(-28deg); }
.ut-tally-btns { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.ut-tbtn { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line, #ddd); background: #fff; font: 800 18px/1 var(--body); color: #2b2457; cursor: pointer; }
.ut-tbtn:hover { border-color: var(--ws-c, #7b3fd1); }
.ut-tbtn[data-tally="1"] { background: #f1eefe; }
/* fixed tests: all the choices of a part on ONE row (user) */
.ut-form .ut-mc .mc-opts { flex-wrap: nowrap; gap: 6px; }
.ut-form .ut-mc .mc-opts label { font-size: 15px !important; padding: 5px 10px 5px 7px; gap: 6px; white-space: nowrap; }
.ut-form .ut-mc .mc-opts input { width: 17px; height: 17px; }
@media (max-width: 700px) { .ut-form .ut-mc .mc-opts { flex-wrap: wrap; } }

/* the list of games (Times Tables page, user 2026-11-21): the owner's galaxy picture behind the cards */
.section.games-galaxy { background: linear-gradient(180deg, rgba(10,8,40,.55), rgba(10,8,40,.35) 40%, rgba(10,8,40,.6)),
  url("/assets/img/games-galaxy-bg.jpg") center / cover no-repeat, #0b0a2a; }
.section.games-galaxy .section-head h2, .section.games-galaxy .section-head p { color: #fff; }
.section.games-galaxy .section-head .eyebrow { color: #ffd23f; }
.section.games-galaxy .card.mission { box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s, box-shadow .15s; }
.section.games-galaxy a.card.mission:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.45); }

/* game cards 2026-11-23 (user): the full picture, moving gently, with only the game's name */
.section.games-galaxy .card.mission { position: relative; padding: 0; overflow: hidden; border-radius: 22px; aspect-ratio: 3 / 2;
  background: #0b0a2a; border: 2px solid rgba(160,190,255,.35); }
.section.games-galaxy .card.mission .scene { position: absolute; inset: 0; height: 100% !important; padding: 0; margin: 0; border-radius: 0; }
.section.games-galaxy .card.mission .scene img { width: 100%; height: 100%; object-fit: cover; animation: cover-drift 7s ease-in-out infinite alternate; }
.section.games-galaxy .card.mission:nth-child(2n) .scene img { animation-duration: 8.5s; animation-direction: alternate-reverse; }
@keyframes cover-drift { from { transform: scale(1.03) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -2.5%); } }
.section.games-galaxy .card.mission .scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(2px 2px at 12% 18%, #fff, transparent), radial-gradient(2px 2px at 82% 26%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 64% 12%, #fff, transparent), radial-gradient(2px 2px at 30% 70%, #fff, transparent);
  animation: card-twinkle 2.4s ease-in-out infinite alternate; }
@keyframes card-twinkle { from { opacity: .25; } to { opacity: 1; } }
.section.games-galaxy .card.mission .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(8,6,36,.88)); }
.section.games-galaxy .card.mission .body h3 { margin: 0; color: #fff; text-align: center; font-size: 22px; letter-spacing: .3px;
  text-shadow: 0 2px 0 #1b1747, 0 0 12px rgba(120,160,255,.7); }
.section.games-galaxy a.card.mission:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 0 3px #ffd23f; }
.section.games-galaxy a.card.mission:hover .scene img { animation-duration: 3s; }
@media (prefers-reduced-motion: reduce) { .section.games-galaxy .card.mission .scene img, .section.games-galaxy .card.mission .scene::after { animation: none; } }

.game-topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.game-topics span { color: #fff; font-weight: 800; margin-right: 4px; }
.game-topics button { border: 2px solid rgba(160,190,255,.5); background: rgba(20,16,70,.6); color: #fff; font: 700 15px/1 var(--body);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.game-topics button.on { background: #ffd23f; color: #1b1747; border-color: #ffd23f; box-shadow: 0 0 14px rgba(255,210,63,.6); }

/* hover preview (user 2026-11-23): the game plays itself for a moment inside the card */
.game-peek { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; opacity: 0; transition: opacity .35s; pointer-events: none; z-index: 1; background: #0b0830; }
.game-peek.on { opacity: 1; }
.game-peek iframe { position: absolute; left: 0; width: 390px; height: 690px; border: 0; transform-origin: 0 0; pointer-events: none; }
.section.games-galaxy .card.mission .body { z-index: 2; }

/* Unit 1 tens-and-ones worksheets (user 2026-11-24): part-whole models and base-ten blocks */
.pw { position: relative; width: 200px; height: 150px; margin: 0 auto; }
.pw-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.pw-lines line { stroke: #9aa0b8; stroke-width: 2.5; }
.pw-c { position: absolute; width: 62px; height: 62px; border-radius: 50%; border: 2.5px solid #8a8fa8; background: #fff;
  display: grid; place-items: center; font: 800 22px var(--body, inherit); color: #1d2340; }
.pw-c.top { left: 69px; top: 0; } .pw-c.left { left: 17px; top: 82px; } .pw-c.right { left: 121px; top: 82px; }
.pw-c .blank input { width: 46px !important; text-align: center; font-size: 20px; }
.pw-cell { padding-top: 12px; }
.b10 { display: block; margin: 0 auto 6px; max-width: 100%; height: auto; }
.blocks-cell .us-pic { min-height: 120px; display: grid; place-items: end center; }
.us-table.tens-ones td { text-align: center; vertical-align: middle; } .us-table.tens-ones td.blk { padding: 6px 10px; }

@media print {
  .pw { transform: scale(.78); transform-origin: top center; height: 118px; margin-bottom: -4px; }
  .pw-cell { padding-top: 6px; padding-bottom: 2px; }
  .us-eq .blank input { max-width: 44px; }
  .blocks-cell .us-pic { min-height: 0; }
}
@media print { .blocks-cell .b10 { height: 104px; width: auto; } .blocks-cell { padding-top: 4px; padding-bottom: 4px; } }

/* the circle is the box: no underline under the answer (user 2026-11-24) */
.pw-c .blank input.ans, .pw-c input.ans { border: 0 !important; border-bottom: 0 !important; box-shadow: none !important; background: transparent !important; outline: 0; }
.pw-c:focus-within { border-color: var(--ws-c, #7b3fd1); box-shadow: 0 0 0 3px rgba(123,63,209,.18); }

/* Unit 1 place value + negative numbers sheets (user 2026-11-24/25) */
.to-rows { display: grid; gap: 10px; }
.to-row, .hto-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 2px dashed var(--ws-c, #c9c2f2); border-radius: 16px; background: #fff; }
.to-row .to-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 900 18px var(--body, inherit); background: #8a8fa8; }
.to-blue { border-color: #9ec0f5; } .to-blue .to-n { background: #3f7fe0; }
.to-red { border-color: #f3b0b0; } .to-red .to-n { background: #e05a5a; }
.to-green { border-color: #a8d8a8; } .to-green .to-n { background: #4caf50; }
.to-purple { border-color: #cdb6f0; } .to-purple .to-n { background: #8b62d6; }
.to-orange { border-color: #f6cf9d; } .to-orange .to-n { background: #ef8a2c; }
.to-pic { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.to-pic .b10 { margin: 0; }
.to-tab { flex: 0 0 auto; border-collapse: collapse; border-radius: 10px; overflow: hidden; border: 2px solid #c9cde0; }
.to-tab th { background: #eef2fb; font-size: 13px; padding: 5px 10px; border: 1px solid #c9cde0; }
.to-tab td { padding: 8px 8px; border: 1px solid #c9cde0; text-align: center; }
.to-tab td .blank input { border: 2px dashed #b8bfd6; border-radius: 8px; height: 38px; text-align: center; }
.hto-row { border-style: solid; border-color: #e3e6ef; background: #fafbfe; }
.hto-ans { display: grid; gap: 8px; flex: 0 0 auto; }
.hto-total { display: flex; align-items: center; gap: 8px; font-weight: 800; border: 2px solid #c9cde0; border-radius: 10px; padding: 6px 10px; background: #fff; }
.dd.mt svg { max-width: 100%; height: auto; }
.dd.mt .dd-dot { fill: #1d2340; } .dd.mt .dd-dot.from { fill: #e0457b; r: 9; }
.dd.mt .dd-user line { stroke: #1d4ed8; stroke-width: 4; stroke-linecap: round; }
.cmp-q { display: inline-flex; align-items: center; gap: 12px; font-size: 22px; }
.cmp-q select { font-size: 20px; width: 64px; height: 44px; border-radius: 50%; text-align: center; }
.ord-set { border-radius: 14px; background: #eef2fb; padding: 10px 12px; }
.ord-given { display: flex; justify-content: space-around; font-size: 20px; margin-bottom: 8px; }
.ord-boxes { display: flex; gap: 6px; justify-content: space-between; }
.ord-boxes .blank input { width: 50px !important; height: 42px; border: 2px solid #2b2346; border-radius: 8px; text-align: center; background: #fff; }
@media print { .to-row, .hto-row { padding: 6px 10px; } .to-rows { gap: 6px; } }
.hto-row .to-pic .b10 { max-height: 150px; width: auto; }
@media print { .hto-row .to-pic .b10 { max-height: 128px; } }

/* user 2026-11-25: the "use it to help you" number line, big enough to read */
.ut-help svg, .ut-help .us-nl { width: 100% !important; max-width: none !important; height: auto !important; display: block; margin: 10px auto 0; overflow: visible; }
.ut-help .us-nl text { font-size: 26px; }   /* viewBox units: about 17px on screen */
.ut-help .us-nl line { stroke-width: 3; }
.ut-help b { font-size: 17px; }
/* worksheet cards: no type · level line (user 2026-11-25); the main page shows 4 a lesson */
.mw-card .mw-title { display: none; }
.mw-unit:not(.v2-ws-unit) .mw-card.mw-extra { display: none; }
/* the preview window */
.mw-pv { position: fixed; inset: 0; z-index: 1000; background: rgba(15,18,45,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mw-pv-card { background: #fff; border-radius: 20px; width: min(860px, 100%); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.mw-pv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e6e8f0; }
.mw-pv-top b { font-size: 18px; }
.mw-pv-x { border: 0; background: #f1f2f8; border-radius: 50%; width: 36px; height: 36px; font-size: 16px; cursor: pointer; }
.mw-pv iframe { width: 100%; height: 70vh; border: 0; background: #f4f5f9; }
.mw-pv-btns { display: flex; gap: 10px; justify-content: center; padding: 12px 16px; flex-wrap: wrap; }
