/* Success Tutoring Games — site styles */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('/assets/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/andika-latin-400-normal.woff2') format('woff2'); }
/* Metric-matched fallback so text does not reflow (layout shift) when Nunito finishes loading. */
@font-face { font-family: 'Nunito Fallback'; src: local('Arial'), local('Helvetica'), local('Liberation Sans'); size-adjust: 101.2%; ascent-override: 99.8%; descent-override: 34.9%; line-gap-override: 0%; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('/assets/fonts/nunito-latin-900-normal.woff2') format('woff2'); }
:root {
  --brand: #2b59c3;
  --brand-dark: #1d3f94;
  --brand-soft: #e8eeff;
  --accent: #ff8a1f;
  --accent-dark: #d96a00;
  --ok: #17a36b;
  --ok-text: #0d7448;
  --ok-soft: #dff7ec;
  --bad: #d32f2f;
  --bad-soft: #fde7e8;
  --ink: #1b2340;
  --ink-soft: #4a5578;
  --line: #dfe4f2;
  --bg: #f6f8ff;
  --card: #ffffff;
  --math: #2b7de9;
  --english: #9b51e0;
  --logic: #ff8a1f;
  --science: #17a36b;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(27, 35, 64, .08);
  --wrap: 1120px;
  --font: 'Nunito', 'Nunito Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 900; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.1rem; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.logo small { display: block; font-weight: 700; font-size: .72rem; color: var(--ink-soft); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 800; padding: 8px 12px; border-radius: 999px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 900; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 999px; padding: 12px 22px;
  background: var(--accent); color: var(--ink); box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--ink); filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn-blue, .btn-blue:hover { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-dark); }
