/* ---------- tokeny ---------- */

:root {
  --bg: #111315;
  --bg-2: #15181b;
  --surface: #1a1d21;
  --surface-2: #20242a;
  --line: #272b31;
  --line-2: #363b43;
  --text: #ebe9e4;
  --muted: #989ea6;
  --faint: #6c727a;
  --accent: #e8692c;
  --accent-hover: #f27a3f;
  --accent-ink: #121416;
  --accent-soft: rgba(232, 105, 44, .13);
  --ok: #5fb57e;
  --ok-soft: rgba(95, 181, 126, .12);
  --bad: #e5584f;
  --bad-soft: rgba(229, 88, 79, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .7);

  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 4px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --w: 1180px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ededea;
    --bg-2: #e5e5e1;
    --surface: #f8f8f6;
    --surface-2: #f0f0ed;
    --line: #d5d5d0;
    --line-2: #bfc0ba;
    --text: #16181b;
    --muted: #555a60;
    --faint: #7c8187;
    --accent: #c2501b;
    --accent-hover: #ad4514;
    --accent-ink: #fbfaf8;
    --accent-soft: rgba(194, 80, 27, .1);
    --ok: #2c8549;
    --ok-soft: rgba(44, 133, 73, .1);
    --bad: #c4362e;
    --bad-soft: rgba(196, 54, 46, .09);
    --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 16px 34px -24px rgba(40, 36, 30, .35);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #ededea;
  --bg-2: #e5e5e1;
  --surface: #f8f8f6;
  --surface-2: #f0f0ed;
  --line: #d5d5d0;
  --line-2: #bfc0ba;
  --text: #16181b;
  --muted: #555a60;
  --faint: #7c8187;
  --accent: #c2501b;
  --accent-hover: #ad4514;
  --accent-ink: #fbfaf8;
  --accent-soft: rgba(194, 80, 27, .1);
  --ok: #2c8549;
  --ok-soft: rgba(44, 133, 73, .1);
  --bad: #c4362e;
  --bad-soft: rgba(196, 54, 46, .09);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 16px 34px -24px rgba(40, 36, 30, .35);
  color-scheme: light;
}

/* ---------- baza ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; width: 100%; max-width: var(--w); margin: 0 auto; padding: 40px 24px 72px; outline: none; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-stretch: 108%; }
h1 { font-size: clamp(30px, 4.2vw, 46px); }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r); font-weight: 600; }
.skip:focus { left: 8px; }

.ic { flex: none; display: block; }
.mono { font-family: var(--mono); }

/* ---------- nagłówek ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: var(--w); margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r);
  font: 800 13px/1 var(--sans); font-stretch: 118%; letter-spacing: .02em;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-weight: 700; font-size: 15px; font-stretch: 106%; letter-spacing: -.01em; }
.brand-txt small { font: 500 11.5px/1.3 var(--mono); color: var(--muted); }

.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r);
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }

.theme-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r); background: transparent; color: var(--muted);
  transition: color .2s, border-color .2s;
}
.theme-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- stopka ---------- */

.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
.foot-in { max-width: var(--w); margin: 0 auto; padding: 18px 24px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); font-size: inherit; }
.link:hover { color: var(--text); text-decoration-color: var(--accent); }

/* ---------- przyciski ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--r); border: 1px solid transparent;
  font-weight: 650; font-size: 15.5px; white-space: nowrap; text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 3px; background: rgba(0, 0, 0, .18); }

.icon-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--faint);
  transition: color .2s, background-color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.tick { border-color: var(--line-2); }
.icon-btn.tick .ic { opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); }
.icon-btn.tick:hover .ic { opacity: .45; transform: none; }
.icon-btn.tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.icon-btn.tick[aria-pressed="true"] .ic { opacity: 1; transform: none; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; margin-bottom: 22px; }
.back:hover { color: var(--text); }

.label { display: block; font: 500 12px/1.4 var(--mono); color: var(--faint); margin-bottom: 10px; }

/* ---------- start ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 28px 0 60px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -.035em; font-stretch: 112%; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 22px; max-width: 46ch; font-size: 18px; color: var(--muted); }
.hero .row { margin-top: 32px; }

.lead { color: var(--muted); max-width: 62ch; font-size: 17px; margin-top: 12px; }

.phrase {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 26px 26px 22px; position: relative; overflow: hidden;
}
.phrase::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.phrase-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.phrase-head .label { margin: 0; }
.phrase-en { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-stretch: 104%; }
.phrase-pl { margin-top: 8px; color: var(--muted); font-size: 16.5px; }
.phrase-ex { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: 15px; color: var(--muted); }
.phrase-ex span { color: var(--text); }
.phrase-foot { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 500 12px var(--mono); color: var(--faint); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 22px; }
.section-head p { font: 500 13px var(--mono); color: var(--faint); }

.decks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.deck { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.deck h3 { font-size: 19px; }
.deck h3 a { text-decoration: none; }
.deck h3 a:hover { color: var(--accent); }
.deck p { color: var(--muted); font-size: 14.5px; grid-column: 1; }
.deck-meter { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.meter { flex: 1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform .6s var(--ease); }
.deck-meter span { font: 500 12.5px var(--mono); color: var(--faint); min-width: 64px; text-align: right; }
.deck-links { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.deck-links a {
  font: 600 13.5px var(--sans); text-decoration: none; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.deck-links a:hover { color: var(--text); border-color: var(--text); }

/* ---------- słownik ---------- */

