/* Weitblick Trainer
   Layout: one centred column (max 1080px); a panoramic hero, then unit cards and a grid of training modes.
   Each training view takes the full column with a slim progress bar on top. */
:root {
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #E8ECF3;
  --ink: #142036;
  --muted: #56637D;
  --line: #D6DCE7;
  --sun: #E39B2D;
  --sun-ink: #3A2400;
  --u1: #0E7490; --u2: #B45309; --u3: #4D7C0F; --u4: #9F1239; --u0: #142036;
  --der: #2257D6; --die: #D42E2E; --das: #13894A;
  --good: #13894A; --good-bg: #E3F4EA;
  --bad: #CC3A2A; --bad-bg: #FBE6E2;
  --shadow: 0 1px 2px rgba(20, 32, 54, .06), 0 8px 24px -12px rgba(20, 32, 54, .18);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1424; --surface: #151F33; --surface-2: #1E2A42; --ink: #E7ECF6; --muted: #98A6C0; --line: #2A3753;
    --sun: #F0AE4A; --sun-ink: #2A1800;
    --u1: #2BAACB; --u2: #E58B3D; --u3: #84B83F; --u4: #E4557F; --u0: #E7ECF6;
    --der: #6EA2FF; --die: #FF7B7B; --das: #4FD58B;
    --good: #4FD58B; --good-bg: #133826; --bad: #FF8A78; --bad-bg: #3D1C1A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1424; --surface: #151F33; --surface-2: #1E2A42; --ink: #E7ECF6; --muted: #98A6C0; --line: #2A3753;
  --sun: #F0AE4A; --sun-ink: #2A1800;
  --u1: #2BAACB; --u2: #E58B3D; --u3: #84B83F; --u4: #E4557F; --u0: #E7ECF6;
  --der: #6EA2FF; --die: #FF7B7B; --das: #4FD58B;
  --good: #4FD58B; --good-bg: #133826; --bad: #FF8A78; --bad-bg: #3D1C1A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
#root { max-width: 1080px; margin: 0 auto; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ── header ── */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding-block: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.brand svg { width: 34px; height: 34px; flex: none; border-radius: 9px; }
.brand b { font: 800 19px/1 var(--f-display); letter-spacing: -.01em; }
.brand small { display: block; font: 500 12px/1.2 var(--f-mono); color: var(--muted); letter-spacing: .04em; margin-top: 3px; }
.top .spacer { flex: 1; }
.chipstat { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 700 14px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.chipstat svg { width: 16px; height: 16px; }
.chipstat.flame svg { color: var(--sun); }
.chipstat.bump { animation: bump .45s var(--spring); }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform .2s var(--ease), background .2s; }
.iconbtn:hover { transform: translateY(-1px); }
.iconbtn svg { width: 19px; height: 19px; }

/* ── generic ── */
.view { animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.015em; }
.eyebrow { font: 700 12px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sec { margin-top: 44px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 26px; font-weight: 750; }
.sec-head p { margin: 0; color: var(--muted); font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 16px; transition: transform .18s var(--ease), box-shadow .2s, background .2s, opacity .2s; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ink) 70%, transparent); transform: translateY(-1px); }
.btn.sun { background: var(--sun); color: var(--sun-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.muted { color: var(--muted); }
.kbd { font: 700 11px/1 var(--f-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; color: var(--muted); background: var(--surface); }

/* ── hero ── */
.hero { position: relative; overflow: hidden; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); margin-top: 6px; padding-bottom: 150px; }
.hero-text { position: relative; z-index: 2; padding: 38px 36px 30px; max-width: 660px; }
.hero h1 { font-size: clamp(44px, 8vw, 84px); line-height: .92; font-weight: 800; margin-top: 14px; letter-spacing: -.035em; }
.hero h1 span { display: block; color: var(--muted); font-weight: 600; }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 18px 0 24px; }
.hero .lede b { color: var(--ink); font-family: var(--f-mono); font-size: 17px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.pano { position: absolute; inset: auto 0 0 0; height: 150px; z-index: 1; pointer-events: none; }
.pano svg { position: absolute; bottom: 0; left: -5%; width: 110%; height: 100%; }
.pano .l1 { animation: drift 26s ease-in-out infinite alternate; }
.pano .l2 { animation: drift 19s ease-in-out infinite alternate-reverse; }
.pano .l3 { animation: drift 14s ease-in-out infinite alternate; }
.pano .l4 { animation: drift 22s ease-in-out infinite alternate-reverse; }
.sunball { position: absolute; right: 13%; bottom: 62px; width: 74px; height: 74px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 14px color-mix(in srgb, var(--sun) 16%, transparent), 0 0 0 30px color-mix(in srgb, var(--sun) 7%, transparent); animation: rise 1.6s var(--ease) both, glow 5s ease-in-out 1.6s infinite alternate; }
@keyframes drift { from { transform: translateX(-2.2%); } to { transform: translateX(2.2%); } }
@keyframes rise { from { transform: translateY(70px); } to { transform: none; } }
@keyframes glow { from { transform: scale(1); } to { transform: scale(1.07); } }
.hero-stats { position: absolute; z-index: 3; right: 24px; top: 24px; display: grid; gap: 8px; }
.hstat { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; min-width: 150px; }
.hstat b { display: block; font: 700 24px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.hstat span { font-size: 13px; color: var(--muted); }

/* ── units ── */
.units { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.unit { position: relative; text-align: left; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; min-width: 0; }
.unit:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.unit.on { border-color: var(--uc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--uc) 22%, transparent); }
.unit .ring { width: 56px; height: 56px; }
.unit .ring circle { fill: none; stroke-width: 6; }
.unit .ring .track { stroke: var(--surface-2); }
.unit .ring .val { stroke: var(--uc); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); transform: rotate(-90deg); transform-origin: center; }
.unit .ring text { font: 700 14px var(--f-mono); fill: var(--ink); }
.unit .num { font: 700 12px/1 var(--f-mono); letter-spacing: .12em; color: var(--uc); text-transform: uppercase; }
.unit h3 { font-size: 17px; line-height: 1.2; font-weight: 700; }
.unit .cnt { font-size: 13px; color: var(--muted); margin-top: auto; }
.unit .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--uc); color: var(--bg); display: grid; place-items: center; transform: scale(0); transition: transform .3s var(--spring); }
.unit .check svg { width: 13px; height: 13px; }
.unit.on .check { transform: scale(1); }

