/* VoltLearn – verspieltes Lern-App-Design (Mobile First). Gemeinsam für Website und Admin. */
/* Schrift lokal eingebunden (keine Verbindung zu Google – DSGVO) */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/nunito-latin-900-normal.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --bg-2: #f7f7f7;
  --card: #ffffff;
  --card-2: #f2f4f7;
  --line: #e5e5e5;
  --line-2: #d4d7dc;
  --text: #3c3c3c;
  --strong: #222b38;
  --muted: #8a8f98;
  --volt: #ffc800;          /* Hauptfarbe: Strom-Gelb */
  --volt-dark: #d9a300;
  --volt-ink: #3a2a00;
  --blue: #1e9bf0;
  --blue-dark: #1478c0;
  --ok: #4cc23a;
  --ok-dark: #389d28;
  --ok-bg: #e3f8d8;
  --bad: #ff5a5a;
  --bad-dark: #d63c3c;
  --bad-bg: #ffe2e2;
  --warn: #ff9f1a;
  --purple: #a463f2;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131f24; --bg-2: #18262c; --card: #131f24; --card-2: #1f3038; --line: #37464f; --line-2: #4b5c66;
    --text: #e8edf0; --strong: #ffffff; --muted: #9aa8b0;
    --ok-bg: #1d3a1a; --bad-bg: #3d1f22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131f24; --bg-2: #18262c; --card: #131f24; --card-2: #1f3038; --line: #37464f; --line-2: #4b5c66;
  --text: #e8edf0; --strong: #ffffff; --muted: #9aa8b0; --ok-bg: #1d3a1a; --bad-bg: #3d1f22; color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); font-weight: 600;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: var(--blue); text-decoration: none; font-weight: 800; }
img { max-width: 100%; display: block; border-radius: 14px; }
h1, h2, h3 { color: var(--strong); line-height: 1.2; margin: 0 0 .5rem; font-weight: 900; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

/* ───── Layout ───── */
.app { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(100px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--line); }
.topbar-inner { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.15rem; color: var(--strong); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; }
.spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 900; padding: 6px 10px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); color: var(--strong); cursor: pointer; font: inherit;
}
.pill .ico { font-size: 1.1rem; }
.pill.flame { color: var(--warn); }
.pill.flame.off { color: var(--muted); filter: grayscale(1); }
.pill.xp { color: var(--purple); }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg); border-top: 2px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar-inner { max-width: 640px; margin: 0 auto; display: flex; padding: 6px 8px; gap: 4px; }
body.wide .app, body.wide .topbar-inner, body.wide .tabbar-inner { max-width: 1100px; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  color: var(--muted); font-size: .7rem; font-weight: 900; border-radius: 14px; border: 2px solid transparent;
}
.tabbar a .ti { font-size: 1.55rem; line-height: 1; filter: grayscale(.9); opacity: .75; }
.tabbar a.active { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.tabbar a.active .ti { filter: none; opacity: 1; }

/* ───── Karten & Listen ───── */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.tap { cursor: pointer; border-bottom-width: 4px; transition: transform .08s; }
.card.tap:active { transform: translateY(2px); border-bottom-width: 2px; margin-top: 2px; }
.row { display: flex; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.stat .big { font-size: 1.6rem; }
.stat b { display: block; font-size: 1.15rem; color: var(--strong); font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; gap: 10px; }
.section-title h2 { margin: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-weight: 800; }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--card-2); border: 2px solid var(--line);
}
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 900; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-dark); }
.badge.lock { background: #fff3c4; color: #8a6400; }
.badge.bad { background: var(--bad-bg); color: var(--bad-dark); }
.badge.blue { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue-dark); }
.progress { height: 14px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .35s ease; position: relative; }
.progress > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 9px; background: rgba(255,255,255,.35); }
.progress.volt > i { background: var(--volt); }
.progress.purple > i { background: var(--purple); }

