/* ==========================================================================
   Urease-Lab – Stylesheet
   Tokens → Grundlagen → Bausteine → Seiten → Admin → Responsiv → Druck
   ========================================================================== */

:root {
  --pink: #e8277c;
  --pink-strong: #c81c67;
  --pink-soft: #fde6f0;
  --pink-ink: #9d1650;
  --ink: #191724;
  --ink-2: #22202c;
  --ink-3: #302c3a;
  --ink-line: #45404f;

  --bg: #f4f3f8;
  --surface: #ffffff;
  --surface-2: #f8f7fa;
  --surface-3: #efedf4;
  --text: #191724;
  --text-2: #5f5b6a;
  --text-3: #8a8694;
  --line: #e0dde7;
  --line-strong: #cdc8d6;

  --ok: #0f8a5f;
  --ok-soft: #e5f6ee;
  --bad: #c0264b;
  --bad-soft: #fdecef;
  --warn: #8a5a00;
  --warn-soft: #fff6e2;
  --info: #1f5a80;
  --info-soft: #ecf6fd;

  --shadow-color: 35 30 48;
  --shadow-sm: 0 1px 2px rgb(var(--shadow-color) / .06);
  --shadow: 0 18px 50px rgb(var(--shadow-color) / .07);
  --shadow-lg: 0 30px 80px rgb(var(--shadow-color) / .12);

  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111018;
    --surface: #1a1823;
    --surface-2: #211f2b;
    --surface-3: #2a2735;
    --text: #f1eff6;
    --text-2: #b4b0c0;
    --text-3: #8a8697;
    --line: #2f2c3a;
    --line-strong: #423e4f;
    --pink-soft: #3a1829;
    --pink-ink: #ff8fbe;
    --ok: #3ccf94;
    --ok-soft: #12291f;
    --bad: #ff7d96;
    --bad-soft: #2f1620;
    --warn: #f3c46b;
    --warn-soft: #2c2415;
    --info: #8cc8f0;
    --info-soft: #152331;
    --shadow-color: 0 0 0;
    --shadow: 0 18px 50px rgb(0 0 0 / .35);
    --shadow-lg: 0 30px 80px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

/* ---------- Grundlagen ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -.03em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .9em; padding: .1em .35em; border-radius: 6px; background: var(--surface-3); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--pink) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

.kicker { color: var(--pink); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--text-2); line-height: 1.6; }
.fine { color: var(--text-3); font-size: .78rem; line-height: 1.5; }

/* ---------- Bausteine ---------- */

.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: .8rem; font-weight: 900; letter-spacing: .16em; text-decoration: none; }
.brand em { font-style: normal; color: #ff76b0; }
.brand-mark { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .7rem; color: #fff; background: var(--pink); rotate: -4deg; transition: rotate .4s var(--ease); }
.brand:hover .brand-mark { rotate: 6deg; }
.brand-mark .icon { width: 1.25rem; height: 1.25rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .6rem 1.1rem;
  border: 1px solid transparent; border-radius: 12px;
  font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap;
  transition: background .18s, border-color .18s, box-shadow .18s, translate .18s, opacity .18s;
}
.btn:active:not(:disabled) { translate: 0 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { min-height: 3.1rem; font-size: 1rem; }
.btn-primary { background: var(--pink); color: #fff; box-shadow: 0 10px 25px rgb(232 39 124 / .22); }
.btn-primary:hover:not(:disabled) { background: var(--pink-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-3); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.icon-btn { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text-2); transition: .15s; }
.icon-btn:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); }
.icon-btn:disabled { opacity: .3; cursor: default; }

.field { display: grid; gap: .5rem; }
.field > label { font-weight: 700; font-size: .92rem; }
input:not([type=radio]):not([type=checkbox]), textarea {
  width: 100%; min-height: 2.9rem; padding: .7rem .95rem;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.6; resize: vertical; min-height: 7rem; }
input:not([type=radio]):not([type=checkbox]):focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgb(232 39 124 / .14); }
::placeholder { color: var(--text-3); }

.alert { display: block; padding: .75rem .9rem; border-radius: 12px; font-size: .88rem; line-height: 1.5; border: 1px solid; }
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.mini-icon { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 14px; background: var(--pink-soft); color: var(--pink); }
.mini-icon .icon { width: 1.35rem; height: 1.35rem; }
.mini-icon.danger { background: var(--bad-soft); color: var(--bad); }

.subtle-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-3); font-size: .85rem; text-decoration: none; }
.subtle-link:hover { color: var(--text); }

