/* Labas: clean workspace theme (white cards on light grey, mint green + navy). No frameworks. */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --line: #e7e9f0;
  --text: #2e3753;
  --muted: #8a91a6;
  --green: #22c38a;
  --green-ink: #13a571; /* green used as text: enough contrast on white */
  --green-soft: #e8f8f1;
  --navy: #33416a;
  --red: #ef3b53;
  --red-soft: #fdecee;
  --amber: #f0a020;
  --on-green: #ffffff;
  --shadow: 0 1px 2px rgb(30 40 80 / 0.04), 0 4px 18px rgb(30 40 80 / 0.06);
  --radius: 6px;
  --font: "Mulish", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f121a;
    --surface: #171b26;
    --surface-2: #1d2230;
    --line: #2a3042;
    --text: #e4e8f3;
    --muted: #8e96ad;
    --green: #2fd597;
    --green-ink: #3ee0a3;
    --green-soft: #15302a;
    --navy: #a9b6dc;
    --red: #ff5a6e;
    --red-soft: #3a1c22;
    --on-green: #0c1a14;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 22px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
/* The same dark rules when Dark is picked in the theme switch */
:root[data-theme="dark"] {
  --bg: #0f121a;
  --surface: #171b26;
  --surface-2: #1d2230;
  --line: #2a3042;
  --text: #e4e8f3;
  --muted: #8e96ad;
  --green: #2fd597;
  --green-ink: #3ee0a3;
  --green-soft: #15302a;
  --navy: #a9b6dc;
  --red: #ff5a6e;
  --red-soft: #3a1c22;
  --on-green: #0c1a14;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 22px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); font-size: 14px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
svg { flex: none; }

/* ---------------------------------------------------------------- top bar */
.nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.nav-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-word { font-weight: 800; font-size: 16px; letter-spacing: 0.04em; }
.brand-word span { color: var(--green-ink); }
.links { display: flex; gap: 28px; }
.links a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.links a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.links a:hover { color: var(--text); text-decoration: none; }
.account { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 14.5px; font-weight: 700; color: var(--navy); }
.who { display: flex; align-items: center; gap: 10px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--navy); cursor: pointer; }
.linkbtn:hover { color: var(--green-ink); }