.btn-blue:active { box-shadow: 0 1px 0 var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: .95rem; }
.header-cta { display: none; }
@media (min-width: 1100px) { .header-cta { display: inline-flex; white-space: nowrap; } }
@media (min-width: 1000px) and (max-width: 1439px) { .logo small { display: none; } .nav a { padding: 8px 9px; } .site-header .wrap { gap: 10px; } }
@media (max-width: 720px) {
  .site-header { position: static; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .nav a { white-space: nowrap; }
}

/* Hero */
.hero { padding: 48px 0 32px; text-align: center; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 680px; margin: 0 auto 1.5em; }
.hero .badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.badge { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; color: var(--ink-soft); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 0 0 24px; }
.chip {
  font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  padding: 6px 14px; border-radius: 999px;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.search {
  font: inherit; border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px; min-width: 0; width: 100%; max-width: 320px; background: #fff;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); overflow: hidden;
  border: 1px solid var(--line); transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(27, 35, 64, .14); color: var(--ink); }
.card-art { height: 120px; display: grid; place-items: center; font-size: 64px; line-height: 1; }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 900; font-size: 1.1rem; }
.card-desc { color: var(--ink-soft); font-size: .93rem; margin: 0; flex: 1; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .75rem; font-weight: 900; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.cat-math { --cat: var(--math); }
.cat-english { --cat: var(--english); }
.cat-logic { --cat: var(--logic); }
.cat-science { --cat: var(--science); }
.card-art { background: color-mix(in srgb, var(--cat, var(--brand)) 16%, #fff); }
.tag-cat { background: color-mix(in srgb, var(--cat, var(--brand)) 16%, #fff); color: color-mix(in srgb, var(--cat, var(--brand)) 55%, #000); }
.empty { text-align: center; color: var(--ink-soft); padding: 32px 0; }

/* Category tiles */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cat-tile {
  display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--cat) 14%, #fff); border: 2px solid color-mix(in srgb, var(--cat) 30%, #fff);
}
.cat-tile:hover { color: var(--ink); border-color: var(--cat); }
.cat-tile .emoji { font-size: 40px; }
.cat-tile strong { display: block; font-size: 1.1rem; }
.cat-tile span { font-size: .9rem; color: var(--ink-soft); }

/* Sections */
section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.prose { max-width: 760px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.two-col { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }
.panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 22px 24px; box-shadow: var(--shadow); }
.panel ul, .panel ol { padding-left: 1.2em; margin: 0; }
.panel li { margin-bottom: .4em; }

/* Breadcrumbs */
.crumbs { font-size: .9rem; padding-top: 16px; color: var(--ink-soft); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: '›'; margin-right: 6px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.crumbs a:hover { text-decoration: underline; }

/* Game page */
.game-head { padding: 12px 0 8px; }
.game-head h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: .25em; }
.game-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.game-head p { color: var(--ink-soft); max-width: 760px; }
.game-frame {
  background: #fff; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow);
  min-height: 460px; position: relative; overflow: hidden;
}
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 900; cursor: pointer; }
.faq details p { margin: .6em 0 0; color: var(--ink-soft); }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--brand) 0%, #4a7bf0 100%); color: #fff; border-radius: 24px;
  padding: 32px 28px; display: grid; gap: 18px; align-items: center; grid-template-columns: 1fr;
}
@media (min-width: 760px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { color: #fff; margin-bottom: .25em; }
.cta-band p { margin: 0; opacity: .92; }

/* Footer */
.site-footer { margin-top: 48px; background: var(--ink); color: #cfd6ef; padding: 40px 0 28px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer p a, .footer-bottom a { text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .6em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .85rem; }

/* ---------- Game UI (shared by all games) ---------- */
.g { padding: 22px; min-height: 460px; display: flex; flex-direction: column; }
.g-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.g-title { font-size: 1.8rem; font-weight: 900; margin: 0; }
.g-emoji { font-size: 64px; line-height: 1; }
.g-sub { color: var(--ink-soft); margin: 0; max-width: 520px; }
.g-settings { display: grid; gap: 14px; width: 100%; max-width: 560px; }
.g-setting { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.g-setting-label { font-weight: 900; font-size: .9rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.g-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.g-hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; font-weight: 900; }
.g-hud .pill { background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: .95rem; }
.g-progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 12px 0 4px; }
.g-progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #4fd39b); transition: width .3s ease; }
.g-icon-btn { font: inherit; border: 2px solid var(--line); background: #fff; border-radius: 999px; width: 40px; height: 40px; cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.g-q { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 900; margin: 0; }
.g-q-big { font-size: clamp(2.2rem, 8vw, 3.6rem); letter-spacing: .02em; }
.g-q-small { font-size: clamp(1.1rem, 3vw, 1.4rem); }
.g-visual { display: flex; justify-content: center; }
.g-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 560px; }
.g-choices.g-choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-choice {
  font: inherit; font-weight: 900; font-size: clamp(1.1rem, 3.4vw, 1.5rem); cursor: pointer; min-height: 64px; padding: 10px;
  border-radius: 16px; border: 3px solid var(--line); background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line);
  transition: transform .06s ease; overflow-wrap: anywhere;
}
.g-choice:hover:not(:disabled) { border-color: var(--brand); }
.g-choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.g-choice .k { display: inline-block; font-size: .7em; color: var(--ink-soft); margin-right: 6px; vertical-align: middle; }
.g-choice.is-right { background: var(--ok-soft); border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); }
.g-choice.is-wrong { background: var(--bad-soft); border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
.g-choice:disabled { cursor: default; }
.g-form { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.g-input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.6rem; font-weight: 900; text-align: center; padding: 10px 14px;
  border: 3px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink);
}
.g-input:focus { border-color: var(--brand); outline: none; }
.g-feedback { min-height: 1.6em; font-weight: 900; font-size: 1.15rem; }
.g-feedback.ok { color: var(--ok-text); }
.g-feedback.bad { color: #c62828; }
.g-stars { font-size: 48px; letter-spacing: 6px; }
.g-result-score { font-size: 3rem; font-weight: 900; margin: 0; line-height: 1; }
.g-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.g-note { font-size: .9rem; color: var(--ink-soft); }
.g-pop { animation: g-pop .35s ease; }
@keyframes g-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.g-shake { animation: g-shake .35s ease; }
@keyframes g-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .g-pop, .g-shake { animation: none; } .card, .g-progress > div { transition: none; } }
@media (max-width: 480px) { .g { padding: 16px; } .g-choices.g-choices-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Memory match */
.mm-board { display: grid; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
.mm-card {
  aspect-ratio: 1; border-radius: 14px; border: 0; cursor: pointer; font-size: clamp(26px, 7vw, 44px); padding: 0;
  background: linear-gradient(135deg, var(--brand), #5d86f2); color: transparent; box-shadow: 0 4px 0 var(--brand-dark);
  transition: transform .2s ease, background .2s ease;
}
.mm-card.is-up, .mm-card.is-done { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 3px var(--line); }
.mm-card.is-done { box-shadow: inset 0 0 0 3px var(--ok); background: var(--ok-soft); cursor: default; }
.mm-card .mm-word { font-size: clamp(12px, 3vw, 16px); font-weight: 900; }

/* Sudoku */
.sd-board { display: grid; gap: 0; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; width: min(100%, 420px); margin: 0 auto; background: var(--ink); }
.sd-cell {
  aspect-ratio: 1; display: grid; place-items: center; font: inherit; font-weight: 900; font-size: clamp(20px, 6vw, 32px);
  background: #fff; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--brand); cursor: pointer; padding: 0;
}
.sd-cell.given { color: var(--ink); cursor: default; background: #f3f5fb; }
.sd-cell.sel { background: #fff3c4; }
.sd-cell.peer { background: #eef3ff; }
.sd-cell.err { color: var(--bad); background: var(--bad-soft); }
.sd-cell.br { border-right: 3px solid var(--ink); }
.sd-cell.bb { border-bottom: 3px solid var(--ink); }
.sd-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.sd-pad button { width: 52px; height: 52px; font-size: 1.4rem; }

/* Clock + fraction visuals */
.viz { width: 220px; height: 220px; }
@media (max-width: 480px) { .viz { width: 180px; height: 180px; } }

/* Header account link */
.acct-link { text-decoration: none; font-weight: 800; color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .92rem; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.acct-link:hover, .acct-link[aria-current="page"] { border-color: var(--brand); color: var(--brand-dark); }
@media (max-width: 720px) { .acct-link { margin-left: auto; order: 2; } .site-header .nav { order: 3; } }

/* Results screen extras */
.g-points { margin: 0; font-weight: 900; font-size: 1.2rem; color: var(--accent-dark); }
.g-social { width: 100%; max-width: 520px; }
.g-social:empty { display: none; }

/* Leaderboards */
.lb-callout { background: var(--brand-soft); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: .95rem; text-align: center; }
.lb-callout.ok { background: var(--ok-soft); }
.lb-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.lb-list, .panel .lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: grid; grid-template-columns: 44px 36px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; }
.lb-row:nth-child(odd) { background: var(--bg); }
.lb-row.is-mine { background: #fff3c4; outline: 2px solid #ffc53d; }
.lb-rank { font-weight: 900; text-align: center; font-size: 1.05rem; }
.lb-avatar { font-size: 1.5rem; text-align: center; }
.lb-name { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { color: var(--ink-soft); font-weight: 700; }
.lb-points { font-weight: 900; font-variant-numeric: tabular-nums; }
.lb-empty { color: var(--ink-soft); text-align: center; padding: 18px 0; margin: 0; }
.lb-panel { margin-top: 24px; }
.lb-panel .section-head { margin-bottom: 8px; }
.lb-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.select { font: inherit; font-weight: 800; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; color: var(--ink); max-width: 100%; }
label:has(> .select) { max-width: 100%; min-width: 0; }
.select { width: auto; min-width: 0; text-overflow: ellipsis; }

/* Account forms */
.account { max-width: 680px; margin: 0 auto; display: grid; gap: 18px; }
.tabs { display: flex; gap: 6px; }
.tab { font: inherit; font-weight: 900; cursor: pointer; flex: 1; min-width: 0; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink-soft); }
.tab[aria-selected="true"] { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.form { display: grid; gap: 14px; }
.form fieldset { border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
.form legend { font-weight: 900; padding: 0 6px; }
.form label { display: grid; gap: 4px; font-weight: 800; }
.form input[type=email], .form input[type=password] { font: inherit; font-weight: 400; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--ink); }
.form input:focus { border-color: var(--brand); outline: none; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: .95rem; }
.form .check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.form-intro { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 0; }
.hint { color: var(--ink-soft); font-size: .88rem; font-weight: 600; margin: 0; }
.form-msg { margin: 0; font-weight: 800; min-height: 1.2em; }
.form-msg.ok { color: var(--ok-text); }
.form-msg.bad { color: var(--bad); }
.nick-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nick { font-size: 1.4rem; font-weight: 900; color: var(--brand-dark); background: var(--brand-soft); border-radius: 12px; padding: 6px 14px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-pick label { display: block; cursor: pointer; }
.avatar-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-pick span { display: grid; place-items: center; width: 46px; height: 46px; font-size: 26px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.avatar-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.avatar-pick input:focus-visible + span { outline: 3px solid var(--accent); }
.link-btn { font: inherit; background: none; border: 0; color: var(--brand); text-decoration: underline; cursor: pointer; padding: 0; font-weight: 700; }
.done { text-align: center; }
.players { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.player { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; flex-wrap: wrap; }
.player.is-active { border-color: var(--ok); background: var(--ok-soft); }
.player-avatar { font-size: 2rem; }
.player-info { flex: 1; min-width: 180px; display: grid; }
.player-info span { color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
.player-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.editor { margin-top: 14px; border-top: 2px dashed var(--line); padding-top: 14px; }
.danger { margin-top: 18px; }
.danger summary { cursor: pointer; font-weight: 800; color: var(--bad); }
.danger-btn { background: var(--bad); box-shadow: 0 4px 0 #a52a2e; }

/* Level guide table */
.level-table { width: 100%; border-collapse: collapse; }
.level-table th, .level-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.level-table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.grade-links { display: flex; flex-wrap: wrap; gap: 8px; }
.grade-links a { text-decoration: none; font-weight: 800; padding: 6px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); color: var(--ink); }
.grade-links a:hover { border-color: var(--brand); color: var(--brand-dark); }
.card-level { font-size: .82rem; font-weight: 800; color: var(--brand-dark); }

/* Guides */
.guide-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.guide-card { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.guide-card:hover { color: var(--ink); border-color: var(--brand); }
.guide-card .g-emoji { font-size: 40px; text-align: left; }
.guide-card strong { display: block; font-size: 1.1rem; margin: 8px 0 4px; }
.guide-card span { color: var(--ink-soft); font-size: .93rem; }
.article { max-width: 760px; }
.article h2 { margin-top: 1.4em; }
.article .byline { color: var(--ink-soft); font-size: .9rem; font-weight: 700; }
.article .play-box { background: var(--brand-soft); border-radius: 16px; padding: 14px 18px; margin: 1.2em 0; font-weight: 700; }
.article table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }

/* Australian Curriculum */
.ac-picker { display: grid; gap: 14px; }
.ac-row { display: grid; gap: 6px; }
.ac-row .g-options { justify-content: flex-start; }
.ac-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.ac-desc { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-weight: 700; margin-bottom: 12px; }
.ac-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; font-weight: 700; background: var(--ink); color: #fff; border-radius: 6px; padding: 2px 8px; text-decoration: none; white-space: nowrap; }
a.ac-code:hover { color: #fff; background: var(--brand); }
.ac-strand { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.ac-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ac-result-group h3 { margin: 18px 0 10px; }
.ac-home { margin-top: 32px; }

/* Country switcher + chooser */
.country { position: relative; }
.country summary { list-style: none; cursor: pointer; font-weight: 900; font-size: .9rem; border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.country summary::-webkit-details-marker { display: none; }
.country[open] summary, .country summary:hover { border-color: var(--brand); }
.country ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.country li a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 800; }
.country li a:hover, .country li a[aria-current] { background: var(--brand-soft); color: var(--brand-dark); }
@media (max-width: 720px) { .country { order: 2; } }
.country-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; background: #fff3c4; font-weight: 800; font-size: .95rem; text-align: center; }
.country-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); max-width: 960px; margin: 0 auto; }
.country-card { display: grid; justify-items: center; gap: 4px; padding: 22px 14px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); text-align: center; }
.country-card:hover, .country-card.is-suggested { border-color: var(--brand); color: var(--ink); }
.country-card.is-suggested { box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.country-card .flag { font-size: 48px; line-height: 1; }
.country-card strong { font-size: 1.1rem; }
.country-card span:last-child { color: var(--ink-soft); font-size: .88rem; font-weight: 700; }

/* Game quick facts (easy for people and AI answer engines to scan) */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 18px; max-width: 900px; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.facts dt { font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 800; font-size: .92rem; }
.facts-below { margin: 16px 0 0; max-width: none; }

/* Daily challenge */
.daily-streak { margin: 0; font-weight: 900; background: #fff3c4; border-radius: 999px; padding: 8px 16px; }
.daily-share { display: grid; justify-items: center; gap: 6px; background: var(--bg); border-radius: 16px; padding: 12px 16px; }
.daily-grid { font-size: 28px; letter-spacing: 2px; margin: 0; }

/* Printable worksheets */
.ws-head h1 { margin-top: 12px; }
.ws-sheet { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; box-shadow: var(--shadow); }
.ws-sheet-head { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 14px; font-weight: 700; }
.ws-list { columns: 3 220px; column-gap: 32px; margin: 0; padding-left: 1.6em; font-size: 1.15rem; }
.ws-list li { break-inside: avoid; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ws-q { font-weight: 800; }
.ws-instr { font-weight: 700; margin: 0 0 12px; }
.ws-a { display: inline-block; min-width: 3ch; color: var(--ok-text); font-weight: 900; }
.ws-foot { margin: 14px 0 0; font-size: .8rem; color: var(--ink-soft); text-align: right; }
.ws-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 18px; }
.ws-table span { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
@media print {
  .site-header, .site-footer, .crumbs, .ws-actions, .ws-print-hide, .country-bar, .skip { display: none !important; }
  body { background: #fff; }
  .ws-head .lead { display: none; }
  .ws-sheet { box-shadow: none; border: 0; padding: 0; }
  .ws-list { font-size: 13pt; }
}

/* Badges */
.g-badges { display: grid; justify-items: center; gap: 4px; background: #fff3c4; border-radius: 16px; padding: 10px 16px; width: 100%; max-width: 520px; }
.g-badge { margin: 0; font-weight: 900; }
.badge-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.badge-card { display: grid; justify-items: center; text-align: center; gap: 4px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 12px; }
.badge-card .b-icon { font-size: 44px; line-height: 1; }
.badge-card.locked { background: #f4f5f9; border-style: dashed; }
.badge-card.locked > :first-child { filter: grayscale(1); opacity: .5; }
.badge-card.got { border-color: #ffc53d; box-shadow: 0 0 0 3px #fff3c4; }
.badge-card span { color: var(--ink-soft); font-size: .88rem; font-weight: 700; }

/* Device high scores */
.g-device-best { margin: 0; font-weight: 900; color: var(--accent-dark); }
.hs-box { width: 100%; max-width: 420px; background: var(--bg); border-radius: 16px; padding: 12px 16px; }
.hs-title { margin: 0 0 8px; font-size: 1rem; }
.hs-list { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.hs-list li { display: grid; grid-template-columns: 36px 1fr auto 70px; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 10px; font-weight: 800; }
.hs-list li.is-new { background: #fff3c4; outline: 2px solid #ffc53d; }
.hs-name { letter-spacing: .15em; font-family: ui-monospace, Menlo, monospace; }
.hs-date { color: var(--ink-soft); font-size: .82rem; text-align: right; }
.hs-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 8px; }
.hs-rank-new { font-weight: 900; width: 100%; text-align: center; }
.hs-input { width: 5.5ch; font: inherit; font-size: 1.4rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; text-align: center; border: 3px solid var(--line); border-radius: 12px; padding: 6px; font-family: ui-monospace, Menlo, monospace; }
.hs-input:focus { border-color: var(--brand); outline: none; }
.ws-clocks { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; list-style-position: inside; padding-left: 0; }
.ws-clocks li { display: grid; justify-items: center; gap: 4px; border-bottom: 0; }
.ws-line { font-weight: 700; color: var(--ink-soft); }
@media print { .ws-clocks { grid-template-columns: repeat(4, 1fr); } }

/* Test prep */
.tp-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.tp-facts dt { font-weight: 800; color: var(--muted, #5a6380); }
.tp-facts dd { margin: 0; }
.tp-facts ul { margin: 0; padding-left: 1.2em; }
.tp-facts li { margin: 4px 0; }
@media (max-width: 560px) { .tp-facts dl { grid-template-columns: 1fr; } .tp-facts dd { margin-bottom: 6px; } }
.tp-disclaimer { margin: 24px 0; padding: 12px 16px; border-left: 4px solid #c9d3f0; background: rgba(43, 89, 195, 0.05); border-radius: 8px; }

/* Homeschool planner */
.planner { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 10px 0 18px; font-size: .9rem; }
.planner th, .planner td { border: 1.5px solid #c9d3f0; padding: 6px 8px; text-align: left; vertical-align: top; }
.planner thead th { background: var(--brand-soft); }
.planner tbody th { width: 22%; font-weight: 800; }
.planner tbody td { height: 46px; }
.planner-log tbody td { height: 30px; }
.planner-h { font-size: 1.1rem; margin-top: 8px; }
.planner-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.planner-notes div { display: grid; gap: 22px; }
.planner-notes span { border-bottom: 1.5px solid #c9d3f0; height: 1px; }
@media (max-width: 640px) { .planner { font-size: .8rem; overflow-wrap: anywhere; } .planner th, .planner td { padding: 4px 3px; } .planner-notes { grid-template-columns: 1fr; } }
@media print { .planner tbody td { height: 52px; } .planner { font-size: 10pt; } }
.tracker { margin-bottom: 24px; }
.tracker .planner tbody td { height: auto; text-align: center; font-size: 1.1rem; }
.tracker .planner thead th:first-child, .tracker .planner tbody th { width: 40%; }
.tracker .planner thead th:nth-child(2) { width: 15%; }
.tracker .planner a { color: inherit; }
.tracker-pick { font-weight: 800; display: inline-flex; gap: 8px; align-items: center; }
.tracker-pick select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); }
@media print { .tracker { break-after: page; } [data-year][hidden] { display: none !important; } }

/* Timed test mode */
.g-timer { font-variant-numeric: tabular-nums; }
.g-timer.is-low { background: #ffe1e1; color: #b3261e; }
.g-choice.is-picked { border-color: var(--brand); background: var(--brand-soft); }
.g-review { width: 100%; max-width: 640px; text-align: left; display: grid; gap: 10px; }
.g-review h3 { margin: 6px 0 0; font-size: 1.1rem; }
.g-review-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.g-review-item p { margin: 6px 0 0; }
.g-review-q { font-weight: 800; }
.g-review-q .g-visual svg { max-width: 100%; height: auto; max-height: 160px; }
.g-review-pics { display: flex; gap: 14px; margin-top: 8px; }
.g-review-pics figure { margin: 0; text-align: center; font-size: .85rem; font-weight: 800; }
.g-review-pics svg { width: 72px; height: 72px; }
.tp-timed { margin: 8px 0 0; background: #fff8e1; border-color: #ffe08a; }

/* Spelling list worksheets (look, say, cover, write, check) */
.ws-sp-week { margin: 0 0 4px; font-size: 1.35rem; }
.ws-sp-how { margin: 0 0 12px; color: var(--ink-soft); font-weight: 700; }
.ws-spell { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 1.15rem; }
.ws-spell th, .ws-spell td { border: 1.5px solid var(--ink); padding: 0 10px; height: 2.6em; text-align: left; vertical-align: middle; }
.ws-spell th { height: auto; padding: 8px 10px; background: var(--brand-soft); font-size: .95rem; }
.ws-spell th:first-child, .ws-spell td:first-child { width: 28%; }
.ws-spell th:last-child, .ws-spell td:last-child { width: 14%; text-align: center; }
.ws-sp-word { font-weight: 800; font-size: 1.25rem; overflow-wrap: anywhere; }
.ws-sp-tip { margin: 12px 0 0; background: #fff8e1; border: 1px solid #ffe08a; border-radius: 12px; padding: 8px 12px; }
.ws-sp-all { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 18px; }
.ws-sp-set { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.ws-sp-set h3 { margin: 0 0 8px; font-size: 1.05rem; }
.ws-sp-set p { margin: 8px 0 0; font-size: .9rem; color: var(--ink-soft); }
.ws-sp-words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ws-sp-words li { background: var(--bg); border-radius: 8px; padding: 3px 9px; font-weight: 800; }
@media (max-width: 560px) {
  .ws-spell { font-size: 1rem; }
  .ws-spell th, .ws-spell td { padding: 0 6px; }
  .ws-spell th { padding: 6px; font-size: .8rem; }
  .ws-sp-word { font-size: 1.05rem; }
}
@media print {
  .ws-sp-week { font-size: 16pt; }
  .ws-spell { font-size: 14pt; }
  .ws-spell th, .ws-spell td { height: 1.75cm; }
  .ws-spell th { height: auto; background: #eef1fb; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ws-sp-word { font-size: 16pt; }
  .ws-spell tr { break-inside: avoid; }
}

/* Classroom mode */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.class-cols { display: grid; gap: 16px; grid-template-columns: 1fr 2fr; align-items: start; }
@media (max-width: 860px) { .class-cols { grid-template-columns: 1fr; } }
.class-join, .class-new, .class-add { margin: 12px 0; display: grid; gap: 6px; }
.class-join .g-form, .class-new .g-form, .class-add .g-form, .class-danger .g-form { justify-content: flex-start; flex-wrap: wrap; }
.class-join .g-input { max-width: 180px; text-transform: uppercase; letter-spacing: .12em; }
.class-add .g-input { max-width: 110px; }
.class-names { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 12px; }
.class-name { font: inherit; font-weight: 800; font-size: 1.05rem; padding: 14px 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.class-name:hover, .class-name:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.class-detail { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.class-code { display: inline-flex; flex-direction: column; background: var(--brand-soft); border-radius: 14px; padding: 8px 18px; margin: 4px 0 10px; }
.class-code span { font-size: .8rem; font-weight: 800; color: var(--ink-soft); }
.class-code strong { font-size: 2rem; letter-spacing: .2em; color: var(--brand-dark); }
.table-wrap { overflow-x: auto; margin: 10px 0 18px; }
.class-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.class-table th, .class-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; white-space: nowrap; }
.class-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.class-danger { margin-top: 18px; }
.class-danger summary { cursor: pointer; font-weight: 800; }
.class-danger .g-form { margin: 10px 0; }
.link-btn.danger { color: #b3261e; }
.class-cards { display: none; }
@media print {
  body.printing-cards > *:not(.class-cards) { display: none !important; }
  body.printing-cards .class-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; }
  .class-card { border: 1.5px dashed #888; border-radius: 10px; padding: 6mm; display: grid; gap: 2mm; text-align: center; break-inside: avoid; font-size: 10pt; }
  .class-card strong { font-size: 14pt; }
  .class-card-av { font-size: 28pt; }
  .class-card-url { font-size: 8pt; word-break: break-all; }
}
.hw-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.hw-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 800; text-decoration: none; color: var(--ink); }
a.hw-item:hover { border-color: var(--brand); }
.hw-item.is-done { border-color: #3fbf6f; background: #effaf2; }
.hw-emoji { font-size: 1.3rem; }
.hw-done { font-size: .85rem; color: #1f8a4c; }
.hw-pick { margin: 6px 0 16px; }
.hw-pick summary { list-style: none; display: inline-flex; }
.hw-pick summary::-webkit-details-marker { display: none; }
.hw-pick fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 8px 12px; }
.hw-pick legend { font-weight: 800; padding: 0 6px; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.hw-missing { color: var(--ink-soft); }

/* Printable certificate (three-star rounds) */
.g-cert { display: grid; justify-items: center; gap: 6px; }
.g-cert .g-input { max-width: 220px; }
.cert-sheet { display: none; }
@media print {
  @page cert { size: landscape; margin: 10mm; }
  .cert-sheet { page: cert; }
  body.printing-cert > *:not(.cert-sheet) { display: none !important; }
  body.printing-cert .cert-sheet { display: block; }
  .cert { box-sizing: border-box; height: 180mm; border: 6mm solid #2b59c3; outline: 2mm solid #ffc53d; outline-offset: -10mm; border-radius: 6mm; padding: 18mm 20mm; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 3mm; color: #1b2340; }
  .cert-stars { font-size: 30pt; color: #ffb800; letter-spacing: 6mm; }
  .cert-kicker { font-size: 30pt; font-weight: 900; margin: 0; color: #2b59c3; }
  .cert-line { font-size: 14pt; margin: 0; }
  .cert-name { font-size: 34pt; font-weight: 900; margin: 2mm 0; border-bottom: 1px solid #c9d3f0; display: inline-block; align-self: center; padding: 0 10mm; }
  .cert-game { font-size: 22pt; font-weight: 900; margin: 0; }
  .cert-foot { display: flex; justify-content: space-between; margin-top: 8mm; font-size: 11pt; text-align: left; }
  .cert-foot span:last-child { text-align: right; font-weight: 800; }
}

/* Best games roundup */
.best-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.best-item { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.best-item h3 { margin: 2px 0 4px; font-size: 1.15rem; }
.best-item p { margin: 0 0 4px; }
.best-rank { font-weight: 900; font-size: 1.4rem; color: var(--brand-dark); min-width: 1.6em; }
.best-emoji { font-size: 2rem; line-height: 1; }
.best-label { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: color-mix(in srgb, var(--accent) 55%, #000); }

/* Skill pages */
.skill-examples { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.skill-examples li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.skill-examples details summary, .skill-clocks details summary { cursor: pointer; color: var(--brand-dark); font-size: .85rem; }
.skill-clocks { display: flex; flex-wrap: wrap; gap: 16px; }
.skill-clocks figure { margin: 0; text-align: center; font-weight: 800; }

/* My progress */
.prog-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.prog-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; display: grid; }
.prog-stats strong { font-size: 1.6rem; color: var(--brand-dark); }
.prog-stats span { font-size: .85rem; font-weight: 800; color: var(--ink-soft); }
.prog-year select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); margin-left: 6px; }
.prog-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.prog-game { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.prog-game ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: .92rem; }
.prog-title { font-weight: 900; text-decoration: none; color: var(--ink); }
.prog-stars { color: #e3a008; letter-spacing: 1px; }

/* Glossary */
.glossary { display: grid; gap: 8px; margin: 0 0 24px; }
.glossary > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; scroll-margin-top: 80px; }
.glossary dt { font-weight: 900; font-size: 1.05rem; }
.glossary dd { margin: 2px 0 0; }
.gl-ex { display: block; color: var(--ink-soft); font-size: .92rem; }
.glossary-jump a { font-weight: 800; }

/* Embed mode (?embed=1): only the game and a small credit line */
.embed-credit { display: none; }
html.embed body { background: transparent; }
html.embed .site-header, html.embed .site-footer, html.embed .skip, html.embed .country-bar { display: none !important; }
html.embed main > :not(.wrap) { display: none !important; }
html.embed main > .wrap > :not(#game):not(.embed-credit) { display: none !important; }
html.embed main > .wrap { padding: 0; max-width: none; }
html.embed .embed-credit { display: block; text-align: center; font-size: .85rem; margin: 8px 0 0; }
.embed-panel summary { cursor: pointer; }
.embed-code { width: 100%; font: .85rem/1.4 ui-monospace, monospace; padding: 10px; border: 2px solid var(--line); border-radius: 10px; margin: 8px 0; resize: vertical; }

/* Printable charts */
.mchart, .hchart { border-collapse: collapse; width: 100%; table-layout: fixed; font-weight: 800; text-align: center; }
.mchart th, .mchart td, .hchart td { border: 1.5px solid #c9d3f0; padding: 6px 0; font-size: clamp(.75rem, 2.4vw, 1rem); }
.mchart thead th, .mchart tbody th { background: var(--brand-soft); color: var(--brand-dark); }
.mchart td.sq { background: #fff3c4; }
.hchart td { height: 2.4em; }
.fwall { display: grid; gap: 4px; }
.fw-row { display: flex; gap: 0; border: 1.5px solid #1b2340; border-radius: 6px; overflow: hidden; }
.fw-row span { flex: 1; text-align: center; padding: 8px 0; font-weight: 800; font-size: clamp(.6rem, 2vw, .95rem); border-right: 1.5px solid #1b2340; }
.fw-row span:last-child { border-right: 0; }
.fw-row:nth-child(1) span { background: #ffd6d6; } .fw-row:nth-child(2) span { background: #ffe5c2; } .fw-row:nth-child(3) span { background: #fff3b0; }
.fw-row:nth-child(4) span { background: #d8f5d0; } .fw-row:nth-child(5) span { background: #cfe8ff; } .fw-row:nth-child(6) span { background: #e0dcff; }
.fw-row:nth-child(7) span { background: #f6d4f0; } .fw-row:nth-child(8) span { background: #d5f2ef; } .fw-row:nth-child(9) span { background: #eef0f5; }
@media print { .chart-modes { display: none !important; } .mchart th, .mchart td, .hchart td { font-size: 11pt; padding: 5px 0; } .fw-row span { font-size: 10pt; } }

/* Home: today's challenges */
.today { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding-top: 8px; }
.today-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.today-card:hover { border-color: var(--brand); color: var(--ink); }
.today-card strong { display: block; }
.today-card span span { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.today-emoji { font-size: 2rem; }

/* Award certificates page */
.cert-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0; }
.cert-form label { display: grid; gap: 4px; font-weight: 800; font-size: .9rem; }
.cert-form input, .cert-form select { font: inherit; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; min-width: 180px; }
.cert-screen { box-sizing: border-box; max-width: 900px; margin: 0 auto; aspect-ratio: 297 / 210; border: 14px solid #2b59c3; outline: 4px solid #ffc53d; outline-offset: -26px; border-radius: 14px; background: #fff; padding: 6% 7%; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 6px; color: #1b2340; }
.cert-screen .cert-stars { font-size: clamp(1rem, 4vw, 2.2rem); color: #e3a008; letter-spacing: .4em; }
.cert-screen .cert-kicker { font-size: clamp(1.2rem, 5vw, 2.6rem); font-weight: 900; color: #2b59c3; margin: 0; }
.cert-screen .cert-line { margin: 0; font-size: clamp(.8rem, 2vw, 1.1rem); }
.cert-screen .cert-name { font-size: clamp(1.4rem, 6vw, 3rem); font-weight: 900; margin: 4px auto; border-bottom: 1px solid #c9d3f0; padding: 0 1em; max-width: 100%; overflow-wrap: anywhere; }
.cert-screen .cert-foot { display: flex; justify-content: space-between; margin-top: 4%; font-size: clamp(.7rem, 1.8vw, 1rem); font-weight: 700; }
@media print {
  .cert-preview { page: cert; }
  .cert-screen { max-width: none; width: 100%; height: 180mm; aspect-ratio: auto; border-width: 6mm; outline-width: 2mm; outline-offset: -10mm; }
}
.ws-list.ws-compact { columns: 4 130px; column-gap: 20px; font-size: .98rem; }
.ws-list.ws-compact li { margin-bottom: 2px; }
@media print { .ws-list.ws-compact { columns: 4; font-size: 11pt; } }

/* Site search */
.search-link { text-decoration: none; font-size: 1.1rem; padding: 4px 6px; border-radius: 999px; }
.search-link:hover { background: var(--brand-soft); }
.site-search { max-width: 640px; margin: 0 auto; }
.site-search .search { width: 100%; }
.search-results { display: grid; gap: 10px; max-width: 760px; margin: 0 auto 32px; }
.search-hit { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.search-hit:hover { border-color: var(--brand); color: var(--ink); }
.search-hit strong { display: block; }
.search-hit span span:last-child { color: var(--ink-soft); font-size: .92rem; }
.search-kind { display: block; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); }
.search-emoji { font-size: 1.6rem; }
.link-box { margin: 10px 0 18px; } .link-box h3 { margin: 0; font-size: 1rem; }
.rchart { border-collapse: collapse; width: 100%; table-layout: fixed; }
.rchart th, .rchart td { border: 1.5px solid #c9d3f0; padding: 10px 4px; text-align: center; font-weight: 800; }
.rchart thead th { background: var(--brand-soft); color: var(--brand-dark); }
.rchart tbody th { text-align: left; width: 34%; padding-left: 10px; height: 2.6em; }
.rchart td { font-size: 1.5rem; color: #e3a008; }
.rchart-foot { margin-top: 14px; font-weight: 800; }
.ws-list.ws-wide { columns: 1; font-size: 1.05rem; }
.ws-list.ws-wide li { margin-bottom: 14px; padding-bottom: 18px; border-bottom: 1px dashed #c9d3f0; }
.ws-list.ws-wide .ws-q { font-weight: 700; }

/* Handwriting sheets: guide lines placed from Andika's metrics (ascent 1.22em, x-height .51em, ascender .79em, descent .39em),
   so the baseline sits at 1.22em in a 1.61em line: top line .43em, dashed middle .71em, baseline 1.22em. */
.ws-trace { font-family: 'Andika', 'Comic Sans MS', sans-serif; font-size: clamp(26px, 7vw, 40px); }
.ws-tr-row { margin-bottom: .3em; }
.ws-tr-line { height: 1.61em; line-height: 1.61em; white-space: nowrap; overflow: hidden; padding-left: .2em;
  background:
    linear-gradient(#9aa6c8, #9aa6c8) 0 .43em / 100% 1.5px no-repeat,
    repeating-linear-gradient(to right, #b5bfdb 0 8px, transparent 8px 14px) 0 .71em / 100% 1.5px no-repeat,
    linear-gradient(#4b5a8a, #4b5a8a) 0 1.22em / 100% 2px no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ws-tr-m { color: var(--ink); margin-right: .6em; }
.ws-tr-g { color: #b9c0d3; margin-right: .6em; }
.ws-tr-row:has(.ws-tr-line + .ws-tr-line) { font-size: .72em; margin-bottom: .5em; }
@media print { .ws-trace { font-size: 25pt; } .ws-tr-row { margin-bottom: .2em; } .ws-tr-row { break-inside: avoid; } .ws-tr-g { color: #aeb5c8; } }

/* Times tables hub */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tt-tile { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; background: #fff; border: 2px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); }
.tt-tile strong { font-size: 1.8rem; font-weight: 900; color: var(--brand-dark); }
.tt-tile span { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.tt-tile:hover, .tt-tile:focus-visible { border-color: var(--brand); }
/* Sight words lists and printable flash cards */
.sw-meta { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.sw-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sw-cards li { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; font-size: 1.25rem; font-weight: 800; }
@media print {
  .sw-set { break-before: page; }
  .sw-set:first-of-type { break-before: auto; }
  .sw-cards { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .sw-cards li { border: 1px dashed #888; border-radius: 0; padding: 1.1cm 4px; font-size: 26pt; break-inside: avoid; }
}

/* Worksheet generator */
.ws-maker-form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.ws-maker-form > label { display: grid; gap: 4px; font-weight: 800; }
.ws-maker-form fieldset { border: 0; padding: 0; margin: 0; flex-basis: 100%; }
.ws-maker-form legend { font-weight: 800; margin-bottom: 4px; }
.ws-maker-tables { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-maker-tables label { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; font-weight: 800; background: #fff; }
.ws-maker-title { flex: 1 1 220px; }
@media print { .ws-maker-form { display: none !important; } }

/* Printable mazes */
.ws-mazes { display: grid; gap: 18px; justify-items: center; }
.ws-mazes-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ws-maze { width: 100%; max-width: 640px; }
.ws-maze svg { width: 100%; height: auto; display: block; }
.ws-maze-sol { stroke: #ff8a1f; opacity: 0; }
.show-sol .ws-maze-sol { opacity: .85; }
@media print { .ws-maze svg { max-height: 22cm; } .ws-mazes-2 .ws-maze svg { max-height: 10.5cm; } .ws-mazes-2 { grid-template-columns: 1fr; } }
