@font-face { font-family: "Rubik"; src: url("fonts/Rubik-Variable.woff2") format("woff2"), url("fonts/Rubik-Variable.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }

:root {
  --navy: #0B1638; --navy-2: #16275A; --navy-3: #2A4483; --ink: #F4F7FB; --muted: #BFD3F2; --dim: #8FA3C8;
  --yellow: #FFD23F; --cyan: #3FD0FF; --pink: #FF6B8A; --green: #3DDC97; --red: #F2495C; --purple: #A98BFF;
  --radius: 22px; --font: "Rubik", "Arial Hebrew", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: radial-gradient(circle at 85% 0%, rgba(63, 208, 255, 0.16), transparent 45%), radial-gradient(circle at 0% 100%, rgba(255, 210, 63, 0.10), transparent 40%), var(--navy);
  background-attachment: fixed; color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.4;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) calc(84px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  overscroll-behavior: none; user-select: none;
}
body.playing { padding-bottom: env(safe-area-inset-bottom, 0px); }
#app { max-width: 520px; margin: 0 auto; padding-top: 14px; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
input { font: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.hide { display: none !important; }

/* ---------- shared pieces ---------- */
.logo { width: 190px; margin: 0 auto; display: block; }
.card { background: var(--navy-2); border-radius: var(--radius); padding: 18px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border-radius: 999px; font-size: 21px; font-weight: 800; background: var(--yellow); color: var(--navy); transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--navy-3); }
.btn.small { min-height: 46px; font-size: 18px; }
.btn[disabled] { opacity: .45; }
.h1 { font-size: 30px; font-weight: 900; line-height: 1.15; }
.h2 { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 15px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: 15px; font-weight: 800; background: var(--navy-3); }

/* ---------- onboarding ---------- */
.onb { display: flex; flex-direction: column; gap: 18px; padding-top: 6vh; }
.field { width: 100%; min-height: 58px; border-radius: 16px; border: 2px solid var(--navy-3); background: var(--navy-2); color: var(--ink); padding: 0 18px; font-size: 21px; font-weight: 700; }
.field::placeholder { color: var(--dim); font-weight: 500; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; }
.choice { min-height: 64px; border-radius: 16px; background: var(--navy-2); border: 2px solid var(--navy-3); font-weight: 800; font-size: 19px; }
.choice[aria-pressed="true"] { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.av { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid transparent; }
.av[aria-pressed="true"] { border-color: var(--ink); }
.av svg { width: 62%; height: 62%; }

/* ---------- home ---------- */
.me { display: flex; align-items: center; gap: 12px; }
.me .avatar { width: 56px; height: 56px; flex: none; }
.xpbar { height: 12px; border-radius: 6px; background: var(--navy-3); overflow: hidden; margin-top: 6px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--cyan)); border-radius: 6px; }
.streak { display: flex; flex-direction: column; align-items: center; font-weight: 900; font-size: 20px; color: var(--yellow); }
.streak svg { width: 30px; height: 30px; }
.daily { background: linear-gradient(135deg, #1D3A7A, var(--navy-2)); border: 2px solid var(--yellow); }
.daily .btn { margin-top: 12px; }
.stations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st { border-radius: var(--radius); padding: 16px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; color: var(--navy); text-align: right; }
.st b { font-size: 22px; font-weight: 900; }
.st span { font-size: 14px; font-weight: 800; direction: ltr; text-align: right; }
.st small { font-size: 14px; font-weight: 600; opacity: .8; }

/* ---------- game ---------- */
.game { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 40px); }
.ghead { display: flex; align-items: center; gap: 10px; }
.quit { width: 44px; height: 44px; border-radius: 50%; background: var(--navy-2); display: flex; align-items: center; justify-content: center; flex: none; }
.quit svg { width: 22px; height: 22px; fill: var(--ink); }
.prog { flex: 1; height: 10px; border-radius: 5px; background: var(--navy-2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--yellow); transition: width .3s; }
.score { font-weight: 900; font-size: 20px; color: var(--yellow); min-width: 64px; text-align: left; }
.timer { height: 8px; border-radius: 4px; background: var(--navy-2); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--cyan); transform-origin: right; }
.tag { align-self: center; font-size: 15px; font-weight: 800; padding: 4px 14px; border-radius: 999px; color: var(--navy); }
.qcard { background: #FBFCFE; color: var(--navy); border-radius: 26px; padding: 22px 18px; text-align: center; font-size: 25px; font-weight: 800; line-height: 1.3; }
.qcard.big { font-size: 32px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { min-height: 78px; border-radius: 20px; background: var(--navy-2); border: 3px solid var(--navy-3); font-size: 21px; font-weight: 800; padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.opt.ok { background: var(--green); border-color: var(--green); color: var(--navy); }
.opt.bad { background: var(--red); border-color: var(--red); }
.opt.fade { opacity: .35; }
.opt svg { width: 56px; height: 56px; }
.letterbox { display: flex; justify-content: center; }
.letter { width: 132px; height: 132px; border-radius: 34px; background: var(--yellow); color: var(--navy); font-size: 96px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.answer-row { display: flex; gap: 10px; }
.answer-row .field { flex: 1; }
.answer-row .btn { width: auto; padding: 0 22px; }
.feedback { border-radius: 18px; padding: 14px 16px; font-weight: 800; font-size: 19px; text-align: center; }
.feedback.ok { background: rgba(61, 220, 151, .16); color: var(--green); }
.feedback.bad { background: rgba(242, 73, 92, .16); color: #FF9AA8; }
.feedback small { display: block; color: var(--muted); font-weight: 600; font-size: 16px; margin-top: 4px; }
.board { display: grid; gap: 10px; }
.board .cell { aspect-ratio: 1; border-radius: 18px; background: var(--navy-2); display: flex; align-items: center; justify-content: center; }
.board .cell svg { width: 64%; height: 64%; }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.words div { background: var(--navy-2); border-radius: 16px; padding: 14px 8px; text-align: center; font-weight: 800; font-size: 21px; }
.digits { direction: ltr; text-align: center; font-size: 46px; font-weight: 900; letter-spacing: 10px; }
.look { text-align: center; font-weight: 900; font-size: 24px; color: var(--pink); }

/* ---------- results ---------- */
.result { text-align: center; display: flex; flex-direction: column; gap: 14px; padding-top: 4vh; }
.bigscore { font-size: 64px; font-weight: 900; color: var(--yellow); line-height: 1; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats3 div { background: var(--navy-2); border-radius: 18px; padding: 12px 6px; }
.stats3 b { display: block; font-size: 26px; font-weight: 900; }
.levelup { background: var(--purple); color: var(--navy); border-radius: 18px; padding: 12px; font-weight: 900; font-size: 20px; }

/* ---------- board & profile ---------- */
.tabs { display: flex; gap: 8px; background: var(--navy-2); padding: 6px; border-radius: 999px; }
.tabs button { flex: 1; min-height: 44px; border-radius: 999px; font-weight: 800; }
.tabs button[aria-selected="true"] { background: var(--yellow); color: var(--navy); }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; background: var(--navy-2); border-radius: 16px; padding: 10px 14px; }
.li .rank { width: 30px; font-weight: 900; color: var(--yellow); text-align: center; }
.li .avatar { width: 40px; height: 40px; flex: none; }
.li b { font-weight: 900; }
.skill { display: flex; flex-direction: column; gap: 6px; }
.skill .bar { height: 14px; border-radius: 7px; background: var(--navy-3); overflow: hidden; }
.skill .bar i { display: block; height: 100%; border-radius: 7px; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.switch { width: 58px; height: 34px; border-radius: 17px; background: var(--navy-3); position: relative; }
.switch::after { content: ""; position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: right .2s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { right: 28px; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: auto 0 0 0; display: flex; justify-content: space-around; background: rgba(11, 22, 56, .96); border-top: 1px solid var(--navy-3); padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); backdrop-filter: blur(10px); z-index: 10; }
.nav[hidden] { display: none; }
.avatar { width: 100%; height: 100%; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; min-height: 52px; justify-content: center; color: var(--dim); font-size: 14px; font-weight: 700; }
.nav-btn svg { width: 26px; height: 26px; fill: currentColor; }
.nav-btn[aria-current="page"] { color: var(--yellow); }

.pop { animation: pop .28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .pop, .shake { animation: none; } .timer i, .prog i { transition: none; } }

/* ---------- leagues & duels ---------- */
.strip[hidden] { display: none; }
a.btn { text-decoration: none; }
.strip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; }
.strip svg, .league-head svg { width: 40px; height: 46px; flex: none; }
.league-head { display: flex; align-items: center; gap: 14px; }
.league-head svg { width: 58px; height: 66px; }
.li.up { box-shadow: inset -5px 0 0 var(--green); }
.li.down { box-shadow: inset -5px 0 0 var(--red); }
.li.me { background: var(--navy-3); }
.zones { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; font-weight: 700; }
.zones .z { display: inline-flex; align-items: center; gap: 6px; }
.zones .z::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.note { background: var(--green); color: var(--navy); border-radius: 18px; padding: 12px 16px; font-weight: 900; }
.code { direction: ltr; font-size: 46px; font-weight: 900; letter-spacing: 8px; color: var(--yellow); text-align: center; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.vs .side { background: var(--navy-2); border: 3px solid transparent; border-radius: 22px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.vs .side.win { border-color: var(--yellow); }
.vs .avatar { width: 64px; height: 64px; }
.vs .pts { font-size: 34px; font-weight: 900; line-height: 1; }
.vs .mid { font-weight: 900; color: var(--dim); font-size: 22px; }
.vs .name { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err { color: var(--red); font-weight: 700; min-height: 1.4em; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- SPEED SCHOOL ---------- */
.school-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right; background: linear-gradient(135deg, #3B2A7A, var(--navy-2)); border: 2px solid var(--purple); }
.school-card .ltr { font-weight: 900; font-size: 15px; letter-spacing: 2px; color: var(--purple); }
.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.subj { background: var(--navy-2); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: right; border-top: 5px solid var(--c); }
.subj b { font-size: 20px; font-weight: 900; }
.subj .bar { width: 100%; height: 8px; border-radius: 4px; background: var(--navy-3); overflow: hidden; }
.subj .bar i { display: block; height: 100%; background: var(--c); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lv { aspect-ratio: 1; border-radius: 16px; background: var(--navy-2); border: 2px solid var(--c); font-weight: 900; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.lv.on { background: var(--c); color: var(--navy); }
.lv[disabled] { border-color: var(--navy-3); color: var(--dim); }
.lv svg { width: 20px; height: 20px; }
.lv-sep { grid-column: 1 / -1; font-weight: 900; font-size: 15px; color: var(--yellow); margin-top: 6px; }
.lv.bg { border-style: dashed; }
.lv.bg:not([disabled]) { box-shadow: 0 0 0 2px var(--yellow) inset; }
.hint { width: auto; flex: 1; gap: 6px; }
.hint[disabled] { opacity: .7; }
.game > .hint { flex: none; align-self: center; padding-inline: 22px; }

/* ---------- leaderboards, profile photo ---------- */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { min-width: 64px; white-space: nowrap; font-size: 16px; }
.avatar.photo { border-radius: 50%; overflow: hidden; display: block; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face { position: relative; display: inline-flex; width: 40px; height: 40px; flex: none; }
.face .crown { position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 24px; height: 24px; }
.face .crown svg { width: 100%; height: 100%; }
.li.top1 { box-shadow: inset -5px 0 0 var(--yellow); }
.li.top2 { box-shadow: inset -5px 0 0 #C9D3E3; }
.li.top3 { box-shadow: inset -5px 0 0 #CD8B5A; }
.li .small { font-size: 13px; }
.myplace { display: flex; align-items: center; gap: 10px; border: 2px solid var(--yellow); }
.myplace .avatar { width: 44px; height: 44px; flex: none; }
.myplace .rank { font-weight: 900; color: var(--yellow); min-width: 34px; text-align: center; }
/* ---------- arena, ranked ---------- */
.mode-card { display: flex; flex-direction: column; gap: 10px; border: 2px solid var(--c); }
.mode-card .tagline { font-weight: 900; letter-spacing: 2px; font-size: 14px; color: var(--c); text-align: right; }
.mode-card svg { width: 34px; height: 40px; flex: none; }
.choices.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.wrap .choice { min-height: 46px; padding: 0 14px; font-size: 16px; }
.pin { direction: ltr; text-align: center; font-size: clamp(40px, 13vw, 72px); white-space: nowrap; font-weight: 900; letter-spacing: 4px; color: var(--yellow); background: var(--navy-2); border-radius: 24px; padding: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--navy-2); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 800; animation: pop .3s; }
.chip .avatar { width: 30px; height: 30px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--c); color: #fff; border-radius: 18px; min-height: 92px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 19px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.tile svg { width: 26px; height: 26px; }
.tile.right { outline: 4px solid #fff; }
.tile.dim-tile { opacity: .35; }
.tile[data-n]::after { content: attr(data-n); font-size: 14px; opacity: .9; }
.timer-num { font-size: 30px; font-weight: 900; color: var(--yellow); }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.searching svg { width: 90px; height: 104px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; margin-top: 18px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.step b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .block { width: 100%; border-radius: 14px 14px 0 0; display: flex; align-items: flex-start; justify-content: center; font-size: 30px; font-weight: 900; color: var(--navy); padding-top: 6px; }
.step.s1 .block { height: 120px; background: var(--yellow); }
.step.s2 .block { height: 86px; background: #C9D3E3; }
.step.s3 .block { height: 64px; background: #CD8B5A; }
.face.big { width: 64px; height: 64px; }
.face.big .crown { width: 34px; height: 34px; top: -20px; }
@media (prefers-reduced-motion: reduce) { .dots i, .searching svg, .chip { animation: none; } }
/* ---------- consent, legal pages ---------- */
.consent { border: 2px solid var(--navy-3); }
.consent .choice { min-height: 52px; font-size: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--yellow); }
.linkish { color: var(--cyan); text-decoration: underline; font-weight: 800; padding: 0; }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.links .btn { width: 100%; }
.legal { line-height: 1.6; font-size: 17px; user-select: text; }
.legal h3 { font-size: 19px; margin: 16px 0 6px; color: var(--yellow); }
.legal ul { padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
.legal p { margin: 6px 0; }
dialog.sheet { width: min(560px, 94vw); max-height: 86vh; overflow: auto; border: none; border-radius: 22px; padding: 18px; background: var(--navy-2); color: var(--ink); direction: rtl; }
dialog.sheet::backdrop { background: rgba(5, 10, 30, .7); }.check[hidden] { display: none; }
dialog.sheet { position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.break { text-align: center; display: flex; flex-direction: column; gap: 12px; }
dialog.break:not([open]) { display: none; }

/* ---------- read-aloud, review, badges, reports ---------- */
.qcard { position: relative; }
.speak { float: left; margin: -14px 12px 2px -10px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy-2); color: var(--yellow); display: flex; align-items: center; justify-content: center; }
.speak svg { width: 22px; height: 22px; }
.review-card { border: 2px solid var(--pink); display: flex; flex-direction: column; gap: 8px; }
.task-card { border: 2px solid var(--cyan); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats4 div { background: var(--navy-3); border-radius: 14px; padding: 10px 4px; font-size: 13px; }
.stats4 b { display: block; font-size: 22px; font-weight: 900; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--navy-3); border-radius: 16px; padding: 10px 6px; font-size: 13px; }
.badge b { font-size: 14px; }
.badge.locked { opacity: .45; }
.badge-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.badge-ic svg { width: 26px; height: 26px; }
.badge-ic.off { background: var(--navy-2); }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; background: var(--navy-2); border: 2px solid var(--yellow); border-radius: 18px; padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: pop .3s; max-width: 92vw; }
.toast.out { opacity: 0; transition: opacity .4s; }
select.field { appearance: auto; }
@media print {
  body { background: #fff !important; color: #000; padding: 0; }
  .nav, .noprint { display: none !important; }
  .card { background: #fff !important; color: #000; border: 1px solid #ccc; }
  .stats4 div { background: #f2f2f2; }
}
.teacher-pill { background: var(--cyan); color: var(--navy); }
.small-chip { font-size: 12px; padding: 2px 8px; margin-top: 4px; display: inline-flex; }
.linkrow { text-align: right; color: inherit; padding: 0; }
.opt.picked { background: var(--navy-3); border-color: var(--cyan); }
.dict-play { width: auto; align-self: center; padding: 0 22px; }
.dict-play svg { width: 22px; height: 22px; }
.choices.wrap .choice .dim { font-size: 12px; }

/* admin screen and reports */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--navy-3); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 28px; }
.pill.warn { background: var(--red); color: #fff; }
.pill.ok { background: var(--green); color: var(--navy); }
.reportbar { padding: 4px 8px 10px; }
.linkish.small { font-size: 14px; opacity: .8; }

.ok-text { color: var(--green); }
.speedy-card .opts { margin-top: 10px; }

/* topic map, daily practice and weekly goal */
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.topic { text-align: right; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--navy-3); border: 0; border-inline-start: 6px solid var(--m); color: inherit; font: inherit; cursor: pointer; }
.topic b { font-size: 15px; }
.legend { gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--m); display: inline-block; }
.goal-card { display: flex; gap: 14px; align-items: center; }
.ring { --deg: 0deg; width: 86px; height: 86px; flex: none; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, var(--navy-2, #13204A) 78%, transparent 79%), conic-gradient(var(--green) var(--deg), var(--navy-3) 0); }
.ring b { font-size: 24px; line-height: 1; }
.goals { gap: 8px; margin-top: 8px; }
.goals .btn { flex: 1; }
.later { margin-top: 10px; }
.later summary { cursor: pointer; padding: 6px 0; }
.later .topics { margin-top: 8px; opacity: .85; }

/* the avatar's look: a frame ring and an accessory above the head */
.dressed { position: relative; display: inline-block; width: 40px; height: 40px; flex: none; }
.me .dressed { width: 56px; height: 56px; }
.myplace .dressed { width: 44px; height: 44px; }
.vs .dressed { width: 64px; height: 64px; }
.face .dressed { width: 100%; height: 100%; }
.dressed > .avatar { width: 100% !important; height: 100% !important; position: relative; }
.ring-frame { position: absolute; inset: -7px; border-radius: 50%; background: var(--ring);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px)); }
.acc { position: absolute; left: 50%; top: -42%; width: 86%; z-index: 1; transform: translateX(-50%); pointer-events: none; }
.acc svg { width: 100%; height: auto; display: block; }

/* wardrobe */
.wardrobe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.ward { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 6px 10px; border-radius: 16px; background: var(--navy-2); border: 2px solid transparent; color: inherit; font: inherit; cursor: pointer; }
.ward.on { border-color: var(--yellow); }
.ward .dressed { width: 56px; height: 56px; }
.wardrobe-card .dressed { width: 56px; height: 56px; }
.row > .dressed:only-child { width: 96px; height: 96px; margin-top: 24px; }

/* streak, teams, friends */
.streak .flame svg { width: 30px; height: 30px; }
.streak > svg { width: 30px; height: 34px; flex: none; }
.teams-pick { gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.teams-pick .btn { flex: 1; }
.tbar { display: grid; grid-template-columns: 72px 1fr 44px; align-items: center; gap: 8px; margin-top: 6px; }
.tbar .track { height: 12px; border-radius: 6px; background: var(--navy-3); overflow: hidden; }
.tbar .track i { display: block; height: 100%; border-radius: 6px; }
.stickers { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 10px; }

/* SPEED SCHOOL as an adventure map: the subjects are islands along a winding path */
.subjects.map { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; position: relative; padding: 6px 0; }
.subjects.map::before { content: ""; position: absolute; inset: 0 50% 0 auto; width: 0; border-inline-start: 4px dashed rgba(255, 255, 255, .18); transform: translateX(50%); }
.subjects.map .subj { border-top: 0; border-radius: 28px 28px 22px 22px; position: relative; box-shadow: 0 8px 0 rgba(0, 0, 0, .25), inset 0 -10px 0 color-mix(in srgb, var(--c) 30%, transparent); }
.subjects.map .subj:nth-child(4n+2), .subjects.map .subj:nth-child(4n+3) { transform: translateY(14px); }

/* ---------- step 8: loading, walkthrough, comfort ---------- */
.boot { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot img { width: 200px; }
.boot-bar { width: 160px; height: 6px; border-radius: 6px; background: var(--navy-3); overflow: hidden; position: relative; }
.boot-bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 6px; background: var(--yellow); animation: boot 1s ease-in-out infinite alternate; }
@keyframes boot { from { transform: translateX(0); } to { transform: translateX(-150%); } }
body:not(.playing) #app > * { animation: screenIn .22s ease-out; }
@media (prefers-reduced-motion: reduce) { #app > *, .boot-bar::after { animation: none !important; } }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.intro .logo { width: 150px; margin: 0 auto; }
.intro-art { width: 150px; height: 150px; margin: 8px auto; border-radius: 50%; background: var(--navy-2); border: 3px solid var(--navy-3); display: grid; place-items: center; }
.intro-art svg { width: 84px; height: 84px; }
.intro-dots { display: flex; justify-content: center; gap: 8px; }
.intro-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--navy-3); }
.intro-dots i.on { background: var(--yellow); width: 26px; border-radius: 6px; }
ul.news { padding: 0 20px 0 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
ol.steps-list { padding: 0 22px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 19px; }
.field.pin { text-align: center; letter-spacing: 12px; font-size: 28px; max-width: 220px; margin: 0 auto; display: block; }
#instHint .quit { flex: none; }
#instHint .btn { flex: none; padding: 0 16px; white-space: nowrap; }

/* text size: the whole app grows, nav included */
html.tx-l body { zoom: 1.12; }
html.tx-xl body { zoom: 1.25; }
/* high contrast: plain dark background, bright text, strong borders */
html.hc { --muted: #F4F7FB; --dim: #DDE7F7; --navy-2: #0F1D47; }
html.hc body { background: #050B22; }
html.hc .card, html.hc .btn.ghost, html.hc .choice, html.hc .field { border-width: 2px; border-color: #9FB4DA; }
html.hc :focus-visible { outline: 4px solid #FFD23F; outline-offset: 3px; }
/* less motion, chosen in the app (on top of the device setting) */
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }

/* tablets, computers and smart boards: wider screens use the space */
@media (min-width: 900px) {
  #app { max-width: 760px; }
  .stations { grid-template-columns: repeat(4, 1fr); }
  .subjects { grid-template-columns: repeat(3, 1fr); }
  .subjects.map { grid-template-columns: repeat(3, 1fr); }
  .subjects.map::before { display: none; }
  .subjects.map .subj:nth-child(4n+2), .subjects.map .subj:nth-child(4n+3) { transform: none; }
  .subjects.map .subj:nth-child(3n+2) { transform: translateY(14px); }
}
@media (min-width: 1400px) and (min-height: 760px) {
  body { zoom: 1.2; }
  html.tx-l body { zoom: 1.32; }
  html.tx-xl body { zoom: 1.45; }
}

/* holiday events */
.event-card { border: 2px solid var(--ev); background: linear-gradient(135deg, color-mix(in srgb, var(--ev) 18%, var(--navy-2)), var(--navy-2)); }
