/* THE SITE SHELL AND THE NEW HOME PAGES (redesign stage 1, 8 Nov 2026).
   1. Fonts and colours (light, and dark when the device asks for it)
   2. The shell: sidebar, top bar, Subjects menu, language menu, the phone menu (en/engine/shell.js builds it)
   3. The landing page (index.html) and the home page (en/index.html), drawn by en/engine/home.js
   4. Game pages (stage 2): the path in the top bar, the game and its side panel, Close reading (en/engine/app.js, NEW_UI)
   5. Subject pages, the word list and My progress (stage 3; app.js), then Reading Comprehension, the Daily Circuit page and login
   6. The Chinese version (stage 4): the same pages in Chinese
   7. After the rebuild (8 Nov 2026): Listen beside the game's name, calmer feedback, the top bar staying in view on computers
   8. The Staff Room (9 Nov 2026): the teacher page in the shell (teacher/index.html; shell.js data-staff)
   Everything is prefixed aea- so nothing clashes with the game pages (en/engine/styles.css) or css/home.css. */

/* ---------- 1. Fonts and colours ---------- */
@font-face { font-family: "Gloock"; src: url("../fonts/gloock-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
:root {
  --sh-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sh-serif: "Gloock", Georgia, "Times New Roman", serif;
  --sh-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sh-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sh-bg: #f5f6fa; --sh-side: #edf1f9; --sh-card: #ffffff; --sh-ink: #151935; --sh-ink2: #2f3553; --sh-muted: #5b6182;
  --sh-line: #dde0eb; --sh-line2: #e3e5ee; --sh-soft: #f0f2f8; --sh-hover: #e0e7f6; --sh-on: #d9e3f7; --sh-on-ink: #1a4fa0;
  --sh-link: #1a5cb0; --sh-off: #8a90ad; --sh-yellow: #ffe14d; --sh-yellow-hover: #ffd60a; --sh-navy: #151935; --sh-navy-ink: #ffffff;
  --sh-navy-muted: #d3d6ea; --sh-green: #17825a; --sh-green-ink: #11694a; --sh-green-soft: #e3f4ea; --sh-red-ink: #9b1c1c;
  --sh-flame: #c2410c; --sh-track: #e2e4ec; --sh-fill: #2e7d4f; --sh-switch-off: #8a90ad; --sh-pill: #eef0f6; --sh-shadow: rgba(21,25,53,.16);
  --sh-fc-bg: #eef3fb; --sh-fc-line: #dbe4f4; --sh-fc-edge: #c3d2ee; --sh-fc-l2: #f4f7fd; --sh-fc-l3: #dfe7f5; --sh-say: #e8effc; --sh-btn-line: #c9d3e8;
  --sh-st-new-bg: #eef0f6; --sh-st-new: #4a4f6e; --sh-st-learn-bg: #fdf0d5; --sh-st-learn: #7a4a00; --sh-st-fam-bg: #e1ecfb; --sh-st-fam: #1a4fa0;
  --sh-st-known-bg: #e3f4ea; --sh-st-known: #11694a; --sh-bar-known: #17825a; --sh-bar-fam: #1a5cb0; --sh-bar-learn: #e0a526; --sh-bar-new: #c9cedd;
  --sh-near: #9a5b00;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --sh-bg: #11152a; --sh-side: #161b33; --sh-card: #1a1f38; --sh-ink: #e8ebf6; --sh-ink2: #c9cee3; --sh-muted: #a9b0cc;
  --sh-line: #2c3354; --sh-line2: #262c4a; --sh-soft: #20264a; --sh-hover: #232a4d; --sh-on: #263264; --sh-on-ink: #c3d2ff;
  --sh-link: #9db1ff; --sh-off: #6f7698; --sh-yellow: #f2d43a; --sh-yellow-hover: #ffe14d; --sh-navy: #0b0e1f; --sh-navy-ink: #ffffff;
  --sh-navy-muted: #c3c8e2; --sh-green: #3fb27f; --sh-green-ink: #6fdcaa; --sh-green-soft: #163a2c; --sh-red-ink: #ff8a78;
  --sh-flame: #ff9a5a; --sh-track: #2c3354; --sh-fill: #5fd39a; --sh-switch-off: #5d6488; --sh-pill: #252b4d; --sh-shadow: rgba(0,0,0,.45); color-scheme: dark;
  --sh-fc-bg: #171d38; --sh-fc-line: #2a3358; --sh-fc-edge: #36427a; --sh-fc-l2: #1d2444; --sh-fc-l3: #232b52; --sh-say: #263264; --sh-btn-line: #36406a;
  --sh-st-new-bg: #262c4a; --sh-st-new: #c9cee3; --sh-st-learn-bg: #3a2c12; --sh-st-learn: #f3c56b; --sh-st-fam-bg: #1d2c55; --sh-st-fam: #9db1ff;
  --sh-st-known-bg: #163a2c; --sh-st-known: #6fdcaa; --sh-bar-known: #3fb27f; --sh-bar-fam: #6f8fff; --sh-bar-learn: #e0a526; --sh-bar-new: #3a4268;
  --sh-near: #f3c56b; } }
:root[data-theme="dark"] {
  --sh-bg: #11152a; --sh-side: #161b33; --sh-card: #1a1f38; --sh-ink: #e8ebf6; --sh-ink2: #c9cee3; --sh-muted: #a9b0cc;
  --sh-line: #2c3354; --sh-line2: #262c4a; --sh-soft: #20264a; --sh-hover: #232a4d; --sh-on: #263264; --sh-on-ink: #c3d2ff;
  --sh-link: #9db1ff; --sh-off: #6f7698; --sh-yellow: #f2d43a; --sh-yellow-hover: #ffe14d; --sh-navy: #0b0e1f; --sh-navy-ink: #ffffff;
  --sh-navy-muted: #c3c8e2; --sh-green: #3fb27f; --sh-green-ink: #6fdcaa; --sh-green-soft: #163a2c; --sh-red-ink: #ff8a78;
  --sh-flame: #ff9a5a; --sh-track: #2c3354; --sh-fill: #5fd39a; --sh-switch-off: #5d6488; --sh-pill: #252b4d; --sh-shadow: rgba(0,0,0,.45); color-scheme: dark;
  --sh-fc-bg: #171d38; --sh-fc-line: #2a3358; --sh-fc-edge: #36427a; --sh-fc-l2: #1d2444; --sh-fc-l3: #232b52; --sh-say: #263264; --sh-btn-line: #36406a;
  --sh-st-new-bg: #262c4a; --sh-st-new: #c9cee3; --sh-st-learn-bg: #3a2c12; --sh-st-learn: #f3c56b; --sh-st-fam-bg: #1d2c55; --sh-st-fam: #9db1ff;
  --sh-st-known-bg: #163a2c; --sh-st-known: #6fdcaa; --sh-bar-known: #3fb27f; --sh-bar-fam: #6f8fff; --sh-bar-learn: #e0a526; --sh-bar-new: #3a4268;
  --sh-near: #f3c56b; }

/* ---------- 2. The shell ---------- */
html.aea-shelled body { margin: 0; }
.aea-shell { display: flex; align-items: stretch; min-height: 100vh; font-family: var(--sh-body); }
/* the sidebar's colour all the way down, however long the page */
@media (min-width: 860px) { .aea-shell { background: linear-gradient(to right, var(--sh-side) 248px, transparent 248px); } }
.aea-shell *, .aea-shell *::before, .aea-shell *::after { box-sizing: border-box; }
.aea-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.aea-skip { position: absolute; left: 16px; top: -120px; z-index: 100; background: var(--sh-navy); color: var(--sh-navy-ink); padding: 12px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.aea-skip:focus { top: 16px; }
.aea-shell a:focus-visible, .aea-shell button:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.aea-i { flex: none; display: block; }
.aea-logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aea-logo-light { display: none !important; } :root:not([data-theme="light"]) .aea-logo-dark { display: block !important; } }
:root[data-theme="dark"] .aea-logo-light { display: none !important; } :root[data-theme="dark"] .aea-logo-dark { display: block !important; }

/* Sidebar */
.aea-side { flex: 0 0 248px; width: 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px; padding: 0 12px 24px; background: var(--sh-side); color: var(--sh-ink);
  font-size: 16px; line-height: 1.35; z-index: 40; }
.aea-brand { height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.aea-brand-a { display: block; line-height: 0; border-radius: 6px; }
.aea-logo { width: 180px; height: auto; display: block; }
.aea-close { display: none; }
.aea-me { display: none; }
.aea-lang { position: relative; flex: none; }
.aea-lang-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--sh-line); border-radius: 10px;
  background: var(--sh-card); color: var(--sh-ink); font: 700 15px/1 var(--sh-body); cursor: pointer; text-align: left; }
.aea-lang-btn > span:first-of-type { flex: 1; }
.aea-lang-btn:hover { border-color: var(--sh-muted); }
.aea-lang-list { position: absolute; left: 0; right: 0; top: 50px; z-index: 5; list-style: none; margin: 0; padding: 6px; background: var(--sh-card);
  border: 1px solid var(--sh-line); border-radius: 12px; box-shadow: 0 12px 32px var(--sh-shadow); }
.aea-lang-list[hidden] { display: none; }
.aea-lang-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: 8px;
  color: var(--sh-ink); text-decoration: none; font-size: 15px; }
.aea-lang-list a[aria-current] { font-weight: 700; }
.aea-lang-list a:hover { background: var(--sh-soft); }
.aea-lang-list [lang="zh-CN"] { font-family: var(--sh-zh); }
.aea-lang-list small { font-size: 13px; color: var(--sh-muted); }
.aea-navs { display: flex; flex-direction: column; gap: 14px; }   /* tighter since 11 Nov 2026 (teacher: "crush the left sidebar menu") */
.aea-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.aea-nav { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 3px 12px; border-radius: 9px; color: var(--sh-ink2); text-decoration: none; font-size: 16px; line-height: 1.25; }
a.aea-nav:hover { background: var(--sh-hover); color: var(--sh-ink); }
.aea-nav.on { background: var(--sh-on); color: var(--sh-on-ink); font-weight: 700; }
.aea-nav.off { color: var(--sh-off); cursor: default; }
/* My subjects: close together (a long name wraps, tightly) */
.aea-mine .aea-subject, .aea-shared .aea-subject { min-height: 30px; padding-top: 4px; padding-bottom: 4px; gap: 10px; font-size: 15px; line-height: 1.2; }
.aea-mine .aea-dot, .aea-shared .aea-dot { width: 16px; }
.aea-dot { flex: none; width: 20px; display: flex; justify-content: center; }
.aea-dot i { display: block; width: 9px; height: 9px; border-radius: 50%; }
.aea-sec { display: flex; flex-direction: column; gap: 2px; }
.aea-sec-h { margin: 0 12px 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sh-muted); }
.aea-hint { margin: 4px 12px 0; font-size: 14px; }
.aea-hint a, .aea-linkbtn { color: var(--sh-link); font-weight: 700; }
.aea-linkbtn { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* Subjects: the first thing in the menu, so it stands out (11 Nov 2026) */
button.aea-nav { width: 100%; border: 0; background: transparent; font-family: var(--sh-body); text-align: left; cursor: pointer; }
.aea-nav.aea-subjects-btn { min-height: 44px; margin-bottom: 4px; background: var(--sh-navy); color: var(--sh-navy-ink); font-weight: 700; }
.aea-nav.aea-subjects-btn > span { flex: 1; }
.aea-nav.aea-subjects-btn:hover, .aea-nav.aea-subjects-btn.on { background: var(--sh-navy); color: var(--sh-navy-ink); opacity: .9; }
.aea-nav.aea-subjects-btn.on .aea-i:last-child { transform: rotate(180deg); }

/* Main column and top bar */
.aea-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.aea-top { position: relative; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-height: 64px;
  padding: 10px clamp(16px, 2.6vw, 40px); background: var(--sh-card); border-bottom: 1px solid var(--sh-line2); color: var(--sh-ink);
  font-family: var(--sh-body); font-size: 16px; line-height: 1.3; }
.aea-menu-btn, .aea-top-logo { display: none; }
/* The Subjects panel (11 Nov 2026): beside the sidebar, level with its Subjects button; the whole screen on phones */
.aea-pick { position: fixed; z-index: 75; left: 256px; top: var(--pick-top, 72px); width: min(560px, calc(100vw - 280px)); max-height: calc(100vh - var(--pick-top, 72px) - 16px);
  overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; background: var(--sh-card); color: var(--sh-ink);
  border: 1px solid var(--sh-line); border-radius: 14px; box-shadow: 0 18px 48px var(--sh-shadow); font: 400 16px/1.35 var(--sh-body); }
.aea-pick[hidden] { display: none; }
.aea-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 0 20px; }
.aea-pick-head h2 { margin: 0; font: 400 26px/1.1 var(--sh-serif); }
.aea-pick-x { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--sh-ink); cursor: pointer; }
.aea-pick-x:hover { background: var(--sh-soft); }
.aea-pick-lead { margin: 4px 20px 6px; font-size: 14px; color: var(--sh-ink2); }
.aea-pick-groups { padding: 4px 12px 8px; columns: 2 230px; column-gap: 14px; }
.aea-pick-g { break-inside: avoid; padding: 8px 0 6px; }
.aea-pick-g h3 { margin: 0 8px 2px; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .08em; text-transform: uppercase; }
.aea-pick-g ul { list-style: none; margin: 0; padding: 0; }
.aea-pick-row { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px 0 8px; border-radius: 9px; }
.aea-pick-row:hover { background: var(--sh-soft); }
.aea-pick-row input { flex: none; width: 19px; height: 19px; margin: 0; accent-color: var(--sh-green); cursor: pointer; }
.aea-pick-row input:disabled { cursor: default; }
.aea-pick-row label { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 4px; cursor: pointer; }
.aea-pick-row.always label { cursor: default; }
.aea-pick-row .nm { font-size: 15px; font-weight: 700; line-height: 1.25; }
.aea-pick-row .note { font: 400 11px/1.4 var(--sh-mono); letter-spacing: .04em; color: var(--sh-muted); }
.aea-pick-go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--sh-muted); }
.aea-pick-go:hover { background: var(--sh-card); color: var(--sh-ink); }
.aea-page a.aea-pick-go { color: var(--sh-muted); }
.aea-pick-row input:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.aea-pick-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 10px 14px 14px; background: var(--sh-card); border-top: 1px solid var(--sh-line2); }
.aea-pick-done { min-height: 42px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--sh-navy); color: var(--sh-navy-ink); font: 700 15px/1 var(--sh-body); cursor: pointer; }
.aea-pick-done:hover { opacity: .9; }
.aea-pick button:focus-visible, .aea-pick a:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.aea-lvl { flex: none; padding: 1px 8px; border-radius: 99px; background: var(--sh-green-soft); color: var(--sh-green-ink); font: 400 12px/1.6 var(--sh-mono); }
.aea-soon { flex: none; padding: 1px 8px; border-radius: 99px; border: 1px dashed var(--sh-line); font: 400 12px/1.6 var(--sh-mono); }

