/* LernHub
   Layout: Arbeitsplatz. Bühne (Karte/Bild) links groß, Arbeitsblatt rechts (Desktop);
   auf dem Handy Bühne oben, Blatt darunter, Navigation unten. */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #eef2f2; --surface: #ffffff; --surface-2: #f2f5f5; --ink: #13202b; --muted: #5a6975; --line: #d5dde0;
  --ocean: #cfe3ee; --ocean-2: #bdd6e5; --land: #e9e6d8; --land-t: #dde7c8; --border: #a3ab9c;
  --pen: #2340c8; --pen-dk: #152a8f; --pen-ink: #ffffff; --pen-soft: #2340c81f; --hl: #ffc22e; --ok-dk: #0c6436; --bad-dk: #a3241a; --card-sh: #d5dde0;
  --ok: #138548; --bad: #cf3427; --mtn: #94643a; --river: #2a72c3; --sand: #d7ae5f;
  --shadow: 0 1px 2px #0d1b2a14, 0 8px 24px #0d1b2a12;
  --f-display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 16px; --top-h: 60px; --panel-w: 440px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c1218; --surface: #141c24; --surface-2: #1a242e; --ink: #e6ecf1; --muted: #93a2ae; --line: #25323e;
  --ocean: #0f2233; --ocean-2: #0b1b29; --land: #2a2e2a; --land-t: #33412c; --border: #56614f;
  --pen: #8fa3ff; --pen-dk: #5a6fd0; --pen-ink: #0c1218; --pen-soft: #8fa3ff24; --hl: #ffc93f; --ok-dk: #2c9a5e; --bad-dk: #c84d42; --card-sh: #25323e;
  --ok: #4fd08a; --bad: #ff7a6d; --mtn: #cf9d68; --river: #5ca8f2; --sand: #bf9a55;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0c1218; --surface: #141c24; --surface-2: #1a242e; --ink: #e6ecf1; --muted: #93a2ae; --line: #25323e;
  --ocean: #0f2233; --ocean-2: #0b1b29; --land: #2a2e2a; --land-t: #33412c; --border: #56614f;
  --pen: #8fa3ff; --pen-dk: #5a6fd0; --pen-ink: #0c1218; --pen-soft: #8fa3ff24; --hl: #ffc93f; --ok-dk: #2c9a5e; --bad-dk: #c84d42; --card-sh: #25323e;
  --ok: #4fd08a; --bad: #ff7a6d; --mtn: #cf9d68; --river: #5ca8f2; --sand: #bf9a55;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; border-radius: 6px; }
svg { overflow: visible; }

/* ---------- Gerüst ---------- */
.app { display: grid; grid-template-rows: auto 1fr; height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
.top { display: flex; align-items: center; gap: 16px; padding-inline: 16px; height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 21px/1 var(--f-display); letter-spacing: -.01em; white-space: nowrap; }
.brand em { font-style: normal; color: var(--pen); }
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--pen); stroke-width: 2; }
.tabs { display: flex; gap: 4px; margin-inline: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; transition: background .15s, color .15s; }
.tabs a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--pen-ink); background: var(--pen); }
.top-tools { display: flex; align-items: center; gap: 10px; }
.ring { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--pen); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .6s ease; }
.ring span { font: 700 11px var(--f-body); font-variant-numeric: tabular-nums; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-2); }

.set-main { min-height: 0; display: grid; }
.stage { display: grid; grid-template-columns: 1fr var(--panel-w); min-height: 0; height: 100%; }
.stage.solo { grid-template-columns: 1fr; }
.stage.solo .map-wrap { display: none; }
.stage.solo .panel { border-left: 0; width: 100%; max-width: 780px; margin-inline: auto; background: transparent; }
.on-set .stage.solo { background: var(--bg); }
.stage.solo .panel > * { flex: none; }
.map-wrap { position: relative; min-height: 0; background: var(--ocean-2); overflow: hidden; touch-action: none; }
#map { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
#map.picking { cursor: crosshair; }
.panel { background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 16px; }

.map-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-tools .icon-btn { box-shadow: var(--shadow); }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; max-width: calc(100% - 100px); overflow: hidden; text-overflow: ellipsis; }
.legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; color: var(--muted); max-width: calc(100% - 24px); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: 4px 9px; border-radius: 7px; font-size: 13px; font-weight: 700; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 700; }

