:root {
  --ink: #13242C;
  --ink-soft: #4A6470;
  --scrub: #0E5A6B;
  --scrub-deep: #0A4351;
  --paper: #EEF4F5;
  --card: #FFFFFF;
  --line: #CFDDE1;
  --mint: #19B985;
  --mint-bg: #DDF7EC;
  --coral: #E5484D;
  --coral-bg: #FDE4E4;
  --amber: #F5A524;
  --amber-bg: #FFF1D6;
  --trace-off: #B9CCD2;
  --shadow: 0 2px 0 rgba(19, 36, 44, .14);
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E3F1F3; --ink-soft: #95B3BC; --scrub: #4FC3D6; --scrub-deep: #2A9DB1;
    --paper: #0A1C22; --card: #11272F; --line: #22414B;
    --mint: #2BD99F; --mint-bg: #0F3A2E; --coral: #FF6B6E; --coral-bg: #3D1719;
    --amber: #FFC048; --amber-bg: #3A2B0C; --trace-off: #2A4954; --shadow: 0 2px 0 rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E3F1F3; --ink-soft: #95B3BC; --scrub: #4FC3D6; --scrub-deep: #2A9DB1;
  --paper: #0A1C22; --card: #11272F; --line: #22414B;
  --mint: #2BD99F; --mint-bg: #0F3A2E; --coral: #FF6B6E; --coral-bg: #3D1719;
  --amber: #FFC048; --amber-bg: #3A2B0C; --trace-off: #2A4954; --shadow: 0 2px 0 rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn { border: 0; border-radius: var(--r-md); padding: 14px 20px; font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  background: var(--scrub); color: #fff; box-shadow: 0 4px 0 var(--scrub-deep); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--scrub-deep); }
.btn[disabled] { background: var(--line); color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--scrub); box-shadow: inset 0 0 0 2px var(--line); }
.btn.good { background: var(--mint); box-shadow: 0 4px 0 #0E8A62; color: #06261B; }
.btn.bad { background: var(--coral); box-shadow: 0 4px 0 #A72A2E; }
.link { background: none; border: 0; color: var(--scrub); font-weight: 700; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { margin-bottom: 28px; }
.auth-hero svg { width: 100%; height: 90px; display: block; }
.auth-hero h1 { font-size: clamp(2.4rem, 9vw, 3.4rem); font-weight: 800; color: var(--scrub); }
.auth-hero p { color: var(--ink-soft); margin: 6px 0 0; font-size: 1.05rem; }
.tabs { display: flex; gap: 6px; background: var(--card); padding: 5px; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 11px; font-weight: 700; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { background: var(--scrub); color: #fff; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field input, .field select { width: 100%; padding: 13px 14px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
.field input:focus { border-color: var(--scrub); outline: none; }
.err { color: var(--coral); font-weight: 700; min-height: 1.5em; margin: 0 0 10px; }
.guest { text-align: center; margin-top: 14px; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--scrub); display: flex; align-items: center; gap: 8px; margin-right: auto; }
.brand svg { width: 30px; height: 30px; }
.stat { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.stat svg { width: 22px; height: 22px; }
.stat.streak { color: var(--coral); }
.stat.xp { color: var(--amber); }
.stat.streak.cold { color: var(--ink-soft); }
main { padding: 18px 16px 110px; max-width: 760px; width: 100%; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--ink-soft); font-size: .78rem; font-weight: 700; padding: 6px 10px; border-radius: 12px; min-width: 64px; }
.nav button svg { width: 26px; height: 26px; }
.nav button[aria-current="page"] { color: var(--scrub); background: color-mix(in srgb, var(--scrub) 12%, transparent); }
.side { display: none; }
.nav .brand { display: none; }

@media (min-width: 1000px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; }
  .topbar .stat.streak { margin-left: auto; }
  .nav { position: sticky; top: 0; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 6px; border-top: 0; border-right: 1px solid var(--line); padding: 20px 14px; grid-row: 1 / span 2; }
  .nav .brand { display: flex; margin: 0 0 20px 8px; }
  .nav button { flex-direction: row; gap: 14px; font-size: 1rem; padding: 12px 14px; justify-content: flex-start; }
  .topbar { grid-column: 2 / span 2; }
  .topbar .brand { display: none; }
  main { grid-column: 2; padding-bottom: 40px; }
  .side { display: block; grid-column: 3; padding: 18px 20px 18px 0; }
  .side > * { position: sticky; top: 80px; }
}

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 1.1rem; margin-bottom: 10px; }
.goal-bar { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: var(--amber); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.level-row { white-space: nowrap; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.level-name { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--scrub); }

/* ---------- Path (EKG) ---------- */
.unit { margin: 6px 0 34px; }
.unit-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 4px; }
.unit-num { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: .9; color: var(--trace-off); min-width: 2ch; }
.unit.active .unit-num { color: var(--scrub); }
.unit-head h2 { font-size: 1.35rem; }
.unit-head p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-soft); }
.strip { position: relative; height: 128px; }
.strip svg.trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace path { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.trace .off { stroke: var(--trace-off); }
.trace .on { stroke: var(--mint); }
.trace .blip { fill: var(--mint); filter: drop-shadow(0 0 6px var(--mint)); }
.node { position: absolute; top: 14px; transform: translateX(-50%); width: 58px; height: 58px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 3px var(--trace-off), 0 4px 0 var(--line); color: var(--ink-soft); }
.node svg { width: 26px; height: 26px; }
.node.done { background: var(--mint); color: #06261B; box-shadow: 0 4px 0 #0E8A62; }
.node.current { background: var(--scrub); color: #fff; box-shadow: 0 4px 0 var(--scrub-deep), 0 0 0 6px color-mix(in srgb, var(--scrub) 22%, transparent); }
.node.current { animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 30%, 100% { transform: translateX(-50%) scale(1); } 10% { transform: translateX(-50%) scale(1.12); } 20% { transform: translateX(-50%) scale(.97); } }
.node.locked { cursor: not-allowed; opacity: .75; }
.node .stars { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; letter-spacing: 1px; color: var(--amber); white-space: nowrap; }
.node-label { position: absolute; top: 96px; transform: translateX(-50%); font-size: .72rem; color: var(--ink-soft); text-align: center; width: 84px; line-height: 1.2; }
@media (max-width: 520px) { .node-label { display: none; } }

.unit-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }

/* popover for lesson start */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(5, 18, 22, .45); z-index: 20; display: grid; align-items: end; justify-items: center; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } }
.sheet { background: var(--card); width: 100%; max-width: 480px; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px 20px max(22px, env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .sheet { border-radius: var(--r-lg); } }
.sheet h2 { font-size: 1.5rem; margin-bottom: 4px; }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; }
.sheet .row .btn { flex: 1; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* ---------- Lesson ---------- */
.lesson { min-height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.lesson-top { display: flex; align-items: center; gap: 14px; padding: max(14px, env(safe-area-inset-top)) 0 14px; }
.x { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.x svg { width: 24px; height: 24px; }
.progress { flex: 1; height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--mint); border-radius: 99px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.lives { display: flex; gap: 3px; color: var(--coral); }
.lives svg { width: 22px; height: 22px; }
.lives svg.lost { color: var(--line); }
.combo { font-family: var(--display); font-weight: 800; color: var(--amber); font-size: .95rem; min-height: 1.4em; text-align: right; }
.q-area { flex: 1; padding: 6px 0 24px; }
.q-kind { font-weight: 700; color: var(--scrub); font-size: .95rem; margin-bottom: 8px; }
.q-text { font-family: var(--display); font-weight: 700; font-size: clamp(1.25rem, 4.6vw, 1.6rem); margin-bottom: 22px; }
.q-text .gap { display: inline-block; min-width: 5ch; border-bottom: 3px solid var(--scrub); color: var(--scrub); }
.opts { display: grid; gap: 10px; }
@media (min-width: 640px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt { text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: var(--r-md); padding: 14px 16px; font-size: 1.02rem; box-shadow: 0 3px 0 var(--line); display: flex; gap: 12px; align-items: flex-start; }
.opt kbd { font-family: var(--display); font-size: .8rem; font-weight: 800; border: 2px solid var(--line); border-radius: 7px; min-width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-soft); flex: none; }
.opt[aria-pressed="true"] { border-color: var(--scrub); background: color-mix(in srgb, var(--scrub) 10%, var(--card)); box-shadow: 0 3px 0 var(--scrub); }
.opt[aria-pressed="true"] kbd { border-color: var(--scrub); color: var(--scrub); }
.opt.right { border-color: var(--mint); background: var(--mint-bg); box-shadow: 0 3px 0 var(--mint); }
.opt.wrong { border-color: var(--coral); background: var(--coral-bg); box-shadow: 0 3px 0 var(--coral); }
.opt[disabled] { cursor: default; }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf .opt { justify-content: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem; padding: 22px 10px; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pairs .col { display: grid; gap: 10px; align-content: start; }
.pairs .opt { font-size: .95rem; padding: 12px; min-height: 56px; align-items: center; }
.pairs .opt.matched { opacity: .35; border-color: var(--mint); box-shadow: none; }
.pairs .opt.shake { animation: shake .3s; border-color: var(--coral); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.order-built { min-height: 64px; border-bottom: 2px dashed var(--line); padding: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.order-pool { display: flex; flex-direction: column; gap: 8px; }
.order-item { text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: var(--r-sm); padding: 10px 14px; box-shadow: 0 3px 0 var(--line); }
.order-built .order-item { border-color: var(--scrub); }
.order-item .n { font-family: var(--display); font-weight: 800; color: var(--scrub); margin-right: 8px; }
.lesson-foot { position: sticky; bottom: 0; padding: 14px 0 max(16px, env(safe-area-inset-bottom)); background: var(--paper); }
.feedback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.feedback.ok { background: var(--mint-bg); }
.feedback.no { background: var(--coral-bg); }
.feedback .inner { max-width: 720px; margin: 0 auto; }
.feedback h3 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.feedback.ok h3 { color: var(--mint); }
.feedback.no h3 { color: var(--coral); }
:root:not([data-theme="dark"]) .feedback.ok h3 { color: #0B7A55; }
.feedback h3 svg { width: 30px; height: 30px; }
.feedback p { margin: 6px 0 14px; max-height: 32vh; overflow: auto; }
.feedback .answer { font-weight: 700; }

/* ---------- Result ---------- */
.result { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.result-card { max-width: 440px; width: 100%; }
.result h1 { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; color: var(--scrub); margin: 10px 0 6px; }
.result svg.ekg { width: 100%; height: 80px; }
.result svg.ekg path { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.tile { border-radius: var(--r-md); border: 2px solid var(--line); overflow: hidden; background: var(--card); }
.tile b { display: block; font-family: var(--display); font-size: 1.5rem; padding: 10px 4px 2px; }
.tile span { display: block; font-size: .8rem; font-weight: 700; padding: 4px; color: #fff; }
.tile.a span { background: var(--amber); color: #3A2600; } .tile.a b { color: var(--amber); }
.tile.b span { background: var(--mint); color: #06261B; } .tile.b b { color: var(--mint); }
.tile.c span { background: var(--scrub); } .tile.c b { color: var(--scrub); }
.levelup { background: var(--amber-bg); border-radius: var(--r-md); padding: 12px; font-weight: 700; margin-bottom: 16px; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; }

/* ---------- Lists ---------- */
.board { list-style: none; padding: 0; margin: 0; }
.board li { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.board li.me { background: color-mix(in srgb, var(--scrub) 10%, transparent); border-radius: var(--r-sm); }
.board .pos { font-family: var(--display); font-weight: 800; width: 2ch; text-align: center; color: var(--ink-soft); }
.board li:nth-child(1) .pos { color: var(--amber); }
.board .who { flex: 1; font-weight: 700; }
.board .pts { font-family: var(--display); font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px; background: var(--card); }
.badge svg { width: 34px; height: 34px; color: var(--trace-off); }
.badge b { display: block; font-family: var(--display); margin-top: 6px; }
.badge small { color: var(--ink-soft); display: block; line-height: 1.3; margin-top: 2px; }
.badge.got { border-color: var(--amber); background: var(--amber-bg); }
.badge.got svg { color: var(--amber); }
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.statgrid div { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--card); }
.statgrid b { display: block; font-family: var(--display); font-size: 1.5rem; }
.page-title { font-size: 1.8rem; font-weight: 800; margin: 4px 0 6px; }
.page-sub { color: var(--ink-soft); margin: 0 0 20px; }
.empty { text-align: center; padding: 30px 10px; }
.empty svg { width: 120px; height: 60px; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 99px; z-index: 40; font-weight: 700; animation: up .2s; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Pflegebob ---------- */
:root { --bob-body: #43CDB2; --bob-scrubs: #0E5A6B; --bob-line: #13242C; --bob-cap: #EAF6FF; --dg-body: #D3E4E9; --dg-line: #9DB8C0;
  --zone: rgba(14, 90, 107, .10); --zone-stroke: rgba(14, 90, 107, .55); }
:root[data-theme="dark"] { --bob-scrubs: #2A9DB1; --dg-body: #1D3943; --dg-line: #3D6270; --zone: rgba(79, 195, 214, .12); --zone-stroke: rgba(79, 195, 214, .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bob-scrubs: #2A9DB1; --dg-body: #1D3943; --dg-line: #3D6270; --zone: rgba(79, 195, 214, .12); --zone-stroke: rgba(79, 195, 214, .6); } }
.bob-wrap { display: flex; align-items: center; gap: 12px; }
.bob { width: 84px; height: 92px; flex: none; overflow: visible; }
.bob-wrap.sm .bob { width: 58px; height: 64px; }
.bob-wrap.md .bob { width: 76px; height: 84px; }
.bob-wrap.lg { flex-direction: column; gap: 8px; }
.bob-wrap.lg .bob { width: 150px; height: 165px; }
.bob-wrap.hero .bob { width: 96px; height: 106px; }
.bob * { transform-box: view-box; }
.b-shadow { fill: var(--bob-line); opacity: .12; }
.b-body { fill: var(--bob-body); }
.b-scrubs { fill: var(--bob-scrubs); }
.b-neck { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; opacity: .85; }
.b-steth { fill: none; stroke: var(--bob-line); stroke-width: 2.6; stroke-linecap: round; }
.b-steth-head { fill: #C9D6DB; stroke: var(--bob-line); stroke-width: 2; }
.b-cap { fill: var(--bob-cap); stroke: #9CC7D6; stroke-width: 1.5; }
.b-heart { fill: #E5484D; }
.b-eye { fill: #fff; }
.b-pupil { fill: var(--bob-line); }
.b-glint { fill: #fff; }
.b-cheek { fill: #FF8FA3; opacity: .55; }
.b-line { fill: none; stroke: var(--bob-line); stroke-width: 3; stroke-linecap: round; }
.b-mouth { fill: var(--bob-line); }
.b-tongue { fill: #FF7A8A; }
.b-arm > path { fill: none; stroke: var(--bob-body); stroke-width: 9; stroke-linecap: round; }
/* Gegenstand in der Hand bleibt aufrecht, egal wie Bob den Arm bewegt */
.b-hand { transform-origin: 106px 106px; transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.bob[data-mood="happy"] .b-hand { transform: rotate(125deg); }
.bob[data-mood="sad"] .b-hand { transform: rotate(-12deg); }
.bob[data-mood="cheer"] .b-hand { animation: bob-hand-cheer .3s ease-in-out infinite alternate; }
.bob[data-mood="wave"] .b-hand { animation: bob-hand-wave 1.1s ease-in-out 3; }
@keyframes bob-hand-cheer { from { transform: rotate(110deg); } to { transform: rotate(150deg); } }
@keyframes bob-hand-wave { 0%, 100% { transform: rotate(130deg); } 50% { transform: rotate(160deg); } }
.b-arm-l { transform-origin: 24px 82px; transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.b-arm-r { transform-origin: 96px 82px; transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.b-all { transform-origin: 60px 124px; animation: bob-breathe 3.2s ease-in-out infinite; }
.e-happy, .e-sad, .mo-happy, .mo-sad { display: none; }
.e-idle { transform-origin: 60px 60px; animation: bob-blink 5s infinite; }
.bob[data-mood="happy"] .e-idle, .bob[data-mood="cheer"] .e-idle { display: none; }
.bob[data-mood="happy"] .e-happy, .bob[data-mood="cheer"] .e-happy { display: inline; }
.bob[data-mood="happy"] .mo-idle, .bob[data-mood="cheer"] .mo-idle, .bob[data-mood="wave"] .mo-idle { display: none; }
.bob[data-mood="happy"] .mo-happy, .bob[data-mood="cheer"] .mo-happy, .bob[data-mood="wave"] .mo-happy { display: inline; }
.bob[data-mood="sad"] .e-sad, .bob[data-mood="sad"] .mo-sad { display: inline; }
.bob[data-mood="sad"] .mo-idle { display: none; }
.bob[data-mood="sad"] .b-pupil { transform: translateY(2px); }
.bob[data-mood="happy"] .b-all { animation: bob-jump .55s cubic-bezier(.3,.7,.4,1) 2; }
.bob[data-mood="happy"] .b-arm-l { transform: rotate(125deg); }
.bob[data-mood="happy"] .b-arm-r { transform: rotate(-125deg); }
.bob[data-mood="cheer"] .b-all { animation: bob-jump .6s cubic-bezier(.3,.7,.4,1) 4; }
.bob[data-mood="cheer"] .b-arm-l { animation: bob-cheer-l .3s ease-in-out infinite alternate; }
.bob[data-mood="cheer"] .b-arm-r { animation: bob-cheer-r .3s ease-in-out infinite alternate; }
.bob[data-mood="wave"] .b-arm-r { animation: bob-wave 1.1s ease-in-out 3; }
.bob[data-mood="sad"] .b-all { animation: bob-droop .5s ease-out forwards; }
.bob[data-mood="sad"] .b-arm-l { transform: rotate(-12deg); }
.bob[data-mood="sad"] .b-arm-r { transform: rotate(12deg); }
@keyframes bob-breathe { 50% { transform: scale(1.025, .975); } }
@keyframes bob-blink { 0%, 45%, 49%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
@keyframes bob-jump { 0% { transform: translateY(0) scale(1.08, .9); } 40% { transform: translateY(-18px) scale(.95, 1.06); } 75% { transform: translateY(0) scale(1.06, .94); } 100% { transform: none; } }
@keyframes bob-cheer-l { from { transform: rotate(110deg); } to { transform: rotate(150deg); } }
@keyframes bob-cheer-r { from { transform: rotate(-110deg); } to { transform: rotate(-150deg); } }
@keyframes bob-wave { 0%, 100% { transform: rotate(-130deg); } 50% { transform: rotate(-160deg); } }
@keyframes bob-droop { to { transform: translateY(4px) rotate(-4deg) scale(1.02, .97); } }
.bubble { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; font-weight: 700; line-height: 1.35; max-width: 34ch; animation: pop .35s cubic-bezier(.3,1.5,.5,1) both .1s; }
.bubble::before { content: ''; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; background: var(--card); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.bob-wrap.lg .bubble::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.auth-hero .bob-wrap { margin-bottom: 14px; }
.coach { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin: 6px 0 26px; }
.coach .btn { flex: none; }
@media (max-width: 520px) { .coach .btn { width: 100%; } }
.fb-row { display: flex; gap: 12px; align-items: flex-start; }
.fb-row .bob-wrap { margin-top: -4px; }
.fb-text { flex: 1; min-width: 0; }
.result .bob-wrap.lg { margin: 0 auto; }
.result .bubble { margin: 0 auto; }

/* XP-Flug & Combo */
.xp-float { position: fixed; z-index: 50; transform: translate(-50%, 0); font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--amber); pointer-events: none;
  text-shadow: 0 2px 0 rgba(0,0,0,.12); animation: xpfly 1.05s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes xpfly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }
.combo-pop { position: fixed; z-index: 45; top: 22%; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; pointer-events: none;
  background: var(--amber); color: #3A2600; border-radius: var(--r-lg); padding: 12px 22px; box-shadow: 0 6px 0 #C47F0A; animation: combo 1.6s cubic-bezier(.3,1.4,.5,1) forwards; }
.combo-pop svg { width: 34px; height: 34px; color: #E5484D; animation: flick .25s ease-in-out infinite alternate; }
.combo-pop b { font-family: var(--display); font-size: 1.5rem; }
.combo-pop span { font-weight: 700; font-size: .95rem; }
@keyframes combo { 0% { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-8deg); } 18% { opacity: 1; transform: translateX(-50%) scale(1.08) rotate(2deg); } 30% { transform: translateX(-50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px); } }
@keyframes flick { to { transform: scale(1.15) rotate(6deg); } }
.opt.right { animation: okpulse .45s ease-out; }
@keyframes okpulse { 40% { transform: scale(1.04); } }

/* ---------- Zeig, wo ---------- */
.hs { margin: 0; display: grid; justify-items: center; gap: 6px; }
.hs svg { width: 100%; max-width: 420px; max-height: 50vh; overflow: visible; }
.dg-body > :not(.limb):not(.seam):not(.navel) { fill: var(--dg-body); stroke: var(--dg-line); stroke-width: 1.5; }
.dg-body .limb { fill: none; stroke: var(--dg-body); stroke-linecap: round; stroke-linejoin: round; }
.dg-body .limb.arm { stroke-width: 17px; } .dg-body .limb.leg { stroke-width: 27px; }
.hs .seam { fill: none; stroke: var(--dg-line); stroke-width: 1.5; stroke-linecap: round; }
.hs .navel { fill: var(--dg-line); }
.hs .ecg-line { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.zone { cursor: pointer; outline: none; }
.zone > * { fill: var(--zone); stroke: var(--zone-stroke); stroke-width: 1.6; stroke-dasharray: 4 3; transition: fill .15s, stroke .15s; }
.zone:hover > *, .zone:focus-visible > * { fill: color-mix(in srgb, var(--scrub) 25%, transparent); }
.zone.sel > * { fill: color-mix(in srgb, var(--amber) 55%, transparent); stroke: var(--amber); stroke-width: 3; stroke-dasharray: none; }
.zone.right > * { fill: color-mix(in srgb, var(--mint) 60%, transparent); stroke: var(--mint); stroke-width: 3; stroke-dasharray: none; animation: zpulse .6s ease-out 2; }
.zone.wrong > * { fill: color-mix(in srgb, var(--coral) 50%, transparent); stroke: var(--coral); stroke-width: 3; stroke-dasharray: none; }
@keyframes zpulse { 50% { stroke-width: 6; } }
/* Organe: Zonen sind das Organ selbst */
.dg-heart .zone > * { fill: #E7A1A1; stroke: #A84444; stroke-dasharray: none; }
.dg-lung .zone > * { fill: #F2B8C0; stroke: #B5606C; stroke-dasharray: none; }
.dg-brain .zone > * { fill: #F1C9D4; stroke: #A86A7E; stroke-dasharray: none; }
.dg-heart .zone:nth-child(odd) > * { fill: #DD8E8E; }
.dg-brain .zone:nth-child(2n) > * { fill: #E8B5C4; }
.dg-heart .zone:hover > *, .dg-lung .zone:hover > *, .dg-brain .zone:hover > * { filter: brightness(1.08); stroke-width: 2.5; }
.zone.line > * { fill: none !important; stroke-width: 11 !important; stroke-linecap: round; stroke-dasharray: none; }
.dg-heart .zone.line > * { stroke: #6E8FC7; }
.dg-heart .zone[data-z="aorta"] > * { stroke: #C95555; }
.dg-lung .zone.line > * { stroke: #A7BCC4; }
.dg-lung .zone[data-z="zwerchfell"] > * { stroke: #C79A7A; }
.dg-heart .zone[data-z="sinus"] > *, .dg-heart .zone[data-z="av"] > * { fill: #F5C24B; stroke: #9C7414; }
.dg-heart .zone[data-z="mitral"] > *, .dg-heart .zone[data-z="trikuspidal"] > * { fill: #FFF3E6; stroke: #9C6F4B; }
.dg-heart .zone.sel > *, .dg-lung .zone.sel > *, .dg-brain .zone.sel > *, .zone.line.sel > * { stroke: var(--amber) !important; stroke-width: 4; filter: drop-shadow(0 0 4px var(--amber)); }
.zone.line.sel > * { stroke-width: 13 !important; }
.dg-heart .zone.right > *, .dg-lung .zone.right > *, .dg-brain .zone.right > *, .zone.line.right > * { stroke: var(--mint) !important; filter: drop-shadow(0 0 5px var(--mint)); }
.dg-heart .zone.wrong > *, .dg-lung .zone.wrong > *, .dg-brain .zone.wrong > *, .zone.line.wrong > * { stroke: var(--coral) !important; filter: drop-shadow(0 0 4px var(--coral)); }
.zone-label { font: 700 11px var(--body); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; animation: pop .3s both; }

.hs-answer { display: inline-flex; align-items: center; gap: 6px; background: var(--mint-bg); color: var(--ink); font-weight: 700; font-size: 1rem; padding: 6px 12px; border-radius: 99px; animation: pop .3s both; }
.hs-answer svg { width: 18px; height: 18px; color: var(--mint); }

/* ---------- Runde 3: Konto, Quests, Garderobe, Blitz, Fälle ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check, .radio { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: .95rem; }
.check input, .radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--scrub); flex: none; }
.reasons { display: grid; gap: 2px; margin-bottom: 8px; }
.field textarea { width: 100%; padding: 12px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; resize: vertical; }
.link.inline { padding: 0; }
.link.danger { color: var(--coral); }
.btn.tiny { padding: 6px 10px; font-size: .85rem; box-shadow: 0 3px 0 var(--scrub-deep); border-radius: 10px; }
.inline-ic { width: 18px; height: 18px; vertical-align: -3px; }
.stat.exam { color: var(--scrub); }
.stat .freeze svg { width: 14px; height: 14px; color: #6FB7E9; margin-left: -2px; }
.nav button { position: relative; }
.nav .dot { position: absolute; top: 2px; right: 10px; background: var(--coral); color: #fff; font-size: .68rem; min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
@media (min-width: 1000px) { .nav .dot { position: static; margin-left: auto; } }
.mobile-only { display: block; }
@media (min-width: 1000px) { .mobile-only { display: none; } }
.coach-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .coach-actions { width: 100%; } .coach-actions .btn { flex: 1; } }
.coach .btn.ghost svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--amber); }
.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip svg { width: 16px; height: 16px; }
.node.sp-fall:not(.done) { background: var(--amber); color: #3A2600; box-shadow: 0 4px 0 #C47F0A; animation: none; }
.node.sp-zw:not(.done) { background: #6E5BD6; color: #fff; box-shadow: 0 4px 0 #4A3BA8; animation: none; }
.bob-wrap.poke svg.bob { cursor: pointer; }
.bob.spin .b-all { animation: bob-spin .9s cubic-bezier(.3,.7,.4,1); }
@keyframes bob-spin { 0% { transform: rotate(0); } 60% { transform: rotate(380deg) scale(1.1); } 100% { transform: rotate(360deg); } }
.bob-wrap.xs .bob { width: 46px; height: 52px; }
/* Quests */
.quest { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.quest .qtext { flex: 1; min-width: 0; font-size: .92rem; font-weight: 700; }
.quest .goal-bar { height: 8px; margin-top: 5px; }
.quest.done .goal-bar i { background: var(--mint); }
.qok svg { width: 22px; height: 22px; color: var(--mint); }
.kit { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 10px; border: 2px dashed var(--line); background: none; border-radius: var(--r-md); padding: 10px 12px; color: var(--ink-soft); font-weight: 700; }
.kit svg { width: 30px; height: 30px; color: var(--trace-off); flex: none; }
.kit.ready { border: 2px solid var(--coral); color: var(--coral); background: var(--coral-bg); animation: kitwiggle 1.2s ease-in-out infinite; cursor: pointer; }
.kit.ready svg { color: var(--coral); }
.kit.open svg { color: var(--mint); }
@keyframes kitwiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-3deg); } 85% { transform: rotate(3deg); } 95% { transform: rotate(-1deg); } }
.kit-open { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 8px; background: rgba(5, 18, 22, .55); color: #fff; text-align: center; animation: pop .3s both; }
.kit-open .kit-box svg { width: 120px; height: 120px; color: var(--coral); animation: kitopen .9s cubic-bezier(.3,1.5,.5,1) both; filter: drop-shadow(0 0 24px rgba(255,200,80,.8)); }
.kit-open b { font-family: var(--display); font-size: 2.4rem; color: var(--amber); }
@keyframes kitopen { 0% { transform: scale(.3) rotate(-20deg); } 50% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
/* Level-up */
.levelup-overlay { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px; background: rgba(5, 18, 22, .6); animation: pop .3s both; }
.lu-card { position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-lg); padding: 26px 22px 22px; max-width: 400px; width: 100%; text-align: center; }
.lu-card h2 { font-size: 2rem; color: var(--scrub); margin: 2px 0 10px; }
.lu-card .muted { margin: 10px 0 0; }
.lu-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--amber) 22%, transparent) 0 12deg, transparent 12deg 24deg); animation: rays 12s linear infinite; z-index: 0; }
.lu-card > :not(.lu-rays) { position: relative; z-index: 1; }
@keyframes rays { to { transform: rotate(360deg); } }
.levelup svg { width: 20px; height: 20px; vertical-align: -4px; color: var(--amber); }
.stars-big { font-size: 2.2rem; letter-spacing: 6px; }
.stars-big span { color: var(--line); display: inline-block; }
.stars-big span.on { color: var(--amber); animation: starpop .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
/* Herzverlust, Feuer-Fortschritt */
.lives svg.breaking { animation: heartbreak .7s ease-out; }
@keyframes heartbreak { 0% { color: var(--coral); transform: scale(1.3); } 40% { transform: scale(1.3) rotate(-15deg); } 100% { transform: scale(1); } }
.progress.fire i { background: linear-gradient(90deg, var(--amber), var(--coral)); box-shadow: 0 0 12px var(--amber); }
.combo svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--coral); }
/* Feedback-Links */
.fb-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -6px 0 12px; }
.fb-links .link { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; color: var(--ink-soft); }
.fb-links svg { width: 16px; height: 16px; }
/* Fall */
.case { background: var(--amber-bg); border: 2px solid color-mix(in srgb, var(--amber) 50%, transparent); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 16px; }
.case summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.case summary svg { width: 20px; height: 20px; color: #B87A0A; }
.case p { margin: 8px 0 2px; line-height: 1.5; }
/* Blitz */
.blitz-score { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--amber); min-width: 2ch; text-align: right; }
.progress.timer i { background: var(--amber); transition: none; }
.progress.timer.hurry i { background: var(--coral); animation: hurry .5s ease-in-out infinite alternate; }
@keyframes hurry { to { opacity: .55; } }
.blitz .opts.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blitz .opt { justify-content: center; text-align: center; }
/* Schwächen */
.weak-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; }
.w-name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-pct { font-family: var(--display); font-weight: 800; font-size: .95rem; }
/* Garderobe */
.wr-stage { display: grid; place-items: center; padding: 6px 0 10px; }
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.outfit { border: 2px solid var(--line); background: var(--card); border-radius: var(--r-md); padding: 8px 6px 10px; display: grid; justify-items: center; gap: 2px; text-align: center; }
.outfit b { font-family: var(--display); font-size: .9rem; }
.outfit small { color: var(--ink-soft); font-size: .75rem; line-height: 1.2; }
.outfit.on { border-color: var(--scrub); background: color-mix(in srgb, var(--scrub) 10%, var(--card)); }
.outfit[disabled] { opacity: .55; cursor: not-allowed; }
.outfit[disabled] .bob { filter: grayscale(1) brightness(.9); }
.board .pos { font-size: 1.1rem; }
.invite-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 16px; }
.invite-card .bob-wrap { flex: 1; min-width: 220px; }
@media (max-width: 520px) { .invite-card .btn { width: 100%; } }
.invite-text { width: 100%; padding: 12px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; margin-bottom: 8px; }
.btn .inline-ic { color: currentColor; }

/* ---------- Klassen-Battle ---------- */
:root { --b0: #E5484D; --b1: #2F7FD8; --b2: #E5A008; --b3: #19A974; }
.battle { min-height: 100dvh; max-width: 760px; margin: 0 auto; padding: 0 16px 30px; }
.b-head { display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 0 10px; }
.b-code { margin-right: auto; font-weight: 700; color: var(--ink-soft); }
.b-code b { font-family: var(--display); color: var(--ink); letter-spacing: .08em; }
.code-input { font-family: var(--display) !important; font-size: 1.8rem !important; letter-spacing: .35em; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); margin: 14px 0; font-size: .9rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.unit-pick { max-height: 34vh; overflow: auto; border: 2px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; background: var(--paper); }
.unit-pick .check { margin: 2px 0 6px; font-size: .9rem; }
.battle-card { border: 2px solid var(--amber); background: linear-gradient(135deg, var(--amber-bg), var(--card) 70%); }
/* Lobby */
.b-lobby { text-align: center; display: grid; justify-items: center; gap: 8px; padding-top: 10px; }
.b-lobby p { margin: 0; }
.b-bigcode { font-family: var(--display); font-weight: 800; font-size: clamp(3.4rem, 18vw, 6rem); letter-spacing: .12em; color: var(--scrub); line-height: 1; animation: pop .4s both; }
.b-lobby.screen .b-bigcode { font-size: clamp(5rem, 16vw, 10rem); }
.b-lobby h3 { margin-top: 14px; }
.b-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.b-pl { display: grid; justify-items: center; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 10px 8px; min-width: 84px; animation: pop .35s cubic-bezier(.3,1.5,.5,1) both; }
.b-pl span { font-weight: 700; font-size: .85rem; }
.b-pl.me { border: 2px solid var(--scrub); }
.b-players.big .b-pl { min-width: 110px; } .b-players.big .bob { width: 64px; height: 70px; } .b-players.big .b-pl span { font-size: 1.05rem; }
.b-start { max-width: 360px; margin-top: 14px; }
/* Countdown */
.b-count { min-height: 70dvh; display: grid; place-content: center; text-align: center; }
.b-num { font-family: var(--display); font-weight: 800; font-size: 9rem; color: var(--scrub); line-height: 1; }
.b-num.pop { animation: numpop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes numpop { 0% { transform: scale(2.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
/* Frage */
.b-timer { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.b-timer i { display: block; height: 100%; background: var(--mint); border-radius: 99px; }
.b-timer.hurry i { background: var(--coral); }
.b-meta { display: flex; justify-content: space-between; margin: 6px 0 12px; }
.b-secs { font-family: var(--display); font-weight: 800; }
.b-opts { display: grid; gap: 10px; }
@media (min-width: 640px) { .b-opts { grid-template-columns: 1fr 1fr; } }
.b-opt { border: 0; border-radius: var(--r-md); padding: 16px 14px; min-height: 74px; color: #fff; font-weight: 700; font-size: 1.02rem; text-align: left; display: flex; gap: 12px; align-items: center; transition: transform .1s, opacity .2s; }
.b-opt .shape { font-size: 1.4rem; width: 28px; text-align: center; flex: none; }
.b-opt.c0, .c0 { background: var(--b0); } .b-opt.c1, .c1 { background: var(--b1); } .b-opt.c2, .c2 { background: var(--b2); } .b-opt.c3, .c3 { background: var(--b3); }
.b-opt.c0 { box-shadow: 0 5px 0 #A72A2E; } .b-opt.c1 { box-shadow: 0 5px 0 #1D5AA0; } .b-opt.c2 { box-shadow: 0 5px 0 #A87300; } .b-opt.c3 { box-shadow: 0 5px 0 #0E7A52; }
.b-opt:active:not([disabled]) { transform: translateY(4px); box-shadow: none; }
.b-opt[disabled] { cursor: default; opacity: .45; }
.b-opt.sel { opacity: 1; outline: 4px solid var(--ink); outline-offset: 2px; animation: pop .3s; }
.b-wait { text-align: center; font-weight: 700; color: var(--scrub); min-height: 1.4em; margin: 14px 0 0; }
.b-answered { text-align: center; }
.b-q .btn.ghost { display: block; margin: 8px auto 0; }
.b-q.screen .q-text { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
.b-q.screen .b-opt { min-height: 110px; font-size: clamp(1.1rem, 2vw, 1.6rem); }
/* Auflösung */
.b-result { display: flex; align-items: center; gap: 12px; border-radius: var(--r-lg); padding: 12px 16px; margin: 4px 0 16px; animation: pop .35s both; }
.b-result.ok { background: var(--mint-bg); } .b-result.no { background: var(--coral-bg); }
.b-result b { display: block; font-family: var(--display); font-size: 1.5rem; }
.b-result.ok b { color: #0B7A55; } .b-result.no b { color: var(--coral); }
:root[data-theme="dark"] .b-result.ok b { color: var(--mint); }
.small-q { font-size: 1.1rem !important; margin-bottom: 12px !important; }
.b-dist { display: grid; gap: 6px; }
.b-drow { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) 1fr 26px 22px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); opacity: .6; }
.b-drow.right { opacity: 1; background: var(--mint-bg); font-weight: 700; }
.b-drow .shape { color: #fff; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem; }
.b-dtext { font-size: .92rem; }
.b-dbar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.b-dbar i { display: block; height: 100%; border-radius: 99px; animation: grow .7s cubic-bezier(.2,.8,.2,1) both .15s; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.b-drow svg { width: 20px; height: 20px; color: var(--mint); }
.b-ex { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin: 12px 0; }
.b-rev h3 { margin: 16px 0 8px; }
.b-rev.screen .b-dtext { font-size: 1.2rem; } .b-rev.screen .small-q { font-size: 1.5rem !important; }
.b-board { list-style: none; padding: 0; margin: 0 0 16px; position: relative; }
.b-board li { position: absolute; left: 0; right: 0; height: 46px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px;
  transition: top .8s cubic-bezier(.3,1.1,.4,1); }
.b-board li.me { border: 2px solid var(--scrub); }
.b-board .pos { font-family: var(--display); font-weight: 800; width: 1.6ch; color: var(--ink-soft); }
.b-board li:first-child .pos { color: var(--amber); }
.b-board .bob { width: 34px; height: 38px; }
.b-board .who { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-board .who svg { color: var(--coral); }
.b-board .gain { font-weight: 800; color: var(--mint); font-size: .85rem; animation: pop .4s both .4s; }
.b-board .pts { font-family: var(--display); font-weight: 800; min-width: 4ch; text-align: right; }
.center { text-align: center; }
/* Podest */
.b-final { text-align: center; }
.b-final h2 { font-size: 2rem; color: var(--scrub); margin: 6px 0 16px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; max-width: 520px; margin: 0 auto 16px; }
.pod { display: grid; justify-items: center; gap: 2px; }
.pod b { font-size: .95rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod span { font-family: var(--display); font-weight: 800; color: var(--ink-soft); font-size: .9rem; }
.pod .block { width: 100%; border-radius: 12px 12px 0 0; font-family: var(--display); font-weight: 800; font-size: 2rem; color: #fff; display: grid; place-items: center; animation: rise .9s cubic-bezier(.2,.9,.3,1.2) both; transform-origin: bottom; }
.pod.p1 .block { height: 130px; background: #E5A008; animation-delay: .9s; }
.pod.p2 .block { height: 95px; background: #9AA9B0; animation-delay: .5s; }
.pod.p3 .block { height: 70px; background: #C07A45; animation-delay: .2s; }
.pod.p1 { animation: pop .5s both 1.3s; } .pod.p2 { animation: pop .5s both .8s; } .pod.p3 { animation: pop .5s both .5s; }
@keyframes rise { from { transform: scaleY(0); } }
.b-mine { font-size: 1.1rem; }
.b-final .row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.b-final.screen .podium { max-width: 760px; } .b-final.screen .pod b { font-size: 1.3rem; }
.b-q.screen .b-opt[disabled] { opacity: 1; cursor: default; }
.battle:has(.screen) { max-width: 1280px; }
.b-q.screen .b-timer { height: 16px; }
.b-q.screen .b-secs { font-size: 1.6rem; }
.b-q.screen .b-answered { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.b-rev.screen { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0 32px; align-items: start; }
.b-rev.screen > .small-q, .b-rev.screen > .btn { grid-column: 1 / -1; }
.b-rev.screen > h3 { grid-column: 2; grid-row: 2; margin-top: 0; }
.b-rev.screen > .b-dist { grid-column: 1; grid-row: 2 / span 2; }
.b-rev.screen > .b-board { grid-column: 2; grid-row: 3; }
.b-rev.screen > .b-ex { grid-column: 1; }
@media (max-width: 900px) { .b-rev.screen { display: block; } }

/* ---------- Team-Modus ---------- */
.t0 .b-scrubs { fill: var(--b0); } .t1 .b-scrubs { fill: var(--b1); } .t2 .b-scrubs { fill: var(--b2); } .t3 .b-scrubs { fill: var(--b3); }
.tc0 { --tc: var(--b0); } .tc1 { --tc: var(--b1); } .tc2 { --tc: var(--b2); } .tc3 { --tc: var(--b3); }
.b-teams { display: grid; gap: 10px; width: 100%; grid-template-columns: 1fr; }
@media (min-width: 640px) { .b-teams.n2 { grid-template-columns: 1fr 1fr; } .b-teams.n3 { grid-template-columns: repeat(3, 1fr); } .b-teams.n4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .b-teams.n4 { grid-template-columns: repeat(4, 1fr); } }
.b-team { border: 3px solid var(--tc); border-radius: var(--r-lg); padding: 10px; background: color-mix(in srgb, var(--tc) 8%, var(--card)); display: grid; justify-items: center; gap: 8px; }
.b-team.mine { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 30%, transparent); }
.b-team h4 { margin: 0; font-family: var(--display); color: var(--tc); font-size: 1.15rem; }
.b-team h4 small { background: var(--tc); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: .8rem; vertical-align: 2px; }
.team-chip { display: inline-block; background: var(--tc); color: #fff; font-weight: 800; border-radius: 99px; padding: 3px 12px; margin-bottom: 8px; font-size: .9rem; }
.b-board.teamb li { border-left: 6px solid var(--tc); }
.b-board .tdot { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); flex: none; }
.b-board .tbar { flex: 1.2; height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; max-width: 160px; }
.b-board .tbar i { display: block; height: 100%; background: var(--tc); border-radius: 99px; transition: width .8s; }
.b-board.teamb .who { flex: 0 1 auto; }
.block.tc0, .block.tc1, .block.tc2, .block.tc3 { background: var(--tc) !important; }
.tpod-bobs { display: flex; flex-wrap: wrap; justify-content: center; max-width: 170px; }
.tpod-bobs .bob { width: 40px; height: 44px; }
.b-board li { text-align: left; }
.b-side h3 { margin: 16px 0 8px; }
.b-rev.screen > .b-side { grid-column: 2; grid-row: 2 / span 3; }
.b-rev.screen > .b-side h3:first-child { margin-top: 0; }
.b-board .tbar { flex: 1; max-width: none; }

.field > small { display: block; margin-top: 6px; font-size: .82rem; line-height: 1.35; }
.board .bob { width: 34px; height: 38px; flex: none; }
.board .who { min-width: 0; }
.board .who small, .board .pts small { display: block; font-weight: 500; font-size: .78rem; color: var(--ink-soft); font-family: inherit; }
.board .who small .inline-ic { color: var(--coral); }
.board .pts { text-align: right; white-space: nowrap; }
.board-me { margin: 0 0 8px; }
.wr-tabs { margin-top: 4px; }
.wr-tabs button { padding: 9px 4px; font-size: .9rem; min-width: 0; }
.wr-count { margin: 0 0 10px; text-align: center; }
/* Als App hinzufügen */
.a2hs { position: fixed; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 30; max-width: 460px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 12px 34px rgba(19, 36, 44, .22); padding: 14px 14px 14px; animation: up .3s cubic-bezier(.2,.8,.2,1); }
.a2hs.out { opacity: 0; transform: translateY(12px); transition: .2s; }
@media (min-width: 1000px) { .a2hs { bottom: 20px; } }
.a2-x { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--ink-soft); padding: 6px; border-radius: 10px; }
.a2-x svg { width: 18px; height: 18px; display: block; }
.a2-head { display: flex; gap: 10px; align-items: center; padding-right: 26px; margin-bottom: 12px; }
.a2-head .bob { width: 46px; height: 54px; }
.a2-head b { display: block; font-family: var(--display); font-size: 1.05rem; }
.a2-head span { display: block; font-size: .86rem; color: var(--ink-soft); line-height: 1.35; }
.a2hs .row { display: flex; gap: 10px; } .a2hs .row .btn { flex: 1; }
.a2-body p { margin: 0 0 10px; font-size: .92rem; }
.a2-steps { margin: 0 0 10px; padding-left: 1.4em; display: grid; gap: 8px; font-size: .92rem; line-height: 1.4; }
.a2-ic { width: 20px; height: 20px; vertical-align: -4px; color: var(--scrub); }
.a2-note { font-size: .82rem !important; color: var(--ink-soft); background: color-mix(in srgb, var(--scrub) 8%, transparent); padding: 8px 10px; border-radius: var(--r-sm); }
/* ---------- Bildfragen, Tippen, Freitext ---------- */
.fig-q { margin: 6px 0 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; }
.fig-svg svg { display: block; width: 100%; height: auto; max-height: 46vh; }
.fig-svg .labels-hidden text { visibility: hidden; }
.fig-mark .ring { fill: none; stroke: #E5484D; stroke-width: 6; transform-box: fill-box; transform-origin: center; animation: fig-pulse 1.3s ease-out infinite; }
.fig-mark .dot { fill: #E5484D; stroke: #fff; stroke-width: 3; }
.fig-mark.ok .dot { fill: #19B985; } .fig-mark.ok .ring { stroke: #19B985; animation: none; }
@keyframes fig-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fig-mark .ring { animation: none; } }
.typein { display: grid; gap: 8px; justify-items: start; }
.type-in { width: 100%; font: inherit; font-size: 1.15rem; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--card); color: var(--ink); }
.type-in:focus { outline: none; border-color: var(--scrub); }
.type-in.right { border-color: #19B985; background: color-mix(in srgb, #19B985 10%, var(--card)); }
.type-in.wrong { border-color: #E5484D; background: color-mix(in srgb, #E5484D 8%, var(--card)); }
.open-in { width: 100%; font: inherit; font-size: 1.02rem; line-height: 1.45; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--card); color: var(--ink); resize: vertical; min-height: 120px; }
.open-in:focus { outline: none; border-color: var(--scrub); }
.checklist { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.checklist h4 { margin: 0 0 8px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-radius: 10px; cursor: pointer; }
.ck input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--scrub); flex: none; }
.ck.had span { color: var(--ink); } .ck.miss { background: color-mix(in srgb, #E5484D 9%, transparent); }
.ck.miss span { font-weight: 700; }
.mine { display: inline-block; margin-bottom: 4px; } .mine s { text-decoration-color: #E5484D; text-decoration-thickness: 2px; }
.mine-note { display: inline-block; margin-bottom: 4px; }
.ord-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.ord { padding: 2px 8px; border-radius: 8px; font-size: .92rem; } .ord.ok { background: color-mix(in srgb, #19B985 14%, transparent); } .ord.no { background: color-mix(in srgb, #E5484D 12%, transparent); text-decoration: line-through; text-decoration-color: #E5484D; }
.fig-sheet { max-height: 92vh; overflow: auto; }
.fig-list { display: grid; gap: 12px; margin: 8px 0 14px; }
.fig-big { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; }
.miss-list { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px; font-size: .92rem; }
.feedback .inner { max-height: 70vh; overflow-y: auto; }
/* ---------- Drag & Drop ---------- */
.dnd-hint { margin: 0 0 8px; }
.dnd { display: grid; gap: 14px; }
.dnd-slots { display: grid; gap: 8px; }
.dslot { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-md); background: color-mix(in srgb, var(--scrub) 5%, var(--card)); border: 2px dashed var(--line); transition: border-color .15s, background .15s; }
.dslot.filled { border-style: solid; border-color: color-mix(in srgb, var(--scrub) 35%, var(--line)); }
.dslot.over, .dnd-pool.over { border-color: var(--scrub); background: color-mix(in srgb, var(--scrub) 14%, var(--card)); }
.dslot-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--scrub); color: #fff; font-family: var(--display); font-weight: 800; }
.dslot-drop { min-height: 44px; display: flex; align-items: center; }
.dslot .ph { color: var(--ink-soft); font-size: .88rem; padding-left: 4px; }
.dslot.right { border: 2px solid var(--mint); background: color-mix(in srgb, var(--mint) 12%, var(--card)); }
.dslot.wrong { border: 2px solid var(--coral); background: color-mix(in srgb, var(--coral) 9%, var(--card)); }
.dslot .should { grid-column: 2; font-weight: 700; color: var(--coral); font-size: .92rem; }
.dslot .cap { display: block; font-size: .85rem; font-weight: 700; margin-top: 4px; }
.dnd-pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; min-height: 58px; border-radius: var(--r-md); border: 2px dashed transparent; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.dnd-pool.empty { justify-content: center; align-items: center; }
.dcard { font: inherit; font-weight: 700; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 10px 14px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .12s, border-color .12s, box-shadow .12s; text-align: left; }
.dcard:hover { border-color: color-mix(in srgb, var(--scrub) 45%, var(--line)); }
.dcard.sel { border-color: var(--scrub); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scrub) 25%, transparent); transform: translateY(-2px); }
.dcard.dragging { opacity: .35; }
.dcard.ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .95; box-shadow: 0 14px 30px rgba(19, 36, 44, .28); cursor: grabbing; }
.dslot-drop .dcard { width: 100%; }
.dcard[disabled] { cursor: default; opacity: 1; }
.dnd.imgs .dnd-pool { display: grid; grid-template-columns: 1fr 1fr; }
.dnd.imgs .dcard { padding: 4px; }
.dnd.imgs .dcard img { display: block; width: 100%; height: auto; border-radius: 10px; pointer-events: none; }
.dnd.imgs .dslot-drop { min-height: 70px; }
/* Nummern-Stellen im Bild */
.fig-svg .labels-hidden text.zn { visibility: visible; }
.dzone { cursor: pointer; }
.dzone circle { fill: #fff; stroke: var(--scrub, #0E5A6B); stroke-width: 4; }
.dzone text { fill: #0E5A6B; font-weight: 800; pointer-events: none; }
.dzone.filled circle { fill: #0E5A6B; } .dzone.filled text { fill: #fff; }
.dzone.over circle { stroke: #F5A524; stroke-width: 7; }
.dzone.ok circle { fill: #19B985; stroke: #fff; } .dzone.no circle { fill: #E5484D; stroke: #fff; } .dzone.ok text, .dzone.no text { fill: #fff; }
.dnd.imgs .dnd-pool.empty { display: flex; }
/* ---------- Aufgaben der Lehrkraft / Klasse ---------- */
.tasks { margin-bottom: 16px; border-left: 5px solid var(--amber, #F5A524); }
.tasks h3 { margin-top: 0; }
.task + .task { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.due { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; } .due.late { color: var(--coral); font-weight: 700; }
.task-lessons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task-lessons .chip.done { opacity: .6; text-decoration: line-through; }
.my-classes p { margin: 0 0 6px; }
.school-chip { margin: -6px 0 14px; color: var(--ink-soft); font-size: .95rem; }
.locked-more { color: var(--ink-soft); text-align: center; }
