:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --text: #1d2422;
  --muted: #6b7471;
  --line: #e4dfd3;
  --primary: #1f6f5c;
  --primary-text: #ffffff;
  --soft: #e3f0ec;
  --warn: #c9652b;
  --warn-soft: #fbeadf;
  --ok: #2c8a57;
  --ok-soft: #e1f3e8;
  --rec: #c8372d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191a;
    --card: #1f2526;
    --text: #edf0ee;
    --muted: #9aa5a1;
    --line: #2f3839;
    --primary: #4fb79c;
    --primary-text: #0c1f1a;
    --soft: #24383a;
    --warn: #eb9460;
    --warn-soft: #3a2a20;
    --ok: #62c68d;
    --ok-soft: #1f3529;
    --rec: #ef6a5f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
.loading { color: var(--muted); text-align: center; margin-top: 40vh; }

h1 { font-size: 28px; margin: 8px 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 26px 4px 8px; font-weight: 600; }
p { margin: 0; }
.sub { color: var(--muted); }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: 0.45; cursor: default; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  font-weight: 600; flex: 1; text-align: center;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; }
.btn.soft { background: var(--soft); border-color: transparent; }
.btn.rec { background: var(--rec); color: #fff; border-color: transparent; }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.big { min-height: 60px; font-size: 18px; }
.row { display: flex; gap: 10px; }
.row + .row { margin-top: 10px; }

/* Start */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 16px; }
.stats { display: flex; gap: 8px; margin-bottom: 14px; }
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

.list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; border-top: 1px solid var(--line); min-height: 56px;
}
.item:first-child { border-top: 0; }
.item:active { background: var(--soft); }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; overflow-wrap: anywhere; }
.item .info { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.item .count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { color: var(--muted); }
.bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 2px solid var(--line); }
.dot.ueben { background: var(--warn); border-color: var(--warn); }
.dot.kann { background: var(--ok); border-color: var(--ok); }

.foot { text-align: center; margin-top: 28px; font-size: 14px; color: var(--muted); }
.link { color: var(--muted); text-decoration: underline; font-size: 14px; padding: 8px; }

/* Kopfzeile */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 8px; }
.back { color: var(--primary); font-weight: 600; padding: 10px 10px 10px 0; }
.pos { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* Übungskarte */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px; text-align: center; }
.cat { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.word { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 10px 0 8px; overflow-wrap: anywhere; hyphens: auto; letter-spacing: -0.01em; }
.word.long { font-size: 25px; }
.word.sentence { font-size: 24px; line-height: 1.3; }
.hu { color: var(--muted); font-size: 18px; }
.hint { margin-top: 14px; padding: 10px 12px; background: var(--soft); border-radius: 12px; font-size: 15px; text-align: left; }

.step { margin-top: 18px; }
.step .label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 0 4px 8px; }

.pulse { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.result { margin-top: 10px; padding: 12px 14px; border-radius: 14px; text-align: left; font-size: 16px; }
.result.good { background: var(--ok-soft); }
.result.bad { background: var(--warn-soft); }
.result.note { background: var(--soft); color: var(--muted); font-size: 15px; }
.result b { display: block; margin-bottom: 2px; }
.result .heard { overflow-wrap: anywhere; }
.w-ok { color: var(--ok); font-weight: 600; }
.w-miss { color: var(--warn); font-weight: 600; text-decoration: underline; }

.rate { margin-top: 26px; }
.done { text-align: center; padding: 40px 10px; }
.done .big-num { font-size: 56px; font-weight: 700; color: var(--ok); }
