/* Deutschico – Design-System. Dunkles „Arcade“-Thema als Standard, helles über [data-theme=light],
   rosa-verspieltes über [data-theme=girly] (Umschalter: core/theme.js).
   Komponenten-Klassen sind in CLAUDE.md dokumentiert; neue Module sollen nur diese verwenden. */

:root {
  --bg: #0a0a1f;
  --bg-2: #101030;
  --panel: #16163c;
  --panel-2: #1d1d4d;
  --panel-3: #262663;
  --line: rgba(160, 160, 255, 0.14);
  --line-2: rgba(160, 160, 255, 0.26);
  --text: #eeedff;
  --muted: #a6a6d0;
  --faint: #6e6ea0;
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-ink: #ffffff;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.14);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.14);
  --c-lesen: #22d3ee;
  --c-hoeren: #a78bfa;
  --c-schreiben: #fbbf24;
  --c-sprechen: #34d399;
  --c-karten: #fb923c;
  --c-boss: #fb7185;
  --glow: 0 0 0 1px var(--line-2), 0 10px 40px -12px rgba(139, 108, 255, 0.45);
  --shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.6);
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Chakra Petch', 'Nunito', system-ui, sans-serif;
  --reading: 'Source Serif 4', Georgia, serif;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f4f3ff;
  --bg-2: #ebe9ff;
  --panel: #ffffff;
  --panel-2: #f6f5ff;
  --panel-3: #ebe8ff;
  --line: rgba(60, 50, 140, 0.12);
  --line-2: rgba(60, 50, 140, 0.24);
  --text: #1c1a3a;
  --muted: #5d5a86;
  --faint: #8d8ab0;
  --accent: #6d4aff;
  --accent-2: #0891b2;
  --ok: #059669;
  --ok-bg: rgba(5, 150, 105, 0.1);
  --bad: #e11d48;
  --bad-bg: rgba(225, 29, 72, 0.08);
  --warn: #b45309;
  --warn-bg: rgba(217, 119, 6, 0.1);
  --c-lesen: #0891b2;
  --c-hoeren: #7c3aed;
  --c-schreiben: #d97706;
  --c-sprechen: #059669;
  --c-karten: #ea580c;
  --c-boss: #e11d48;
  --glow: 0 0 0 1px var(--line-2), 0 10px 30px -14px rgba(109, 74, 255, 0.35);
  --shadow: 0 8px 24px -14px rgba(30, 20, 80, 0.3);
  color-scheme: light;
}

:root[data-theme='girly'] {
  --bg: #fff0f7;
  --bg-2: #ffe4f1;
  --panel: #ffffff;
  --panel-2: #fff5fa;
  --panel-3: #ffe3f0;
  --line: rgba(190, 40, 120, 0.14);
  --line-2: rgba(190, 40, 120, 0.28);
  --text: #4a1238;
  --muted: #8a4a72;
  --faint: #b884a6;
  --accent: #e0428f;
  --accent-2: #9b5de5;
  --ok: #0f9d74;
  --ok-bg: rgba(15, 157, 116, 0.1);
  --bad: #d7263d;
  --bad-bg: rgba(215, 38, 61, 0.08);
  --warn: #b7610b;
  --warn-bg: rgba(234, 140, 30, 0.12);
  --c-lesen: #9b5de5;
  --c-hoeren: #e0428f;
  --c-schreiben: #d9820b;
  --c-sprechen: #0f9d74;
  --c-karten: #f15bb5;
  --c-boss: #c2185b;
  --glow: 0 0 0 1px var(--line-2), 0 10px 30px -12px rgba(224, 66, 143, 0.4);
  --shadow: 0 8px 24px -14px rgba(120, 20, 80, 0.28);
  --radius: 22px;
  --radius-sm: 16px;
  --font-display: 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 108, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.4em; letter-spacing: 0.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.8em; }
a { color: var(--accent-2); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Layout */

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--text); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 20px -6px var(--accent);
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; }
.logo-text b { color: var(--accent-2); font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 700;
}
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav .ico { font-size: 20px; width: 26px; text-align: center; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 8px; }
.sidebar-foot { margin-top: auto; font-size: 13px; color: var(--faint); padding: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.hud {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px);
}
.hud .spacer { flex: 1; }
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 28px 80px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .spacer { flex: 1; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.sticky-col { position: sticky; top: 84px; }

/* mobile: Navigation unten */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
  }
  .sidebar .logo, .sidebar-foot { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; position: relative; }
  .nav a.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .nav a.nav-extra { display: none; }
  .nav .count { position: absolute; top: 0; right: 4px; margin: 0; }
  .hud { padding: 10px 16px; }
  .page { padding: 20px 16px 110px; }
  .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .hide-mobile { display: none !important; }
}

