:root {
  --bg: #f6f4fb; --bg2: #eeeaf8; --card: #ffffff; --ink: #16132a; --muted: #6e6a86; --line: #e6e2f2;
  --a1: #7b5cff; --a2: #ff5fa2; --a3: #ffb36b; --accent: #7b5cff; --accent-ink: #fff;
  --grad: linear-gradient(120deg, var(--a1), var(--a2));
  --good: #12a36a; --good-bg: #e5f7ef; --warn: #b8690a; --warn-bg: #fff3e2;
  --bad: #d23a5a; --bad-bg: #fdebef; --mark: #ffd36b; --mid: #ffb36b; --new: #e3dff0;
  --shadow: 0 1px 2px rgba(22,19,42,.04), 0 8px 24px rgba(22,19,42,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0c18; --bg2: #171428; --card: #191629; --ink: #f4f1ff; --muted: #a29dbd; --line: #2a2640;
    --a1: #9479ff; --a2: #ff6fae; --accent: #9479ff; --accent-ink: #fff;
    --good: #3ddc97; --good-bg: #10291f; --warn: #ffbf66; --warn-bg: #2d2210;
    --bad: #ff7a93; --bad-bg: #2f1520; --mark: #8a6a12; --mid: #ffb36b; --new: #2c2843;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: 17px; line-height: 1.45; }
main { max-width: 680px; margin: 0 auto; padding: 16px 16px 56px; }
h1 { font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; margin: 0; font-weight: 800; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 10px; font-weight: 800; }
h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.box, .card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
button { font: inherit; cursor: pointer; border-radius: 14px; border: 0; color: inherit; }
button:disabled { opacity: .4; cursor: default; }
.big { background: var(--grad); color: #fff; font-weight: 800; padding: 13px 22px; width: 100%; border-radius: 999px; letter-spacing: .01em; }
.big:active { transform: scale(.98); }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 12px 18px; width: 100%; border-radius: 999px; font-weight: 600; }
.link { background: none; color: var(--accent); padding: 4px 0; font-weight: 700; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Kopf ---- */
.appbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: .85rem; font-weight: 600; }
.chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.banner { display: block; width: 100%; border-radius: 22px; aspect-ratio: 1199 / 1000; object-fit: cover; box-shadow: var(--shadow); }
.hero { margin: 18px 0 6px; }

/* ---- Statistik ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.stat span { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* ---- Wiederholen (Highlight) ---- */
.review { background: var(--grad); color: #fff; border: 0; }
.review p { margin: 4px 0 14px; opacity: .92; }
.review .big { background: #fff; color: #5b3fd6; }
.review h2 { margin: 0; font-size: 1.2rem; }

/* ---- Lektionen ---- */
.lek-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.bar { display: flex; height: 8px; background: var(--new); border-radius: 99px; overflow: hidden; }
.b-ok { background: var(--good); } .b-mid { background: var(--mid); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 8px 0 14px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.d-ok { background: var(--good); } .d-mid { background: var(--mid); } .d-new { background: var(--new); }
details.frueher summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 6px 0 12px; }

/* ---- Playlist ---- */
.tracks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .tracks { grid-template-columns: repeat(3, 1fr); } }
.track { background: none; padding: 0; text-align: left; border-radius: 18px; display: block; width: 100%; }
.track:disabled { opacity: 1; cursor: default; }
.cover { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: #fff; box-shadow: var(--shadow); }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, rgba(255,255,255,.35), transparent 45%); }
.cover .t { position: relative; z-index: 1; font-weight: 800; font-size: 1.05rem; line-height: 1.1; letter-spacing: -.02em; }
.cover .s { position: relative; z-index: 1; display: block; font-size: .7rem; font-weight: 700; opacity: .85; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.cover .pl { position: absolute; z-index: 1; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); color: #16132a; display: grid; place-items: center; font-size: .8rem; }
.track.zu .cover { filter: grayscale(1) brightness(.55); }
.track.next .cover { outline: 3px solid var(--a2); outline-offset: 2px; }
.track-note { font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* ---- Einstellungen ---- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; background: var(--bg2); border: 1px solid transparent; padding: 10px 12px; font-size: .92rem; font-weight: 600; border-radius: 999px; }
.seg button.on { background: var(--ink); color: var(--bg); }
.figuren { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .figuren { grid-template-columns: repeat(4, 1fr); } }
.figur { background: var(--bg2); border: 2px solid transparent; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 18px; }
.figur img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.figur span { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.figur.on { border-color: var(--fc); background: var(--card); }

/* ---- Buddy / Sprechblase ---- */
.mascot { display: flex; align-items: center; gap: 12px; margin: 12px 0 14px; }
.mbody { flex: 0 0 64px; width: 64px; height: 64px; }
.mbody img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid; object-fit: cover; display: block; }
.bubble { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 10px 14px; font-weight: 600; font-size: .95rem; line-height: 1.35; box-shadow: var(--shadow); }
.mascot.hop .mbody { animation: hop .5s; }
.mascot.tilt .mbody { animation: tilt .6s; }
.mascot.wiggle .mbody { animation: wiggle .5s; }
@keyframes hop { 30% { transform: translateY(-12px) rotate(-6deg); } 60% { transform: translateY(0); } 80% { transform: translateY(-4px); } }
@keyframes tilt { 30% { transform: rotate(-10deg); } 70% { transform: rotate(6deg); } }
@keyframes wiggle { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }

/* ---- Übung ---- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.topbar .muted { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin: 4px 0 2px; }
.eq span { flex: 1; max-width: 12px; border-radius: 3px; background: var(--new); transition: background .3s; transform-origin: bottom; }
.eq span.an { background: var(--grad); }
.eq span.pop { animation: eq .6s; }
@keyframes eq { 30% { transform: scaleY(1.6); } }
.eq-label { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ask { color: var(--muted); font-size: .9rem; font-weight: 600; }
.prompt { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 18px; word-break: break-word; line-height: 1.15; }
input { width: 100%; font: inherit; font-size: 1.35rem; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink); outline: none; }
input:focus { border-color: var(--accent); }
input:disabled { opacity: .7; }
.fb { margin: 14px 0 4px; border-radius: 16px; line-height: 1.5; }
.fb:empty { display: none; }
.fb.good { background: var(--good-bg); color: var(--good); padding: 12px 14px; font-weight: 800; }
.fb.warn { background: var(--warn-bg); color: var(--warn); padding: 12px 14px; }
.fb.bad { background: var(--bad-bg); color: var(--ink); padding: 12px 14px; }
.fb .row { margin: 2px 0; }
.fb .lbl { color: var(--muted); display: inline-block; min-width: 70px; font-size: .9rem; }
.fb s { color: var(--bad); }
.sol { font-size: 1.25rem; letter-spacing: .02em; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 1px; }
.hint { margin-top: 8px; font-size: .92rem; color: var(--muted); }
.pattern { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .35em; word-spacing: .6em; }
.speak { background: none; font-size: 1.1rem; padding: 0 6px; vertical-align: middle; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.erklaer { margin-top: 10px; background: var(--card); border-radius: 14px; padding: 10px 12px; font-size: .93rem; line-height: 1.45; }
.erklaer ul, .fa-tipp ul { margin: 6px 0 0; padding-left: 20px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ---- Ende ---- */
.end h1 { font-size: 1.6rem; }
.ergebnis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.ergebnis div { background: var(--bg2); border-radius: 16px; padding: 12px 6px; text-align: center; }
.ergebnis b { display: block; font-size: 1.6rem; }
.ergebnis span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.unlock { border-radius: 18px; padding: 16px; margin: 6px 0 14px; color: #fff; }
.unlock small { display: block; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .85; font-size: .72rem; }
.unlock b { font-size: 1.3rem; }
.list { padding-left: 20px; margin: 8px 0; }
.list li { margin: 4px 0; }

/* ---- Fehler-Check ---- */
.fehlerart { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.fehlerart:first-of-type { border-top: 0; padding-top: 4px; }
.fa-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 1px 10px; font-size: .8rem; font-weight: 800; }
.fa-tipp { margin: 6px 0; font-size: .93rem; line-height: 1.45; }
.fa-bsp { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; }
.fa-bsp s { color: var(--bad); }

/* ---- Login ---- */
.login h1 { margin: 22px 0 6px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login label { font-size: .85rem; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.login input { font-size: 1.15rem; }
.fehler { background: var(--bad-bg); color: var(--bad); border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }

.kap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kap-head .eyebrow { margin-bottom: 10px; }
.banner.flach { aspect-ratio: auto; height: clamp(200px, 42vw, 330px); object-position: center 78%; }
