:root {
  --bg: #121014;
  --surface: #1c1920;
  --surface-2: #26222b;
  --line: #34303a;
  --text: #f4f1f7;
  --muted: #a39dab;
  --lime: #c3ff3d;
  --lime-ink: #1a2400;
  --violet: #9b6bff;
  --red: #ff5a6e;
  --green: #4ade80;
  --radius: 18px;
  --tabbar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, sans-serif; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
h1, h2, h3, .display { font-family: 'Space Grotesk', Inter, sans-serif; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Layout: bottom tabs on phone, sidebar on desktop */
main { padding: calc(16px + var(--safe-t)) 16px calc(var(--tabbar) + var(--safe-b) + 96px); max-width: 760px; margin: 0 auto; }
.tabs { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(18,16,20,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabs a.active { color: var(--lime); }
.brand { display: none; }
@media (min-width: 900px) {
  .tabs { top: 0; right: auto; width: 230px; height: auto; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 24px 14px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
  .tabs a.active { background: var(--surface-2); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font: 700 20px 'Space Grotesk', sans-serif; }
  .brand img { width: 40px; height: 40px; border-radius: 12px; }
  main { margin-left: 230px; max-width: none; padding: 40px max(48px, calc((100vw - 230px - 900px) / 2)); }
}

/* Generic pieces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 900px) { .grid-desk { grid-template-columns: 1fr 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.btn.violet { background: var(--violet); color: #fff; border-color: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--lime)); border-radius: inherit; transition: width .4s; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 -2px; }
input.field, textarea.field, select.field { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; outline: none; }
input.field:focus, textarea.field:focus { border-color: var(--violet); }
textarea.field { min-height: 160px; resize: vertical; font: 13px/1.5 ui-monospace, monospace; }

/* Home */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 22px; min-height: 210px;
  background: linear-gradient(180deg, rgba(18,16,20,.1), rgba(18,16,20,.85)), url(/img/hero.jpg) center/cover; border: 1px solid var(--line); }
.hero .mascot { position: absolute; right: -24px; bottom: -14px; width: 170px; mix-blend-mode: lighten;
  -webkit-mask: radial-gradient(closest-side, #000 70%, transparent); mask: radial-gradient(closest-side, #000 70%, transparent); }
.hero h1 { max-width: 62%; }
.hero .row { margin-top: 14px; flex-wrap: wrap; gap: 8px; max-width: 70%; }
.quickstart { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 22px;
  border-radius: 24px; background: var(--lime); color: var(--lime-ink); text-align: left; box-shadow: 0 10px 40px -12px rgba(195,255,61,.55); }
.quickstart b { font: 700 24px 'Space Grotesk', sans-serif; }
.quickstart .go { position: absolute; right: 20px; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 50%;
  background: var(--lime-ink); color: var(--lime); display: grid; place-items: center; font-size: 22px; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font: 700 15px 'Space Grotesk', sans-serif; }
.stat { display: grid; gap: 2px; }
.stat b { font: 700 24px 'Space Grotesk', sans-serif; }

/* Learning path */
.path { position: relative; border-radius: 24px; overflow: hidden; padding: 30px 0 60px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,16,20,.55), rgba(18,16,20,.9)), url(/img/map.jpg) center top/cover; }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; margin: 0 auto 28px; text-align: center; }
.node:nth-child(4n+2) { translate: 70px; } .node:nth-child(4n+4) { translate: -70px; }
.node .disc { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font: 700 26px 'Space Grotesk', sans-serif;
  background: var(--lime); color: var(--lime-ink); box-shadow: 0 7px 0 #7ea51e, 0 0 30px rgba(195,255,61,.35); }
.node.done .disc { background: var(--violet); color: #fff; box-shadow: 0 7px 0 #5b3bb0, 0 0 30px rgba(155,107,255,.4); }
.node.locked .disc { background: var(--surface-2); color: var(--muted); box-shadow: 0 7px 0 #0c0b0d; }
.node .label { font-weight: 600; font-size: 14px; line-height: 1.25; text-shadow: 0 2px 8px #000; }
.node.boss-end .disc { width: 96px; height: 96px; background: url(/img/boss.jpg) center/150%; box-shadow: 0 7px 0 #7a1b2a, 0 0 40px rgba(255,90,110,.5); }

/* Bottom sheet + overlay */
#overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 22px 18px calc(22px + var(--safe-b)); border: 1px solid var(--line); animation: up .25s ease-out; }
@media (min-width: 900px) { #overlay { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* Quiz player */
.player { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
  padding: calc(14px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
.player-inner { width: 100%; max-width: 620px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.player-top { display: flex; align-items: center; gap: 12px; }
.player-top .bar { flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: var(--muted); flex: none; }
.hearts { font-size: 18px; letter-spacing: 2px; }
.timer { font: 700 15px 'Space Grotesk', sans-serif; min-width: 48px; text-align: right; }
.timer.low { color: var(--red); }
.q-area { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; }
.q-kind { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }
.q-prompt { font: 600 21px/1.35 'Space Grotesk', sans-serif; }
.option { width: 100%; text-align: left; padding: 15px 16px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font-weight: 500; }
.option.correct { border-color: var(--green); background: rgba(74,222,128,.12); }
.option.wrong { border-color: var(--red); background: rgba(255,90,110,.12); }
.feedback { border-radius: 16px; padding: 14px 16px; border: 1px solid; animation: up .2s ease-out; }
.feedback.ok { border-color: rgba(74,222,128,.5); background: rgba(74,222,128,.08); }
.feedback.bad { border-color: rgba(255,90,110,.5); background: rgba(255,90,110,.08); }
.feedback b { display: block; margin-bottom: 4px; }
.cloze-input { display: inline-block; min-width: 120px; width: 50%; margin: 2px 4px; padding: 4px 10px; border-radius: 10px;
  background: var(--surface-2); border: 2px dashed var(--violet); outline: none; font: inherit; }

/* Speed swipe */
.swipe-stage { flex: 1; display: grid; place-items: center; position: relative; min-height: 300px; }
.swipe-card { width: 100%; max-width: 420px; min-height: 280px; padding: 26px; border-radius: 26px; display: flex; flex-direction: column;
  justify-content: center; gap: 14px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  box-shadow: 0 20px 50px -20px #000; touch-action: none; user-select: none; cursor: grab; }
.swipe-card .stamp { position: absolute; top: 22px; padding: 4px 12px; border: 3px solid; border-radius: 10px; font: 700 20px 'Space Grotesk';
  opacity: 0; text-transform: uppercase; }
.swipe-card .stamp.yes { right: 22px; color: var(--green); rotate: 12deg; }
.swipe-card .stamp.no { left: 22px; color: var(--red); rotate: -12deg; }
.swipe-hint { display: flex; justify-content: space-between; gap: 12px; }
.swipe-hint .btn { flex: 1; }

/* Results */
.result { text-align: center; display: grid; gap: 14px; justify-items: center; padding-top: 6vh; }
.result img { width: 200px; border-radius: 24px; }
.boss-img { width: 100%; max-height: 160px; object-fit: cover; object-position: center 15%; border-radius: 18px; }

/* Wissen */
.search { position: sticky; top: calc(8px + var(--safe-t)); z-index: 5; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); }
.sheet-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.sheet-list.formula li { font-family: ui-monospace, monospace; font-size: 14px; }
mark { background: rgba(195,255,61,.3); color: inherit; border-radius: 3px; }
.empty { text-align: center; padding: 30px 10px; display: grid; gap: 12px; justify-items: center; }
.empty img { width: 140px; border-radius: 20px; }

#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); translate: -50% 0; padding: 12px 18px;
  border-radius: 14px; background: var(--violet); color: #fff; font-weight: 600; box-shadow: 0 10px 30px -10px #000; animation: up .2s; max-width: 90vw; }
.login { min-height: 80dvh; display: grid; place-items: center; }
.login .card { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; }
.login img { width: 140px; margin: 0 auto; border-radius: 24px; }

/* Eulen-Chat */
.owl-fab { position: fixed; z-index: 15; right: 16px; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); width: 60px; height: 60px;
  border-radius: 50%; overflow: hidden; border: 2px solid var(--lime); box-shadow: 0 8px 30px -6px rgba(195,255,61,.5); background: var(--surface); }
.owl-fab img { width: 100%; height: 100%; object-fit: cover; }
.tabs[hidden] ~ .owl-fab { display: none; }
@media (min-width: 900px) { .owl-fab { bottom: 28px; right: 28px; width: 68px; height: 68px; } }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble.owl { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bubble ul, .bubble-owl ul { margin: 4px 0; padding-left: 20px; }
.bubble.typing { color: var(--muted); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.bubble-owl { margin-top: 8px; font-size: 15px; border-color: var(--violet); }
.chat-input { display: flex; align-items: flex-end; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.chat-input textarea { flex: 1; resize: none; border: 0; outline: none; background: none; padding: 10px 4px; max-height: 160px; font-size: 16px; }
.chat-input .send { background: var(--lime); color: var(--lime-ink); border-radius: 50%; font-size: 18px; }
.chat-input .attach { cursor: pointer; }
.new-banner { border-color: var(--lime); }

/* Kurse im Lernpfad */
details.course > summary { list-style: none; cursor: pointer; }
details.course > summary::-webkit-details-marker { display: none; }
details.course[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.course .path { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

/* Thema erklären + Fachbegriffe */
.topic-card { border-color: var(--violet); background: linear-gradient(120deg, rgba(155,107,255,.18), var(--surface) 60%); }
.topic-owl { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin: 0 auto; border: 2px solid var(--violet); }
.topic-owl.thinking { animation: pulse 1.4s infinite; }
.audio-card { display: flex; align-items: center; gap: 14px; }
.audio-card .play { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: 20px; font-weight: 700; }
.term-card { padding: 26px 20px; border-radius: 22px; text-align: center; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.term-card h1 { margin-top: 6px; }
.explain-box { position: relative; }
.explain-box textarea { min-height: 140px; padding-right: 56px; font: 16px/1.5 Inter, sans-serif; }
.explain-box .mic { position: absolute; right: 6px; bottom: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }
.explain-box .mic.rec { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
.feedback.part { border-color: rgba(250,204,21,.5); background: rgba(250,204,21,.08); }
.model-answer { margin-top: 10px; border-color: var(--violet); }

/* ---------- Karteikarten-Design ---------- */
.player { background: radial-gradient(120% 60% at 50% -10%, rgba(155,107,255,.18), transparent 60%), var(--bg); }
.player-top .bar { height: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.player-top .bar > i { box-shadow: 0 0 14px rgba(195,255,61,.6); }
.qcard { position: relative; padding: 22px 20px 24px; border-radius: 26px; overflow: hidden;
  background: linear-gradient(155deg, #2c2733 0%, #1d1a21 55%, #18161b 100%);
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 18px 40px -22px #000, inset 0 1px 0 rgba(255,255,255,.06); }
.qcard::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--violet), var(--lime)); }
.qcard .q-prompt { font-size: 22px; line-height: 1.4; margin-top: 12px; }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qtype { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
.qchip { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.qcard.pop { animation: pop .35s ease-out; border-color: rgba(74,222,128,.6); }
.qcard.shake { animation: shake .4s; border-color: rgba(255,90,110,.6); }
@keyframes pop { 40% { transform: scale(1.025); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface);
  border: 2px solid var(--line); transition: transform .12s, border-color .15s, background .15s; line-height: 1.4; }
.option:not(:disabled):hover { border-color: var(--violet); }
.option:not(:disabled):active { transform: scale(.98); }
.option .letter { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font: 700 15px 'Space Grotesk', sans-serif; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.option.correct { border-color: var(--green); background: rgba(74,222,128,.12); animation: pop .35s; }
.option.correct .letter { background: var(--green); color: #052e12; border-color: transparent; }
.option.wrong { border-color: var(--red); background: rgba(255,90,110,.12); }
.option.wrong .letter { background: var(--red); color: #fff; border-color: transparent; }
.option:disabled:not(.correct):not(.wrong) { opacity: .55; }

.swipe-card { min-height: 320px; justify-content: space-between; }
.swipe-card .q-prompt { flex: 1; display: flex; align-items: center; font-size: 24px; }
.swipe-help { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.swipe-card .stamp { top: 46px; z-index: 1; background: rgba(18,16,20,.85); }
.swipe-hint .btn:first-child { border-color: rgba(255,90,110,.45); }
.swipe-hint .btn:last-child { border-color: rgba(74,222,128,.45); }

.cloze-input { border: 0; border-bottom: 3px solid var(--violet); border-radius: 10px 10px 4px 4px; background: rgba(155,107,255,.12);
  padding: 4px 12px; min-width: 140px; font-weight: 600; color: var(--lime); }
.cloze-input:focus { background: rgba(155,107,255,.22); }
.cloze-input:disabled { opacity: 1; }

.feedback { border-radius: 20px; padding: 16px 18px; }
.next-rep { display: inline-flex; margin-top: 10px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(155,107,255,.16); color: #d8c8ff; animation: up .25s ease-out; }
.term-card { text-align: center; }
.term-card .qchip { display: inline-block; max-width: 90%; }
.term-card h1 { font-size: 30px; margin: 14px 0 8px; }

/* Gedächtnis-Übersicht */
.memory { display: grid; gap: 12px; }
.membar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.membar i { display: block; min-width: 6px; }
.memlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.memlegend b { color: var(--text); }
.q-area > * { flex-shrink: 0; }

/* Belohnungen */
.treasure { border-color: #ffcf5a55; background: linear-gradient(120deg, rgba(255,207,90,.14), var(--surface) 60%); }
.btn.gift { background: linear-gradient(90deg, #ffcf5a, var(--lime)); color: var(--lime-ink); border: 0; animation: pulse 1.4s infinite; }
.reward-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(10,8,12,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; }
.reward-box { position: relative; z-index: 1; width: 100%; max-width: 520px; display: grid; gap: 14px; text-align: center; animation: up .3s ease-out; }
.reward-media { border-radius: 24px; overflow: hidden; border: 2px solid var(--lime); box-shadow: 0 0 60px -10px rgba(195,255,61,.5); background: #000; }
.reward-media img, .reward-media video { display: block; width: 100%; max-height: 62dvh; object-fit: contain; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 15px; background: var(--c); border-radius: 2px;
  animation: fall var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }
.treasure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 900px) { .treasure-grid { grid-template-columns: repeat(5, 1fr); } }
.tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 0; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.locked { font-size: 22px; color: var(--muted); }
.tile-play { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.6); font-size: 11px; }

/* Spiele */
.daily { text-align: left; display: grid; gap: 4px; padding: 16px; }
.daily-ico { font-size: 28px; }
.riddle-card::before { background: linear-gradient(90deg, #ffcf5a, var(--lime)); }
.pairs { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; }
.pairs .col { display: grid; gap: 8px; align-content: start; }
.ptile { padding: 10px 11px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font-size: 13.5px; line-height: 1.35; text-align: left; transition: transform .1s, opacity .3s; }
.ptile.term { font-weight: 700; font-family: 'Space Grotesk', sans-serif; font-size: 14.5px; }
.ptile.sel { border-color: var(--violet); background: rgba(155,107,255,.16); }
.ptile.done { border-color: var(--green); background: rgba(74,222,128,.12); opacity: .45; pointer-events: none; }
.ptile.miss, .chip.miss { animation: shake .4s; border-color: var(--red); }
.slots { display: grid; gap: 8px; margin: 0; padding-left: 26px; }
.slot { min-height: 46px; border-radius: 14px; border: 2px dashed var(--line); padding: 10px 12px; color: var(--muted); }
.slot.filled { border-style: solid; border-color: var(--green); background: rgba(74,222,128,.1); color: var(--text); font-weight: 600; animation: pop .3s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--line); font-weight: 600; font-size: 14px; }
.chip:active { transform: scale(.96); }
.replay { margin-left: 4px; font-size: 14px; opacity: .7; }
.grade { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font: 700 48px 'Space Grotesk', sans-serif; }
.grade.pass { background: radial-gradient(circle, rgba(195,255,61,.25), transparent 70%); color: var(--lime); border: 3px solid var(--lime); }
.grade.fail { background: radial-gradient(circle, rgba(255,90,110,.2), transparent 70%); color: var(--red); border: 3px solid var(--red); }
.podcast-card { display: flex; gap: 14px; align-items: center; }
.podcast-card img { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; flex: none; }
audio { width: 100%; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stage { display: grid; gap: 2px; justify-items: center; text-align: center; font-size: 10.5px; color: var(--muted); filter: grayscale(1) brightness(.5); }
.stage.on { filter: none; color: var(--text); }
.stage img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 2px solid var(--line); }
.stage.on img { border-color: var(--lime); }
.stage b { font-size: 11px; line-height: 1.2; }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 900px) { .badges { grid-template-columns: repeat(4, 1fr); } }
.badge { display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); opacity: .45; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; border-color: #ffcf5a77; background: linear-gradient(150deg, rgba(255,207,90,.12), var(--surface)); }
.badge span { font-size: 26px; }
.badge small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.pairs { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.ptile { overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }

/* ---------- Arena ---------- */
.arena { gap: 16px; }
.arena-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; min-height: 170px; padding: 20px; border-radius: 26px;
  background: radial-gradient(120% 120% at 100% 50%, rgba(255,90,110,.35), transparent 55%), linear-gradient(135deg, #2a1d3d, #18151c 70%);
  border: 1px solid rgba(255,255,255,.08); }
.arena-hero > div { position: relative; z-index: 1; flex: 1; }
.arena-hero h1 { font-size: 24px; max-width: 220px; margin: 4px 0 12px; }
.arena-hero img { position: absolute; right: -40px; bottom: -10px; width: 200px; height: 200px; object-fit: cover; object-position: center 20%;
  border-radius: 50%; opacity: .85; -webkit-mask: radial-gradient(closest-side, #000 60%, transparent); mask: radial-gradient(closest-side, #000 60%, transparent); }
.ah-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ff9aa8; }
.ah-stats { flex-wrap: wrap; gap: 6px; max-width: 230px; }
.ah-stats .pill { background: rgba(0,0,0,.35); font-size: 13px; padding: 5px 10px; }

.chapter-pick { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); }
.chapter-pick select { flex: 1; appearance: none; -webkit-appearance: none; background: none; border: 0; outline: none; font-weight: 600; padding: 14px 0; min-width: 0; }
.chapter-pick .caret { color: var(--muted); pointer-events: none; }

.arena-h { font-size: 17px; margin: 6px 2px -4px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick, .game { position: relative; overflow: hidden; display: grid; gap: 3px; align-content: end; text-align: left; min-height: 118px; padding: 14px;
  border-radius: 22px; border: 1px solid rgba(255,255,255,.08); transition: transform .12s; }
.quick:active, .game:active, .challenge:active, .grave-card:active { transform: scale(.97); }
.quick b, .game b { font: 700 16px 'Space Grotesk', sans-serif; }
.quick small, .game small { color: rgba(255,255,255,.7); font-size: 12.5px; line-height: 1.3; }
.q-ico, .g-ico { position: absolute; top: 12px; left: 12px; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; background: rgba(0,0,0,.25); }
.game { min-height: 150px; }
.game .g-ico { width: 52px; height: 52px; font-size: 28px; }
.quick.violet { background: linear-gradient(150deg, #5b3bb0, #2b2140); }
.quick.lime { background: linear-gradient(150deg, #5d7a12, #232b14); }
.quick.amber { background: linear-gradient(150deg, #a8681c, #2d2216); }
.quick.pink { background: linear-gradient(150deg, #a3306b, #2c1825); }
.game.blue { background: linear-gradient(150deg, #2463c4, #17213a); }
.game.green { background: linear-gradient(150deg, #14866b, #142a24); }

.challenge { position: relative; overflow: hidden; display: flex; align-items: center; text-align: left; min-height: 112px; padding: 16px; border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08); transition: transform .12s; }
.challenge .ch-text { position: relative; z-index: 1; max-width: 66%; display: grid; gap: 4px; }
.challenge h3 { font-size: 17px; }
.challenge p { font-size: 13px; color: rgba(255,255,255,.75); line-height: 1.35; }
.ch-go { margin-top: 4px; justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); }
.challenge img { position: absolute; right: -14px; top: 50%; translate: 0 -50%; width: 136px; height: 136px; object-fit: cover; border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, #000 62%, transparent); mask: radial-gradient(closest-side, #000 62%, transparent); }
.challenge.gold { background: linear-gradient(120deg, #6b4a12, #241c12 70%); border-color: #ffcf5a55; }
.challenge.violet { background: linear-gradient(120deg, #47307f, #1d1828 70%); }
.challenge.teal { background: linear-gradient(120deg, #155e63, #142224 70%); }

.grave-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.grave-card .g-ico { position: static; }
.grave-card b { display: block; font: 700 16px 'Space Grotesk', sans-serif; }
.grave-card small { color: var(--muted); }
.grave-card.has { border-color: rgba(255,90,110,.5); background: linear-gradient(120deg, rgba(255,90,110,.16), var(--surface) 70%); }
.grave-card .count { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; }
.arena > * { min-width: 0; }
.chapter-pick select { width: 100%; text-overflow: ellipsis; }
.quick-grid, .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.arena-hero img { width: 165px; height: 165px; right: -36px; opacity: .7; }
.arena-hero > div { max-width: 72%; }
.quick { min-height: 132px; }
@media (min-width: 900px) { .arena-hero img { width: 230px; height: 230px; right: 10px; opacity: .9; } .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Wissen ---------- */
.wissen > * { min-width: 0; }
.wissen-hero { display: flex; align-items: center; gap: 12px; padding: 20px; border-radius: 26px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(155,107,255,.35), transparent 55%), linear-gradient(135deg, #221b33, #17151b 70%);
  border: 1px solid rgba(255,255,255,.08); }
.wissen-hero > div { flex: 1; }
.wissen-hero h1 { margin: 4px 0 12px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.search-box:focus-within { border-color: var(--violet); }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 14px 0; font-size: 16px; }
.course-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.course-chips::-webkit-scrollbar { display: none; }
.cchip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cchip i, .course-h i { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); }
.cchip.on { color: var(--text); border-color: var(--tone, var(--lime)); background: color-mix(in srgb, var(--tone, var(--lime)) 18%, var(--surface)); }
.violet { --tone: #9b6bff; } .lime { --tone: #c3ff3d; } .amber { --tone: #f5b84d; } .pink { --tone: #ff6fae; } .blue { --tone: #5aa2ff; } .teal { --tone: #3fd0c0; }
.course-h { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 10px 2px -4px; }
.course-h span { margin-left: auto; font: 600 12px Inter, sans-serif; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: var(--surface); }

.kcard { position: relative; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.kcard::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.kcard[open] { border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.kcard > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; }
.kcard > summary::-webkit-details-marker { display: none; }
.k-head { flex: 1; min-width: 0; display: grid; gap: 8px; }
.k-head h3 { font-size: 16px; line-height: 1.3; }
.k-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.k-bar { flex: 1; max-width: 140px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.k-bar i { display: block; height: 100%; background: var(--tone); border-radius: inherit; }
.k-chev { font-size: 22px; color: var(--muted); transition: transform .2s; }
.kcard[open] .k-chev { transform: rotate(90deg); }
.k-body { display: grid; gap: 14px; padding: 0 16px 16px 20px; }
.k-body h4 { font: 700 13px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.owl-says { display: flex; gap: 12px; align-items: flex-start; }
.owl-says img { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--tone); }
.owl-says p { position: relative; padding: 14px 16px; border-radius: 6px 18px 18px 18px; background: var(--surface-2); line-height: 1.6; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; line-height: 1.5; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #14110f; background: var(--tone); }
.formula { font-family: ui-monospace, monospace; font-size: 13.5px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: #0f0d12; border: 1px solid var(--line); }
.notes { display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: #3a3218; border: 1px solid #ffcf5a44; color: #ffe9b0; line-height: 1.5; transform: rotate(-.4deg); }
.note:nth-child(even) { transform: rotate(.4deg); }
.trap { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(245,184,77,.1); border: 1px solid rgba(245,184,77,.35); line-height: 1.5; }
.k-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.k-actions .btn { min-height: 42px; padding: 0 8px; font-size: 13.5px; }
@media (min-width: 900px) { .course-chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; } }
.k-body .seg button { white-space: nowrap; font-size: 12.5px; padding: 9px 4px; }

/* Upload */
.upload-card { padding: 16px; border-color: color-mix(in srgb, var(--lime) 35%, var(--line)); }
.dropzone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 14px; border-radius: 18px; border: 2px dashed var(--line);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 8%, var(--surface-2)); }
.dz-ico { font-size: 30px; }
.dropzone small { color: var(--muted); }
.ufile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ufile > span:first-child { font-size: 22px; }
.ufile b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ufile small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ufile.ok { border-color: rgba(74,222,128,.5); } .ufile.err { border-color: rgba(255,90,110,.5); } .ufile.err small { color: #ff9aa8; }
.ufile.busy { border-color: var(--violet); animation: pulse 1.4s infinite; }
.ustate { font-size: 18px; }
textarea.write { min-height: 200px; font: 15px/1.55 Inter, sans-serif; }
.upload-card > *, .upload-card .stack > *, .sheet .stack > * { min-width: 0; }
.upload-card select { width: 100%; }
/* visually hidden but still "there" – iOS only opens file pickers for inputs that are rendered */
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.dropzone, .chat-input .attach { position: relative; }
button.dropzone { width: 100%; color: inherit; font: inherit; }
/* the real file input lies invisibly over the whole tap area: works in every browser without scripted clicks */
.dropzone, .chat-input .attach { position: relative; overflow: hidden; }
input.cover { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 200px; z-index: 2; }

/* ---------- Notizen ---------- */
.notes > * { min-width: 0; }
.notes-hero { background: radial-gradient(120% 140% at 100% 0%, rgba(63,208,192,.3), transparent 55%), linear-gradient(135deg, #17282a, #16151a 70%); }
.note-card { display: grid; gap: 6px; text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.note-card:active { transform: scale(.98); }
.nc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.nc-top h3 { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-top span { flex: none; }
.nc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.nc-tags span { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.note-title { width: 100%; background: none; border: 0; outline: none; font: 700 24px 'Space Grotesk', sans-serif; color: var(--text); padding: 4px 0; }
.note-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tool { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 20px; }
.tool span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tool.rec.on, .tool.rec.on span { background: var(--red); color: #fff; border-color: var(--red); }
.tool.rec { border-color: rgba(255,90,110,.45); }
.recbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255,90,110,.12); border: 1px solid rgba(255,90,110,.5); }
.recbar .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
.recbar b { font: 700 18px 'Space Grotesk', sans-serif; }
.note-body { width: 100%; min-height: 42dvh; resize: vertical; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  color: var(--text); font: 16px/1.6 Inter, sans-serif; outline: none; }
.note-body:focus { border-color: #3fd0c0; }
.rec-row { display: flex; align-items: center; gap: 8px; }
.rec-row audio { flex: 1; min-width: 0; height: 40px; }
.nh, .note-summary h4 { font: 700 13px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.note-summary { --tone: #3fd0c0; border-color: rgba(63,208,192,.45); }
.term-row { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.term-row span { font-size: 14px; color: var(--muted); }
@media (max-width: 899px) { .tabs a span { font-size: 10.5px; } }