/* ---------------------------------------------------------------- Karten & Flächen */

.card {
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 80%, var(--bg)));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card.glow { box-shadow: var(--glow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.card.clickable:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--glow); }
.panel { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.divider { height: 1px; background: var(--line); margin: 8px 0; border: 0; }

.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.big-number { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); }
.ico { display: inline-block; line-height: 1; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer;
  text-decoration: none; transition: transform 0.08s, filter 0.15s, background 0.15s; user-select: none;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  border: 0; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--accent) 55%, #000), 0 10px 24px -10px var(--accent);
}
.btn-primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); }
.btn-primary:active { box-shadow: 0 3px 0 -1px color-mix(in srgb, var(--accent) 55%, #000); transform: translateY(3px); }
.btn-ok { border: 0; background: var(--ok); color: #05281c; }
.btn-danger { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: var(--bad); background: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 26px; font-size: 1.08rem; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 15px;
}
.btn-icon:hover { background: var(--panel-3); }

/* ---------------------------------------------------------------- Chips, Badges, Balken */

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); background: var(--panel-2);
}
.chip-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-bg); }
.chip-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
.chip-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-bg); }
.chip-accent { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
.chip-lock { color: var(--faint); }

.bar { height: 10px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.bar.ok > i { background: var(--ok); }
.bar.bad > i { background: var(--bad); }
.bar.warn > i { background: var(--warn); }
.bar.thin { height: 6px; }
.bar.fat { height: 16px; }

.stars { display: inline-flex; gap: 1px; font-size: 16px; letter-spacing: -1px; }
.stars i { font-style: normal; color: var(--panel-3); }
.stars i.on { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.6); }

.timer {
  font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 4px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2);
}
.timer.warn { color: var(--warn); border-color: var(--warn); }
.timer.crit { color: var(--bad); border-color: var(--bad); animation: pulse 1s infinite; }

/* ---------------------------------------------------------------- HUD & Spielelemente */

.level-badge {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #c026d3); box-shadow: 0 4px 16px -4px var(--accent);
}
.xp { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.xp .xp-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; }
.xp .rank { color: var(--text); }
.hud-stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; padding: 6px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.hud-stat.flame { color: #fb923c; }
.hud-stat.cold { color: var(--faint); }
.lock-state { font-weight: 800; font-size: 14px; }
.lock-state.open { color: var(--ok); }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(34, 211, 238, 0.22), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(192, 38, 211, 0.22), transparent 60%),
    linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2); box-shadow: var(--glow);
}
.hero h1 { margin-bottom: 6px; }
.gradient-text { background: linear-gradient(90deg, var(--accent-2), var(--accent), #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }

.quest { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.quest.done { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.quest.claimed { opacity: 0.6; }
.quest .q-ico { font-size: 22px; }

.world-card { position: relative; overflow: hidden; border-left: 4px solid var(--wc, var(--accent)); }
.world-card::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--wc, var(--accent)) 35%, transparent), transparent 70%);
}
.world-card .world-ico { font-size: 34px; }

/* Levelpfad einer Welt */
.path { display: flex; flex-direction: column; gap: 26px; }
.path-part h3 { display: flex; align-items: center; gap: 10px; }
.nodes { display: flex; flex-wrap: wrap; gap: 14px; }
.node {
  position: relative; width: 150px; min-height: 118px; padding: 12px; border-radius: 18px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; justify-content: space-between;
  background: var(--panel); border: 2px solid var(--line-2); color: var(--text); text-align: left;
  transition: transform 0.12s, box-shadow 0.15s; box-shadow: 0 5px 0 -1px var(--panel-3);
}
.node:hover { transform: translateY(-3px); box-shadow: 0 8px 0 -1px var(--panel-3), var(--glow); }
.node .node-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--nc, var(--accent)); }
.node .node-title { font-size: 13px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
.node.done { border-color: color-mix(in srgb, var(--nc, var(--accent)) 60%, transparent); }
.node.next { border-color: var(--nc, var(--accent)); box-shadow: 0 5px 0 -1px var(--panel-3), 0 0 24px -4px var(--nc, var(--accent)); animation: bob 2.4s ease-in-out infinite; }
.node.locked { cursor: pointer; opacity: 0.55; filter: grayscale(0.6); }
.node.locked .node-num::after { content: ' 🔒'; font-size: 14px; }
.node .free-tag { position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--ok); color: #05281c; }

.boss-card { border: 1px solid color-mix(in srgb, var(--c-boss) 45%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--c-boss) 14%, var(--panel)), var(--panel)); }
.hp { height: 14px; border-radius: 99px; background: var(--panel-3); overflow: hidden; border: 1px solid var(--line-2); }
.hp > i { display: block; height: 100%; background: linear-gradient(90deg, #ef4444, #f97316); transition: width 0.8s; }

.achievement { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.achievement .a-ico { font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-3); }
.achievement.off { opacity: 0.45; filter: grayscale(1); }

.lock-panel {
  text-align: center; padding: 28px; border-radius: var(--radius); border: 1px dashed var(--line-2);
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(139, 108, 255, 0.05) 12px 24px), var(--panel);
}
.lock-panel .lock-ico { font-size: 44px; }

/* ---------------------------------------------------------------- Übungen */

.ex { display: flex; flex-direction: column; gap: 18px; }
.ex-situation { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel-2); border-left: 4px solid var(--accent-2); }
.ex-instruction { font-weight: 700; }
.textcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.textcard h3 { font-family: var(--font); font-weight: 800; }
.textcard .tag { font-family: var(--font-display); font-weight: 700; color: var(--accent-2); margin-right: 8px; }
.prose { font-family: var(--reading); font-size: 17px; line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }

.q { padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.q.ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.q.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.q-top { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.q-num {
  flex: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; background: var(--panel-3); color: var(--text);
}
.q-prompt { font-weight: 700; padding-top: 4px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.inline { flex-direction: row; flex-wrap: wrap; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 10px 12px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.opts.inline .opt { width: auto; }
.opt:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-3); }
.opt .opt-key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; background: var(--panel-3); text-transform: lowercase;
}
.opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.opt.sel .opt-key { background: var(--accent); color: #fff; }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.ok .opt-key { background: var(--ok); color: #05281c; }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); }
.opt.bad .opt-key { background: var(--bad); color: #fff; }
.opt.reveal { border-style: dashed; border-color: var(--ok); }
.opt:disabled { cursor: default; }

.explain { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 15px; background: var(--panel-2); border-left: 4px solid var(--faint); }
.explain.ok { border-left-color: var(--ok); }
.explain.bad { border-left-color: var(--bad); }
.explain b { font-weight: 800; }

.match-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.match-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.key-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.key-picker .opt { width: 40px; height: 40px; padding: 0; justify-content: center; align-items: center; font-family: var(--font-display); font-weight: 700; }

.gap-text { font-family: var(--reading); font-size: 17px; line-height: 2.1; }
.gap {
  display: inline-flex; align-items: center; gap: 4px; min-width: 96px; padding: 0 10px; margin: 0 2px;
  border-radius: 10px; border: 2px dashed var(--line-2); background: var(--panel-2); font-family: var(--font); font-size: 15px;
  cursor: pointer; vertical-align: middle; line-height: 30px;
}
.gap .gap-n { font-family: var(--font-display); font-weight: 700; color: var(--muted); font-size: 12px; }
.gap.filled { border-style: solid; border-color: var(--accent); }
.gap.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.gap.ok { border-color: var(--ok); background: var(--ok-bg); }
.gap.bad { border-color: var(--bad); background: var(--bad-bg); }
.wordbank { display: flex; flex-wrap: wrap; gap: 8px; }
.word { padding: 6px 12px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 700; }
.word:hover { background: var(--panel-3); }
.word .word-key { font-family: var(--font-display); color: var(--muted); margin-right: 6px; }
.word.used { opacity: 0.4; }
select.gap-select { padding: 4px 8px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); font-size: 15px; }

.email-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.email-card .email-meta { padding: 12px 18px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); display: grid; gap: 2px; }
.email-card .email-meta b { color: var(--text); }
.email-card .email-body { padding: 16px 18px; }

.notepad {
  background: #fff8c9; color: #3a3210; border-radius: 6px 6px 14px 14px; padding: 18px 20px; box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(transparent 0 30px, rgba(80, 60, 0, 0.12) 30px 31px);
  font-family: 'Patrick Hand', 'Comic Sans MS', var(--font); font-size: 18px;
}
.notepad h3 { color: #3a3210; font-family: var(--font-display); }
.notepad input { width: 100%; border: 0; border-bottom: 2px solid rgba(80, 60, 0, 0.35); background: transparent; color: #3a3210; font-family: inherit; font-size: 18px; padding: 2px 4px; }
.notepad input:focus { outline: none; border-bottom-color: #6d4aff; }
.notepad label { font-weight: 700; font-size: 15px; }

.field, textarea.writer, input.field {
  width: 100%; border-radius: 12px; border: 2px solid var(--line-2); background: var(--panel-2); padding: 12px 14px;
}
textarea.writer { min-height: 260px; resize: vertical; font-family: var(--reading); font-size: 17px; line-height: 1.65; }
.field:focus, textarea.writer:focus { outline: none; border-color: var(--accent); }
.counter { font-size: 13px; color: var(--muted); font-weight: 700; }
.counter.ok { color: var(--ok); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.checklist li::before { content: '○'; color: var(--faint); font-weight: 800; }
.checklist li.done::before { content: '✓'; color: var(--ok); }
.checklist label { display: flex; gap: 10px; cursor: pointer; width: 100%; }

details.model-answer, details.transcript { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
details.model-answer > summary, details.transcript > summary { cursor: pointer; padding: 12px 16px; font-weight: 800; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.model-answer > summary::before, details.transcript > summary::before { content: '▸ '; color: var(--accent-2); }
details[open].model-answer > summary::before, details[open].transcript > summary::before { content: '▾ '; }
details.model-answer > div, details.transcript > div { padding: 0 16px 16px; }
.line { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 4px 0; }
.line .speaker { font-weight: 800; color: var(--muted); font-size: 14px; }

.audio-player { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--c-hoeren) 18%, var(--panel)), var(--panel)); border: 1px solid color-mix(in srgb, var(--c-hoeren) 35%, transparent); }
.audio-label { font-weight: 800; }
.audio-controls { display: flex; align-items: center; gap: 12px; }
.audio-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.audio-bar > i { display: block; height: 100%; width: 0; background: var(--c-hoeren); transition: width 0.4s; }
.audio-status { font-size: 13px; color: var(--muted); }
.btn-audio { background: var(--c-hoeren); color: #1a0b3d; border: 0; }
.audio-player.playing .btn-audio { animation: pulse 1.2s infinite; }

/* Sprechen */
.mic-btn {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; font-size: 34px;
  background: radial-gradient(circle at 30% 30%, #ff8fa3, #e11d48); color: #fff; box-shadow: 0 10px 30px -8px #e11d48;
}
.mic-btn.rec { animation: rec 1.2s infinite; }
.transcript-live { min-height: 90px; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px dashed var(--line-2); font-family: var(--reading); font-size: 17px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); }
.bubble.me { margin-left: auto; background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.bubble .who { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.chat { display: flex; flex-direction: column; gap: 10px; }

/* Karten */
.flashcard { perspective: 1200px; min-height: 260px; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; min-height: 260px; transition: transform 0.5s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 22px; padding: 26px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px;
  background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); box-shadow: var(--glow);
}
.flashcard-back { transform: rotateY(180deg); }

/* ---------------------------------------------------------------- Ergebnis */

.result-hero { text-align: center; padding: 30px 20px; }
.result-hero .stars { font-size: 48px; gap: 8px; }
.result-hero .stars i { animation: pop 0.5s backwards; }
.result-hero .stars i:nth-child(2) { animation-delay: 0.15s; }
.result-hero .stars i:nth-child(3) { animation-delay: 0.3s; }
.xp-gain { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fbbf24; }

/* ---------------------------------------------------------------- Overlays */

.toasts { position: fixed; z-index: 100; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); font-weight: 700; box-shadow: var(--shadow); animation: slideIn 0.25s; max-width: 360px; }
.toast-ok { border-color: var(--ok); }
.toast-bad { border-color: var(--bad); }
.toast-xp { border-color: #fbbf24; color: #fbbf24; }
.toast.out { opacity: 0; transform: translateX(20px); transition: 0.35s; }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(5, 5, 20, 0.66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade 0.18s; }
.modal-back.out { opacity: 0; transition: 0.18s; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; box-shadow: var(--glow); animation: pop 0.25s; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 110; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
.float-text { position: fixed; z-index: 120; transform: translateX(-50%); font-family: var(--font-display); font-weight: 700; color: #fbbf24; pointer-events: none; animation: floatUp 1.1s forwards; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.float-text.bad { color: var(--bad); }

.boot { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.boot .logo-mark { width: 64px; height: 64px; font-size: 32px; margin: 0 auto 14px; animation: bob 1.4s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.6; } }
@keyframes rec { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); } 100% { box-shadow: 0 0 0 22px rgba(225, 29, 72, 0); } }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
@keyframes floatUp { to { transform: translate(-50%, -70px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- writing (agent) ---- */
.topic-pick { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.writer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.notepad .n-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.notepad .n-row:last-child { margin-bottom: 0; }
.notepad .n-status { font-size: 13px; font-weight: 800; }
.notepad .n-status.ok { color: var(--ok); }
.notepad .n-status.bad { color: var(--bad); }

/* ---- exercises (agent) ---- */
/* sb1: Wort gewählt, wartet auf einen Lücken-Klick */
.word.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
/* sb2: Auswahlfeld-Rückmeldung nach check(), analog zu .gap.ok/.bad */
select.gap-select.ok { border-color: var(--ok); background: var(--ok-bg); }
select.gap-select.bad { border-color: var(--bad); background: var(--bad-bg); }
select.gap-select:disabled { opacity: 0.85; cursor: default; }

/* ---------------------------------------------------------------- Views (Kern) */
.level-badge { text-decoration: none; }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.radar-row a, .path-part a { color: var(--text); text-decoration: none; }
.radar-row a:hover { color: var(--accent-2); }

.forecast-bar { position: relative; }
.forecast-bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.55; border-radius: 2px; }
.forecast-bar .mark.floor { opacity: 0.25; }
.teaser-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.teaser-list .feat { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.teaser-list .feat .ico { font-size: 24px; }
.mission-bar {
  position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 24px -28px -80px; padding: 14px 28px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
}
.part-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.part-tabs button { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 800; cursor: pointer; font-size: 14px; }
.part-tabs button.active { background: var(--accent); color: #fff; border-color: transparent; }
.part-tabs button .done-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; }
.tips { font-size: 15px; }
.tips ul { margin: 6px 0 0; padding-left: 20px; }
.radar-row { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; }
.box-dots { display: inline-flex; gap: 3px; }
.box-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--panel-3); }
.box-dots i.on { background: var(--ok); }
.plan-day { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-day:last-child { border-bottom: 0; }
.plan-day.today { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 12px; padding: 12px; }
.code-input { font-family: var(--font-display); font-size: clamp(1.1rem, 4vw, 1.6rem); letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }
@media (max-width: 860px) {
  .mission-bar { margin: 20px -16px -110px; padding: 12px 16px calc(80px + env(safe-area-inset-bottom)); }
  .radar-row { grid-template-columns: 1fr 60px; }
  .radar-row > :first-child { grid-column: 1 / -1; }
}

/* ---- cards (agent) ---- */
.flash-word { font-family: var(--font-display); font-weight: 700; font-size: 2rem; }
.flash-article { color: var(--accent-2); margin-right: 6px; }
.flash-meaning { font-size: 1.15rem; font-weight: 700; }
.flashcard-face .chip { margin: 2px; }

.duell-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px 10px; }
.duell-word { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 8vw, 3.6rem); text-align: center; }
.duell-word.shake { animation: duellShake 0.4s; color: var(--bad); }
.duell-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; max-width: 520px; }
.duell-choice { font-size: 1.3rem; padding: 20px 10px; }
@keyframes duellShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) { .duell-word.shake { animation: none; } }

/* ---- matching layout (Kern) ---- */
.match-side { max-height: calc(100vh - 110px); overflow: auto; padding-right: 4px; }
.match-side .q { padding: 12px; }
@media (max-width: 860px) { .match-side { max-height: none; overflow: visible; } }

/* ---------------------------------------------------------------- Sperrbildschirm & Themes */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-wrap .page { width: 100%; max-width: 600px; }
.gate-top { margin-bottom: 14px; }
.gate-top .logo { padding: 0; }
.theme-btn { font-size: 18px; line-height: 1; padding: 6px 10px; }

[data-theme='girly'] body {
  background:
    radial-gradient(1100px 560px at 85% -10%, rgba(241, 91, 181, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(155, 93, 229, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme='girly'] h1, [data-theme='girly'] h2, [data-theme='girly'] h3 { font-weight: 800; letter-spacing: 0; }
[data-theme='girly'] .hero {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(155, 93, 229, 0.18), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(241, 91, 181, 0.2), transparent 60%),
    linear-gradient(135deg, var(--panel-2), var(--panel));
}
[data-theme='girly'] .gradient-text { background-image: linear-gradient(90deg, #f15bb5, #e0428f, #9b5de5); }
[data-theme='girly'] .logo-mark, [data-theme='girly'] .level-badge { background: linear-gradient(135deg, #f15bb5, #9b5de5); }
[data-theme='girly'] .logo-text b { color: var(--accent); }
[data-theme='girly'] .modal-back { background: rgba(74, 18, 56, 0.35); }
[data-theme='girly'] .sidebar-foot::after { content: ' ✿'; color: var(--accent); }