.chip-user { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border: 1px solid var(--ink-line); border-radius: 10px; color: #d7d3df; font-size: .86rem; background: transparent; }
.chip-user.as-btn:hover { border-color: #6a6475; color: #fff; }

.dialog { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(92vw, 30rem); }
.dialog::backdrop { background: rgb(17 16 24 / .55); backdrop-filter: blur(4px); }
.dialog[open] { animation: pop .28s var(--ease); }
.dialog-body { display: grid; gap: 1rem; padding: 1.8rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }

/* ---------- Startseite ---------- */

.split-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr); }
.hero-side {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 3rem clamp(2rem, 6vw, 6rem);
  color: #fff; background: var(--ink);
}
.hero-side::before { content: ""; position: absolute; inset: auto -20% -40% auto; width: 38rem; height: 38rem; border-radius: 50%; background: radial-gradient(circle, rgb(232 39 124 / .28), transparent 65%); z-index: -1; animation: glow 9s ease-in-out infinite; }
.hero-side::after { content: ""; position: absolute; width: 32rem; height: 32rem; border: 1px solid rgb(255 255 255 / .07); border-radius: 50%; right: -12rem; top: 16%; box-shadow: 0 0 0 5rem rgb(255 255 255 / .018), 0 0 0 10rem rgb(255 255 255 / .012); z-index: -1; }
.hero-copy { position: relative; z-index: 2; max-width: 34rem; }
.hero-copy h1 { margin: .7rem 0 1rem; font-size: clamp(3.2rem, 6.4vw, 6.2rem); line-height: .9; letter-spacing: -.065em; }
.hero-copy h1 span { color: #ff4b9a; }
.hero-lead { color: #b8b4c4; font-size: 1.05rem; }
.hero-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .6rem; }
.hero-points li { display: flex; align-items: center; gap: .65rem; color: #d4d0dd; font-size: .92rem; }
.hero-points .icon { color: #ff76b0; }
.hero-side > * { animation: rise .7s var(--ease) both; }
.hero-side > .hero-copy { animation-delay: .12s; }

.thermo-art { position: absolute; right: 12%; top: 13%; width: 14rem; height: 25rem; z-index: 1; animation: rise .9s var(--ease) .2s both; }
.tube { position: absolute; bottom: 0; left: 50%; width: 6.4rem; height: 19rem; border: 4px solid rgb(255 255 255 / .75); border-top: 0; border-radius: 0 0 3.2rem 3.2rem; translate: -50% 0; rotate: 7deg; overflow: hidden; }
.tube::before { content: ""; position: absolute; left: -1rem; right: -1rem; top: 1.2rem; border-top: 4px solid rgb(255 255 255 / .75); rotate: -7deg; }
.tube i { position: absolute; inset: 50% 0 0; background: linear-gradient(#fb61a6, #e52177); border-radius: 50% 50% 0 0 / 8% 8% 0 0; animation: fill 5s var(--ease) infinite alternate; }
.tube b, .tube em, .tube s { position: absolute; border-radius: 50%; background: #ffb1d2; animation: bubble 3.6s ease-in infinite; }
.tube b { width: 1.1rem; height: 1.1rem; left: 1.2rem; bottom: 1rem; }
.tube em { width: .7rem; height: .7rem; right: 1.5rem; bottom: 2rem; animation-delay: 1.2s; }
.tube s { width: .5rem; height: .5rem; left: 2.8rem; bottom: .5rem; animation-delay: 2.1s; }
.temp { position: absolute; font-family: var(--mono); font-weight: 800; color: #6c6879; }
.t1 { left: -3rem; top: 4rem; } .t2 { right: -2rem; top: 8rem; color: #ff4b9a; } .t3 { left: -4rem; top: 14rem; } .t4 { right: -2.5rem; top: 19rem; }

.panel-side { display: grid; place-items: center; align-content: center; gap: 1.2rem; padding: 2rem; }
.login-card { width: min(100%, 31rem); display: grid; gap: 1.05rem; padding: clamp(1.5rem, 4vw, 2.8rem); animation: rise .6s var(--ease) .1s both; }
.login-card h1, .login-card h2 { font-size: 2rem; letter-spacing: -.04em; }
.login-card .back { margin-bottom: .3rem; }
.waiting { display: flex; gap: .4rem; padding: .5rem 0; }
.waiting span { width: .6rem; height: .6rem; border-radius: 50%; background: var(--pink); animation: blink 1.2s infinite; }
.waiting span:nth-child(2) { animation-delay: .2s; } .waiting span:nth-child(3) { animation-delay: .4s; }

.center-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }

/* ---------- Kopfzeile ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
  color: #fff; background: var(--ink); border-bottom: 1px solid var(--ink-3);
}
.topbar-meta { display: flex; align-items: center; gap: .6rem; }
.timer, .save-state { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .75rem; border: 1px solid var(--ink-line); border-radius: 10px; font-size: .84rem; color: #d7d3df; }
.timer { font-family: var(--mono); font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.urgent { color: #ff77ae; border-color: #8e2856; animation: pulse 2s infinite; }
.timer.over { color: #ffb35c; border-color: #7a5320; }
.save-state { border-color: transparent; color: #9c98a8; }
.save-state.saving .icon { animation: bob 1s ease-in-out infinite; }
.save-state.saved { color: #7fe0b5; }
.save-state.failed { color: #ff8fa6; }

/* ---------- Lab ---------- */

.lab-layout { min-height: calc(100vh - 4.6rem); display: grid; grid-template-columns: 18.5rem minmax(0, 1fr); }
.rail { position: sticky; top: 4.6rem; align-self: start; height: calc(100vh - 4.6rem); overflow-y: auto; padding: 2.2rem 1.6rem; background: var(--ink-2); color: #fff; }
.rail h2 { margin: .5rem 0 1.4rem; font-size: 2rem; line-height: 1; letter-spacing: -.045em; }
.rail-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .7rem; color: #a9a5b2; font-size: .75rem; font-family: var(--mono); }
.bar { height: .35rem; border-radius: 1rem; background: #413c49; overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--pink); transition: width .5s var(--ease); }
.rail-steps { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; gap: .3rem; }
.rail-step { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .62rem; border: 0; border-radius: 12px; background: transparent; color: #75717f; text-align: left; transition: background .2s, color .2s; }
.rail-step:disabled { cursor: default; }
.rail-step:not(:disabled):hover { background: #2a2733; color: #c9c5d2; }
.rail-num { position: relative; width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid var(--ink-line); border-radius: 9px; font-family: var(--mono); font-size: .72rem; flex: none; transition: .25s; }
.rail-num .icon { position: absolute; width: .95rem; opacity: 0; scale: .4; transition: .25s var(--ease); }
.rail-text { display: grid; gap: .1rem; }
.rail-text strong { font-size: .88rem; }
.rail-text small { font-size: .72rem; opacity: .8; }
.rail-step.active { background: var(--ink-3); color: #fff; }
.rail-step.active .rail-num { background: var(--pink); border-color: var(--pink); color: #fff; }
.rail-step.done { color: #b3afbb; }
.rail-step.done .rail-num { color: #ff65a7; border-color: #6d3050; }
.rail-step.done .rail-num b { opacity: 0; }
.rail-step.done .rail-num .icon { opacity: 1; scale: 1; }
.rail-step.active.done .rail-num { color: #fff; }
.rail-note { display: flex; gap: .6rem; color: #8d8997; font-size: .76rem; line-height: 1.45; }

.task-area { width: min(100%, 64rem); margin: 0 auto; padding: clamp(1.25rem, 4vw, 3.5rem); }
.task-area > .alert { margin-bottom: 1rem; }
.station { animation: stationIn .45s var(--ease); }
.station.back { animation-name: stationBack; }
.task-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.3rem; }
.task-head h1 { font-size: clamp(2.2rem, 4.2vw, 3.7rem); margin-top: .35rem; line-height: .95; letter-spacing: -.055em; outline: none; }
.badge-mono { padding: .5rem .75rem; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-family: var(--mono); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.task-card { display: grid; gap: 1.6rem; padding: clamp(1.2rem, 3vw, 2rem); }
.source-note { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; background: var(--info-soft); color: var(--info); font-size: .86rem; line-height: 1.5; }
.source-note .icon { margin-top: .15rem; }

.item { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: .85rem; }
.item-q { padding: 0; font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.35; }
.item-intro { color: var(--text-2); font-size: .92rem; margin-top: -.4rem; }
.item.shake { animation: shake .4s; }

.options { display: grid; gap: .55rem; }
.options-temps { grid-template-columns: repeat(4, 1fr); }
.options-graph { grid-template-columns: repeat(4, 1fr); }
.option {
  position: relative; display: flex; align-items: flex-start; gap: .75rem;
  padding: .95rem 1rem; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); cursor: pointer; line-height: 1.4; font-size: .94rem;
  transition: border-color .16s, background .16s, box-shadow .16s, translate .16s;
}
.option:hover { border-color: color-mix(in srgb, var(--pink) 45%, var(--line-strong)); background: var(--surface-2); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-dot { width: 1.15rem; height: 1.15rem; flex: none; margin-top: .1rem; border: 2px solid var(--line-strong); border-radius: 50%; transition: .16s; }
.option:has(input:checked) { border-color: var(--pink); background: color-mix(in srgb, var(--pink-soft) 60%, var(--surface)); box-shadow: 0 0 0 3px rgb(232 39 124 / .1); }
.option:has(input:checked) .option-dot { border-color: var(--pink); background: var(--pink); box-shadow: inset 0 0 0 3px var(--surface); }
.option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--pink) 55%, transparent); outline-offset: 2px; }
.options-temps .option { justify-content: center; font-family: var(--mono); font-weight: 800; font-size: 1.15rem; padding: 1.2rem .5rem; }
.options-temps .option-dot { display: none; }
.option-graph { flex-direction: column; align-items: stretch; gap: .5rem; padding: .7rem; }
.option-graph .option-label { display: flex; gap: .5rem; align-items: flex-start; font-size: .84rem; font-weight: 650; }
.graph { width: 100%; height: auto; max-height: 9rem; }
.graph-axis { fill: none; stroke: var(--text-3); stroke-width: 1.2; }
.graph-line { fill: none; stroke: var(--pink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 0; }
.option-graph:hover .graph-line, .option-graph:has(input:checked) .graph-line { animation: draw 1s var(--ease); }
.graph text { fill: var(--text-3); font-size: 7px; font-weight: 600; font-family: var(--font); }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.order-card {
  display: grid; grid-template-columns: 2rem 1.2rem 1fr auto; align-items: center; gap: .7rem;
  padding: .65rem .7rem; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); cursor: grab; user-select: none; touch-action: none;
  transition: box-shadow .2s, border-color .2s, background .2s;
}
.order-card:hover { border-color: color-mix(in srgb, var(--pink) 45%, var(--line-strong)); }
.order-card.dragging { cursor: grabbing; border-color: var(--pink); box-shadow: var(--shadow-lg); background: var(--surface-2); z-index: 5; position: relative; }
.order-card.moved { animation: nudge .35s var(--ease); }
.order-num { width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--ink-2); color: #fff; border-radius: 9px; font-family: var(--mono); font-size: .78rem; }
.order-grip { color: var(--text-3); display: grid; }
.order-card strong { font-size: .95rem; font-weight: 650; }
.order-btns { display: flex; gap: .3rem; }

.split-visual { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; padding: 1rem; border-radius: 16px; background: var(--ink-2); color: #fff; }
.bath { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; padding: 1rem; border: 1px solid var(--ink-line); border-radius: 12px; }
.bath::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 35%; background: linear-gradient(transparent, rgb(90 160 255 / .18)); animation: wave 3s ease-in-out infinite; }
.bath span { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bath i { color: #ff69a9; font-family: var(--mono); font-style: normal; }
.split-visual > b { grid-column: 1 / -1; text-align: center; color: #b8b4c1; font-size: .8rem; font-weight: 600; }

.field-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.counter { color: var(--text-3); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.counter.ok { color: var(--ok); }
.counter.ok b::before { content: "✓ "; }
.term-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border: 1px dashed var(--line-strong); border-radius: 999px; color: var(--text-3); font-size: .74rem; font-weight: 700; transition: .25s var(--ease); }
.chip .icon { width: .8rem; height: .8rem; display: none; }
.chip.hit { border-style: solid; border-color: color-mix(in srgb, var(--pink) 40%, transparent); background: var(--pink-soft); color: var(--pink-ink); }
.chip.hit .icon { display: block; }
.chip.pop { animation: pop .35s var(--ease); }

.hint { border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); border-radius: 14px; background: var(--warn-soft); overflow: hidden; }
.hint summary, .model summary { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; color: var(--warn); font-size: .84rem; font-weight: 800; cursor: pointer; list-style: none; }
.hint summary::-webkit-details-marker, .model summary::-webkit-details-marker { display: none; }
.hint p { padding: 0 1rem 1rem; color: var(--warn); line-height: 1.55; font-size: .88rem; }
.hint[open] p { animation: rise .3s var(--ease); }

.task-nav { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-top: 1.1rem; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.nav-status { text-align: center; color: var(--text-3); font-size: .8rem; }

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

.result-shell { width: min(100%, 60rem); margin: 0 auto; padding: clamp(1.2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem; display: grid; gap: 1.4rem; }
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.2rem, 4vw, 3rem); align-items: center; padding: clamp(1.4rem, 4vw, 3rem); position: relative; overflow: hidden; }
.result-hero h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -.055em; margin: .4rem 0 .8rem; }
.result-copy { display: grid; gap: .6rem; }
.result-copy h1 { margin: 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.score-ring { position: relative; width: 11rem; height: 11rem; }
.score-ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--pink); stroke-width: 10; stroke-linecap: round; animation: ring 1.4s var(--ease) .2s both; }
.score-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring strong { font-size: 3.4rem; line-height: 1; letter-spacing: -.06em; }
.score-ring span { color: var(--text-3); font-size: .85rem; }
.confetti { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; pointer-events: none; animation: confetti 2.4s ease-in forwards; }

.replay { padding: clamp(1.2rem, 3vw, 2rem); display: grid; gap: 1.4rem; }
.replay-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.replay h2 { font-size: 1.5rem; margin-top: .3rem; }
.tubes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.tube-fig { margin: 0; display: grid; justify-items: center; gap: .7rem; }
.rtube { position: relative; width: 3.4rem; height: 9rem; border: 3px solid var(--line-strong); border-top: 0; border-radius: 0 0 1.7rem 1.7rem; overflow: hidden; background: var(--surface-2); }
.rtube i { position: absolute; inset: 22% 0 0; background: #f5eef2; transition: none; }
.tubes.run .rtube i { animation: toPink var(--d, 4s) linear forwards; }
.t-5 { --d: 9s; --to: #f7c3da; }
.t-45 { --d: 2.2s; --to: #e8277c; }
.t-65 { --d: 5s; --to: #f08ab6; }
.t-80 { --d: 12s; --to: #f3e2ea; }
.tube-fig figcaption { display: grid; text-align: center; }
.tube-fig strong { font-family: var(--mono); }
.tube-fig span { color: var(--text-3); font-size: .78rem; }
.t-45 strong { color: var(--pink); }

.section-title { font-size: 1.5rem; margin: 1rem 0 .2rem; }
.feedback { display: grid; gap: 1rem; }
.fb-station { padding: clamp(1.1rem, 3vw, 1.8rem); display: grid; gap: 1rem; }
.fb-station h3 { font-size: 1.3rem; margin-top: -.5rem; }
.fb-item { display: grid; gap: .6rem; padding: 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.fb-item.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); }
.fb-item.bad { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface)); }
.fb-q { display: flex; gap: .6rem; align-items: flex-start; }
.fb-q strong { font-size: .95rem; line-height: 1.4; }
.fb-mark { width: 1.6rem; height: 1.6rem; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.fb-mark .icon { width: .9rem; height: .9rem; }
.ok .fb-mark { background: var(--ok); }
.bad .fb-mark { background: var(--bad); }
.fb-answer, .fb-solution { font-size: .9rem; }
.fb-answer span, .fb-solution span { color: var(--text-3); font-weight: 700; }
.fb-solution { color: var(--ok); }
.fb-explain { display: flex; gap: .5rem; color: var(--text-2); font-size: .86rem; line-height: 1.5; }
.fb-explain .icon { color: var(--warn); margin-top: .15rem; }
blockquote { margin: 0; padding: .8rem 1rem; border-left: 3px solid var(--pink); border-radius: 4px 10px 10px 4px; background: var(--surface); color: var(--text); font-size: .92rem; line-height: 1.6; white-space: normal; }
.term-chips.small .chip .icon { display: block; }
.term-chips.small .chip:not(.hit) { text-decoration: line-through; opacity: .75; }
.model { border-radius: 12px; background: var(--info-soft); }
.model summary { color: var(--info); }
.model p { padding: 0 1rem 1rem; color: var(--info); font-size: .88rem; line-height: 1.6; }

/* ---------- Admin ---------- */

.live-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border: 1px solid var(--ink-line); border-radius: 10px; color: #bdb9c7; font-size: .8rem; }
.live-chip i { width: .5rem; height: .5rem; border-radius: 50%; background: #3ccf94; box-shadow: 0 0 0 0 rgb(60 207 148 / .6); animation: live 2s infinite; }
.live-chip.off i { background: #ff7d96; animation: none; }

.admin-wrap { width: min(100% - 2rem, 76rem); margin: 0 auto; padding: 2.2rem 0 4rem; display: grid; gap: 1.3rem; }
.admin-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.admin-title h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); letter-spacing: -.055em; margin: .3rem 0 .4rem; }
.admin-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .8rem .35rem .4rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; min-height: 2.75rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 2.6rem; height: 1.5rem; border-radius: 1rem; background: var(--line-strong); padding: 3px; transition: background .2s; }
.switch-track span { display: block; width: 1.12rem; height: 1.12rem; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: translate .25s var(--ease); }
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track span { translate: 1.1rem 0; }
.switch input:focus-visible + .switch-track { outline: 3px solid color-mix(in srgb, var(--pink) 55%, transparent); outline-offset: 2px; }
.switch-label { font-weight: 700; font-size: .88rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.stat { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.stat > .icon { width: 2.6rem; height: 2.6rem; padding: .65rem; border-radius: 12px; background: var(--pink-soft); color: var(--pink); }
.stat div { display: grid; }
.stat strong { font-size: 1.7rem; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-3); font-size: .8rem; }
.stat em { font-style: normal; color: var(--warn); }

.tabs { display: flex; gap: .3rem; padding: .3rem; border-radius: 14px; background: var(--surface-3); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; padding: .55rem 1rem; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-panel { animation: rise .35s var(--ease); }
.tab-panel > .card { padding: clamp(1rem, 3vw, 1.6rem); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.card-head h2 { font-size: 1.35rem; margin-bottom: .3rem; }
.search { display: flex; align-items: center; gap: .5rem; padding: 0 .8rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); min-width: 15rem; color: var(--text-3); }
.search input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; background: transparent !important; }

.station-heat { display: grid; grid-template-columns: repeat(var(--cols, 9), 1fr); gap: .35rem; margin-bottom: 1.2rem; }
.heat-cell { display: grid; gap: .3rem; padding: .6rem .5rem; border-radius: 10px; background: var(--surface-2); text-align: center; min-width: 0; }
.heat-cell b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.heat-cell span { color: var(--text-3); font-size: .66rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-cell.has { background: color-mix(in srgb, var(--pink) calc(var(--h, 0) * 1%), var(--surface-2)); }
.heat-cell.done-cell.has { background: color-mix(in srgb, var(--ok) calc(var(--h, 0) * 1%), var(--surface-2)); }

.participant-list { display: grid; gap: .5rem; }
.p-row { display: grid; grid-template-columns: minmax(10rem, 1.2fr) minmax(9rem, 1fr) minmax(10rem, 1.3fr) auto; align-items: center; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: opacity .3s, border-color .3s; }
.p-row.fresh { animation: flash 1.2s var(--ease); }
.p-row.idle { opacity: .55; }
.p-name { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.avatar { width: 2.3rem; height: 2.3rem; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--pink-soft); color: var(--pink-ink); font-weight: 900; }
.p-name div, .p-station { display: grid; min-width: 0; }
.p-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name small, .p-station small { color: var(--text-3); font-size: .74rem; }
.p-station strong { font-size: .9rem; }
.p-progress { display: grid; gap: .35rem; }
.p-progress div:first-child { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-3); }
.p-progress div:first-child span { color: var(--text); font-weight: 800; }
.p-progress .bar { background: var(--surface-3); height: .45rem; }
.status { justify-self: end; padding: .35rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.status.working { background: var(--info-soft); color: var(--info); }
.status.complete { background: var(--ok-soft); color: var(--ok); }
.status.idle-s { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-3); }

.evaluation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.evaluation-grid > .card { padding: 1.4rem; }
.evaluation-grid .wide { grid-column: 1 / -1; }
.eval-items { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; }
.eval-items .card { padding: 1.3rem; display: grid; gap: .75rem; align-content: start; }
.eval-summary { display: grid; gap: .6rem; align-content: start; background: var(--ink); color: #fff; border-color: var(--ink); }
.eval-summary h2 { font-size: 3rem; letter-spacing: -.06em; }
.eval-summary .muted { color: #aaa6b7; }
.eval-summary .bar { background: #3a3544; height: .55rem; margin: .4rem 0 .8rem; }
.eval-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0; }
.eval-summary dl div { padding: .8rem; border-radius: 12px; background: #262330; }
.eval-summary dt { color: #9d99a9; font-size: .74rem; }
.eval-summary dd { margin: .2rem 0 0; font-size: 1.3rem; font-weight: 800; }
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.card-title h3 { font-size: 1.05rem; letter-spacing: -.02em; }
.card-title small { color: var(--text-3); font-size: .74rem; }
.rate { padding: .3rem .55rem; border-radius: 8px; font-size: .74rem; font-weight: 800; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.rate.good { background: var(--ok-soft); color: var(--ok); }
.rate.mid { background: var(--warn-soft); color: var(--warn); }
.rate.low { background: var(--bad-soft); color: var(--bad); }
.dist-row { display: grid; gap: .3rem; }
.dist-row > div:first-child { display: flex; justify-content: space-between; gap: .8rem; font-size: .84rem; }
.dist-row > div:first-child span { display: flex; gap: .35rem; align-items: center; }
.dist-row .bar { background: var(--surface-3); height: .5rem; }
.dist-row.right .bar > span { background: var(--ok); }
.dist-row.wrong .bar > span { background: color-mix(in srgb, var(--bad) 75%, var(--surface)); }
.dist-row .icon { width: .85rem; height: .85rem; }
.dist-row.right .icon { color: var(--ok); }
.dist-row.wrong .icon { color: var(--bad); }
.histogram { display: flex; align-items: flex-end; gap: .45rem; height: 10rem; padding-top: 1rem; }
.histogram > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; height: 100%; }
.histogram i { display: block; width: 100%; height: calc(var(--p, 0%) * .72); min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--pink); transition: height .5s var(--ease); }
.histogram b { font-size: .75rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.histogram span { font-size: .7rem; color: var(--text-3); font-family: var(--mono); }
.word-cloud { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }
.word-cloud span { display: inline-flex; align-items: baseline; gap: .35rem; padding: .4rem .65rem; border-radius: 10px; background: var(--pink-soft); color: var(--pink-ink); font-weight: 750; font-size: var(--fs, 1rem); }
.word-cloud small { font-size: .66rem; opacity: .7; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .6rem; margin-top: 1.2rem; }
.word-grid > div { padding: .85rem; border-radius: 12px; background: var(--surface-2); }
.word-grid strong { font-size: .82rem; }
.word-grid p { margin-top: .3rem; color: var(--text-2); font-size: .8rem; line-height: 1.5; }

.submission-list { display: grid; gap: .5rem; }
.submission-list details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.submission-list details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.submission-list summary { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .9rem 1rem; cursor: pointer; list-style: none; }
.submission-list summary::-webkit-details-marker { display: none; }
.submission-list summary > div { display: grid; }
.submission-list summary small { color: var(--text-3); font-size: .76rem; }
.submission-list time { color: var(--text-3); font-size: .78rem; }
.score-pill { padding: .35rem .65rem; border-radius: 999px; background: var(--pink-soft); color: var(--pink-ink); font-weight: 800; font-size: .78rem; }
.answer-body { padding: 0 1rem 1rem; display: grid; gap: .9rem; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.answer-grid > div { padding: .8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.answer-grid > div.right { border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.answer-grid > div.wrong { border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.answer-grid > div.long { grid-column: 1 / -1; }
.answer-grid small { display: flex; gap: .35rem; align-items: center; color: var(--text-3); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.answer-grid p { margin-top: .3rem; font-size: .88rem; line-height: 1.55; white-space: pre-wrap; }
.answer-grid .right small .icon { color: var(--ok); }
.answer-grid .wrong small .icon { color: var(--bad); }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.row-actions .btn { min-height: 2.3rem; padding: .4rem .8rem; font-size: .82rem; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.settings-grid .card { padding: 1.5rem; display: grid; gap: .8rem; align-content: start; }
.settings-grid h2 { font-size: 1.3rem; }
.inline-form { display: flex; align-items: flex-end; gap: .6rem; }
.inline-form .field { width: 8rem; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.danger-zone .btn { justify-self: start; }

.join-dialog { width: min(96vw, 44rem); background: var(--ink); color: #fff; }
.join-body { display: grid; justify-items: center; gap: 1rem; padding: 2.4rem 2rem; text-align: center; }
.join-body h2 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.05em; }
.qr { width: min(70vw, 20rem); aspect-ratio: 1; padding: 1rem; border-radius: 20px; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.join-url { font-family: var(--mono); font-size: clamp(1rem, 2.6vw, 1.5rem); font-weight: 800; color: #ff76b0; word-break: break-all; }
.join-body .btn-ghost { color: #bdb9c7; }

/* ---------- Ergebnis: Überblick und genaue Rückmeldung ---------- */

.overview { padding: clamp(1.2rem, 3vw, 2rem); display: grid; gap: 1.1rem; }
.overview-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.overview h2 { font-size: 1.5rem; margin-top: .3rem; }
.legend { display: flex; gap: .5rem; }
.lg { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.lg .icon { width: .85rem; height: .85rem; }
.lg.ok { background: var(--ok-soft); color: var(--ok); }
.lg.bad { background: var(--bad-soft); color: var(--bad); }
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.ov-tile { position: relative; display: grid; gap: .25rem; align-content: start; min-height: 5rem; padding: .85rem 2.4rem .85rem .9rem; border-radius: 14px; border: 1px solid; text-decoration: none; transition: translate .2s var(--ease), box-shadow .2s; }
.ov-tile:hover { translate: 0 -2px; box-shadow: var(--shadow); }
.ov-tile.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.ov-tile.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.ov-code { font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.ok .ov-code { color: var(--ok); }
.bad .ov-code { color: var(--bad); }
.ov-tile strong { font-size: .86rem; line-height: 1.3; }
.ov-mark { position: absolute; top: .75rem; right: .75rem; width: 1.4rem; height: 1.4rem; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.ov-mark .icon { width: .8rem; height: .8rem; }
.ok .ov-mark { background: var(--ok); }
.bad .ov-mark { background: var(--bad); }

.fb-item { scroll-margin-top: 6rem; }
.fb-item:target { box-shadow: 0 0 0 3px rgb(232 39 124 / .25); }
.fb-q { align-items: center; }
.fb-code { margin-left: auto; padding: .2rem .5rem; border-radius: 7px; background: var(--surface); color: var(--text-2); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.fo-head { color: var(--text-3); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fo-head.ok { color: var(--ok); }
.fb-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.fb-options li { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; line-height: 1.4; color: var(--text-2); }
.fo-mark { width: 1.3rem; height: 1.3rem; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.fo-mark .icon { width: .75rem; height: .75rem; }
.fo-text { flex: 1; }
.fo-tag { flex: none; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.fb-options li.right { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--text); font-weight: 650; }
.fb-options li.right .fo-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.fb-options li.right .fo-tag, .fb-options li.solution .fo-tag { color: var(--ok); }
.fb-options li.wrong { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--text); font-weight: 650; }
.fb-options li.wrong .fo-mark { background: var(--bad); border-color: var(--bad); color: #fff; }
.fb-options li.wrong .fo-tag { color: var(--bad); }
.fb-options li.solution { border: 1.5px dashed var(--ok); color: var(--text); font-weight: 650; }
.fb-options li.solution .fo-mark { border-color: var(--ok); color: var(--ok); }
.fb-options li.chosen { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 40%, transparent); color: var(--text); font-weight: 650; }
.fb-options li.chosen .fo-mark { background: var(--pink); border-color: var(--pink); color: #fff; }
.fb-options li.chosen .fo-tag { color: var(--pink-ink); }
.fb-order { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fb-order.single { grid-template-columns: 1fr; }
.fb-order ol { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; }
.fb-order li { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; border: 1px solid; font-size: .88rem; font-weight: 650; }
.fb-order li .num { width: 1.5rem; height: 1.5rem; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--ink-2); color: #fff; font-family: var(--mono); font-size: .72rem; }
.fb-order li .fo-mark { margin-left: auto; border: 0; color: #fff; }
.fb-order li.right { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.fb-order li.right .fo-mark { background: var(--ok); }
.fb-order li.wrong { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.fb-order li.wrong .fo-mark { background: var(--bad); }
.fb-order li.solution { background: var(--surface); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.fb-order li.solution .num { background: var(--ok); }
.fb-graphs { display: flex; gap: .8rem; flex-wrap: wrap; }
.fb-graphs figure { margin: 0; width: min(100%, 15rem); padding: .6rem; border-radius: 12px; border: 1.5px solid; background: var(--surface); }
.fb-graphs figcaption { display: grid; gap: .1rem; font-size: .82rem; }
.fb-graphs figcaption b { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.fb-graphs .right { border-color: var(--ok); } .fb-graphs .right b { color: var(--ok); } .fb-graphs .right .graph-line { stroke: var(--ok); }
.fb-graphs .wrong { border-color: var(--bad); } .fb-graphs .wrong b { color: var(--bad); } .fb-graphs .wrong .graph-line { stroke: var(--bad); }
.fb-graphs .solution { border-color: var(--ok); border-style: dashed; } .fb-graphs .solution b { color: var(--ok); } .fb-graphs .solution .graph-line { stroke: var(--ok); }
.fb-explain span b { color: var(--text); }
.fb-solution-line { display: flex; gap: .5rem; align-items: flex-start; padding: .6rem .75rem; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: .92rem; }
.fb-solution-line .icon { margin-top: .15rem; }
.solution-item { background: var(--surface); }
.result-hero.single { grid-template-columns: auto 1fr; align-items: start; }
.mini-icon.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Admin: Quoten, Matrix, Fachbegriffe, Lösungen ---------- */

.rate-list { display: grid; gap: .55rem; margin-top: 1rem; }
.rate-row { display: grid; grid-template-columns: 2.2rem minmax(8rem, 16rem) 1fr 3.4rem 2.6rem; align-items: center; gap: .7rem; font-size: .86rem; }
.rate-row .code { font-family: var(--mono); font-weight: 800; font-size: .76rem; color: var(--text-3); }
.rate-row .lbl { font-weight: 650; }
.rate-row .bar { height: .6rem; background: var(--surface-3); }
.rate-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.rate-row small { color: var(--text-3); font-size: .72rem; }
.rate-row.good .bar > span { background: var(--ok); }
.rate-row.mid .bar > span { background: #d4a017; }
.rate-row.low .bar > span { background: var(--bad); }
.misconceptions { margin-top: 1.1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--bad-soft); display: grid; gap: .4rem; font-size: .86rem; }
.misconceptions .kicker { color: var(--bad); }
.matrix-scroll { overflow-x: auto; margin-top: 1rem; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.matrix th { position: sticky; top: 0; padding: .55rem .5rem; background: var(--ink); color: #fff; font-size: .74rem; text-align: center; }
.matrix th:first-child { text-align: left; border-radius: 10px 0 0 10px; }
.matrix th:last-child { border-radius: 0 10px 10px 0; }
.matrix td { padding: .45rem .5rem; text-align: center; border-bottom: 1px solid var(--line); }
.matrix td.nm { text-align: left; font-weight: 750; }
.matrix td.pt { font-weight: 800; font-variant-numeric: tabular-nums; }
.matrix tr.pending td.pt { font-style: italic; color: var(--text-3); font-weight: 600; }
.matrix td.tm { color: var(--text-3); font-size: .76rem; white-space: nowrap; }
.matrix td.mk .icon { width: 1.35rem; height: 1.35rem; padding: .25rem; border-radius: 50%; }
.matrix td.right .icon { background: var(--ok); color: #fff; }
.matrix td.wrong .icon { background: var(--bad); color: #fff; }
.matrix td.open .icon { color: var(--text-3); padding: 0; }
.matrix tbody tr:hover td { background: var(--surface-2); }
.legend-line { margin-top: .8rem; }
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.term-card { display: grid; gap: .45rem; align-content: start; padding: .9rem; border-radius: 12px; background: var(--surface-2); }
.term-card > strong { font-size: .88rem; }
.term-card > small { color: var(--text-3); font-size: .74rem; margin-top: -.3rem; }
.term-card .bar > span { background: var(--info); }
.answer-grid p.sol { color: var(--ok); font-size: .8rem; font-weight: 700; margin-top: .35rem; }

.qr-wrap { position: relative; }
.qr.locked svg { opacity: .12; filter: blur(2px); }
.qr-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; color: var(--ink); font-weight: 800; text-align: center; padding: 2rem; }
.qr-lock .icon { width: 2rem; height: 2rem; color: var(--pink); }
.join-url.small { font-size: clamp(.8rem, 2vw, 1rem); }
.join-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.switch.on-dark { background: #262330; border-color: #45404f; color: #fff; }
.btn.on-dark { background: transparent; color: #fff; border-color: #5a5466; }
.join-body .btn-ghost:hover { background: #2a2733; color: #fff; }

/* ---------- index.html ---------- */

.boot-card h1 { font-size: 1.8rem; margin: .4rem 0 .8rem; }
.boot-card .brand { margin-bottom: .6rem; }
.boot-list { margin: .4rem 0; padding-left: 1.2rem; display: grid; gap: .45rem; color: var(--text-2); font-size: .9rem; line-height: 1.5; }
.boot-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }

@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .fb-order { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: 2rem 1fr 3rem; }
  .rate-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .rate-row small { display: none; }
  .result-hero.single { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .overview-grid { grid-template-columns: 1fr; }
  .fo-tag { display: none; }
}

/* ---------- Pause ---------- */

.pause-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.35rem; padding: .45rem .8rem; border: 1px solid var(--ink-line); border-radius: 10px; background: transparent; color: #d7d3df; font-size: .84rem; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.pause-btn:hover:not(:disabled) { background: #2a2733; border-color: #6a6475; color: #fff; }
.pause-btn:disabled { opacity: .6; cursor: wait; }
.pause-card .btn.full { width: 100%; }
.pause-card form { display: grid; }
.pause-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pause-stat { display: grid; gap: .2rem; padding: .9rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pause-stat .icon { color: var(--pink); }
.pause-stat strong { font-size: 1.6rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pause-stat span { color: var(--text-3); font-size: .78rem; line-height: 1.3; }
.timer-frozen strong { font-family: var(--mono); }
.timer-frozen.urgent strong { color: var(--pink); }
.timer-frozen.over strong { color: var(--warn); }
.pause-progress { display: grid; gap: .4rem; }
.pause-progress .bar { background: var(--surface-3); height: .5rem; }
.pause-progress > span { color: var(--text-3); font-size: .8rem; }
.status.paused-s { background: var(--surface-3); color: var(--text-2); }
@media (max-width: 620px) { .pause-btn span { display: none; } }

/* ---------- Startseite mit Ergebnissen ---------- */

.home-hero { gap: 1.5rem; }
.home-trophy { position: relative; z-index: 1; align-self: center; width: min(22rem, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.home-trophy .orbit { position: absolute; border-radius: 50%; border: 1px dashed rgb(255 255 255 / .12); }
.home-trophy .o1 { inset: 0; animation: spin 40s linear infinite; }
.home-trophy .o2 { inset: 12%; border-style: solid; border-color: rgb(255 255 255 / .06); }
.home-trophy .bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffb1d2, #e8277c); box-shadow: 0 0 24px rgb(232 39 124 / .5); animation: floaty 6s ease-in-out infinite; }
.home-trophy .b1 { width: 1rem; height: 1rem; top: 6%; left: 22%; }
.home-trophy .b2 { width: .6rem; height: .6rem; top: 30%; right: 2%; animation-delay: -2s; }
.home-trophy .b3 { width: .8rem; height: .8rem; bottom: 10%; left: 8%; animation-delay: -4s; }
.trophy-ring { position: relative; width: 72%; aspect-ratio: 1; filter: drop-shadow(0 20px 40px rgb(232 39 124 / .25)); }
.trophy-ring svg { width: 100%; height: 100%; }
.tr-bg { fill: rgb(255 255 255 / .03); stroke: #34303f; stroke-width: 12; }
.tr-fg { fill: none; stroke: #ff4b9a; stroke-width: 12; stroke-linecap: round; animation: ring 1.6s var(--ease) .3s both; }
.trophy-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .1rem; }
.trophy-ring small { color: #ff8fbe; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.trophy-ring strong { font-size: clamp(3.4rem, 7vw, 5rem); line-height: .95; letter-spacing: -.06em; }
.trophy-ring span { color: #aaa6b7; font-size: .85rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1.4rem; max-width: 30rem; }
.hero-stats > div { display: grid; gap: .1rem; padding: .8rem .9rem; border: 1px solid rgb(255 255 255 / .08); border-radius: 14px; background: rgb(255 255 255 / .03); }
.hero-stats strong { font-size: 1.35rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stats span { color: #9c98a8; font-size: .74rem; }

.home-card { gap: 1.1rem; }
.home-card .btn.full { width: 100%; }
.home-card form { display: grid; }
.home-head { display: flex; align-items: center; gap: .9rem; }
.home-head h2 { margin-top: .15rem; }
.home-avatar { width: 3.2rem; height: 3.2rem; flex: none; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, #ff5fa2, #c81c67); color: #fff; font-size: 1.4rem; font-weight: 900; box-shadow: 0 10px 24px rgb(232 39 124 / .3); rotate: -4deg; }
.fine.center { text-align: center; }
.attempt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; max-height: 24rem; overflow-y: auto; }
.attempt { display: grid; gap: .7rem; padding: .85rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); animation: rise .45s var(--ease) both; }
.attempt:nth-child(2) { animation-delay: .07s; } .attempt:nth-child(3) { animation-delay: .14s; } .attempt:nth-child(4) { animation-delay: .21s; }
.attempt.latest { border-color: color-mix(in srgb, var(--pink) 45%, var(--line)); background: color-mix(in srgb, var(--pink-soft) 40%, var(--surface)); box-shadow: 0 10px 30px rgb(232 39 124 / .08); }
.attempt-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; }
.attempt-score { width: 3.3rem; height: 3.3rem; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; border-radius: 14px; color: #fff; background: var(--ok); }
.attempt-score[data-level=mid] { background: #c98f0c; }
.attempt-score[data-level=low] { background: var(--bad); }
.attempt-score strong { font-size: 1.45rem; letter-spacing: -.04em; }
.attempt-score span { font-size: .72rem; opacity: .85; }
.attempt-info { display: grid; gap: .2rem; min-width: 0; }
.attempt-info strong { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .95rem; }
.attempt-info > span { color: var(--text-3); font-size: .75rem; }
.attempt-info em { font-style: normal; padding: .1rem .4rem; border-radius: 6px; font-size: .64rem; font-weight: 800; }
.tag-new { background: var(--pink); color: #fff; }
.tag-delta.up { background: var(--ok-soft); color: var(--ok); }
.tag-delta.down { background: var(--bad-soft); color: var(--bad); }
.attempt-actions { display: flex; gap: .35rem; align-items: center; }
.attempt-actions .btn { min-height: 2.3rem; padding: .4rem .7rem; font-size: .82rem; }
.icon-btn.big { width: 2.3rem; height: 2.3rem; border-radius: 11px; text-decoration: none; }
.task-dots { display: grid; grid-template-columns: repeat(8, 1fr); gap: .3rem; }
.task-dots .dot { display: grid; place-items: center; height: 1.5rem; border-radius: 7px; font-family: var(--mono); font-size: .66rem; font-weight: 800; color: #fff; cursor: default; }
.task-dots .dot.ok { background: var(--ok); }
.task-dots .dot.bad { background: color-mix(in srgb, var(--bad) 85%, var(--surface)); }
.home-links { display: flex; align-items: center; gap: .6rem; color: var(--text-3); flex-wrap: wrap; justify-content: center; }
.subtle-link.as-btn { border: 0; background: none; padding: 0; cursor: pointer; }
a.pause-btn { text-decoration: none; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes floaty { 50% { translate: 0 -14px; } }
@media (max-width: 900px) {
  .home-trophy { width: 13rem; position: absolute; right: -1rem; top: 1rem; opacity: .9; }
  .home-hero .hero-copy { max-width: 60%; }
}
@media (max-width: 620px) {
  .home-trophy { position: static; width: 13.5rem; align-self: center; }
  .trophy-ring small { font-size: .52rem; letter-spacing: .1em; }
  .trophy-ring strong { font-size: 3rem; }
  .trophy-ring span { font-size: .7rem; }
  .home-hero { padding-bottom: 1.6rem; }
  .home-hero .hero-copy { max-width: none; }
  .hero-stats strong { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .attempt-top { grid-template-columns: auto 1fr; }
  .attempt-actions { grid-column: 1 / -1; }
  .attempt-actions .btn { flex: 1; }
}

/* ---------- Animationen ---------- */

@keyframes rise { from { opacity: 0; translate: 0 14px; } }
@keyframes pop { from { opacity: 0; scale: .92; } }
@keyframes stationIn { from { opacity: 0; translate: 24px 0; } }
@keyframes stationBack { from { opacity: 0; translate: -24px 0; } }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
@keyframes nudge { 50% { scale: 1.02; } }
@keyframes bubble { 0% { translate: 0 0; opacity: 0; } 15% { opacity: 1; } 100% { translate: 0 -10rem; opacity: 0; } }
@keyframes fill { from { inset: 62% 0 0; } to { inset: 38% 0 0; } }
@keyframes glow { 50% { translate: -3rem -2rem; scale: 1.1; } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgb(232 39 124 / .18); } }
@keyframes bob { 50% { translate: 0 -3px; } }
@keyframes wave { 50% { translate: 0 4px; } }
@keyframes draw { from { stroke-dashoffset: 220; } }
@keyframes ring { from { stroke-dasharray: 0 400; } }
@keyframes toPink { to { background: var(--to); } }
@keyframes confetti { to { translate: var(--x, 0) 110vh; rotate: var(--r, 540deg); opacity: .9; } }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgb(60 207 148 / 0); } 100% { box-shadow: 0 0 0 0 rgb(60 207 148 / 0); } }
@keyframes flash { from { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(232 39 124 / .15); } }

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

/* ---------- Responsiv ---------- */

@media (max-width: 1050px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .p-row { grid-template-columns: 1fr 1fr; }
  .evaluation-grid, .settings-grid { grid-template-columns: 1fr; }
  .options-graph { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .split-shell { grid-template-columns: 1fr; }
  .hero-side { min-height: 44vh; padding: 2rem 1.4rem; }
  .thermo-art { right: 2%; top: 0; scale: .6; }
  .hero-copy h1 { font-size: 3.2rem; }
  .hero-points { display: none; }
  .panel-side { padding: 1.5rem 1rem 2.5rem; }
  .lab-layout { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: .9rem 1rem; }
  .rail > h2, .rail-note, .rail > .kicker { display: none; }
  .rail-steps { display: flex; gap: .3rem; margin: .7rem 0 0; overflow-x: auto; scrollbar-width: none; }
  .rail-steps li { flex: none; }
  .rail-step { padding: .3rem; }
  .rail-text { display: none; }
  .task-area { padding: 1.3rem 1rem; }
  .answer-grid { grid-template-columns: 1fr; }
  .result-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .result-actions { justify-content: center; }
}
@media (max-width: 620px) {
  .thermo-art { display: none; }
  .hero-side { min-height: 0; gap: 2.2rem; }
  .topbar { height: 4rem; }
  .chip-user:not(.as-btn), .save-state span, .live-chip span { display: none; }
  .lab-layout { min-height: calc(100vh - 4rem); }
  .options-temps { grid-template-columns: 1fr 1fr; }
  .task-head { flex-direction: column; align-items: flex-start; }
  .task-nav { grid-template-columns: 1fr 1fr; }
  .nav-status { grid-column: 1 / -1; grid-row: 1; }
  .task-nav > .btn:last-of-type, .task-nav [data-next] { justify-self: end; }
  .split-visual { grid-template-columns: 1fr; }
  .split-visual > b { grid-column: auto; }
  .order-card { grid-template-columns: 1.8rem 1fr auto; }
  .order-grip { display: none; }
  .field-meta { flex-direction: column; gap: .5rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { padding: .9rem; }
  .stat > .icon { display: none; }
  .p-row { grid-template-columns: 1fr auto; }
  .p-station { display: none; }
  .p-progress { grid-column: 1 / -1; }
  .search { min-width: 0; width: 100%; }
  .submission-list summary { grid-template-columns: 1fr auto; }
  .submission-list time { display: none; }
  .station-heat { grid-template-columns: repeat(3, 1fr); }
  .tubes { grid-template-columns: repeat(2, 1fr); }
  .inline-form { flex-wrap: wrap; }
}

/* ---------- Druck / PDF ---------- */

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --shadow: none; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .topbar, .replay { display: none !important; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .result-shell { width: 100%; padding: 0; gap: .8rem; }
  .fb-station { break-inside: auto; }
  .fb-item { break-inside: avoid; }
  details.model { display: block; }
  details.model > * { display: block; }
  .ring-fg, .result-hero * { animation: none !important; }
}
