/* ===== Duolingo-artiges Theme: bunt, rund, drückbare Buttons, Fortschritt überall ===== */
@import url("/static/vendor/fonts/nunito.css");

:root {
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --r: 18px; --r-sm: 14px; --r-xs: 10px;
  --green: #58cc02; --green-d: #46a302; --blue: #1cb0f6; --blue-d: #1899d6; --yellow: #ffc800; --yellow-d: #e5b400;
  --red: #ff4b4b; --red-d: #ea2b2b; --purple: #ce82ff; --purple-d: #a560e8; --orange: #ff9600; --orange-d: #e08600;
  --accent: var(--blue); --accent-soft: #ddf4ff;
  --ok: var(--green); --ok-soft: #d7ffb8; --warn: var(--orange); --warn-soft: #ffe6c0; --bad: var(--red); --bad-soft: #ffdfe0;
  --c1: var(--blue); --c2: var(--orange); --c3: var(--green); --c4: var(--red); --c5: var(--purple);
  --nav-h: 66px;
}
:root, :root[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f7f7f7; --surface-3: #e5e5e5;
  --border: #e5e5e5; --border-2: #d6d6d6;
  --text: #3c3c3c; --text-2: #4b4b4b; --text-muted: #777777;
  --primary: var(--green); --primary-d: var(--green-d); --primary-text: #ffffff;
  --shadow: none; --shadow-lg: 0 18px 40px -18px rgba(0,0,0,.25);
}
:root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg: #131f24; --surface: #1b2a30; --surface-2: #203239; --surface-3: #2a3d45;
  --border: #37464f; --border-2: #4a5c66;
  --text: #f1f7fb; --text-2: #dce6ec; --text-muted: #96a7b1;
  --primary: var(--green); --primary-d: var(--green-d); --primary-text: #ffffff;
  --accent-soft: rgba(28,176,246,.18); --ok-soft: rgba(88,204,2,.2); --warn-soft: rgba(255,150,0,.2); --bad-soft: rgba(255,75,75,.2);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f7f7f7; --surface-3: #e5e5e5;
  --border: #e5e5e5; --border-2: #d6d6d6;
  --text: #3c3c3c; --text-2: #4b4b4b; --text-muted: #777777;
  --accent-soft: #ddf4ff; --ok-soft: #d7ffb8; --warn-soft: #ffe6c0; --bad-soft: #ffdfe0;
} }