/* Days in a row, points and the name (points.js and account.js draw the last two; restyled here) */
.aea-top-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.aea-streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; color: var(--sh-ink); }
.aea-streak[hidden] { display: none; }
.aea-streak .aea-i { color: var(--sh-flame); stroke-width: 2.2; }
.aea-streak i { font: 400 12px/1 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--sh-muted); }
.aea-shell .acct-wrap { gap: 8px 20px; }
.aea-shell .pts { gap: 20px; padding: 0; font-size: 15px; color: var(--sh-ink); }
.aea-shell .pts-v { gap: 6px; }
.aea-shell .pts-v i { font: 400 12px/1 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; opacity: 1; color: var(--sh-muted); }
.aea-shell .pts-v b { font: 700 18px/1 var(--sh-body); }
.gp-label, .reading-points { font: 600 12px/1.4 var(--sh-mono); letter-spacing: .03em; color: var(--sh-ink); }
.reading-points { display: inline-block; position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lvl-k .reading-points, .aea-hello-lvl .reading-points, .g-hstats .reading-points { margin-inline-start: 12px; }
.business-current-level .lvl-k:has(.reading-points) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px .5em; }
.business-current-level .lvl-k .reading-points { margin-inline-start: auto; }
.g-level > .reading-points { margin-top: 5px; }
.score-delta { position:absolute; top:100%; right:0; white-space:nowrap; padding:3px 7px; border-radius:5px; background:var(--sh-card,#fff); color:var(--sh-ink,#242424); z-index:2; font:700 14px/1.3 var(--sh-body); pointer-events:none; }
.score-delta.up { color:#197148; }
.score-delta.down { color:#b43932; }
@media (prefers-reduced-motion:no-preference) {
  .score-delta { animation:score-delta-fade 1.4s ease-out forwards; }
  @keyframes score-delta-fade { 0%,65% {opacity:1} 100% {opacity:0} }
}
.aea-shell .pts-v small { font: 400 12px/1 var(--sh-mono); opacity: 1; color: var(--sh-muted); margin-left: -4px; }
.aea-shell .acct-chip { min-height: 40px; padding: 0 16px; border-radius: 99px; font-size: 15px; opacity: 1; max-width: 16em; }
.aea-shell .acct-chip.on { background: var(--sh-pill); border-color: transparent; color: var(--sh-ink); }
.aea-shell .acct-chip.on:hover { background: var(--sh-hover); }
.aea-shell .acct-chip:not(.on):not(.warn) { background: var(--sh-navy); border-color: var(--sh-navy); color: var(--sh-navy-ink); border-radius: 10px; padding: 0 18px; }
.aea-shell .acct-chip:not(.on):not(.warn):hover { opacity: .9; }
.aea-shell .ui-sw { min-height: 34px; }
.aea-shell .acct-chip .acct-dot { background: #2e9d5b; }

/* The page inside: its own points bar, Log in button and mouse logo are now in the shell; its back link stays */
.aea-content { flex: 1; min-width: 0; outline: none; }
html.aea-shelled .aea-content .home-mark,
html.aea-shelled .aea-content .acct-wrap,
html.aea-shelled .aea-content .topline > .acct-chip { display: none !important; }
html.aea-shelled .aea-content .topline:not(:has(.back)) { display: none; }
html.aea-shelled .aea-content .pts-line-end { display: none; }   /* points.js's bar on a page with no back link: the shell shows the points */
html.aea-shelled .aea-content h1::after { content: none; }      /* the old yellow line under headings (css/home.css) */

/* During a Daily Circuit station or a class game the bar along the bottom starts beside the sidebar (styles.css draws it) */
@media (min-width: 860px) { html.aea-shelled .cc-bar { left: 248px; } }
html.aea-shelled .cc-in { max-width: 1500px; margin: 0; padding: 0 clamp(0px, 1.6vw, 24px); }

/* Phones and small tablets: the sidebar becomes a menu that slides in */
@media (max-width: 859.98px) {
  .aea-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(318px, 86vw); height: auto; transform: translateX(-105%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 8px 0 24px var(--sh-shadow); z-index: 70; gap: 14px; }
  html.aea-menu-open .aea-side { transform: none; visibility: visible; transition: transform .22s ease; }
  html.aea-menu-open { overflow: hidden; }
  .aea-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(21,25,53,.5); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s; }
  html.aea-menu-open .aea-scrim { opacity: 1; visibility: visible; transition: opacity .2s; }
  .aea-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--sh-ink); cursor: pointer; }
  .aea-logo { width: 150px; }
  .aea-me { display: block; padding: 12px 14px; border-radius: 12px; background: var(--sh-card); border: 1px solid var(--sh-line); }
  .aea-me .acct-wrap { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
  .aea-me .pts { flex-wrap: wrap; gap: 6px 16px; }
  .aea-top { min-height: 56px; padding: 6px 12px 6px 6px; gap: 6px; flex-wrap: nowrap; }
  .aea-menu-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--sh-ink); cursor: pointer; }
  .aea-top-logo { display: block; flex: none; line-height: 0; }
  .aea-logo-sm { width: 128px; height: auto; display: block; }
  .aea-pick { inset: 0; width: auto; max-height: none; border-radius: 0; border: 0; z-index: 90; }
  .aea-pick-groups { columns: 1; }
  .aea-pick-row { min-height: 46px; }
  .aea-top-end { gap: 10px; flex-wrap: nowrap; min-width: 0; }
  .aea-top-end .pts { display: none; }
  .aea-top-end .pts[data-scoring-trial] { display:inline-flex; gap:9px; }
  .aea-top-end .pts[data-scoring-trial] .pts-v { gap:3px; }
  .aea-top-end .pts[data-scoring-trial] .pts-v b { font-size:15px; }
  .aea-top-end .score-delta, .reading-points .score-delta { position:fixed; top:auto; right:12px; bottom:max(16px,env(safe-area-inset-bottom)); padding:6px 10px; border:1px solid var(--sh-line); z-index:40; }
  .reading-points .score-delta { bottom:calc(max(16px,env(safe-area-inset-bottom)) + 34px); }
  .aea-streak i { display: none; }
  .aea-shell .aea-top-end .acct-chip { max-width: 9.5em; padding: 0 12px; }
  .aea-shell .aea-top-end .ui-sw { display: none; }
}
@media (max-width: 619px) {
  .aea-top:has([data-scoring-trial]) { flex-wrap:wrap; }
  .aea-top-end:has([data-scoring-trial]), .aea-top-end .acct-wrap:has([data-scoring-trial]) { display:contents; }
  .aea-top:has([data-scoring-trial]) .aea-top-logo { margin-right:auto; }
  .aea-top-end .pts[data-scoring-trial] { order:5; flex:1 0 100%; justify-content:center; gap:clamp(9px,4vw,24px); padding:5px 0; }
}
@media (max-width: 859.98px) and (prefers-reduced-motion: reduce) { .aea-side, .aea-scrim { transition: none !important; } }
@media (min-width: 860px) { .aea-scrim { display: none; } }
@media print { .aea-side, .aea-top, .aea-scrim { display: none !important; } }

/* ---------- 3. The landing page and the home page ---------- */
body.aea-page { margin: 0; background: var(--sh-bg); color: var(--sh-ink); font-family: var(--sh-body); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.aea-page a { color: var(--sh-link); }
.aea-page a:hover { color: var(--sh-ink); }
/* …but not the sidebar and menus, which look the same on every page */
.aea-page .aea-side a.aea-nav { color: var(--sh-ink2); }
.aea-page .aea-side a.aea-nav:hover { color: var(--sh-ink); }
.aea-page .aea-side a.aea-nav.on { color: var(--sh-on-ink); }
.aea-page .aea-lang-list a { color: var(--sh-ink); }
.aea-page a:focus-visible, .aea-page button:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.aea-wrap { max-width: 1680px; padding: 32px clamp(16px, 2.6vw, 40px) 56px; display: flex; flex-direction: column; gap: 40px; }
.aea-eyebrow { margin: 0; font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.aea-h1 { margin: 0; font: 400 clamp(36px, 3.8vw, 56px)/1.05 var(--sh-serif); letter-spacing: -.005em; text-wrap: balance; }
.aea-h2 { margin: 0; font: 400 36px/1.1 var(--sh-serif); }
.aea-h2.sm { font-size: 30px; }
.aea-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 20px; }
.aea-card { background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 14px; }
.aea-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border: 0; border-radius: 12px;
  font: 700 17px/1 var(--sh-body); text-decoration: none; cursor: pointer; }
.aea-page .aea-btn-dark { background: var(--sh-navy); color: var(--sh-navy-ink); }
.aea-page .aea-btn-dark:hover { color: var(--sh-navy-ink); opacity: .92; }
.aea-page .aea-btn-y { background: var(--sh-yellow); color: #151935; }
.aea-page .aea-btn-y:hover { background: var(--sh-yellow-hover); color: #151935; }
.aea-page .aea-btn-line { min-height: 44px; padding: 0 16px; font-size: 15px; background: var(--sh-card); color: var(--sh-ink); border: 1px solid var(--sh-line); }
.aea-page .aea-btn-line:hover { border-color: var(--sh-ink); color: var(--sh-ink); }
.aea-mono { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sh-muted); }
.aea-mono b, .aea-mono strong { font-weight: 500; color: var(--sh-ink); }
.aea-bar { height: 6px; border-radius: 99px; background: var(--sh-track); overflow: hidden; }
.aea-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sh-fill); }

