/* Klassenpuls – gemeinsames Stylesheet */
:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #1d2027;
  --muted: #626775;
  --line: #e0ddd4;
  --accent: #0d6b58;
  --accent-strong: #09503f;
  --accent-soft: #e2f0ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #1f7a3f;
  --ok-soft: #e3f4e8;
  --warn: #9a6200;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 4px 16px rgba(20, 22, 28, .06);
  --q0: #cf2e3f; --q1: #1d62c4; --q2: #e3a300; --q3: #1e864a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); line-height: 1.45; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; padding: .55em 1.05em; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { background: var(--surface-2); border-color: #cfcabe; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn.small { min-height: 34px; padding: .3em .7em; font-size: .9rem; }

.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: .55em .8em; border-radius: 10px;
  border: 1px solid #cfcabe; background: #fff;
}
.textarea { resize: vertical; min-height: 64px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 0 0 .3em; }
.hint { color: var(--muted); font-size: .9rem; }
.error-text { color: var(--danger); font-size: .92rem; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #22252c; color: #fff; padding: .7em 1.1em; border-radius: 10px; z-index: 100;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow); font-weight: 600;
}
.toast.bad { background: var(--danger); }

/* ------------------------------------------------------------------ */
/* Teilnehmende (Handy)                                                */
/* ------------------------------------------------------------------ */
.p-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .45em; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.conn { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4em; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9b5aa; }
.conn.on::before { background: #22a355; }
.conn.off { color: var(--danger); }
.conn.off::before { background: var(--danger); }

.p-main { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stack > * + * { margin-top: 14px; }
.p-kicker { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.p-question { font-size: 1.35rem; font-weight: 700; }
.p-center { text-align: center; }
.p-big-emoji { font-size: 2.6rem; line-height: 1; }
.code-input { font-size: 2rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .35em; }

.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 600;
}
.choice .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b8b3a7; display: grid; place-items: center; }
.choice.multi .mark { border-radius: 6px; }
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.choice.sel .mark { border-color: var(--accent); background: var(--accent); }
.choice.sel .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.choice.multi.sel .mark::after { border-radius: 2px; }
.choice:disabled { cursor: default; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: .3em .8em; font-weight: 600; }

.scale-item + .scale-item { border-top: 1px solid var(--line); padding-top: 16px; }
.scale-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.scale-btns button {
  flex: 1 0 calc(20% - 6px); min-width: 44px; min-height: 48px; border-radius: 10px; border: 2px solid var(--line);
  background: #fff; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums;
}
.scale-btns button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--muted); margin-top: 6px; }