.dict { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; align-items: start; }
.side { position: sticky; top: 96px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
  border-left: 2px solid transparent; transition: color .2s, background-color .2s;
}
.side-list a small { font: 500 12px var(--mono); color: var(--faint); }
.side-list a:hover { color: var(--text); background: var(--surface); }
.side-list a[aria-current="true"] { color: var(--text); background: var(--surface); border-left-color: var(--accent); border-radius: 0 var(--r) var(--r) 0; }

.dict-head h1 { font-size: clamp(28px, 3.6vw, 40px); }
.dict-head .lead { margin-top: 8px; font-size: 16px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 26px 0 8px; }
.search { position: relative; flex: 1 1 280px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 14px 0 44px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 15.5px; transition: border-color .2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.seg button {
  border: 0; background: transparent; padding: 8px 13px; border-radius: 3px;
  font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.count { font: 500 13px var(--mono); color: var(--faint); margin: 14px 0 0; }
.count b { color: var(--text); font-weight: 600; }

.cat { margin-top: 38px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.cat-head h2 { font-size: 17px; font-stretch: 104%; }
.cat-head span { font: 500 12px var(--mono); color: var(--faint); }

.words { list-style: none; margin: 0; padding: 0; }
.word {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; gap: 4px 24px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.word-en { font-weight: 650; font-size: 16.5px; line-height: 1.35; }
.word-en .alt { color: var(--faint); font-weight: 500; }
.word-pl { color: var(--muted); font-size: 15.5px; line-height: 1.4; padding-top: 1px; }
.word-ex { grid-column: 1 / 3; font-size: 14px; color: var(--faint); line-height: 1.45; }
.word-ex::before { content: "np. "; font: 500 11.5px var(--mono); color: var(--faint); opacity: .8; }
.word-act { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: 4px; margin-top: -6px; }
.word.is-known .word-en { color: var(--muted); }
.word mark { background: var(--accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; box-shadow: inset 0 -1px 0 var(--accent); }

.empty { padding: 48px 0; text-align: left; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

/* ---------- quiz: ustawienia ---------- */

.setup { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; margin-top: 32px; align-items: start; }
.field + .field { margin-top: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: transparent;
  font-weight: 600; font-size: 14.5px; color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.chip small { font: 500 12px var(--mono); color: var(--faint); }
.chip:hover { color: var(--text); border-color: var(--text); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.chip[aria-pressed="true"] small { color: var(--accent); }
.chip-box { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px; display: grid; place-items: center; opacity: .6; }
.chip[aria-pressed="true"] .chip-box { background: var(--accent); border-color: var(--accent); opacity: 1; }
.chip[aria-pressed="true"] .chip-box::after { content: ""; width: 6px; height: 3px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.field-tools { margin-top: 12px; display: flex; gap: 16px; font-size: 14px; }

.modes { display: grid; gap: 8px; }
.mode {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent;
  transition: border-color .2s, background-color .2s;
}
.mode:hover { border-color: var(--text); }
.mode b { font-weight: 650; font-size: 15.5px; }
.mode span { grid-column: 2; color: var(--muted); font-size: 13.5px; }
.mode-dot { grid-row: 1 / span 2; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.mode[aria-pressed="true"] .mode-dot { border: 5px solid var(--accent); }

.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); cursor: pointer; margin-top: 22px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.startbar {
  margin-top: 40px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.startbar p { color: var(--muted); }
.startbar b { color: var(--text); font-family: var(--mono); font-weight: 600; }

/* ---------- quiz: przebieg ---------- */

.run { max-width: 720px; margin: 0 auto; }
.run-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.run-top .back { margin: 0; }
.run-top p { font: 500 13px var(--mono); color: var(--faint); }
.run-top p b { color: var(--text); font-weight: 600; }
.steps { display: flex; gap: 3px; margin-bottom: 28px; }
.steps i { flex: 1; height: 4px; border-radius: 1px; background: var(--line); transition: background-color .3s; }
.steps i.ok { background: var(--ok); }
.steps i.bad { background: var(--bad); }
.steps i.now { background: var(--text); }

.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 34px 34px 30px; }
.q-meta { display: flex; justify-content: space-between; gap: 12px; font: 500 12px var(--mono); color: var(--faint); }
.prompt { margin: 22px 0 28px; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.18; letter-spacing: -.025em; font-stretch: 104%; font-weight: 750; }
.prompt-row { display: flex; align-items: flex-start; gap: 10px; }
.prompt-row .prompt { flex: 1; }
.prompt-row .icon-btn { margin-top: 24px; }

.opts { display: grid; gap: 8px; }
.opt {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2);
  font-size: 16px; font-weight: 550; line-height: 1.35;
  transition: border-color .15s, background-color .15s, transform .12s var(--ease);
}
.opt kbd {
  width: 28px; height: 28px; display: grid; place-items: center;
  font: 600 12.5px var(--mono); color: var(--faint); border: 1px solid var(--line-2); border-radius: 3px;
}
.opt:hover:not(:disabled) { border-color: var(--text); }
.opt:active:not(:disabled) { transform: translateY(1px); }
.opt:disabled { cursor: default; }
.opt.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-ok kbd { border-color: var(--ok); color: var(--ok); }
.opt.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-bad kbd { border-color: var(--bad); color: var(--bad); }
.opts.done .opt:not(.is-ok):not(.is-bad) { opacity: .45; }

.answer {
  width: 100%; height: 54px; padding: 0 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 18px; font-weight: 550; transition: border-color .2s;
}
.answer:focus { outline: none; border-color: var(--accent); }
.answer.shake { animation: shake .35s; border-color: var(--bad); }
.form-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.note { min-height: 22px; margin-top: 8px; font-size: 14px; color: var(--bad); }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.fb { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border-radius: var(--r); border: 1px solid; }
.fb .ic { margin-top: 2px; }
.fb div { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.fb b { font-weight: 650; }
.fb-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.fb-ok .ic, .fb-ok > div > b:first-child { color: var(--ok); }
.fb-bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.fb-bad .ic { color: var(--bad); }
.fb .correct { color: var(--text); font-weight: 650; }
.fb s { color: var(--muted); }
.fb .ex { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hint-keys { margin-top: 16px; font: 500 12px var(--mono); color: var(--faint); }

/* ---------- wynik ---------- */

.result { max-width: 720px; margin: 0 auto; }
.score { display: flex; align-items: baseline; gap: 14px; margin: 6px 0 4px; }
.score b { font-size: clamp(64px, 10vw, 104px); line-height: .95; font-weight: 800; letter-spacing: -.05em; font-stretch: 112%; }
.score span { font: 500 22px var(--mono); color: var(--faint); }
.result .lead { margin-top: 14px; }
.result h2 { font-size: 18px; margin: 40px 0 4px; }
.result .words .word { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* ---------- animacje ---------- */

@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

@media (prefers-reduced-motion: no-preference) {
  main.enter > * { animation: enter .45s var(--ease) both; }
  main.enter > *:nth-child(2) { animation-delay: .04s; }
  main.enter > *:nth-child(3) { animation-delay: .08s; }
  .fade-in { animation: enter .35s var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* ---------- mniejsze ekrany ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 8px; }
  .decks { grid-template-columns: 1fr; }
  .dict { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; margin: 0 -24px 24px; }
  .side .label { display: none; }
  .side-list { flex-direction: row; overflow-x: auto; padding: 0 24px 4px; scrollbar-width: none; }
  .side-list::-webkit-scrollbar { display: none; }
  .side-list a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: var(--r) var(--r) 0 0; }
  .side-list a[aria-current="true"] { border-left: 0; border-bottom-color: var(--accent); border-radius: var(--r) var(--r) 0 0; }
  .setup { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  main { padding: 24px 16px 56px; }
  .top-in { padding: 0 16px; gap: 10px; height: 58px; }
  .brand-txt small { display: none; }
  .brand-txt b { font-size: 14px; }
  .nav a { padding: 8px 10px; }
  .nav a span { display: none; }
  .foot-in { padding: 16px; }
  .side { margin: 0 -16px 20px; }
  .side-list { padding: 0 16px 4px; }
  .hero h1 { font-size: 36px; }
  .hero .lead { font-size: 16.5px; }
  .hero .row .btn { flex: 1; }
  .deck { grid-template-columns: 1fr; }
  .deck-links { grid-row: auto; grid-column: 1; margin-top: 8px; }
  .word { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .word-en { grid-column: 1; }
  .word-pl { grid-column: 1; }
  .word-ex { grid-column: 1; margin-top: 4px; }
  .word-act { grid-row: 1 / span 3; grid-column: 2; }
  .result .words .word { grid-template-columns: 1fr; }
  .qcard { padding: 24px 18px 22px; }
  .startbar .btn { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
}

/* ---------- dodatki ---------- */

.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: 14.5px; }
.cat { scroll-margin-top: 84px; }

/* ---------- poziomy ---------- */

.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 24px 0 4px; }
.levels button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent;
  transition: border-color .2s, background-color .2s;
}
.levels button b { font-weight: 650; font-size: 15px; }
.levels button small { font: 500 12px var(--mono); color: var(--faint); }
.levels button:hover { border-color: var(--text); }
.levels button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.levels button[aria-pressed="true"] small { color: var(--accent); }
.run .levels, .result .levels { margin: 0 0 26px; }
.deck-sub { font: 500 13px var(--mono); color: var(--faint); margin-left: 6px; letter-spacing: 0; }
@media (max-width: 640px) {
  .levels button { padding: 9px 10px; }
  .levels button b { font-size: 14px; }
}
.decks { grid-template-columns: minmax(0, 1fr); }
.deck-meter { max-width: 520px; }
