/* StudyQuest child app: Style A "Sunday Grand Prix". Light theme only, landscape first (1280×800). */
/* Themes are skins: tokens, display font, words (strings.js) and art (app.js).
   Racing is the default; [data-theme] works on <html> and on single cards (the profile picker). */
:root, [data-theme="race"] {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --border: #E1E5EC;
  --ink: #161B26;
  --ink-2: #4A5468;
  --asphalt: #262C3A;
  --asphalt-2: #3A4256;
  --on-asphalt-2: #C9D0DD;
  --go: #FFC93C;
  --go-shadow: #C99A16;
  --red: #D7263D; --red-soft: #FFE7EA; --red-ink: #A8182B;
  --green: #1F9D55; --green-soft: #E3F5EA; --green-ink: #14693A;
  --light-green: #2BB673; --light-amber: #F2A900; --light-blue: #2F6FDE; --light-off: #DCE1E9;
  --cream: #FFF6DC;
  --radius-sm: 16px; --radius-md: 22px; --radius-lg: 28px; --radius-xl: 32px;
  --child: #D7263D;
  --helmet: var(--child);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --disp-style: italic; --disp-case: uppercase; --disp-weight: 800;
  --btn-radius: var(--radius-sm);
  --hero-text: #fff;
  color-scheme: light;
}
[data-theme="horse"] {
  --bg: #F7F2EA; --surface: #FFFFFF; --border: #E8DFD2; --ink: #2A2238; --ink-2: #5C5368;
  --asphalt: #3E2A4F; --asphalt-2: #5A4470; --on-asphalt-2: #D9CCE3;
  --go: #F5C04A; --go-shadow: #C8931C;
  --red: #E2557A; --red-soft: #FDE6EE; --red-ink: #9E2549;
  --green: #5B8C3A; --green-soft: #EAF2E1; --green-ink: #4A7030;
  --light-green: #5B8C3A; --light-amber: #D9900F; --light-blue: #7B3F8C; --light-off: #E5DDD2;
  --cream: #FFF4D6;
  --radius-sm: 20px; --radius-md: 26px; --radius-lg: 30px; --radius-xl: 32px;
  --btn-radius: 999px;
  --arena: #7FA65A; --arena-sand: #C9A57A;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --disp-style: normal; --disp-case: none; --disp-weight: 700;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--body); font-weight: 700; font-size: 18px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
body.dark { background: var(--asphalt); }
#app { min-height: 100vh; min-height: 100dvh; padding: 20px 24px 28px; max-width: 1400px; margin: 0 auto; }
h1, h2, h3, .disp { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); text-transform: var(--disp-case); letter-spacing: 0.01em; line-height: 1; margin: 0; }
h1 { font-size: 44px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
p { margin: 0.35em 0; }
.muted { color: var(--ink-2); }
.small { font-size: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons ---------- */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px solid var(--light-blue); outline-offset: 3px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 12px 26px; border-radius: var(--btn-radius);
  background: var(--surface); border: 2px solid var(--border); color: var(--ink);
  font-weight: 900; font-size: 20px; text-decoration: none; transition: transform 0.08s;
}
.btn:active:not(:disabled) { transform: translateY(2px) scale(0.98); }
.btn.go {
  background: var(--go); border: 0; color: var(--ink); box-shadow: 0 6px 0 var(--go-shadow);
  font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); text-transform: var(--disp-case);
  font-size: 34px; min-height: 84px; padding: 10px 36px; border-radius: var(--radius-md); margin-bottom: 6px;
}
.btn.go:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--go-shadow); }
.btn.dark { background: var(--asphalt-2); border-color: var(--asphalt-2); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.wide { width: 100%; }
.btn.icon { min-width: 60px; padding: 8px 16px; }
.btn .ico { font-size: 24px; line-height: 1; }

/* ---------- patterns ---------- */
.kerb { height: 16px; background: repeating-linear-gradient(90deg, var(--red) 0 28px, #fff 28px 56px); }
.chequer {
  --sq: 16px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%),
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%);
  background-size: calc(var(--sq) * 2) calc(var(--sq) * 2);
  background-position: 0 0, var(--sq) var(--sq);
}
.card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 20px 22px; }
.hero { background: var(--asphalt); color: #fff; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.hero .in { padding: 24px 26px; flex: 1; display: flex; flex-direction: column; gap: 18px; }

/* ---------- shift lights ---------- */
.shift { display: inline-flex; gap: 6px; }
.sl { width: 18px; height: 18px; border-radius: 50%; background: var(--light-off); transition: background 0.15s, box-shadow 0.15s; }
.hero .sl { background: var(--asphalt-2); }
.shift.big { gap: 12px; }
.shift.big .sl { width: 44px; height: 44px; }
.sl.on.g { background: var(--light-green); box-shadow: 0 0 10px var(--light-green); }
.sl.on.a { background: var(--light-amber); box-shadow: 0 0 10px var(--light-amber); }
.sl.on.b { background: var(--light-blue); box-shadow: 0 0 12px var(--light-blue); }
.shift.big .sl.on { box-shadow: 0 0 22px currentColor; }
.shift.big .sl.on.g { color: var(--light-green); }
.shift.big .sl.on.a { color: var(--light-amber); }
.shift.big .sl.on.b { color: var(--light-blue); }

/* ---------- Blits ---------- */
.blits { display: flex; align-items: flex-end; gap: 14px; }
.blits .face { width: 120px; height: 120px; flex: none; }
.blits .face svg { width: 100%; height: 100%; display: block; }
.bubble {
  position: relative; background: #fff; color: var(--ink); border-radius: var(--radius-md);
  padding: 14px 18px; font-size: 20px; font-weight: 800; margin-bottom: 30px;
}
.bubble::before { content: ""; position: absolute; left: -12px; bottom: 16px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.card .bubble, .light .bubble { background: var(--bg); }
.card .bubble::before { border-right-color: var(--bg); }
.blits.cheer .face { animation: hop 0.5s ease 2; }
@keyframes hop { 50% { transform: translateY(-14px) rotate(-4deg); } }

/* ---------- helmet avatar ---------- */
.helmet { display: block; }
.helmet svg { display: block; width: 100%; height: 100%; }

/* ---------- 1. Wie ry vandag? ---------- */
.who-scr { min-height: calc(100dvh - 48px); display: flex; flex-direction: column; color: #fff; }
.who-scr .chequer { height: 32px; border-radius: 8px; --sq: 16px; }
.who-scr h1 { font-size: 64px; text-align: center; margin: 40px 0 6px; }
.who-scr .sub { text-align: center; color: var(--on-asphalt-2); font-size: 22px; }
.drivers { display: flex; justify-content: center; gap: 40px; margin: 40px 0; flex-wrap: wrap; }
.driver {
  width: 320px; background: var(--asphalt-2); border-radius: var(--radius-xl); padding: 28px 20px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff;
  border: 4px solid transparent; transition: transform 0.1s;
}
.driver:active { transform: scale(0.97); }
.driver .helmet { width: 200px; height: 170px; }
.driver .nm { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 46px; text-transform: var(--disp-case); }
.driver .tag { color: var(--on-asphalt-2); font-size: 16px; }
.driver.last { border-color: var(--go); }
.who-scr .foot { margin-top: auto; display: flex; justify-content: flex-end; }
.who-scr .empty { text-align: center; color: var(--on-asphalt-2); max-width: 560px; margin: 40px auto; font-size: 22px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.topbar .helmet { width: 64px; height: 54px; }
.topbar .hi { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 38px; text-transform: var(--disp-case); }
.topbar .sp { flex: 1; }
.topbar .ttl { font-size: 38px; }

/* ---------- 2. Pitlaan ---------- */
.pit { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; gap: 22px; align-items: stretch; }
.pit .hero .in { justify-content: space-between; }
.pit .quick .btn.go { width: 100%; }
.pit .quick .sub { color: var(--on-asphalt-2); font-size: 16px; margin-top: 10px; text-align: center; }
.pit-card { background: var(--red-soft); color: var(--red-ink); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.pit-card h3 { color: var(--red-ink); display: flex; align-items: center; gap: 10px; }
.pit-card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pit-card .chip { background: #fff; color: var(--red-ink); border-radius: 99px; padding: 4px 12px; font-size: 15px; }
.pit-card .btn { align-self: flex-start; }
.tracks-h { margin: 4px 0 14px; }
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.track {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  text-align: left; display: flex; flex-direction: column; min-height: 210px; padding: 0; transition: transform 0.1s;
}
.track:active:not(:disabled) { transform: scale(0.97); }
.track .band { background: var(--sc); color: #fff; padding: 14px 16px 12px; display: flex; align-items: center; gap: 10px; }
.track .band .ic { font-size: 34px; line-height: 1; }
.track .band .nm { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 27px; min-width: 0; text-transform: var(--disp-case); line-height: 1; }
.track .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }
.track .full { color: var(--ink-2); font-size: 15px; }
.track .last { font-size: 17px; }
.track:disabled { opacity: 0.55; }
.resume { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--cream); border: 2px solid var(--go); border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 18px; font-size: 19px; }
.resume .t { flex: 1 1 320px; }

/* subject colours */
.s-wisk { --sc: #2F6FDE; } .s-huis { --sc: #D7263D; } .s-fal { --sc: #7A4DD8; } .s-psw { --sc: #C2367F; }
.s-nwt { --sc: #1F9D55; } .s-geo { --sc: #0E8C9C; } .s-gesk { --sc: #B4590B; } .s-mix { --sc: #262C3A; }

/* ---------- 3. scope ---------- */
.scope { display: grid; grid-template-columns: 7fr 4fr; gap: 22px; align-items: start; }
.scope .head { background: var(--sc); color: #fff; border-radius: var(--radius-md); padding: 18px 22px; display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.scope .head .ic { font-size: 40px; }
.units { display: flex; flex-direction: column; gap: 10px; }
.group-label { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 22px; color: var(--ink-2); text-transform: var(--disp-case); margin-top: 8px; }
.unit {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; min-height: 64px; font-size: 19px;
}
.unit .dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border); flex: none; }
.unit.in .dot { background: color-mix(in srgb, var(--sc) 25%, #fff); border-color: var(--sc); }
.unit.sel { border-color: var(--sc); box-shadow: 0 0 0 2px var(--sc) inset; }
.unit.sel .dot { background: var(--sc); }
.unit.empty { opacity: 0.55; }
.unit .count { margin-left: auto; color: var(--ink-2); font-size: 15px; }
.scope .side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.scope .side .btn { width: 100%; }

/* ---------- 4. lap ---------- */
.lap-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.lap-top .where { flex: 1; min-width: 0; }
.lap-top .where .s { font-size: 20px; font-weight: 900; }
.lap-top .where .t { font-size: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lap-top .count { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 40px; }
.lapbar { position: relative; height: 72px; background: var(--asphalt); border-radius: 99px; margin-bottom: 18px; overflow: hidden; }
.lapbar .lane { position: absolute; left: 64px; right: 96px; top: 50%; height: 0; border-top: 3px dashed rgba(255,255,255,0.25); }
.lapbar .flag { position: absolute; right: 18px; top: 12px; bottom: 12px; width: 40px; border-radius: 6px; --sq: 8px; }
.lapbar .ticks { position: absolute; left: 64px; right: 96px; top: 0; bottom: 0; }
.lapbar .tick { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--asphalt-2); color: var(--on-asphalt-2); font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.lapbar .tick.done { background: var(--on-asphalt-2); color: var(--asphalt); }
.lapbar .tick.cur { background: transparent; }
.lapbar .car { position: absolute; top: 8px; width: 120px; height: 52px; margin-left: -60px; color: var(--child); transition: left 0.6s cubic-bezier(.3,.7,.3,1); z-index: 2; pointer-events: none; }
.lapbar .car svg { width: 100%; height: 100%; display: block; }
.lapbar .lastlap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 34px; color: var(--go); background: rgba(38,44,58,0.88); opacity: 0; pointer-events: none; z-index: 3; }
.lapbar .lastlap.show { animation: flash 1.6s ease forwards; }
@keyframes flash { 0%, 30%, 60% { opacity: 1; } 15%, 45% { opacity: 0.2; } 100% { opacity: 0; } }

.qcard { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 22px 26px; }
.qhead { display: flex; gap: 16px; align-items: flex-start; }
.prompt { font-size: 36px; font-weight: 900; line-height: 1.2; flex: 1; white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.prompt.long { font-size: 28px; }
.speak { flex: none; }
.qsvg { display: flex; justify-content: center; margin: 12px 0 4px;
  --card: var(--surface); --brand: var(--light-blue); --line: var(--border); --bad: var(--red-ink); --warn-soft: var(--cream); }
.qsvg svg { max-width: 100%; max-height: 260px; height: auto; }
.passage { background: var(--bg); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 16px; }
.passage summary { font-weight: 900; font-size: 20px; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; }
.passage .txt { white-space: pre-wrap; font-size: 20px; line-height: 1.55; max-height: 300px; overflow: auto; margin-top: 8px; -webkit-user-select: text; user-select: text; }
.passage .btn { min-height: 48px; font-size: 17px; padding: 6px 14px; margin-left: auto; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.answer {
  display: flex; align-items: center; gap: 16px; text-align: left; min-height: 96px; padding: 14px 18px;
  background: var(--surface); border: 3px solid var(--border); border-radius: var(--radius-md);
  font-size: 28px; font-weight: 800; line-height: 1.2;
}
.answer.small-txt { font-size: 22px; }
.answer .key { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 30px; }
.answer.sel { background: var(--cream); border-color: var(--ink); }
.answer.sel .key { background: var(--ink); color: #fff; }
.answer.bounce { animation: press 0.22s ease; }
@keyframes press { 40% { transform: scale(0.95); } }
.order-help { color: var(--ink-2); font-size: 17px; margin-top: 14px; }
.order { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.order-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 3px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px 8px 16px; font-size: 22px; }
.order-item .num { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 28px; width: 32px; }
.order-item .txt { flex: 1; }
.order-item .btn { min-width: 60px; min-height: 60px; padding: 0; font-size: 22px; }
.lap-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.lap-nav .btn.go { min-width: 420px; }

/* ---------- 5. results ---------- */
.res { display: grid; grid-template-columns: 5fr 6fr; gap: 22px; align-items: start; }
.res .hero .in { align-items: center; text-align: center; }
.res .fin { font-size: 40px; color: var(--go); }
.res .pct { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 150px; line-height: 0.9; }
.res .pct small { font-size: 70px; }
.res .lvl { font-size: 30px; font-weight: 900; }
.res .sub { color: var(--on-asphalt-2); font-size: 17px; }
.res .blits { text-align: left; align-self: stretch; }
.res .left { display: flex; flex-direction: column; gap: 16px; }
.res .side { display: flex; flex-direction: column; gap: 16px; }
.cel { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cel span { background: var(--go); color: var(--ink); border-radius: 99px; padding: 6px 16px; font-weight: 900; font-size: 19px; animation: pop 0.4s ease; }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.1); } }
.strong { background: var(--green-soft); border-color: transparent; }
.strong h3 { color: var(--green-ink); }
.strong ul, .weak ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.strong li { display: flex; gap: 10px; align-items: center; color: var(--green-ink); font-size: 19px; }
.weak { background: var(--red-soft); border-color: transparent; }
.weak h3 { color: var(--red-ink); }
.weak li { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius-sm); padding: 10px 12px 10px 16px; }
.weak li .t { flex: 1; }
.weak li .t b { display: block; font-size: 19px; }
.weak li .t span { display: block; font-size: 15px; color: var(--ink-2); font-weight: 700; }
.weak li .btn { min-height: 56px; font-size: 17px; padding: 6px 14px; flex: none; }
.res-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.res-actions .btn.go { flex: 1; }
.badges-new { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-new { background: var(--asphalt); color: #fff; border-radius: var(--radius-md); padding: 12px 16px; display: flex; gap: 10px; align-items: center; animation: drop 0.6s cubic-bezier(.3,1.6,.5,1); position: relative; overflow: hidden; }
.badge-new .i { font-size: 32px; }
.badge-new::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%); transform: translateX(-100%); animation: shine 1.2s 0.5s ease; }
@keyframes drop { 0% { transform: translateY(-60px); opacity: 0; } }
@keyframes shine { to { transform: translateX(100%); } }
.review-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.review-item { border-left: 8px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: 17px; }
.review-item.ok { border-color: var(--green); }
.review-item.no { border-color: var(--light-amber); }
.review-item .q { font-weight: 900; }

/* ---------- 6. garage ---------- */
.garage { display: grid; grid-template-columns: 6fr 5fr; gap: 22px; align-items: start; }
.garage .show { padding: 24px; align-items: center; justify-content: center; min-height: 340px; }
.garage .show .car { width: 100%; max-width: 480px; color: var(--pick); }
.garage .show .car svg { width: 100%; height: auto; display: block; }
.garage .show .helmet { width: 140px; height: 116px; }
.garage .opts { display: flex; flex-direction: column; gap: 18px; }
.swatches, .numbers { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.swatch { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--border); }
.swatch.sel { box-shadow: 0 0 0 4px var(--ink); }
.numbtn { min-width: 76px; min-height: 64px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 32px; }
.numbtn.sel { background: var(--cream); border-color: var(--ink); }
.other { display: flex; gap: 12px; align-items: center; margin-top: 12px; font-size: 17px; }
.other input { font: inherit; font-size: 24px; width: 110px; min-height: 60px; border-radius: var(--radius-sm); border: 2px solid var(--border); padding: 6px 14px; -webkit-user-select: text; user-select: text; }

/* ---------- 7. progress ---------- */
.chips-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.schip { min-height: 56px; padding: 8px 18px; border-radius: 99px; border: 2px solid var(--border); background: var(--surface); font-weight: 900; font-size: 18px; display: inline-flex; gap: 8px; align-items: center; }
.schip.sel { background: var(--sc, var(--asphalt)); border-color: var(--sc, var(--asphalt)); color: #fff; }
.prog { display: grid; grid-template-columns: 8fr 4fr; gap: 20px; align-items: start; }
.prog .main { display: flex; flex-direction: column; gap: 16px; }
.prog .tiles { display: flex; flex-direction: column; gap: 16px; }
.tile { background: var(--asphalt); color: #fff; border-radius: var(--radius-md); padding: 18px 20px; }
.tile .v { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 60px; line-height: 1; color: var(--go); }
.tile .v.txt { font-size: 40px; }
.tile .l { color: var(--on-asphalt-2); font-size: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.note { color: var(--ink-2); font-size: 15px; font-weight: 700; }
.toplist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.toplist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.toplist li:last-child { border: 0; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: 15px; font-weight: 800; background: var(--bg); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.overview { display: flex; flex-direction: column; gap: 10px; }
.ov-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ov-row:last-child { border: 0; }
.ov-row .n { display: flex; gap: 10px; align-items: center; font-weight: 900; }
.ov-row .n i { width: 14px; height: 14px; border-radius: 4px; background: var(--sc); flex: none; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.trophy { background: var(--asphalt); color: #fff; border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.trophy .i { font-size: 38px; line-height: 1; }
.trophy .n { font-size: 15px; font-weight: 800; }
.trophy .d { font-size: 13px; color: var(--on-asphalt-2); }
.trophy.locked { background: var(--bg); color: var(--ink-2); border: 2px dashed var(--border); }
.trophy.locked .i { filter: grayscale(1); opacity: 0.35; }
details.all summary { cursor: pointer; font-weight: 900; min-height: 48px; display: flex; align-items: center; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(22,27,38,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; max-width: 560px; width: 100%; }
.modal h2 { margin-bottom: 10px; }
.modal .row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.modal .row .btn { flex: 1; }
.error-box { max-width: 600px; margin: 60px auto; text-align: center; }

/* ---------- effects ---------- */
.fx-lights { position: fixed; inset: 0; z-index: 100; background: rgba(22,27,38,0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; transition: opacity 0.25s; }
.fx-lights.out { opacity: 0; }
.fx-gantry { display: flex; gap: 22px; background: #0d1018; padding: 22px 28px; border-radius: 24px; }
.fx-pod { display: flex; flex-direction: column; gap: 14px; background: #161b26; padding: 12px; border-radius: 16px; }
.fx-pod i { width: 72px; height: 72px; border-radius: 50%; background: #2c3242; transition: background 0.08s, box-shadow 0.08s; }
.fx-pod.on i { background: #ff2a3d; box-shadow: 0 0 30px #ff2a3d; }
.fx-go { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 120px; color: var(--go); min-height: 130px; line-height: 1; }
.fx-lights.go .fx-go { animation: pop 0.35s ease; }
.fx-skip { color: var(--on-asphalt-2); font-size: 18px; }
.fx-wipe {
  position: fixed; inset: -10% -60%; z-index: 90; pointer-events: none; transform: translateX(-120%) skewX(-12deg);
  --sq: 40px; background-color: #fff;
  background-image: linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%), linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%);
  background-size: 80px 80px; background-position: 0 0, 40px 40px;
  animation: wipe 1.2s cubic-bezier(.6,.05,.4,.95) forwards;
}
@keyframes wipe { 45%, 55% { transform: translateX(0) skewX(-12deg); } 100% { transform: translateX(120%) skewX(-12deg); } }
.fx-wipe.fade { inset: 0; transform: none; animation: fadeio 1.1s ease forwards; }
@keyframes fadeio { 0% { opacity: 0; } 45%, 55% { opacity: 1; } 100% { opacity: 0; } }
.fx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 95; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fx-wipe.fade { animation-duration: 1.1s !important; }
  .lapbar .lastlap.show { animation: none !important; opacity: 1; }
}

/* ---------- portrait and smaller screens: stack the columns ---------- */
@media (max-width: 1000px), (orientation: portrait) {
  #app { padding: 16px; }
  .pit, .scope, .res, .garage, .prog { grid-template-columns: 1fr; }
  .scope .side { position: static; }
  .lap-nav .btn.go { min-width: 0; flex: 1; }
  .who-scr h1 { font-size: 48px; }
}
@media (max-width: 700px) {
  h1 { font-size: 34px; }
  .tracks { grid-template-columns: repeat(2, 1fr); }
  .answers { grid-template-columns: 1fr; }
  .prompt { font-size: 28px; }
  .answer { font-size: 22px; min-height: 76px; }
  .res .pct { font-size: 110px; }
  .driver { width: 100%; max-width: 320px; }
  .topbar .hi { font-size: 28px; }
  .topbar .btn .lbl { display: none; }
  .ov-row { grid-template-columns: 1fr auto; }
  .ov-row .shift { grid-column: 1 / -1; }
  .lapbar .car { width: 90px; margin-left: -45px; }
}

/* ---------- tracker: goal, paused races, Herstelbaan, coverage ---------- */
.goal { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 12px 18px; margin-bottom: 16px; font-weight: 900; font-size: 19px; }
.goal .bar { flex: 1; height: 18px; border-radius: 99px; background: var(--light-off); overflow: hidden; }
.goal .bar i { display: block; height: 100%; background: var(--go); border-radius: 99px; transition: width 0.6s; }
.goal.done { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.goal.done .bar i { background: var(--green); }
.resume { display: grid; gap: 8px; align-items: stretch; }
.resume > b.t { flex: none; }
.resume .prow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resume .prow .t { flex: 1 1 auto; min-width: 240px; }
.pit-card.repair { background: var(--red); color: #fff; position: relative; overflow: hidden; padding-bottom: 28px; }
.pit-card.repair::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: repeating-linear-gradient(90deg, #fff 0 24px, var(--red-ink) 24px 48px); }
.pit-card.repair h3 { color: #fff; font-size: 30px; }
.pit-card.repair .big { font-size: 24px; font-weight: 900; }
.pit-card.repair .small { font-size: 16px; opacity: 0.92; }
.pit-card.repair .btn.red { background: #fff; color: var(--red-ink); border-color: #fff; font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); font-size: 26px; min-height: 68px; }
.track .cov, .covrow .cov { display: block; height: 8px; border-radius: 99px; background: var(--light-off); overflow: hidden; }
.track .cov i, .covrow .cov i { display: block; height: 100%; background: var(--sc, var(--ink)); }
.track .covl { font-size: 14px; color: var(--ink-2); margin-top: -6px; }
.track .opn { font-size: 15px; color: var(--red-ink); background: var(--red-soft); border-radius: 99px; padding: 2px 10px; align-self: flex-start; }
.unit .count.has-open { color: var(--red-ink); font-weight: 900; }
.res .small-lvl { font-size: 20px; color: var(--on-asphalt-2); }
.covlist { display: flex; flex-direction: column; gap: 8px; }
.covrow { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr 48px 90px; gap: 12px; align-items: center; font-size: 16px; }
.covrow .pc { font-weight: 900; text-align: right; }
@media (max-width: 700px) { .covrow { grid-template-columns: 1fr 60px; } .covrow .cov { grid-column: 1 / -1; } }

/* ---------- login ---------- */
.login-scr { min-height: calc(100dvh - 48px); display: flex; flex-direction: column; align-items: center; color: #fff; }
.login-scr .chequer { height: 32px; border-radius: 8px; align-self: stretch; }
.login-scr h1 { font-size: 56px; text-align: center; margin: 40px 0 8px; }
.login-scr .sub { color: var(--on-asphalt-2); font-size: 20px; text-align: center; max-width: 620px; }
.login-card { background: var(--asphalt-2); border-radius: var(--radius-xl); padding: 28px; width: 100%; max-width: 520px; margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 18px; color: var(--on-asphalt-2); }
.login-card input { font: inherit; font-size: 24px; min-height: 64px; border-radius: var(--radius-sm); border: 2px solid transparent; padding: 8px 16px; -webkit-user-select: text; user-select: text; }
.login-card .err { color: #FFC2CA; min-height: 1.4em; }
.login-card .btn.go { width: 100%; }
.who-scr .foot { gap: 12px; }

/* ---------- the profile picker shows each child in their own theme ---------- */
.driver[data-theme="horse"] { background: var(--bg); color: var(--ink); }
.driver[data-theme="horse"] .tag { color: var(--ink-2); }
.driver .pony { width: 230px; height: 170px; }
.pony, .mascot-svg { display: block; }
.pony svg, .mascot-svg svg { width: 100%; height: 100%; display: block; }
.topbar .pony { width: 78px; height: 60px; }
.theme-pick { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.theme-pick .btn { flex: 1; min-width: 150px; }
.theme-pick .btn.sel { border-color: var(--ink); background: var(--cream); }

/* ---------- Perdry (horse) skin ---------- */
[data-theme="horse"] .btn.go { border-radius: 999px; }
[data-theme="horse"] .kerb { height: 14px; margin: 0 22px 18px; border-radius: 99px; background: repeating-linear-gradient(90deg, #7B3F8C 0 40px, #fff 40px 80px); }
[data-theme="horse"] .pit-card.repair::after { background: repeating-linear-gradient(90deg, #fff 0 24px, var(--red-ink) 24px 48px); border-radius: 99px; left: 16px; right: 16px; bottom: 8px; height: 10px; }
[data-theme="horse"] .s-wisk { --sc: #2E8FA8; } [data-theme="horse"] .s-huis { --sc: #E2557A; } [data-theme="horse"] .s-fal { --sc: #7B3F8C; } [data-theme="horse"] .s-psw { --sc: #A8507A; }
[data-theme="horse"] .s-nwt { --sc: #5B8C3A; } [data-theme="horse"] .s-geo { --sc: #3C7D6E; } [data-theme="horse"] .s-gesk { --sc: #A0612E; } [data-theme="horse"] .s-mix { --sc: #3E2A4F; }
[data-theme="horse"] .track .band { position: relative; }
.track .band .fence { width: 44px; height: 30px; flex: none; }
[data-theme="horse"] .track .band { min-height: 62px; }
[data-theme="horse"] .track .band .nm { font-size: 25px; }
[data-theme="horse"] .who-scr h1, [data-theme="horse"] .topbar .hi { letter-spacing: 0; }
/* horseshoes instead of shift lights */
[data-theme="horse"] .sl {
  border-radius: 0; width: 20px; height: 20px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 36 L4 36 Q1 20 6 11 Q12 2 20 2 Q28 2 34 11 Q39 20 36 36 L32 36 Q33 22 30 15 Q26 9 20 9 Q14 9 10 15 Q7 22 8 36 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 36 L4 36 Q1 20 6 11 Q12 2 20 2 Q28 2 34 11 Q39 20 36 36 L32 36 Q33 22 30 15 Q26 9 20 9 Q14 9 10 15 Q7 22 8 36 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  box-shadow: none !important;
}
[data-theme="horse"] .shift.big .sl { width: 46px; height: 46px; }
[data-theme="horse"] .hero .sl { background: #5A4470; }
[data-theme="horse"] .hero .sl.on.g { background: #7FB35A; } [data-theme="horse"] .hero .sl.on.a { background: #F2A93B; } [data-theme="horse"] .hero .sl.on.b { background: #C68AD6; }
[data-theme="horse"] .shift .sl.on { filter: drop-shadow(0 0 6px currentColor); }
/* the arena jump bar */
[data-theme="horse"] .lapbar { background: var(--arena); height: 84px; }
[data-theme="horse"] .lapbar .lane { border-top: 0; top: auto; bottom: 10px; height: 14px; background: var(--arena-sand); border-radius: 99px; left: 40px; }
[data-theme="horse"] .lapbar .tick { width: 30px; height: 34px; margin: -10px 0 0 -15px; border-radius: 6px; background: transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); align-items: flex-start; }
[data-theme="horse"] .lapbar .tick::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 7px; border-radius: 4px; background: repeating-linear-gradient(90deg, #7B3F8C 0 7px, #fff 7px 14px); }
[data-theme="horse"] .lapbar .tick::after { content: ""; position: absolute; left: 1px; right: 1px; top: 10px; bottom: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }
[data-theme="horse"] .lapbar .tick.done::before { background: #F5C04A; }
[data-theme="horse"] .lapbar .tick.done { color: #3E2A4F; text-shadow: none; }
[data-theme="horse"] .lapbar .tick.cur::before, [data-theme="horse"] .lapbar .tick.cur::after { opacity: 0.5; }
[data-theme="horse"] .lapbar .flag { background: none; width: 40px; }
[data-theme="horse"] .lapbar .flag::before { content: ""; position: absolute; left: 8px; top: 2px; bottom: 0; width: 5px; border-radius: 3px; background: #fff; }
[data-theme="horse"] .lapbar .flag::after { content: ""; position: absolute; left: 13px; top: 4px; width: 26px; height: 20px; background: var(--go); clip-path: polygon(0 0, 100% 50%, 0 100%); }
[data-theme="horse"] .lapbar .car { top: 2px; width: 100px; height: 76px; margin-left: -50px; }
.lapbar .car.jump { animation: jump 0.6s ease; }
@keyframes jump { 0% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-16px) rotate(-8deg); } 75% { transform: translateY(-4px) rotate(4deg); } 100% { transform: translateY(0) rotate(0); } }
[data-theme="horse"] .lapbar .lastlap { background: rgba(62,42,79,0.88); }
[data-theme="horse"] .answer .key { border-radius: 50%; }
[data-theme="horse"] .answer.sel .key { background: var(--asphalt); }
/* results: a rosette with the level in the middle */
.rosette { width: 170px; height: 170px; animation: spinin 0.9s cubic-bezier(.3,1.4,.5,1); }
.rosette svg { width: 100%; height: 100%; display: block; }
@keyframes spinin { 0% { transform: rotate(-200deg) scale(0.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
.res .rosette + .pct { margin-top: -6px; }
[data-theme="horse"] .badge-new, [data-theme="horse"] .trophy:not(.locked) { background: var(--asphalt); }
[data-theme="horse"] .trophy .i { font-size: 34px; }
/* start bell */
.fx-bell { font-size: 130px; line-height: 1; }
.fx-bell.ding { animation: ring 0.35s ease; }
@keyframes ring { 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }
[data-theme="horse"] .fx-lights { background: rgba(62,42,79,0.94); }
[data-theme="horse"] .fx-wipe { background-image: none; background: repeating-linear-gradient(90deg, #7B3F8C 0 90px, #fff 90px 180px); }
/* Saalkamer */
.garage .show .pony { width: 100%; max-width: 480px; aspect-ratio: 260 / 200; height: auto; }
.garage .horse-name { margin-top: 4px; font-family: var(--display); font-weight: var(--disp-weight); font-size: 34px; color: #fff; }
.namefield { font: inherit; font-size: 24px; width: 100%; min-height: 60px; border-radius: var(--radius-sm); border: 2px solid var(--border); padding: 6px 16px; margin-top: 12px; -webkit-user-select: text; user-select: text; }
.swatch.coat { border-radius: 50%; }

/* read aloud */
.btn.talking { background: var(--cream); border-color: var(--ink); }
.btn.talking .ico { animation: pulse 0.8s ease infinite alternate; }
@keyframes pulse { to { transform: scale(1.2); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--asphalt); color: #fff; border-radius: var(--radius-md); padding: 14px 20px; font-size: 18px; max-width: min(640px, calc(100vw - 32px)); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* choosing sections: "Alles tot hier" or "Net dié wat ek kies" */
.seg { display: inline-flex; gap: 0; border: 2px solid var(--border); border-radius: var(--btn-radius); overflow: hidden; margin: 4px 0 10px; background: var(--surface); }
.seg .btn { border: 0; border-radius: 0; box-shadow: none; min-height: 52px; font-size: 17px; }
.seg .btn.on { background: var(--sc, var(--asphalt)); color: #fff; }
.pickbar { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 18px; }
.pickbar .btn { min-height: 44px; font-size: 15px; padding: 6px 14px; }
.unit.pick .dot { border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 18px; }
.unit.pick.sel .dot { background: var(--sc); }
.group-label.as-btn { background: none; border: 0; padding: 6px 0; text-align: left; cursor: pointer; display: flex; align-items: baseline; gap: 10px; min-height: 44px; }
.group-label.as-btn .hint { font-family: var(--body); font-style: normal; text-transform: none; font-size: 15px; font-weight: 800; color: var(--sc); }

/* "Iets lyk verkeerd" */
.flagrow { display: flex; justify-content: flex-end; margin-top: 14px; }
.flagbtn { min-height: 44px; font-size: 15px; padding: 6px 14px; background: transparent; border: 2px dashed var(--border); color: var(--ink-2); box-shadow: none; }
.flagged { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--cream); border: 2px solid var(--light-amber); border-radius: var(--radius-sm); padding: 16px 18px; font-size: 19px; font-weight: 700; }
.flagged .i { font-size: 30px; }
.flagged .btn { margin-left: auto; min-height: 48px; font-size: 16px; }
.lapbar .tick.flag { background: var(--light-amber); color: var(--ink); }
.flag-modal .reasons { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.flag-modal .reason { text-align: left; justify-content: flex-start; font-size: 18px; min-height: 56px; }
.flag-modal .reason.on { border-color: var(--ink); background: var(--cream); box-shadow: 0 0 0 2px var(--ink) inset; }
.flag-modal .fnote { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-weight: 700; color: var(--ink-2); }
.flag-modal input { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--border); }
.flag-modal .ferr { color: var(--red-ink); font-weight: 800; min-height: 1em; margin: 8px 0 0; }
.review-item.flag { border-color: var(--light-amber); }

/* =====================================================================
   2026 refresh (Nov 2026): same screens and words, a modern skin.
   Wide display type, drawn icons instead of emoji, soft layered shadows,
   gradient subject tiles, glass panels on deep hero gradients, idle motion.
   Everything below overrides the original style above; delete this block to roll back.
   ===================================================================== */
:root, [data-theme="race"] {
  --bg: #EEF1F7; --surface: #FFFFFF; --border: #E4E8F0; --ink: #0F1424; --ink-2: #4A5468;
  --asphalt: #111729; --asphalt-2: #2A3352; --on-asphalt-2: #C9D2EA;
  --go: #FFC61A; --go-hi: #FFE066; --go-shadow: #C99A16; --go-ink-2: #5C4A00;
  --red: #E02842; --red-hi: #FF5A6E; --red-soft: #FFE8EC; --red-ink: #B4123A;
  --green: #16A34A; --green-soft: #F0FDF4; --green-ink: #14532D;
  --light-green: #22C55E; --light-amber: #F5A524; --light-blue: #3B82F6; --light-off: #E6EAF1;
  --cream: #FFF6DC; --field: #F6F8FC; --field-line: #E6EAF1;
  --display: "Unbounded", "Figtree", system-ui, sans-serif;
  --body: "Figtree", "Nunito", system-ui, sans-serif;
  --disp-style: normal; --disp-weight: 800; --disp-track: -0.01em;
  --h1: 32px; --h2: 22px; --h3: 18px;
  --radius-sm: 18px; --radius-md: 24px; --radius-lg: 30px; --radius-xl: 34px;
  --btn-radius: 18px;
  --hero-bg: linear-gradient(165deg, #1D2747 0%, #111729 55%, #0B0F1C 100%);
  --page-tint-1: #DCE6FF; --page-tint-2: #FFE9D6;
  --shadow-tint: 15, 20, 36;
  --sh-1: 0 1px 0 rgba(var(--shadow-tint), .04), 0 14px 30px -18px rgba(var(--shadow-tint), .45);
  --sh-2: 0 1px 0 rgba(var(--shadow-tint), .04), 0 24px 48px -26px rgba(var(--shadow-tint), .5);
  --sh-hero: 0 30px 60px -30px rgba(var(--shadow-tint), .75), inset 0 1px 0 rgba(255,255,255,.08);
  --glass: rgba(255,255,255,.09); --glass-line: rgba(255,255,255,.16);
}
[data-theme="horse"] {
  --bg: #FBF6EF; --border: #EFE6DA; --ink: #2A2238; --ink-2: #5C5368;
  --asphalt: #3E2A4F; --asphalt-2: #5A4470; --on-asphalt-2: #E9DDF2;
  --go: #F2B42E; --go-hi: #FFD978; --go-shadow: #C8931C; --go-ink-2: #6B4A00;
  --red: #E2557A; --red-hi: #F27FA0; --red-soft: #FDE6EE; --red-ink: #9E2549;
  --light-off: #EADFD0; --field: #FBF7F2; --field-line: #EFE6DA;
  --display: "Fredoka", "Figtree", system-ui, sans-serif; --disp-weight: 700; --disp-track: 0;
  --h1: 40px; --h2: 28px; --h3: 22px;
  --radius-sm: 22px; --radius-md: 28px; --radius-lg: 32px; --radius-xl: 36px;
  --btn-radius: 999px;
  --hero-bg: linear-gradient(175deg, #6B3E8E 0%, #4A2A66 45%, #2E1A44 100%);
  --page-tint-1: #FCE3EC; --page-tint-2: #EFE6FA;
  --shadow-tint: 62, 42, 79;
}
html, body { background-color: var(--bg); }
body {
  font-weight: 700;
  background-image: radial-gradient(900px 520px at 88% -12%, var(--page-tint-1) 0%, transparent 70%), radial-gradient(760px 520px at -12% 112%, var(--page-tint-2) 0%, transparent 70%);
  background-attachment: fixed;
}
body.dark { background: var(--hero-bg); background-attachment: fixed; }
h1, h2, h3, .disp { letter-spacing: var(--disp-track); line-height: 1.1; }
h1 { font-size: var(--h1); } h2 { font-size: var(--h2); } h3 { font-size: var(--h3); }
.ic-svg { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
h2 .ic-svg, h3 .ic-svg { vertical-align: -0.15em; }

/* buttons */
.btn {
  border: 0; background: rgba(255,255,255,.92); box-shadow: var(--sh-1); font-weight: 800; font-size: 18px;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s, background .16s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.btn .ico { font-size: 22px; display: inline-flex; }
.btn.go, [data-theme="horse"] .btn.go {
  position: relative; overflow: hidden; border: 0; color: var(--ink);
  background: linear-gradient(180deg, var(--go-hi) 0%, var(--go) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), inset 0 -4px 0 rgba(0,0,0,.08), 0 18px 30px -12px color-mix(in srgb, var(--go) 70%, transparent);
  font-size: 24px; min-height: 84px; border-radius: 24px; margin-bottom: 0; letter-spacing: var(--disp-track);
}
[data-theme="horse"] .btn.go { border-radius: 999px; font-size: 28px; }
.btn.go:active:not(:disabled) { transform: translateY(2px) scale(.985); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 8px 16px -10px color-mix(in srgb, var(--go) 70%, transparent); }
.btn.go:disabled { filter: none; opacity: 1; background: rgba(255,255,255,.1); color: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.btn.go:disabled .arr { background: rgba(255,255,255,.1); color: rgba(255,255,255,.55); }
.card .btn.go:disabled, .side .btn.go:disabled { background: var(--field); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--field-line); }
.quickbtn { justify-content: flex-start; gap: 16px; padding: 0 12px 0 26px; text-align: left; }
.quickbtn > .ic-svg { width: 34px; height: 34px; stroke-width: 2.4; }
.quickbtn .qt { flex: 1; }
.quickbtn .arr { width: 60px; height: 60px; border-radius: 18px; background: var(--ink); color: var(--go-hi); display: inline-flex; align-items: center; justify-content: center; flex: none; }
[data-theme="horse"] .quickbtn .arr { border-radius: 50%; background: var(--asphalt); }
.quickbtn .arr .ic-svg { width: 28px; height: 28px; stroke-width: 2.8; }
.quickbtn:not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 70px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.7), rgba(255,255,255,0)); animation: sheen 3.8s ease-in-out 3 forwards; pointer-events: none; }
@keyframes sheen { 0% { transform: translateX(-120%) skewX(-20deg); } 55%, 100% { transform: translateX(900%) skewX(-20deg); } }
.btn.dark { background: var(--ink); color: #fff; }
[data-theme="horse"] .btn.dark { background: var(--asphalt); }
body.dark .btn.dark { background: var(--glass); border: 1px solid var(--glass-line); box-shadow: none; backdrop-filter: blur(10px); }
.btn.red { background: linear-gradient(180deg, var(--red-hi), var(--red)); color: #fff; box-shadow: 0 12px 24px -14px var(--red); }

/* cards and hero panels. The see-through panels on the hero (bubble, revision card) lie on a copy of the hero
   gradient instead of a live backdrop blur (SQ-049): same frosted look, but no re-blur on every frame. */
.card { border: 0; box-shadow: var(--sh-2); border-radius: var(--radius-md); }
.hero { position: relative; background: var(--hero-bg); box-shadow: var(--sh-hero); border-radius: var(--radius-xl); isolation: isolate; }
.hero .in { position: relative; z-index: 1; }
.hero .scenery { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; z-index: 0; pointer-events: none; }
.hero .scenery.full { top: 0; height: 100%; }
/* Home-page speed (SQ-049): the scenery moves for about 10 seconds after the page opens, then rests. A loop that never
   stops repaints the whole hero every frame, which made the home page lag on the tablets. Each new render starts it again.
   The line and the stars move in small steps (about 12 and 4 redraws a second) instead of 60, which looks the same at this size. */
.hero .scenery .dash { animation: dashmove 2.4s steps(30) 4; }
.hero .scenery .tw { animation: twinkle 2.4s steps(10) 4; transform-box: fill-box; transform-origin: center; }
@keyframes dashmove { to { stroke-dashoffset: -80; } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.8); } }
.kerb, [data-theme="horse"] .kerb { display: none; }

/* mascot */
.blits .face { width: 140px; height: 140px; filter: drop-shadow(0 16px 16px rgba(0,0,0,.35)); animation: idle 3.4s ease-in-out 3 forwards; transform-origin: 50% 90%; will-change: transform; }
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
.blits.cheer .face { animation: hop .5s ease 2, idle 3.4s ease-in-out 1s 3 forwards; }
.bubble { border-radius: 22px 22px 22px 6px; font-size: 19px; line-height: 1.35; box-shadow: var(--sh-1); }
.bubble::before { display: none; }
.hero .bubble { background: linear-gradient(var(--glass), var(--glass)), var(--hero-bg); color: #fff; border: 1px solid var(--glass-line); box-shadow: none; }
.card .bubble, .light .bubble { background: var(--field); box-shadow: none; }

/* helmet avatar and top bar */
.topbar { gap: 14px; }
.topbar .hi { font-size: 28px; }
[data-theme="horse"] .topbar .hi { font-size: 34px; }
.topbar > .helmet, .topbar > .pony { filter: drop-shadow(0 8px 10px rgba(var(--shadow-tint), .25)); }
.navpill { display: inline-flex; gap: 4px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.8); box-shadow: var(--sh-1); }
.navpill .btn { background: transparent; box-shadow: none; min-height: 52px; border-radius: 999px; padding: 6px 18px; font-size: 17px; }
.navpill .btn.icon { padding: 6px 14px; }
.navpill #switch { width: 52px; min-width: 52px; padding: 0; background: var(--ink); color: #fff; }
[data-theme="horse"] .navpill #switch { background: var(--asphalt); }
.navpill #switch .lbl { display: none; }
#tohome { border-radius: 999px; padding: 6px 20px 6px 14px; }
.goalring { display: inline-flex; align-items: center; gap: 12px; padding: 6px 18px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.8); box-shadow: var(--sh-1); }
.goalring .ring { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.goalring .ring svg { position: absolute; inset: 0; width: 44px; height: 44px; }
.goalring .ring .trk { fill: none; stroke: var(--light-off); stroke-width: 6; }
.goalring .ring .val { fill: none; stroke: var(--light-green); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); }
[data-theme="horse"] .goalring .ring .val { stroke: var(--red); }
.goalring.done .ring .val { stroke: var(--light-green); }
.goalring .ring .ic-svg { width: 20px; height: 20px; color: var(--green); stroke-width: 3; }
.goalring .gt { display: flex; flex-direction: column; line-height: 1.15; }
.goalring .gt b { font-size: 17px; font-weight: 900; }
.goalring .gt small { font-size: 13px; color: var(--ink-2); font-weight: 700; }

/* Pitlaan / Stal */
.pit { gap: 24px; }
.pit .hero .in { gap: 16px; }
.pit .quick .btn.go { min-height: 92px; }
.pit .quick .sub { margin-top: 8px; }
.pit-card { border-radius: var(--radius-md); }
.pit-card.repair, [data-theme="horse"] .pit-card.repair { background: linear-gradient(var(--glass), var(--glass)), var(--hero-bg); border: 1px solid var(--glass-line); color: #fff; padding: 16px 18px; }
.pit-card.repair::after, [data-theme="horse"] .pit-card.repair::after { display: none; }
.pit-card.repair h3 { font-size: 20px; color: #fff; }
.pit-card .pc-ic { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(160deg, var(--red-hi), var(--red)); display: inline-flex; align-items: center; justify-content: center; flex: none; }
[data-theme="horse"] .pit-card .pc-ic { border-radius: 50%; }
.pit-card .pc-ic .ic-svg { width: 24px; height: 24px; }
.pit-card.repair .big { font-size: 20px; }
.pit-card.repair .small { color: var(--on-asphalt-2); opacity: 1; }
.pit-card.repair .btn.red { background: #fff; color: var(--red-ink); font-size: 20px; min-height: 60px; border-radius: 16px; box-shadow: none; }
[data-theme="horse"] .pit-card.repair .btn.red { border-radius: 999px; }
.resume { border: 0; box-shadow: var(--sh-1); background: var(--surface); }
.resume .prow .t .ic-svg { margin-right: 8px; color: var(--red); }
.tracks-h { margin: 6px 0 14px; }
.tracks { gap: 16px; }
.track {
  border: 0; border-radius: var(--radius-md); box-shadow: var(--sh-1); min-height: 214px; background: var(--surface);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
}
.track:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--sh-2); }
.track:active:not(:disabled) { transform: scale(.97); }
.track .band, [data-theme="horse"] .track .band {
  position: relative; overflow: hidden; min-height: 104px; padding: 0 18px 14px; align-items: flex-end; justify-content: space-between;
  background: linear-gradient(140deg, color-mix(in srgb, var(--sc) 72%, #fff) 0%, var(--sc) 55%, color-mix(in srgb, var(--sc) 78%, #000) 100%);
}
.track .band::before { content: ""; position: absolute; right: -22px; top: -26px; width: 124px; height: 124px; border-radius: 50%; background: rgba(255,255,255,.14); }
.track .band .nm, [data-theme="horse"] .track .band .nm { position: relative; font-size: 19px; line-height: 1.1; }
[data-theme="horse"] .track .band .nm { font-size: 24px; }
.track .band .ic { position: absolute; right: 14px; top: 14px; width: 58px; height: 58px; border-radius: 18px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 30px; }
[data-theme="horse"] .track .band .ic { border-radius: 50%; }
.track .band .ic .ic-svg { width: 32px; height: 32px; stroke-width: 2; }
.track .band .fence { position: absolute; left: 14px; top: 16px; width: 64px; height: 36px; opacity: .55; }
.track .body { gap: 9px; padding: 14px 18px 16px; }
.track .full { font-size: 14px; }
.track .cov, .covrow .cov { height: 6px; background: var(--field-line); }
.track .opn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 5px 10px; }
.track .opn .ic-svg { width: 14px; height: 14px; }

/* shift lights become LED capsules (racing only; the horse theme keeps its horseshoes) */
html:not([data-theme="horse"]):not([data-kind="world"]) .shift { gap: 4px; }
html:not([data-theme="horse"]):not([data-kind="world"]) .sl { width: 22px; height: 10px; border-radius: 6px; }
html:not([data-theme="horse"]):not([data-kind="world"]) .track .shift { display: flex; }
html:not([data-theme="horse"]):not([data-kind="world"]) .track .sl { flex: 1; width: auto; }
html:not([data-theme="horse"]):not([data-kind="world"]) .shift.big { gap: 8px; padding: 10px 12px; border-radius: 999px; background: rgba(0,0,0,.35); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
html:not([data-theme="horse"]):not([data-kind="world"]) .shift.big .sl { width: 36px; height: 16px; border-radius: 8px; background: #2A3352; }
html:not([data-theme="horse"]):not([data-kind="world"]) .sl.on { animation: ledon .35s cubic-bezier(.2,.8,.2,1); }
@keyframes ledon { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } }

/* scope screen */
.scope .head { position: relative; overflow: hidden; border-radius: var(--radius-md); background: linear-gradient(140deg, color-mix(in srgb, var(--sc) 72%, #fff) 0%, var(--sc) 55%, color-mix(in srgb, var(--sc) 78%, #000) 100%); box-shadow: var(--sh-1); }
.scope .head .ic { width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; }
.scope .head .ic .ic-svg { width: 32px; height: 32px; }
.unit { border: 0; box-shadow: var(--sh-1); transition: transform .14s, box-shadow .14s; }
.unit:active { transform: scale(.985); }
.unit .dot { border: 3px solid var(--field-line); }
.unit .dot .ic-svg { width: 18px; height: 18px; stroke-width: 3; color: #fff; }
.unit.sel { box-shadow: 0 0 0 3px var(--sc), var(--sh-1); }
.seg { border: 0; box-shadow: var(--sh-1); padding: 4px; gap: 4px; border-radius: 999px; }
.seg .btn { border-radius: 999px; background: transparent; }
.group-label.as-btn .hint .ic-svg { width: 16px; height: 16px; }

/* a lap */
.lap-top .where { display: flex; align-items: center; gap: 12px; }
.lap-top .where > div { min-width: 0; }
.lap-top .wic { width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(140deg, color-mix(in srgb, var(--sc) 72%, #fff), var(--sc)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--sh-1); }
.lap-top .wic:empty { display: none; }
[data-theme="horse"] .lap-top .wic { border-radius: 50%; }
.lap-top .wic .ic-svg { width: 26px; height: 26px; }
.lap-top .count { font-size: 34px; }
[data-theme="horse"] .lap-top .count { font-size: 40px; }
#exit { border-radius: 999px; padding: 6px 20px 6px 14px; }
.lapbar { background: linear-gradient(180deg, #1D2747, #0F1424); box-shadow: inset 0 2px 6px rgba(0,0,0,.5), 0 12px 24px -16px rgba(11,15,28,.8); }
.lapbar .glow { position: absolute; left: 64px; top: 50%; height: 6px; margin-top: -3px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--child)); box-shadow: 0 0 14px var(--child); transition: width .6s cubic-bezier(.3,.7,.3,1); }
.lapbar .tick { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); font-size: 12px; }
.lapbar .tick.done { background: var(--child); color: #fff; box-shadow: 0 0 10px var(--child); }
.lapbar .flag { border-radius: 12px; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.lapbar .car { filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); }
[data-theme="horse"] .lapbar { background: linear-gradient(180deg, #C9A57A, #B08A5C); box-shadow: inset 0 2px 6px rgba(0,0,0,.25), 0 12px 24px -16px rgba(62,42,79,.6); }
[data-theme="horse"] .lapbar .glow { display: none; }
[data-theme="horse"] .lapbar .tick, [data-theme="horse"] .lapbar .tick.done { box-shadow: none; background: transparent; }
[data-theme="horse"] .lapbar .lane { background: rgba(255,255,255,.25); }
.qcard { border: 0; box-shadow: var(--sh-2); border-radius: var(--radius-lg); padding: 26px 28px; }
.prompt { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.28; }
.prompt.long { font-size: 26px; }
.speak { border-radius: 18px; background: var(--field); box-shadow: none; }
[data-theme="horse"] .speak { border-radius: 999px; }
.passage { background: var(--field); }
.answer {
  border: 0; background: var(--field); box-shadow: inset 0 0 0 2px var(--field-line); border-radius: var(--radius-md);
  font-size: 24px; transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s, background .16s;
}
[data-theme="horse"] .answer { border-radius: 999px; padding-left: 14px; }
.answer.small-txt { font-size: 20px; }
.answer .key { background: #fff; border-radius: 16px; font-size: 20px; box-shadow: 0 1px 2px rgba(var(--shadow-tint), .12); }
[data-theme="horse"] .answer .key { font-size: 24px; }
.answer .atx { flex: 1; }
.answer .amark { display: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; align-items: center; justify-content: center; flex: none; }
.answer .amark .ic-svg { width: 20px; height: 20px; stroke-width: 3; }
.answer.sel { background: color-mix(in srgb, var(--child) 9%, #fff); border: 0; box-shadow: 0 0 0 3px var(--child), 0 16px 30px -14px color-mix(in srgb, var(--child) 60%, transparent); transform: translateY(-2px); }
.answer.sel .key, [data-theme="horse"] .answer.sel .key { background: var(--ink); color: #fff; }
.answer.sel .amark { display: inline-flex; animation: pop .35s cubic-bezier(.2,.8,.2,1); }
.order-item { border: 0; box-shadow: inset 0 0 0 2px var(--field-line); background: var(--field); }
.order-item .btn .ic-svg { width: 24px; height: 24px; }
.lap-nav .btn.go { min-width: 420px; }
.lap-nav #prev { border-radius: 20px; min-height: 64px; padding: 6px 22px 6px 16px; }
[data-theme="horse"] .lap-nav #prev { border-radius: 999px; }
.flagbtn { border: 0; box-shadow: none; background: transparent; }
.flagged { border: 0; box-shadow: inset 0 0 0 2px var(--light-amber); }
.flagged .i .ic-svg { width: 30px; height: 30px; color: var(--light-amber); }

/* results */
.res { gap: 24px; }
.res .fin { font-size: 28px; color: #fff; display: flex; align-items: center; gap: 10px; }
[data-theme="horse"] .res .fin { font-size: 34px; }
.res .fin .ic-svg { color: var(--go-hi); }
@property --pv { syntax: '<number>'; inherits: false; initial-value: 0; }
.pctring { position: relative; width: 230px; height: 230px; display: flex; align-items: center; justify-content: center; }
.pctring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; --pv: var(--p);
  background: conic-gradient(var(--go-hi) 0, var(--go) calc(var(--pv) * 1%), rgba(255,255,255,.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17px));
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--go) 60%, transparent));
  animation: ringfill 1.6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes ringfill { from { --pv: 0; } }
.res .pct { position: relative; font-size: 64px; letter-spacing: -0.03em; }
[data-theme="horse"] .res .pct { font-size: 76px; }
.res .pct small { font-size: 30px; }
.res .lvl { font-size: 22px; }
.res .rosette { width: 120px; height: 120px; margin-bottom: -6px; }
.res .rosette + .pctring { margin-top: -4px; }
.strong, .weak { background: var(--surface); }
.strong h3, .weak h3 { display: flex; align-items: center; gap: 10px; }
.strong h3::before, .weak h3 .ic-svg { flex: none; }
.strong li .ic-svg { color: var(--green); stroke-width: 3; }
.weak h3 .ic-svg { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--red-soft); color: var(--red-ink); }
.weak li { background: var(--field); border-radius: 20px; padding: 12px 12px 12px 18px; }
.weak li .btn.red { background: var(--ink); color: #fff; box-shadow: none; border-radius: 16px; }
[data-theme="horse"] .weak li .btn.red { background: var(--asphalt); border-radius: 999px; }
.cel span { background: linear-gradient(180deg, var(--go-hi), var(--go)); box-shadow: 0 10px 20px -10px var(--go); }
.res-actions .btn { min-height: 84px; border-radius: 24px; }
[data-theme="horse"] .res-actions .btn { border-radius: 999px; }
.review-item { border-left: 0; box-shadow: inset 6px 0 0 var(--border), var(--sh-1); border-radius: 16px; }
.review-item.ok { box-shadow: inset 6px 0 0 var(--green), var(--sh-1); }
.review-item.no { box-shadow: inset 6px 0 0 var(--light-amber), var(--sh-1); }
.review-item.flag { box-shadow: inset 6px 0 0 var(--light-amber), var(--sh-1); }
.review-item .ic-svg { width: 18px; height: 18px; }

/* badges: a tinted round medal with a drawn icon */
.bdg { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.15), 0 8px 16px -8px rgba(0,0,0,.4); }
.bdg .ic-svg { width: 28px; height: 28px; stroke-width: 2.2; }
.bdg.t-gold { background: linear-gradient(160deg, #FFE066, #E8A317); color: #5C3A00; }
.bdg.t-silver { background: linear-gradient(160deg, #F1F5F9, #94A3B8); color: #1E293B; }
.bdg.t-bronze { background: linear-gradient(160deg, #F6C08E, #B0652A); color: #3B1D06; }
.bdg.t-fire { background: linear-gradient(160deg, #FDBA74, #EA580C); }
.bdg.t-blue { background: linear-gradient(160deg, #93C5FD, #2563EB); }
.bdg.t-red { background: linear-gradient(160deg, #FDA4AF, #E11D48); }
.bdg.t-green { background: linear-gradient(160deg, #86EFAC, #16A34A); }
.bdg.locked { background: var(--field); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--field-line); opacity: .7; }
.badge-new { background: var(--hero-bg); border-radius: 22px; padding: 12px 18px 12px 12px; gap: 14px; font-weight: 800; }
[data-theme="horse"] .badge-new { background: var(--hero-bg); }
.trophies { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.trophy, [data-theme="horse"] .trophy:not(.locked) { background: var(--field); color: var(--ink); border-radius: 22px; padding: 16px 10px; gap: 8px; }
.trophy .d { color: var(--ink-2); }
.trophy.locked { border: 2px dashed var(--field-line); background: transparent; }

/* garage, progress */
.garage .show { min-height: 360px; }
.swatch { border: 4px solid #fff; box-shadow: 0 0 0 1px var(--border), var(--sh-1); transition: transform .14s; }
.swatch.sel { box-shadow: 0 0 0 4px var(--ink), var(--sh-1); transform: scale(1.06); }
.numbtn { border: 0; box-shadow: var(--sh-1); font-size: 26px; }
.numbtn.sel { background: var(--ink); color: #fff; }
.theme-pick .btn.sel { box-shadow: 0 0 0 3px var(--ink), var(--sh-1); border: 0; background: var(--surface); }
.namefield, .other input { border: 0; box-shadow: inset 0 0 0 2px var(--field-line); background: var(--field); }
.schip { border: 0; box-shadow: var(--sh-1); }
.schip .ic-svg { width: 20px; height: 20px; }
.tile, [data-theme="horse"] .tile { background: var(--hero-bg); border-radius: var(--radius-md); box-shadow: var(--sh-hero); }
.tile .v { font-size: 52px; color: var(--go-hi); }
.tile .v.txt { font-size: 30px; }
[data-theme="horse"] .tile .v { font-size: 60px; }

/* profile picker and login */
.who-scr h1, .login-scr h1 { font-size: 48px; }
[data-theme="horse"] .who-scr h1 { font-size: 56px; }
.who-scr .chequer, .login-scr .chequer { height: 20px; border-radius: 999px; opacity: .85; }
.driver { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); border-radius: var(--radius-xl); transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s; box-shadow: 0 24px 48px -28px rgba(0,0,0,.7); }
.driver:hover { transform: translateY(-4px); }
.driver .nm { font-size: 34px; }
.driver[data-theme="horse"] .nm { font-size: 42px; }
.driver.last { border-color: var(--go); box-shadow: 0 0 0 3px var(--go), 0 24px 48px -28px rgba(0,0,0,.7); }
.driver[data-theme="horse"] { background: linear-gradient(170deg, #FFFFFF, #FBF6EF); border-color: transparent; }
.driver .helmet, .driver .pony { filter: drop-shadow(0 14px 14px rgba(0,0,0,.35)); }
.login-card { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); }
.login-card input { border: 0; }
.who-scr .foot .ic-svg, .login-scr .ic-svg { width: 20px; height: 20px; }

/* dialogs, toasts and effects */
.modal-back { background: rgba(11,15,28,.55); backdrop-filter: blur(6px); }
.modal { border-radius: var(--radius-lg); box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); animation: modalin .25s cubic-bezier(.2,.8,.2,1); }
@keyframes modalin { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal h2 { display: flex; align-items: center; gap: 10px; }
.flag-modal .reason { border: 0; box-shadow: inset 0 0 0 2px var(--field-line); background: var(--field); }
.flag-modal .reason.on { box-shadow: inset 0 0 0 3px var(--ink); background: var(--cream); }
.flag-modal input { border: 0; box-shadow: inset 0 0 0 2px var(--field-line); background: var(--field); }
.toast { background: var(--ink); border-radius: 999px; padding: 14px 24px; box-shadow: 0 20px 40px -16px rgba(0,0,0,.5); }
.fx-lights { background: rgba(11,15,28,.82); backdrop-filter: blur(10px); }
[data-theme="horse"] .fx-lights { background: rgba(46,26,68,.82); }
.fx-gantry { background: rgba(0,0,0,.4); box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.fx-pod { background: rgba(255,255,255,.06); }
.fx-pod i { background: #2A3352; }
.fx-go { font-size: 96px; }
.fx-bell { width: 140px; height: 140px; color: var(--go-hi); filter: drop-shadow(0 0 30px color-mix(in srgb, var(--go) 60%, transparent)); }
.fx-bell .ic-svg { width: 100%; height: 100%; stroke-width: 1.6; }

@media (max-width: 1000px), (orientation: portrait) {
  .lap-nav .btn.go { min-width: 0; }
  .navpill .btn .lbl { display: none; }
  .goalring .gt small { display: none; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .pctring { width: 190px; height: 190px; }
  .res .pct { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .blits .face, .quickbtn::after, .hero .scenery .dash, .hero .scenery .tw { animation: none !important; }
}

/* SQ-030: step-by-step walkthrough of wrong maths answers after a practice race */
.tutor-back { align-items: flex-start; overflow-y: auto; }
.modal.tutor { max-width: 760px; margin: 12px auto; max-height: none; }
.tutor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tutor-head h2 { margin: 0; font-size: 22px; }
.tutor-q { font-size: 24px; font-weight: 900; margin: 14px 0 8px; }
.tutor-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tutor-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); font-size: 19px; font-weight: 700; }
.tutor-opt .key { width: 32px; height: 32px; border-radius: 9px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex: none; }
.tutor-opt.right, .answer.right { background: var(--green-soft); box-shadow: 0 0 0 3px var(--green); }
.tutor-opt.chosen, .answer.chosen { background: var(--red-soft); box-shadow: 0 0 0 3px var(--red); }
.tutor-line { margin: 12px 0 0; font-size: 18px; }
.tutor-hint { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--cream); font-size: 19px; font-weight: 800; }
.tutor-hint.ok { background: var(--green-soft); color: var(--green-ink); }
.tutor-steps { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.tutor-steps h3 { margin: 0 0 8px; }
.tutor-steps ol { margin: 0 0 10px; padding-left: 26px; font-size: 20px; line-height: 1.45; }
.tutor-steps li { display: none; margin: 6px 0; }
.tutor-steps li.show { display: list-item; animation: pop .3s ease; }
.tutor-steps li:last-child.show { font-weight: 900; }
.tutor-answers { grid-template-columns: 1fr 1fr; }
.tutor-answers .answer:disabled { opacity: 1; }
.tutor-nav { justify-content: flex-end; }
.tutor-done { padding: 12px 0; }
@media (max-width: 640px) { .tutor-opts, .tutor-answers { grid-template-columns: 1fr; } .tutor-q { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .tutor-steps li.show { animation: none; } }
.tutor [hidden] { display: none !important; }
.tutor-methods { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.tutor-methods .btn.sel { background: var(--ink); border-color: var(--ink); color: #fff; }

/* SQ-030: the result screen stays locked until the maths walkthrough is done */
.res-actions .tutor-lock { flex-basis: 100%; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.res-actions .btn.go:disabled { background: var(--field); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--field-line); }
.res-actions .tutor-lock[hidden] { display: none; }

/* SQ-032: messages from a parent, and the one-time "turn on notifications" card. */
#inbox:empty { display: none; }
#inbox { display: grid; gap: 12px; margin-bottom: 18px; }
.inbox-msg, .inbox-ask { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 3px solid var(--child, var(--go)); border-radius: var(--radius-md); box-shadow: var(--sh-1); padding: 14px 18px; }
.inbox-ask { border-style: dashed; border-color: var(--border, #ccc); }
.inbox-msg .ib-ic, .inbox-ask .ib-ic { color: var(--child, var(--go)); display: inline-flex; }
.inbox-msg .ib-ic .ic-svg, .inbox-ask .ib-ic .ic-svg { width: 34px; height: 34px; }
.inbox-msg .ib-body, .inbox-ask .ib-body { flex: 1 1 280px; min-width: 0; }
.inbox-msg .ib-body p { font-size: 22px; margin: 4px 0; overflow-wrap: anywhere; }
.inbox-ask .ib-body p { margin: 4px 0 0; }
.inbox-msg .ib-when { font-size: 14px; color: var(--ink-2, #666); }

/* SQ-016: instant feedback in practice races, and the missed laps once more at the end */
.answers.locked .answer:disabled { opacity: 1; cursor: default; }
.order.locked .order-item.right { box-shadow: inset 0 0 0 3px var(--green); background: var(--green-soft); }
.order.locked .order-item.chosen { box-shadow: inset 0 0 0 3px var(--red); background: var(--red-soft); }
.fb { margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-size: 20px; animation: pop .3s ease; }
.fb.ok { background: var(--green-soft); color: var(--green-ink); }
.fb.no { background: var(--cream); }
.fb-head { font-size: 24px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.fb-line { margin-top: 8px; font-weight: 700; }
.fb-line.small { font-size: 17px; }
.fb .row { margin-top: 12px; }
.fb .note { margin: 8px 0 0; }
.retry-intro { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .fb { animation: none; } }

/* SQ-011: a level range. Lights up to the bottom of the range are solid; up to the top they glow faintly. */
.sl.on.maybe { opacity: 0.4; box-shadow: none !important; animation: none; filter: none !important; }
.lvl-note { font-size: 0.9em; opacity: 0.85; margin-top: 4px; }
/* The lit colours must win over the big racing capsule's dark background, or solid and faint can't be told apart. */
html:not([data-theme="horse"]):not([data-kind="world"]) .shift.big .sl.on.g { background: var(--light-green); }
html:not([data-theme="horse"]):not([data-kind="world"]) .shift.big .sl.on.a { background: var(--light-amber); }
html:not([data-theme="horse"]):not([data-kind="world"]) .shift.big .sl.on.b { background: var(--light-blue); }

/* ---------- SQ-046: revise together ("Saam leer") ---------- */
.pit-card.together { background: var(--surface); color: var(--ink); border: 2px solid var(--border); }
.pit-card.together h3 { color: var(--ink); }
.pit-card.together .small { font-size: 16px; color: var(--ink-2); }
.tg { max-width: 1280px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.tg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--asphalt); color: #fff; border-radius: var(--radius-md); padding: 14px 18px; }
.tg-bar h1 { display: flex; align-items: center; gap: 10px; font-size: 30px; color: #fff; }
.tg-bar .sp { flex: 1 1 200px; color: var(--on-asphalt-2); font-size: 16px; }
.tg-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-steps span { background: var(--asphalt-2); color: var(--on-asphalt-2); border-radius: 99px; padding: 6px 14px; font-size: 15px; }
.tg-steps span.on { background: var(--go); color: var(--ink); font-weight: 900; }
.tg-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.tg-child { flex: 999 1 560px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.tg-child h3 { font-size: 22px; margin-top: 6px; }
.tg-topic { font-size: 38px; }
.tg-goal { background: var(--green-soft); color: var(--green-ink); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 20px; margin: 0; }
.tg-read { display: flex; gap: 10px; align-items: flex-start; font-size: 18px; color: var(--ink-2); margin: 0; }
.tg-wrong { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.tg-wrong .q { margin: 0; font-size: 19px; }
.tg-ans { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-ans span { border-radius: 12px; padding: 6px 12px; font-size: 17px; border: 2px solid; }
.tg-ans .no { background: var(--red-soft); color: var(--red-ink); border-color: var(--red); }
.tg-ans .ok { background: var(--green-soft); color: var(--green-ink); border-color: var(--green); }
.tg-steps-box ol { margin: 6px 0 0; padding-left: 22px; }
.tg-lead { margin: 0; color: var(--ink-2); font-size: 18px; }
.tg-ask { font-size: 26px; margin: 0; }
.tg-go { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.tg-parent { flex: 1 1 300px; min-width: 0; background: var(--asphalt); color: #fff; border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-size: 16px; }
.tg-parent.hidden { flex: 0 0 auto; background: none; padding: 0; }
.tg-parent h3, .tg-parent h4 { color: #fff; font-family: inherit; font-style: normal; text-transform: none; font-weight: 900; }
.tg-parent h4 { font-size: 16px; margin: 8px 0 0; border-top: 1px solid var(--asphalt-2); padding-top: 10px; }
.tg-parent p { margin: 0; color: var(--on-asphalt-2); }
.tg-parent p b { color: #fff; }
.tg-parent .small { font-size: 14px; }
.tg-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tg-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-marks .btn.sel { background: var(--go); color: var(--ink); }
.tg-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tg-subj { text-align: left; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 16px; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.tg-subj b { font-size: 21px; }
.tg-subj span { font-size: 15px; color: var(--ink-2); }
.tg-subj.sel { border-color: var(--child); box-shadow: 0 0 0 2px var(--child); }
.tg-plan { display: flex; flex-direction: column; gap: 10px; font-family: "Nunito", "Segoe UI", system-ui, sans-serif; }
.tg-plan label { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.tg-plan input { width: 24px; height: 24px; margin-top: 2px; }
.tg-plan span { display: flex; flex-direction: column; gap: 2px; }
.tg-plan small { color: var(--ink-2); font-size: 14px; }
.tg-plan .btn { align-self: flex-end; }
.tg-empty { font-size: 20px; }
.tg-end { align-items: center; text-align: center; }
.tg-end h2 { font-size: 46px; }
.tg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tg-table th, .tg-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--asphalt-2); vertical-align: top; }
.tg-table th { color: var(--on-asphalt-2); font-weight: 700; }
.tg-pw { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-weight: 800; }
.tg-pw input { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--border); }
.modal .err { color: var(--red-ink); min-height: 1.2em; }
/* ---------- SQ-047: exam dates (next-exam card, exam timetable, getting ready) ---------- */
.examcard { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 18px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.examcard.solo { grid-template-columns: 1fr; padding: 0; border: 0; background: none; margin-bottom: 0; }
.ex-hero { background: linear-gradient(135deg, var(--asphalt), var(--asphalt-2)); color: var(--hero-text, #fff); border-radius: var(--radius-md); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ex-eyebrow { font-size: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--on-asphalt-2); }
.ex-big { font-family: var(--display); font-style: var(--disp-style); text-transform: var(--disp-case); font-weight: var(--disp-weight); font-size: 40px; line-height: 1.05; overflow-wrap: anywhere; }
.ex-sub { color: var(--on-asphalt-2); font-size: 17px; }
.ex-sleeps { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.ex-sleeps i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.18); }
.ex-sleeps i.day { background: var(--go); box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.examcard.today .ex-hero { background: linear-gradient(135deg, var(--asphalt-2), var(--asphalt)); }
.ex-side { display: flex; flex-direction: column; gap: 12px; justify-content: center; min-width: 0; }
.ex-side .blits { align-items: center; }
.ex-side .blits .face { width: 84px; height: 84px; animation: none; filter: none; }
.ex-side .blits .bubble { font-size: 17px; background: var(--bg); color: var(--ink); border: 1px solid var(--border); box-shadow: none; }
.ex-side .blits .bubble::before, .ex-side .blits .bubble::after { display: none; }
.ex-side .btn.go { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; font-size: 20px; }
.ex-mini { margin: 0; color: var(--ink-2); font-size: 15px; text-align: center; }
.ex-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ex-links .btn { flex: 1 1 180px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ex-page { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.ex-path { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; flex-direction: column; }
.ex-stop { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 6px; position: relative; border-radius: var(--radius-sm); color: var(--ink); }
button.ex-stop { cursor: pointer; }
button.ex-stop:hover { background: var(--field, var(--bg)); }
button.ex-stop:focus-visible { outline: 3px solid var(--asphalt-2); outline-offset: 2px; }
.ex-stop:not(:last-child)::after { content: ""; position: absolute; left: 30px; top: 60px; bottom: -10px; width: 4px; border-radius: 2px; background: var(--border); }
.ex-dot { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 20px; background: var(--bg); color: var(--ink-2); border: 4px solid var(--asphalt-2); z-index: 1; }
.ex-dot svg { width: 24px; height: 24px; }
.ex-stop.done .ex-dot { background: var(--go); border-color: var(--go); color: var(--go-ink, var(--ink)); }
.ex-stop.next .ex-dot { background: var(--asphalt); border-color: var(--go); color: #fff; }
.ex-t b { display: block; font-size: 19px; }
.ex-t small { color: var(--ink-2); font-size: 15px; }
.ex-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; border-radius: 99px; padding: 6px 12px; background: var(--bg); color: var(--ink); white-space: nowrap; }
.ex-pill svg { width: 18px; height: 18px; }
.ex-stop.done .ex-pill { background: var(--go); color: var(--go-ink, var(--ink)); }
.ex-here { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--asphalt-2); padding: 6px 0 0 72px; }
.ex-bar { display: flex; gap: 5px; margin-top: 4px; }
.ex-bar i { flex: 1; height: 12px; border-radius: 6px; background: rgba(255,255,255,.18); }
.ex-bar i.strong { background: var(--go); }
.ex-bar i.growing { background: rgba(255,255,255,.55); }
.ex-secs { display: flex; flex-direction: column; gap: 4px; }
.ex-secs .note { margin: 0 0 6px; }
.ex-sec { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--ink); }
.ex-sec:hover { background: var(--field, var(--bg)); }
.ex-sec:focus-visible { outline: 3px solid var(--asphalt-2); outline-offset: 2px; }
.ex-sec .n { font-size: 18px; }
.ex-sec .st { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.ex-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); }
.ex-ic svg { width: 22px; height: 22px; }
.ex-sec.strong .ex-ic { background: var(--go); color: var(--go-ink, var(--ink)); }
.ex-sec.growing .ex-ic { background: color-mix(in srgb, var(--ink) 14%, var(--surface)); color: var(--ink); }
.ex-page > .btn.go { align-self: stretch; min-height: 64px; font-size: 20px; }
@media (max-width: 1000px), (orientation: portrait) { .examcard { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ex-big { font-size: 32px; } .ex-stop { grid-template-columns: 44px minmax(0, 1fr); } .ex-stop .ex-pill { grid-column: 2; justify-self: start; } .ex-dot { width: 44px; height: 44px; font-size: 17px; } .ex-here { padding-left: 64px; } }

/* ===== SQ-050: the child app fits the tablet screen =====
   Home, a question and results (body.fit) are one screen that never scrolls. Long content scrolls
   inside its own panel; the top bar and the bottom buttons stay put. Phones and very small windows
   keep the scrolling page (see the media query). */

/* --- the home screen's news slot (all sizes) --- */
.newsrow { flex: none; }
.newsbox { align-items: stretch; }
.newsbox .face { align-self: flex-end; }
.newsbox.idle .bubble { align-self: center; }
.news { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; border-radius: 22px 22px 22px 6px; color: #fff;
  background: linear-gradient(var(--glass), var(--glass)), var(--hero-bg); border: 1px solid var(--glass-line); touch-action: pan-y; }
.news .eb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .82; min-width: 0; }
.news .eb > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news .eb .when { margin-left: auto; font-weight: 700; letter-spacing: 0; text-transform: none; opacity: .8; flex: none; }
.news .eb .ic-svg, .news .eb svg { width: 18px; height: 18px; flex: none; }
.news .tx { flex: 1; min-height: 0; overflow: auto; font-size: 18px; line-height: 1.3; font-weight: 700; -webkit-user-select: text; user-select: text; }
.news .tx b { font-family: var(--display); font-style: var(--disp-style); font-weight: var(--disp-weight); text-transform: var(--disp-case); font-size: 22px; }
.news .row { display: flex; align-items: center; gap: 8px; flex: none; }
.news .row .btn { min-height: 48px; padding: 6px 16px; font-size: 16px; }
.news .row .btn svg { width: 20px; height: 20px; }
.news .row .sp { flex: 1; }
.news .nav { display: flex; align-items: center; gap: 4px; flex: none; }
.news .nav .nv { min-height: 44px; min-width: 44px; padding: 0; background: transparent; border: 0; box-shadow: none; color: #fff; }
.news .dots { display: flex; gap: 5px; }
.news .dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.35); transition: width .2s; }
.news .dots i.on { width: 20px; background: #fff; }
.news.k-msg { border-color: color-mix(in srgb, var(--child, var(--go)) 70%, transparent); }
.pit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pit-pair .pit-card { min-width: 0; }
.exbadge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; font-size: 13px; font-weight: 900; padding: 4px 10px; border-radius: 99px; background: var(--asphalt); color: #fff; }
.exbadge svg { width: 15px; height: 15px; flex: none; }
.track .band .exbadge { position: absolute; left: 12px; top: 12px; z-index: 1; max-width: calc(100% - 92px); background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.35); }
.track .band .exbadge > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.track .band:has(.exbadge) .fence { display: none; }
@media (max-width: 700px) { .pit-pair { grid-template-columns: 1fr; } }

/* --- feedback beside the Next button (all sizes) --- */
.lap-nav.with-fb { align-items: stretch; }
.lap-nav .fb { flex: 1; min-width: 0; margin: 0; padding: 10px 16px; font-size: 16px; line-height: 1.3; max-height: 32vh; overflow: auto; align-self: center; }
.lap-nav .fb-head { font-size: 19px; }
.lap-nav .fb-line { margin-top: 4px; }
.lap-nav .fb-line.small { font-size: 14px; }
.lap-nav .fb .row { margin-top: 8px; }
.lap-nav .fb .row .btn { min-height: 48px; font-size: 16px; }
.lap-nav .fb .note { font-size: 14px; }
.lap-nav.with-fb > .btn { align-self: center; }
@media (max-width: 1000px), (orientation: portrait) {
  .lap-nav.with-fb { flex-wrap: wrap; }
  .lap-nav .fb { order: -1; flex-basis: 100%; }
}

/* --- results: score next to the award --- */
.res-top { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* --- SQ-050 part 2: section picker, exam readiness, avatar screen, progress --- */
.scope .units { margin-top: 12px; }
.garage > .hero { grid-row: span 2; }
.garage > #save { grid-column: -2 / -1; align-self: start; }

/* --- one screen, no page scroll (tablet and larger) --- */
@media (min-width: 760px) and (min-height: 600px) {
  html:has(body.fit), body.fit { height: 100%; overflow: hidden; }
  body.fit #app { height: 100dvh; min-height: 0; box-sizing: border-box; display: flex; flex-direction: column; padding: 16px 22px 18px; max-width: none; }
  body.fit #app > * { flex: none; }
  body.fit .topbar { margin-bottom: 14px; }
  body.fit .topbar .hi { font-size: 26px; }

  /* home */
  body.fit #app > .pit { flex: 1; min-height: 0; grid-template-columns: 5fr 7fr; gap: 20px; }
  body.fit .pit .hero { min-height: 0; }
  body.fit .pit .hero .in { gap: 14px; padding: 20px 22px; justify-content: flex-start; min-height: 0; }
  body.fit .newsrow { height: 196px; display: flex; }
  body.fit .newsrow > .blits { flex: 1; min-width: 0; }
  body.fit .newsbox .face { width: 100px; height: 100px; }
  body.fit .pit .quick .btn.go { min-height: 78px; }
  body.fit .pit .quick .sub { font-size: 14px; margin-top: 6px; }
  body.fit .pit-pair { flex: 1; min-height: 0; }
  body.fit .pit-pair .pit-card { margin: 0; padding: 14px 16px; gap: 6px; min-height: 0; overflow: auto; }
  body.fit .pit-pair .pit-card.repair { padding-bottom: 22px; }
  body.fit .pit-pair .pit-card h3 { font-size: 16px; margin: 0; gap: 8px; }
  body.fit .pit-pair .pit-card .big { font-size: 16px; }
  body.fit .pit-pair .pit-card .small, body.fit .pit-pair .pit-card > div { font-size: 14px; line-height: 1.3; }
  body.fit .pit-pair .pit-card .btn { margin-top: auto; min-height: 48px; font-size: 15px; padding: 8px 14px; }
  body.fit .tracks-col { min-height: 0; display: flex; flex-direction: column; }
  body.fit .tracks-h { margin: 0 0 10px; font-size: 22px; flex: none; }
  body.fit .tracks { flex: 1; min-height: 0; grid-template-rows: 1fr 1fr; gap: 14px; }
  body.fit .track { min-height: 0; display: flex; flex-direction: column; }
  body.fit .track .band { flex: none; height: 92px; min-height: 0; box-sizing: border-box; }
  body.fit .track .body { flex: 1; min-height: 0; gap: 7px; padding: 10px 14px 12px; justify-content: center; overflow: hidden; }
  body.fit .track .full { display: none; }
  body.fit .track .last { font-size: 16px; }

  /* a question */
  body.fit .lap-top { margin-bottom: 12px; }
  body.fit .lapbar { margin-bottom: 14px; }
  body.fit #app > .qcard { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 22px; overflow: hidden; }
  body.fit .qcard .qmain { flex: 1; min-height: 0; overflow: auto; }
  body.fit .qcard .flagrow { flex: none; margin-top: 8px; }
  body.fit #app > .qcard.has-passage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px 20px; }
  body.fit .qcard.has-passage .passage { margin: 0; min-height: 0; overflow: auto; }
  body.fit .qcard.has-passage .passage .txt { max-height: none; overflow: visible; font-size: 18px; }
  body.fit .qcard.has-passage .flagrow { grid-column: 1 / -1; }
  body.fit .qcard.has-passage .answers { grid-template-columns: 1fr; gap: 10px; }
  body.fit .qcard.has-passage .prompt { font-size: 24px; }
  body.fit .qcard.has-passage .answers { margin-top: 12px; }
  body.fit .qcard.has-passage .answer { min-height: 58px; padding-top: 6px; padding-bottom: 6px; }
  body.fit .qcard.has-passage .passage .btn { white-space: nowrap; }
  body.fit #app > .qcard.has-passage:has(> .passage:not([open])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  body.fit #app > .lap-nav { margin-top: 14px; }

  /* results */
  body.fit #app > .res { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  body.fit .res > .left { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
  body.fit .res > .left > .hero { flex: 1; min-height: 0; }
  body.fit .res .hero .in { gap: 8px; padding: 16px 20px; justify-content: center; min-height: 0; overflow: auto; }
  body.fit .res .res-actions { flex: none; }
  body.fit .res > .side { min-height: 0; overflow: auto; padding: 2px 4px 8px 2px; }
  body.fit .res .pctring { width: 168px; height: 168px; }
  body.fit .res .pct { font-size: 52px; }
  body.fit .res .rosette, body.fit .res .award { width: 112px; height: 112px; margin: 0; }
  body.fit .res .lvl { font-size: 20px; }
  body.fit .res .sub, body.fit .res .lvl-note { font-size: 14px; margin: 0; }
  body.fit .res .blits .face { width: 84px; height: 84px; }
  body.fit .res .blits .bubble { font-size: 15px; }

  /* choosing sections: the list scrolls, the start buttons stay */
  body.fit #app > .scope { flex: 1; min-height: 0; align-items: stretch; }
  body.fit .scope-main { min-height: 0; display: flex; flex-direction: column; }
  body.fit .scope-main > * { flex: none; }
  body.fit .scope .head { padding: 12px 18px; margin-bottom: 10px; }
  body.fit .scope-main > .units { flex: 1; min-height: 0; overflow: auto; padding: 2px 4px 8px 2px; }
  body.fit .scope .side { position: static; min-height: 0; overflow: auto; }

  /* exam readiness: the section list scrolls, the practise button stays */
  body.fit #app > .ex-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.fit .ex-page > * { flex: none; }
  body.fit .ex-page > .ex-secs { flex: 1; min-height: 0; overflow: auto; }

  /* avatar screen: the options scroll, the preview and the save button stay */
  body.fit #app > .garage { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; }
  body.fit .garage > .hero { min-height: 0; }
  body.fit .garage .show { min-height: 0; height: 100%; box-sizing: border-box; }
  body.fit .garage > .opts { min-height: 0; overflow: auto; padding: 2px 4px 8px 2px; }
  /* every option fits without scrolling: compact cards, one row of swatches or numbers each */
  body.fit #app > .garage { grid-template-columns: 4fr 7fr; grid-template-rows: auto minmax(0, 1fr); gap: 18px; }
  body.fit .garage > #save { min-height: 72px; }
  body.fit .garage > .opts { gap: 10px; }
  body.fit .garage .opts > .card { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  body.fit .garage .opts > .card > h3 { flex-basis: 100%; margin: 0; font-size: 15px; }
  body.fit .garage .swatches, body.fit .garage .numbers { margin: 0; gap: 8px; flex-wrap: wrap; }
  body.fit .garage .swatch { width: 46px; height: 46px; border-width: 3px; }
  body.fit .garage .numbtn { min-width: 52px; min-height: 46px; font-size: 20px; padding: 0 8px; }
  body.fit .garage .numbtn.patbtn { font-size: 15px; }
  body.fit .garage .other { margin: 0; font-size: 14px; gap: 8px; }
  body.fit .garage .other input { width: 72px; min-height: 46px; font-size: 20px; padding: 4px 10px; }
  body.fit .garage .namefield { margin: 0; min-height: 48px; font-size: 20px; }
  body.fit .garage .theme-card .now-world { margin: 0; flex: 1; min-width: 0; }
  body.fit .garage .theme-card .now-world .mface { width: 44px; height: 44px; }
  body.fit .garage .theme-card .btn { margin: 0; width: auto; min-height: 46px; }
  body.fit .garage .theme-card .note { margin: 0 !important; flex: 1; }
  body.fit .garage .show { padding: 16px; }
  body.fit #app > h1 { font-size: 24px; margin-bottom: 10px !important; }
  body.fit #app > h1 { flex: none; }

  /* progress: the cards scroll, the totals stay */
  body.fit #app > .chips-row { flex: none; overflow-x: auto; flex-wrap: nowrap; }
  body.fit #app > .prog { flex: 1; min-height: 0; align-items: stretch; }
  body.fit .prog > .main { min-height: 0; overflow: auto; padding: 2px 4px 8px 2px; }
  body.fit .prog > .tiles { min-height: 0; overflow: auto; }
}
@media (min-width: 760px) and (min-height: 600px) and (orientation: portrait) {
  body.fit #app > .pit { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  body.fit .pit-pair { flex: none; }
  body.fit .tracks { grid-template-columns: repeat(3, 1fr); }
  body.fit .track .band { height: 76px; }
  body.fit .track .band .ic { width: 48px; height: 48px; top: 12px; right: 12px; }
  body.fit .track .body { gap: 5px; padding: 8px 12px 10px; }
  body.fit .track .last { font-size: 15px; }
  body.fit #app > .qcard.has-passage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 42%) minmax(0, 1fr) auto; }
  body.fit .qcard.has-passage .answers { grid-template-columns: 1fr 1fr; }
  body.fit #app > .res { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  body.fit .res > .left > .hero { flex: none; }
  body.fit #app > .scope { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  body.fit .scope .side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  body.fit .scope .side > .blits { display: none; }
  body.fit .scope .side > .btn { grid-row: 1; }
  body.fit .scope .side > .note { grid-row: 2; margin: 0 !important; }
  body.fit #app > .garage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; }
  body.fit .garage > .hero { grid-row: auto; }
  body.fit #app > .prog { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  body.fit .prog > .tiles { order: -1; flex-direction: row; }
  body.fit .prog > .tiles > * { flex: 1; }
}