/* Greeting */
.aea-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; }
.aea-hello-lvl { flex: 0 1 440px; min-width: 240px; display: flex; flex-direction: column; gap: 10px; }

/* The Daily Circuit card */
.aea-circuit { flex: 2 1 560px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; padding: 30px;
  border-radius: 14px; background: var(--sh-navy); color: var(--sh-navy-ink); }
.aea-circuit.small { flex: 2 1 340px; flex-direction: column; align-items: stretch; justify-content: space-between; }
.aea-circuit-main { flex: 1 1 260px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.aea-circuit h2 { margin: 0; font: 400 46px/1 var(--sh-serif); color: var(--sh-navy-ink); }
.aea-circuit p { margin: 0; color: var(--sh-navy-muted); font-size: 17px; }
.aea-badge5 { padding: 2px 10px; border-radius: 6px; background: var(--sh-yellow); color: #151935; font: 500 13px/1.4 var(--sh-mono); letter-spacing: .06em; }
.aea-circuit-st { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sh-navy-muted); }
.aea-circuit a:focus-visible { outline-color: var(--sh-yellow); }
.aea-week { display: flex; flex-direction: column; gap: 10px; }
.aea-week ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.aea-week li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.aea-week .c { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.28); color: #151935; }
.aea-week .c.done { background: var(--sh-yellow); border-color: var(--sh-yellow); }
.aea-week .c.today { border: 2px dashed var(--sh-yellow); }
.aea-week .d { font: 400 12px/1 var(--sh-mono); color: #aab0d0; }

/* This week */
.aea-thisweek { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 24px 26px; }
.aea-thisweek-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.aea-thisweek-top h2 { margin: 0; font: 500 13px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.aea-big { margin: 0; display: flex; align-items: baseline; gap: 8px; color: var(--sh-muted); }
.aea-big b { font: 400 52px/1 var(--sh-serif); color: var(--sh-ink); }
.aea-chart { display: flex; align-items: flex-end; gap: 8px; }
.aea-chart > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.aea-chart .col { width: 100%; height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.aea-chart .col i { display: block; width: 100%; max-width: 26px; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--sh-ink); }
.aea-chart .col i.now { background: var(--sh-link); }
.aea-chart span { font: 400 12px/1 var(--sh-mono); color: var(--sh-muted); }
.aea-words { margin: 0; padding-top: 12px; border-top: 1px solid var(--sh-line2); font: 400 13px/1.4 var(--sh-mono); color: var(--sh-ink2); }
.aea-words b { font-weight: 500; color: var(--sh-ink); }

/* Your subjects (11 Nov 2026, teacher): in their areas, four boxes across, all the same size; the name at half the old size,
   two lines at most (then …); the level; Open at the same height in every box */
.aea-sec-wrap { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 20px; }
.aea-sec-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.aea-sec-top .aea-linkbtn { font-size: 15px; }
.aea-groups { display: flex; flex-direction: column; gap: 22px; }
.aea-group { display: flex; flex-direction: column; gap: 10px; }
.aea-group-h { margin: 0; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; }
.aea-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1199px) { .aea-grid4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) and (min-width: 860px) { .aea-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .aea-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 359px) { .aea-grid4 { grid-template-columns: minmax(0, 1fr); } }
.aea-box { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px 16px; background: var(--sh-card); border: 1px solid var(--sh-line);
  border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.aea-box:hover { border-color: var(--sh-off); box-shadow: 0 6px 18px rgba(21,25,53,.06); }
.aea-box-t { margin: 0; height: 2.5em; font: 400 15px/1.25 var(--sh-serif); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.aea-box-t a { color: var(--sh-ink); text-decoration: none; }
.aea-page .aea-box-t a { color: var(--sh-ink); }
.aea-box-t a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.aea-box-t a:focus-visible { outline: none; }
.aea-box-t a:focus-visible::after { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
/* the level: two lines of room, so every box is the same height */
.aea-box-lv { display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; height: calc(2 * 1.4 * 12px + 12px); }
.aea-box-lv .aea-mono { margin: 0; font-size: 12px; letter-spacing: .06em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.aea-box .aea-btn-line { position: relative; z-index: 1; align-self: flex-start; max-width: 100%; margin-top: auto; min-height: 38px; padding: 0 12px; font-size: 14px; gap: 8px; }
.aea-box .aea-btn-line .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aea-box .aea-btn-line svg { flex: none; }
/* Only Essentials so far */
.aea-add { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 22px; border: 1px dashed var(--sh-line); border-radius: 10px; }
.aea-add p { margin: 0; color: var(--sh-ink2); }
.aea-always { font: 400 12px/1.4 var(--sh-mono); letter-spacing: .06em; color: var(--sh-green-ink); }

/* Class games (en/engine/classgame.js puts its cards in [data-class-games]) */
.aea-classes:empty { display: none; }
.aea-classes .class-games { display: flex; flex-direction: column; gap: 10px; }
.aea-classes .circuit-box { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px 20px; padding: 18px 22px; border-radius: 14px;
  background: var(--sh-card); border: 2px solid #b4286a; }
.aea-classes .cc-badge { flex: none; width: 52px; height: 56px; border-radius: 12px; background: #b4286a; color: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font: 400 26px/1 var(--sh-serif); }
.aea-classes .cc-badge small { font: 500 11px/1 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.aea-classes .cc-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aea-classes .cc-text p { margin: 0; }
.aea-classes .cc-k { font: 400 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.aea-classes .cc-name { font: 400 26px/1.15 var(--sh-serif); }
.aea-classes .cc-sub, .aea-classes .cc-status { font-size: 15px; color: var(--sh-muted); }
.aea-classes .cc-status b { color: var(--sh-ink); }
.aea-classes .cc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px; background: #b4286a; color: #fff;
  font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (max-width: 619px) { .aea-classes .circuit-box { grid-template-columns: auto minmax(0,1fr); } .aea-classes .cc-box-actions { grid-column: 1 / -1; } .aea-classes .cc-btn { width: 100%; } }

/* Suggestions box (en/engine/suggest.js fills [data-suggest]) */
.aea-page .suggest { background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 10px; padding: 20px 24px; scroll-margin-top: 20px; }
.aea-page .suggest:empty { display: none; }
.aea-page .sg-top { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.aea-page .sg-icon { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--sh-yellow); display: grid; place-items: center; font-size: 1.3rem; }
.aea-page .sg-text { flex: 1 1 260px; min-width: 0; }
.aea-page .sg-title { margin: 0; font: 400 24px/1.2 var(--sh-serif); color: var(--sh-ink); }
.aea-page .sg-sub { margin: 2px 0 0; color: var(--sh-muted); font-size: 15px; }
.aea-page .sg-action { flex: 0 1 auto; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.aea-page .sg-action .cc-btn, .aea-page .sg-btns .cc-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--sh-navy);
  background: var(--sh-navy); color: var(--sh-navy-ink); font: 700 15px/1 var(--sh-body); text-decoration: none; cursor: pointer; }
.aea-page .sg-btns .cc-btn.alt { background: transparent; color: var(--sh-ink); border-color: var(--sh-line); }
.aea-page .sg-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sh-line2); }
.aea-page .sg-k { margin: 0; font-weight: 700; font-size: 15px; }
.aea-page .sg-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
@media (max-width: 759px) { .aea-page .sg-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aea-page .sg-kind { font: 700 15px/1.25 var(--sh-body); text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sh-line); background: var(--sh-bg); color: var(--sh-ink); cursor: pointer; }
.aea-page .sg-kind:hover { border-color: var(--sh-muted); }
.aea-page .sg-kind[aria-pressed="true"] { border-color: var(--sh-green); background: var(--sh-green-soft); }
.aea-page .sg-t { font: inherit; width: 100%; min-height: 104px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sh-line); background: var(--sh-bg); color: var(--sh-ink); }
.aea-page .sg-t:focus { border-color: var(--sh-green); }
.aea-page .sg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.aea-page .sg-who, .aea-page .sg-count { font-size: 14px; color: var(--sh-muted); }
.aea-page .sg-who b { color: var(--sh-ink); }
.aea-page .sg-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.aea-page .sg-msg { margin: 0; font-size: 15px; color: var(--sh-muted); }
.aea-page .sg-msg:empty { display: none; }
.aea-page .sg-msg.ok { color: var(--sh-green-ink); font-weight: 700; }
.aea-page .sg-msg.err { color: var(--sh-red-ink); font-weight: 700; }

/* Landing page (no points or days in a row in its top bar: Log in, or the student's name, only) */
.aea-landing .aea-top .pts, .aea-landing .aea-streak, .aea-landing .aea-me { display: none !important; }
.aea-hero { display: flex; flex-wrap: wrap; align-items: stretch; gap: 28px; }
.aea-hero-text { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.aea-hero-text .aea-h1 { max-width: 16ch; font-size: clamp(40px, 4.6vw, 68px); line-height: 1.02; }
.aea-hero-text > p { margin: 0; font-size: 19px; color: var(--sh-ink2); }
.aea-hero-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 8px; }
.aea-hero-btns a.plain { font-weight: 700; }
.aea-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; }
.aea-steps > div { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--sh-line); }
.aea-steps h2 { margin: 0; font: 400 26px/1.15 var(--sh-serif); }
.aea-steps p { margin: 0; font-size: 16px; color: var(--sh-ink2); }
.aea-ess { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 20px 24px; }
.aea-ess h3 { margin: 0; font: 400 30px/1.1 var(--sh-serif); }
.aea-ess h3 a { color: var(--sh-ink); text-decoration: none; }
.aea-ess h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.aea-ess .aea-always { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.aea-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.aea-areabox { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 14px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 10px; }
.aea-areabox .rule { display: block; width: 44px; height: 4px; border-radius: 2px; }
.aea-areabox h3 { margin: 0; font: 400 28px/1.1 var(--sh-serif); }
.aea-areabox ul { list-style: none; margin: 0 -10px; padding: 0; }
.aea-areabox li { border-top: 1px solid var(--sh-line2); }
.aea-areabox a, .aea-areabox .soon { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 10px; border-radius: 8px; color: var(--sh-ink); text-decoration: none; font-weight: 700; }
.aea-areabox a:hover { background: var(--sh-soft); color: var(--sh-ink); }
.aea-areabox a span, .aea-areabox .soon span { flex: 1; min-width: 0; }
.aea-areabox .soon { color: var(--sh-muted); font-weight: 400; }
.aea-areabox .soon small { font: 400 12px/1 var(--sh-mono); }
.aea-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; border-top: 1px solid var(--sh-line); font: 400 13px/1.4 var(--sh-mono); color: var(--sh-muted); }
@media (max-width: 619px) {
  .aea-wrap { gap: 30px; padding-top: 22px; }
  .aea-circuit { padding: 22px; }
  .aea-circuit h2 { font-size: 36px; }
  .aea-week .c { width: 32px; height: 32px; }
  .aea-week ol { gap: 6px; }
  .aea-h2 { font-size: 30px; }
  .aea-hero-btns .aea-btn { width: 100%; }
}

/* ---------- 4. Game pages (redesign stage 2, 8 Nov 2026) ----------
   en/engine/app.js draws these when the shell is on the page (NEW_UI): #app[data-view="game"] is a game with its side
   panel, #app[data-view="reading"] a Reading Comprehension page. Menus, the word list and My progress keep their old
   look (data-view="page") until stage 3. The colours of right and wrong answers still come from en/engine/styles.css. */

/* The path in the top bar on game pages: Home / Descriptive language / Fill the gap */
.aea-crumbs-slot { display: none; min-width: 0; }
html.aea-crumbed .aea-crumbs-slot { display: block; }
.aea-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; line-height: 1.3; }
.aea-crumbs a { color: var(--sh-link); font-weight: 700; text-decoration: none; border-radius: 6px; }
.aea-crumbs a:hover { color: var(--sh-ink); text-decoration: underline; }
.aea-crumbs [aria-current] { color: var(--sh-ink2); }
.aea-crumb-sep { color: var(--sh-off); }
@media (max-width: 859.98px) {
  html.aea-crumbed .aea-top { flex-wrap: wrap; }
  html.aea-crumbed .aea-crumbs-slot { order: 10; flex: 1 0 100%; margin: 6px -12px -6px -6px; padding: 9px 16px; border-top: 1px solid var(--sh-line2); }
  .aea-crumbs ol { font-size: 14px; }
  .aea-crumbs li:nth-child(1), .aea-crumbs li:nth-child(2) { display: none; }   /* Home: the logo beside the menu button goes there */
}

/* The page: wide, from the left, like the home page */
html.aea-shelled #app[data-view="game"], html.aea-shelled #app[data-view="reading"] { max-width: 1500px; margin: 0; padding: 30px clamp(16px, 2.6vw, 40px) 56px; }
html.aea-shelled #app[data-view="reading"] { max-width: 1600px; padding-top: 24px; }
#app[data-view="reading"] .g-head { margin-bottom: 18px; }
#app[data-view="reading"] .g-title h1 { font-size: clamp(32px, 3vw, 42px); }
html.aea-shelled body.in-circuit #app[data-view] { padding-bottom: 130px; }

/* The heading: the game's column, its name, how to play (on a reading page, the level and this round's score beside it) */
.g-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; margin: 0 0 22px; }
.g-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.g-eyebrow { margin: 0; font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.g-title h1 { margin: 0; font: 400 clamp(34px, 3.2vw, 46px)/1.05 var(--sh-serif); letter-spacing: -.005em; color: var(--sh-ink); text-wrap: balance; }
.g-hint { margin: 0; max-width: 72ch; font-size: 17px; color: var(--sh-ink2); }

/* The game on the left, the side panel on the right (under the game when there isn't room) */
.g-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.g-main { flex: 3 1 580px; min-width: 0; max-width: 1000px; display: flex; flex-direction: column; gap: 14px; }
.g-side { flex: 1 1 280px; min-width: 0; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 860px) and (max-width: 1199.98px) { .g-side { max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; } }
.g-box { padding: 20px 22px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px; color: var(--sh-ink); }
.g-box[hidden] { display: none; }
.g-box h2 { margin: 0 0 12px; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.g-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-stats div { min-width: 0; }
.g-stats dt { font: 400 12px/1.4 var(--sh-mono); letter-spacing: .04em; color: var(--sh-muted); }
.g-stats dd { margin: 0; font: 400 30px/1.2 var(--sh-serif); color: var(--sh-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-stats dd b { font-weight: 400; }
.g-stats dd small { font-size: 18px; color: var(--sh-muted); }
.g-lvl { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.g-lvl span { font: 400 26px/1.15 var(--sh-serif); }
.g-lvl a { font-size: 14px; font-weight: 700; color: var(--sh-link); }
.g-bar { display: block; height: 6px; margin-top: 10px; border-radius: 99px; background: var(--sh-track); overflow: hidden; }
.g-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sh-fill); transition: width .4s; }
.g-cap { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--sh-muted); }
.g-keys ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--sh-ink2); }
.g-keys kbd { display: inline-block; min-width: 26px; margin-right: 4px; padding: 1px 7px; border: 1px solid var(--sh-line); border-radius: 6px; background: var(--sh-bg); color: var(--sh-ink); font: 500 13px/1.5 var(--sh-mono); text-align: center; }
@media (hover: none) { .g-keys { display: none; } }   /* tablets and phones: no keyboard */
.g-more { padding-bottom: 10px; }
.g-more ul { list-style: none; margin: 0 -10px; padding: 0; }
.g-more a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: 8px; color: var(--sh-ink); text-decoration: none; }
.g-more a:hover { background: var(--sh-soft); color: var(--sh-ink); }
.g-more svg { flex: none; color: var(--sh-off); }
.g-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; }
.g-tools .toggle { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 700; color: var(--sh-ink); cursor: pointer; }
.g-tools .toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--sh-green); }
#app[data-view] .g-box a:focus-visible, #app[data-view] .g-box input:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }

/* The game card */
#app[data-view="game"] .card { padding: clamp(22px, 3vw, 44px); border-color: var(--sh-line); border-radius: 12px; background: var(--sh-card); }
#app[data-view="game"] .instr { margin: 0 0 22px; font: 400 13px/1.45 var(--sh-mono); letter-spacing: .1em; color: var(--sh-muted); }
#app[data-view="game"] .sentence { margin-bottom: 28px; font-size: clamp(22px, 2.1vw, 28px); line-height: 1.55; }
#app[data-view="game"] .sentence .slot { min-width: 6em; border-bottom-width: 3px; }
#app[data-view="game"] .opts { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
#app[data-view="game"] .opts.long { grid-template-columns: minmax(0, 1fr); }
#app[data-view] .opt { gap: 14px; min-height: 64px; padding: 10px 18px; border-radius: 12px; font-size: 20px; line-height: 1.35; }
#app[data-view] .opts.long .opt { min-height: 56px; font-size: 18px; }
#app[data-view] .opt kbd { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 7px; font-size: 13px; }
#app[data-view] .feedback { margin-top: 22px; padding: 16px 20px; font-size: 17px; }
#app[data-view] .feedback .verdict { font-size: 19px; }
#app[data-view] .next-row { margin-top: 18px; }
#app[data-view] .next-row .btn, #app[data-view] .check-row .btn { min-height: 50px; padding: 0 26px; border-radius: 12px; font-size: 17px; }
#app[data-view="game"] .auto { height: 4px; margin-top: 16px; border-radius: 99px; }
#app[data-view="game"] .prompt-word { margin-bottom: 26px; font-size: clamp(40px, 4vw, 56px); }
#app[data-view="game"] .prompt-def { margin-bottom: 26px; font-size: clamp(21px, 2vw, 26px); line-height: 1.45; }
#app[data-view="game"] .statement { margin-bottom: 26px; font-size: clamp(22px, 2.1vw, 28px); }
#app[data-view="game"] .tf-btns { gap: 14px; }
#app[data-view="game"] .tfb { min-height: 68px; border-radius: 12px; font-size: 21px; }
#app[data-view="game"] .gk-q { font-size: clamp(21px, 2vw, 25px); }
#app[data-view="game"] .exam-q { font-size: 21px; padding: 18px 20px; }
#app[data-view="game"] .errtext { font-size: clamp(19px, 1.8vw, 22px); }
#app[data-view="game"] .readtext, #app[data-view="game"] .extract { font-size: clamp(19px, 1.8vw, 22px); }
#app[data-view="game"] .build-goal { font-size: clamp(19px, 1.9vw, 23px); }
#app[data-view="game"] .tile { min-height: 60px; border-radius: 12px; font-size: 17px; }
#app[data-view="game"] .tile.word { font-size: 22px; }
#app[data-view="game"] .bank-w { font-size: 18px; padding: 10px 16px; }
/* Arcade games: the clock above the card; bigger holes and words on a computer */
.g-main > .timer { height: 10px; margin: 0; border-radius: 99px; }
.g-main > .timer i { border-radius: 99px; }
#app[data-view="game"] .arcade-card { padding: clamp(18px, 2.6vw, 32px); }
#app[data-view="game"] .arcade-def { font-size: clamp(20px, 2vw, 26px); line-height: 1.35; }
html:not(.phone) #app[data-view="game"] .hole { height: 118px; }
html:not(.phone) #app[data-view="game"] .mole { height: 80px; font-size: 20px; }