/* ───── Formulare ───── */
label { display: block; font-weight: 900; font-size: .9rem; margin: 14px 0 6px; color: var(--strong); }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 700; color: var(--text); background: var(--bg-2);
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); background: var(--card); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--ok); padding: 0; flex: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 10px 0; color: var(--text); }

/* ───── 3D-Buttons ───── */
.btn {
  --c: var(--card); --d: var(--line-2); --t: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em; font-size: .92rem;
  background: var(--c); color: var(--t); border: 2px solid var(--d); border-bottom-width: 5px;
  padding: 11px 18px; border-radius: 16px; cursor: pointer; min-height: 50px; text-align: center; user-select: none;
  transition: transform .06s, border-bottom-width .06s, filter .1s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 2px; margin-bottom: 3px; }
.btn:disabled { --c: var(--card-2); --d: var(--line); --t: var(--muted); cursor: default; }
.btn.primary { --c: var(--volt); --d: var(--volt-dark); --t: var(--volt-ink); }
.btn.green { --c: var(--ok); --d: var(--ok-dark); --t: #fff; }
.btn.blue { --c: var(--blue); --d: var(--blue-dark); --t: #fff; }
.btn.red, .btn.danger { --c: var(--bad); --d: var(--bad-dark); --t: #fff; }
.btn.ghost { --c: transparent; --d: transparent; --t: var(--blue); border-bottom-width: 2px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .78rem; border-radius: 12px; border-bottom-width: 4px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ───── Lernpfad ───── */
.pkg-switch { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.pkg-switch::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--card);
  color: var(--text); font: inherit; font-size: .88rem; font-weight: 900; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip.active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
.unit-banner { border-radius: 18px; padding: 16px 18px; color: #fff; margin: 22px 0 18px; border-bottom: 5px solid rgba(0,0,0,.18); display: flex; align-items: center; gap: 12px; }
.unit-banner h2 { color: #fff; margin: 0; font-size: 1.2rem; }
.unit-banner p { margin: 2px 0 0; opacity: .9; font-size: .88rem; }
.path { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 44px 0 10px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node {
  width: 74px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.9rem; position: relative;
  background: var(--c, var(--ok)); box-shadow: 0 7px 0 var(--d, var(--ok-dark)); color: #fff; transition: transform .06s, box-shadow .06s;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--d, var(--ok-dark)); }
.node.locked { --c: var(--card-2); --d: var(--line-2); color: var(--muted); cursor: not-allowed; }
.node.done { --c: var(--volt); --d: var(--volt-dark); }
.node.current { animation: bob 1.6s ease-in-out infinite; }
.node.current::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 6px solid color-mix(in srgb, var(--c) 35%, transparent); }
.node-crowns { position: absolute; bottom: -6px; right: -8px; background: var(--card); border: 2px solid var(--line); border-radius: 10px; font-size: .72rem; padding: 0 5px; font-weight: 900; color: var(--volt-dark); }
.tooltip {
  position: absolute; top: -48px; white-space: nowrap; background: var(--card); border: 2px solid var(--line); color: var(--ok-dark);
  font-weight: 900; padding: 6px 12px; border-radius: 12px; text-transform: uppercase; font-size: .82rem; animation: bob 1.6s ease-in-out infinite;
}
.tooltip::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%) rotate(45deg); width: 12px; height: 12px; background: var(--card); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* ───── Lektion / Quiz ───── */
.lesson-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.lesson-top .progress { flex: 1; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; color: var(--muted); cursor: pointer; padding: 4px 6px; font-weight: 900; line-height: 1; }
.q-kicker { color: var(--purple); font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.q-text { font-size: 1.28rem; font-weight: 800; color: var(--strong); white-space: pre-wrap; }
.q-img { margin: 14px 0; border: 2px solid var(--line); background: #fff; }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; font-weight: 800; color: var(--strong);
  background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 16px; padding: 14px; cursor: pointer;
}
.opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 3px; }
.opt .key { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; border: 2px solid var(--line); font-size: .85rem; color: var(--muted); }
.opt.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); color: var(--blue-dark); }
.opt.sel .key { border-color: var(--blue); color: var(--blue); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-dark); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad-dark); }
.opt img { margin-top: 8px; max-height: 160px; background: #fff; }
.answer-input { font-size: 1.2rem; text-align: center; padding: 16px; margin-top: 16px; }

.lesson-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border-top: 2px solid var(--line); background: var(--bg); padding: 16px 16px calc(16px + var(--safe-b)); transition: background .2s; }
.lesson-foot .inner { max-width: 640px; margin: 0 auto; }
.lesson-foot.ok { background: var(--ok-bg); border-color: transparent; }
.lesson-foot.bad { background: var(--bad-bg); border-color: transparent; }
.fb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; animation: up .2s ease; }
.fb-head .fb-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.fb-head h2 { margin: 0; }
.lesson-foot.ok h2 { color: var(--ok-dark); } .lesson-foot.bad h2 { color: var(--bad-dark); }
.fb-text { white-space: pre-wrap; max-height: 32dvh; overflow: auto; margin-bottom: 12px; font-weight: 700; }
.lesson-foot.ok .fb-text { color: var(--ok-dark); } .lesson-foot.bad .fb-text { color: var(--bad-dark); }
.fb-text img { margin-top: 8px; max-height: 200px; background: #fff; }
.foot-actions { display: flex; gap: 10px; align-items: center; }
.foot-actions .btn { flex: 1; }

/* Ergebnis-Bildschirm */
.result-screen { min-height: 78dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.result-screen h1 { font-size: 2rem; color: var(--volt-dark); }
.result-tiles { display: flex; gap: 10px; margin: 18px 0; width: 100%; max-width: 420px; }
.result-tile { flex: 1; border-radius: 16px; border: 2px solid var(--c); overflow: hidden; }
.result-tile .h { background: var(--c); color: #fff; font-weight: 900; font-size: .74rem; text-transform: uppercase; padding: 4px; }
.result-tile .v { padding: 12px 4px; font-size: 1.3rem; font-weight: 900; color: var(--c); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 300; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* Maskottchen */
.mascot { width: 120px; height: 120px; animation: bob 2.4s ease-in-out infinite; }
.mascot.sm { width: 64px; height: 64px; }
.speech { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; font-weight: 800; color: var(--strong); }

/* ───── Hinweise, Modal, Toast ───── */
.notice { border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; border: 2px solid var(--line); background: var(--card); font-weight: 700; }
.notice.warning { border-color: var(--warn); background: #fff4e3; color: #7a4a00; }
.notice.critical { border-color: var(--bad); background: var(--bad-bg); color: var(--bad-dark); }
.notice.info { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + var(--safe-b)); animation: up .22s ease; }
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 24px; } .modal { border-radius: 24px; } }
.modal .lvl { display: inline-block; font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.lvl.info { color: var(--blue); } .lvl.warning { color: var(--warn); } .lvl.critical { color: var(--bad); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 400; background: var(--strong); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 800; max-width: calc(100% - 32px); animation: fade .15s ease; }
.toast.err { background: var(--bad); color: #fff; }
.center-screen { min-height: 78dvh; display: grid; place-items: center; text-align: center; padding: 24px 8px; }
.auth { max-width: 420px; margin: 4vh auto 0; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--volt); border-radius: 50%; animation: spin .8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; }
.week-bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week-bars i { width: 100%; background: var(--purple); border-radius: 8px 8px 4px 4px; min-height: 4px; }
.week-bars span { font-size: .7rem; color: var(--muted); font-weight: 900; }
.goal-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--volt) calc(var(--p) * 1%), var(--card-2) 0); display: grid; place-items: center; flex: none; }
.goal-ring > span { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 1.3rem; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.lb-row.me { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.lb-rank { width: 28px; text-align: center; font-weight: 900; color: var(--muted); }
.lb-rank.top { font-size: 1.3rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; padding: 6px 12px; border-radius: 12px; background: var(--card-2); color: var(--strong); }
.timer.warn { background: var(--bad-bg); color: var(--bad-dark); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.qnav button { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); font: inherit; font-weight: 900; cursor: pointer; color: var(--text); }
.qnav button.done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-dark); }
.qnav button.cur { border-color: var(--blue); color: var(--blue); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emoji-grid button { font-size: 1.6rem; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.emoji-grid button.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--card)); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 70px; }