/* ---------- Karte ---------- */
.sphere { fill: var(--ocean); }
.grat { fill: none; stroke: var(--border); stroke-opacity: .28; stroke-width: .5; vector-effect: non-scaling-stroke; }
.special-lat { fill: none; stroke: var(--border); stroke-opacity: .7; stroke-width: .8; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.country { fill: var(--land); stroke: var(--border); stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .2s; }
.show-targets .country.target { fill: var(--land-t); }
.country.hover { fill: color-mix(in srgb, var(--pen) 22%, var(--land)); }
.country.sel, .country.hl { fill: var(--hl); }
.country.ok { fill: var(--ok); }
.country.bad { fill: var(--bad); }
.country.m0 { fill: color-mix(in srgb, var(--bad) 55%, var(--land)); }
.country.m1 { fill: color-mix(in srgb, var(--hl) 70%, var(--land)); }
.country.m2 { fill: color-mix(in srgb, var(--ok) 45%, var(--land)); }
.country.m3 { fill: var(--ok); }
.country.mx { fill: var(--land-t); }
.lake { fill: var(--ocean); stroke: var(--river); stroke-width: .4; stroke-opacity: .5; vector-effect: non-scaling-stroke; }
.river-bg { fill: none; stroke: var(--river); stroke-opacity: .45; stroke-width: .7; vector-effect: non-scaling-stroke; }
.capital { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }

.feat { vector-effect: non-scaling-stroke; transition: opacity .2s; }
.feat.g.area { fill: url(#hatch); stroke: var(--mtn); stroke-width: 1; }
.feat.g.line { fill: none; stroke: var(--mtn); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1 7; }
.feat.l.area { fill: color-mix(in srgb, var(--sand) 45%, transparent); stroke: var(--sand); stroke-width: 1; }
.feat.w.area { fill: color-mix(in srgb, var(--river) 30%, var(--ocean)); stroke: var(--river); stroke-width: 1; }
.feat.w.line { fill: none; stroke: var(--river); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.feat.pt { fill: var(--sand); stroke: var(--ink); stroke-width: 1.5; }
.feat.dim { opacity: .28; }
.feat.focus.area { stroke: var(--hl); stroke-width: 3; }
.feat.focus.line { stroke-width: 4.5; filter: drop-shadow(0 0 3px var(--hl)) drop-shadow(0 0 2px var(--hl)); }
.feat.focus.g.line { stroke-width: 7; }
.feat.focus.pt { stroke: var(--hl); stroke-width: 3; }
.feat.reveal.area { stroke: var(--ok); stroke-width: 3; }
.feat.reveal.line { stroke: var(--ok); stroke-width: 4.5; }
.feat.hit { cursor: pointer; }
.halo { fill: none; stroke: var(--hl); stroke-width: 2.5; vector-effect: non-scaling-stroke; animation: halo 1.6s ease-out infinite; }
@keyframes halo { from { stroke-opacity: 1; } to { stroke-opacity: 0; } }

.label { font-family: var(--f-body); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.label.num { fill: var(--pen); font-family: var(--f-display); font-weight: 800; }
.label.feat-label { fill: var(--ink); }
.guess { stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.guess.ok { fill: var(--ok); } .guess.bad { fill: var(--bad); }
.guess-line { fill: none; stroke: var(--bad); stroke-width: 1.8; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.dist { font: 700 12px var(--f-body); fill: var(--bad); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; text-anchor: middle; }

/* ---------- Panel-Bausteine ---------- */
.eyebrow { font: 700 12px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.015em; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #0002; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--pen); color: var(--pen); background: var(--pen-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .08s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--pen); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; }
.btn.block { width: 100%; }
.btn kbd { font: 700 11px var(--f-body); opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Listen */
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border: 0; background: none; text-align: left; border-radius: 9px; width: 100%; }
.item + .item { border-top: 1px solid var(--line); }
.item:hover { background: var(--surface-2); }
.item.sel { background: var(--pen-soft); }
.item .num { font: 800 15px var(--f-display); color: var(--pen); text-align: center; }
.item .t { display: flex; flex-direction: column; min-width: 0; }
.item .t b { font-weight: 700; }
.item .t span { font-size: 13.5px; color: var(--muted); }
.ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; justify-self: center; }
.ico.g { background: color-mix(in srgb, var(--mtn) 20%, transparent); color: var(--mtn); }
.ico.w { background: color-mix(in srgb, var(--river) 20%, transparent); color: var(--river); }
.ico.l { background: color-mix(in srgb, var(--sand) 30%, transparent); color: color-mix(in srgb, var(--sand) 60%, var(--ink)); }
.ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ok); }
.group-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 2px; }
.group-h h3 { font-size: 18px; font-weight: 800; }
.group-h .muted { font-size: 13px; }
.sub-h { font: 700 12px var(--f-body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 8px 8px 2px; }

/* Karten / Kacheln */
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); }
.card.flat { background: var(--surface-2); border-color: transparent; }
.ex-grid { display: grid; gap: 8px; }
.ex { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px; transition: border-color .15s, background .15s; }
.ex:hover { border-color: var(--pen); }
.ex[aria-pressed="true"] { border-color: var(--pen); background: var(--pen-soft); }
.ex .ex-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--pen-soft); color: var(--pen); display: grid; place-items: center; }
.ex .ex-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ex b { display: block; }
.ex span { font-size: 13.5px; color: var(--muted); }
.ex .pct { font: 700 13px var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.opts { display: grid; gap: 12px; }
.opt-label { font: 700 13px var(--f-body); color: var(--muted); margin-bottom: 6px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.switch input { width: 20px; height: 20px; accent-color: var(--pen); }

/* Abfrage */
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head .count { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pen); border-radius: 3px; transition: width .35s ease; }
.prompt { font: 800 25px/1.2 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.prompt mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--hl) 70%, transparent) 55%); color: inherit; padding: 0 2px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font: 700 13px var(--f-body); color: var(--muted); }
.input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); font-size: 17px; transition: border-color .15s, background .15s; }
.input:focus { border-color: var(--pen); background: var(--surface); outline: none; }
.input.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.input.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.45; }
.fb { border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; animation: pop .22s ease; }
.fb.ok { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.fb.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.fb.part { background: color-mix(in srgb, var(--hl) 20%, var(--surface)); }
.fb strong { font: 800 18px var(--f-display); }
.fb.ok strong { color: var(--ok); } .fb.bad strong { color: var(--bad); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.facts-check { display: flex; flex-direction: column; gap: 2px; }
.facts-check button { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: none; padding: 7px 6px; border-radius: 8px; font-size: 15px; }
.facts-check button:hover { background: var(--surface-2); }
.facts-check b { width: 20px; flex: none; font-size: 16px; }
.facts-check .y b { color: var(--ok); } .facts-check .n b { color: var(--bad); } .facts-check .n span { color: var(--muted); }
.hintline { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card .row > .i { width: 26px; height: 26px; color: var(--pen); }

/* Ergebnis */
.result-top { display: flex; align-items: center; gap: 18px; }
.grade { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font: 800 44px var(--f-display); color: var(--pen-ink); background: var(--pen); flex: none; }
.grade.g1, .grade.g2 { background: var(--ok); } .grade.g4, .grade.g5 { background: var(--bad); } .grade.g3 { background: var(--hl); color: #1d1600; }
.grade small { font-size: 18px; }
.miss { display: flex; flex-wrap: wrap; gap: 6px; }
.miss button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 14px; }

/* Fortschritt */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font: 800 22px var(--f-display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

/* Detail */
.detail-head { display: flex; align-items: flex-start; gap: 12px; }
.badge { font: 800 18px var(--f-display); color: var(--pen-ink); background: var(--pen); border-radius: 10px; min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
.fact-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); z-index: 50; animation: pop .2s ease; }

/* ---------- Handy ---------- */
@media (max-width: 899px) {
  :root { --top-h: 54px; }
  .app { height: auto; min-height: 100dvh; grid-template-rows: auto auto; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .brand { font-size: 19px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 10px; border-radius: 12px; }
  .tabs a[aria-current="page"] { background: var(--pen-soft); color: var(--pen); }
  .top-tools { margin-left: auto; }
  .stage { grid-template-columns: 1fr; }
  .map-wrap { position: sticky; top: 0; z-index: 4; height: 46dvh; min-height: 260px; border-bottom: 1px solid var(--line); }
  .panel { border-left: 0; overflow: visible; padding: 18px 16px 28px; }
  .prompt { font-size: 22px; }
  h1 { font-size: 26px; }
  .legend { font-size: 12px; padding: 6px 10px; }
  .map-tools { top: 8px; right: 8px; }
  .map-tools .icon-btn { width: 34px; height: 34px; }
  .map-hint { top: 8px; font-size: 13px; }
}
@media (min-width: 1400px) { :root { --panel-w: 480px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =================================================================== LernHub */
.brand-mark { fill: none; stroke: var(--pen); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.page { overflow-y: auto; min-height: 0; }
.page-in { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; display: flex; flex-direction: column; gap: 20px; }
.btn.sm, .icon-btn.sm { padding: 6px 10px; font-size: 13.5px; }
.icon-btn.sm { width: 32px; height: 32px; padding: 0; }
.input.sm { padding: 6px 8px; font-size: 14px; width: auto; }
select.input { appearance: auto; }
.nowrap { flex-wrap: nowrap; }
.full { grid-column: 1 / -1; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--hl) 28%, var(--surface)); color: color-mix(in srgb, var(--hl) 40%, var(--ink)); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.tag .x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.form-err { color: var(--bad); font-weight: 700; font-size: 14px; }
.empty { text-align: center; align-items: center; padding: 40px 24px; max-width: 560px; margin: 40px auto; }
.big-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--pen-soft); color: var(--pen); margin: 0 auto; }
.big-ico .i { width: 28px; height: 28px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 700 12px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.click { cursor: pointer; }
.table tr.click:hover, .table tr.open { background: var(--surface-2); }
.table tr.dead { opacity: .5; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .icon-btn { display: inline-grid; }
.detail-row > td { background: var(--surface-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
code.sel { user-select: all; word-break: break-all; }
.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* Kopfzeile */
.menu-wrap { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--pen); color: var(--pen-ink); font: 800 14px var(--f-display); display: grid; place-items: center; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu-h { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-h span { font-size: 13px; color: var(--muted); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14.5px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.back { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; max-width: 340px; }
.back > .i { flex: none; width: 22px; height: 22px; }
.back-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.back-t small { font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.back-t b { font: 800 16px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-top { border-bottom-color: transparent; background: transparent; }
.auth-top .top-tools { margin-left: auto; }

/* Anmeldung */
.auth { display: grid; place-items: center; padding: 24px 16px 60px; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; max-width: 980px; width: 100%; }
.auth-side h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.02; letter-spacing: -.02em; margin-bottom: 14px; }
.auth-side h1::after { content: ""; display: block; width: 72px; height: 8px; border-radius: 4px; background: var(--hl); margin-top: 18px; }
.auth-side p { color: var(--muted); font-size: 17px; max-width: 42ch; }
.auth-feats { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; font-weight: 700; }
.auth-feats li { display: flex; align-items: center; gap: 10px; }
.auth-feats .i { color: var(--pen); }
.auth-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.auth-card .seg { display: flex; }
.auth-card .seg a { flex: 1; text-align: center; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; }
.auth-card .seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #0002; }

/* Übersicht */
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head > div { flex: 1; min-width: 220px; }
.dash-head h1 { font-size: clamp(30px, 4.4vw, 42px); }
.resume { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow); }
.resume-l { display: flex; flex-direction: column; }
.resume-l small { color: var(--muted); font-weight: 700; font-size: 12px; }
.mini-ring { --p: 0; --rc: var(--pen); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--line) 0); flex: none; }
.mini-ring span { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 700 11px var(--f-body); font-variant-numeric: tabular-nums; }
.subject { display: flex; flex-direction: column; gap: 12px; }
.subject-h { display: flex; align-items: center; gap: 12px; }
.subject-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--sc, var(--pen)) 16%, var(--surface)); color: var(--sc, var(--pen)); flex: none; }
.subject-ico .i { width: 22px; height: 22px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.set-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; border-top: 4px solid var(--sc, var(--pen)); transition: transform .15s, box-shadow .15s; }
.set-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.set-card h3 { font: 800 19px/1.2 var(--f-display); }
.set-card-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kind .i { width: 16px; height: 16px; }
.set-card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.set-card .bar i { background: var(--sc, var(--pen)); }

/* Lernset: Lernkarten */
.search { position: relative; flex: 1; min-width: 200px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 40px; }
.lcards { display: flex; flex-direction: column; gap: 10px; }
.lcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); cursor: pointer; transition: border-color .15s; }
.lcard:hover { border-color: color-mix(in srgb, var(--pen) 50%, var(--line)); }
.lcard.sel { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.lcard-h { display: flex; align-items: center; gap: 10px; }
.lcard-h h3 { flex: 1; font-size: 18px; font-weight: 800; }
.quote { margin: 0; padding: 12px 16px; border-left: 4px solid var(--hl); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 16.5px; }
.masked { display: inline-block; min-width: 2.2em; border-bottom: 2px dotted var(--muted); color: transparent; }
.cat-opts { display: grid; gap: 8px; }
.cat-btn { justify-content: flex-start; padding: 14px 16px; font-size: 16px; }
.cat-btn.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); opacity: 1; }
.cat-btn.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); opacity: 1; }

