/*! Rechenhappen 1.0.0 – Kopfrechnen in kleinen Happen. Läuft komplett im Browser, speichert nur lokal. */
/* ==== app-base.css ==== */
/* Rechenhappen – Grundlagen: Farben (Rechenheft hell, Tafel dunkel), Schrift, Bausteine */
:root {
  --paper: #F6F7FB;
  --sheet: #FFFFFF;
  --sheet-2: #EFF2F9;
  --grid: rgba(36, 70, 196, 0.075);
  --grid-strong: rgba(36, 70, 196, 0.14);
  --line: #DCE1EC;
  --line-2: #C3CADC;
  --ink: #1B2440;
  --ink-2: #48526E;
  --ink-3: #6B7490;
  --accent: #2446C4;
  --accent-press: #1A369E;
  --accent-soft: #E6EBFB;
  --on-accent: #FFFFFF;
  --red: #C62F27;
  --red-soft: #FBE7E4;
  --green: #147A4B;
  --green-soft: #DFF2E7;
  --marker: #FFE14D;
  --star: #F2B705;
  --star-line: #A67900;
  --flame: #E8680F;
  --violet: #6A42BD;
  --scrim: rgba(16, 22, 40, 0.48);
  --shadow: 0 1px 2px rgba(27, 36, 64, 0.06), 0 6px 18px rgba(27, 36, 64, 0.07);
  --radius: 16px;
  --radius-s: 11px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --tab-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #18211E;
    --sheet: #212D28;
    --sheet-2: #29372F;
    --grid: rgba(226, 238, 230, 0.045);
    --grid-strong: rgba(226, 238, 230, 0.09);
    --line: #33443C;
    --line-2: #486055;
    --ink: #EDF2EC;
    --ink-2: #BAC6BE;
    --ink-3: #93A198;
    --accent: #93B2FF;
    --accent-press: #B3C8FF;
    --accent-soft: rgba(147, 178, 255, 0.15);
    --on-accent: #0E1934;
    --red: #FF8D7E;
    --red-soft: rgba(255, 141, 126, 0.14);
    --green: #86DDA9;
    --green-soft: rgba(134, 221, 169, 0.14);
    --marker: #FFE27A;
    --star: #FFD54A;
    --star-line: #FFD54A;
    --flame: #FFA05C;
    --violet: #C6AAFF;
    --scrim: rgba(4, 8, 6, 0.62);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 22px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #18211E;
  --sheet: #212D28;
  --sheet-2: #29372F;
  --grid: rgba(226, 238, 230, 0.045);
  --grid-strong: rgba(226, 238, 230, 0.09);
  --line: #33443C;
  --line-2: #486055;
  --ink: #EDF2EC;
  --ink-2: #BAC6BE;
  --ink-3: #93A198;
  --accent: #93B2FF;
  --accent-press: #B3C8FF;
  --accent-soft: rgba(147, 178, 255, 0.15);
  --on-accent: #0E1934;
  --red: #FF8D7E;
  --red-soft: rgba(255, 141, 126, 0.14);
  --green: #86DDA9;
  --green-soft: rgba(134, 221, 169, 0.14);
  --marker: #FFE27A;
  --star: #FFD54A;
  --star-line: #FFD54A;
  --flame: #FFA05C;
  --violet: #C6AAFF;
  --scrim: rgba(4, 8, 6, 0.62);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 22px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- Grundgerüst ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
  background: var(--paper);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-text-size-adjust: 100%;
}
body {
  height: 100%;
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#app { max-width: 560px; margin: 0 auto; min-height: 100%; position: relative; }
.view { padding: 4px 16px calc(var(--tab-h) + 28px); display: flex; flex-direction: column; gap: 16px; }
.view.no-tabs { padding-bottom: 28px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Schrift ---------- */
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 18px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 650; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.mono { font-family: var(--font-mono); font-size: 0.95em; }
.num { font-variant-numeric: tabular-nums; }
.prose { color: var(--ink-2); max-width: 62ch; }
.mark { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); padding: 0 2px; color: var(--ink); }
:root[data-theme="dark"] .mark { background: none; color: var(--marker); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { background: none; color: var(--marker); } }

/* ---------- Kopfzeile & Tabs ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; min-height: 56px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.topbar .grow { flex: 1; min-width: 0; }
.wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.wordmark svg { width: 28px; height: 28px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--sheet-2); }
.icon-btn svg { width: 24px; height: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; background: var(--sheet); border: 1px solid var(--line);
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip svg { width: 18px; height: 18px; }
.chip.flame { color: var(--ink); }
.chip.flame svg { color: var(--flame); }
.chip.off svg { color: var(--ink-3); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--sheet); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-inner { max-width: 560px; margin: 0 auto; height: var(--tab-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.tab {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3);
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }

/* ---------- Knöpfe ---------- */
.btn {
  appearance: none; border: 0; border-radius: 13px; padding: 12px 18px; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-press); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-line { background: var(--sheet); color: var(--ink); border: 1px solid var(--line-2); }
.btn-plain { background: transparent; color: var(--ink-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.btn-small { min-height: 38px; padding: 8px 14px; font-size: 14.5px; border-radius: 11px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Flächen ---------- */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--sheet-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.5s ease; }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 18px; height: 18px; }
.star-on { fill: var(--star); stroke: var(--star-line); }
.star-off { fill: none; stroke: var(--line-2); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sheet-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 38px; font-weight: 650; font-size: 14.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.12); }
.empty { text-align: center; color: var(--ink-3); padding: 20px 8px; }

/* ---------- Blätter, Dialoge, Hinweise ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s ease;
}
.scrim.center { align-items: center; padding: 16px; }
.sheet {
  background: var(--sheet); width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; overflow: auto;
  border-radius: 22px 22px 0 0; padding: 6px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; gap: 14px;
}
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 6px auto 2px; flex: none; }
.dialog {
  background: var(--sheet); border-radius: 20px; padding: 22px 20px 18px; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 14px; animation: pop 0.2s ease; box-shadow: var(--shadow);
}
.toast {
  position: fixed; left: 50%; z-index: 70; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); animation: pop 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ==== app-round.css ==== */
/* Rechenhappen – Übungsrunde, Rechenwege, Ziffernblock */
:root {
  --heat-1: #DDE4F8; --heat-2: #AEBFEE; --heat-3: #6A86DE; --heat-4: #2446C4; --heat-ink: #FFFFFF;
  --margin-line: rgba(198, 47, 39, 0.28);
  --knob: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --heat-1: #2C3D45; --heat-2: #435C74; --heat-3: #6C8CC2; --heat-4: #93B2FF; --heat-ink: #0E1934;
    --margin-line: rgba(255, 141, 126, 0.22);
    --knob: #EDF2EC;
  }
}
:root[data-theme="dark"] {
  --heat-1: #2C3D45; --heat-2: #435C74; --heat-3: #6C8CC2; --heat-4: #93B2FF; --heat-ink: #0E1934;
  --margin-line: rgba(255, 141, 126, 0.22);
  --knob: #EDF2EC;
}