/* ── modes ── */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mode { position: relative; overflow: hidden; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start; transition: transform .28s var(--ease), box-shadow .28s, border-color .28s; min-width: 0; }
.mode:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--mc) 45%, var(--line)); }
.mode .ic { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--mc) 14%, transparent); color: var(--mc); transition: transform .35s var(--spring); }
.mode:hover .ic { transform: rotate(-8deg) scale(1.08); }
.mode .ic svg { width: 26px; height: 26px; }
.mode h3 { font-size: 20px; font-weight: 750; line-height: 1.15; }
.mode p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.mode .badge { grid-column: 2; justify-self: start; margin-top: 8px; font: 700 12px/1 var(--f-mono); padding: 6px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.mode::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--mc); opacity: 0; transform: scale(.4); transition: opacity .35s, transform .5s var(--ease); }
.mode:hover::after { opacity: .07; transform: scale(1); }
.mode.big { grid-column: span 2; background: linear-gradient(120deg, color-mix(in srgb, var(--mc) 10%, var(--surface)), var(--surface) 70%); }
.mode.big h3 { font-size: 26px; }

/* ── weak topics ── */
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 4px 12px; align-items: center; }
.trow .tn { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tn i { font-style: normal; color: var(--muted); font-size: 13px; }
.trow .tv { font: 700 14px var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.trow .bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.trow .bar i { display: block; height: 100%; border-radius: 6px; background: var(--tc); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.empty { text-align: center; padding: 28px; color: var(--muted); grid-column: 1 / -1; }

/* ── session ── */
.sbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.progress { flex: 1; height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 10px; background: var(--mc, var(--ink)); transition: width .6s var(--ease); }
.count { font: 700 14px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.timer { font: 700 15px var(--f-mono); padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); border-color: var(--bad); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.stage { max-width: 760px; margin: 0 auto; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 28px 24px; box-shadow: var(--shadow); animation: cardIn .45s var(--ease) both; }
@keyframes cardIn { from { opacity: .001; transform: translateX(36px) rotate(.6deg); } to { opacity: 1; transform: none; } }
.qcard.out { animation: cardOut .28s var(--ease) both; }
@keyframes cardOut { to { opacity: 0; transform: translateX(-36px) rotate(-.6deg); } }
.qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pill { font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; padding: 6px 9px; border-radius: 8px; color: var(--bg); background: var(--uc); }
.tag { font-size: 14px; color: var(--muted); }
.qtext { font: 700 clamp(22px, 3.6vw, 30px)/1.25 var(--f-display); letter-spacing: -.01em; margin: 0 0 22px; overflow-wrap: anywhere; }
.qtext .gap { display: inline-block; min-width: 2.6em; border-bottom: 3px solid var(--sun); margin: 0 .1em; }
.noun-big { text-align: center; padding: 18px 0 26px; }
.noun-big .blank { display: inline-block; min-width: 2.4em; padding: 0 .2em; border-bottom: 4px solid var(--line); color: transparent; transition: color .3s, border-color .3s; }
.noun-big .w { font: 800 clamp(34px, 7vw, 56px)/1.1 var(--f-display); letter-spacing: -.02em; overflow-wrap: anywhere; }

.opts { display: grid; gap: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 17px; line-height: 1.35; transition: transform .18s var(--ease), border-color .2s, background .25s; animation: optIn .4s var(--ease) both; }
.opt:nth-child(2) { animation-delay: .05s; } .opt:nth-child(3) { animation-delay: .1s; } .opt:nth-child(4) { animation-delay: .15s; }
@keyframes optIn { from { opacity: .001; transform: translateY(8px); } }
.opt:hover:not([disabled]) { border-color: var(--ink); transform: translateX(3px); }
.opt .key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 700 13px var(--f-mono); background: var(--surface-2); color: var(--muted); transition: background .2s, color .2s; }
.opt .lbl { min-width: 0; overflow-wrap: anywhere; }
.opt[disabled] { cursor: default; }
.opt.right { border-color: var(--good); background: var(--good-bg); animation: pop .45s var(--spring); }
.opt.right .key { background: var(--good); color: var(--bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .45s; }
.opt.wrong .key { background: var(--bad); color: var(--bg); }
.opt.dim { opacity: .5; }
.opt.chosen { border-color: var(--ink); background: var(--surface-2); }
@keyframes pop { 40% { transform: scale(1.03); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes bump { 40% { transform: scale(1.18); } }

.opts.art { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.art .opt { justify-content: center; flex-direction: column; gap: 8px; padding: 18px 8px; font: 800 24px/1 var(--f-display); }
.opts.art .opt .key { width: 24px; height: 24px; font-size: 12px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.a-der { color: var(--der); } .a-die { color: var(--die); } .a-das { color: var(--das); }

.feedback { margin-top: 16px; border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; animation: fbIn .4s var(--spring) both; }
@keyframes fbIn { from { opacity: .001; transform: translateY(16px) scale(.98); } }
.feedback.ok { background: var(--good-bg); }
.feedback.no { background: var(--bad-bg); }
.feedback .fic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--bg); }
.feedback.ok .fic { background: var(--good); } .feedback.no .fic { background: var(--bad); }
.feedback .fic svg { width: 22px; height: 22px; }
.feedback b { display: block; font: 800 18px/1.2 var(--f-display); }
.feedback.ok b { color: var(--good); } .feedback.no b { color: var(--bad); }
.feedback p { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.feedback .btn { height: 44px; }
.hintline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

.xpfly { position: fixed; z-index: 60; font: 800 20px var(--f-mono); color: var(--good); pointer-events: none; animation: fly 1s var(--ease) forwards; }
@keyframes fly { from { opacity: 1; transform: translate(-50%, 0) scale(.8); } to { opacity: 0; transform: translate(-50%, -70px) scale(1.15); } }

/* cloze */
.cloze { font: 600 clamp(21px, 3.3vw, 27px)/1.6 var(--f-display); margin: 0 0 20px; overflow-wrap: anywhere; }
.cloze input { font: 700 inherit; font-size: .95em; border: 0; border-bottom: 3px solid var(--sun); background: color-mix(in srgb, var(--sun) 10%, transparent); border-radius: 8px 8px 0 0; padding: 0 8px; min-width: 4ch; max-width: 100%; text-align: center; outline: none; transition: border-color .2s, background .2s; }
.cloze input:focus { background: color-mix(in srgb, var(--sun) 20%, transparent); }
.cloze input.ok { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.cloze input.no { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); animation: shake .45s; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* order */
.slots { min-height: 70px; padding: 12px; border-radius: 16px; border: 2px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; margin-bottom: 14px; transition: border-color .3s, background .3s; }
.slots.ok { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.slots.no { border-style: solid; border-color: var(--bad); background: var(--bad-bg); animation: shake .45s; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; margin-bottom: 18px; }
.tile { border: 1.5px solid var(--line); border-bottom-width: 3px; background: var(--surface); border-radius: 12px; padding: 9px 13px; font: 700 17px/1.2 var(--f-display); transition: transform .2s var(--ease), border-color .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--ink); }
.slots .tile { background: var(--surface-2); }
.solution { margin: 0 0 14px; font: 600 18px/1.4 var(--f-display); color: var(--good); }

/* summary */
.summary { text-align: center; }
.bigring { width: 180px; height: 180px; margin: 6px auto 8px; display: block; }
.bigring circle { fill: none; stroke-width: 14; }
.bigring .track { stroke: var(--surface-2); }
.bigring .val { stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1.4s var(--ease); }
.bigring text { font: 800 40px var(--f-mono); fill: var(--ink); }
.grade { font: 800 30px/1.1 var(--f-display); margin: 4px 0 6px; }
.sumstats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; }
.sumstats div { background: var(--surface-2); border-radius: 14px; padding: 10px 16px; min-width: 110px; }
.sumstats b { display: block; font: 700 22px var(--f-mono); }
.sumstats span { font-size: 13px; color: var(--muted); }
.review { text-align: left; margin-top: 22px; display: grid; gap: 8px; }
.review h3 { font-size: 18px; margin: 6px 0 4px; }
.ritem { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: grid; gap: 4px; font-size: 15px; }
.ritem .rq { font-weight: 700; overflow-wrap: anywhere; }
.ritem .ry { color: var(--bad); text-decoration: line-through; overflow-wrap: anywhere; }
.ritem .ra { color: var(--good); font-weight: 700; overflow-wrap: anywhere; }

/* setup */
.setup { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; }
.setup h2 { font-size: 30px; margin-bottom: 6px; }
.setup .group { margin-top: 22px; }
.setup .group > p { margin: 0 0 10px; font: 700 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.tgl { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 13px; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; transition: background .2s, border-color .2s, transform .15s; }
.tgl i { font: 700 12px var(--f-mono); font-style: normal; color: var(--muted); }
.tgl.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tgl.on i { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tgl:active { transform: scale(.96); }
.setup .go { margin-top: 26px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* blitz */
.blitz { text-align: center; }
.blitz .hud { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 4px 0 10px; flex-wrap: wrap; }
.blitz .tring { width: 92px; height: 92px; }
.blitz .tring circle { fill: none; stroke-width: 8; }
.blitz .tring .track { stroke: var(--surface-2); }
.blitz .tring .val { stroke: var(--sun); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .25s linear; }
.blitz .tring text { font: 800 26px var(--f-mono); fill: var(--ink); }
.blitz .score b { display: block; font: 800 40px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.blitz .score span, .blitz .combo span { font-size: 13px; color: var(--muted); }
.blitz .combo b { display: block; font: 800 28px/1 var(--f-mono); color: var(--sun); }
.blitz .combo.hot b { animation: bump .4s var(--spring); }
.bcard { position: relative; margin: 10px auto 24px; max-width: 520px; height: 190px; }
.bcard .noun { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); font: 800 clamp(30px, 6vw, 46px)/1.1 var(--f-display); letter-spacing: -.02em; overflow-wrap: anywhere; animation: nounIn .3s var(--spring) both; }
.bcard .noun small { display: block; font: 500 15px var(--f-body); color: var(--muted); letter-spacing: 0; margin-top: 6px; }
@keyframes nounIn { from { transform: scale(.85) translateY(20px); opacity: .001; } }
.bcard .noun.go-der { animation: toL .35s var(--ease) forwards; } .bcard .noun.go-die { animation: toD .35s var(--ease) forwards; } .bcard .noun.go-das { animation: toR .35s var(--ease) forwards; }
@keyframes toL { to { transform: translate(-60%, 40px) rotate(-12deg); opacity: 0; } }
@keyframes toD { to { transform: translate(0, 90px) scale(.8); opacity: 0; } }
@keyframes toR { to { transform: translate(60%, 40px) rotate(12deg); opacity: 0; } }
.bcard .noun.miss { animation: shake .45s; border-color: var(--bad); }
.bbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin: 0 auto; }
.bbtn { height: 92px; border-radius: 22px; border: 0; color: #fff; font: 800 30px/1 var(--f-display); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: transform .12s var(--ease), filter .2s; box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--bc) 55%, #000); }
.bbtn small { font: 700 11px var(--f-mono); opacity: .8; }
.bbtn:active, .bbtn.press { transform: translateY(4px); box-shadow: 0 2px 0 -1px color-mix(in srgb, var(--bc) 55%, #000); }
.bbtn.b-der { --bc: #2257D6; background: #2257D6; } .bbtn.b-die { --bc: #D42E2E; background: #D42E2E; } .bbtn.b-das { --bc: #13894A; background: #13894A; }
.countdown { font: 800 120px/1 var(--f-display); color: var(--sun); animation: cd .9s var(--ease) both; }
@keyframes cd { from { transform: scale(1.8); opacity: .001; } 60% { transform: scale(1); opacity: 1; } to { transform: scale(.9); opacity: .2; } }

/* flashcards */
.fcwrap { perspective: 1400px; max-width: 560px; margin: 0 auto; touch-action: pan-y; }
.fc { position: relative; height: 320px; transform-style: preserve-3d; transition: transform .6s var(--spring); cursor: pointer; }
.fc.flip { transform: rotateY(180deg); }
.fc .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; gap: 10px; }
.fc .back { transform: rotateY(180deg); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fc .face .t { font: 700 12px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .65; }
.fc .face .w { font: 800 clamp(28px, 5.5vw, 42px)/1.15 var(--f-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fc .face .s { font-size: 16px; opacity: .8; overflow-wrap: anywhere; }
.fc .face .tap { position: absolute; bottom: 16px; font-size: 13px; opacity: .55; }
.fc.drag { transition: none; }
.fc.away-l { animation: awayL .35s var(--ease) forwards; } .fc.away-r { animation: awayR .35s var(--ease) forwards; }
@keyframes awayL { to { transform: translateX(-130%) rotate(-18deg); opacity: 0; } }
@keyframes awayR { to { transform: translateX(130%) rotate(18deg); opacity: 0; } }
.fcbtns { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.fcbtns .no { background: var(--bad-bg); color: var(--bad); }
.fcbtns .yes { background: var(--good-bg); color: var(--good); }

/* pairs */
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin: 0 auto; }
.pcol { display: grid; gap: 10px; }
.pc { min-height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); padding: 10px 14px; font-size: 16px; font-weight: 700; text-align: center; transition: transform .2s var(--ease), border-color .2s, background .2s, opacity .4s; overflow-wrap: anywhere; animation: optIn .4s var(--ease) both; }
.pc:hover:not([disabled]) { transform: translateY(-2px); border-color: var(--ink); }
.pc.sel { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, var(--surface)); transform: scale(1.03); }
.pc.done { border-color: var(--good); background: var(--good-bg); color: var(--good); animation: matched .6s var(--spring) forwards; }
@keyframes matched { 40% { transform: scale(1.06); } to { transform: scale(.96); opacity: .45; } }
.pc.err { border-color: var(--bad); background: var(--bad-bg); animation: shake .45s; }

/* word list */
.search { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 18px; font-size: 17px; margin-bottom: 14px; }
.search:focus { outline: none; border-color: var(--ink); }
.wtable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.wtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.wtable th { text-align: left; font: 700 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.wtable td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wtable tr:last-child td { border-bottom: 0; }
.wtable td:first-child { font-weight: 700; }
.wtable .u { font: 700 11px var(--f-mono); color: var(--uc); }

.foot { margin-top: 56px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.foot button { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; font-size: 13px; }
.confirm { display: inline-flex; gap: 8px; align-items: center; }

/* ── responsive ── */
@media (max-width: 920px) {
  .units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit.all { grid-column: 1 / -1; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { position: relative; inset: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 36px 24px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .brand small { display: none; }
  .hero { border-radius: 20px; padding-bottom: 104px; }
  .hero-text { padding: 26px 20px 22px; }
  .hero-stats { padding: 0 20px 20px; gap: 6px; }
  .pano { height: 104px; }
  .sunball { width: 52px; height: 52px; bottom: 44px; right: 10%; }
  .hstat { min-width: 0; padding: 8px 10px; }
  .hstat b { font-size: 18px; }
  .hstat span { font-size: 12px; }
  .units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit.all { grid-column: 1 / -1; }
  .modes { grid-template-columns: minmax(0, 1fr); }
  .mode.big { grid-column: auto; }
  .topics { grid-template-columns: minmax(0, 1fr); }
  .qcard { padding: 20px 16px 18px; border-radius: 20px; }
  .feedback { grid-template-columns: auto minmax(0, 1fr); }
  .feedback .btn { grid-column: 1 / -1; width: 100%; }
  .bbtn { height: 80px; font-size: 24px; }
  .fc { height: 280px; }
  .pairs { gap: 8px; } .pc { font-size: 14px; padding: 8px; min-height: 58px; }
  .chipstat.xp { display: none; }
  .setup { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.unit .ring { display: block; }
.unit .ring svg, .bigring svg { width: 100%; height: 100%; display: block; overflow: visible; }