/* Zuordnen */
.match { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 12px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.m-item, .m-info { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; transition: border-color .12s, background .12s; }
.m-item { align-items: center; min-height: 48px; }
.m-item.active { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.m-item.done .m-badge { background: var(--pen); color: var(--pen-ink); }
.m-item.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.m-item.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.m-badge { width: 26px; height: 26px; border-radius: 8px; border: 1.5px dashed var(--line); display: grid; place-items: center; font: 800 13px var(--f-display); flex: none; }
.m-item.done .m-badge { border: 0; }
.m-letter { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); font: 800 13px var(--f-display); display: grid; place-items: center; flex: none; }
.m-info.used { border-color: color-mix(in srgb, var(--pen) 45%, var(--line)); }
.m-info.used .m-letter { background: var(--pen); color: var(--pen-ink); }
.m-info:disabled, .m-item:disabled { cursor: default; }

/* Bilder */
.dg-title { position: absolute; left: 12px; top: 12px; background: var(--surface); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); }
#dg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
#dg.picking { cursor: crosshair; }
.dpt { fill: var(--pen); stroke: #fff; cursor: pointer; }
.dpt.sel, .dpt.focus { fill: var(--hl); stroke: var(--ink); }
.dpt.reveal { fill: var(--ok); }
.label.dlabel { text-anchor: start; fill: #13202b; stroke: #ffffff; }

/* Verwaltung */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.subtabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.subtabs a:hover { background: var(--surface-2); color: var(--ink); }
.subtabs a[aria-current="page"] { background: var(--pen-soft); color: var(--pen); }
.count-badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; line-height: 20px; }
.pend { border-left: 4px solid var(--hl); }
.user-detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; padding: 8px 4px; }
.prog-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 48px; gap: 10px; align-items: center; font-size: 14px; }
.prog-row b { text-align: right; font-variant-numeric: tabular-nums; }
.new-code { border: 2px dashed var(--pen); }
.code-big { font: 800 30px var(--f-display); letter-spacing: .08em; }
.subj-card { border-top: 4px solid var(--sc); }
.sets-admin .item { grid-template-columns: 34px 1fr auto; }
.add-set summary { cursor: pointer; font-weight: 700; color: var(--pen); display: inline-flex; gap: 6px; align-items: center; }
.add-set[open] summary { margin-bottom: 12px; }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 12px; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin-bottom: 10px; }
.ed-bar { position: sticky; top: 0; z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin: -10px -12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-radius: 12px; }
.ed-items { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ed-item + .ed-item { border-top: 1px solid var(--line); }
.ed-item.open { background: var(--surface-2); }
.ed-item-h { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; }
.ed-toggle { flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; min-width: 0; }
.ed-toggle:hover { background: var(--surface-2); }
.ed-item-b { padding: 4px 14px 16px; }
.diag-ed { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.dimg { position: relative; width: 100%; max-width: 820px; border-radius: 10px; overflow: hidden; cursor: crosshair; background: var(--surface-2); }
.dimg img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.pdot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--pen); border: 2px solid #fff; box-shadow: 0 1px 3px #0005; cursor: pointer; }
.pdot span { position: absolute; left: 14px; top: -4px; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: #13202b; background: #ffffffd9; padding: 0 4px; border-radius: 4px; pointer-events: none; }
.pdot.on { background: var(--hl); width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 899px) {
  .page-in { padding: 20px 16px 40px; }
  .grid2, .two-col, .user-detail { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; }
  .auth-side p, .auth-feats { display: none; }
  .back { max-width: 52vw; }
  .set-top .ring { margin-left: auto; }
  .set-top .top-tools { margin-left: 0; }
  .set-top #themeBtn { display: none; }
  .main-nav { display: flex; }
  .stage.solo .panel { padding: 18px 16px 28px; }
  .match { grid-template-columns: 1fr; }
  .menu { position: fixed; right: 12px; top: 58px; }
  .table { font-size: 13.5px; }
  .ed-bar { margin: 0; }
}

/* =================================================================== Frisch & verspielt (v2) */
/* Bewegung */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes jump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-16px) scale(1.04, .96); } 55% { transform: translateY(0) scale(1.06, .92); } 75% { transform: translateY(-4px); } 100% { transform: none; } }
@keyframes droop { 0% { transform: rotate(0); } 30% { transform: rotate(-6deg) translateY(2px); } 60% { transform: rotate(4deg); } 100% { transform: none; } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes pop2 { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.8); } }