/* Close reading, Big idea, Note taking: the passage on the left, the questions on the right, Confirm under them */
.g-hstats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; }
.g-hstats dl { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; }
.g-hstats dl[hidden] { display: none; }
.g-hstats dt { font: 400 12px/1.4 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--sh-muted); }
.g-hstats dd { margin: 0; display: flex; align-items: baseline; font: 400 24px/1.2 var(--sh-serif); color: var(--sh-ink); white-space: nowrap; }
.g-hstats dd b { font-weight: 400; }
.g-hstats dd small { font-size: 16px; color: var(--sh-muted); }
.g-hstats dd a { margin-left: 10px; font: 700 14px/1 var(--sh-body); color: var(--sh-link); }
#app[data-view] .cr-card { padding: 0; border: 0; background: none; }
.cr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.cr-pass { flex: 1 1 500px; min-width: 0; padding: 28px 34px 30px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px; color: var(--sh-ink);
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.cr-k { margin: 0 0 6px; font: 400 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.cr-pass h2 { margin: 0 0 12px; font: 400 30px/1.15 var(--sh-serif); }
.cr-text p { margin: 0 0 14px; font-size: 18px; line-height: 1.7; }
.cr-text p:last-child { margin-bottom: 0; }
.cr-qs { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cr-q { display: flex; flex-direction: column; gap: 9px; padding: 16px 20px 18px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px; color: var(--sh-ink); }
.cr-q.ok { border-color: var(--good); }
.cr-q.no { border-color: var(--bad); }
.cr-qtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cr-qtop .cr-k { margin: 0; }
.cr-tag { font: 500 12px/1.4 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; }
.cr-tag[hidden] { display: none; }
.cr-q.ok .cr-tag { color: var(--good); }
.cr-q.no .cr-tag { color: var(--bad); }
.cr-q h3, .cr-q .question { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
#app[data-view] .cr-q .opts { gap: 7px; }
#app[data-view] .cr-q .opt { min-height: 44px; padding: 7px 12px; gap: 12px; border-radius: 10px; font-size: 16.5px; }
#app[data-view] .cr-q .opt kbd { width: 24px; height: 24px; border-radius: 6px; font-size: 12px; }
.cr-q .opt[aria-pressed="true"]:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); box-shadow: none; }
.cr-why { display: grid; gap: 4px; padding: 10px 14px; border-radius: 8px; font-size: 15px; color: var(--sh-ink2); }
.cr-why[hidden] { display: none; }
.cr-q.ok .cr-why { background: var(--good-soft); }
.cr-q.no .cr-why { background: var(--bad-soft); }
.cr-ans b { color: var(--sh-ink); }
.cr-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 20px; padding-top: 4px; }
.cr-end { flex: 1 1 260px; margin: 0; text-align: right; font-weight: 700; }
.cr-end:empty { display: none; }
.cr-end.ok { color: var(--good); }
.cr-end.no { color: var(--bad); }
#app[data-view] .cr-go { min-height: 52px; padding: 0 32px; border-radius: 12px; font-size: 17px; box-shadow: 0 4px 14px rgba(21,25,53,.18); }
#app[data-view] .cr-go:disabled { opacity: .4; cursor: default; box-shadow: none; }
.cr-actions .report-btn { margin-right: auto; }
.cr-notes .note-task { margin: 0; }
.cr-notes .next-row, .cr-notes .check-row { margin-top: 6px; }
.cr-notes .fb:empty { display: none; }
@media (max-width: 1099.98px) { .cr-pass { position: static; max-height: none; } }

/* Phones: the score in one line under the name, then the game; no keys, no More (the path at the top goes back) */
@media (max-width: 859.98px) {
  html.aea-shelled #app[data-view="game"], html.aea-shelled #app[data-view="reading"] { padding: 18px 16px 40px; }
  .g-head { margin-bottom: 12px; }
  .g-title h1 { font-size: 34px; }
  .g-hint { font-size: 15px; }
  .g-layout { flex-direction: column; align-items: stretch; gap: 14px; }
  .g-main { flex: none; max-width: none; }
  .g-side { order: -1; max-width: none; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
  .g-side .g-box { padding: 0; border: 0; background: none; }
  .g-side .g-keys, .g-side .g-more, .g-side .g-box h2, .g-level .g-bar, .g-level .g-cap, .g-level a { display: none; }
  .g-side .g-stats, .g-hstats dl { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .g-side .g-stats div, .g-hstats dl div { display: flex; align-items: baseline; gap: 5px; }
  .g-side .g-stats dt, .g-hstats dt { font-size: 12px; text-transform: uppercase; }
  .g-side .g-stats dd, .g-hstats dd { font: 700 15px/1.3 var(--sh-mono); }
  .g-side .g-stats dd small, .g-hstats dd small { font-size: 13px; }
  .g-level .g-lvl span { font: 500 12px/1.3 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--sh-muted); }
  .g-tools { padding: 0; }
  #app[data-view="game"] .card { padding: 20px 18px; }
  #app[data-view="game"] .opt { min-height: 54px; font-size: 18px; }
  #app[data-view="game"] .sentence, #app[data-view="game"] .statement { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .g-bar i { transition: none; } }

/* ---------- 5. Subject pages, word list, My progress (redesign stage 3, 8 Nov 2026) ----------
   #app[data-view="topic"]: a subject page (app.js topicPage: heading, levels, word cards, games). "list": the word list.
   "progress": My progress. Then the pages outside the game engine: Reading Comprehension, the Daily Circuit page, login. */
html.aea-shelled #app[data-view="topic"], html.aea-shelled #app[data-view="list"], html.aea-shelled #app[data-view="progress"] {
  max-width: 1600px; margin: 0; padding: 30px clamp(16px, 2.6vw, 40px) 56px; display: flex; flex-direction: column; gap: 34px; }
html.aea-shelled #app[data-view="list"] { max-width: 1180px; gap: 18px; }
html.aea-shelled #app[data-view="progress"] { gap: 26px; }

/* The heading: area, name, the I study this switch; the level buttons and the student's level */
.t-head { display: flex; flex-direction: column; gap: 18px; }
.t-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.t-title { min-width: 0; }
.t-eyebrow { margin: 0 0 4px; font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.t-title h1 { margin: 0; font: 400 clamp(40px, 4.2vw, 60px)/1 var(--sh-serif); letter-spacing: -.005em; color: var(--sh-ink); text-wrap: balance; }
.t-always { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--sh-green-ink); }
.t-sw { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 44px; padding: 0 4px; border: 0; background: transparent; cursor: pointer; }
.t-sw-l { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-sw-t { position: relative; display: block; width: 44px; height: 24px; border-radius: 99px; background: var(--sh-switch-off); transition: background .15s; }
.t-sw-t::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.t-sw[aria-checked="true"] .t-sw-t { background: var(--sh-green); }
.t-sw[aria-checked="true"] .t-sw-t::after { transform: translateX(20px); }
.t-sw:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; border-radius: 12px; }
.t-lv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; }
.t-lv-btns { min-width: 0; }
#app[data-view="topic"] .levels-head { display: none; }
#app[data-view="topic"] .sets.levels { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
#app[data-view="topic"] .sets.levels .chip { width: auto; min-height: 44px; padding: 0 8px 0 14px; gap: 8px; border: 1px solid var(--sh-line); border-radius: 99px; background: var(--sh-card); color: var(--sh-ink); font-size: 15px; }
#app[data-view="topic"] .sets.levels .chip[aria-pressed="true"] { background: var(--sh-ink); border-color: var(--sh-ink); color: var(--sh-bg); }
#app[data-view="topic"] .sets.levels .chip-n { padding: 1px 8px; background: var(--sh-pill); color: var(--sh-muted); font-size: 12px; }
#app[data-view="topic"] .sets.levels .chip[aria-pressed="true"] .chip-n { background: rgba(127,127,127,.25); color: inherit; }
#app[data-view="topic"] .lvl-line { flex: 0 1 380px; min-width: 240px; margin: 0; gap: 8px; }
#app[data-view="topic"] .lvl-k { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; color: var(--sh-muted); }
#app[data-view="topic"] .lvl-line .lvl-now { color: var(--sh-ink); }
#app[data-view="topic"] .lvl-divider { height: 6px; border-radius: 99px; background: var(--sh-track); }
#app[data-view="topic"] .lvl-divider i { background: var(--sh-fill); border-radius: 99px; }
#app[data-view="topic"] .syl { max-width: 900px; margin: 0; }

/* Words at this level: the word cards and Your words */
.t-words { display: flex; flex-direction: column; gap: 14px; }
.t-sec-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.t-sec-top h2 { margin: 0; font: 400 32px/1.1 var(--sh-serif); color: var(--sh-ink); }
.t-sec-top a { font-size: 15px; font-weight: 700; color: var(--sh-link); }
.t-words-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 20px; }
.fc-area { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 28px clamp(18px, 2.4vw, 36px); background: var(--sh-fc-bg); border: 1px solid var(--sh-fc-line); border-radius: 16px; }
.fc-stack { position: relative; padding-right: 72px; }
.fc-layer { position: absolute; border-radius: 16px; border: 1px solid var(--sh-fc-edge); }
.fc-layer.l3 { top: 30px; bottom: 30px; left: 72px; right: 0; z-index: 1; background: var(--sh-fc-l3); }
.fc-layer.l2 { top: 20px; bottom: 20px; left: 48px; right: 24px; z-index: 2; background: var(--sh-fc-l2); }
.fc-layer.l1 { top: 10px; bottom: 10px; left: 24px; right: 48px; z-index: 3; background: var(--sh-card); }
.fc { position: relative; z-index: 4; perspective: 1600px; cursor: pointer; }
.fc-inner { display: grid; transition: transform .5s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
.fc.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; min-height: max(300px, var(--fc-h, 0px)); display: flex; flex-direction: column; gap: 14px; padding: 26px 30px 70px; background: var(--sh-card); border: 1px solid var(--sh-fc-edge);
  border-radius: 16px; box-shadow: 0 8px 24px rgba(21,25,53,.08); color: var(--sh-ink); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fc-back { transform: rotateY(180deg); }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fc-pos { font: 400 13px/1.4 var(--sh-mono); color: var(--sh-muted); }
.fc-stage { display: inline-block; padding: 2px 10px; border-radius: 99px; font: 500 12px/1.5 var(--sh-mono); letter-spacing: .04em; text-transform: uppercase; }
.st-new { background: var(--sh-st-new-bg); color: var(--sh-st-new); }
.st-learn { background: var(--sh-st-learn-bg); color: var(--sh-st-learn); }
.st-fam { background: var(--sh-st-fam-bg); color: var(--sh-st-fam); }
.st-known { background: var(--sh-st-known-bg); color: var(--sh-st-known); }
.fc-word-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fc-word { margin: 0; font: 400 clamp(40px, 4vw, 56px)/1.05 var(--sh-serif); color: var(--sh-ink); overflow-wrap: anywhere; }
.fc-word.sm { font-size: 30px; }
.fc-say { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--sh-say); color: var(--sh-link); cursor: pointer; }
.fc-say.sm { width: 34px; height: 34px; margin-top: -4px; }
.fc-say:hover { filter: brightness(.96); }
.fc-tip { margin: auto 0 0; font-size: 15px; color: var(--sh-muted); }
.fc-def { margin: 0; font-size: 21px; line-height: 1.45; }
.fc-ex { margin: 0; display: flex; align-items: flex-start; gap: 10px; font-size: 17px; line-height: 1.5; color: var(--sh-ink2); }
.fc-syn { margin: 0; font: 400 13px/1.5 var(--sh-mono); color: var(--sh-muted); }
.fc-flip { position: absolute; right: 20px; bottom: 18px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--sh-btn-line); border-radius: 99px; background: var(--sh-card); color: var(--sh-ink); font: 700 15px/1 var(--sh-body); cursor: pointer; }
.fc-flip::before { content: "↻"; font-size: 17px; color: var(--sh-link); }
.fc-flip:hover { border-color: var(--sh-ink); }
.fc button:focus-visible, .fc-nav button:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.fc-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; padding-right: 72px; }
.fc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1px solid var(--sh-btn-line); border-radius: 10px;
  background: var(--sh-card); color: var(--sh-ink); font: 700 16px/1 var(--sh-body); cursor: pointer; }