/* ---------------------------------------------------------------- layout */
.app { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; display: grid; gap: 24px; align-content: start; }
.footer { max-width: 1240px; width: 100%; margin: 0 auto; padding: 18px 24px 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.loading { padding: 64px 0; text-align: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------------------------------------------------------------- controls */
.btn {
  font: 700 14px var(--font); border: 1px solid var(--green); border-radius: 4px; padding: 0 18px; height: 40px;
  background: var(--green); color: var(--on-green); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.outline { background: var(--surface); color: var(--green-ink); }
.btn.outline:hover { background: var(--green-soft); filter: none; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.dashed { background: none; border: 1px dashed var(--green); color: var(--green-ink); }
.btn.dashed:hover { background: var(--green-soft); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
input[type="text"], textarea {
  width: 100%; font: 15px/1.55 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; transition: border-color 0.15s;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--green); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 160px; }
label.field { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.code-chip { font: 700 14px var(--mono); letter-spacing: 0.12em; color: var(--navy); border: 1px solid var(--line); background: var(--surface-2); padding: 3px 10px; border-radius: 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- sign-in */
.notice { background: var(--green-soft); color: var(--text); border: 1px solid var(--green); border-radius: var(--radius); padding: 12px 16px; font-weight: 600; }
.signin { display: grid; gap: 12px; justify-items: start; }
.gsi-slot { min-height: 44px; }
.dev-login { display: flex; gap: 10px; width: min(100%, 420px); }
.fine { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- tile picker (like "Let's create a puzzle") */
.picker { padding: 36px 40px 40px; display: grid; gap: 28px; }
.picker-head { text-align: center; display: grid; gap: 8px; }
.picker-head h2 { font-size: 24px; font-weight: 700; color: var(--navy); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile {
  position: relative; display: grid; justify-items: center; gap: 12px; padding: 22px 12px 18px; background: none; border: 1px solid transparent;
  border-radius: var(--radius); font: inherit; color: var(--text); cursor: default; text-align: center;
}
button.tile { cursor: pointer; }
button.tile:hover { background: var(--surface-2); }
.tile[aria-selected="true"] { border-color: var(--green); background: var(--green-soft); }
.tile-icon svg { width: 78px; height: 78px; }
.tile-name { font-weight: 700; font-size: 16px; color: var(--navy); }
.tile-desc { color: var(--muted); font-size: 13.5px; max-width: 26ch; }
.tip {
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 4px; padding: 6px 10px;
  font-size: 13px; color: var(--text); text-align: left; opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--surface); }
button.tile:hover .tip, .tile[aria-selected="true"] .tip { opacity: 1; }
.pane { display: grid; gap: 14px; }
.pane-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.lobby .picker { padding-top: 48px; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; background: var(--surface-2); }
.preview p { line-height: 1.75; }

/* ---------------------------------------------------------------- list column (like "Terms") */
.list-card { padding: 22px 22px 14px; display: grid; gap: 10px; align-content: start; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.duel-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; color: var(--text); }
.duel-row:hover { text-decoration: none; background: var(--surface-2); }
.duel-row .act { color: var(--green-ink); font-weight: 700; font-size: 14px; }
.rows .empty-row { padding: 14px 2px; color: var(--muted); }
.answer { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 12px 2px; align-items: start; }
.answer .mark-ok, .answer .mark-miss { width: 18px; height: 18px; margin-top: 3px; }
.answer .mark-ok { color: var(--green-ink); }
.answer .mark-miss { color: var(--red); }
.answer .tag { font-size: 12.5px; font-weight: 700; }
.answer .tag.ok { color: var(--green-ink); }
.answer .tag.miss { color: var(--red); }
.found { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); padding: 0 6px; border-radius: 4px; }

/* ---------------------------------------------------------------- workspace (duel + results) */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.back svg { width: 16px; height: 16px; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.workspace { display: grid; gap: 24px; align-items: start; }
.workspace.two { grid-template-columns: 280px minmax(0, 1fr); }
.workspace.three { grid-template-columns: 270px 340px minmax(0, 1fr); }
.side { padding: 0; }
.side section { padding: 20px 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.side section:first-child { border-top: 0; }
.big-num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.big-num small { font-size: 14px; font-weight: 600; color: var(--muted); }
.timer { font: 700 22px var(--mono); color: var(--navy); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: flex; gap: 10px; align-items: center; }
.checks svg { width: 18px; height: 18px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.people li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.people .pts { margin-left: auto; font-weight: 800; color: var(--navy); }
.people li.you { font-weight: 700; }
.people .played { margin-left: auto; color: var(--muted); font-size: 13px; }
.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.kv li { display: flex; justify-content: space-between; }
.kv b { color: var(--navy); }
.kv b.good { color: var(--green-ink); }
.kv b.bad { color: var(--red); }
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font-size: 46px; font-weight: 800; color: var(--navy); line-height: 1; letter-spacing: -0.02em; }
.winner { background: var(--green); color: var(--on-green); border-radius: 4px; padding: 10px 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.winner svg { width: 18px; height: 18px; }
.winner.tie { background: var(--navy); color: var(--surface); }

/* The paper sheet */
.sheet-wrap { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.sheet { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 3px; padding: 30px 40px 40px; display: grid; gap: 22px; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.sheet-head b { font-weight: 800; }
.sheet-title { text-align: center; font-size: 34px; font-weight: 700; color: var(--text); }
.sheet-text { font-size: 17px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-text mark, .editor-marks mark {
  background: none; color: inherit; text-decoration: underline wavy var(--red) 1.5px; text-underline-offset: 6px; text-decoration-skip-ink: none;
}
.sheet-text mark.new { text-decoration-color: var(--amber); }

/* Editable text with underlines: a transparent textarea over a mirror that draws the marks. */
.editor { position: relative; }
.editor-marks, .editor textarea {
  font: 17px/2 var(--font); padding: 4px 2px; margin: 0; border: 0; letter-spacing: normal; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal;
}
.editor-marks { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.editor textarea { position: relative; display: block; width: 100%; min-height: 260px; background: transparent; resize: vertical; color: var(--text); caret-color: var(--green-ink); border-radius: 0; }
.editor textarea:focus { outline: none; }
.editor-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.editor-hint i { width: 26px; height: 10px; flex: none; background: none; border-bottom: 2px wavy var(--red); text-decoration: underline wavy var(--red); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  background: var(--navy); color: var(--surface); padding: 10px 18px; border-radius: 4px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .workspace.three { grid-template-columns: 270px minmax(0, 1fr); }
  .workspace.three > .sheet-wrap { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-inner { gap: 18px; padding: 0 16px; }
  .links { gap: 16px; }
  .app { padding: 20px 16px 40px; }
  .lobby, .workspace.two, .workspace.three { grid-template-columns: 1fr; }
  .picker { padding: 28px 18px; }
  .tiles { grid-template-columns: 1fr; }
  .tip { display: none; }
  .sheet-wrap { padding: 12px; }
  .sheet { padding: 20px 18px 24px; }
  .sheet-title { font-size: 26px; }
}
@media (max-width: 520px) {
  .links { display: none; }
  .account .who span { display: none; }
}

/* ---------------------------------------------------------------- landing page */
.landing { display: grid; gap: 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 40px 48px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-ink); }
.hero h1 { font-size: clamp(34px, 4.6vw, 50px); line-height: 1.1; margin: 14px 0 16px; color: var(--navy); }
.hero h1 em { font-style: normal; color: var(--green-ink); }
.hero .lede { font-size: 17px; color: var(--muted); max-width: 46ch; margin-bottom: 26px; }
.hero-sheet { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.hero-sheet .sheet { padding: 22px 26px 26px; gap: 14px; }
.hero-sheet .sheet-title { font-size: 24px; }
.hero-sheet .sheet-text { font-size: 15.5px; line-height: 1.95; }
.hero-score { position: absolute; right: -14px; bottom: -18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 4px; min-width: 170px; }
.hero-score div { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; }
.hero-score b { color: var(--navy); }
.hero-score .lead b { color: var(--green-ink); }
.section { padding: 36px 40px 40px; display: grid; gap: 26px; }
.section-head { text-align: center; display: grid; gap: 8px; justify-items: center; }
.section-head h2 { font-size: 26px; color: var(--navy); }
.section-head p { color: var(--muted); max-width: 60ch; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.point { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 6px; text-align: center; }
.point b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.point.plus b { color: var(--green-ink); }
.point.minus b { color: var(--red); }
.point span { font-weight: 700; color: var(--navy); }
.point p { color: var(--muted); font-size: 13.5px; }
.examples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; list-style: none; margin: 0; padding: 0; }
.examples li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 14.5px; }
.examples .bad { text-decoration: underline wavy var(--red) 1.5px; text-underline-offset: 5px; }
.examples .good { color: var(--green-ink); font-weight: 700; }
.examples svg { width: 16px; height: 16px; color: var(--muted); }
.faq { display: grid; gap: 0; max-width: 760px; margin: 0 auto; width: 100%; }
.faq details { border-top: 1px solid var(--line); padding: 14px 4px; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-ink); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin-top: 8px; }
.cta { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 40px; }
.cta h2 { font-size: 26px; color: var(--navy); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; gap: 34px; }
  .hero-score { right: 8px; bottom: -22px; }
  .section { padding: 28px 18px; }
  .points, .examples { grid-template-columns: 1fr; }
  .examples li { grid-template-columns: 1fr; gap: 4px; }
  .examples svg { display: none; }
  .cta { padding: 28px 18px; }
}

/* ---------------------------------------------------------------- shared bits for Play and Learn */
.tiles.two { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; width: fit-content; }
.segmented button { font: 700 13.5px var(--font); color: var(--muted); background: none; border: 0; border-radius: 4px; padding: 6px 14px; cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 3px rgb(30 40 80 / 0.12); }
.page-head { display: grid; gap: 4px; }
.page-head h1 { font-size: 26px; color: var(--navy); }
.stack-sm { display: grid; gap: 10px; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.3s; }
.linkbtn.small { font-size: 13px; color: var(--green-ink); display: inline-flex; align-items: center; gap: 4px; }
.linkbtn.small svg { width: 15px; height: 15px; }
.answer .mark-open { width: 18px; height: 18px; margin-top: 3px; color: var(--red); }
.answer.fixed .found { text-decoration: line-through; color: var(--muted); }
.reveal-btns { display: flex; gap: 16px; margin-top: 6px; }
.reveal { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 4px; background: var(--green-soft); font-size: 13.5px; }
.reveal svg { width: 16px; height: 16px; margin-top: 2px; color: var(--green-ink); }
b.good { color: var(--green-ink); }
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mode { display: flex; gap: 18px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.mode .tile-icon svg { width: 64px; height: 64px; }
.mode h3 { font-size: 18px; color: var(--navy); margin-bottom: 6px; }

@media (max-width: 860px) {
  .tiles.two { grid-template-columns: 1fr 1fr; }
  .modes { grid-template-columns: 1fr; }
}

/* ================================================================ Learn path (Duolingo-style) */
.learn { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
.learn-main { display: grid; gap: 28px; }
.learn-side { display: grid; gap: 16px; position: sticky; top: 88px; }
.side-card { padding: 18px 20px; display: grid; gap: 12px; }
.chips { display: flex; justify-content: space-between; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; color: var(--navy); }
.chip svg { width: 24px; height: 24px; }
.unit { display: grid; gap: 18px; }
.unit-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 12px;
  background: linear-gradient(135deg, #2fd497, #18b47b); color: #fff; box-shadow: 0 4px 0 #129765;
}
.unit-banner.alt { background: linear-gradient(135deg, #4c5d8f, #2c3860); box-shadow: 0 4px 0 #1f2846; }
.unit-banner h2 { color: #fff; font-size: 22px; }
.unit-banner p { opacity: 0.92; font-size: 14.5px; }
.unit-no { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.btn.light { background: #fff; border-color: #fff; color: #129765; box-shadow: 0 3px 0 rgb(0 0 0 / 0.15); }
.unit-banner.alt .btn.light { color: #2c3860; }
.path { display: grid; justify-items: center; gap: 46px; padding: 34px 0 8px; }
.node-row { position: relative; display: grid; justify-items: center; gap: 6px; transform: translateX(var(--x)); }
.node {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--green); color: #fff; box-shadow: 0 6px 0 #129765; transition: transform 0.08s, box-shadow 0.08s;
}
.node svg { width: 34px; height: 34px; }
.node:hover { text-decoration: none; filter: brightness(1.04); }
.node:active { transform: translateY(4px); box-shadow: 0 2px 0 #129765; }
.node.done { background: #ffc21a; box-shadow: 0 6px 0 #d99e00; color: #fff; }
.node.locked { background: var(--line); color: var(--muted); box-shadow: 0 6px 0 #cfd3de; cursor: not-allowed; pointer-events: none; }
.node.current::before {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--line) 0); z-index: -1;
  -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px); mask: radial-gradient(circle, transparent 41px, #000 42px);
}
.node-label { font-size: 13px; font-weight: 700; color: var(--muted); max-width: 160px; text-align: center; }
.start-bubble {
  position: absolute; bottom: calc(100% + 4px); background: var(--surface); color: var(--green-ink); border: 2px solid var(--line);
  border-radius: 10px; padding: 5px 12px; font-weight: 800; font-size: 13px; letter-spacing: 0.04em; animation: bob 1.4s ease-in-out infinite; white-space: nowrap;
}
.start-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--line); }
@keyframes bob { 50% { transform: translateY(-5px); } }
.mini-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-board li, .board li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.mini-board .name, .board .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board .rank { width: 18px; color: var(--muted); font-weight: 800; }
.mini-board li.you { font-weight: 800; }
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.practice-card .btn { justify-self: start; }

/* ================================================================ Lesson player */
body.focus .nav, body.focus .footer { display: none; }
body.focus .app { max-width: 1000px; padding: 0 24px 140px; }
.lesson { display: grid; gap: 28px; }
.lesson-top { display: flex; align-items: center; gap: 18px; padding: 26px 0 4px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.sm { padding: 4px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--red); }
.progress { flex: 1; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(var(--green), #18b47b); transition: width 0.4s; box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.3); }
.hearts { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; color: var(--red); }
.hearts svg { width: 26px; height: 26px; }
.lesson-body { display: grid; gap: 22px; max-width: 640px; width: 100%; margin: 0 auto; }
.q { font-size: 28px; color: var(--navy); }
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; font: 600 17px var(--font); color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 3px 0 var(--line); cursor: pointer;
}
.option:hover { background: var(--surface-2); }
.option .key { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 13px; color: var(--muted); flex: none; }
.option[aria-pressed="true"] { border-color: #59c3ff; background: #eaf7ff; box-shadow: 0 3px 0 #59c3ff; color: #1677b3; }
.option.right { border-color: var(--green); background: var(--green-soft); box-shadow: 0 3px 0 var(--green); color: var(--green-ink); }
.option.wrong { border-color: var(--red); background: var(--red-soft); box-shadow: 0 3px 0 var(--red); color: var(--red); }
.lesson-sheet { padding: 22px 26px; }
.lesson-sheet .editor textarea { min-height: 120px; }
.lesson-foot { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--line); background: var(--surface); z-index: 6; }
.foot-inner { max-width: 1000px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 108px; }
.lesson-foot.right { background: #d7ffb8; border-top-color: transparent; }
.lesson-foot.wrong { background: #ffdfe0; border-top-color: transparent; }
.feedback { display: flex; align-items: center; gap: 14px; min-width: 0; }
.feedback b { display: block; font-size: 20px; }
.feedback span { font-size: 14.5px; }
.lesson-foot.right .feedback { color: #3e8a00; }
.lesson-foot.wrong .feedback { color: #c2142b; }
.fb-icon { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.fb-icon svg { width: 30px; height: 30px; }
.answer-reveal { margin-top: 4px; font-size: 14px; }
.answer-reveal summary { cursor: pointer; font-weight: 700; }
.btn.big { height: 50px; padding: 0 32px; font-size: 15px; border-radius: 12px; box-shadow: 0 4px 0 #129765; text-transform: uppercase; letter-spacing: 0.04em; }
.btn.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #129765; }
.btn.big[disabled] { background: var(--line); border-color: var(--line); color: var(--muted); box-shadow: 0 4px 0 #cfd3de; opacity: 1; }
.lesson-foot.wrong .btn.big { background: #ee2b47; border-color: #ee2b47; box-shadow: 0 4px 0 #b9162e; color: #fff; }
.lesson-foot.right .btn.big { background: #58cc02; border-color: #58cc02; box-shadow: 0 4px 0 #46a302; color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgb(15 18 30 / 0.5); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { padding: 32px; max-width: 420px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.modal-icon svg { width: 64px; height: 64px; }
.finish { padding: 48px 32px; display: grid; gap: 18px; justify-items: center; text-align: center; margin-top: 40px; }
.finish h1 { font-size: 32px; color: #e5a100; }
.finish-icon svg { width: 120px; height: 120px; }
.finish-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.fstat { border-radius: 14px; border: 2px solid; min-width: 130px; overflow: hidden; display: grid; text-align: center; }
.fstat span { color: #fff; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px; }
.fstat b { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 22px; padding: 12px; background: var(--surface); }
.fstat b svg { width: 22px; height: 22px; }
.fstat.xp { border-color: #ffc21a; }
.fstat.xp span { background: #ffc21a; }
.fstat.xp b { color: #e5a100; }
.fstat.acc { border-color: #58cc02; }
.fstat.acc span { background: #58cc02; }
.fstat.acc b { color: #46a302; }
.fstat.hp { border-color: #ff4b62; }
.fstat.hp span { background: #ff4b62; }
.fstat.hp b { color: #e0283f; }

/* ================================================================ Leaderboard */
.board-page { padding: 36px 40px 40px; display: grid; gap: 20px; max-width: 720px; width: 100%; margin: 0 auto; }
.board-icon svg { width: 72px; height: 72px; }
.segmented a { font: 700 13.5px var(--font); color: var(--muted); border-radius: 4px; padding: 6px 14px; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a[aria-selected="true"] { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 3px rgb(30 40 80 / 0.12); }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board li { padding: 10px 14px; border-radius: 10px; font-size: 15px; }
.board li.you { background: var(--green-soft); font-weight: 800; }
.board .rank { width: 30px; font-weight: 800; color: var(--muted); text-align: center; }
.board .rank.r1 { color: #e5a100; }
.board .rank.r2 { color: #8f9bb3; }
.board .rank.r3 { color: #c26d2c; }
.board b { color: var(--navy); }
.center { text-align: center; }

/* ================================================================ CMS */
.cms { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; }
.cms-tree { padding: 14px; }
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tree ul { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 2px; }
.tree-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.lesson-row { cursor: pointer; font-size: 14px; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row.active { background: var(--green-soft); font-weight: 700; }
.tools { display: inline-flex; gap: 0; opacity: 0.55; }
.tree-row:hover .tools, .ch-row:hover .tools, .tree-row.active .tools { opacity: 1; }
.cms-main { padding: 22px 24px; display: grid; gap: 14px; }
.ch-row { display: grid; grid-template-columns: 116px 1fr auto; gap: 12px; align-items: start; padding: 14px 2px; }
.ch-row p { margin-top: 4px; line-height: 1.8; }
.ch-row mark { background: none; color: inherit; text-decoration: underline wavy var(--red) 1.5px; text-underline-offset: 4px; }
.badge { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 4px; text-align: center; }
.badge.fix { background: var(--green-soft); color: var(--green-ink); }
.badge.choose { background: #eaf0ff; color: #3a55b4; }
.pill { font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.form { display: grid; gap: 16px; }
.form .preview .sheet-text { font-size: 16px; }
.opt-edit { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.opt-edit li { display: flex; gap: 10px; align-items: center; }
.opt-edit input[type="radio"] { width: 18px; height: 18px; accent-color: var(--green); flex: none; }

@media (max-width: 1000px) {
  .learn { grid-template-columns: 1fr; }
  .learn-side { position: static; order: -1; }
  .cms { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .unit-banner { flex-direction: column; align-items: flex-start; }
  .q { font-size: 22px; }
  .foot-inner { flex-direction: column; align-items: stretch; min-height: 0; padding: 16px; }
  .btn.big { width: 100%; }
  body.focus .app { padding: 0 16px 220px; }
  .ch-row { grid-template-columns: 1fr; }
  .board-page { padding: 24px 16px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lesson-foot.right { background: #1d3a12; }
  :root:not([data-theme="light"]) .lesson-foot.wrong { background: #3d151b; }
  :root:not([data-theme="light"]) .lesson-foot.right .feedback { color: #9be15d; }
  :root:not([data-theme="light"]) .lesson-foot.wrong .feedback { color: #ff8a98; }
  :root:not([data-theme="light"]) .option[aria-pressed="true"] { background: #11283a; color: #8fd3ff; }
  :root:not([data-theme="light"]) .fb-icon { background: var(--surface); }
  :root:not([data-theme="light"]) .node.locked { box-shadow: 0 6px 0 #1b2030; }
}
/* The same dark rules when Dark is picked in the theme switch */
:root[data-theme="dark"] .lesson-foot.right { background: #1d3a12; }
:root[data-theme="dark"] .lesson-foot.wrong { background: #3d151b; }
:root[data-theme="dark"] .lesson-foot.right .feedback { color: #9be15d; }
:root[data-theme="dark"] .lesson-foot.wrong .feedback { color: #ff8a98; }
:root[data-theme="dark"] .option[aria-pressed="true"] { background: #11283a; color: #8fd3ff; }
:root[data-theme="dark"] .fb-icon { background: var(--surface); }
:root[data-theme="dark"] .node.locked { box-shadow: 0 6px 0 #1b2030; }

@media (prefers-reduced-motion: reduce) {
  .start-bubble { animation: none; }
  .progress i { transition: none; }
}

/* ================================================================ Landing page v2 */
.hero-demo { position: relative; padding: 34px 26px 30px; }
.demo-card { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; gap: 12px; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.demo-top { display: flex; align-items: center; gap: 12px; }
.demo-x svg { width: 18px; height: 18px; color: var(--muted); }
.demo-bar { flex: 1; height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.demo-bar i { display: block; width: 62%; height: 100%; border-radius: 6px; background: var(--green); }
.demo-hearts { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 800; }
.demo-hearts svg { width: 20px; height: 20px; }
.demo-q { font-weight: 800; font-size: 18px; color: var(--navy); margin-top: 4px; }
.demo-opt { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 3px 0 var(--line); font-weight: 600; font-size: 15px; }
.demo-opt .key { width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 7px; display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.demo-opt.picked { border-color: #58cc02; background: #effbe5; box-shadow: 0 3px 0 #58cc02; color: #3e8a00; }
.demo-foot { display: flex; align-items: center; gap: 12px; background: #d7ffb8; color: #3e8a00; border-radius: 12px; padding: 10px 14px; margin-top: 4px; }
.demo-foot b { display: block; font-size: 16px; }
.demo-foot span { font-size: 13px; }
.demo-ok { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.demo-ok svg { width: 20px; height: 20px; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 13px; color: var(--muted); animation: bob 3s ease-in-out infinite;
}
.float-chip b { font-size: 18px; color: var(--navy); }
.float-chip svg { width: 22px; height: 22px; }
.float-chip.streak { top: -2px; right: 26%; }
.float-chip.xp { bottom: 4px; left: 0; animation-delay: -1.5s; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: grid; gap: 8px; align-content: start; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.feature-icon svg { width: 34px; height: 34px; }
.feature-icon.fi-heart { background: #ffe9ec; }
.feature-icon.fi-fire { background: #fff1e0; }
.feature-icon.fi-cup, .feature-icon.fi-learn, .feature-icon.fi-fix { background: var(--green-soft); }
.feature-icon.fi-room { background: #eaf0ff; }
.feature h3 { font-size: 17px; color: var(--navy); }
.feature p { color: var(--muted); font-size: 14px; }

.path-section { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: center; gap: 40px; }
.path-copy { display: grid; gap: 14px; }
.path-copy h2 { font-size: 30px; color: var(--navy); }
.mini-path { display: grid; justify-items: center; gap: 26px; padding: 8px 0 12px; }
.mini-banner { width: 100%; max-width: 340px; background: linear-gradient(135deg, #2fd497, #18b47b); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 4px 0 #129765; display: grid; }
.mini-banner small { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.mini-banner b { font-size: 18px; }
.mini-node { display: grid; justify-items: center; gap: 4px; transform: translateX(var(--x)); }
.mini-node span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); box-shadow: 0 5px 0 #129765; }
.mini-node span svg { width: 26px; height: 26px; }
.mini-node.done span { background: #ffc21a; box-shadow: 0 5px 0 #d99e00; }
.mini-node.current span { outline: 6px solid var(--green-soft); }
.mini-node.locked span { background: var(--line); color: var(--muted); box-shadow: 0 5px 0 #cfd3de; }
.mini-node small { font-size: 12px; font-weight: 700; color: var(--muted); }

.duel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.duel-steps { display: grid; gap: 16px; }
.step-row { display: flex; gap: 16px; align-items: center; }
.step-row .tile-icon svg { width: 54px; height: 54px; }
.step-row h3 { color: var(--navy); }
.points.compact { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.points.compact .point { padding: 12px 8px; gap: 2px; }
.points.compact .point b { font-size: 24px; }
.points.compact .point span { font-size: 13px; }
.cta-icon svg { width: 80px; height: 80px; }

@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .path-section, .duel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .hero-demo { padding: 18px 6px 26px; }
  .float-chip.streak { right: 18%; top: -6px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-opt.picked { background: #1d3a12; color: #9be15d; }
  :root:not([data-theme="light"]) .demo-foot { background: #1d3a12; color: #9be15d; }
  :root:not([data-theme="light"]) .demo-ok { background: var(--surface); }
  :root:not([data-theme="light"]) .feature-icon.fi-heart { background: #3a1c22; }
  :root:not([data-theme="light"]) .feature-icon.fi-fire { background: #3a2a14; }
  :root:not([data-theme="light"]) .feature-icon.fi-room { background: #1c2440; }
}
/* The same dark rules when Dark is picked in the theme switch */
:root[data-theme="dark"] .demo-opt.picked { background: #1d3a12; color: #9be15d; }
:root[data-theme="dark"] .demo-foot { background: #1d3a12; color: #9be15d; }
:root[data-theme="dark"] .demo-ok { background: var(--surface); }
:root[data-theme="dark"] .feature-icon.fi-heart { background: #3a1c22; }
:root[data-theme="dark"] .feature-icon.fi-fire { background: #3a2a14; }
:root[data-theme="dark"] .feature-icon.fi-room { background: #1c2440; }

@media (prefers-reduced-motion: reduce) {
  .float-chip { animation: none; }
}

/* ---------------------------------------------------------------- theme switch */
.theme-btn { margin-left: 6px; color: var(--navy); }
.theme-btn svg { width: 21px; height: 21px; }
:root[data-theme="light"] { color-scheme: light; }

/* ---------------------------------------------------------------- unit feedback */
.banner-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.banner-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0; color: #fff; opacity: 0.9; font: 700 13px var(--font); cursor: pointer; }
.banner-link:hover { opacity: 1; text-decoration: underline; }
.banner-link svg { width: 16px; height: 16px; }
.unit-done { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; padding: 16px 20px; }
.unit-done.compact { grid-template-columns: 1fr auto; text-align: left; border: 1px solid var(--line); border-radius: 12px; }
.unit-done-icon svg { width: 44px; height: 44px; }
.unit-thanks { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; }
.unit-thanks svg { width: 18px; height: 18px; }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; padding: 2px; color: var(--line); cursor: pointer; }
.star svg { width: 24px; height: 24px; }
.star:hover, .star.on, .stars:hover .star { color: #ffc21a; }
.stars:hover .star:hover ~ .star { color: var(--line); }
.stars.big .star svg { width: 34px; height: 34px; }
.feedback-modal { max-width: 520px; width: 100%; text-align: left; justify-items: stretch; position: relative; }
.feedback-modal h2 { color: var(--navy); }
.feedback-modal .stars { justify-self: center; }
.modal-close { position: absolute; top: 10px; right: 10px; }
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cat { font: 700 13px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.fb-cat[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.feedback-modal textarea { min-height: 120px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font: 800 11.5px/20px var(--font); text-align: center; border: 0; }
button.count { cursor: pointer; }
.segmented button .count { margin-left: 4px; }
.fb-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 2px; }
.fb-row p { margin-top: 6px; white-space: pre-wrap; }
.fb-row.done { opacity: 0.6; }
.fb-row .tools { opacity: 1; gap: 6px; align-items: center; }
.mini-stars { color: #ffc21a; letter-spacing: 1px; font-size: 14px; }
.mini-stars span { color: var(--line); }
@media (max-width: 760px) {
  .unit-done { grid-template-columns: 1fr; justify-items: start; }
  .banner-actions { align-items: flex-start; }
  .fb-row { grid-template-columns: auto 1fr; }
  .fb-row .tools { grid-column: 2; }
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 3px rgb(30 40 80 / 0.12); }

/* ================================================================ Labas: vocabulary */

/* Levels and word tags */
.level-chip { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 6px; background: var(--navy); color: var(--surface); font: 800 12.5px var(--font); letter-spacing: 0.04em; vertical-align: middle; }
.level-head { display: flex; align-items: center; gap: 14px; padding: 6px 4px 0; }
.level-head .level-chip { min-width: 48px; height: 36px; font-size: 16px; border-radius: 10px; }
.level-head h2 { font-size: 20px; color: var(--navy); }
.level-head p { margin: 0; }
.learn-main { display: grid; gap: 26px; }
.wtag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; white-space: nowrap; vertical-align: middle; letter-spacing: 0; }

/* The prompt in an exercise */
.prompt-card { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 22px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.prompt-word { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.25; overflow-wrap: anywhere; }

/* Typing in Lithuanian */
input[type="text"].type-box { font-size: 22px; padding: 14px 18px; border-width: 2px; border-radius: 12px; background: var(--surface-2); }
input[type="text"].type-box:read-only { opacity: 0.85; }
.lt-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.lt-key { min-width: 42px; height: 42px; padding: 0 10px; font: 700 18px var(--font); color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.lt-key:hover { background: var(--surface-2); }
.lt-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

/* Building a phrase from tiles */
.build-answer { min-height: 66px; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px; padding: 10px 2px 14px; border-bottom: 2px solid var(--line); }
.build-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding-top: 6px; }
.word-tile { padding: 9px 15px; font: 600 17px var(--font); color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.word-tile:hover { background: var(--surface-2); }
.word-tile.used { visibility: hidden; }

/* Feedback footer: "knyga = book" and the word's note */
.feedback > div { display: grid; gap: 3px; min-width: 0; }
.feedback b span { font-size: inherit; }
.feedback .pair b { display: inline; font-size: inherit; }
.feedback .pair { font-size: 15px; }
.feedback .note { font-size: 13.5px; opacity: 0.85; }

/* Duel questions */
.duel-sheet { gap: 18px; }
.duel-q { display: grid; gap: 16px; }
.duel-q .q { font-size: 22px; }
.qdots { display: flex; flex-wrap: wrap; gap: 6px; }
.qdot { width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--muted); font: 700 13px var(--font); cursor: pointer; }
.qdot.done { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.qdot.at { border-color: var(--navy); color: var(--navy); }

/* Picking decks for a duel */
.deck-picker { display: grid; gap: 16px; }
.deck-group { display: grid; gap: 10px; }
.deck-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.deck-chip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--surface); font-weight: 700; font-size: 14px; line-height: 1.35; }
.deck-chip:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.deck-chip input { margin-top: 2px; accent-color: var(--green); }
.deck-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }

/* Review card on the Learn page */
.review-count { display: flex; align-items: center; gap: 12px; }
.review-count b { font-size: 26px; color: var(--navy); }
.review-icon svg { width: 46px; height: 46px; display: block; }

/* Your words */
.words-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
.words-filter input { flex: 1; min-width: 200px; width: auto; }
.words-units { display: grid; gap: 16px; }
.words-unit { padding: 6px 0 4px; }
.words-unit .list-head { padding: 12px 20px; }
.words-unit .list-head h3 { display: flex; align-items: center; gap: 8px; }
.word-list { list-style: none; margin: 0; padding: 0; }
.word-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto 92px; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); }
.word-list .w-lt { font-weight: 800; }
.word-list .w-en small { display: block; color: var(--muted); font-size: 12.5px; }
.word-list li.new .w-lt { color: var(--muted); }
.word-list .pill { justify-self: end; }
.pill.due { background: #fff3df; border-color: #f7c675; color: #a96500; }
.pill.ok { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }

/* Landing page bits */
.examples .lt { font-weight: 700; color: var(--navy); }
.examples .en { color: var(--muted); }
.demo-word { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin: 0; }
.feature-icon.fi-cards { background: var(--green-soft); }

/* Content editor */
.badge.noun { background: #eaf0ff; color: #3a55b4; }
.badge.verb { background: var(--green-soft); color: var(--green-ink); }
.badge.phrase { background: #fff1e0; color: #a96500; }
.badge.other { background: var(--surface-2); color: var(--muted); }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
select { font: 15px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.due { background: #3a2a10; border-color: #6b4a14; color: #ffc46b; }
  :root:not([data-theme="light"]) .badge.noun { background: #1e2740; color: #a9b9f0; }
  :root:not([data-theme="light"]) .badge.phrase { background: #3a2a10; color: #ffc46b; }
}
:root[data-theme="dark"] .pill.due { background: #3a2a10; border-color: #6b4a14; color: #ffc46b; }
:root[data-theme="dark"] .badge.noun { background: #1e2740; color: #a9b9f0; }
:root[data-theme="dark"] .badge.phrase { background: #3a2a10; color: #ffc46b; }

@media (max-width: 600px) {
  .prompt-word { font-size: 23px; }
  .prompt-card { padding: 14px 16px; }
  .word-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 16px; }
  .word-list .w-en { grid-column: 1; }
  .word-list .wtag { display: none; }
  .word-list .pill { grid-row: 1 / span 2; grid-column: 2; }
  .form-two { grid-template-columns: 1fr; }
  .lt-key { min-width: 38px; height: 38px; font-size: 17px; }
  .word-tile { font-size: 16px; padding: 8px 12px; }
}

/* Duel answer key: words, not code */
.answer .found { font: 700 15px var(--font); background: none; border: 0; padding: 0; letter-spacing: 0; color: var(--text); }

/* ================================================================ Courses, profiles, follows */

.course-flag { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 800 16px var(--font); letter-spacing: 0.04em; color: #fff; background: linear-gradient(135deg, #4be3ad, #1fbf86); }
.course-flag.big { width: 72px; height: 72px; border-radius: 18px; font-size: 24px; }
.official { display: inline-flex; vertical-align: -3px; margin-left: 4px; }
.official svg { width: 17px; height: 17px; }
.user-link { color: inherit; font-weight: 700; }
.user-link:hover { color: var(--green-ink); }
a.who { color: inherit; text-decoration: none; }
.mini-board a.name, .board a.name { color: inherit; }

/* "You're learning" bar on the Learn page */
.course-bar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.course-bar-text { flex: 1; min-width: 180px; display: grid; }
.course-bar-text h2 { font-size: 19px; }
.course-bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: grid; }

/* Course cards */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.course-grid > .picker { grid-column: 1 / -1; }
.course-card { padding: 18px 20px; display: grid; gap: 12px; }
.course-main { display: flex; gap: 14px; align-items: center; color: inherit; }
.course-main:hover { text-decoration: none; }
.course-main:hover h3 { color: var(--green-ink); }
.course-main h3 { font-size: 17px; }
.course-desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* A course's page */
.course-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.course-page-main { display: grid; gap: 20px; }
.course-hero { display: flex; gap: 20px; padding: 24px; align-items: flex-start; }
.course-hero h1 { font-size: 28px; }
.course-hero p { margin: 6px 0 0; }
.deck-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.deck-row p { margin: 2px 0 0; }
.profile-mini { display: grid; gap: 10px; }
.profile-mini-head { display: flex; gap: 10px; align-items: center; color: inherit; }
.profile-mini-head:hover { text-decoration: none; }

/* Profiles */
.profile { display: grid; gap: 20px; }
.profile-head { display: flex; gap: 22px; align-items: center; padding: 26px; flex-wrap: wrap; }
.profile-text { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.profile-text h1 { font-size: 26px; }
.profile-text p { margin: 0; }
.profile-text .row { gap: 18px; margin-top: 6px; }
.avatar.big { width: 84px; height: 84px; font-size: 32px; }
.profile-edit, .new-course { padding: 20px 22px; }
.section-row h2 { font-size: 20px; }
.user-list { max-width: 460px; width: 100%; }
.user-list .people { max-height: 60vh; overflow: auto; }

/* Studio */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.settings-grid > .form { padding: 22px; }
.danger-zone h3 { color: var(--red); }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.admin-course { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.admin-course.is-hidden { opacity: 0.75; }

@media (max-width: 860px) {
  .course-page, .settings-grid { grid-template-columns: 1fr; }
  .course-hero { flex-direction: column; }
  .admin-course { grid-template-columns: auto minmax(0, 1fr); }
  .admin-course .tools { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .course-grid { grid-template-columns: 1fr; }
  .profile-head { padding: 20px; }
}