body { font-weight: 600; }
h1, h2, h3 { font-weight: 800; letter-spacing: 0; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; }
.muted { font-weight: 600; }
mark { background: #fff3a8; border-radius: 6px; }

/* Karten: 2px-Rand, runde Ecken */
.card { border: 2px solid var(--border); border-radius: var(--r); box-shadow: none; }
.list-item { border-color: var(--border); }

/* Drückbare Buttons */
.btn { border-radius: 16px; border: 2px solid var(--border-2); border-bottom-width: 4px; font-weight: 800; letter-spacing: .02em; text-transform: none; padding: 11px 18px; background: var(--surface); transition: transform .08s, border-color .15s, background .15s; }
.btn:hover { background: var(--surface-2); transform: none; }
.btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.btn.primary, .btn.accent, .btn.ok { color: #fff; border-color: transparent; }
.btn.primary { background: var(--green); box-shadow: 0 4px 0 var(--green-d); border-bottom-width: 2px; border-top-width: 2px; }
.btn.accent { background: var(--blue); box-shadow: 0 4px 0 var(--blue-d); border-bottom-width: 2px; }
.btn.ok { background: var(--green); box-shadow: 0 4px 0 var(--green-d); border-bottom-width: 2px; }
.btn.primary:hover, .btn.accent:hover, .btn.ok:hover { filter: brightness(1.05); opacity: 1; }
.btn.primary:active:not(:disabled), .btn.accent:active:not(:disabled), .btn.ok:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; border-bottom-width: 2px; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; box-shadow: none; }
.btn.ghost:active:not(:disabled) { transform: scale(.95); border-bottom-width: 2px; }
.btn.icon { border-bottom-width: 2px; }
.btn.lg { padding: 15px 22px; font-size: 1.05rem; border-radius: 18px; }
.btn.sm { padding: 7px 12px; border-bottom-width: 3px; border-radius: 12px; }
.btn.primary .kbd { display: none; }
.kbd { background: var(--surface-2); }

/* Eingaben */
.input, .select, .textarea { border: 2px solid var(--border); border-radius: 14px; background: var(--surface-2); font-weight: 600; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: none; background: var(--surface); }
.answer-row .unit { border-radius: 14px; font-weight: 800; }

/* Badges / Chips */
.badge { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .66rem; padding: 3px 9px; }
.chip { border: 2px solid var(--border); border-bottom-width: 3px; font-weight: 800; }
.chip.active { background: var(--blue); border-color: var(--blue-d); color: #fff; }
.tabs { background: var(--surface-2); border-radius: 16px; }
.tabs button { font-weight: 800; border-radius: 12px; }

/* Fortschritt: dick, mit Glanz */
.progress { height: 14px; border-radius: 10px; background: var(--surface-3); }
.progress > i { background: var(--green); position: relative; }
.progress > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.progress.ok > i { background: var(--green); }
.ring circle { stroke-width: 10; }
.ring .bar { stroke: var(--green); }
.ring .track { stroke: var(--surface-3); }

/* Navigation */
.sidebar { border-right: 2px solid var(--border); }
.nav-item { font-weight: 800; border-radius: 14px; color: var(--text-muted); }
.nav-item.active { background: var(--accent-soft); color: var(--blue); border: 2px solid #84d8ff; }
.brand .logo { background: var(--green); box-shadow: 0 3px 0 var(--green-d); }
@media (max-width: 900px) {
  .bottomnav { border-top: 2px solid var(--border); }
  .bottomnav button { font-weight: 800; font-size: .66rem; }
  .bottomnav button.active { color: var(--blue); }
  .bottomnav button::after { display: none; }
  .bottomnav button.active .ico { transform: scale(1.15); }
  .bottomnav .ico { width: 26px; height: 26px; }
  .bottomnav button.active .ico { background: var(--accent-soft); border-radius: 10px; padding: 3px; width: 32px; height: 32px; border: 2px solid #84d8ff; }
}

/* Startseite */
.home-top h1 { font-size: 1.5rem; }
.home-streak { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 16px; color: var(--orange); font-weight: 800; }
.home-cta { background: var(--green); color: #fff; border-radius: 22px; box-shadow: 0 6px 0 var(--green-d); transition: transform .08s; }
.home-cta:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--green-d); }
.home-cta .ring .track { stroke: rgba(255,255,255,.25); } .home-cta .ring .bar { stroke: #fff; }
.home-cta .ring .label { color: #fff; } .home-cta .ring .label small { color: #fff; opacity: .85; }
.home-cta .s { opacity: .9; font-weight: 600; }
.home-cta .go { background: rgba(255,255,255,.2); padding: 6px 12px; border-radius: 12px; }
.home-cta.done { background: var(--yellow); color: #4b3a00; box-shadow: 0 6px 0 var(--yellow-d); }
.home-cta.done .ring .bar { stroke: #4b3a00; } .home-cta.done .ring .label, .home-cta.done .ring .label small { color: #4b3a00; }
.quick button { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 16px; font-weight: 800; }
.quick button:active { transform: translateY(2px); border-bottom-width: 2px; }
.quick .qico { background: var(--accent-soft); color: var(--blue); border-radius: 12px; width: 40px; height: 40px; }
.quick button:nth-child(2) .qico { background: var(--ok-soft); color: var(--green-d); }
.quick button:nth-child(3) .qico { background: #f0e0ff; color: var(--purple-d); }
.subject-row { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 18px; padding: 12px 14px; transition: transform .08s; }
.subject-row:active { transform: translateY(2px); border-bottom-width: 2px; }
.subject-row .nm { font-weight: 800; font-size: 1.02rem; }
.subject-row .due-pill { border-radius: 12px; font-weight: 800; background: var(--warn-soft); color: #b36b00; }
.subject-row .due-pill.zero { background: var(--surface-2); color: var(--text-muted); }
.avatar { border-radius: 14px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.prep { border: 2px solid var(--yellow); border-bottom-width: 4px; background: #fff8dc; border-radius: 18px; }
:root:not([data-theme="light"]) .prep { background: rgba(255,200,0,.12); }
.section-h h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.weekbar i { background: var(--blue); border-radius: 6px 6px 3px 3px; }
.weekbar .today i { background: var(--orange); }

/* Lernkarten */
.review-top .progress { height: 16px; }
.review-counts span { border-radius: 10px; font-weight: 800; }
.flashcard .face { border: 2px solid var(--border); border-radius: 22px; box-shadow: none; padding: 22px 20px; }
.flashcard .front { font-size: 1.25rem; font-weight: 700; line-height: 1.5; }
.flashcard .hint { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.flashcard .hint .ico { color: var(--orange); }
.cloze { border-bottom: 3px solid var(--blue); border-radius: 8px; }
.cloze-hide { background: var(--accent-soft); color: var(--blue); }
.cloze-show { background: var(--ok-soft); }
.opt { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 16px; font-weight: 700; padding: 13px 14px; transition: transform .08s, border-color .15s, background .15s; }
.opt:hover { border-color: var(--border-2); background: var(--surface-2); }
.opt:active { transform: translateY(2px); border-bottom-width: 2px; }
.opt .box { border-radius: 8px; border-width: 2px; }
.opt.selected { border-color: #84d8ff; background: var(--accent-soft); } .opt.selected .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--ok-soft); } .opt.correct .box { background: var(--green); border-color: var(--green); }
.opt.wrong { border-color: var(--red); background: var(--bad-soft); } .opt.wrong .box { background: var(--red); border-color: var(--red); }
.result { border-radius: 14px; font-weight: 800; font-size: 1.05rem; }
.result.ok { background: var(--ok-soft); color: #3f8a00; } .result.bad { background: var(--bad-soft); color: #d12b2b; }
:root:not([data-theme="light"]) .result.ok { color: #9bef5c; } :root:not([data-theme="light"]) .result.bad { color: #ff8d8d; }

/* Bewertungsleiste als farbiges Panel */
.rate { gap: 8px; padding: 12px; border-radius: 20px; background: var(--surface-2); }
.rate.is-ok { background: var(--ok-soft); } .rate.is-bad { background: var(--bad-soft); }
.rate button { border: 2px solid var(--border-2); border-bottom-width: 4px; border-radius: 14px; background: var(--surface); font-weight: 800; transition: transform .08s; }
.rate button:active { transform: translateY(2px); border-bottom-width: 2px; }
.rate .r1 { border-color: #ffb1b1; } .rate .r1 b { color: var(--red); }
.rate .r2 { border-color: #ffd9a3; } .rate .r2 b { color: var(--orange); }
.rate .r3 { border-color: #b8ec8f; } .rate .r3 b { color: var(--green-d); }
.rate .r4 { border-color: #a6e0ff; } .rate .r4 b { color: var(--blue-d); }
.rate button.suggest { box-shadow: 0 0 0 3px var(--blue); border-color: var(--blue); }
.rate-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; padding: 2px 4px 6px; }
.rate-head .ico { flex: none; }
.rate.is-ok .rate-head { color: #3f8a00; } .rate.is-bad .rate-head { color: #d12b2b; }
:root:not([data-theme="light"]) .rate.is-ok .rate-head { color: #9bef5c; } :root:not([data-theme="light"]) .rate.is-bad .rate-head { color: #ff8d8d; }
@media (max-width: 900px) {
  .rate.sticky { border-radius: 22px 22px 0 0; left: 0; right: 0; bottom: 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); border: 0; box-shadow: 0 -8px 30px rgba(0,0,0,.12); background: var(--surface); }
  .rate.sticky.is-ok { background: var(--ok-soft); } .rate.sticky.is-bad { background: var(--bad-soft); }
  .rate.sticky button { background: var(--surface); }
  .actions.sticky { left: 14px; right: 14px; }
}
.summary h2 { font-size: 1.5rem; }
.summary .stat .v { color: var(--green-d); font-size: 1.7rem; }

/* Üben */
.mode-card { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 20px; }
.mode-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.mode-card .mico { background: var(--accent-soft); color: var(--blue); border-radius: 14px; width: 48px; height: 48px; }
.mode-card:nth-child(2) .mico { background: var(--ok-soft); color: var(--green-d); }
.mode-card:nth-child(3) .mico { background: var(--warn-soft); color: var(--orange); }
.mode-card:nth-child(4) .mico { background: #f0e0ff; color: var(--purple-d); }
.mode-card:nth-child(5) .mico { background: var(--bad-soft); color: var(--red); }
.exercise .task { font-weight: 700; }
.step { border-radius: 14px; background: var(--surface-2); }
.step .n { background: var(--blue); }
.list-item.clickable .title { font-weight: 800; }

/* Themen / Erklärseiten */
.topic { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 20px; }
.topic:active { transform: translateY(2px); border-bottom-width: 2px; }
.doc { font-size: 1.05rem; font-weight: 600; line-height: 1.7; }
.doc h1 { font-size: 1.7rem; }
.doc h3 { color: var(--blue); font-size: 1.15rem; margin-top: 1.8em; padding-left: 12px; border-left: 5px solid var(--blue); border-radius: 3px; }
.doc blockquote { border: 2px solid var(--yellow); border-left-width: 6px; background: #fff8dc; border-radius: 14px; font-weight: 700; }
:root:not([data-theme="light"]) .doc blockquote { background: rgba(255,200,0,.12); }
.doc table { font-size: .95rem; } .doc th { background: var(--accent-soft); color: var(--blue-d); }
.doc th, .doc td { border: 2px solid var(--border); }
.w { border: 2px solid var(--border); border-radius: 20px; }
.w-title { font-weight: 800; color: var(--text); }
.w-step { border-radius: 14px; } .w-step-n { background: var(--blue); }
.w-chip { border-width: 2px; font-weight: 800; }
.w-chip.active { background: var(--chip); }
.w-order-item, .w-match-item { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 14px; font-weight: 700; }
.w-order-item.ok, .w-match-item.ok { border-color: var(--green); background: var(--ok-soft); }
.w-order-item.bad, .w-match-item.bad { border-color: var(--red); background: var(--bad-soft); }
.w-tip { background: #fff8dc; border: 2px solid var(--yellow); }
:root:not([data-theme="light"]) .w-tip { background: rgba(255,200,0,.12); }
.w-tip-icon { color: var(--orange); }
.w-info { border-radius: 14px; }
.w-handle { fill: var(--blue); } .w-ball { fill: var(--orange); }

/* Plan / Aufgaben / Stapel */
.event { border: 2px solid var(--border); border-left-width: 6px; border-radius: 16px; }
.task-item .cb { border-radius: 9px; border-width: 2px; }
.task-item.done .cb { background: var(--green); border-color: var(--green); }
.deck-row.active { background: var(--accent-soft); }
.material { border: 2px solid var(--border); border-bottom-width: 4px; border-radius: 16px; }
.material .mico { background: var(--accent-soft); color: var(--blue); border-radius: 12px; }

/* Login */
.login .card { border-bottom-width: 4px; }
.login .logo { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }

/* Erfolge / Statistik */
.achievement { border: 2px solid var(--border); border-radius: 16px; }
.achievement .aico { background: var(--warn-soft); color: var(--orange); border-radius: 12px; }
.achievement.locked .aico { background: var(--surface-2); color: var(--text-muted); }
.heatmap .l1 { background: #b8ec8f; } .heatmap .l2 { background: #8ad94f; } .heatmap .l3 { background: var(--green); } .heatmap .l4 { background: var(--green-d); }
.bars i { background: var(--blue); } .bars i.c { background: var(--green); }

/* Toast / XP */
.toast { border-radius: 16px; font-weight: 800; }
.xp-pop { color: var(--yellow-d); font-weight: 900; text-shadow: 0 2px 0 #fff; }
:root:not([data-theme="light"]) .xp-pop { text-shadow: none; }
.modal { border-radius: 22px; border-width: 2px; }

/* ===== Feinschliff ===== */
.ring .label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.05; font-variant-numeric: tabular-nums; font-weight: 900; }
.ring .label small { margin-top: 2px; font-weight: 700; letter-spacing: .02em; }
.home-cta { align-items: center; padding: 18px 18px 18px 16px; }
.home-cta .t { line-height: 1.2; }
.home-cta .s { line-height: 1.35; margin-top: 4px; }
.home-top { align-items: flex-start; }
.home-top h1 { line-height: 1.15; margin-bottom: 4px; }
.home-top .sub { font-variant-numeric: tabular-nums; }
.home-streak { flex: none; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v, .review-counts span, .subject-row .due-pill, .subject-row .meta, .rate button small { font-variant-numeric: tabular-nums; }
.quick button { padding: 12px 6px 11px; }
.subject-row .progress { height: 10px; }
.subject-row .meta { margin-top: 1px; }
.card-title h3 { font-size: 1.05rem; }
.flashcard .meta { align-items: flex-start; }
.flashcard .meta .badge { line-height: 1.6; }
.section-h { margin: 22px 0 10px; }
.review-top { gap: 12px; }
.review-top .progress > i { background: var(--green); }
.btn.block { display: flex; }
.summary .ring { margin: 0 auto 12px; }
.rate button small { margin-top: 1px; }

/* Kein Doppeltipp-Zoom, kein hängender Pinch-Zoom im App-Modus */
html, body { touch-action: manipulation; overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; }
.main { overflow-x: hidden; }

.quick { grid-template-columns: repeat(4, 1fr); }
.quick button { font-size: .74rem; padding: 10px 2px 9px; }
.quick button:nth-child(4) .qico { background: var(--bad-soft); color: var(--red); }
.mode-card:nth-child(6) .mico { background: var(--bad-soft); color: var(--red); }
.mode-card:nth-child(7) .mico { background: var(--warn-soft); color: var(--orange); }
.mode-card:nth-child(8) .mico { background: var(--accent-soft); color: var(--blue); }