/* ---------- Karopapier-Karte ---------- */
.paper-card {
  position: relative;
  background-color: var(--sheet);
  background-image:
    linear-gradient(90deg, transparent calc(100% - 30px), var(--margin-line) calc(100% - 30px), var(--margin-line) calc(100% - 28.5px), transparent calc(100% - 28.5px)),
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
  background-position: 0 0, -1px -1px, -1px -1px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 40px 18px 18px;
  box-shadow: var(--shadow);
}

/* ---------- Aufgabe ---------- */
.problem {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.16em 0.26em;
  font-family: var(--font-num); font-weight: 700; line-height: 1.15; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.problem .op { color: var(--ink-3); font-weight: 600; }
.size-l { font-size: clamp(44px, 13vw, 64px); }
.size-m { font-size: clamp(36px, 10.5vw, 52px); }
.size-s { font-size: clamp(28px, 8.4vw, 40px); }
.size-xs { font-size: clamp(24px, 7vw, 32px); }
.size-step { font-size: 26px; justify-content: flex-start; }
.slot {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 0.12em;
  min-width: 1.4em; padding: 0 0.12em; color: var(--accent);
  border-bottom: 3px solid var(--accent); border-radius: 2px;
}
.slot.wait { color: var(--ink-3); border-bottom-color: var(--line-2); }
.slot.show { border-bottom-color: transparent; }
.slot.ok { color: var(--green); border-bottom-color: var(--green); }
.slot .tick { width: 0.62em; height: 0.62em; stroke-width: 3; align-self: center; }
.slot.bad { color: var(--ink-3); border-bottom-color: var(--red); }
.slot.bad s { text-decoration-color: var(--red); text-decoration-thickness: 0.09em; }
.slot .fix { color: var(--red); margin-left: 0.2em; }
.slot.help { color: var(--accent); border-bottom-style: dashed; }
.caret { display: inline-block; width: 0.08em; height: 0.9em; background: var(--accent); border-radius: 2px; animation: blink 1.05s steps(1) infinite; align-self: center; }
@keyframes blink { 50% { opacity: 0; } }
.task-label { text-align: center; margin-bottom: 10px; }
.timebar { height: 4px; border-radius: 3px; background: var(--line); margin: 16px auto 0; max-width: 240px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.timebar.over i { background: var(--ink-3); }
.feedback { text-align: center; margin-top: 12px; }
.ok-line { color: var(--green); font-weight: 650; }

/* ---------- Korrektur & Rechenweg ---------- */
.correction { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.correction-head { font-size: 16px; color: var(--red); font-weight: 600; }
.correction-head strong { color: var(--ink); font-family: var(--font-num); font-size: 18px; }
.way { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: way; }
.way li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; counter-increment: way; }
.way li::before { content: counter(way); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; align-self: start; margin-top: 2px; }
.way-q { font-family: var(--font-num); font-weight: 700; font-size: 18px; color: var(--ink); }
.way-note { font-size: 13.5px; color: var(--ink-3); }
.hint { color: var(--ink-2); }
.tip { color: var(--ink-2); background: var(--sheet-2); border-radius: 10px; padding: 8px 10px; }
.example { padding-top: 18px; padding-right: 36px; display: flex; flex-direction: column; gap: 12px; }
.example .problem { margin-bottom: 4px; }

/* ---------- Schritt für Schritt ---------- */
.main-q { opacity: 0.85; margin-bottom: 6px; }
.gsteps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gsteps li.done { display: flex; align-items: center; gap: 8px; font-family: var(--font-num); font-weight: 700; font-size: 20px; color: var(--ink-2); }
.gsteps li.done .tick { width: 20px; height: 20px; color: var(--green); stroke-width: 3; }
.gsteps li.current { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.gsteps li.current .problem { color: var(--ink); }
.shake { animation: shake 0.35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Rundenrahmen ---------- */
.screen { min-height: 100%; }
.round-screen {
  display: flex; flex-direction: column;
  height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  min-height: 460px;
}
.round-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px 6px; flex: none; }
.round-progress { flex: 1; height: 10px; border-radius: 99px; background: var(--sheet-2); overflow: hidden; border: 1px solid var(--line); }
.round-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.35s ease; }
.round-progress.blitz i { background: var(--flame); transition: none; }
.round-count { font-weight: 700; font-size: 15px; color: var(--ink-2); min-width: 42px; text-align: right; }
.combo-chip { font-size: 12.5px; font-weight: 800; color: var(--ink); background: var(--marker); border-radius: 99px; padding: 3px 9px; white-space: nowrap; animation: pop 0.2s ease; }
:root[data-theme="dark"] .combo-chip { color: #1B2440; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .combo-chip { color: #1B2440; } }
.round-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 10px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.task-card { min-height: 180px; display: flex; flex-direction: column; justify-content: center; }
.task-actions { display: flex; justify-content: center; min-height: 44px; }
.help-btn { color: var(--ink-3); }

/* ---------- Ziffernblock ---------- */
.keypad {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border-top: 1px solid var(--line);
}
.key {
  height: clamp(50px, 8.2vh, 66px); border-radius: 14px; border: 1px solid var(--line); background: var(--sheet);
  font-family: var(--font-num); font-size: 27px; font-weight: 650; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 0.06s ease, background-color 0.1s ease;
}
.key svg { width: 28px; height: 28px; }
.key.down, .key:active { transform: scale(0.96); background: var(--accent-soft); }
.key-del { background: var(--sheet-2); color: var(--ink-2); }
.key-ok { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.key-ok.down, .key-ok:active { background: var(--accent-press); }
.key[disabled] { opacity: 0.4; }
@media (min-height: 780px) { .round-body { padding-top: 20px; } }

/* ---------- Statistik ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font-ui); }
.axis-strong { fill: var(--ink-2); font-weight: 700; }
.bar-goal { fill: var(--accent); }
.bar-open { fill: var(--heat-2); }
.goal-line { stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 4 3; }
.area { fill: var(--accent); opacity: 0.1; }
.line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.end-dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; }
.crosshair { stroke: var(--ink-3); stroke-width: 1; }
.hit { cursor: pointer; outline: none; }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none; background: var(--ink); color: var(--paper);
  padding: 6px 10px; border-radius: 9px; font-size: 12.5px; display: flex; flex-direction: column; white-space: nowrap; box-shadow: var(--shadow);
}
.chart-tip strong { font-size: 14.5px; }
.select { width: 100%; min-height: 44px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--sheet); color: var(--ink); padding: 8px 12px; font-size: 15px; }
.board-scroll { overflow-x: auto; }
.board { display: grid; grid-template-columns: 30px repeat(9, minmax(27px, 1fr)); gap: 3px; min-width: 300px; }
.bh { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 22px; }
.corner { color: var(--accent); font-size: 15px; }
.cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 7px; border: 1px solid transparent; padding: 0;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.board-m .cell { font-size: 9.5px; letter-spacing: -0.02em; }
.cell.lv0 { background: transparent; border-color: var(--line); color: var(--ink-3); font-weight: 500; }
.cell.lv1 { background: var(--heat-1); }
.cell.lv2 { background: var(--heat-2); }
.cell.lv3 { background: var(--heat-3); color: var(--heat-ink); }
.cell.lv4 { background: var(--heat-4); color: var(--heat-ink); }
.cell.wrong::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 1.5px var(--sheet); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.sw.lv0 { border: 1px solid var(--line-2); }
.sw.lv1 { background: var(--heat-1); } .sw.lv2 { background: var(--heat-2); } .sw.lv3 { background: var(--heat-3); } .sw.lv4 { background: var(--heat-4); }
.sw.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.board-info { color: var(--ink-2); min-height: 1.4em; }
.table-scroll { overflow-x: auto; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lv-table th { text-align: right; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lv-table th:first-child { text-align: left; }
.lv-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.today-dot { fill: var(--accent); }
.lv-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-table .stars svg { width: 14px; height: 14px; }
.td-title { display: block; font-weight: 600; font-size: 13.5px; }

/* ==== app-screens.css ==== */
/* Rechenhappen – Start, Lernpfad, Abschluss, Erfolge, Einstellungen */
.view-wrap { min-height: 100%; }
.inline-icon { width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 14.5px; padding: 6px 2px; }
.sub-h { margin: 4px 0 8px; }
.stack-tight { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

/* ---------- Tagesziel ---------- */
.goal-card { display: flex; flex-direction: column; gap: 12px; }
.goal-count { font-family: var(--font-num); font-size: 20px; color: var(--ink-3); font-weight: 650; }
.goal-count strong { font-size: 34px; color: var(--ink); font-weight: 800; }
.goal-boxes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.goal-boxes.dense { grid-template-columns: repeat(25, 1fr); gap: 3px; }
.goal-boxes i { aspect-ratio: 1 / 1; border-radius: 4px; border: 1.5px solid var(--grid-strong); background: var(--sheet); display: block; }
.goal-boxes i.on { background: var(--accent); border-color: var(--accent); }
.goal-card.reached .goal-boxes i.on { background: var(--green); border-color: var(--green); }
.goal-stamp { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--green); color: var(--green); display: flex; align-items: center; justify-content: center; transform: rotate(-10deg); }
.goal-stamp svg { width: 30px; height: 30px; stroke-width: 3; }
.goal-line { color: var(--ink-2); }
.rank-line { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Hauptknopf ---------- */
.cta {
  border: 0; border-radius: 18px; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; min-height: 76px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.cta:hover { background: var(--accent-press); }
.cta:active { transform: scale(0.985); }
.cta-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--on-accent); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.cta-icon svg { width: 22px; height: 22px; margin-left: 3px; }
.cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cta-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.cta-sub { font-size: 13.5px; opacity: 0.88; }
.due-note { margin-top: -6px; padding-left: 4px; }

/* ---------- Stufen auf der Startseite ---------- */
.track-list { display: flex; flex-direction: column; gap: 10px; }
.track-row, .blitz-row {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 12px 12px 12px; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; text-align: left;
}
.track-row:hover, .blitz-row:hover { border-color: var(--line-2); }
.track-ex {
  min-width: 76px; padding: 12px 8px; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink);
  border-radius: 11px; background-color: var(--sheet-2);
  background-image: linear-gradient(var(--grid-strong) 1px, transparent 1px), linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 10px 10px; white-space: nowrap;
}
.track-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.track-title { font-weight: 700; font-size: 16px; line-height: 1.25; }
.track-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chev { width: 20px; height: 20px; color: var(--ink-3); }
.blitz-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--marker); color: #1B2440; display: flex; align-items: center; justify-content: center; }
.blitz-icon svg { width: 24px; height: 24px; }
.blitz-best { display: flex; flex-direction: column; align-items: flex-end; padding-right: 4px; }
.blitz-best strong { font-family: var(--font-num); font-size: 22px; line-height: 1.1; }
.install-card { display: flex; flex-direction: column; gap: 8px; }
.install-card .row svg { width: 22px; height: 22px; color: var(--accent); }

/* ---------- Lernpfad ---------- */
.path { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 8px; }
.path::before { content: ''; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 2px; background: var(--line-2); }
.path-btn {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; border: 1px solid transparent; background: transparent; text-align: left;
}
.path-btn:hover { background: var(--sheet); border-color: var(--line); }
.node {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-weight: 800; font-size: 17px; background: var(--sheet); border: 2px solid var(--accent); color: var(--accent); flex: none;
}
.node svg { width: 18px; height: 18px; }
.path-item.locked .node { border-style: dashed; border-color: var(--line-2); color: var(--ink-3); }
.path-item.current .node { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.path-item.mastered .node { background: var(--accent-soft); }
.path-item.current .path-btn { background: var(--sheet); border-color: var(--line); }
.path-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.path-title { font-weight: 700; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.path-item.locked .path-title { color: var(--ink-2); }
.path-ex { color: var(--ink-2); font-size: 14px; }
.goal-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--marker); color: #1B2440; padding: 2px 7px; border-radius: 6px; }
.level-sheet { gap: 12px; }
.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin: 0; }
.facts-row div { background: var(--sheet-2); border-radius: 11px; padding: 8px 10px; }
.facts-row dt { font-size: 12px; color: var(--ink-3); }
.facts-row dd { margin: 0; font-weight: 750; font-size: 17px; }
.lock-note { color: var(--ink-2); }

/* ---------- Abschluss ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-tile { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-value { font-family: var(--font-num); font-size: 25px; font-weight: 800; line-height: 1.15; }
.unlock-list { display: flex; flex-direction: column; gap: 8px; }
.unlock { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent); }
.unlock-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.unlock-badge svg { width: 22px; height: 22px; }
.new-badges { display: flex; flex-direction: column; gap: 10px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 14px; }
.badge-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; text-align: center; }
.lv-changes, .mistakes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lv-change { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lv-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.delta { font-size: 13px; font-weight: 800; border-radius: 6px; padding: 1px 6px; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.mistakes li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-family: var(--font-num); font-weight: 700; font-size: 17px; }
.mistakes li .tiny { font-family: var(--font-ui); font-weight: 500; }
.end-actions { margin-top: 6px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* ---------- Erfolge ---------- */
.rank-card .rank-name { font-size: 24px; }
.rank-no { font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 10px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.badge-title { font-weight: 700; font-size: 14px; line-height: 1.2; margin-top: 4px; }
.badge-card:not(.got) .badge-title { color: var(--ink-2); }
.badge-desc { line-height: 1.3; }
.badge-date { color: var(--ink-2); }
.stamp { display: inline-block; width: 76px; height: 76px; flex: none; }
.stamp svg { width: 100%; height: 100%; display: block; }
.stamp.ink-blue { color: var(--accent); }
.stamp.ink-red { color: var(--red); }
.stamp.ink-green { color: var(--green); }
.stamp.ink-violet { color: var(--violet); }
.stamp.locked { color: var(--line-2); }
.stamp:not(.locked) { opacity: 0.92; mix-blend-mode: multiply; }
:root[data-theme="dark"] .stamp:not(.locked) { mix-blend-mode: normal; opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp:not(.locked) { mix-blend-mode: normal; opacity: 1; } }

/* ---------- Einstellungen ---------- */
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.setting-text { display: flex; flex-direction: column; gap: 2px; }
.setting-label { font-weight: 650; font-size: 15px; }
.switch { width: 52px; height: 32px; border-radius: 16px; border: 0; background: var(--line-2); position: relative; flex: none; transition: background-color 0.15s ease; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(20px); }
.about { text-align: center; padding: 8px 0 4px; }
.streak-line { margin-top: -6px; }