.page-in > *, .panel > *:not(.fb-dock) { animation: rise .4s cubic-bezier(.2, .8, .3, 1) both; }
.page-in > *:nth-child(2), .panel > *:nth-child(2) { animation-delay: .04s; }
.page-in > *:nth-child(3), .panel > *:nth-child(3) { animation-delay: .08s; }
.page-in > *:nth-child(4), .panel > *:nth-child(4) { animation-delay: .12s; }
.page-in > *:nth-child(n+5), .panel > *:nth-child(n+5) { animation-delay: .16s; }

/* Maskottchen */
.mascot { display: inline-block; width: var(--ms, 96px); height: calc(var(--ms, 96px) * 1.03); flex: none; position: relative; }
.mascot-svg, .mascot-img { width: 100%; height: 100%; overflow: visible; display: block; }
.mascot-img { object-fit: contain; }
.mascot .body-g { transform-origin: 50% 90%; animation: bob 3.2s ease-in-out infinite; }
.mascot .blink { transform-origin: 100px 48px; transform: scaleY(0); animation: blink2 5s infinite; }
@keyframes blink2 { 0%, 93%, 100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }
.mascot.m-cheer .body-g, .mascot.react.m-happy .body-g { animation: jump .7s cubic-bezier(.3, .7, .4, 1) 1, bob 3.2s .7s ease-in-out infinite; }
.mascot.m-sad .body-g { animation: droop .8s ease 1; }
.mascot.m-wave .arm-r { transform-origin: 170px 110px; animation: wave 1s ease-in-out 2; }
.mascot .sparkles path { transform-box: fill-box; transform-origin: center; animation: twinkle 1.2s ease-in-out infinite; }
.mascot .shadow { transform-origin: 100px 208px; }
.mascot-img { animation: bob 3.2s ease-in-out infinite; }
.mascot.react .mascot-img { animation: jump .7s 1, bob 3.2s .7s infinite; }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; box-shadow: 0 3px 0 var(--card-sh); }
.bubble::before { content: ""; position: absolute; left: -10px; top: 22px; width: 16px; height: 16px; background: inherit; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.bubble.big { font: 800 20px/1.25 var(--f-display); }

/* Knöpfe im „Drück-mich“-Stil */
.btn { border-width: 2px; border-radius: 14px; box-shadow: 0 3px 0 var(--card-sh); font-weight: 800; padding: 11px 18px; transition: transform .08s, box-shadow .08s, background .15s, filter .15s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--card-sh); }
.btn.primary { border-color: var(--pen-dk); box-shadow: 0 4px 0 var(--pen-dk); }
.btn.primary:active { box-shadow: 0 1px 0 var(--pen-dk); transform: translateY(3px); }
.btn.ghost, .btn.ghost:active { box-shadow: none; border-color: transparent; }
.btn.sm { padding: 6px 12px; border-radius: 11px; box-shadow: 0 2px 0 var(--card-sh); }
.btn.primary.sm { box-shadow: 0 3px 0 var(--pen-dk); }
.btn:disabled { box-shadow: none; transform: none; }
.icon-btn { border-width: 2px; border-radius: 12px; }
.icon-btn.ghost { border-color: transparent; background: none; }
.input { border-width: 2px; border-radius: 14px; }
.input.shake { animation: shake .4s ease; }
.chip { border-width: 2px; padding: 6px 13px; }
.seg { border-radius: 14px; padding: 4px; }
.seg button { border-radius: 10px; }
.card { border-width: 2px; border-radius: 20px; box-shadow: 0 3px 0 var(--card-sh); }
.card.flat { box-shadow: none; }