.fc-btn:disabled { opacity: .45; cursor: default; }
.fc-btn.fc-next { padding: 0 22px; border: 0; background: var(--sh-navy); color: var(--sh-navy-ink); }
.fc-btn.fc-shuf { width: 46px; padding: 0; color: var(--sh-link); }
.fc-n { min-width: 76px; text-align: center; font: 400 16px/1 var(--sh-mono); color: var(--sh-ink); }
.t-mine { flex: 1 1 300px; min-width: 0; max-width: 440px; display: flex; flex-direction: column; gap: 16px; padding: 24px 26px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 16px; color: var(--sh-ink); }
.t-mine h3 { margin: 0; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.t-mine-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.t-mine-big b { font: 400 52px/1 var(--sh-serif); }
.t-mine-big span { color: var(--sh-muted); }
.t-mine-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--sh-track); }
.t-mine-bar i { display: block; height: 100%; }
.t-mine-bar .st-known, .t-mine-key .sw.st-known { background: var(--sh-bar-known); }
.t-mine-bar .st-fam, .t-mine-key .sw.st-fam { background: var(--sh-bar-fam); }
.t-mine-bar .st-learn, .t-mine-key .sw.st-learn { background: var(--sh-bar-learn); }
.t-mine-bar .st-new, .t-mine-key .sw.st-new { background: var(--sh-bar-new); }
.t-mine-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.t-mine-key li { display: flex; align-items: center; gap: 10px; }
.t-mine-key li span:nth-child(2) { flex: 1; }
.t-mine-key .sw { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.t-mine-key b { font: 500 15px/1 var(--sh-mono); }
.t-mine-note { margin: 0; padding-top: 14px; border-top: 1px solid var(--sh-line2); font-size: 15px; color: var(--sh-ink2); }
@media (prefers-reduced-motion: reduce) { .fc-inner, .t-sw-t, .t-sw-t::after { transition: none; } }

/* The games, in their columns and the Games row */
#app[data-view="topic"] .cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 28px; }
#app[data-view="topic"] .col { gap: 12px; }
#app[data-view="topic"] .col h2 { font: 400 34px/1.1 var(--sh-serif); margin: 0; color: var(--sh-ink); }
#app[data-view="topic"] .col h2::before { width: 48px; height: 4px; margin-bottom: 12px; }
#app[data-view="topic"] .col .game { gap: 6px; padding: 18px 20px; border-radius: 8px; border-color: var(--sh-line); background: var(--sh-card); color: var(--sh-ink); }
#app[data-view="topic"] .col .game:hover { border-color: var(--sh-off); transform: none; box-shadow: 0 6px 18px rgba(21,25,53,.06); }
#app[data-view="topic"] .col .game h3 { font-size: 26px; line-height: 1.1; }
#app[data-view="topic"] .col .game p { font-size: 16px; line-height: 1.45; color: var(--sh-ink2); }
#app[data-view="topic"] .col .game .best { font: 400 13px/1.4 var(--sh-mono); letter-spacing: 0; color: var(--sh-muted); }
#app[data-view="topic"] .col .game.off { filter: none; opacity: 1; background: var(--sh-bg); border-color: var(--sh-line2); color: var(--sh-off); }
#app[data-view="topic"] .col .game.off p, #app[data-view="topic"] .col .game.off .best { color: var(--sh-off); }
#app[data-view="topic"] .games-row { margin-top: 0; }
/* Three across, lined up with the columns above (8 Nov 2026, teacher: the descriptions fit on two lines); fewer when narrower */
#app[data-view="topic"] .games-grid { grid-template-columns: repeat(auto-fill, minmax(max(280px, calc((100% - 56px) / 3)), 1fr)); gap: 24px 28px; }
#app[data-view="topic"] .col-games .games-grid { align-items: stretch; }
#app[data-view="topic"] .col-games .games-grid .game p { min-block-size: 2lh; }
#app[data-view="topic"] .col-games .games-grid .game .best { margin-top: auto; }
#app[data-view="topic"] .col-note { font-size: 15px; color: var(--sh-muted); }

/* The word list */
#app[data-view="list"] .g-head { margin: 0; }
#app[data-view="list"] .search { max-width: 640px; min-height: 50px; margin: 0; padding: 0 16px; border: 1px solid var(--sh-line); border-radius: 12px; background: var(--sh-card); color: var(--sh-ink); font-size: 17px; }
#app[data-view="list"] .search:focus { outline: 3px solid var(--sh-link); outline-offset: 1px; }
#app[data-view="list"] .instr { font: 500 13px/1.4 var(--sh-mono); letter-spacing: .1em; color: var(--sh-muted); }
#app[data-view="list"] .wl { border-color: var(--sh-line); border-radius: 12px; background: var(--sh-card); }
#app[data-view="list"] .wl-row { grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 16px; padding: 14px 20px; border-color: var(--sh-line2); }
#app[data-view="list"] .wl-row .w { font-size: 22px; }
#app[data-view="list"] .wl-row .w .fc-stage { margin-top: 6px; font-size: 11px; }
#app[data-view="list"] .wl-row .d { font-size: 16px; color: var(--sh-ink); }
@media (max-width: 620px) { #app[data-view="list"] .wl-row { grid-template-columns: minmax(0, 1fr); } }

/* My progress */
#app[data-view="progress"] .p-head { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
#app[data-view="progress"] .p-head h1 { margin: 0; font: 400 clamp(40px, 4.2vw, 60px)/1 var(--sh-serif); letter-spacing: -.005em; color: var(--sh-ink); }
#app[data-view="progress"] .p-head p:not(.g-eyebrow) { margin: 0; max-width: 70ch; color: var(--sh-ink2); font-size: 17px; }
#app[data-view="progress"] .p-head .g-eyebrow { margin: 0; }
#app[data-view="progress"] .p-bar { max-width: 560px; height: 8px; margin-top: 6px; }
#app[data-view="progress"] .acct-panel { margin: 0; }
#app[data-view="progress"] .stat-tiles { margin: 0; gap: 16px; }
#app[data-view="progress"] .stat { padding: 18px 20px; border-color: var(--sh-line); border-radius: 12px; background: var(--sh-card); }
#app[data-view="progress"] .stat b { font-size: 40px; color: var(--sh-ink); }
#app[data-view="progress"] .stat span { font: 400 13px/1.4 var(--sh-mono); color: var(--sh-muted); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }
.p-box { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px; color: var(--sh-ink); }
.p-box h2, .p-h { margin: 0; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
#app[data-view="progress"] .p-h { margin-bottom: 12px; }
#app[data-view="progress"] .pts-cards { margin: 0; grid-template-columns: 1fr; gap: 12px; }
#app[data-view="progress"] .pts-card { border-color: var(--sh-line2); background: var(--sh-bg); }
#app[data-view="progress"] .days { margin: 0; height: 140px; border-color: var(--sh-line2); }
#app[data-view="progress"] .legend { margin: 0; }
#app[data-view="progress"] .prog-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
#app[data-view="progress"] .prog-row { padding: 16px 18px; border-color: var(--sh-line); background: var(--sh-card); }
#app[data-view="progress"] .prog-row:hover { border-color: var(--sh-off); }
#app[data-view="progress"] .prog-name { font-size: 17px; }
#app[data-view="progress"] .pts-how { margin: 0; border-color: var(--sh-line); }
.p-note { margin: 0; font-size: 15px; color: var(--sh-muted); }

/* Pages outside the game engine (stage 3): Reading Comprehension, the Daily Circuit page, login */
.aea-pagehead { display: flex; flex-direction: column; gap: 8px; }
.aea-lead { margin: 0; max-width: 70ch; font-size: 18px; color: var(--sh-ink2); }
.aea-pagehead .aea-h1 { font-size: clamp(40px, 4.2vw, 60px); line-height: 1; }
/* Reading Comprehension: the reading level, then the activities */
.aea-lv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 22px 24px; }
.aea-lv-text { min-width: 0; flex: 1 1 280px; }
.aea-lv h2 { margin: 0 0 4px; font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.aea-lv p { margin: 0; color: var(--sh-ink2); font-size: 16px; }
.aea-lv .lv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aea-lv .lv-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--sh-line); border-radius: 99px;
  background: var(--sh-card); color: var(--sh-ink); font: 400 15px/1 var(--sh-body); cursor: pointer; }
.aea-lv .lv-chip[aria-pressed="true"] { background: var(--sh-ink); border-color: var(--sh-ink); color: var(--sh-bg); }
.aea-lv .lv-chip.good::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2e9d63; }
.aea-lv .lv-chip:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
.aea-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.aea-page .aea-content .aea-act, .aea-act { display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 22px 24px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px;
  color: var(--sh-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.aea-page .aea-content .aea-act:hover { border-color: var(--sh-off); box-shadow: 0 6px 18px rgba(21,25,53,.06); color: var(--sh-ink); }
.aea-act-name { font: 400 30px/1.1 var(--sh-serif); }
.aea-act-sub { font-size: 16px; line-height: 1.45; color: var(--sh-ink2); }
.aea-act-go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 42px; padding: 0 16px; border: 1px solid var(--sh-line);
  border-radius: 10px; font-weight: 700; font-size: 15px; }
.aea-act:hover .aea-act-go { border-color: var(--sh-ink); }
.aea-act.topic-off { opacity: .55; cursor: not-allowed; }
.aea-act .topic-phone { display: none; font-size: 14px; font-weight: 700; color: var(--sh-red-ink); }
.phone .aea-act.topic-off .topic-phone { display: block; }
.phone .aea-act.topic-off .aea-act-go { display: none; }
/* The Daily Circuit page (circuit.js draws .cc-panel and .cc-subjects): the navy card of the home page */
.aea-page .cc-page { display: flex; flex-direction: column; gap: 20px; max-width: 1100px; }
.aea-page .cc-panel { gap: 14px; padding: 30px; border: 0; border-radius: 14px; background: var(--sh-navy); color: var(--sh-navy-ink); }
.aea-page .cc-panel h2 { font: 400 clamp(36px, 3.6vw, 46px)/1.05 var(--sh-serif); letter-spacing: 0; color: var(--sh-navy-ink); }
.aea-page .cc-panel p { color: var(--sh-navy-muted); font-size: 17px; max-width: 70ch; }
.aea-page .cc-panel .cc-k { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; color: var(--sh-navy-muted); }
.aea-page .cc-panel .cc-streak { color: var(--sh-yellow) !important; }
.aea-page .cc-panel .cc-big { font: 400 72px/1 var(--sh-serif); color: var(--sh-navy-ink); }
.aea-page .cc-panel .cc-big small { font: 400 18px/1 var(--sh-body); color: var(--sh-navy-muted); }
.aea-page .cc-panel .cc-list li { border-top-color: rgba(255,255,255,.18); color: var(--sh-navy-ink); }
.aea-page .cc-panel .cc-score { color: var(--sh-yellow); font-weight: 700; }
.aea-page .cc-panel .cc-actions { gap: 12px; margin-top: 10px !important; }
.aea-page .cc-panel .cc-btn { min-height: 52px; padding: 0 26px; border: 0; border-radius: 12px; background: var(--sh-yellow); color: #151935; font: 700 17px/1 var(--sh-body); }
.aea-page .cc-panel .cc-btn:hover { background: var(--sh-yellow-hover); opacity: 1; }
.aea-page .cc-panel .cc-btn.alt { background: transparent; color: var(--sh-navy-ink); border: 1.5px solid rgba(255,255,255,.5); }
.aea-page .cc-panel .cc-btn:focus-visible { outline: 3px solid var(--sh-yellow); outline-offset: 3px; }
.aea-page .cc-subjects { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: 12px; }
.aea-page .cc-subjects .cc-k { font: 500 12px/1.4 var(--sh-mono); letter-spacing: .1em; color: var(--sh-muted); }
.aea-page .cc-subjects p { margin: 0; }
.aea-page .cc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aea-page .cc-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--sh-green); border-radius: 99px; color: var(--sh-ink); background: var(--sh-green-soft); font-size: 15px; }
.aea-page .cc-small a { font-weight: 700; color: var(--sh-link); }
/* Log in: the form in a card, in English (from the Chinese version, html.aea-zh: with the Chinese beside it, as before) */
html.aea-shelled .aea-login .aea-content > .home { max-width: 640px; margin: 0; padding: 30px clamp(16px, 2.6vw, 40px) 56px; gap: 22px; }
html.aea-shelled .aea-login .navline { display: none; }
html.aea-shelled .aea-login .aea-top-end { display: none; }
html.aea-shelled:not(.aea-zh) .aea-login [lang="zh"] { display: none; }
html.aea-shelled .aea-login .intro .eyebrow { font: 400 13px/1.4 var(--sh-mono); letter-spacing: .1em; color: var(--sh-muted); }
html.aea-shelled .aea-login .intro h1 { margin: 0; font: 400 clamp(40px, 4.2vw, 56px)/1 var(--sh-serif); color: var(--sh-ink); }
html.aea-shelled .aea-login #panel { padding: 28px; gap: 18px; border: 1px solid var(--sh-line); border-radius: 14px; background: var(--sh-card); color: var(--sh-ink); }
html.aea-shelled .aea-login .field label { font-size: 16px; }
html.aea-shelled .aea-login .field input { min-height: 50px; padding: 0 14px; border: 1px solid var(--sh-line); border-radius: 12px; background: var(--sh-bg); color: var(--sh-ink); font-size: 17px; }
html.aea-shelled .aea-login .field input:focus { outline: 3px solid var(--sh-link); outline-offset: 1px; border-color: var(--sh-link); }
html.aea-shelled .aea-login .btn { min-height: 52px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--sh-navy); color: var(--sh-navy-ink); font: 700 17px/52px var(--sh-body); }
html.aea-shelled .aea-login .btn.alt { background: transparent; color: var(--sh-ink); border: 1px solid var(--sh-line); line-height: 50px; }
html.aea-shelled .aea-login .btn:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
html.aea-shelled .aea-login .who { font: 400 34px/1.1 var(--sh-serif); }
html.aea-shelled .aea-login .note { color: var(--sh-muted); font-size: 15px; }
html.aea-shelled .aea-login .err { color: var(--sh-red-ink); }
html.aea-shelled body.aea-login { background: var(--sh-bg); color: var(--sh-ink); font-family: var(--sh-body); }

