/* Wortschatz — learn German (A1 → B1). Warm paper textbook look, flag accents. */

:root {
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #f0e9db;
  --ink: #241f19;
  --muted: #71675b;
  --line: #e2d8c6;
  --accent: #b5862a;          /* flag gold, warmed down */
  --accent-ink: #7c5c17;
  --accent-soft: #f6ecd4;
  --danger: #b23f38;
  --green: #48793c;
  --g-m: #2f6cb3;             /* der - blue */
  --g-f: #c0392b;             /* die - red */
  --g-n: #2e7d52;             /* das - green */
  --tier1: #48793c;           /* A1 */
  --tier2: #a66a1c;           /* A2 */
  --tier3: #6d4fa1;           /* B1 */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.05), 0 8px 24px -18px rgba(40, 30, 10, 0.25);
}
[data-theme="dark"] {
  --bg: #171310;
  --surface: #211c17;
  --surface-2: #2b241e;
  --ink: #f0e8db;
  --muted: #a2937f;
  --line: #372f26;
  --accent: #e4b34a;
  --accent-ink: #e4b34a;
  --accent-soft: #33291b;
  --danger: #d0685f;
  --green: #85b168;
  --g-m: #6d9bd6;
  --g-f: #e07a70;
  --g-n: #7fbb98;
  --tier1: #85b168;
  --tier2: #cf9a4e;
  --tier3: #a98ad6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -18px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 26px; }
h3 { font-size: 17px; letter-spacing: 0.2px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-flag { display: inline-flex; flex-direction: column; border-radius: 5px; overflow: hidden; border: 1px solid rgba(0,0,0,0.25); box-shadow: var(--shadow); }
.brand-flag span { display: block; width: 22px; height: 7px; }
.brand-flag span:nth-child(1) { background: #26211b; }
.brand-flag span:nth-child(2) { background: #d12731; }
.brand-flag span:nth-child(3) { background: #f2c14e; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: Georgia, serif; font-size: 18px; }
.brand-text small { color: var(--muted); font-size: 11.5px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.nav-btn:hover { color: var(--ink); background: var(--surface-2); }
.nav-btn.active { color: var(--accent-ink); background: var(--accent-soft); }
[data-theme="dark"] .nav-btn.active { color: var(--accent); }
.top-stats { display: flex; gap: 6px; align-items: center; order: 3; width: 100%; }
.stat-chip {
  font-size: 12.5px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.stat-chip strong { color: var(--ink); }

/* ---------- generic ---------- */
.tab-head { margin: 26px 2px 16px; }
.tab-head p { color: var(--muted); margin: 2px 0 0; font-size: 14.5px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.btn {
  font: inherit; font-weight: 650; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #241a05; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13.5px; border-radius: 9px; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.icon-btn {
  border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer;
  border-radius: 999px; width: 32px; height: 32px; line-height: 1; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--ink); filter: brightness(0.97); }
select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.select-label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="search"] {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, .flash:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar.thin { height: 6px; margin: 6px 0 0; }
.bar-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--accent); transition: width 0.35s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip {
  font: inherit; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 12px;
}
.chip:hover { color: var(--ink); }
.chip .count { opacity: 0.55; font-size: 12px; font-weight: 500; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
[data-theme="dark"] .chip.active { color: var(--accent); }

/* ---------- level badges ---------- */
.lv-badge {
  font: 700 10.5px/1 system-ui, sans-serif; letter-spacing: 1px;
  border-radius: 6px; padding: 3px 7px; vertical-align: 2px; color: #fff;
}
.lv-1 { background: var(--tier1); }
.lv-2 { background: var(--tier2); }
.lv-3 { background: var(--tier3); }

/* ---------- gender colors ---------- */
.g-m { color: var(--g-m); } .g-f { color: var(--g-f); } .g-n { color: var(--g-n); }

/* ---------- pronunciation respellings ---------- */.pr {
  color: var(--accent-ink);
  font-family: "Gill Sans", "Avenir Next", system-ui, sans-serif;
  font-size: 13px; letter-spacing: 0.6px;
}
[data-theme="dark"] .pr { color: var(--accent); }
.vrow .de { display: flex; flex-direction: column; gap: 1px; min-width: 34%; }
.vrow .pr { font-size: 11.5px; letter-spacing: 0.4px; }
.bubble .pr { font-size: 12.5px; }
.qcard .pr { margin: 2px auto 0; }
.pr-in:disabled { cursor: default; }
.say-legend {
  background: var(--surface-2); border-radius: 12px; padding: 8px 14px;
  font-size: 13.5px; color: var(--muted); margin: 0 0 12px; border: 1px dashed var(--line);
}
.say-legend summary { cursor: pointer; font-weight: 700; }
.say-legend[open] { padding-bottom: 14px; }
.say-legend p { margin: 10px 0 0; }
.say-legend kbd {
  font: 700 11px/1 system-ui, sans-serif; background: var(--surface);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}

/* ---------- account sync card ---------- */
.acct-area { font-size: 14px; }
.acct-form {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px;
  align-items: center; margin: 10px 0;
}
.acct-form input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: inherit; font: inherit; min-width: 0;
}
.acct-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.acct-choose { display: grid; gap: 8px; margin-top: 10px; }
.acct-choose .btn { text-align: left; }
.acct-err { color: #c0392b; }
.acct-ok { color: var(--green); }
.acct-badge {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: 1px;
}
.acct-badge.ok { background: var(--green); }
.acct-badge.warn { background: #d9a62e; }
@media (max-width: 640px) {
  .acct-form { grid-template-columns: 1fr; }
}

/* ---------- path map ---------- */
.path-map { display: flex; flex-direction: column; align-items: center; padding: 6px 0 10px; }
.path-door {
  text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase; padding: 14px 0 6px;
}
.path-door.dim { opacity: 0.4; }
.u-links { display: flex; flex-direction: column; align-items: center; width: 100%; }
.u-item { display: flex; flex-direction: column; align-items: center; width: 100%; }
.u-link { width: 3px; height: 26px; border-left: 3px dotted var(--line); }
.u-link.locked { opacity: 0.5; }
.u-node {
  width: 74px; height: 74px; border-radius: 999px; font-size: 34px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); position: relative;
  box-shadow: var(--shadow); transition: transform 0.1s ease; user-select: none;
}
.u-node:hover { transform: scale(1.05); }
.u-node.locked { filter: grayscale(0.6); opacity: 0.45; cursor: not-allowed; }
.u-node.current { border-color: var(--accent); border-width: 3px; }
.u-node.current::after {
  content: 'START'; position: absolute; top: -24px; left: 50%; margin-left: -17px;
  font: 800 10.5px/1 system-ui, sans-serif; letter-spacing: 2px; color: var(--accent-ink);
  animation: pulse 1.6s ease infinite;
}
[data-theme="dark"] .u-node.current::after { color: var(--accent); }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.75; } }
.u-node.done { background: var(--accent-soft); border-color: var(--green); }
.u-crown {
  position: absolute; top: -10px; right: -10px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.u-label { margin: 10px 0 0; font-size: 14.5px; font-weight: 700; }
.u-sublabel { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.u-meta { font-size: 12px; color: var(--muted); }
.u-meta .done-tick { color: var(--green); font-weight: 800; }

/* ---------- unit intro + stage list ---------- */
.stage-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.stage-head .u-emo { font-size: 34px; }
.stage-head .btn { margin-left: auto; }
.stage-row {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: var(--surface);
}
.stage-row.locked { opacity: 0.55; }
.stage-ic { font-size: 26px; }
.stage-info { flex: 1; min-width: 0; }
.stage-info strong { display: block; }
.stage-info span { font-size: 13px; color: var(--muted); }
.stage-share a { font-size: 12.5px; color: var(--accent-ink); }
[data-theme="dark"] .stage-share a { color: var(--accent); }
.done-tick { color: var(--green); font-weight: 800; }

/* ---------- flashcards (inside stages) ---------- */
.flash-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; }
.flash-meta-btns { display: flex; gap: 6px; }
.flash-stage { perspective: 1400px; margin-top: 14px; }
.flash { cursor: pointer; }
.flash-inner {
  position: relative; width: 100%; min-height: 280px;
  transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 26px; text-align: center; box-shadow: var(--shadow);
}
.flash-front { background: var(--surface); }
.flash-back { background: var(--accent-soft); transform: rotateY(180deg); }
.face-head {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px;
}
.face-head .say { position: absolute; right: 0; }
.face-head .say-slow { right: 38px; }
.face-tag {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.gender-chip {
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px;
  border: 1px dashed currentColor;
}
.gender-chip.m { color: var(--g-m); } .gender-chip.f { color: var(--g-f); } .gender-chip.n { color: var(--g-n); }
.word {
  font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 6vw, 44px); line-height: 1.2;
  max-width: 100%; overflow-wrap: break-word;
}
.word-secondary { font-size: 15px; color: var(--muted); font-family: system-ui, sans-serif; max-width: 46ch; }
.face-hint { position: absolute; bottom: 14px; font-size: 11.5px; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; }
.flash-actions { display: flex; gap: 10px; justify-content: center; margin: 18px 0 8px; flex-wrap: wrap; }
.flash-actions .btn { min-width: 92px; }
.slow-hint { font-size: 11.5px; color: var(--muted); }

/* ---------- shared stage / quiz bits ---------- */
.stage-prompt { margin: 12px 0 2px; }
.q-side { display: flex; justify-content: center; }
.q-prompt { margin: 6px 0 4px; }
.qcard { position: relative; margin-top: 10px; text-align: center; padding: 22px 18px 18px; }
.qcard .say { position: absolute; right: 12px; top: 12px; }
.qcard .say-slow { position: absolute; right: 50px; top: 12px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.q-options.one { grid-template-columns: 1fr; }
.opt {
  font: inherit; text-align: center; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 12px; color: var(--ink);
}
.opt:hover { border-color: var(--muted); }
.opt.correct { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.opt:disabled { cursor: default; opacity: 0.85; }
.opt .say { margin-left: 8px; width: 26px; height: 26px; font-size: 12px; }
.q-type { display: flex; gap: 10px; margin-top: 14px; }
.q-input-wrap { position: relative; flex: 1; }
#qInput { padding-right: 40px; }
.umlaut-bar { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.umlaut-bar button {
  font: inherit; width: 34px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
}
.umlaut-bar button:hover { background: var(--surface-2); }
.umlaut-bar .hint-btn { width: auto; padding: 5px 10px; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.q-feedback { min-height: 24px; margin: 6px 0 0; font-weight: 650; }
.q-feedback.ok { color: var(--green); }
.q-feedback.no { color: var(--danger); }
.q-next { margin: 14px 0 30px; }
.quiz-meta { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.quiz-meta .btn { margin-left: auto; }
.quiz-final-score { font-size: 30px; font-family: Georgia, serif; font-weight: 700; margin: 4px 0 10px; }
.review-list { list-style: none; padding: 0; margin: 0 0 14px; }
.review-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-top: 1px dashed var(--line); font-size: 15px;
}
.review-list .de { font-weight: 650; }
.review-list .en { color: var(--muted); }
.review-list .say { width: 26px; height: 26px; font-size: 12px; }

/* ---------- conversations ---------- */
.dlg-grid { display: grid; gap: 10px; margin-top: 6px; }
.dlg-card {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.dlg-card.locked { opacity: 0.55; }
.dlg-card .ic { font-size: 28px; }
.dlg-info { flex: 1; min-width: 0; }
.dlg-info strong { display: block; font-size: 15.5px; }
.dlg-info span { font-size: 13px; color: var(--muted); display: block; }
.dlg-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dlg-best { font-size: 12px; color: var(--green); font-weight: 700; }

/* chat script */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 16px; position: relative;
  border: 1px solid var(--line); background: var(--surface);
}
.bubble.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.you { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent-soft); }
.bubble .line-de { font-size: 15.5px; font-weight: 600; }
.bubble .line-en { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bubble .say { position: absolute; right: 6px; bottom: -13px; width: 26px; height: 26px; font-size: 12px; background: var(--surface); box-shadow: var(--shadow); }
.bubble .say-slow { position: absolute; right: -24px; bottom: -13px; width: 26px; height: 26px; font-size: 12px; background: var(--surface); box-shadow: var(--shadow); }
.chat-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.dlg-setting { font-size: 14px; color: var(--muted); font-style: italic; }

/* pick-the-reply */
.drill-partner { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 12px 0 6px; }
.drill-q { font-weight: 800; margin: 12px 0 8px; }
.reply-opts { display: flex; flex-direction: column; gap: 8px; }
.reply-opt {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 11px 14px; color: var(--ink);
}
.reply-opt:hover { border-color: var(--muted); }
.reply-opt .en { display: block; font-size: 12px; color: var(--muted); }
.reply-opt.correct { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.reply-opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.reply-opt:disabled { cursor: default; opacity: 0.92; }
.drill-why {
  margin-top: 10px; font-size: 13.5px; background: var(--surface-2);
  border-radius: 10px; padding: 9px 12px; color: var(--muted);
}

/* ---------- vocab list ---------- */
.vocab-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.vocab-controls input { max-width: 420px; }
#vocabCount { margin-left: auto; white-space: nowrap; }
.vgroup { margin: 18px 0 26px; }
.vgroup h3 { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.vgroup h3 .count { font-family: system-ui, sans-serif; font-size: 12px; font-weight: 500; color: var(--muted); }
.vgroup ul { list-style: none; margin: 0; padding: 0; }
.vrow {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.vrow .de { font-weight: 650; font-size: 16px; min-width: 30%; }
.vrow .en { color: var(--muted); flex: 1; }
.vrow .lv-badge { min-width: 26px; text-align: center; }
.vrow .say { width: 28px; height: 28px; font-size: 13px; }
.vrow .say-slow { width: 28px; height: 28px; font-size: 13px; }
.vrow .star.is-known { color: var(--accent); }

/* ---------- grammar ---------- */
.grammar-grid { display: grid; gap: 14px; }
.grammar p { font-size: 14.5px; }
.gtable { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 8px 0; }
.gtable th, .gtable td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.gtable th { font-weight: 800; }
.gtable tr:last-child th, .gtable tr:last-child td { border-bottom: 0; }
.g-m-h { color: var(--g-m); } .g-f-h { color: var(--g-f); } .g-n-h { color: var(--g-n); }
.glist { padding-left: 18px; margin: 8px 0; }
.glist li { margin: 8px 0; font-size: 14.5px; }
.tip {
  background: var(--accent-soft); border-radius: 10px; padding: 9px 12px;
  font-size: 14px;
}
.center-table td, .center-table th { text-align: center; }
.center-table td:first-child, .center-table th:first-child { text-align: left; }
.excell { font-weight: 650; }
.inline-say {
  font: inherit; border: 0; background: none; cursor: pointer; padding: 0 2px;
  color: inherit; opacity: 0.75; font-size: 0.9em;
}
.inline-say:hover { opacity: 1; }
@media (min-width: 900px) { .grammar-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- progress ---------- */
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.prog-grid .card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 26px; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-track { stroke: var(--surface-2); }
.ring-value { stroke: var(--accent); stroke-dasharray: 0 327; transition: stroke-dasharray 0.7s ease; }
.prog-big { font-family: Georgia, serif; font-size: 40px; font-weight: 700; }
.prog-big small { font-size: 16px; color: var(--muted); font-family: system-ui, sans-serif; font-weight: 500; display: block; }
.catbars { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.catbar-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 3px; }
.catbar-row .count { color: var(--muted); }
.catbar .bar { height: 7px; }
.prog-nums { display: flex; justify-content: space-around; margin: 14px 0 6px; text-align: center; }
.prog-nums div { display: flex; flex-direction: column; gap: 2px; }
.prog-nums strong { font-size: 26px; font-family: Georgia, serif; }
.best-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.best-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.best-table td:last-child { text-align: right; font-weight: 700; color: var(--accent-ink); }
[data-theme="dark"] .best-table td:last-child { color: var(--accent); }
.best-table tr:last-child td { border-bottom: 0; }
.best-empty { color: var(--muted); font-size: 14px; }

/* ---------- stage completion ---------- */
.stage-done { text-align: center; padding: 30px 20px; }
.stage-done .big { font-size: 44px; }
.stage-done .xprow { font-weight: 800; color: var(--accent-ink); }
[data-theme="dark"] .stage-done .xprow { color: var(--accent); }
.stage-done .done-row { display: flex; justify-content: center; gap: 26px; margin: 12px 0 16px; font-size: 14px; }
.stage-done .done-row strong { font-family: Georgia, serif; font-size: 22px; display: block; }
.stage-done .done-label-done { color: var(--green); }
.stage-done .done-label-again { color: var(--danger); }

/* ---------- footer ---------- */
.footer { margin: 40px auto 30px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 700px) {
  .prog-grid { grid-template-columns: 1fr; }
  .prog-grid .card:first-child { grid-template-columns: 1fr; text-align: center; }
  .ring { margin: 0 auto; }
}
@media (max-width: 480px) {
  .q-options { grid-template-columns: 1fr; }
  .flash-actions .btn { flex: 1; }
  .prog-nums { flex-direction: column; gap: 14px; }
  .bubble { max-width: 94%; }
  .bubble .say-slow { right: 6px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-inner { transition: none; }
  .bar-fill, .ring-value { transition: none; }
  .u-node.current::after { animation: none; }
}