/* Kopf & Übersicht */
.top { box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
.hero-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--pen) 9%, var(--surface)), var(--surface) 60%); border: 2px solid var(--line); border-radius: 26px; padding: 20px 24px; box-shadow: 0 4px 0 var(--card-sh); }
.hero-main { display: flex; align-items: center; gap: 18px; flex: 1 1 420px; min-width: 0; }
.hero-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; flex: 1; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.hs { display: flex; align-items: center; gap: 8px; }
.hs b { font: 800 22px/1 var(--f-display); display: block; font-variant-numeric: tabular-nums; }
.hs span:not(.hs-ico) { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.hs-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.hs-ico .i { width: 22px; height: 22px; }
.hs.hot .hs-ico { background: color-mix(in srgb, #ff8a1f 18%, var(--surface)); color: #ff8a1f; }
.hs-ico.blue { background: var(--pen-soft); color: var(--pen); }
.week { display: flex; gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.wd i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.wd.on i { background: #ff8a1f; border-color: #e0700a; color: #fff; }
.wd.on i .i { width: 15px; height: 15px; stroke-width: 3; }
.wd.today { color: var(--ink); }
.wd.today i { border-color: var(--pen); }
.resume { gap: 12px; border-width: 2px; border-radius: 18px; box-shadow: 0 3px 0 var(--card-sh); }
.set-card { position: relative; border-width: 2px; border-top-width: 6px; border-radius: 20px; box-shadow: 0 4px 0 var(--card-sh); padding: 18px; gap: 10px; }
.set-card:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--card-sh); }
.set-card-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.set-card > *:not(.set-card-link) { position: relative; z-index: 1; pointer-events: none; }
.set-card .set-actions, .set-card .set-actions * { pointer-events: auto; }
.set-card-top .mini-ring { margin-left: auto; width: 42px; height: 42px; }
.set-card-top .mini-ring span { width: 32px; height: 32px; }
.set-card-foot { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.set-actions { display: flex; gap: 8px; }
.subject-h h2 { font-size: 24px; }
.auth-mascot { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-mascot .bubble { font-weight: 700; }

/* Abfrage */
.q-top { display: flex; align-items: center; gap: 12px; }
.q-progress { flex: 1; height: 16px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 2px solid var(--line); }
.q-progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(180deg, #7ee06b, #4fbf4a); box-shadow: inset 0 -3px 0 #3ea23a, inset 0 3px 0 #ffffff55; transition: width .5s cubic-bezier(.3, .8, .3, 1); }
.q-streak { display: inline-flex; align-items: center; gap: 3px; font: 800 17px var(--f-display); color: var(--muted); min-width: 44px; }
.q-streak .i { width: 22px; height: 22px; }
.q-streak.on { color: #ff8a1f; }
.q-streak.on .i { fill: #ffb347; stroke: #ff8a1f; }
.q-streak.pop { animation: pop2 .45s ease; }
.q-meta { display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 700; margin-top: -6px; padding-left: 50px; }
.q-hero { display: flex; align-items: flex-end; gap: 12px; }
.q-hero .bubble { flex: 1; min-width: 0; margin-bottom: 10px; }
.q-hero .bubble::before { top: auto; bottom: 18px; }
.q-hero .prompt { font-size: 21px; }
.q-hero .eyebrow { margin-bottom: 4px; }
.q-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.q-actions .btn.primary { min-width: 140px; }
.fb-dock { margin-top: auto; position: sticky; bottom: 0; z-index: 3; }
.fb-dock:empty { display: none; }
.panel { padding-bottom: 20px; }
.fb-sheet { border-radius: 22px 22px 0 0; margin: 0 -20px -20px; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; animation: sheet .3s cubic-bezier(.2, .8, .3, 1); border-top: 3px solid; max-height: 62dvh; overflow-y: auto; }
.fb-sheet.ok { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); border-color: var(--ok); }
.fb-sheet.part { background: color-mix(in srgb, var(--hl) 22%, var(--surface)); border-color: var(--hl); }
.fb-sheet.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); }
.fb-head { display: flex; align-items: center; gap: 12px; }
.fb-head strong { display: block; font: 800 21px/1.15 var(--f-display); }
.fb-sheet.ok strong { color: var(--ok); } .fb-sheet.bad strong { color: var(--bad); } .fb-sheet.part strong { color: color-mix(in srgb, var(--hl) 45%, var(--ink)); }
.fb-sub { font-size: 14px; color: var(--muted); font-weight: 700; }
.fb-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.fb-badge .i { width: 24px; height: 24px; stroke-width: 3; }
.fb-sheet.ok .fb-badge { color: var(--ok); } .fb-sheet.bad .fb-badge { color: var(--bad); } .fb-sheet.part .fb-badge { color: color-mix(in srgb, var(--hl) 50%, var(--ink)); }
.fb-body { display: flex; flex-direction: column; gap: 4px; font-size: 15.5px; }
.fb-sheet.ok .fb-next { background: var(--ok); border-color: var(--ok-dk); box-shadow: 0 4px 0 var(--ok-dk); color: #fff; }
.fb-sheet.bad .fb-next { background: var(--bad); border-color: var(--bad-dk); box-shadow: 0 4px 0 var(--bad-dk); color: #fff; }
.fb-sheet.part .fb-next { background: var(--hl); border-color: #c98a00; box-shadow: 0 4px 0 #c98a00; color: #1d1600; }
.stage.solo .fb-sheet { margin: 0; border-radius: 22px; border-width: 3px; border-style: solid; }
.confirm .mascot { vertical-align: middle; margin-right: 8px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* Ergebnis */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-top: 8px; }
.result h1 { font-size: 32px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 460px; }
.tile { border: 2px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: center; background: var(--surface); box-shadow: 0 3px 0 var(--card-sh); }
.tile span { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile span .i { width: 16px; height: 16px; }
.tile b { font: 800 28px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.tile b small { font-size: 16px; color: var(--muted); }
.tile.t-main { border-color: var(--pen); }
.tile.t-main.g1, .tile.t-main.g2 { border-color: var(--ok); color: var(--ok); }
.tile.t-main.g3 { border-color: var(--hl); }
.tile.t-main.g4, .tile.t-main.g5 { border-color: var(--bad); color: var(--bad); }
.tile.t-streak b { color: #ff8a1f; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.miss { justify-content: center; }
.miss button { border-width: 2px; border-radius: 10px; font-weight: 700; }

/* Übungsauswahl */
.ex-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.ex { border-width: 2px; border-radius: 18px; box-shadow: 0 3px 0 var(--card-sh); padding: 14px; transition: transform .12s, box-shadow .12s, border-color .15s; }
.ex:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--card-sh); }
.ex[aria-pressed="true"] { box-shadow: 0 3px 0 var(--pen-dk); }
.ex .ex-ico { border-radius: 14px; }
.lcard { border-width: 2px; border-radius: 18px; box-shadow: 0 3px 0 var(--card-sh); }
.lcard.sel { box-shadow: 0 3px 0 var(--pen-dk); }
.m-item, .m-info { border-width: 2px; border-radius: 14px; box-shadow: 0 2px 0 var(--card-sh); }
.cat-btn { border-radius: 16px; }

/* Vergleich */
.cmp-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmp-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-fig figcaption { font: 800 15px var(--f-display); }
.cmp-img { cursor: default; border: 2px solid var(--line); border-radius: 16px; max-width: none; }
.cmp-img .pdot { cursor: default; animation: pop2 .5s ease; }
.cmp-none { position: absolute; inset: auto 8px 8px 8px; background: var(--surface); border: 2px solid var(--bad); color: var(--bad); border-radius: 10px; padding: 4px 8px; font-size: 13px; font-weight: 800; display: flex; gap: 6px; align-items: center; justify-content: center; }
.cmp-table td.c, .cmp-table th.c { text-align: center; width: 28%; }
.cmp-table tr.diff td:first-child { box-shadow: inset 4px 0 0 var(--hl); }
.cmp-table .yes { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.cmp-table .yes .i { width: 17px; height: 17px; stroke-width: 3; }
.cmp-table .no { color: var(--muted); font-weight: 800; }

/* Verwaltung: Maskottchen */
.mood-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mood-row figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }

@media (max-width: 899px) {
  .hero-card { padding: 16px; border-radius: 22px; }
  .hero-main { flex-basis: 100%; gap: 10px; align-items: flex-start; }
  .hero-mascot .mascot { --ms: 84px !important; }
  .bubble.big { font-size: 17px; }
  .resume { width: 100%; }
  .resume .btn { margin-left: auto; }
  .q-hero .mascot { --ms: 56px !important; }
  .q-hero .prompt { font-size: 19px; }
  .fb-dock { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .fb-sheet { margin: 0 -16px; border-radius: 22px 22px 0 0; }
  .stage.solo .fb-sheet { margin: 0; }
  .cmp-figs { grid-template-columns: 1fr; }
  .q-meta { padding-left: 0; }
  .result h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .mascot *, .mascot-img { animation: none !important; } }