/* Phones */
@media (max-width: 859.98px) {
  html.aea-shelled #app[data-view="topic"], html.aea-shelled #app[data-view="list"], html.aea-shelled #app[data-view="progress"] { padding: 18px 16px 40px; gap: 26px; }
  .fc-area { padding: 16px; }
  .fc-stack, .fc-nav { padding-right: 0; }
  .fc-layer { display: none; }
  .fc-face { min-height: max(260px, var(--fc-h, 0px)); padding: 20px 20px 66px; }
  .fc-word { font-size: 40px; }
  .fc-word.sm { font-size: 26px; }
  .fc-def { font-size: 19px; }
  .fc-nav { gap: 10px; }
  .fc-btn { padding: 0 14px; }
  .fc-n { min-width: 60px; }
  .t-mine { max-width: none; }
  .t-sec-top h2 { font-size: 28px; }
  #app[data-view="topic"] .col h2 { font-size: 30px; }
  .aea-page .cc-panel { padding: 22px; }
  .aea-act { min-height: 0; }
}

/* ---------- 6. The Chinese version (redesign stage 4, 8 Nov 2026) ----------
   The same pages in Chinese (zh/, and My progress, Maths and Log in when opened from there). Every label is written in both
   languages, each in its own span (class t-en / t-zh), and <html data-ui="en|zh"> (the English / 中文 switch: account.js)
   shows one. html.aea-zh: the shell is the Chinese version's (shell.js data-side="zh"). */