/* ───── Schaltplan-Aufgaben ───── */
.diagram { position: relative; margin: 14px 0 8px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.diagram img { width: 100%; border-radius: 0; }
.zone {
  position: absolute; border: 3px dashed var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border-radius: 10px;
  font: inherit; font-weight: 900; font-size: clamp(.55rem, 2.4vw, .75rem); line-height: 1.05; color: var(--blue-dark);
  display: grid; place-items: center; cursor: pointer; padding: 1px 2px; overflow: hidden; text-align: center;
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
.zone.filled { border-style: solid; background: #fff; }
.zone.right { border-color: var(--ok); color: var(--ok-dark); background: var(--ok-bg); }
.zone.wrong { border-color: var(--bad); color: var(--bad-dark); background: var(--bad-bg); }
.token-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.token.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.token.used { opacity: .35; }

/* ───── Lernkarten ───── */
.flashcard { perspective: 1200px; min-height: 52dvh; cursor: pointer; }
.fc-inner { position: relative; min-height: 52dvh; transition: transform .45s ease; transform-style: preserve-3d; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 22px; padding: 20px; overflow: auto; }
.fc-back { transform: rotateY(180deg); border-color: var(--ok); }

/* ───── Abzeichen ───── */
.badge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge-cell { min-width: 0; text-align: center; border: 2px solid var(--line); border-radius: 16px; padding: 10px 3px; background: var(--card); cursor: pointer; font: inherit; }
.badge-cell .e { font-size: 2rem; line-height: 1.2; }
.badge-cell .n { font-size: .68rem; font-weight: 900; color: var(--strong); overflow-wrap: anywhere; hyphens: auto; }
.badge-cell.locked .e { filter: grayscale(1); opacity: .35; }
.badge-cell .bar { height: 5px; background: var(--card-2); border-radius: 9px; margin: 6px 6px 0; overflow: hidden; }
.badge-cell .bar i { display: block; height: 100%; background: var(--volt); }
.countdown { display: flex; align-items: center; gap: 14px; }
.countdown .days { font-size: 2.2rem; font-weight: 900; color: var(--bad); line-height: 1; text-align: center; min-width: 64px; }
.countdown .days small { display: block; font-size: .7rem; color: var(--muted); }

/* ───── Runde 3: Kopfzeile, Fragen-Werkzeuge ───── */
.pill.coins { color: #b07a00; text-decoration: none; }
.q-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.chip.sm { padding: 6px 10px; font-size: .82rem; }
.tr-box { margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: var(--card-2, #f4f6f8); border: 2px dashed var(--line); font-weight: 700; }
.tr-box[hidden] { display: none; }
.tr-opts { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }

/* Fehlersuche */
.fault-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 12px; }
.meter-mode[hidden], .meter[hidden] { display: none !important; }
.diagram.fault { margin-top: 10px; }
.mpoint { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid var(--strong);
  background: #fff; color: #222; font: inherit; font-weight: 900; font-size: .9rem; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.25); transition: transform .1s; }
.mpoint:hover { transform: scale(1.08); }
.mpoint.probe1 { background: var(--bad); color: #fff; border-color: var(--bad-dark); }
.mpoint[hidden], .fzone[hidden] { display: none; }
.fzone { position: absolute; border: 3px dashed var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); border-radius: 10px;
  font: inherit; font-weight: 900; color: var(--purple); cursor: pointer; display: grid; place-items: start center; padding: 2px; }
.fzone span { background: rgba(255,255,255,.92); border-radius: 6px; padding: 0 5px; font-size: .78rem; }
.fzone.sel { border-style: solid; background: color-mix(in srgb, var(--purple) 26%, transparent); }
.fzone.right { border: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok-dark); }
.fzone.wrong { border: 3px solid var(--bad); background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad-dark); }
.meter { margin-top: 12px; display: flex; gap: 14px; align-items: center; background: #2b2f36; color: #fff; border-radius: 18px; padding: 12px 14px;
  box-shadow: inset 0 -4px 0 #ffc800; }
.meter-lcd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700;
  background: #b9c7a5; color: #1d2a12; border-radius: 10px; padding: 6px 12px; min-width: 132px; text-align: right; }
.meter-lcd.pulse { animation: lcd .35s ease; }
@keyframes lcd { from { filter: brightness(1.4); } to { filter: none; } }
.meter-hint { font-size: .85rem; font-weight: 700; opacity: .9; }
.mlog { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mlog span { font-size: .78rem; font-weight: 800; padding: 4px 8px; border-radius: 10px; background: var(--card-2, #f2f4f7); color: var(--text);
  font-variant-numeric: tabular-nums; }

/* Fachgespräch */
.oral-card textarea { margin-top: 10px; }
.oral-timer { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 900; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.oral-timer .over { color: var(--bad); }
.keypoints { display: grid; gap: 8px; }
.kp { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 700; margin: 0; }
.kp input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.kp:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.kp em { display: block; font-style: normal; color: var(--muted); font-size: .85rem; margin-top: 2px; }

/* Messprotokoll */
.scenario { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-2, #f4f6f8); font-weight: 800; font-size: .92rem; }
.proto { display: grid; gap: 8px; margin-top: 10px; }
.prow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "b b" "h h"; gap: 6px 10px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 14px; }
.prow .plabel { grid-area: l; font-weight: 800; color: var(--strong); min-width: 0; }
.prow .plabel small { display: block; color: var(--muted); font-weight: 700; }
.prow .pval { grid-area: v; font-weight: 900; font-size: 1.15rem; font-variant-numeric: tabular-nums; text-align: right; }
.prow .pval small { color: var(--muted); font-size: .8rem; }
.prow .pbtns { grid-area: b; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prow .phint { grid-area: h; font-size: .82rem; font-weight: 700; color: var(--muted); }
.pv { font: inherit; font-weight: 900; padding: 9px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.pv.ok.sel { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-dark); }
.pv.fail.sel { border-color: var(--bad); background: var(--bad-bg); color: var(--bad-dark); }
.prow.overall { background: color-mix(in srgb, var(--volt) 14%, var(--card)); }
.prow.right { border-color: var(--ok); }
.prow.wrong { border-color: var(--bad); background: var(--bad-bg); }

/* Trainer-Kacheln */
.trainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.trainer { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--card);
  text-decoration: none; color: var(--text); box-shadow: 0 4px 0 var(--line); transition: transform .08s; }
.trainer:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.trainer .ti { font-size: 1.9rem; }
.trainer b { color: var(--strong); }
.trainer small { color: var(--muted); font-weight: 700; }

/* Formelsammlung & Notenrechner */
.sec-h { margin: 18px 0 8px; font-size: 1.1rem; }
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.card.formula { margin: 0; }
.card.formula h3 { margin: 0 0 6px; }
.fml { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--strong);
  background: var(--card-2, #f4f6f8); border-radius: 12px; padding: 8px 12px; overflow-x: auto; }
.vars { white-space: pre-line; margin: 8px 0 0; font-weight: 700; }
.grade-table { display: grid; gap: 8px; }
.garea { display: flex; align-items: center; gap: 12px; margin: 0; }
.garea span { flex: 1; min-width: 0; }
.garea small { display: block; color: var(--muted); font-weight: 700; }
.garea input { width: 90px; text-align: center; font-size: 1.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.grade-result .big { font-size: 2.2rem; font-weight: 900; color: var(--strong); font-variant-numeric: tabular-nums; }
.grade-result .big small { font-size: .9rem; color: var(--muted); }
.grade-result.pass { border-color: var(--ok); }
.grade-result.fail { border-color: var(--bad); }
.grade-result .verdict { font-weight: 900; font-size: 1.2rem; margin-top: 8px; }

/* Liga */
.rank-nav { margin-bottom: 14px; }
.league-head { text-align: center; border-color: var(--lc); }
.league-head h2 { margin: 10px 0 2px; }
.ladder { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ladder-step { width: 42px; height: 46px; border-radius: 12px 12px 18px 18px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--card-2, #eef1f4); opacity: .45; filter: grayscale(.6); }
.ladder-step.past { opacity: .8; filter: none; }
.ladder-step.cur { opacity: 1; filter: none; background: color-mix(in srgb, var(--lc) 30%, var(--card)); outline: 3px solid var(--lc); transform: scale(1.12); }
.zone-line { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 6px 12px; }
.zone-line.up { color: var(--ok-dark); border-top: 2px dashed var(--ok); }
.zone-line.down { color: var(--bad-dark); border-top: 2px dashed var(--bad); }
.lb-row.z-up .lb-rank { color: var(--ok-dark); }
.lb-row.z-down { opacity: .78; }

/* Shop */
.coins-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.coin-big { font-size: 3rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--card); text-align: center; }
.shop-item b { color: var(--strong); }
.shop-item small { color: var(--muted); font-weight: 700; }
.shop-item.active { border-color: var(--blue); }
.shop-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; background: var(--card-2, #f2f4f7); }

/* Challenges */
.challenge { border-color: color-mix(in srgb, var(--volt) 60%, var(--line)); }
.challenge.done { border-color: var(--ok); }
.ch-emoji { font-size: 2rem; }
.bar-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-wrap .bar { flex: 1; height: 12px; border-radius: 6px; background: var(--card-2, #eef1f4); overflow: hidden; }
.bar-wrap .bar i { display: block; height: 100%; background: var(--volt); border-radius: 6px; }
.challenge.done .bar i { background: var(--ok); }

/* Freunde & Gruppen */
.friend-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.code-big { font-size: 1.5rem; font-weight: 900; color: var(--strong); letter-spacing: .04em; }
.col-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.react-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.react { font-size: 1.8rem; width: 56px; height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.react.sel, .react:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
.g-emoji { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--card-2, #f2f4f7); }
.group-head { display: flex; gap: 14px; align-items: center; }
.group-head .goal-ring span { font-size: 1.6rem; background: var(--card); border-radius: 50%; width: 50px; height: 50px; display: grid; place-items: center; }

/* Profil */
.sub-card { border-color: var(--sc); }
.sub-badge { font-size: 2rem; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--sc) 18%, var(--card)); }
.settings .seg .btn { flex: 1; }
.pick-list { max-height: 220px; overflow: auto; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.pick-list .check { margin: 6px 0; }
@media (max-width: 420px) { .meter-lcd { min-width: 110px; font-size: 1.35rem; } }

/* Kopfzeile: vier Anzeigen passen auch auf schmale Handys */
.pill { white-space: nowrap; font-weight: 900; }
.topbar-inner .pill { flex: none; }
@media (max-width: 460px) {
  .topbar-inner { gap: 6px; padding: 10px 12px; }
  #brand-name { display: none; }
  .pill { padding: 5px 8px; gap: 3px; font-size: .92rem; }
  .pill .ico { font-size: 1rem; }
}
/* Lerngruppen: Gründen und Beitreten untereinander */
.group-actions { display: grid; gap: 10px; }
.group-actions form { display: flex; gap: 8px; }
.group-actions form input { flex: 1; min-width: 0; }
.lb-row .muted.small { overflow-wrap: anywhere; }