.quiz-grid { display: grid; gap: 10px; }
.quiz-btn {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 0; border-radius: 12px;
  color: #fff; font-weight: 700; font-size: 1.05rem; text-align: left; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18);
}
.quiz-btn .sym { font-size: 1.3rem; width: 1.4em; text-align: center; flex: none; }
.q-0 { background: var(--q0); } .q-1 { background: var(--q1); } .q-2 { background: var(--q2); color: #1d2027; } .q-3 { background: var(--q3); }
.quiz-btn.dim { opacity: .35; }
.timer-bar { height: 10px; border-radius: 99px; background: #e6e2d8; overflow: hidden; }
.timer-bar > div { height: 100%; background: var(--accent); width: 100%; transform-origin: left; }
.result-banner { border-radius: var(--radius); padding: 22px; text-align: center; }
.result-banner.good { background: var(--ok-soft); color: var(--ok); }
.result-banner.bad { background: var(--danger-soft); color: var(--danger); }
.result-banner.neutral { background: #eeebe3; color: var(--muted); }
.result-banner .headline { font-size: 1.6rem; font-weight: 800; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Lehrkraft: Verwaltung                                               */
/* ------------------------------------------------------------------ */
.h-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.h-main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 120px; }
.h-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.h-row.between { justify-content: space-between; }
.h-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.live-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--accent); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
}
.live-banner .btn { border-color: rgba(255,255,255,.4); }
.live-pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #7df0c6; margin-right: .5em; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(125,240,198,.7); } 70% { box-shadow: 0 0 0 10px rgba(125,240,198,0); } 100% { box-shadow: 0 0 0 0 rgba(125,240,198,0); } }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.set-card { display: flex; flex-direction: column; gap: 10px; }
.set-card h3 { font-size: 1.1rem; }
.set-card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .76rem; font-weight: 700; padding: .2em .6em; border-radius: 999px; background: #ece9e0; color: #4b4f5a; }
.badge.poll { background: #e4ecfa; color: #1d4f9c; }
.badge.wordcloud { background: #f6e9dc; color: #8a4a12; }
.badge.scale { background: #ece6f8; color: #5b3aa0; }
.badge.quiz { background: #fbe4e6; color: #a32231; }
.badge.match { background: #dff0ec; color: #12655a; }
.badge.speed { background: #fdeccd; color: #8a5a06; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

.q-card { position: relative; }
.q-card + .q-card { margin-top: 16px; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-num { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-head .spacer { flex: 1; }
.q-grid { display: grid; gap: 14px; }
.q-grid.two { grid-template-columns: 1fr 1fr; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row + .opt-row { margin-top: 8px; }
.opt-row .input { flex: 1; }
.correct-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.correct-toggle input { width: 18px; height: 18px; accent-color: var(--ok); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.q-warn { color: var(--warn); font-size: .88rem; font-weight: 600; margin-top: 10px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; align-items: center; }
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 24px; display: flex; justify-content: center; z-index: 20;
}
.save-bar .inner { max-width: 1040px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .q-grid.two { grid-template-columns: 1fr; }
  .h-main { padding: 20px 16px 140px; }
  .h-top { padding: 10px 16px; }
}

/* ------------------------------------------------------------------ */
/* Lehrkraft: Präsentation (Beamer)                                    */
/* ------------------------------------------------------------------ */
body.presenting { overflow: hidden; background: #fbfaf6; }
.pr { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.pr-top { display: flex; align-items: center; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.pr-join { display: flex; align-items: center; gap: 14px; min-width: 0; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.pr-join .qr-mini { width: 58px; height: 58px; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.pr-join .qr-mini svg { display: block; width: 100%; height: 100%; }
.pr-join-text { font-size: 1.05rem; color: var(--muted); min-width: 0; }
.pr-join-text strong { color: var(--ink); }
.pr-join-text .url { overflow-wrap: anywhere; }
.pr-code { font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.pr-top .spacer { flex: 1; }
.pr-meta { display: flex; align-items: center; gap: 22px; font-size: 1.15rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pr-meta .people { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pr-meta svg { width: 22px; height: 22px; }

.pr-stage { padding: 28px 48px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.pr-qtext { font-size: clamp(1.6rem, 3.3vw, 3rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; max-width: 1400px; }
.pr-sub { font-size: clamp(1rem, 1.5vw, 1.35rem); color: var(--muted); margin-top: 8px; font-weight: 600; }
.pr-results { flex: 1; min-height: 0; margin-top: 28px; display: flex; flex-direction: column; justify-content: center; }

.bars { display: grid; gap: clamp(10px, 1.6vh, 22px); max-width: 1400px; width: 100%; }
.bar-row .bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: clamp(1.05rem, 1.8vw, 1.7rem); font-weight: 700; margin-bottom: 6px; }
.bar-row .bar-label .val { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.bar-track { height: clamp(18px, 3.4vh, 40px); background: #ebe7dd; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 8px; transition: width .6s cubic-bezier(.2,.8,.2,1); }

.cloud { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: center; gap: .15em .6em; padding: 10px; overflow: hidden; }
.cloud .w { font-weight: 800; line-height: 1.05; transition: opacity .3s; cursor: pointer; border-radius: 6px; padding: 0 .1em; letter-spacing: -.01em; }
.cloud .w:hover { background: rgba(0,0,0,.05); }
.cloud .w.is-hidden { opacity: .25; text-decoration: line-through; }
.cloud .w.new { animation: pop .45s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.scale-rows { display: grid; gap: clamp(14px, 3vh, 36px); max-width: 1400px; width: 100%; }
.scale-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.scale-row .stmt { font-size: clamp(1.05rem, 1.8vw, 1.65rem); font-weight: 700; }
.histo { display: flex; align-items: flex-end; gap: 4px; height: clamp(50px, 9vh, 110px); padding-top: 20px; box-sizing: content-box; }
.histo .col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.histo .col .b { position: relative; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; transition: height .6s cubic-bezier(.2,.8,.2,1); min-height: 2px; opacity: .85; }
.histo .col .n { position: absolute; left: 0; right: 0; bottom: 100%; padding-bottom: 2px; text-align: center; font-size: .85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.histo-axis { display: flex; gap: 4px; margin-top: 4px; }
.histo-axis span { flex: 1; text-align: center; font-weight: 700; color: var(--muted); font-size: .95rem; }
.avg { font-size: clamp(1.8rem, 3.4vw, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.avg small { display: block; font-size: .9rem; color: var(--muted); font-weight: 700; }
.scale-legend { display: flex; justify-content: flex-end; gap: 24px; color: var(--muted); font-weight: 600; margin-bottom: 10px; max-width: 1400px; }

.hidden-results { flex: 1; display: grid; place-items: center; text-align: center; }
.hidden-results .count { font-size: clamp(4rem, 12vw, 10rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.hidden-results .lbl { font-size: 1.5rem; font-weight: 700; color: var(--muted); }

.quiz-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 2vh, 20px); max-width: 1400px; width: 100%; }
.quiz-tile {
  position: relative; display: flex; align-items: center; gap: 16px; padding: clamp(14px, 2.4vh, 28px) 24px; border-radius: 16px; color: #fff;
  font-size: clamp(1.1rem, 2vw, 1.9rem); font-weight: 800; overflow: hidden; min-height: clamp(70px, 13vh, 140px);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.16); transition: opacity .3s, transform .3s;
}
.quiz-tile .sym { font-size: 1.4em; width: 1.3em; text-align: center; flex: none; }
.quiz-tile .txt { position: relative; flex: 1; }
.quiz-tile .cnt { position: relative; font-variant-numeric: tabular-nums; font-size: 1.2em; }
.quiz-tile .fill { position: absolute; left: 0; bottom: 0; top: 0; background: rgba(255,255,255,.2); transition: width .6s; width: 0; }
.quiz-tile.wrong { opacity: .32; }
.quiz-tile.right { transform: scale(1.02); box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 0 0 5px #fff, 0 0 0 9px var(--ok); }
.quiz-tile.right .check-badge { display: inline-grid; }
.check-badge { display: none; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: #fff; color: var(--ok); font-size: .9em; }
.quiz-status { display: flex; align-items: center; gap: 28px; margin-bottom: clamp(14px, 3vh, 30px); }
.countdown {
  width: clamp(90px, 12vh, 140px); height: clamp(90px, 12vh, 140px); border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: clamp(2.2rem, 5vh, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums;
  background: conic-gradient(var(--accent) var(--p, 100%), #e6e2d8 0); position: relative;
}
.countdown::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #fbfaf6; }
.countdown span { position: relative; }
.countdown.low { background: conic-gradient(var(--danger) var(--p, 100%), #e6e2d8 0); color: var(--danger); }
.answered-count { font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 700; color: var(--muted); }
.answered-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ready-note { font-size: clamp(1.2rem, 2.2vw, 2rem); color: var(--muted); font-weight: 700; }

.lb { display: grid; gap: 10px; max-width: 1100px; width: 100%; margin: 0 auto; }
.lb-row { display: grid; grid-template-columns: 3.2em 1fr auto auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: clamp(8px, 1.4vh, 16px) 22px; font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 700; }
.lb-row .rank { font-size: 1.1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row.top1 { border-color: #e3b200; background: #fff8dc; }
.lb-row.top2 { background: #f3f4f6; }
.lb-row.top3 { background: #fbefe4; }
.lb-row .pts { font-variant-numeric: tabular-nums; }
.lb-row .x { opacity: 0; font-size: .9rem; }
.lb-row:hover .x { opacity: 1; }

.join-slide { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; max-width: 1500px; margin: 0 auto; width: 100%; }
.join-qr { width: clamp(220px, 52vh, 560px); aspect-ratio: 1; max-width: 100%; background: #fff; border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.join-qr svg { width: 100%; height: 100%; display: block; }
.join-steps { display: grid; gap: clamp(14px, 3vh, 34px); }
.join-steps .step { font-size: clamp(1.3rem, 2.6vw, 2.4rem); font-weight: 700; color: var(--muted); }
.join-steps .step strong { color: var(--ink); display: block; font-size: 1.15em; overflow-wrap: anywhere; }
.join-steps .code-big { font-size: clamp(3.5rem, 9vw, 8rem); font-weight: 800; letter-spacing: .1em; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.join-people { font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 700; }
.nick-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; max-height: 22vh; overflow: hidden; }
.nick-cloud span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .2em .8em; font-weight: 700; font-size: 1.05rem; }

.pr-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; background: #fff; border-top: 1px solid var(--line); }
.pr-bar .group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-bar .spacer { flex: 1; }
.pr-bar .select { width: auto; max-width: 320px; }
.pr-bar .btn { min-height: 40px; }
body.fs-idle .pr-bar { opacity: 0; transition: opacity .4s; }
body.fs-idle .pr-bar:hover { opacity: 1; }
.pr-ended { flex: 1; display: grid; place-items: center; text-align: center; }

@media (max-width: 900px) {
  .pr-stage { padding: 18px 20px; }
  .pr-top { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .join-slide { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .join-qr { width: min(60vw, 320px); }
  .scale-row { grid-template-columns: 1fr; gap: 8px; }
  .avg { text-align: left; }
  .quiz-tiles { grid-template-columns: 1fr; }
  .pr-meta { gap: 12px; font-size: 1rem; }
}

/* ------------------------------------------------------------------ */
/* Zuordnung: Bilder und Begriffe                                      */
/* ------------------------------------------------------------------ */
/* Editor */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.img-card { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface-2); display: grid; gap: 6px; }
.img-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #ece9e0; }
.img-no { font-weight: 700; font-size: .85rem; color: var(--muted); }
.small-input { min-height: 36px; font-size: .9rem; }

/* Beamer */
.match-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: clamp(12px, 2vw, 26px); width: 100%; }
.match-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.match-card img { width: 100%; height: clamp(90px, 26vh, 300px); object-fit: cover; border-radius: 10px; background: #ece9e0; }
.match-cap { font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.4rem); }
.match-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.match-chip { background: #ece9e0; border-radius: 999px; padding: .25em .8em; font-weight: 700; font-size: clamp(.9rem, 1.2vw, 1.25rem); }
.match-chip.solved { background: var(--ok-soft); color: var(--ok); display: inline-flex; align-items: baseline; gap: .5em; }
.match-chip.solved b { font-variant-numeric: tabular-nums; opacity: .75; font-size: .85em; }
.match-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: clamp(10px, 2vh, 24px); }

/* Handy */
.p-match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-match-card {
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 8px; display: grid; gap: 6px;
  align-content: start; text-align: left; font: inherit;
}
.p-match-card.target:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.p-match-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #ece9e0; }
.p-match-cap { font-weight: 700; font-size: .9rem; }
.p-match-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.p-chip-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.p-chip {
  border: 2px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: .4em .9em;
  font-weight: 600; font-size: .95rem; min-height: 40px; text-align: left;
}
.p-chip.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.p-chip.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.p-chip.ok::after { content: " ✓"; }
.p-chip.fix { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.p-chip:disabled { cursor: default; }
@media (max-width: 380px) { .p-match-grid { grid-template-columns: 1fr; } }

/* Signatur der Lehrkraft */
.sig { text-align: center; color: var(--muted); font-size: .82rem; margin: 22px 0 32px; }
.join-sig { grid-column: 1 / -1; text-align: right; color: var(--muted); font-weight: 600; font-size: clamp(.85rem, 1.1vw, 1.1rem); }

/* Ordner, Kategorien, Bibliothek */
.folder-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: .5em; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: .35em .9em; font-weight: 600; min-height: 36px;
}
.chip-btn:hover { border-color: #cfcabe; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-btn .n { font-variant-numeric: tabular-nums; opacity: .7; font-size: .85em; }
.cat-chip {
  display: inline-flex; align-items: center; gap: .3em; background: #ece9e0; color: #4b4f5a;
  border-radius: 999px; padding: .2em .3em .2em .8em; font-weight: 600; font-size: .85rem;
}
.cat-chip .x { border: 0; background: none; color: inherit; font-size: .9em; padding: 0 .35em; line-height: 1; opacity: .6; }
.cat-chip .x:hover { opacity: 1; }
.modal-overlay { position: fixed; inset: 0; background: rgba(20,22,28,.45); display: grid; place-items: center; padding: 16px; z-index: 200; }
.modal-card { width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { flex: none; }
.modal-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 4px; }
.modal-foot { flex: none; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.modal-foot:empty { display: none; }
/* Scrollleisten sichtbar lassen – sonst merkt niemand, dass es weitergeht */
.modal-body, .lib-list, .pick-list { scrollbar-width: thin; scrollbar-color: #b9b3a5 transparent; }
.modal-body::-webkit-scrollbar, .lib-list::-webkit-scrollbar, .pick-list::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-thumb, .lib-list::-webkit-scrollbar-thumb, .pick-list::-webkit-scrollbar-thumb { background: #b9b3a5; border-radius: 99px; border: 2px solid #fff; }
/* Auswahllisten mit vielen Einträgen: eigener Scrollbereich statt endloser Dialog */
.pick-list { max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fcfbf8; }
.pick-list .check { display: inline-flex; margin: 0 14px 6px 0; }
.pick-empty { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.tag-list { max-height: 46vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b9b3a5 transparent; padding-right: 4px; }
.tag-list::-webkit-scrollbar { width: 10px; }
.tag-list::-webkit-scrollbar-thumb { background: #b9b3a5; border-radius: 99px; border: 2px solid #fff; }
.lib-list { max-height: 48vh; overflow: auto; }
.lib-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.lib-row + .lib-row { margin-top: 8px; }

/* Auswertung */
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile b { display: block; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat-line { display: grid; grid-template-columns: 1fr 200px auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.stat-line:last-child { border-bottom: 0; padding-bottom: 0; }
.rate { display: flex; align-items: center; gap: 10px; }
.rate-track { flex: 1; height: 12px; background: #ebe7dd; border-radius: 6px; overflow: hidden; }
.rate-fill { height: 100%; border-radius: 6px; }
.rate-fill.ok, .rate-ok { background: var(--ok); }
.rate-fill.mid, .rate-mid { background: #b8860b; }
.rate-fill.low, .rate-low { background: var(--danger); }
.rate-val { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.4em; text-align: right; }
b.rate-ok { background: none; color: var(--ok); }
b.rate-mid { background: none; color: #8a6200; }
b.rate-low { background: none; color: var(--danger); }
.trend { width: 100%; height: auto; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .axis { fill: var(--muted); font-size: 11px; font-weight: 600; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend-dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.trend-label { fill: var(--ink); font-size: 13px; font-weight: 700; }
@media (max-width: 720px) {
  .stat-line { grid-template-columns: 1fr; gap: 6px; }
}


/* ---------------------------------------------------------------- Aussagen-Check */
/* Antwortknöpfe: klar unterscheidbare Farben, auch am Beamer aus der letzten Reihe */
.badge.key0, .p-key.k0 { background: #d8ecdc; color: #14532d; }
.badge.key1, .p-key.k1 { background: #fbdfe2; color: #8d1a28; }
.badge.key2, .p-key.k2 { background: #e0eafb; color: #1a4a92; }
.badge.key3, .p-key.k3 { background: #f1e6fa; color: #55308f; }

/* Editor */
.speed-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.speed-row .input { flex: 1 1 260px; }
.q-num.small { width: 22px; height: 22px; font-size: .78rem; }
.speed-keys { display: flex; gap: 6px; flex-wrap: wrap; }

/* Präsentation */
.speed-legend { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.speed-legend .badge { font-size: 1rem; padding: .3em .9em; }
.speed-result { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.speed-sum { text-align: center; font-size: 1.1rem; margin-bottom: 8px; color: var(--muted); }
.speed-res-row { display: grid; grid-template-columns: 1fr auto 160px 62px; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: #fff; }
.speed-res-row.weak { background: #fdeef0; }
.speed-res-text { font-size: 1.05rem; }
.speed-res-bar { height: 12px; border-radius: 999px; background: #e7e3d9; overflow: hidden; }
.speed-res-bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.speed-res-row.weak .speed-res-bar > span { background: var(--q0); }

/* Schüleransicht */
.p-key { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; padding: .5em 1em; border-radius: 12px; border: 2px solid transparent; }
.speed-keys.big { gap: 12px; justify-content: center; }
.speed-keys.big .p-key { font-size: 1.3rem; padding: .9em 1.4em; min-width: 7.5rem; }
.p-key.dim { opacity: .35; }
.p-key.live { cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.14); }
.p-key.live:active { transform: translateY(2px); box-shadow: none; }
.speed-play { min-height: 60vh; justify-content: center; }
.speed-progress { font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.speed-text { font-size: 1.45rem; line-height: 1.35; margin: 10px 0 4px; }
.speed-ring { height: 8px; border-radius: 999px; background: #e7e3d9; overflow: hidden; margin: 6px 0 14px; }
.speed-ring > span { display: block; height: 100%; width: 100%; background: var(--accent, #0d6b58); transform-origin: left center; }
.speed-ring.run > span { animation: speed-shrink linear forwards; }
@keyframes speed-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.speed-review { display: flex; flex-direction: column; gap: 6px; }
.speed-rev-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #f6f4ee; }
.speed-rev-row.ok { background: var(--ok-soft); }
.speed-rev-row.bad { background: #fdeef0; }
.speed-rev-text { flex: 1; font-size: .96rem; }
.speed-rev-mark { font-weight: 800; }
.speed-rev-row.ok .speed-rev-mark { color: var(--ok); }
.speed-rev-row.bad .speed-rev-mark { color: var(--q0); }

@media (max-width: 640px) {
  .speed-res-row { grid-template-columns: 1fr auto; }
  .speed-res-bar { display: none; }
}

/* Import-Dialog */
.code-sample { background: #f3f1ea; border-radius: 10px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; white-space: pre-wrap; overflow-x: auto; margin: 8px 0 0; }