[data-ui="zh"] .t-en, [data-ui="en"] .t-zh { display: none !important; }
.t-zh, .aea-shell [lang="zh-CN"] { font-family: var(--sh-zh); letter-spacing: 0; }
html.aea-zh h1 .t-zh, html.aea-zh h2 .t-zh, html.aea-zh h3 .t-zh, html.aea-zh .aea-h1 .t-zh { font-weight: 600; }
html.aea-zh .aea-streak i.t-zh { text-transform: none; }
/* A Chinese subject page (app.js zhTopicPage): the word card's back has the Chinese; the three columns 词汇, 句子, 游戏 */
.fc-zh { margin: 0; font: 600 clamp(28px, 2.6vw, 36px)/1.25 var(--sh-zh); color: var(--sh-ink); }
#app[data-view="topic"] .col-sentences h2::before { background: var(--good); }

/* ---------- 7. After the rebuild (8 Nov 2026, the teacher's list) ---------- */
/* The Listen switch beside the game's name (a feature to promote: it had moved into the side panel). app.js gameLayout() */
.g-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
#app[data-view] .g-name .lsn-tog { min-height: 42px; padding: 0 18px; gap: 8px; border: 1.5px solid var(--sh-link); border-radius: 99px;
  background: var(--sh-card); color: var(--sh-link); font: 700 16px/1 var(--sh-body); }
#app[data-view] .g-name .lsn-tog:hover { background: var(--sh-say); }
#app[data-view] .g-name .lsn-tog[aria-pressed="true"] { background: var(--sh-link); border-color: var(--sh-link); color: var(--sh-card); }
#app[data-view] .g-name .lsn-tog[aria-pressed="true"] .lsn-state::before { content: "· on"; font-weight: 400; }
#app[data-view] .g-name .lsn-tog:focus-visible { outline: 3px solid var(--sh-ink); outline-offset: 2px; }
/* Feedback after a wrong answer: no big red fill (teacher: "a little dramatic"); a pale panel with a coloured line down the
   left. Nearly (Spot the error, Complete the text: at least half right) is amber */
#app[data-view] .feedback.no, #app[data-view] .feedback.near { background: var(--sh-soft); border-left: 4px solid var(--bad, #b3261e); border-radius: 6px 10px 10px 6px; }
#app[data-view] .feedback.near { border-left-color: var(--sh-near); }
#app[data-view] .feedback.near .verdict { color: var(--sh-near); }
/* The top bar stays in view as the page scrolls: computers only, not phones or tablets (teacher). app.js stickyTop() keeps
   a new question card from scrolling under it */
@media (min-width: 860px) and (hover: hover) and (pointer: fine) {
  .aea-top { position: sticky; top: 0; }
  html.aea-shelled { scroll-padding-top: 84px; }
  .cr-pass { top: 80px; max-height: calc(100vh - 96px); }
}

/* ---------- 8. The Staff Room (9 Nov 2026, teacher) ----------
   teacher/index.html in the site's sidebar and top bar (shell.js data-staff: html.aea-staffed). The top bar has the path
   (Staff Room / …) and the teacher's name, Change password and Log out; the main view is four lists like the landing page's
   subject boxes (.aea-areabox), and a strip for the admin (Reports, Suggestions). The pages inside keep their own look
   (the styles in teacher/index.html, board.css, starters.css, handouts.css). */
html.aea-staffed body.aea-staff { background: var(--sh-bg); }
html.aea-staffed body.aea-staff .aea-content > .home { max-width: 1240px; margin: 0; padding: 30px clamp(16px, 2.6vw, 40px) 56px; gap: 22px; }
html.aea-staffed .aea-staff .intro h1 { margin: 0; font: 400 clamp(40px, 4.2vw, 56px)/1.05 var(--sh-serif); color: var(--sh-ink); }
/* The way back is the path in the top bar: the old "← Staff Room" links under it go (the deeper ones stay) */
html.aea-staffed.aea-crumbed .aea-staff .aea-content .backlink[href="#/"] { display: none; }
html.aea-staffed.aea-crumbed .aea-staff .aea-content p:has(> .backlink[href="#/"]:only-child) { display: none; }
/* The teacher's name, Change password and Log out (index.html #me, moved into the top bar) */
.aea-staff-slot { display: flex; align-items: center; }
.aea-staff-slot #me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; font-size: 15px; color: var(--sh-muted); }
.aea-staff-slot #me:empty { display: none; }
.aea-staff-slot #me b { color: var(--sh-ink); }
.aea-staff-slot #me a { color: var(--sh-link); font-weight: 700; text-decoration: none; }
.aea-staff-slot #me a:hover { text-decoration: underline; }
.aea-staff-slot #me .btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--sh-line); border-radius: 10px; background: transparent; color: var(--sh-ink); font: 700 15px/1 var(--sh-body); }
.aea-staff-slot #me .btn:hover { background: var(--sh-soft); }
.aea-staff-me { display: none; }
@media (max-width: 859.98px) {
  .aea-staff-slot #me b, .aea-staff-slot #me a { display: none; }   /* in the menu instead (.aea-staff-me) */
  .aea-staff-me { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
  .aea-staff-me a { color: var(--sh-link); font-weight: 700; }
  html.aea-staffed .aea-crumbs li:nth-child(1), html.aea-staffed .aea-crumbs li:nth-child(2) { display: block; }   /* Staff Room: the way back */
  html.aea-staffed body.aea-staff .aea-content > .home { padding: 20px 16px 40px; }
}
/* The four lists: Classes, Starters, Handouts, Board Games (four across on a wide screen, two on a narrower one) */
.sr-cols { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .sr-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .sr-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sr-box { align-self: start; }
.sr-box a span { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; }
.sr-box .sr-n { font: 400 13px/1.3 var(--sh-mono); color: var(--sh-muted); }
.sr-box .sr-add { color: var(--sh-link); }
.sr-box .sr-foot { margin: 0; padding-top: 8px; border-top: 1px solid var(--sh-line2); font-size: 15px; color: var(--sh-muted); }
.sr-box .sr-foot a { display: inline; min-height: 0; padding: 0; color: var(--sh-link); font-weight: 700; }
.sr-box .sr-foot a:hover { background: none; text-decoration: underline; }
.sr-box svg { flex: none; color: var(--sh-muted); }
/* The admin's strip (only the admin sees it: the server says who) */
.sr-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 6px; padding: 14px 18px; border: 1px dashed var(--sh-line); border-radius: 10px; }
.sr-admin-k { margin: 0 6px 0 0; font: 500 12px/1.3 var(--sh-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sh-muted); }
.sr-admin a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--sh-line); border-radius: 10px; background: var(--sh-card); color: var(--sh-ink); font-weight: 700; text-decoration: none; }
.sr-admin a:hover { background: var(--sh-soft); }
.sr-admin .rep-count { font-weight: 400; color: var(--sh-muted); }
/* A board game or a starter on the projector covers the whole screen: the sidebar and the top bar step out of the way */
html.bg-on .aea-side, html.bg-on .aea-top { visibility: hidden; }

/* Session controls appear only when practice was launched from the English homepage. */
.aea-mix-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aea-mix-controls small { flex-basis: 100%; }
.aea-mix-controls span:empty { display: none; }
#app .bar:has(.aea-mix-controls) { flex-wrap: wrap; }
