/* ===================================================== QuizE Design-System */
:root {
  --brand: #6c4cf1;
  --brand-2: #8b6cff;
  --brand-ink: #4b2fd0;
  --pink: #ff4f8b;
  --yellow: #ffc531;
  --teal: #14b8a6;
  --green: #16c172;
  --red: #ff4d5e;

  /* Hell: neutrales Grau/Weiß (Akzentfarben oben bleiben) */
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eff0f3;
  --line: #e1e3e8;
  --text: #16181d;
  --muted: #626977;
  --ink: #1d1f24; /* dunkle Flächen wie Toasts, auch im hellen Modus */
  --shadow: 0 1px 2px rgba(16, 18, 24, .06), 0 8px 24px rgba(16, 18, 24, .08);
  --shadow-lg: 0 4px 10px rgba(16, 18, 24, .08), 0 24px 60px rgba(16, 18, 24, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ease: cubic-bezier(.2, .9, .3, 1.2);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
/* Dunkel: neutrales Anthrazit – nur, wenn gewählt (Standard ist Hell) */
:root[data-theme="dark"] {
  --bg: #0e0f12; --bg-2: #15171b; --surface: #1b1d22; --surface-2: #24272d; --line: #33373f;
  --text: #f2f3f5; --muted: #9aa0ab; --brand-ink: #b9a8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
  --ink: #2a2d34;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .6em 1.2em; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1rem; letter-spacing: .01em;
  background: var(--surface-2); color: var(--text);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
  user-select: none; -webkit-user-select: none; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 18px rgba(108, 76, 241, .35); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: rgba(255, 77, 94, .12); color: var(--red); }
.btn.danger:hover { background: rgba(255, 77, 94, .2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.big { min-height: 60px; font-size: 1.2rem; padding: .7em 1.6em; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 44px; border-radius: 50%; font-size: 1.15rem; }
.btn .kbd { font-size: .72em; opacity: .6; font-weight: 600; border: 1px solid currentColor; border-radius: 5px; padding: 0 .35em; }

/* ---------------------------------------------------------------- Formulare */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 700; font-size: .9rem; color: var(--muted); }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px; font-size: 16px; /* 16px: kein iOS-Zoom */
  border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(108, 76, 241, .15); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.error-msg { color: var(--red); font-weight: 700; min-height: 1.4em; font-size: .95rem; }

/* ---------------------------------------------------------------- Karten, Toasts */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
#toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease); text-align: center; }
.toast.error { background: var(--red); }
.toast.ok { background: var(--green); }
.toast.out { opacity: 0; transform: translateY(10px); transition: .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; background: conic-gradient(from 200deg, var(--brand), var(--pink), var(--yellow), var(--brand)); box-shadow: 0 4px 14px rgba(108, 76, 241, .35); }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hell/Dunkel-Schalter */
.theme-btn { min-width: 44px; justify-content: center; }
.theme-corner { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 50; }
button.pill.theme-btn { border: 0; cursor: pointer; min-width: 40px; min-height: 36px; }

/* ===================================================== SCHÜLER (mobil zuerst) */
.student {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior: none;
}
.s-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; min-height: 60px; }
.s-top .who { display: flex; align-items: center; gap: 8px; font-weight: 800; max-width: 60%; }
.s-top .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .95rem; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: .9rem; }
.s-main { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 20px; width: 100%; max-width: 760px; margin: 0 auto; }
.s-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; }
.screen-in { animation: screenIn .45s var(--ease-out) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.join-card { width: 100%; max-width: 420px; padding: 28px 22px; text-align: center; }
.join-card h1 { margin: 6px 0 4px; font-size: clamp(1.6rem, 6vw, 2.1rem); letter-spacing: -.02em; }
.join-card p { margin: 0 auto 20px; color: var(--muted); }
.join-title {
  margin: -6px -4px 18px; padding: 0 4px 16px; border-bottom: 1px solid var(--line);
  font-weight: 800; font-size: 1.08rem; line-height: 1.3; color: var(--text);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.code-input {
  width: 100%; text-align: center; font-size: 2.2rem; font-weight: 900; letter-spacing: .25em;
  padding: 14px 10px 14px calc(10px + .25em); border-radius: 16px; border: 3px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s; min-height: 76px;
}
.code-input::placeholder { color: var(--muted); opacity: .35; }
.code-input:focus { border-color: var(--brand); box-shadow: 0 0 0 5px rgba(108, 76, 241, .15); }
.code-input.shake, .shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.s-foot { font-size: .85rem !important; font-weight: 600; color: var(--muted); max-width: none !important; }
.s-foot a, .auth-card a { color: var(--brand-ink); }
.name-row { display: flex; gap: 8px; }
.name-row .input { font-size: 1.2rem; font-weight: 700; text-align: center; min-height: 60px; }

.q-head { margin: 4px 0 16px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.q-title { font-size: clamp(1.35rem, 5.2vw, 2rem); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }

.timer-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 10px 0 0; }
.timer-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); background-size: 300% 100%; transform-origin: left; border-radius: 99px; }

/* Antwortknöpfe */
.opts { display: grid; gap: 12px; }
@media (min-width: 600px) { .opts.two { grid-template-columns: 1fr 1fr; } }
@media (orientation: landscape) and (max-height: 500px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 68px; padding: 14px 18px; border-radius: 18px; border: 0; color: #fff;
  font-size: 1.15rem; font-weight: 800; background: var(--c); overflow-wrap: anywhere;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .18), 0 10px 20px rgba(0, 0, 0, .1);
  transition: transform .15s var(--ease), box-shadow .15s, opacity .25s, filter .2s;
  animation: optIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes optIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
.opt:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
/* Quiz: große Kacheln, die den Bildschirm füllen – schnell zu treffen */
.opts.quiz { flex: 1; grid-auto-rows: minmax(72px, 1fr); margin-bottom: calc(12px + env(safe-area-inset-bottom)); max-height: 70vh; }
.opts.quiz .opt { font-size: clamp(1.15rem, 3.6vw, 1.7rem); flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.opts.quiz .opt .letter { width: 44px; height: 44px; font-size: 1.2rem; }
.opts.quiz .opt .otext { flex: 0 1 auto; }
@media (max-width: 599px) { .opts.quiz .opt { flex-direction: row; justify-content: flex-start; text-align: left; } }
@media (min-width: 600px) { .opt { min-height: 84px; font-size: 1.3rem; } }
.opt .letter { flex: none; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .25); display: grid; place-items: center; font-weight: 900; }
.opt.selected { outline: 4px solid var(--text); outline-offset: 3px; }
.opt.selected .letter::after { content: "✓"; }
.opt.selected .letter span { display: none; }
.opts.locked .opt:not(.selected) { opacity: .35; filter: saturate(.4); }
.opts.locked .opt { pointer-events: none; }

.scale-btns { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; }
.scale-btns button {
  aspect-ratio: 1; min-height: 52px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface);
  font-size: clamp(1.1rem, 5vw, 1.6rem); font-weight: 900; transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s;
  animation: optIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.scale-btns button.on { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.08); }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; font-size: 1rem; margin-top: 8px; gap: 12px; }
.scale-labels span:last-child { text-align: right; }
.scale-emoji { font-size: 4rem; text-align: center; height: 5rem; transition: transform .25s var(--ease); }

.text-entry { display: grid; gap: 10px; }
.text-entry .input { font-size: 1.15rem; min-height: 60px; }
.text-entry textarea.input { min-height: 120px; }
.counter { text-align: right; color: var(--muted); font-size: .85rem; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; animation: pop .4s var(--ease) both; overflow-wrap: anywhere; }
.chip.long { border-radius: 16px; font-weight: 600; text-align: left; width: 100%; line-height: 1.4; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.rank-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow); font-weight: 800; font-size: 1.05rem; min-height: 64px;
  transition: transform .2s var(--ease-out), box-shadow .2s; user-select: none; -webkit-user-select: none;
  touch-action: none; cursor: grab; -webkit-touch-callout: none;
}
.rank-item .pos { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 900; }
.rank-item .txt { flex: 1; overflow-wrap: anywhere; }
.rank-item .moves { display: flex; gap: 4px; }
.rank-item .moves button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 1.1rem; }
.rank-item .moves button:disabled { opacity: .3; }
.rank-item.dragging { box-shadow: var(--shadow-lg); transform: scale(1.03); z-index: 2; position: relative; }
.grip { color: var(--muted); font-size: 1.3rem; width: 22px; display: grid; place-items: center; pointer-events: none; }
.rank-item.dragging { transition: box-shadow .2s; cursor: grabbing; background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.rank-item .moves button { touch-action: manipulation; cursor: pointer; }

.submit-bar { position: sticky; bottom: 0; padding: 14px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: auto; isolation: isolate; }
/* Inhalt, der darunter scrollt, verschwimmt sanft – ohne einfarbigen Kasten über dem Farbverlauf des Hintergrunds */
.submit-bar::before { content: ""; position: absolute; inset: 0 -16px; z-index: -1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); pointer-events: none; }

/* Status-Bildschirme */
.big-emoji { font-size: clamp(4rem, 20vw, 6.5rem); line-height: 1; animation: bounceIn .7s var(--ease) both; }
@keyframes bounceIn { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.s-center h2 { margin: 0; font-size: clamp(1.5rem, 6vw, 2.2rem); letter-spacing: -.02em; }
.s-center p { margin: 0; color: var(--muted); font-size: 1.1rem; max-width: 30ch; }
.pulse-dots { display: flex; gap: 8px; }
.pulse-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: dot 1.2s infinite ease-in-out; }
.pulse-dots i:nth-child(2) { animation-delay: .15s; background: var(--pink); }
.pulse-dots i:nth-child(3) { animation-delay: .3s; background: var(--yellow); }
@keyframes dot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1.1); opacity: 1; } }
.check-circle { width: 110px; height: 110px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 3.6rem; font-weight: 900; animation: bounceIn .6s var(--ease) both; box-shadow: 0 12px 30px rgba(22, 193, 114, .4); }

.reveal { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; text-align: center; padding: 24px; z-index: 50; animation: screenIn .4s var(--ease-out); }
.reveal.good { background: radial-gradient(circle at 50% 30%, #2ee59d, #0f9d63); }
.reveal.bad { background: radial-gradient(circle at 50% 30%, #ff7a85, #d63447); }
.reveal.none { background: radial-gradient(circle at 50% 30%, #8a7dff, #5a43d6); }
.reveal h2 { font-size: clamp(2rem, 9vw, 3rem); margin: 0; }
.reveal .points { font-size: clamp(2.6rem, 12vw, 4rem); font-weight: 900; animation: bounceIn .7s .15s var(--ease) both; }
.reveal .sub { font-size: 1.15rem; font-weight: 700; opacity: .9; }
.reveal .score-pill { background: rgba(255, 255, 255, .2); padding: 10px 20px; border-radius: 999px; font-weight: 900; font-size: 1.15rem; }

.my-rank { font-size: clamp(3rem, 16vw, 5rem); font-weight: 900; background: linear-gradient(135deg, var(--brand), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.mini-board { width: 100%; max-width: 420px; display: grid; gap: 8px; }
.mini-board .row { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 800; animation: screenIn .4s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
.mini-board .row.me { outline: 3px solid var(--brand); }
.mini-board .row b { width: 26px; color: var(--muted); }
.mini-board .row span:not(.avatar) { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conn-banner { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: .9rem; z-index: 100; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-lg); animation: toastIn .3s; }
.conn-banner .spinner { width: 16px; height: 16px; border-width: 3px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }

/* ===================================================== LEHRER-APP */
.t-app { min-height: 100vh; min-height: 100dvh; }
.t-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.t-top .right { display: flex; align-items: center; gap: 8px; }
.t-wrap { max-width: 1640px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 80px; }
.t-wrap h1:not(.p-title) { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; margin: 0 0 4px; } /* nicht die Folien-Vorschau (Karten-Bild) */
.t-sub { color: var(--muted); margin: 0 0 24px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 30px 26px; }
.auth-card h1 { margin: 18px 0 4px; font-size: 1.7rem; }
.auth-card p { color: var(--muted); margin: 0 0 20px; }
.tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font-weight: 800; color: var(--muted); min-height: 44px; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.s-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s var(--ease-out), box-shadow .2s; animation: screenIn .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.s-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.s-card h3 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; cursor: pointer; }
.s-card .meta { color: var(--muted); font-size: .9rem; font-weight: 600; }
.s-card .types { display: flex; gap: 4px; font-size: 1.1rem; }
.s-card .actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.s-card .actions .btn { min-height: 38px; padding: .4em .9em; font-size: .9rem; }
.s-card .cover { height: 84px; border-radius: 12px; margin: -4px -4px 4px; background: linear-gradient(135deg, var(--a), var(--b)); display: flex; align-items: flex-end; padding: 10px; color: #fff; font-weight: 900; font-size: 1.6rem; cursor: pointer; }
.new-card { display: grid; place-items: center; text-align: center; gap: 6px; min-height: 210px; border: 3px dashed var(--line); background: transparent; box-shadow: none; color: var(--muted); font-weight: 800; border-radius: var(--radius); transition: border-color .2s, color .2s, background .2s; }
.new-card:hover { border-color: var(--brand); color: var(--brand); background: rgba(108, 76, 241, .05); }
.new-card .plus { font-size: 2.4rem; line-height: 1; }
.live-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.live-strip .live { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(255, 77, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big-emoji { margin-bottom: 10px; }

/* ===================================================== EDITOR */
.ed-top { gap: 10px; }
.ed-top .title-in { font-weight: 800; max-width: 420px; min-height: 42px; }
.save-state { font-size: .85rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.ed-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.tb-sep { width: 1px; align-self: stretch; background: var(--line); margin: 6px 2px; }
/* Breitbild (16:9-Monitor): drei Spalten über die volle Breite, jede scrollt für sich */
.t-app:has(> .ed2) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.ed2 { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(190px, 13vw, 270px) minmax(0, 1fr); }
.ed-list { overflow: auto; padding: 14px 12px 80px 16px; border-right: 1px solid var(--line); display: grid; gap: 10px; align-content: start; background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); min-height: 0; }
.ed-main { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 27vw, 540px); min-height: 0; }
.ed-center { overflow: auto; min-height: 0; padding: 20px clamp(16px, 2.2vw, 40px) 40px; display: flex; flex-direction: column; gap: 12px; }
/* Vorschau so groß wie möglich, aber immer komplett sichtbar (16:9 passend zur Fensterhöhe) */
.ed-center > div { width: min(100%, calc((100dvh - 230px) * 16 / 9)); margin: 0 auto; }
.ed-insp { overflow: auto; min-height: 0; padding: 18px 22px 120px; border-left: 1px solid var(--line); background: var(--surface); }
.ed-top .title-in { max-width: min(560px, 40vw); }
/* Schwierigkeitsstufen: Leiste unter dem Editor-Kopf, Balken-Symbol, Auswahl-Knöpfe */
.ed-levels { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); }
.ed-levels[hidden] { display: none; }
.ed-lv-k { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ed-lv-tabs { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ed-lv { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 6px 8px 6px 12px; min-height: 40px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s; }
.ed-lv:hover { border-color: color-mix(in srgb, var(--lc) 55%, var(--line)); }
.ed-lv.on { border-color: var(--lc); background: color-mix(in srgb, var(--lc) 13%, var(--surface)); }
.ed-lv.empty { border-style: dashed; color: var(--muted); }
.ed-lv:focus-visible { outline: 3px solid color-mix(in srgb, var(--lc) 45%, transparent); outline-offset: 1px; }
.ed-lv-c { min-width: 1.75em; padding: 1px 6px; border-radius: 999px; text-align: center; font-size: .8rem; background: color-mix(in srgb, var(--lc) 18%, transparent); }
.ed-lv.empty .ed-lv-c { background: color-mix(in srgb, var(--text) 8%, transparent); }
.ed-lv-more { margin-left: auto; flex: none; }
.lv-sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; vertical-align: -1px; }
.lv-sig i { width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.lv-sig i:nth-child(1) { height: 35%; } .lv-sig i:nth-child(2) { height: 55%; } .lv-sig i:nth-child(3) { height: 78%; } .lv-sig i:nth-child(4) { height: 100%; }
.lv-sig i.on { background: var(--lc); }
.sd-ic .lv-sig { height: 22px; gap: 3px; }
.sd-ic .lv-sig i { width: 6px; }
.sd-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sd-tiles.four .sd-tile { min-height: 0; padding: 12px; }
.sd-tiles.four .sd-ic { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 4px; }
.sd-tiles.four .sd-tile b { font-size: .95rem; overflow-wrap: anywhere; }
.sd-sum .lv-sig { margin-right: 2px; }
.lv-h { display: inline-flex; align-items: center; gap: 8px; }
.lv-h .lv-sig { height: 20px; } .lv-h .lv-sig i { width: 5px; }
.lv-from { display: grid; gap: 8px; margin: 14px 0 18px; }
.lv-from-btn { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.lv-from-btn:hover { border-color: var(--lc, var(--brand)); background: color-mix(in srgb, var(--lc, var(--brand)) 7%, var(--surface)); }
.lv-from-btn.on { border-color: var(--lc); }
.lv-from-btn .lv-sig { height: 20px; } .lv-from-btn .lv-sig i { width: 5px; }
.lv-from-btn small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; }
.lv-all { width: 23px; text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.set-sub { font-size: .8rem; margin-top: 2px; }
/* Stufen eines Quiz in Karten und Listen: vier Farbfelder in Schrifthöhe (blau, grün, gelb, rot) – fehlende blass umrandet */
.lv-dots { display: inline-flex; gap: 2.5px; margin-right: 6px; vertical-align: -.05em; line-height: 0; }
.lv-dots i { width: .7em; height: .7em; border-radius: 2px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 22%, transparent); }
.lv-dots i.on { background: var(--lc); box-shadow: none; }
.st-thumb > .lv-dots { display: none; position: absolute; left: 3px; bottom: 3px; z-index: 1; margin: 0; padding: 2px 3px; gap: 2px; border-radius: 4px; font-size: 10px; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: 0 1px 3px rgb(0 0 0 / .18); }
@media (max-width: 760px) {
  .ed-levels { padding: 6px 10px; gap: 6px; }
  .ed-lv-k { display: none; }
}
@media (max-width: 560px) {
  .ed-levels { gap: 4px; padding: 6px 8px; }
  .ed-lv-tabs { gap: 4px; }
  .ed-lv { padding: 4px 4px 4px 8px; gap: 4px; font-size: .88rem; }
  .ed-lv-c { min-width: 1.45em; padding: 1px 3px; }
  .ed-lv-more { width: 34px; min-width: 34px; padding: 0; }
  .ed-lv:not(.on) .ed-lv-n { display: none; }
  .sd-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .ed-main { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow: auto; }
  .ed-center { overflow: visible; padding-bottom: 0; }
  .ed-center > div { width: 100%; }
  .ed-insp { overflow: visible; border-left: 0; background: transparent; }
}
@media (max-width: 760px) {
  .t-app:has(> .ed2) { height: auto; display: block; }
  .ed2 { grid-template-columns: minmax(0, 1fr); }
  .ed-list { grid-auto-flow: column; grid-auto-columns: 150px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; position: sticky; top: 63px; z-index: 5; }
  .ed-main { overflow: visible; }
  .ed-center { padding: 12px 12px 0; }
  .ed-insp { padding: 12px 14px 120px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 1000px) {
  .ed-top { flex-wrap: wrap; }
  .ed-top .ed-left { order: 2; flex: 1 1 100%; }
  .ed-top .title-in { max-width: none; }
  .ed-top .right { margin-left: auto; }
}
/* Folienliste: Karten mit Farbe je Fragetyp (Streifen links, Nummer, Typ-Zeile) */
.ed-item { --kc: var(--brand); position: relative; display: grid; gap: 5px; padding: 7px 8px 8px 12px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 18, 24, .05);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .2s var(--ease-out); user-select: none; -webkit-user-select: none; }
.ed-item::after { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--kc); }
.ed-item:hover { border-color: color-mix(in srgb, var(--kc) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.ed-item.on { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 9%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kc) 24%, transparent), var(--shadow); } /* aktive Folie in ihrer Typfarbe */
.ed-item[data-k="choice"] { --kc: #6c4cf1; }
.ed-item[data-k="truefalse"] { --kc: #0ea5e9; }
.ed-item[data-k="wordcloud"] { --kc: #14b8a6; }
.ed-item[data-k="open"] { --kc: #3b82f6; }
.ed-item[data-k="scale"] { --kc: #f59e0b; }
.ed-item[data-k="ranking"] { --kc: #ec4899; }
.ed-item[data-k="estimate"] { --kc: #f97316; }
.ed-item[data-k="content"] { --kc: #64748b; }
.ed-item[data-k="video"] { --kc: #ef4444; }
.ed-item.during { margin-left: 18px; }
.ed-item.during::before { content: ""; position: absolute; left: -14px; top: -10px; bottom: 50%; width: 10px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 8px; }
.ed-thumbwrap { position: relative; }
/* Nummer als farbiges Schild oben links auf der Vorschau */
.ed-item .n { position: absolute; left: -4px; top: -4px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center;
  background: var(--kc); color: #fff; font-weight: 900; font-size: .8rem; line-height: 1; box-shadow: 0 2px 6px rgba(16, 18, 24, .25); border: 2px solid var(--surface); z-index: 1; }
.ed-item.on .n { background: var(--kc); transform: scale(1.08); }
.ed-item.dragging { opacity: .5; }
.ed-item.drop-before { box-shadow: 0 -3px 0 var(--brand); }
.ed-item.drop-after { box-shadow: 0 3px 0 var(--brand); }
.thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); position: relative; pointer-events: none; }
.thumb .stage *, .thumb .stage *::before, .thumb .stage *::after { animation: none !important; transition: none !important; }
.thumb-badge { position: absolute; right: 4px; bottom: 4px; font-size: .7rem; font-weight: 800; background: var(--surface); border-radius: 6px; padding: 1px 6px; box-shadow: var(--shadow); }
.ed-item .cap { font-size: .84rem; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ed-item .cap.untitled { color: var(--muted); font-weight: 700; }
.ed-item .kind { font-size: .72rem; font-weight: 800; color: color-mix(in srgb, var(--kc) 80%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -3px; }
.ed-add { display: grid; gap: 6px; margin-top: 6px; }
.ed-add .btn { width: 100%; }
@media (max-width: 760px) { .ed-add { grid-auto-flow: row; align-content: start; } .ed-item.during { margin-left: 0; } .ed-item.during::before { display: none; } .ed-item .cap, .ed-item .kind { display: none; } .ed-item { padding: 6px 6px 6px 11px; } }
/* Vorschau */
.pv-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 800; color: var(--muted); min-height: 34px; font-size: .88rem; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pv-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--bg); border: 1px solid var(--line); position: relative; }
.pv-phone { width: 300px; max-width: 100%; height: 560px; margin: 0 auto; border-radius: 36px; border: 10px solid #1d1f24; overflow: auto; background: var(--bg); box-shadow: var(--shadow-lg); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.pv-phone .q-title { font-size: 1.15rem; }
.pv-phone .opt { min-height: 50px; font-size: .95rem; padding: 10px 12px; animation: none; }
.pv-phone .opt .letter { width: 30px; height: 30px; }
.pv-notes { background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: .92rem; white-space: pre-wrap; color: var(--muted); }
.pv-notes b { color: var(--text); display: block; margin-bottom: 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
/* Inspektor */
.insp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.insp-head .input { width: auto; min-height: 40px; padding: 6px 12px; }
.field > .lbl-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.title-input { font-size: 1.25rem !important; font-weight: 800; }
textarea.title-input { min-height: 84px; }
.fmt-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.fmt-bar button { min-width: 34px; height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: .9rem; color: var(--text); }
.fmt-bar button:hover { border-color: var(--brand); color: var(--brand); }
/* Folientext: Fließtext oder Liste (ein Feld je Punkt) */
.text-field .seg button { padding: 4px 12px; min-height: 30px; font-size: .82rem; }
.le { display: grid; gap: 8px; }
.le-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.le-kinds .field { margin: 0; }
.le-kinds .field > span { font-size: .8rem; }
.le-kinds select.input { padding-block: 8px; }
.le .fmt-bar { margin: 0; }
.le-rows { display: grid; gap: 6px; }
.le-row { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) 34px 34px; align-items: center; gap: 6px; }
.le-row.sub { grid-template-columns: 4em minmax(0, 1fr) 34px 34px; }
.le-row .input { min-width: 0; padding-block: 9px; }
.le-mark { text-align: right; font-weight: 900; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.le-row.sub .le-mark { color: var(--muted); font-weight: 800; }
.le-btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 800; cursor: pointer; }
.le-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.le-del:hover:not(:disabled) { border-color: #e5484d; color: #e5484d; }
.le-btn:disabled { opacity: .3; cursor: default; }
.le-add { justify-self: start; }
.fmt-list small { font-size: .62em; margin-left: 2px; opacity: .7; }
.math-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.math-pal button { display: grid; gap: 2px; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-height: 54px; place-items: center; }
.math-pal button:hover { border-color: var(--brand); }
.math-pal small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.end-labels .settings-row { margin-bottom: 8px; }
.preset-details > small { display: block; margin: 8px 0 6px; font-size: .82rem; }
.preset-details summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .85rem; color: var(--text); user-select: none; }
.preset-details summary::-webkit-details-marker { display: none; }
.preset-details summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
.preset-details[open] summary::after { transform: rotate(180deg); }
.preset-details summary:hover { border-color: #f59e0b; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s; }
.preset-chip:hover { border-color: #f59e0b; }
.preset-chip.on { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); border-color: #f59e0b; }
.opt-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-edit .sw { width: 10px; align-self: stretch; border-radius: 6px; background: var(--c); flex: none; }
.opt-edit .input { flex: 1; min-height: 44px; }
.opt-edit .correct-toggle { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 1.2rem; flex: none; color: var(--muted); }
.opt-edit .correct-toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.opt-edit.drag-over { box-shadow: 0 -3px 0 var(--brand); }
.settings-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.settings-row .field { flex: 1; min-width: 120px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; font-weight: 700; cursor: pointer; }
.toggle-row small { display: block; color: var(--muted); font-weight: 600; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.layout-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.layout-pick button { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 6px; display: grid; gap: 4px; font-size: .74rem; font-weight: 800; color: var(--muted); }
.layout-pick button.on { border-color: var(--brand); color: var(--brand); }
.layout-pick svg { width: 100%; height: auto; }
.details { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.details summary { cursor: pointer; font-weight: 800; color: var(--muted); padding: 6px 0; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: "▸ "; }
.details[open] summary::before { content: "▾ "; }
.insp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.kbd-hint { font-size: .75rem; color: var(--muted); font-weight: 700; }
.theme-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-dot { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line); background: linear-gradient(135deg, var(--a), var(--b)); }
.theme-dot.on { box-shadow: 0 0 0 3px var(--text); }
.popover { position: absolute; z-index: 60; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px; width: 300px; border: 1px solid var(--line); animation: modalIn .25s var(--ease); }
/* ---------------------------------------------------------------- Bilder */
.img-zoom { position: fixed; inset: 0; z-index: 300; background: rgba(10, 8, 25, .92); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); animation: fade .2s; cursor: zoom-out; }
.img-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; animation: modalIn .3s var(--ease); }
.img-zoom .btn { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; background: rgba(255, 255, 255, .15); color: #fff; }
.q-img { display: block; width: 100%; max-height: 30vh; max-height: 30dvh; object-fit: contain; border-radius: 16px; margin-top: 12px; background: var(--surface); box-shadow: var(--shadow); cursor: zoom-in; }
.q-img-wrap { position: relative; }
.q-img-wrap::after { content: "⤢"; position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; font-size: .9rem; pointer-events: none; }
@media (min-width: 600px) { .q-img { max-height: 36vh; } }
/* niedrige Handys (iPhone SE, kleine Androids): Bild und Antworten kompakter, damit alle Antworten ohne Scrollen sichtbar sind */
@media (max-width: 599px) and (max-height: 740px) {
  .q-img { max-height: 22vh; max-height: 22dvh; margin-top: 8px; }
  .opts.quiz { grid-auto-rows: minmax(54px, 1fr); gap: 8px; }
  .opts .opt:not(.with-img .opt) { min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
}
.img-edit { display: grid; gap: 10px; }
.img-prev-wrap { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.img-prev { max-height: 200px; max-width: 100%; object-fit: contain; }
.img-prev-wrap .img-x { position: absolute; top: 8px; right: 8px; }
.img-drop { padding: 16px; font-size: .92rem; }
.img-drop.busy { pointer-events: none; opacity: .7; }
.img-url { display: flex; gap: 8px; }
.img-url .input { min-height: 42px; }
.hist-list { display: grid; gap: 8px; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); flex-wrap: wrap; }
.hist-main { display: grid; min-width: 0; }
.hist-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.hist-act { display: flex; gap: 6px; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-row .field { min-width: 0; }
/* Schülerordner */
.fold-list:empty { display: none; }
.fold-h { margin: 6px 0 10px; font-size: 1.15rem; }
.fold-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.fold-chip { display: grid; gap: 2px; text-align: left; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; min-width: 180px; max-width: 100%; }
.fold-chip:hover { border-color: var(--brand); }
.fold-chip b { font-size: 1rem; overflow-wrap: anywhere; }
.fold-chip small { color: var(--muted); }
.fold-chip.closed { opacity: .7; }
.fold-head { margin-bottom: 14px; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.fold-title { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.fold-title h1 { margin: 0; overflow-wrap: anywhere; }
.fold-acts { display: flex; gap: 8px; }
.fold-group { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.fold-code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .08em; color: var(--text); }
.fold-qr { display: grid; place-items: center; margin: 6px 0 14px; }
.fold-qr svg { width: min(72vw, 300px); height: auto; border-radius: 12px; }
.pupil-card h1 { overflow-wrap: anywhere; }
.pupil-cont { margin-bottom: 16px; }
.pupil-hint { margin: -6px 0 14px; font-size: .9rem; }
.pupil-code-input { text-transform: uppercase; letter-spacing: .3em; font-size: 1.6rem !important; font-weight: 800; text-align: center; font-family: ui-monospace, monospace; }
.pupil-code-big { font-family: ui-monospace, monospace; font-size: clamp(2.6rem, 14vw, 4rem); font-weight: 900; letter-spacing: .25em; text-align: center; padding: 14px 0 14px .25em; margin: 4px 0 12px; border-radius: 18px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.pupil-chip { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .06em; padding: 6px 10px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); white-space: nowrap; font-size: .9rem; }
.dash-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; }
.dash-tools .input { max-width: 260px; min-height: 42px; }
.s-card .cover { position: relative; overflow: hidden; }
.s-card .cover .thumb { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 9, 12, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 200; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 640px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px; animation: modalIn .35s var(--ease); }
.modal.wide { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
.modal h2 { margin: 0 0 14px; }
.modal .muted { color: var(--muted); margin: 0 0 14px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.type-sec { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.type-btn { position: relative; display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); transition: border-color .2s, transform .15s var(--ease), background .2s; }
.type-btn:hover, .type-btn:focus-visible { border-color: var(--brand); transform: translateY(-2px); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.type-btn .ic { font-size: 1.6rem; }
.type-btn b { font-size: 1rem; }
.type-btn small { color: var(--muted); }
.type-btn kbd { position: absolute; top: 10px; right: 10px; font: inherit; font-size: .72rem; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.share-qr { display: grid; place-items: center; gap: 12px; text-align: center; }
.share-qr .qr { width: min(340px, 80vw); border-radius: 14px; box-shadow: var(--shadow); }
.share-pane .sd-tiles + .share-qr { margin-top: 14px; }
.share-pane .sd-tiles + .share-qr .qr { width: min(220px, 60vw, 34vh); }
.share-link { display: flex; gap: 8px; width: 100%; }
.share-link .input { font-size: 13px; }
.drop-zone { border: 3px dashed var(--line); border-radius: 18px; padding: 26px; text-align: center; color: var(--muted); font-weight: 700; transition: border-color .2s, background .2s; cursor: pointer; }
.drop-zone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); color: var(--brand); }
.ai-steps { display: grid; gap: 14px; }
.ai-step { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.ai-step h3 { margin: 0; font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.ai-step h3 i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .85rem; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: center; }
.ai-lvl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-lvl > span:last-child { min-width: 0; max-width: 100%; }
.ai-lvl .seg { flex-wrap: wrap; }
.ai-lvl-hint { margin: 0; font-size: .88rem; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.ai-lvl-hint[hidden] { display: none; }
.ai-hints { margin: 0; padding: 10px 14px 10px 30px; border-radius: 12px; background: color-mix(in srgb, var(--yellow) 18%, transparent); font-size: .92rem; }
.ai-hints:empty { display: none; }
.ai-hints li + li { margin-top: 4px; }
.conn-list { display: grid; gap: 8px; }
.conn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.conn small { display: block; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--brand-ink, var(--brand)); text-decoration: underline; cursor: pointer; }
.ai-err { color: var(--red); font-weight: 700; }
.ai-err:empty { display: none; }
.ai-step p { margin: 0; }
.ai-step > a.btn { justify-self: start; }
.ai-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.ai-open { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-step code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.ai-step textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--pink)); width: 0; transition: width .3s; }

/* ===================================================== FOLIEN-BÜHNE (Beamer, Vorschau, Miniaturen) */
/* Alle Größen in Container-Einheiten → Vorschau sieht exakt aus wie der Beamer, nur kleiner */
.stage { container-type: size; position: relative; width: 100%; height: 100%; overflow: hidden; color: var(--text); background: var(--bg); }
.st-inner { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 3.2cqh 4.5cqw 3.5cqh; }
.p-title { font-size: min(4.3cqw, 8.4cqh); font-weight: 900; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 2.4cqh; text-align: center; overflow-wrap: anywhere; animation: screenIn .5s var(--ease-out) both; }
.p-title.len-l { font-size: min(3.2cqw, 6.2cqh); }
.p-title.len-xl { font-size: min(2.4cqw, 4.6cqh); text-align: left; }
.p-body { flex: 1; min-height: 0; display: flex; }
.p-body.with-img { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.4cqw; transition: grid-template-columns .5s var(--ease-out); }
/* solange noch keine Ergebnisse zu sehen sind, bekommt das Bild fast die ganze Bühne */
.p-body.with-img:has(.hidden-results) { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
.p-body.with-img .bar .lbl { flex-wrap: wrap; justify-content: center; }
.p-body.with-img.only-img { grid-template-columns: minmax(0, 1fr); }
.p-body.with-img.only-img .p-viz { display: none; }
.p-img { min-height: 0; min-width: 0; display: grid; place-items: center; cursor: zoom-in; container-type: size; }
.p-img img { width: min(100cqw, 100cqh * var(--ar, 1.333)); aspect-ratio: var(--ar, 1.333); height: auto; object-fit: cover; border-radius: 1.6cqmin; box-shadow: var(--shadow-lg); animation: screenIn .6s var(--ease-out) both; }
.p-img { position: relative; }
.p-credit { position: absolute; right: 1cqmin; bottom: 1cqmin; max-width: 90%; font-size: max(10px, 2.6cqmin); padding: .2em .6em; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; line-height: 1.25; }
.p-credit.solo { position: static; align-self: flex-end; max-width: 70%; margin-top: .6cqh; background: none; color: var(--muted); padding: 0; text-align: right; }
.p-body.only-img .p-img { cursor: zoom-out; }
.p-viz { flex: 1; min-height: 0; min-width: 0; display: flex; align-items: stretch; justify-content: center; position: relative; }
.p-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); font-weight: 800; font-size: min(2cqw, 3.6cqh); }
.p-empty .pulse-dots { justify-content: center; margin-top: 2cqh; }
.math-block { display: block; margin: .4em 0; overflow-x: auto; overflow-y: hidden; }
.math-pending { font-family: ui-monospace, Consolas, monospace; opacity: .6; }
.katex { font-size: 1.05em; }

/* Inhaltsfolien */
.slide { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: screenIn .5s var(--ease-out) both; }
.slide .s-h { font-size: min(4.6cqw, 9cqh); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 2.6cqh; overflow-wrap: anywhere; }
.slide .s-h.len-l { font-size: min(3.4cqw, 6.6cqh); }
.slide .s-h.len-xl { font-size: min(2.6cqw, 5cqh); }
.slide .s-txt { font-size: min(2.5cqw, 4.8cqh); line-height: 1.45; overflow-wrap: anywhere; min-height: 0; overflow: hidden; }
.slide .s-txt.len-l { font-size: min(2cqw, 3.9cqh); }
.slide .s-txt.len-xl { font-size: min(1.55cqw, 3cqh); }
.rich p { margin: 0 0 .6em; }
.rich ul, .rich ol { margin: 0 0 .6em; padding-left: 1.3em; }
.rich li { margin: .25em 0; }
.rich li::marker { color: var(--brand); font-weight: 900; }
/* Aufzählungsarten: Striche, Häkchen, Pfeile; Zahlen/Buchstaben/römisch mit „)“; Unterpunkte etwas kleiner */
@counter-style paren-decimal { system: extends decimal; suffix: ") "; }
@counter-style paren-lower-alpha { system: extends lower-alpha; suffix: ") "; }
@counter-style paren-upper-alpha { system: extends upper-alpha; suffix: ") "; }
@counter-style paren-lower-roman { system: extends lower-roman; suffix: ") "; }
@counter-style paren-upper-roman { system: extends upper-roman; suffix: ") "; }
.rich ul.l-dash { list-style-type: "–  "; }
.rich ul.l-check { list-style-type: "✓  "; }
.rich ul.l-arrow { list-style-type: "→  "; }
.rich ul.l-dash, .rich ul.l-check, .rich ul.l-arrow { padding-left: 1.5em; }
.rich ol.l-paren { list-style-type: paren-decimal; padding-left: 1.6em; }
.rich ol.l-paren[data-k="la"] { list-style-type: paren-lower-alpha; }
.rich ol.l-paren[data-k="ua"] { list-style-type: paren-upper-alpha; }
.rich ol.l-paren[data-k="lr"] { list-style-type: paren-lower-roman; padding-left: 2.1em; }
.rich ol.l-paren[data-k="ur"] { list-style-type: paren-upper-roman; padding-left: 2.3em; }
.rich li > ul, .rich li > ol { margin: .15em 0 .1em; }
.rich li li { font-size: .9em; }
.rich h3 { font-size: 1.2em; margin: .2em 0 .5em; color: var(--brand-ink); }
.rich blockquote { margin: .4em 0; padding: .2em 0 .2em .8em; border-left: .25em solid var(--brand); color: var(--muted); font-style: italic; }
.rich > :last-child { margin-bottom: 0; }
.slide .s-img { min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.slide .s-img.has-credit { flex-direction: column; gap: .6cqmin; }
.slide .s-img.has-credit img { max-height: calc(100% - 3cqmin); }
.slide .s-credit { font-size: max(10px, 1.25cqmin); opacity: .65; text-align: center; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.slide .s-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 1.4cqmin; box-shadow: var(--shadow-lg); }
.slide.l-title, .slide.l-section { justify-content: center; align-items: center; text-align: center; }
.slide.l-title .s-h { font-size: min(6.4cqw, 12cqh); background: linear-gradient(135deg, var(--brand), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.slide.l-title .s-h.len-l { font-size: min(4.6cqw, 9cqh); }
.slide.l-title .s-txt { color: var(--muted); font-weight: 700; max-width: 80%; }
.slide.l-title .s-img { max-height: 30cqh; margin-bottom: 3cqh; }
.slide.l-section { align-items: flex-start; text-align: left; padding-left: 6cqw; border-left: 1.4cqw solid var(--brand); }
.slide.l-section .s-h { font-size: min(6cqw, 11cqh); }
.slide.l-section .s-txt { color: var(--muted); font-weight: 700; }
.slide.l-text .s-txt { flex: 1; }
.slide.l-split .s-grid { --tc: 1fr; --ic: 1fr; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, var(--tc)) minmax(0, var(--ic)); grid-template-rows: minmax(0, 1fr); gap: 4cqw; align-items: center; }
/* Bild links (Anordnung „Bild, dann Text“) */
.slide.l-split .s-grid.img-first { grid-template-columns: minmax(0, var(--ic)) minmax(0, var(--tc)); }
/* Hochformat: schmale Bildspalte, mehr Platz für Text · Querformat: breitere Bildspalte */
.slide.l-split .s-grid.img-tall { --tc: 1.7fr; }
.slide.l-split .s-grid.img-wide { --ic: 1.3fr; }
.slide.l-split .s-grid.img-only { grid-template-columns: minmax(0, 1fr); }
/* Bild nie höher als die Folie – auch bei Hochformat */
.slide.l-split .s-grid > .s-img { height: 100%; }
.slide.l-image .s-img { flex: 1; }
.slide.l-image .s-cap { text-align: center; color: var(--muted); font-weight: 700; font-size: min(1.8cqw, 3.4cqh); margin-top: 1.6cqh; }
.slide.l-image .s-h { text-align: center; font-size: min(3.4cqw, 6.6cqh); margin-bottom: 1.6cqh; }
.slide.l-image.no-title .s-img img { box-shadow: none; border-radius: 0; }
.slide.l-quote { justify-content: center; padding: 0 8cqw; }
.slide.l-quote .s-q { font-size: min(3.6cqw, 7cqh); font-weight: 800; line-height: 1.3; position: relative; overflow-wrap: anywhere; }
.slide.l-quote .s-q.len-l { font-size: min(2.6cqw, 5cqh); }
.slide.l-quote .s-q::before { content: "„"; position: absolute; left: -.6em; top: -.35em; font-size: 2.6em; color: var(--brand); opacity: .35; line-height: 1; }
.slide.l-quote .s-by { margin-top: 3cqh; color: var(--muted); font-weight: 800; font-size: min(2cqw, 3.8cqh); }
.slide.l-quote .s-by::before { content: "— "; }
.slide-empty { color: var(--muted); opacity: .5; }
/* Folienwechsel am Beamer: alte Bühne (Kopie) gleitet hinaus, darunter kommt die neue herein (stageSwap in teacher.js) */
.st-ghost { pointer-events: none; z-index: 1; will-change: transform, opacity; }
.st-ghost * { animation: none !important; } /* die alte Folie steht still, während sie hinausgleitet */
.st-inner.swapping { z-index: 2; will-change: transform, opacity; }
.st-inner.swapping > .slide { animation: none; }
/* Aufzählungen Punkt für Punkt einblenden (Beamer; Schalter „Liste nacheinander einblenden“ je Folie) */
.slide.list-anim li { animation: liIn .6s var(--ease-out) both; animation-delay: calc(.55s + var(--li, 0) * .38s); }
@keyframes liIn { from { opacity: 0; transform: translateX(-1.4em); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
/* Fortschritt "Fragen zur Folie" */
.task-badge { position: absolute; right: 2cqw; bottom: 2.4cqh; display: flex; align-items: center; gap: 1cqw; background: var(--surface); border-radius: 99px; padding: 1cqh 1.6cqw; box-shadow: var(--shadow-lg); font-weight: 800; font-size: min(1.5cqw, 2.8cqh); animation: screenIn .5s var(--ease-out) both; z-index: 3; }
.task-badge .dot-live { width: 1cqmin; height: 1cqmin; }

/* Balken */
.bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2.4cqw; padding-top: 3cqh; width: 100%; }
.bar { flex: 1; max-width: 18cqw; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1cqh; min-width: 0; }
.bar .colwrap { flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1cqh; }
.bar .val { font-weight: 900; font-size: min(2.6cqw, 5cqh); transition: opacity .3s; }
.bar .col { width: 100%; height: 0; background: var(--c); border-radius: 1.4cqmin 1.4cqmin .5cqmin .5cqmin; transition: height .8s var(--ease-out), opacity .4s, filter .4s; min-height: .8cqh; position: relative; box-shadow: 0 1cqh 2.4cqh color-mix(in srgb, var(--c) 35%, transparent); }
.bar .lbl { display: flex; gap: .6em; align-items: flex-start; font-weight: 800; font-size: min(1.6cqw, 3cqh); text-align: center; line-height: 1.2; overflow-wrap: anywhere; min-height: 2.5em; max-width: 100%; }
.bar .lbl > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* wenige Säulen: genug Platz → Beschriftung größer (auf dem Beamer von hinten lesbar) */
.bars:not(.hidden-results):not(:has(> .bar:nth-child(7))) .bar .lbl { font-size: min(1.9cqw, 3.5cqh); }
.bars:not(.hidden-results):not(:has(> .bar:nth-child(5))) .bar .lbl { font-size: min(2.1cqw, 3.8cqh); }
.bars:not(.reveal-mode) i.reveal-only { display: none; } /* Multiple Choice: Farbe statt A/B/C */
.bar .lbl i, .hbar .lt i { font-style: normal; flex: none; width: 1.6em; height: 1.6em; border-radius: .45em; background: var(--c); color: #fff; display: grid; place-items: center; font-size: .8em; }
.bars.reveal-mode .bar:not(.correct) .col, .bars.reveal-mode .hbar:not(.correct) .hfill { opacity: .25; filter: saturate(.3); }
.bars.reveal-mode .bar.correct .col::after { content: "✓"; position: absolute; top: 1cqh; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 900; font-size: min(3cqw, 5.6cqh); animation: bounceIn .6s var(--ease); }
.hidden-results .val { opacity: 0; }
.hidden-results .col { height: .8cqh !important; }
.hidden-results .hfill { width: 0 !important; }
/* Horizontale Balken – für lange Antworten oder viele Optionen */
.bars.h { flex-direction: column; justify-content: center; align-items: stretch; gap: 1.6cqh; padding-top: 0; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 5cqw; align-items: center; gap: 1.6cqw; font-size: min(1.7cqw, 3.2cqh); font-weight: 800; }
.hbar .lt { display: flex; gap: .6em; align-items: center; line-height: 1.2; overflow-wrap: anywhere; }
.hbar .lt > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Leiste leicht in der Antwortfarbe + immer ein farbiger Ansatz: die Farbe ordnet zu, auch bei 0 Stimmen / verdeckt */
.hbar .track { height: 2.2em; background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); border-radius: .6em; overflow: hidden; position: relative; }
.hbar .hfill { position: absolute; inset: 0 auto 0 0; width: 0; min-width: .7em; background: var(--c); border-radius: .6em; transition: width .8s var(--ease-out), opacity .4s; }
.hbar .hv { font-weight: 900; font-size: 1.3em; text-align: right; }
.quiz-wait { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; animation: bounceIn .6s var(--ease) both; }
.qw-num { font-size: min(12cqw, 22cqh); font-weight: 900; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qw-lab { font-weight: 800; color: var(--muted); font-size: min(2cqw, 3.8cqh); }

/* Skala mit mehreren Aussagen: je Aussage eine Zeile, Balken bis zum Durchschnitt, weiche Verteilung dahinter */
.sr { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.6cqw; width: 100%; min-height: 0; font-size: var(--fs); }
.sr-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em; color: var(--muted); font-weight: 800; font-size: min(3.2cqw, 4.4cqh); white-space: nowrap; min-height: 0; overflow: hidden; }
.sr-side b { color: var(--text); font-size: 1.35em; line-height: 1; }
.sr-side span { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 100%; overflow: hidden; text-overflow: ellipsis; }
.sr-side.r span { transform: none; }
.sr-rows { display: flex; flex-direction: column; justify-content: space-around; gap: .5em; min-height: 0; padding: .2em 1.1em; border-inline: 2px dashed var(--line); }
.sr-row { position: relative; display: grid; gap: .3em; padding-top: .2em; }
.sr-area { position: absolute; left: 0; right: 0; top: -.5em; bottom: .25em; width: 100%; height: calc(100% + .25em); overflow: visible; pointer-events: none; }
.sr-area path { fill: color-mix(in srgb, var(--c) 20%, transparent); stroke: color-mix(in srgb, var(--c) 45%, transparent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; transition: d .9s var(--ease-out); }
.sr-text { position: relative; z-index: 1; font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sr-bar { position: relative; height: .5em; border-radius: 99px; background: var(--surface-2); }
.sr-fill { height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .9s var(--ease-out); }
.sr-dot { position: absolute; top: 50%; left: 0; min-width: 2em; height: 2em; padding: 0 .3em; border-radius: 99px; display: grid; place-items: center; transform: translate(-50%, -50%); background: var(--c); color: #fff; font-weight: 900; font-size: max(.8em, min(1.15cqw, 2.1cqh)); border: .18em solid var(--surface); box-shadow: var(--shadow-lg); transition: left .9s var(--ease-out), opacity .3s; font-variant-numeric: tabular-nums; }
.sr-dot.off { opacity: 0; }
.sr.hidden-results .sr-fill, .sr.hidden-results .sr-area { opacity: 0; transition: none; }
.sr.hidden-results .sr-dot.off { opacity: 1; left: 50% !important; background: var(--surface-2); color: var(--muted); }
/* Skala (eine Frage): großer Balken wie oben, darunter die Verteilung als Säulen genau unter den Werten */
.ss-rows { justify-content: stretch; gap: 0; padding-block: 0; }
.ss-row { flex: 1 1 42%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: 0; }
/* Balken und Fläche laufen von der Mitte der ersten bis zur Mitte der letzten Säule */
.ss .sr-bar { height: .62em; margin-inline: calc(50% / var(--n)); grid-row: 3; }
.ss .sr-area { left: calc(50% / var(--n)); right: auto; width: calc(100% - 100% / var(--n)); top: 1.4em; bottom: auto; height: calc(100% - 1.4em - .31em); }
.ss .sr-dot { min-width: 2.3em; height: 2.3em; font-size: max(.9em, min(1.9cqw, 3.4cqh)); }
.ss-meta { display: flex; justify-content: space-between; gap: 1em; position: relative; z-index: 1; color: var(--muted); font-weight: 800; font-size: .52em; }
.ss-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.ss-dist { flex: 1 1 58%; min-height: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0; padding-top: 1.1em; }
.ss-col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; gap: .22em; min-height: 0; }
.ss-bar { position: relative; width: min(62%, 3.2em); height: 100%; border-radius: .5em .5em .3em .3em; background: color-mix(in srgb, var(--t) 9%, var(--surface-2)); overflow: hidden; }
.ss-bar i { position: absolute; inset: auto 0 0; height: 0; border-radius: inherit; background: linear-gradient(to top, var(--t), color-mix(in srgb, var(--t) 55%, #fff)); opacity: .55; transition: height .9s var(--ease-out), opacity .3s; }
.ss-col.top .ss-bar i { opacity: 1; box-shadow: 0 0 0 .12em color-mix(in srgb, var(--t) 35%, transparent); }
.ss-cnt { min-width: 1.9em; padding: .08em .45em; border-radius: 99px; text-align: center; font-weight: 900; font-size: .5em; font-variant-numeric: tabular-nums; color: var(--text); }
.ss-col.top .ss-cnt { background: var(--t); color: #fff; }
.ss-col.zero .ss-cnt { color: var(--muted); opacity: .6; }
.ss-val { display: grid; place-items: center; min-width: 1.75em; height: 1.75em; border-radius: 50%; font-weight: 900; font-size: .46em; color: var(--muted); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.ss-col.top .ss-val { color: var(--text); box-shadow: inset 0 0 0 .14em var(--t); background: var(--surface); }
.ss.hidden-results .ss-bar i { opacity: 0; transition: none; }
/* viele Werte (z. B. 0–10): Zahlen etwas kleiner */
.ss-dist:has(> .ss-col:nth-child(9)) .ss-val { font-size: .4em; }
.ss-dist:has(> .ss-col:nth-child(9)) .ss-cnt { font-size: .44em; padding-inline: .3em; }

/* Wortwolke */
.cloud { flex: 1; position: relative; width: 100%; min-height: 0; overflow: hidden; }
.cloud > .p-empty { position: absolute; inset: 0; }
.cloud .w { position: absolute; left: 50%; top: 50%; white-space: nowrap; line-height: 1.08; letter-spacing: -.01em; color: var(--c); cursor: default; opacity: 0;
  transition: transform .8s var(--ease-out), font-size .8s var(--ease-out), opacity .4s; }
.cloud .w.placed { opacity: 1; }
.cloud .w > span { display: inline-block; animation: pop .6s var(--ease) both; }
.cloud .w:hover { opacity: .55; cursor: pointer; text-decoration: line-through; }

/* Offene Antworten */
.walls { flex: 1; columns: 4 24cqw; column-gap: 1.4cqw; width: 100%; overflow: hidden; align-self: stretch; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
/* wenige Antworten: größere Zettel (auf dem Beamer von hinten lesbar), bei vielen bleibt es kompakt */
.walls:not(:has(> .note:nth-child(9))) .note { font-size: min(1.8cqw, 3.3cqh); }
.walls:not(:has(> .note:nth-child(4))) { columns: 3 28cqw; }
.walls:not(:has(> .note:nth-child(4))) .note { font-size: min(2.2cqw, 4cqh); }
.note { break-inside: avoid; margin: 0 0 1.4cqw; padding: 1.6cqh 1.4cqw; border-radius: 1.4cqmin; background: var(--c); color: #1c1838; font-weight: 700; font-size: min(1.5cqw, 2.8cqh); box-shadow: var(--shadow); animation: noteIn .6s var(--ease) both; position: relative; overflow-wrap: anywhere; }
.note.long { font-size: min(1.15cqw, 2.2cqh); font-weight: 600; }
.note button { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(0, 0, 0, .08); width: 28px; height: 28px; border-radius: 50%; opacity: 0; transition: opacity .2s; }
.note:hover button { opacity: 1; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-30px) rotate(-4deg) scale(.8); } }

/* Ranking */
.rank-viz { flex: 1; width: 100%; display: grid; align-content: center; gap: 1.6cqh; }
.rank-row { display: grid; grid-template-columns: 3em 1fr; align-items: center; gap: 1cqw; font-weight: 800; font-size: min(1.8cqw, 3.4cqh); transition: transform .7s var(--ease-out); }
/* wenige Einträge: größer, damit das Ranking die Bühne füllt und hinten lesbar ist */
.rank-viz:not(:has(> .rank-row:nth-child(6))) .rank-row { font-size: min(2.4cqw, 4.6cqh); }
.rank-row .pos { width: 2.2em; height: 2.2em; border-radius: .5em; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 900; }
.rank-row .track { position: relative; height: 2.2em; border-radius: .5em; background: var(--surface-2); overflow: hidden; }
.rank-row .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--c) 30%, transparent); width: 0; transition: width .8s var(--ease-out); }
.rank-row .txt { position: relative; padding: 0 .8em; line-height: 2.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bestenliste */
.board { flex: 1; width: 100%; max-width: 80cqw; margin: 0 auto; display: grid; grid-template-rows: auto 1fr; gap: 3cqh; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 2cqw; height: 48cqh; }
.podium .pod { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1cqh; width: 19cqw; height: 100%; }
.podium .pod .nm { font-weight: 900; font-size: min(2.5cqw, 4.6cqh); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pod .sc { font-weight: 800; color: var(--muted); font-size: min(1.8cqw, 3.3cqh); }
.podium .pod .blk { width: 100%; border-radius: 1.6cqmin 1.6cqmin .6cqmin .6cqmin; display: grid; place-items: start center; padding-top: 1.4cqh; font-size: min(4cqw, 7cqh); animation: rise 1s var(--ease-out) both; transform-origin: bottom; }
.podium .p1 .blk { height: 72%; background: linear-gradient(#ffd55a, #f5a300); animation-delay: .6s; }
.podium .p2 .blk { height: 52%; background: linear-gradient(#e3e6f0, #a9afc4); animation-delay: .3s; }
.podium .p3 .blk { height: 38%; background: linear-gradient(#f3b98a, #c97a3d); }
.podium .pod > :not(.blk) { animation: screenIn .5s var(--ease-out) both; }
.podium .p1 > :not(.blk) { animation-delay: 1.2s; }
.podium .p2 > :not(.blk) { animation-delay: .9s; }
.podium .p3 > :not(.blk) { animation-delay: .6s; }
@keyframes rise { from { transform: scaleY(0); } }
.board-list { display: grid; gap: 1cqh 1cqw; align-content: start; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-list .row { display: flex; align-items: center; gap: 1cqw; background: var(--surface); border-radius: 1.2cqmin; padding: 1cqh 1.4cqw; box-shadow: var(--shadow); font-weight: 800; font-size: min(1.6cqw, 3cqh); animation: screenIn .45s var(--ease-out) both; animation-delay: calc(1.4s + var(--i) * 60ms); }
.board-list .row b { color: var(--muted); width: 2em; }
.board-list .row span:not(.avatar) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ended-screen { flex: 1; display: grid; place-items: center; text-align: center; }
.ended-screen h2 { font-size: min(5cqw, 9cqh); margin: 0; }

/* Lobby */
.lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 4cqw; align-items: center; padding: 0 2cqw; }
.lobby-qr { background: #fff; padding: 2cqmin; border-radius: 3cqmin; box-shadow: var(--shadow-lg); animation: bounceIn .7s var(--ease) both; }
.lobby-qr .qr { width: min(60cqh, 36cqw); }
.lobby-info h2 { font-size: min(2.8cqw, 5.4cqh); margin: 0; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lobby-info .url { font-size: min(2.2cqw, 4.2cqh); font-weight: 800; color: var(--muted); margin: .4em 0; }
.lobby-code { font-size: min(8.5cqw, 16cqh); font-weight: 900; letter-spacing: .06em; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: .1em 0 .3em; }
.lobby-people { display: flex; flex-wrap: wrap; gap: 1cqh 1cqw; max-height: 30cqh; overflow: hidden; align-content: flex-start; }
.person { display: inline-flex; align-items: center; gap: 8px; padding: .8cqh 1.4cqw .8cqh .6cqw; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: min(1.4cqw, 2.6cqh); animation: personIn .6s var(--ease) both; }
.person .avatar { width: 2.2em; height: 2.2em; font-size: .8em; }
.person.off { opacity: .45; }
/* Beamer-Ansicht im Hochformat (Tablet hochkant): QR-Code oben, Code und Namen darunter – alles größer */
@container (orientation: portrait) {
  .lobby { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; text-align: center; gap: 4cqh; }
  .lobby-qr .qr { width: min(40cqh, 66cqw); }
  .lobby-info h2 { font-size: min(5.2cqw, 3.4cqh); }
  .lobby-info .url { font-size: min(4cqw, 2.6cqh); }
  .lobby-code { font-size: min(15cqw, 9cqh); }
  .lobby-people { justify-content: center; max-height: 20cqh; gap: 1cqh 2cqw; }
  .person { font-size: min(3cqw, 1.9cqh); padding: .8cqh 2.4cqw .8cqh 1cqw; }
}
@keyframes personIn { 0% { transform: scale(0) rotate(-15deg); opacity: 0; } 70% { transform: scale(1.12) rotate(3deg); } 100% { transform: scale(1); } }

/* ===================================================== PRÄSENTATION (Beamer-Rahmen) */
.present { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); overflow: hidden; }
.present .stage { background: transparent; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 1.2vh 2vw 0; min-height: 0; }
.join-hint { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: clamp(.85rem, 1.3vw, 1.2rem); }
.join-hint .qr { width: clamp(52px, 5.4vw, 88px); border-radius: 8px; cursor: zoom-in; }
.join-hint b { font-size: 1.45em; letter-spacing: .06em; color: var(--brand-ink); }
.p-count { display: flex; gap: 14px; align-items: center; font-weight: 800; font-size: clamp(.95rem, 1.4vw, 1.3rem); }
.p-count .qa-pill { background: var(--brand); color: #fff; border-radius: 99px; padding: 4px 12px; cursor: pointer; animation: pop .4s var(--ease); }
.p-bottom { display: flex; align-items: center; justify-content: space-between; row-gap: 8px; gap: 10px; padding: .8vh 1.6vw 1.4vh; flex-wrap: wrap; transition: opacity .4s; }
.p-bottom .grp { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.p-bottom .grp > * { transition: opacity .4s; }
.present.idle .p-bottom .grp > :not(.timer-ring) { opacity: 0; }
.present.idle .p-bottom .timer-ring { transform: scale(1.25); transform-origin: center bottom; }
.present.idle { cursor: none; }
.p-bottom .btn { min-height: 40px; padding: .4em .95em; font-size: .95rem; }
.p-bottom .btn.icon { width: 40px; padding: 0; }
@media (max-width: 1279px) { .lbl-wide { display: none; } .p-bottom .grp { gap: 6px; } }
.p-progress { position: absolute; left: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--brand), var(--pink)); transition: width .5s var(--ease-out); z-index: 5; }
.slide-no { font-weight: 800; color: var(--muted); font-size: .95rem; min-width: 3.5em; text-align: center; }
.timer-ring { position: relative; width: clamp(52px, 5.4vw, 80px); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 9; }
.timer-ring .bg { stroke: var(--surface-2); }
.timer-ring .fg { stroke: var(--brand); stroke-linecap: round; transition: stroke .3s; }
.timer-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: clamp(1.05rem, 1.7vw, 1.6rem); }
.timer-ring.low .fg { stroke: var(--red); }
.timer-ring.low span { color: var(--red); animation: tick 1s infinite; }
@keyframes tick { 50% { transform: scale(1.15); } }
.answered-pill { font-weight: 900; font-size: clamp(1rem, 1.5vw, 1.4rem); display: flex; align-items: center; gap: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 120; padding: 20px; overflow: auto; animation: slideIn .3s var(--ease-out); }
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer h2 { margin: 0; font-size: 1.2rem; }
.drawer .p-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer .p-row span:not(.avatar) { flex: 1; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.qa-item { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); margin-top: 10px; font-weight: 700; overflow-wrap: anywhere; }
.qa-item .acts { display: flex; gap: 6px; justify-content: flex-end; }
.qa-item .acts .btn { min-height: 34px; font-size: .85rem; padding: .3em .8em; }
.qa-item time { font-size: .78rem; color: var(--muted); font-weight: 700; }
.qa-overlay { position: absolute; left: 50%; bottom: 11cqh; transform: translateX(-50%); width: min(80cqw, 1100px); background: var(--surface); border-radius: 2cqmin; padding: 3cqh 3cqw; box-shadow: var(--shadow-lg); z-index: 10; font-size: min(2.4cqw, 4.6cqh); font-weight: 800; line-height: 1.3; animation: screenIn .45s var(--ease-out); border-left: 1cqw solid var(--brand); overflow-wrap: anywhere; }
.qa-overlay small { display: block; color: var(--muted); font-size: .5em; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4em; }
.present[data-accent="nacht"] { --bg: #0d0b1e; --surface: #1a1633; --surface-2: #241f45; --line: #312a5a; --text: #f3f1ff; --muted: #a49fc4; }
.present[data-accent="papier"] { --bg: #f8f5ee; --surface: #fffdf8; --surface-2: #efe9dc; --line: #e2d9c6; --text: #2b2620; --muted: #776c5c; --brand-ink: #4b2fd0; color-scheme: light; }

/* Referentenansicht / Fernbedienung */
.remote { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); }
.rm-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rm-clock { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.3rem; }
.rm-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding: 16px; overflow: auto; align-content: start; }
@media (max-width: 860px) { .rm-body { grid-template-columns: minmax(0, 1fr); } }
.rm-now, .rm-next { display: grid; gap: 8px; align-content: start; }
.rm-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-next .pv-frame { opacity: .85; }
.rm-notes { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); font-size: 1.1rem; line-height: 1.5; white-space: pre-wrap; min-height: 80px; overflow-wrap: anywhere; }
.rm-notes.empty { color: var(--muted); font-style: italic; }
.rm-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.rm-stats .pill { box-shadow: none; background: var(--surface-2); }
.rm-ctrl { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.rm-ctrl .btn { min-height: 64px; font-size: 1.2rem; }
.rm-extra { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rm-extra .btn { min-height: 42px; font-size: .95rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 640px) { .t-top .right .btn { padding: .5em .8em; } }

/* ===================================================== SCHÜLER: Folien & Fragen zur Folie */
.slide-wrap { display: grid; gap: 14px; padding-bottom: 20px; }
.slide-wrap.solo { min-height: calc(100dvh - 150px); align-content: center; }
.slide-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; overflow-wrap: anywhere; }
.slide-card h2, .slide-card h3 { margin: 0 0 10px; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.01em; }
.slide-card h2.len-l { font-size: 1.2rem; }
.slide-card h2.len-xl { font-size: 1.05rem; }
.slide-card .q-img { margin: 0 0 10px; max-height: 40vh; }
/* Anordnung „Text, dann Bild“: Abstand über dem Bild */
.slide-card .slide-text + .q-img-wrap > .q-img, .slide-card > div + .q-img { margin: 14px 0 0; }
.slide-card .slide-text, .slide-card .rich { font-size: 1.08rem; line-height: 1.5; }
.slide-card .big-emoji { text-align: center; }
.task-list { display: grid; gap: 8px; }
.task-head { font-weight: 800; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; padding: 0 4px; }
.task-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: 1.02rem; min-height: 60px; animation: optIn .4s var(--ease) both; }
.task-item .task-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 900; }
.task-item.done .task-ic { background: var(--green); }
.task-item .task-t { flex: 1; overflow-wrap: anywhere; }
.task-item .task-go { color: var(--muted); font-size: 1.3rem; }
.task-item.done { opacity: .85; }
.pill-mini { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font: inherit; font-size: .78rem; font-weight: 800; color: var(--brand-ink); border: 0; text-transform: none; letter-spacing: 0; }
button.pill-mini { cursor: pointer; min-height: 32px; }
.qa-btn { border: 0; cursor: pointer; font: inherit; font-weight: 800; color: var(--text); min-height: 36px; }
.q-title.len-l { font-size: clamp(1.15rem, 4.4vw, 1.6rem); }
.q-title.len-xl { font-size: clamp(1rem, 3.8vw, 1.3rem); font-weight: 800; }
.opt .otext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opts.long .opt { font-size: 1rem; font-weight: 700; align-items: flex-start; line-height: 1.35; }
.opts.long .opt .letter { margin-top: 2px; }
.chip .katex { font-size: 1em; }
.opt .katex { font-size: 1.2em; }
/* Unteres Blatt (Frage an die Lehrkraft) */
.sheet-bg { position: fixed; inset: 0; z-index: 210; background: rgba(8, 9, 12, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheetIn .3s var(--ease-out); }
@keyframes sheetIn { from { transform: translateY(100%); } }
/* Toast mit Aktion */
.toast.has-act { display: flex; align-items: center; justify-content: space-between; gap: 14px; pointer-events: auto; }
.toast-act { border: 0; background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-weight: 800; padding: 6px 12px; border-radius: 10px; cursor: pointer; }
/* Themes auch für einzelne Bühnen (Vorschau, Miniaturen) */
.stage[data-accent="nacht"] { --bg: #0d0b1e; --surface: #1a1633; --surface-2: #241f45; --line: #312a5a; --text: #f3f1ff; --muted: #a49fc4; }
.stage[data-accent="papier"] { --bg: #f8f5ee; --surface: #fffdf8; --surface-2: #efe9dc; --line: #e2d9c6; --text: #2b2620; --muted: #776c5c; --brand-ink: #4b2fd0; color-scheme: light; }
.s-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===================================================== VIDEO-QUIZ */
.vid-box { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.vid-box iframe.yt { width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 1.2cqmin; box-shadow: var(--shadow-lg); background: #000; }
.vid-title { font-size: min(2.6cqw, 5cqh); margin-bottom: 1.6cqh; }
.video-ph { flex: 1; display: grid; place-content: center; justify-items: center; gap: 2cqh; text-align: center; border-radius: 2cqmin; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #000), color-mix(in srgb, var(--pink) 75%, #000)); color: #fff; padding: 4cqh 4cqw; }
.video-ph .vp-icon { width: 14cqh; height: 14cqh; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 6cqh; padding-left: 1cqh; }
.video-ph .vp-title { font-weight: 900; font-size: min(3.4cqw, 6.4cqh); line-height: 1.15; overflow-wrap: anywhere; }
.video-ph .vp-sub { font-weight: 700; opacity: .85; font-size: min(1.7cqw, 3.2cqh); }
.vid-chip { font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.stop-badge { left: 4px; right: auto; background: var(--brand); color: #fff; }
/* Editor */
.pv-video { background: #000; }
.pv-video iframe.yt { width: 100%; height: 100%; border: 0; display: block; }
.pv-small { width: min(100%, 520px); margin: 0 auto; opacity: .95; }
.vid-tools { display: grid; gap: 10px; }
.vt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vt-now { font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.15rem; min-width: 3.5em; }
.vt-track { position: relative; height: 18px; border-radius: 99px; background: var(--surface-2); cursor: pointer; }
.vt-head { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--text); left: 0; pointer-events: none; transition: left .25s linear; }
.vt-mark { position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; transform: translateY(-50%); border-radius: 50%; border: 3px solid var(--surface); background: var(--brand); box-shadow: var(--shadow); padding: 0; cursor: pointer; }
.vt-mark.on { background: var(--pink); transform: translateY(-50%) scale(1.25); }
.vt-stops { display: flex; flex-wrap: wrap; gap: 6px; }
.vt-stop { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 10px; font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; text-align: left; }
.vt-stop b { color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.vt-stop.on { border-color: var(--brand); }
.stop-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.stop-row .time-in { width: 92px; flex: none; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; }
.vid-status { font-size: .88rem; font-weight: 700; min-height: 1.2em; }
.vid-status.ok { color: var(--green); }
.vid-status.bad { color: var(--red); }
/* Schüler */
.video-pulse { animation: bounceIn .7s var(--ease) both, vpulse 2.4s 1s ease-in-out infinite; }
@keyframes vpulse { 50% { transform: scale(1.08); } }

/* ===================================================== Musik & Töne */
.audio-pop { position: fixed; z-index: 130; width: 280px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; animation: modalIn .25s var(--ease); }
.audio-pop .toggle-row { margin: 0; padding: 10px 12px; }
.audio-pop .toggle-row small { font-size: .78rem; }
.vol-row { display: flex; align-items: center; gap: 8px; }
.vol-row input { flex: 1; accent-color: var(--brand); height: 28px; }
.pre-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pre-row > span { width: 100%; font-weight: 700; font-size: .85rem; color: var(--muted); }
.pre-row .btn { min-height: 36px; font-size: .85rem; padding: .3em .8em; }
.audio-pop .seg { width: 100%; }
.audio-pop .seg button { flex: 1; }
.audio-pop { width: 300px; }

/* Übersicht: Karten mit 16:9-Vorschau, Aktionen in einer Zeile, Menü */
.s-card .cover { height: auto; aspect-ratio: 16 / 9; }
.s-card .actions { flex-wrap: nowrap; }
.s-card .actions .btn.primary { flex: 1; }
.s-card .actions .btn.more { flex: none; width: 38px; padding: 0; font-size: 1.2rem; letter-spacing: .05em; }
.menu-pop { position: absolute; z-index: 80; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 2px; overflow-y: auto; overscroll-behavior: contain; animation: modalIn .18s var(--ease); }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.menu-pop button span { width: 1.4em; text-align: center; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--surface-2); outline: none; }
.menu-pop button.danger { color: var(--red); }
.stage .slide-empty:not(.s-h) { font-size: min(2.4cqw, 4.6cqh); }

/* Tablet (iPad): Folien zum Mitlesen größer und luftiger */
@media (min-width: 700px) {
  .s-main { padding-inline: 28px; }
  .slide-card { padding: 28px 32px; border-radius: 24px; }
  .slide-card h2 { font-size: 2rem; }
  .slide-card h2.len-l { font-size: 1.6rem; }
  .slide-card h2.len-xl { font-size: 1.35rem; }
  .slide-card .slide-text, .slide-card .rich { font-size: 1.3rem; }
  .task-item { min-height: 64px; font-size: 1.1rem; }
}
.slide-card.quote { padding-top: 40px; position: relative; }
.slide-card.quote::before { content: "“"; position: absolute; left: 16px; top: 6px; font-size: 3.6rem; line-height: 1; color: var(--brand); opacity: .35; font-family: Georgia, serif; }
.slide-card.quote blockquote { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.35; font-style: italic; }
.slide-card.quote .by { margin-top: 12px; color: var(--muted); font-weight: 700; }
@media (min-width: 700px) { .slide-card.quote blockquote { font-size: 1.8rem; } }

/* Emoji-Reaktionen: Handy (Lobby) → Beamer */
.react-bar { display: grid; grid-template-columns: repeat(3, auto); gap: 12px; justify-content: center; margin-top: 10px; }
@media (min-width: 520px) { .react-bar { grid-template-columns: repeat(6, auto); } }
.s-center p.react-hint { font-size: .95rem; margin-top: -4px; }
/* Warteraum (Handy) */
.lobby-wait { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 800; }
.lobby-count { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: 1.1rem; }
.lobby-count:empty { display: none; }
.lobby-count b { font-size: 1.3rem; color: var(--brand); }
.react-btn {
  width: 64px; height: 64px; border-radius: 20px; border: 0; background: var(--surface); box-shadow: var(--shadow);
  font-size: 2rem; line-height: 1; display: grid; place-items: center; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; animation: optIn .45s var(--ease) both; animation-delay: calc(300ms + var(--i, 0) * 70ms);
}
.react-btn:active { background: var(--surface-2); }
@media (min-width: 600px) { .react-btn { width: 76px; height: 76px; font-size: 2.4rem; } }
.react-fly { position: fixed; z-index: 90; font-size: 2.2rem; pointer-events: none; transform: translate(-50%, 0); animation: reactFly 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes reactFly {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, -30px) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -220px) scale(.9); }
}
.react-float {
  position: absolute; z-index: 7; pointer-events: none; font-size: calc(6.5cqh * var(--s, 1)); line-height: 1;
  animation: reactBurst 2.8s cubic-bezier(.25, .6, .35, 1) both; filter: drop-shadow(0 .6cqh .8cqh rgba(0, 0, 0, .15));
}
/* quer durchs ganze Bild: unten herein, in Schlangenlinien bis über den oberen Rand */
@keyframes reactBurst {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.4) rotate(0); }
  8% { opacity: 1; transform: translate(-50%, -14cqh) scale(1.2) rotate(calc(var(--rot) * .4)); }
  35% { transform: translate(calc(-50% + var(--dx) * .6), -45cqh) scale(1) rotate(calc(var(--rot) * -.6)); }
  65% { opacity: 1; transform: translate(calc(-50% - var(--dx) * .3), -78cqh) scale(1.05) rotate(calc(var(--rot) * .5)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -118cqh) scale(.9) rotate(var(--rot)); }
}
/* Handy im Warteraum: die Emojis der anderen steigen über den ganzen Bildschirm */
.react-rain { position: fixed; bottom: -60px; z-index: 40; pointer-events: none; font-size: calc(2.4rem * var(--s, 1)); line-height: 1;
  animation: reactRain 3.4s cubic-bezier(.3, .5, .4, 1) both; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15)); }
@keyframes reactRain {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  10% { opacity: .95; transform: translate(-50%, -12vh) scale(1.1) rotate(calc(var(--rot) * .4)); }
  45% { transform: translate(calc(-50% + var(--dx)), -50vh) rotate(calc(var(--rot) * -.5)); }
  80% { opacity: .9; }
  100% { opacity: 0; transform: translate(calc(-50% - var(--dx) * .5), -110vh) scale(.9) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) { .react-float, .react-fly, .react-rain { display: none; } }

/* Bilder in Antworten – bewusst klein */
.opt-img { flex: none; display: block; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .9); }
.opt-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.opts.with-img .opt { min-height: 84px; }
.opts.with-img { grid-template-columns: 1fr 1fr; }
.opts.with-img .opt { padding: 12px; }
.opts.with-img .opt .opt-img { width: 100%; max-width: 170px; height: auto; aspect-ratio: 4 / 3; flex: 0 1 auto; min-height: 0; max-height: 100%; }
.opts.quiz.with-img { grid-auto-rows: minmax(0, 1fr); }
.opts.with-img .opt .letter { width: 32px; height: 32px; font-size: 1rem; flex: none; }
.opts.two.with-img .opt { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.opts.two.with-img .opt .otext { flex: 0 1 auto; }
.rank-item .opt-img { width: 44px; height: 44px; border-radius: 10px; }
.reveal-imgs { display: flex; gap: 10px; justify-content: center; }
.reveal-imgs .opt-img { width: 96px; height: 96px; border-radius: 16px; box-shadow: var(--shadow); }
.bar .bimg { flex: none; width: min(100%, 13cqw); aspect-ratio: 4 / 3; max-height: 16cqh; border-radius: 1cqmin; overflow: hidden; background: var(--surface-2); }
.bar .bimg img, .hbar .bimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bars.with-img .bar .lbl { min-height: 0; }
.hbar .bimg { flex: none; width: 2.8em; height: 2.2em; border-radius: .4em; overflow: hidden; }
.rank-row .rimg { position: relative; float: left; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5em; margin-right: .2em; }
.opt-img-wrap { display: contents; }
.opt-img-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface); font-size: 1.1rem; cursor: pointer; padding: 0; position: relative; overflow: hidden; opacity: .7; }
.opt-img-btn:hover { opacity: 1; border-color: var(--brand); }
.opt-img-btn.has { border: 0; opacity: 1; }
.opt-img-btn.has img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opt-img-btn.has span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 900; opacity: 0; transition: opacity .15s; }
.opt-img-btn.has:hover span, .opt-img-btn.has:focus-visible span { opacity: 1; }

/* Video-Quiz: sanfter Stopp, Countdown, sanfter Wiedereinstieg */
.vid-box { transition: opacity .7s ease, transform .7s var(--ease-out), filter .7s ease; }
.vid-box.stopping { opacity: .35; transform: scale(.97); filter: blur(2px) saturate(.6); }
.vid-box.resume { animation: vidIn .3s ease-out both; }
@keyframes vidIn { from { opacity: 0; transform: scale(.985); } }
.cd-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; text-align: center; animation: cdIn .5s var(--ease-out) both; }
@keyframes cdIn { from { opacity: 0; transform: scale(.94); filter: blur(6px); } }
.cd-kicker { font-weight: 800; color: var(--muted); font-size: min(1.8cqw, 3.4cqh); letter-spacing: .02em; }
.cd-screen .cd-title { margin: 0; max-width: 80%; }
.cd-ring { position: relative; width: min(18cqw, 30cqh); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand), var(--pink), var(--brand)); box-shadow: 0 2cqh 5cqh color-mix(in srgb, var(--brand) 35%, transparent); }
.cd-ring::before { content: ""; position: absolute; inset: 7%; border-radius: 50%; background: var(--bg); }
.cd-num { position: relative; font-weight: 900; font-size: min(10cqw, 17cqh); line-height: 1; color: var(--brand-ink, var(--brand)); }
.cd-num span { display: block; animation: cdPop .9s var(--ease) both; }
@keyframes cdPop { 0% { opacity: 0; transform: scale(1.9); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(.94); } 100% { opacity: .2; transform: scale(.8); } }
/* Handy */
.cd-phone .cd-kicker { font-size: .95rem; }
.cd-phone .cd-ring { width: 150px; }
.cd-phone .cd-ring::before { background: var(--surface); }
.cd-phone .cd-num { font-size: 4.6rem; }
@media (prefers-reduced-motion: reduce) { .cd-num span, .cd-screen, .vid-box.resume { animation: none; } }
.lobby-qr { position: relative; z-index: 2; }

/* Bühnenrand: Countdown oben rechts, Antworten / Teilnehmende unten rechts */
.hud-timer { position: absolute; top: 2.2cqh; right: 1.8cqw; z-index: 6; width: min(8.5cqw, 15cqh); aspect-ratio: 1; animation: bounceIn .5s var(--ease) both; }
.hud-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hud-timer circle { fill: var(--surface); stroke-width: 9; }
.hud-timer .bg { stroke: var(--surface-2); }
.hud-timer .fg { fill: none; stroke: var(--brand); stroke-linecap: round; transition: stroke .3s; }
.hud-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: min(3.2cqw, 5.6cqh); font-variant-numeric: tabular-nums; }
.hud-timer.low .fg { stroke: var(--red); }
.hud-timer.low span { color: var(--red); animation: tick 1s infinite; }
.stage:has(> .hud-timer:not([hidden])) .p-title { padding-inline: 10cqw; }
.hud-count { position: absolute; right: 1.8cqw; bottom: 2.2cqh; z-index: 6; display: flex; align-items: center; gap: .4em; padding: .4em .9em; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: min(1.7cqw, 3.2cqh); line-height: 1; }
.hud-count b { font-size: 1.35em; font-variant-numeric: tabular-nums; }
.hud-count .of { color: var(--muted); }
.hud-count .ic { font-size: 1.1em; }
.hud-count.people { font-size: min(2.3cqw, 4.4cqh); padding: .45em 1em; }
.stage:has(> .hud-count:not([hidden])) .p-body { padding-bottom: 7.5cqh; }

/* Auflösung auf dem Beamer: richtig grün, falsch rot – beides animiert, ohne Konfetti */
.bars.reveal-mode .bar.correct .col { background: var(--green); box-shadow: 0 0 0 .5cqmin color-mix(in srgb, var(--green) 35%, transparent), 0 1cqh 3cqh color-mix(in srgb, var(--green) 45%, transparent); animation: goodGlow 1.2s ease-out 1; }
@keyframes goodGlow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 70%, transparent); } 100% { box-shadow: 0 0 0 3cqmin transparent; } }
.bars.reveal-mode .bar:not(.correct) .col { opacity: 1; filter: none; background: color-mix(in srgb, var(--c) 30%, var(--surface-2)); box-shadow: none; }
.bars.reveal-mode .bar .lbl i, .bars.reveal-mode .hbar .lt i { color: transparent; position: relative; transition: background .3s; }
.bars.reveal-mode .bar .lbl i::before, .bars.reveal-mode .hbar .lt i::before { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.15em; font-weight: 900; color: #fff; }
.bars.reveal-mode .bar.correct .lbl i, .bars.reveal-mode .hbar.correct .lt i { background: var(--green); animation: bounceIn .6s var(--ease) both; }
.bars.reveal-mode .bar.correct .lbl i::before, .bars.reveal-mode .hbar.correct .lt i::before { content: "✓"; }
.bars.reveal-mode .bar:not(.correct) .lbl i, .bars.reveal-mode .hbar:not(.correct) .lt i { background: var(--red); animation: chipShake .5s ease .25s both; }
.bars.reveal-mode .bar:not(.correct) .lbl i::before, .bars.reveal-mode .hbar:not(.correct) .lt i::before { content: "✕"; }
.bars.reveal-mode .bar:not(.correct) .lbl > span, .bars.reveal-mode .bar:not(.correct) .bimg { opacity: .55; }
@keyframes chipShake { 0% { transform: scale(.4); } 35% { transform: scale(1.1); } 50% { transform: translateX(-20%); } 65% { transform: translateX(20%); } 80% { transform: translateX(-10%); } 100% { transform: none; } }
.bars.reveal-mode .bar.correct .val { color: var(--green); }
@keyframes badShake { 0% { transform: translateX(-50%) scale(.3); opacity: 0; } 40% { transform: translateX(-50%) scale(1.1); opacity: 1; } 55% { transform: translateX(calc(-50% - .25em)); } 70% { transform: translateX(calc(-50% + .25em)); } 85% { transform: translateX(calc(-50% - .12em)); } 100% { transform: translateX(-50%); } }
.bars.reveal-mode .hbar.correct .hfill { background: var(--green); }

/* Feedback nach der Auflösung: kurz und eindeutig */
.fb-icon { width: clamp(96px, 30vw, 140px); aspect-ratio: 1; animation: fbPop .45s var(--ease) both; }
.fb-icon svg { width: 100%; height: 100%; overflow: visible; }
.fb-icon .ring { fill: rgba(255, 255, 255, .22); stroke: #fff; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: fbDraw .45s ease-out forwards; }
.fb-icon .mark { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: fbDraw .35s .35s ease-out forwards; }
.fb-icon.bad { animation: fbPop .45s var(--ease) both, fbShake .45s .7s ease both; }
@keyframes fbPop { from { transform: scale(.4); opacity: 0; } }
@keyframes fbDraw { to { stroke-dashoffset: 0; } }
@keyframes fbShake { 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.reveal.good { animation: screenIn .3s var(--ease-out), goodFlash .9s ease-out; }
.reveal.bad { animation: screenIn .3s var(--ease-out), badFlash .9s ease-out; }
@keyframes goodFlash { 0% { box-shadow: inset 0 0 0 0 rgba(255, 255, 255, .55); } 100% { box-shadow: inset 0 0 0 60vmax rgba(255, 255, 255, 0); } }
@keyframes badFlash { 0% { box-shadow: inset 0 0 0 0 rgba(0, 0, 0, .25); } 100% { box-shadow: inset 0 0 0 60vmax rgba(0, 0, 0, 0); } }
.reveal .points { animation: bounceIn .6s .5s var(--ease) both; }

/* Countdown auf dem Handy: dünner Balken ganz oben + Sekunden */
.s-timer { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 6px; background: var(--surface-2); pointer-events: none; }
.s-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); background-size: 300% 100%; transform-origin: left; }
.s-timer span { position: absolute; top: 14px; left: 0; right: 0; margin: 0 auto; width: max-content; min-width: 44px; padding: 5px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; font-size: 1rem; }
.s-timer.low span { color: var(--red); animation: tick 1s infinite; }

/* Sieger am Ende */
.winner .medal { font-size: 6rem; animation: medalIn .9s var(--ease) both; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .2)); }
@keyframes medalIn { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.15) rotate(8deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .fb-icon .ring, .fb-icon .mark { stroke-dashoffset: 0; animation: none; } }
/* solange die Ergebnisse verdeckt sind: Antworten groß zeigen, bei der Auflösung schrumpfen sie für die Balken */
.bar .bimg, .bar .lbl { transition: max-height .6s var(--ease-out), width .6s var(--ease-out), font-size .4s; }
.bars.hidden-results .bar .bimg { width: 100%; max-height: 46cqh; }
.bars.hidden-results .bar .lbl { font-size: min(2.3cqw, 4.2cqh); }
.bars.reveal-mode .bar .lbl i { width: 2em; height: 2em; border-radius: .6em; }

/* Lesezeit: die Frage steht groß im Mittelpunkt, der Countdown ist klein und ruhig */
.cd-screen.reading { gap: 2.6cqh; }
.cd-screen.reading .cd-title { font-size: min(4.6cqw, 8.4cqh); max-width: 88%; }
.cd-screen.reading .cd-title.len-l { font-size: min(3.6cqw, 6.6cqh); }
.cd-screen.reading .cd-title.len-xl { font-size: min(2.8cqw, 5.2cqh); }
.cd-screen.reading .cd-ring { width: min(10cqw, 17cqh); }
.cd-screen.reading .cd-num { font-size: min(5.4cqw, 9.6cqh); }
.cd-screen.with-img .cd-img { min-height: 0; flex: 0 1 auto; display: grid; place-items: center; }
.cd-screen.with-img .cd-img img { max-height: 42cqh; max-width: 70cqw; border-radius: 1.6cqmin; box-shadow: var(--shadow-lg); }
.cd-phone.reading h2 { font-size: clamp(1.5rem, 7vw, 2.2rem); line-height: 1.2; }
.cd-phone.reading .cd-ring { width: 96px; }
.cd-phone.reading .cd-num { font-size: 2.8rem; }
.cd-phone.reading .q-img-wrap { width: 100%; }

/* Lange Antworten: waagerechte Balken lesbar halten */
.bars.h { gap: 2cqh; }
.hbar .lt > span { -webkit-line-clamp: 4; }
.bars.h.long .hbar { font-size: min(1.45cqw, 2.7cqh); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 5cqw; }
/* neben einem Bild: Text in voller Breite über dem Balken */
.bars.h.narrow { gap: 1.8cqh; }
.bars.h.narrow .hbar { grid-template-columns: minmax(0, 1fr) 4.5cqw; row-gap: .7cqh; column-gap: 1cqw; font-size: min(1.5cqw, 2.8cqh); }
.bars.h.narrow .hbar .lt { grid-column: 1 / -1; }
.bars.h.narrow .hbar .track { height: 1.5em; }
.bars.h.narrow .hbar .hv { font-size: 1.15em; }
.p-body.with-img:has(.bars.narrow), .p-body.with-img:has(.bars.narrow.hidden-results) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.bars.h.narrow .hbar { font-size: min(1.7cqw, 3.1cqh); }
.hbar .lt .math, .bar .lbl .math, .rank-row .math, .opt .otext .math { display: inline-block; padding-top: .3em; vertical-align: middle; }
/* lange Antworten ohne Bild: Text in voller Breite über dem Balken, gut lesbar groß */
.bars.h.long:not(.narrow) { gap: 2.6cqh; }
.bars.h.long:not(.narrow) .hbar { grid-template-columns: minmax(0, 1fr) 5cqw; row-gap: .6cqh; column-gap: 1.2cqw; font-size: min(2.1cqw, 3.8cqh); }
.bars.h.long:not(.narrow) .hbar .lt { grid-column: 1 / -1; }
.bars.h.long:not(.narrow) .hbar .track { height: 1.4em; }
.bars.h.long:not(.narrow) .hbar .hv { font-size: 1.2em; }
/* viele kurze Antworten: Text links schmal, Balken lang, Schrift größer (auf dem Beamer von hinten lesbar) */
.bars.h.short .hbar { grid-template-columns: minmax(0, .75fr) minmax(0, 1.6fr) 5cqw; font-size: min(2cqw, 3.6cqh); }
/* senkrechte Balken: mehrzeilige Beschriftung bündig neben dem Buchstaben */
.bar .lbl { justify-content: center; }
.bar .lbl > span { text-align: left; }

/* ---------------------------------------------------------------- Eigenes Tempo (asynchron) */
/* Handy: Fortschritt mit Vor/Zurück */
.self-nav { display: flex; align-items: center; gap: 10px; padding: 0 12px 6px; width: 100%; max-width: 760px; margin: 0 auto; }
.sn-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: 900 1.6rem/1 var(--font); display: grid; place-items: center; padding-bottom: 3px; cursor: pointer; transition: transform .15s, opacity .2s; }
.sn-btn:active:not(:disabled) { transform: scale(.9); }
.sn-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }
.sn-track { flex: 1; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.sn-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--pink)); transition: width .6s var(--ease-out); }
.sn-txt { flex: none; font-weight: 800; font-size: .9rem; color: var(--muted); min-width: 3.6em; text-align: center; font-variant-numeric: tabular-nums; }
.s-main.nav-next, .s-main.nav-prev { overflow-x: clip; }
.s-main.nav-next > * { animation: navNext .38s var(--ease-out) both; }
.s-main.nav-prev > * { animation: navPrev .38s var(--ease-out) both; }
@keyframes navNext { from { opacity: 0; transform: translateX(40px); } }
@keyframes navPrev { from { opacity: 0; transform: translateX(-40px); } }
.self-next { min-width: min(100%, 280px); }
.s-center > .self-next { margin-top: 8px; }
.slide-wrap .submit-bar { display: flex; justify-content: center; position: static; background: none; padding-top: 4px; }
.slide-wrap .submit-bar::before { display: none; }
.reveal .reveal-next { margin-top: 10px; background: #fff; color: #2a2340; min-width: 220px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); animation: screenIn .5s .7s var(--ease-out) both; }
.reveal.good .reveal-next { color: #0b7a4b; }
.reveal.bad .reveal-next { color: #b3263a; }
.reveal.none .reveal-next { color: #4a35c2; }
.fin-score { display: grid; gap: 2px; justify-items: center; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px 26px; }
.fin-score b { font-size: 1.8rem; }
.fin-score span { color: var(--muted); font-weight: 700; }
.fin-note { color: var(--muted); font-weight: 600; margin: 0; }
@media (prefers-reduced-motion: reduce) { .s-main.nav-next > *, .s-main.nav-prev > * { animation: none; } }
/* Beamer: Übersicht im eigenen Tempo (Lobby bleibt mit QR offen für Nachzügler) */
.self-info { display: grid; gap: 1.2cqh; margin: .4cqh 0 2cqh; max-width: 60cqw; }
.si-head { display: flex; align-items: center; gap: 1.2cqw; flex-wrap: wrap; font-size: min(1.9cqw, 3.6cqh); }
.si-badge { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand-ink); border-radius: 99px; padding: .25em .8em; font-weight: 900; font-size: .8em; }
.si-bar { height: max(8px, 1.4cqh); border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.si-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--pink)); transition: width .8s var(--ease-out); }
.lobby.self .lobby-people { max-height: 40cqh; }
.person .pstep:empty { display: none; }
.person .pstep { font-size: .78em; font-weight: 900; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 99px; padding: .1em .55em; font-variant-numeric: tabular-nums; }
.person.done { background: color-mix(in srgb, var(--green) 16%, var(--surface)); }
.person.done .pstep { background: var(--green); color: #fff; animation: pop .4s var(--ease); }
/* Steuerleiste / Teilnehmerliste */
.self-chip { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.self-chip b { color: var(--text); }
.drawer .p-row .p-step { flex: none !important; font-size: .82rem; font-weight: 800; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 99px; padding: 2px 8px; }
.drawer .p-row .p-step.done { background: var(--green); color: #fff; }
/* Sitzung starten: Ablauf, Darstellung, Teamspiel, Zufalls-Ereignisse */
/* Eigenes Tempo: Punkte nach Zeit, Live-Wertung */
.reveal .points .secs { display: block; font-size: 1.05rem; font-weight: 800; opacity: .85; margin-top: 2px; }
.fin { gap: 10px; }
.check-circle.small { width: 72px; height: 72px; font-size: 2.4rem; }
.fin-score .fin-rank { display: inline-block; font-size: 2rem; }
.mini-board.live .row { animation-delay: calc(var(--i) * 60ms); }
.mini-board.live .row small.st { flex: none !important; width: 1.4em; text-align: center; color: var(--muted); font-weight: 900; }
.mini-board.live .row.done small.st { color: var(--green); }
.mini-board.live .row strong { font-variant-numeric: tabular-nums; }
.lb-sep { text-align: center; color: var(--muted); font-weight: 900; line-height: .6; }
/* Beamer: Live-Wertung */
.live-board { grid-template-rows: auto 1fr auto; gap: 2.4cqh; max-width: 74cqw; }
.lb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; flex-wrap: wrap; }
.lb-sub { font-weight: 800; color: var(--muted); font-size: min(1.7cqw, 3.2cqh); }
.lb-list { display: grid; gap: 1.1cqh; align-content: start; }
.lb-row { display: flex; align-items: center; gap: 1.4cqw; background: var(--surface); border-radius: 1.4cqmin; padding: .9cqh 1.6cqw; box-shadow: var(--shadow); font-weight: 800; font-size: min(2.4cqw, calc(34cqh / max(var(--n, 6), 4))); animation: screenIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.lb-row .rk { width: 2.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row.top .rk { color: var(--brand-ink); }
.lb-row .avatar { width: 2em; height: 2em; font-size: .8em; flex: none; }
.lb-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .st { font-size: .72em; font-weight: 800; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 99px; padding: .2em .7em; font-variant-numeric: tabular-nums; }
.lb-row.done .st { background: color-mix(in srgb, var(--green) 18%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--text)); }
.lb-row .sc { min-width: 4em; text-align: right; font-size: 1.1em; font-variant-numeric: tabular-nums; }
.lb-more { text-align: center; color: var(--muted); font-weight: 800; font-size: min(1.4cqw, 2.6cqh); }

/* ===================================================== 3D-ABENTEUER (Schüler) */
.w3d { position: fixed; inset: 0; z-index: 0; background: #120e22; touch-action: none; user-select: none; -webkit-user-select: none; }
.w3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.w3d-fade { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .42s ease; }
.w3d-fade.on { opacity: 1; transition-duration: .4s; }
.w3d-fade.flash { transition-duration: .12s; }
/* 3D-Ereignis (Erdbeben, Eis …): Hinweis oben, nach ein paar Sekunden nur noch Name + Restzeit */
.w3d-ev { position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 54px); transform: translateX(-50%); z-index: 6; pointer-events: none;
  width: min(92vw, 420px); padding: 10px 16px 12px; border-radius: 18px; color: #fff; text-align: center; overflow: hidden;
  background: linear-gradient(135deg, rgba(120, 30, 20, .88), rgba(60, 20, 70, .88)); border: 2px solid rgba(255, 216, 74, .75);
  box-shadow: 0 8px 26px rgba(0,0,0,.35); animation: w3dEvIn .5s cubic-bezier(.2, 1.4, .4, 1); transition: width .4s ease, padding .4s ease; }
.w3d-ev[hidden] { display: none; }
.w3d-ev.shielded { background: linear-gradient(135deg, rgba(20, 70, 160, .9), rgba(40, 30, 110, .9)); border-color: #7fd0ff; box-shadow: 0 0 24px rgba(111, 200, 255, .55); }
/* Schild-Powerup: Anzeige unter dem Namen (getragen bzw. schützt gerade) */
.w3d-shield { position: absolute; left: max(14px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 52px); z-index: 6; pointer-events: none;
  padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: .9rem; color: #fff; background: rgba(24, 30, 70, .8); border: 2px solid #6fa8ff; }
.w3d-shield[hidden] { display: none; }
.w3d-shield.on { background: linear-gradient(90deg, #1f6fe0, #46b8ff); border-color: #bfe8ff; animation: w3dShield 1.2s ease-in-out infinite; }
@keyframes w3dShield { 50% { box-shadow: 0 0 18px rgba(127, 208, 255, .9); } }
.w3d-ev-head { font-weight: 900; font-size: 1.2rem; letter-spacing: .02em; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.w3d-ev-hint { font-weight: 700; font-size: .95rem; margin-top: 2px; opacity: .95; }
.w3d-ev-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: #ffd84a; transform-origin: left center; }
.w3d-ev.mini { width: auto; padding: 6px 14px 8px; }
.w3d-ev.mini .w3d-ev-head { font-size: 1rem; }
.w3d-ev.mini .w3d-ev-hint { display: none; }
.w3d-host .w3d-ev { top: auto; bottom: 86px; left: 24px; transform: none; width: 380px; }
@keyframes w3dEvIn { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.w3d-host .w3d-ev { animation-name: w3dEvInHost; }
@keyframes w3dEvInHost { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

body.in-world { overflow: hidden; background: #120e22; overscroll-behavior: none; }
body.in-world #app { position: relative; z-index: 2; height: 100vh; height: 100dvh; min-height: 0; }
body.w-hud #app, body.w-hud #app .s-main, body.w-picking #app { pointer-events: none; }
body.w-hud #app button, body.w-hud #app a, body.w-hud #app .w-q, body.w-hud #app .self-nav { pointer-events: auto; }
body.w-picking #app > :not(.w-loading) { display: none; }
body.in-world .s-top { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
body.in-world .s-top .pill { background: rgba(24, 18, 40, .72); color: #ffe7a8; box-shadow: 0 2px 10px rgba(0,0,0,.25); border: 1px solid rgba(232, 181, 74, .45); text-shadow: none; }
body.in-world .self-nav { background: rgba(24, 18, 40, .6); border-radius: 999px; padding: 4px 6px; width: calc(100% - 24px); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Laden */
.w-loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; color: #f6e7c4; font-weight: 800; font-size: 1.1rem;
  background: radial-gradient(circle at 50% 40%, #3a2a5a, #120e22 70%); }
.w-spin { width: 58px; height: 58px; border-radius: 50%; border: 5px solid rgba(232,181,74,.25); border-top-color: #e8b54a; animation: wspin .9s linear infinite; }
@keyframes wspin { to { transform: rotate(360deg); } }

/* HUD */
.w-hud-wrap { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 0; }
body.w-hud .s-main { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.w-q { align-self: center; width: 100%; max-width: 620px; padding: 12px 16px 14px; border-radius: 18px; color: #fff8e6; text-align: center;
  background: linear-gradient(180deg, rgba(30, 22, 48, .82), rgba(22, 16, 36, .74)); border: 2px solid rgba(232, 181, 74, .7);
  box-shadow: 0 8px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  max-height: 34vh; overflow: auto; animation: wDrop .5s var(--ease-out) both; }
@keyframes wDrop { from { opacity: 0; transform: translateY(-14px); } }
.w-kicker { font-family: Georgia, serif; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: #e8b54a; margin-bottom: 4px; }
.w-qt { font-weight: 900; font-size: clamp(1.15rem, 4.6vw, 1.6rem); line-height: 1.25; letter-spacing: -.01em; }
.w-qt.len-l { font-size: clamp(1.05rem, 4vw, 1.35rem); }
.w-qt.len-xl { font-size: clamp(.98rem, 3.6vw, 1.2rem); }
.w-hint { margin: 6px 0 0; color: #e9dcc0; font-weight: 600; font-size: .95rem; }
.w-img-btn { margin-top: 8px; border: 1px solid rgba(232,181,74,.6); background: rgba(255,255,255,.08); color: #ffe7a8; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; }
.w-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 620px; align-self: center; }
.w-status { padding: 9px 16px; border-radius: 999px; font-weight: 800; color: #fff; background: rgba(24, 18, 40, .78); border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 4px 16px rgba(0,0,0,.3); text-align: center; animation: wPop .45s var(--ease) both; max-width: 100%; }
.w-status small { font-weight: 700; opacity: .85; }
.w-status.go { background: rgba(24, 18, 40, .7); font-weight: 700; font-size: .95rem; }
.w-status.read { background: rgba(40, 30, 70, .85); }
.w-status.read b { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-left: 4px; border-radius: 50%; background: #e8b54a; color: #2b1a00; }
.w-status.ok { background: rgba(30, 60, 120, .85); }
.w-status.good { background: linear-gradient(90deg, #12a35c, #2fcf7f); font-size: 1.15rem; }
.w-status.bad { background: linear-gradient(90deg, #c8332b, #ff5a4e); font-size: 1.1rem; }
.w-status.late { background: rgba(90, 70, 40, .9); }
@keyframes wPop { from { opacity: 0; transform: scale(.85); } }
.w-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.w-opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 2px solid rgba(255,255,255,.14);
  background: rgba(24, 18, 40, .74); color: #fff; font-weight: 800; text-align: left; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: transform .15s, border-color .2s; }
.w-opt:active { transform: scale(.97); }
.w-opt.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 4px 14px rgba(0,0,0,.25); }
.w-opt.good { border-color: #2fcf7f; }
.w-otext { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; font-size: .95rem; }
.w-shape { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--c); position: relative; }
.w-shape::after { content: ""; position: absolute; inset: 0; margin: auto; background: #fff; }
.w-shape.s0::after { width: 18px; height: 16px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.w-shape.s1::after { width: 18px; height: 18px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.w-shape.s2::after { width: 16px; height: 16px; border-radius: 50%; }
.w-shape.s3::after { width: 14px; height: 14px; }
.w-pass { animation: wPulse 1.6s infinite; }
@keyframes wPulse { 0% { box-shadow: 0 0 0 0 rgba(232,181,74,.6); } 70% { box-shadow: 0 0 0 12px rgba(232,181,74,0); } }
.w-emotes { display: flex; gap: 8px; }
.w-emote { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(232,181,74,.5); background: rgba(24, 18, 40, .7); font-size: 1.3rem; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.25); padding: 0; }
.w-emote:active { transform: scale(.9); }
.w-react { margin: 0; }

/* Karte über der Landschaft (Folien, Textfragen, Wertung …) */
body.w-overlay #app { background: linear-gradient(180deg, rgba(14,10,28,.1), rgba(14,10,28,.45)); overflow: auto; }
body.w-overlay .s-main { flex: 0 1 auto; margin: auto auto max(12px, env(safe-area-inset-bottom)); width: calc(100% - 20px); border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); box-shadow: 0 14px 40px rgba(0,0,0,.35); border: 2px solid rgba(232, 181, 74, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-height: calc(100dvh - 140px); overflow: auto; padding-top: 16px; }
body.w-overlay .s-center { flex: 0 0 auto; padding: 8px 0; }
body.w-overlay .slide-wrap.solo { min-height: 0; }
body.w-overlay .s-main > .screen-in { flex: 0 0 auto !important; }

/* reduziertes HUD: nur Statuszeile + Menü-Knopf unten */
.w-hud-wrap { justify-content: flex-end; align-items: center; }
.w-bar { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.w-bar .w-status { flex: 0 1 auto; font-size: .92rem; padding: 8px 14px; }
.w-status.good { font-size: 1.05rem; }
.w-pass { flex: none; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 900; color: #2b1a00; background: radial-gradient(circle at 35% 30%, #fff1c2, #e0a63a);
  box-shadow: 0 4px 14px rgba(0,0,0,.3); animation: wPulse 1.6s infinite; }
.w-menu-btn { flex: none; }
.w-menu-btn.on { background: rgba(232,181,74,.9); }
.w-menu { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 22px; background: rgba(24, 18, 40, .72); border: 1px solid rgba(232,181,74,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: wPop .3s var(--ease) both; }
.w-row { display: flex; gap: 8px; justify-content: center; }
.w-qmini { align-self: center; cursor: pointer; padding: 8px 14px 10px; max-height: 26vh; }
.w-qmini .w-qt { font-size: clamp(1rem, 4vw, 1.3rem); }
.w-qmini.closed { width: auto; padding: 6px 14px; }
.w-qmini.closed .w-kicker { margin: 0; }
.w-spacer { flex: 1; }
.q-zoom .q-zoom-card { max-width: min(720px, 92vw); padding: 22px 26px; border-radius: 18px; text-align: center; color: #3a2410;
  background: linear-gradient(180deg, #f6e7c4, #ead2a0); border: 4px solid #6b4520; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.q-zoom .q-zoom-t { font-weight: 900; font-size: clamp(1.3rem, 5vw, 2.1rem); line-height: 1.25; }
.q-zoom .q-zoom-card img { max-height: 40vh; margin: 14px auto 0; border-radius: 10px; }
.q-zoom .w-kicker { color: #a8202a; }
body.w-hud .s-top { pointer-events: none; }
body.w-hud .s-top > * { pointer-events: auto; }
/* nach der Auflösung: dezenter 5-s-Countdown bis zur nächsten Aufgabe (oben rechts) */
.w-next { position: fixed; right: max(14px, env(safe-area-inset-right)); top: calc(max(10px, env(safe-area-inset-top)) + 52px); z-index: 30; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; font-weight: 800; font-size: .82rem; color: #fff8e6;
  background: rgba(24, 18, 40, .6); border: 1px solid rgba(255,255,255,.18); opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .4s; }
.w-next.on { opacity: 1; transform: none; }
.w-next b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .95rem; color: #fff;
  background: radial-gradient(closest-side, rgba(24,18,40,.95) 76%, transparent 78% 100%), conic-gradient(#e8b54a calc(var(--p, 1) * 360deg), rgba(255,255,255,.18) 0); }
@media (prefers-reduced-motion: reduce) { .w-q, .w-status, .w-pass, .wp-head { animation: none; } }

/* ===================================================== 3D-ABENTEUER (Beamer-Überblick) */
.w3-layer { position: absolute; inset: 0; z-index: 0; display: none; }
.present.w3 .w3-layer { display: block; }
.w3d.w3d-host { position: absolute; inset: 0; z-index: 0; background: #120e22; touch-action: auto; }
.present.w3 { background: #120e22; }
.present.w3 .stage { grid-row: 1 / -1; grid-column: 1; }
.present.w3 .p-top { grid-row: 1; grid-column: 1; position: relative; z-index: 5; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.present.w3 .p-bottom { grid-row: 3; grid-column: 1; position: relative; z-index: 5; }
.present.w3 .p-top .join-hint b { color: #ffd36a; }
.present.w3 .st-inner { visibility: hidden; }
.present.w3 .hud-count { z-index: 6; }
.present.w3 .hud-timer { width: min(12cqw, 21cqh); top: 10cqh; }
.present.w3 .hud-timer circle { fill: rgba(24, 18, 40, .82); }
.present.w3 .hud-timer span { color: #fff; font-size: min(4.6cqw, 8cqh); }
/* Lesezeit: Countdown groß über der Szene */
.present.w3.w3cd .st-inner { visibility: visible; z-index: 4; background: radial-gradient(circle at 50% 50%, rgba(18,14,34,.55), rgba(18,14,34,.82)); color: #fff8e6; }
.present.w3.w3cd .w3-title { opacity: 0; }
.present.w3.w3cd .cd-screen .cd-kicker { color: #e8b54a; font-size: min(2.4cqw, 4.4cqh); }
.present.w3.w3cd .cd-screen .p-title { color: #fff8e6; text-shadow: 0 .4cqh 2cqh rgba(0,0,0,.6); }
.present.w3.w3cd .cd-screen.reading .cd-ring { width: min(16cqw, 27cqh); }
.present.w3.w3cd .cd-ring::before { background: rgba(24, 18, 40, .9); }
.present.w3.w3cd .cd-num { color: #ffd36a; font-size: min(9cqw, 15cqh); }
/* Frage über der Szene */
.w3-title { position: absolute; top: 2cqh; left: 50%; transform: translateX(-50%); z-index: 3; width: max-content; max-width: 74cqw; text-align: center;
  padding: 1.6cqh 3cqw 2cqh; border-radius: 2.4cqh; color: #3a2410; transition: opacity .4s;
  background: linear-gradient(180deg, #f6e7c4, #ead2a0); border: .5cqh solid #6b4520; box-shadow: 0 1cqh 4cqh rgba(0,0,0,.45), inset 0 0 0 .4cqh #c8902e; }
.w3-title:empty { display: none; }
.w3-sub { font-family: Georgia, serif; font-weight: 700; color: #8a5a22; font-size: min(1.7cqw, 3cqh); letter-spacing: .04em; }
.w3-q { font-weight: 900; font-size: min(2.8cqw, 5.2cqh); line-height: 1.2; }
.w3-q.len-l { font-size: min(2.6cqw, 4.8cqh); }
.w3-q.len-xl { font-size: min(2cqw, 3.8cqh); }
/* Lobby: Beitritts-Code groß */
.present.w3-lobby .join-hint { visibility: visible !important; align-self: flex-start; margin-top: 1vh; padding: 1.2vh 1.4vw; border-radius: 18px; gap: 1.2vw;
  background: rgba(24, 18, 40, .78); border: 2px solid rgba(232, 181, 74, .7); color: #fff8e6; font-size: clamp(1rem, 2vw, 2rem); text-shadow: none; }
.present.w3-lobby .join-hint .qr { width: clamp(90px, 12vw, 220px); background: #fff; padding: 6px; }
.present.w3-lobby .join-hint b { font-size: 1.6em; }

/* Beamer: Bild zur Frage groß zeigen */
.w3-img-btn { position: absolute; z-index: 7; left: 2cqw; bottom: 12cqh; width: min(6.5cqw, 11cqh); aspect-ratio: 1; border-radius: 22%; font-size: min(3.2cqw, 5.6cqh);
  display: grid; place-items: center; padding: 0; cursor: pointer; color: #fff; background: rgba(24, 18, 40, .82); border: 3px solid #d9a640;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); animation: bounceIn .5s var(--ease) both; transition: transform .15s; }
.w3-img-btn:hover { transform: scale(1.08); }
.w3-img-btn.on { background: #d9a640; }
.present:not(.w3) .w3-img-btn, .present:not(.w3) .w3-img-view { display: none; }
/* Beamer: dezenter Countdown zur nächsten Aufgabe nach der Auflösung (unten rechts), ⏸ hält an */
.next-cd { position: absolute; z-index: 7; right: 2cqw; bottom: 12cqh; display: flex; align-items: center; gap: min(1cqw, 1.6cqh); padding: min(.6cqw, 1cqh) min(.6cqw, 1cqh) min(.6cqw, 1cqh) min(1.4cqw, 2.4cqh);
  border-radius: 999px; font-weight: 800; font-size: min(1.5cqw, 2.6cqh); color: #fff8e6; background: rgba(24, 18, 40, .62); border: 1px solid rgba(255,255,255,.18);
  opacity: 0; transition: opacity .4s; }
.next-cd.on { opacity: 1; }
.next-cd[hidden] { display: none; }
.next-cd b { display: grid; place-items: center; width: min(3.4cqw, 6cqh); aspect-ratio: 1; border-radius: 50%; font-size: min(1.8cqw, 3.2cqh);
  background: radial-gradient(closest-side, rgba(24,18,40,.95) 76%, transparent 78% 100%), conic-gradient(#e8b54a calc(var(--p, 1) * 360deg), rgba(255,255,255,.18) 0); }
.next-cd button { border: 0; border-radius: 999px; padding: min(.4cqw, .7cqh) min(.9cqw, 1.5cqh); font: inherit; font-size: .85em; cursor: pointer; color: #fff8e6; background: rgba(255,255,255,.14); }
.next-cd button:hover { background: rgba(255,255,255,.28); }
.w3-img-view { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 4cqh 4cqw; cursor: zoom-out;
  background: rgba(10, 8, 20, .82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .25s ease both; }
.w3-img-view img { width: min(92cqw, calc(84cqh * var(--ar, 1.333))); height: auto; max-height: 84cqh; object-fit: contain; border-radius: 1.2cqh; background: #fff;
  border: 1cqh solid #d9a640; box-shadow: 0 2cqh 6cqh rgba(0,0,0,.6); }
.w3-img-hint { position: absolute; bottom: 2cqh; left: 0; right: 0; text-align: center; color: #f6e7c4; font-weight: 700; font-size: min(1.4cqw, 2.6cqh); opacity: .8; }
@keyframes fadeIn { from { opacity: 0; } }

/* 3D-Beamer: nur das Nötigste – kein kleiner QR-Code, keine doppelte Teilnehmerzahl, kein Fortschrittsbalken */
.present.w3:not(.w3-lobby) .join-hint { display: none; }
.present.w3 .p-count > span:not(.qa-pill) { display: none; }
.present.w3 .p-progress { display: none; }
.present.w3 .p-bottom { justify-content: center; gap: 2vw; }
.present.w3 .p-bottom .btn { background: rgba(24, 18, 40, .82); color: #fff8e6; border-color: rgba(232, 181, 74, .55); }
.present.w3 .p-bottom .btn.primary { background: #d9a640; color: #2b1a00; border-color: #d9a640; }
.present.w3 .p-bottom .self-chip { background: rgba(24, 18, 40, .82); color: #fff8e6; }
.present.w3 .p-bottom .self-chip b { color: #ffd84a; }

/* ===================================================== Schätzfrage */
.est-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.est-input { font-size: 2rem; font-weight: 900; text-align: center; max-width: 280px; letter-spacing: .02em; }
.est-input::placeholder { font-size: 1.2rem; font-weight: 800; letter-spacing: 0; } /* Hinweis passt ins Feld, Zahlen bleiben groß */
.est-unit { font-size: 1.6rem; font-weight: 900; color: var(--muted); }
/* Skala mit mehreren Aussagen (Teilnehmende): Schieberegler je Aussage */
.sl-list { display: grid; gap: 14px; width: 100%; }
.sl-legend { margin: 0 0 2px; font-size: 1rem; color: var(--text); }
.sl-item { --th: 32px; padding: 12px 14px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); }
.sl-text { font-weight: 800; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.sl-wrap { position: relative; padding-top: 30px; }
.sl-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.sl-range:disabled { cursor: default; }
.sl-range::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: linear-gradient(to right, var(--c) calc(var(--pn) * (100% - var(--th)) + var(--th) / 2), var(--surface-2) 0); }
.sl-range::-webkit-slider-thumb { -webkit-appearance: none; width: var(--th); height: var(--th); margin-top: calc(5px - var(--th) / 2); border-radius: 50%; background: var(--c); border: 4px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .15s; }
.sl-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.sl-range::-moz-range-track { height: 10px; border-radius: 99px; background: var(--surface-2); }
.sl-range::-moz-range-progress { height: 10px; border-radius: 99px; background: var(--c); }
.sl-range::-moz-range-thumb { width: calc(var(--th) - 8px); height: calc(var(--th) - 8px); border-radius: 50%; background: var(--c); border: 4px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.sl-range:focus-visible { outline: none; }
.sl-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent); }
.sl-val { position: absolute; top: 0; left: calc(var(--pn) * (100% - var(--th)) + var(--th) / 2); transform: translateX(-50%); min-width: 30px; padding: 2px 8px; border-radius: 99px; background: var(--c); color: #fff; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; pointer-events: none; }
.sl-val::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); z-index: -1; }
.sl-ticks { position: relative; height: 1.2em; margin-top: -4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.sl-ticks span { position: absolute; left: calc(var(--t) * (100% - var(--th)) + var(--th) / 2); transform: translateX(-50%); }
.sl-item.fresh .sl-val { background: var(--muted); }
.sl-item.fresh .sl-range::-webkit-slider-thumb { background: var(--surface); border-color: var(--c); }
.sl-item.fresh .sl-range::-moz-range-thumb { background: var(--surface); border-color: var(--c); }
.sl-item.fresh .sl-range::-moz-range-progress { background: transparent; }
.sl-item.fresh .sl-range::-webkit-slider-runnable-track { background: var(--surface-2); }
.pv-phone .sl-list { gap: 8px; }
.pv-phone .sl-item { padding: 8px 10px 4px; }
.est-range { width: 100%; accent-color: var(--brand); height: 34px; }
.est-hint { min-height: 1.2em; color: var(--muted); font-weight: 700; font-size: .9rem; }
.est-sent { font-size: 1.6rem; font-weight: 900; }
.est-result { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.est-result > div { background: var(--surface); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); text-align: center; min-width: 130px; }
.est-result small { display: block; color: var(--muted); font-weight: 700; }
.est-result b { font-size: 1.5rem; }
.est-preview { display: grid; gap: 12px; }
.est-line { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--muted); }
.est-line i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--pink)); }
/* Beamer */
.est-viz { position: relative; flex: 1; width: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 1.2cqh; padding: 1cqh 2cqw 0; }
.est-stats { display: flex; justify-content: center; gap: 3cqw; }
.est-stats > div { text-align: center; padding: .8cqh 1.6cqw; border-radius: 1.4cqh; background: var(--surface); box-shadow: var(--shadow); }
.est-stats small { display: block; color: var(--muted); font-weight: 700; font-size: min(1.7cqw, 3cqh); }
.est-stats > div:nth-child(1) { border-bottom: .5cqh solid var(--brand); }
.est-stats > div:nth-child(2) { border-bottom: .5cqh solid var(--teal); }
.est-stats b { font-size: min(3.1cqw, 5.4cqh); font-variant-numeric: tabular-nums; }
.est-viz.hidden-results .est-stats { visibility: hidden; }
.est-plot { position: relative; border-bottom: .5cqh solid var(--text); margin: 0 1cqw; }
.est-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: .4cqw; }
.est-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.est-col i { display: block; width: 100%; border-radius: .8cqh .8cqh 0 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); transition: height .6s var(--ease-out); }
.est-viz.reveal-mode .est-col i { opacity: .55; }
.est-mark { position: absolute; top: -1cqh; bottom: 0; width: 0; border-left: .35cqw dashed var(--muted); transition: left .6s var(--ease-out); }
.est-mark span { display: none; }
.est-mark.avg { border-left-color: var(--brand); }
.est-mark.med { border-left-color: var(--teal); }
.est-mark.cor { border-left: .6cqw solid var(--green); animation: bounceIn .6s var(--ease) both; }
.est-mark.cor span { display: block; position: absolute; top: 0; left: 0; transform: translate(-50%, 0); white-space: nowrap; font-weight: 900; padding: .3cqh 1cqw; border-radius: 99px; background: var(--green); color: #fff; font-size: min(2.2cqw, 4cqh); box-shadow: var(--shadow); }
.est-ticks { position: relative; height: 4.2cqh; margin: 0 1cqw; }
.est-ticks span { position: absolute; transform: translateX(-50%); font-weight: 800; color: var(--muted); font-size: min(1.9cqw, 3.4cqh); white-space: nowrap; }
.est-unit-lab { text-align: center; color: var(--muted); font-weight: 800; font-size: min(1.7cqw, 3cqh); }

/* ---------- Teamspiel (kooperativ) ---------- */
.w3-team { margin-top: 1cqh; padding: .6cqh 1.6cqw; border-radius: 99px; display: inline-block; font-weight: 800; font-size: min(1.6cqw, 2.9cqh);
  color: #fff; background: #1d5f8f; box-shadow: inset 0 0 0 .3cqh rgba(255,255,255,.35); }
.w3-team.ok { background: #1f8a52; }
.w3-team.bad { background: #9a3a2c; }
.team-board { text-align: center; justify-items: center; }
.team-score { display: grid; justify-items: center; }
.team-num { font-size: min(12cqw, 20cqh); font-weight: 900; line-height: 1; color: var(--accent, #6c4cf5); font-variant-numeric: tabular-nums; animation: bounceIn .6s var(--ease) both; }
.team-lbl { font-weight: 800; font-size: min(2.2cqw, 4cqh); opacity: .75; }
.team-stars { font-size: min(5cqw, 9cqh); letter-spacing: .1em; color: #f2b632; text-shadow: 0 .3cqh 1cqh rgba(0,0,0,.2); }
.team-stars span { color: rgba(128,128,128,.3); }
.team-sub { font-weight: 700; font-size: min(2cqw, 3.6cqh); margin: 0; }

/* ---------------------------------------------------------------- Teams gegeneinander */
.team-pill { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: .85rem;
  color: #fff; background: var(--c); box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 40%, transparent); }
@media (max-width: 380px) { .team-pill .lbl { display: none; } }
.team-tag { margin: 4px 0 6px; padding: 8px 16px; border-radius: 999px; font-weight: 800; color: #fff; background: var(--c); box-shadow: 0 4px 16px color-mix(in srgb, var(--c) 45%, transparent); }
.tb { display: grid; gap: 8px; width: 100%; max-width: 560px; margin: 10px auto; align-content: start; flex: none; }
.tb-row { display: grid; grid-template-columns: 2.2em 2em 1fr minmax(60px, 1.2fr) auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); text-align: left;
  animation: optIn .45s var(--ease) both; animation-delay: calc(var(--i) * 80ms); }
.tb-row.me { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.tb-row.lead .tb-rk::after { content: ' 👑'; }
.tb-rk { font-weight: 900; white-space: nowrap; }
.tb-ic { font-size: 1.5rem; line-height: 1; }
.tb-nm { display: grid; font-weight: 800; }
.tb-nm small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.tb-bar { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--c) 15%, transparent); overflow: hidden; }
.tb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .8s var(--ease); }
.tb-sc { font-size: 1.15rem; font-weight: 900; white-space: nowrap; }
.tb-sc small { margin-left: 3px; font-size: .7rem; color: var(--muted); }
.tb.big { max-width: 900px; gap: 14px; }
.tb.big .tb-row { padding: 14px 20px; font-size: 1.4rem; border-radius: 20px; }
.tb.big .tb-ic { font-size: 2.6rem; }
.tb.big .tb-bar { height: 22px; }
.tb.big .tb-sc { font-size: 2.2rem; }
.teams-board { width: min(92%, 960px); }
.tb-best { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 0; font-weight: 700; color: var(--muted); font-size: 1.1rem; }
.fin-teams { width: 100%; }
.lobby-teams { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.lt-chip { padding: 6px 14px; border-radius: 999px; font-weight: 800; color: #fff; background: var(--c); }
.lt-chip b { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
.person.in-team { box-shadow: inset 0 0 0 2px var(--tc); }
.pteam { margin-right: 2px; }
.w3-teams-ov { position: absolute; top: 2cqh; right: 2cqw; z-index: 3; display: grid; gap: 8px; justify-items: end; font-size: clamp(.9rem, 1.6cqw, 1.4rem); }
.w3-teams-ov[hidden] { display: none; }
.w3-teams-ov .lt-chip { box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.team-chips { display: inline-flex; gap: 10px; font-weight: 900; }

/* Beamer-Ansicht im Hochformat: Größen hängen sonst an der (schmalen) Breite → nach Höhe/Breite ausgleichen,
   Bild über dem Diagramm statt daneben */
@container (orientation: portrait) {
  .p-title { font-size: min(6cqw, 4cqh); }
  .p-title.len-l { font-size: min(5cqw, 3.4cqh); }
  .p-title.len-xl { font-size: min(4cqw, 2.8cqh); }
  .p-body.with-img { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.4cqh; }
  .p-body.with-img:has(.bars.narrow), .p-body.with-img:has(.bars.narrow.hidden-results) { grid-template-columns: minmax(0, 1fr); }
  .hbar, .bars.h.narrow .hbar, .bars.h.short .hbar, .bars.h.long .hbar { font-size: min(3.6cqw, 2.5cqh); }
  .bar { max-width: 30cqw; }
  .bar .lbl, .bars:not(.hidden-results):not(:has(> .bar:nth-child(7))) .bar .lbl,
  .bars:not(.hidden-results):not(:has(> .bar:nth-child(5))) .bar .lbl { font-size: min(3.4cqw, 2.4cqh); }
  .bar .val { font-size: min(5cqw, 3.6cqh); }
  .rank-row, .rank-viz:not(:has(> .rank-row:nth-child(6))) .rank-row { font-size: min(3.8cqw, 2.7cqh); }
  .walls, .walls:not(:has(> .note:nth-child(4))) { columns: 2 40cqw; }
  .note, .walls:not(:has(> .note:nth-child(9))) .note, .walls:not(:has(> .note:nth-child(4))) .note { font-size: min(3.6cqw, 2.5cqh); }
  .est-ticks span { font-size: min(3.2cqw, 2.3cqh); }
  .est-stats small { font-size: min(3.2cqw, 2.3cqh); }
  .est-stats b { font-size: min(5.4cqw, 3.8cqh); }
  .board { max-width: 94cqw; }
  .podium .pod { width: 30cqw; }
  .podium .pod .nm { font-size: min(4.6cqw, 3.2cqh); }
  .podium .pod .sc { font-size: min(3.4cqw, 2.4cqh); }
  .board-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-list .row { font-size: min(3.4cqw, 2.4cqh); }
  .slide .s-h, .slide .s-h.len-l { font-size: min(7cqw, 4.8cqh); }
  .slide .s-txt, .slide .s-txt.len-l { font-size: min(4.4cqw, 3cqh); }
}

/* ===================================================== Start-Countdown (Warteraum → erste Frage) */
.launch-cd { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(18, 14, 34, .35), rgba(18, 14, 34, .72)); animation: lcIn .35s ease-out both; }
.launch-cd.out { animation: lcOut .6s ease-in both; }
.lc-box { display: grid; justify-items: center; gap: 18px; text-align: center; }
.lc-kicker { color: #fff8e6; font-weight: 900; font-size: clamp(1.2rem, 5vw, 2rem); text-shadow: 0 2px 10px rgba(0, 0, 0, .55); letter-spacing: -.01em; }
.lc-ring { position: relative; width: min(56vw, 34vh, 260px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 22, 52, .92) 60%, rgba(30, 22, 52, .6)); box-shadow: 0 0 0 6px rgba(255, 216, 74, .18), 0 18px 50px rgba(0, 0, 0, .45); }
.lc-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lc-track { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 6; }
.lc-arc { fill: none; stroke: #ffd84a; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .1s linear, stroke .3s; filter: drop-shadow(0 0 6px rgba(255, 216, 74, .7)); }
.lc-num { position: relative; font-weight: 900; line-height: 1; font-size: min(26vw, 15vh, 120px); color: #ffd84a; text-shadow: 0 4px 18px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; }
.lc-num span { display: block; animation: lcPop .95s cubic-bezier(.34, 1.56, .64, 1) both; }
.lc-num span.go { font-size: .62em; color: #fff; animation: lcGo .7s cubic-bezier(.34, 1.56, .64, 1) both; }
.launch-cd.hot .lc-arc { stroke: #ff6a3a; }
.launch-cd.hot .lc-num { color: #ff9a5a; }
.launch-cd.hot .lc-ring { animation: lcBeat 1s ease-out infinite; }
.launch-cd.go .lc-ring { background: radial-gradient(circle, #ffb72a 55%, #ff8a1a); box-shadow: 0 0 0 10px rgba(255, 216, 74, .45), 0 0 80px rgba(255, 190, 60, .9); }
.launch-cd.go .lc-arc, .launch-cd.go .lc-track { opacity: 0; }
@keyframes lcIn { from { opacity: 0; } }
@keyframes lcOut { to { opacity: 0; transform: scale(1.15); } }
@keyframes lcPop { 0% { opacity: 0; transform: scale(2.2); } 22% { opacity: 1; transform: scale(1); } 88% { opacity: 1; transform: scale(.96); } 100% { opacity: .75; transform: scale(.88); } }
@keyframes lcGo { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes lcBeat { 0% { transform: scale(1); } 12% { transform: scale(1.07); } 30% { transform: scale(1); } }
/* 3D auf dem Handy: oben im Bild, ohne Abdunkeln – man soll dabei zum Tor laufen können */
.in-world .launch-cd { place-items: start center; padding-top: calc(env(safe-area-inset-top) + 70px); background: none; }
.in-world .lc-box { gap: 8px; }
.in-world .lc-ring { width: min(34vw, 22vh, 150px); }
.in-world .lc-num { font-size: min(15vw, 10vh, 68px); }
.in-world .lc-kicker { font-size: clamp(1rem, 4vw, 1.4rem); }
/* Beamer: innerhalb der Bühne */
.launch-cd.beamer { position: absolute; z-index: 9; background: radial-gradient(circle at 50% 55%, rgba(18, 14, 34, .15), rgba(18, 14, 34, .55)); }
.launch-cd.beamer .lc-kicker { font-size: min(3.4cqw, 6cqh); }
.launch-cd.beamer .lc-ring { width: min(26cqw, 44cqh); }
.launch-cd.beamer .lc-num { font-size: min(13cqw, 22cqh); }
@media (prefers-reduced-motion: reduce) { .launch-cd, .lc-num span, .launch-cd.hot .lc-ring { animation: none !important; } }

/* Warteraum (Beamer): viele Namen → Chips kleiner, QR-Code im Hochformat kleiner – alle bleiben sichtbar */
.lobby-people { max-height: 44cqh; }
.lobby-people:has(> .person:nth-child(21)) .person { font-size: min(1.2cqw, 2.3cqh); }
.lobby-people:has(> .person:nth-child(31)) .person { font-size: min(1.05cqw, 2cqh); padding-top: .5cqh; padding-bottom: .5cqh; }
@container (orientation: portrait) {
  .lobby:has(.person:nth-child(9)) .lobby-qr .qr { width: min(30cqh, 56cqw); }
  .lobby:has(.person:nth-child(9)) { gap: 2.5cqh; }
  .lobby-people { max-height: 38cqh; }
  .lobby-people:has(> .person:nth-child(16)) .person { font-size: min(2.6cqw, 1.6cqh); }
  .lobby-people:has(> .person:nth-child(26)) .person { font-size: min(2.2cqw, 1.35cqh); padding-top: .5cqh; padding-bottom: .5cqh; }
}

/* ===================================================== Figuren-Bilder (2D) */
.ava-pic { display: inline-block; flex: none; aspect-ratio: 1; background: #efe9dd url(/img/avatars.webp) no-repeat;
  background-size: 600% 2000%; background-position: calc(var(--ax) * 20%) calc(var(--ay) * 100% / 19); }
.avatar.ava-pic { color: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
/* Emoji-Figuren (2D-Sitzungen): Emoji auf hellem Grund in der gewählten Farbe; Größe des Emojis folgt der Schrift des Kreises */
.ava-emo { display: inline-grid; place-items: center; flex: none; aspect-ratio: 1; overflow: hidden;
  background: var(--c); background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--c) 22%, #fff) 0 55%, color-mix(in srgb, var(--c) 55%, #fff) 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent); }
.ava-emo > i { font-style: normal; font-weight: 400; line-height: 1; font-size: 1.5em; translate: 0 .03em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; }
/* Auswahl bei der Namenseingabe (und „Figur wechseln“ im 3D-Menü) */
.ava-choose { display: grid; gap: 10px; margin: 4px 0 6px; }
.ava-choose h2 { margin: 0; font-size: 1.05rem; text-align: left; }
.ava-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; min-width: 0; }
@media (min-width: 560px) { .ava-grid { gap: 10px; } }
.ava-opt { position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 16px; background: none; cursor: pointer;
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1); -webkit-tap-highlight-color: transparent; }
.ava-opt .ava-pic { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06); }
.ava-opt { container-type: inline-size; }
.ava-opt .ava-emo { display: grid; width: 100%; border-radius: 16px; font-size: 40cqi; }
.ava-opt:hover { transform: translateY(-2px); }
.ava-opt[aria-pressed="true"] { transform: scale(1.06); }
.ava-opt[aria-pressed="true"] :is(.ava-pic, .ava-emo) { box-shadow: 0 0 0 3px var(--brand), 0 6px 16px rgba(0, 0, 0, .25); }
.ava-opt[aria-pressed="true"]::after { content: '✓'; position: absolute; right: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 900; }
.ava-opt:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.ava-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ava-name { font-weight: 800; color: var(--muted); }
.ava-tints { display: flex; gap: 8px; }
.ava-tints button { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); transition: transform .15s; }
.ava-tints button[aria-pressed="true"] { transform: scale(1.18); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.join-card.with-ava { max-width: 520px; }
/* Querformat (Tablet quer, Laptop): breiter, 2 Reihen à 10 – „Los geht’s“ bleibt ohne Scrollen sichtbar */
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .join-card.with-ava { max-width: 760px; }
  .join-card.with-ava .ava-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
/* Siegertreppchen (2D): Figur über dem Namen */
.pod .avatar.ava-pic { width: min(8cqw, 10cqh); height: auto; border-radius: 22%; margin: 0 auto .4cqh; display: block; }
.pod .avatar.ava-emo { width: min(8cqw, 10cqh); height: auto; border-radius: 50%; margin: 0 auto .4cqh; display: grid; font-size: min(3.6cqw, 4.5cqh); }
/* mit Bild wird es oben eng: Name/Punkte/Bild behalten ihre Höhe, der Block gibt nach */
.podium .pod > :not(.blk) { flex-shrink: 0; }
.podium .pod .blk { min-height: 6cqh; }
.ava-team { font-weight: 700; font-size: .9rem; color: var(--muted); }

/* ===================================================== VERWALTUNG (Admin) & Konto */
.auth-note { background: rgba(22, 193, 114, .12); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.invite-ok { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(108, 76, 241, .1); color: var(--brand-ink); font-weight: 700; font-size: .92rem; }
.admin { max-width: 1100px; }
.adm-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.adm-grid > [hidden] { display: none; }
/* Tabs der Verwaltung */
.adm-tabs { scroll-margin-top: 84px; display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 16px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-weight: 800; white-space: nowrap; cursor: pointer; }
.adm-tabs button:hover { color: var(--text); }
.adm-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.adm-tabs button:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.adm-count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); font-size: .78rem; }
.adm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.adm-dot.ok { background: var(--green); }
.adm-dot.half, .adm-dot.off { background: #f59e0b; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.adm-head h2 { margin: 0 0 2px; }
.adm-head p { margin: 0; }
.adm-hint { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .92rem; }
.adm-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.adm-search { flex: 1 1 240px; min-width: 0; }
.adm-sort { flex: 0 1 220px; width: auto; }
.adm-none { padding: 18px 0; text-align: center; }
.adm-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-me-sp { width: 44px; flex: none; }
.adm-row .pick-ava { width: 40px; height: 40px; font-size: .85rem; }
.inline-link { display: inline; min-height: 0; line-height: inherit; vertical-align: baseline; border: 0; padding: 0; background: none; color: var(--brand-ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (max-width: 560px) {
  /* Handy: vier Tabs nebeneinander, Symbol über dem Text */
  .adm-tabs { gap: 2px; }
  .adm-tabs button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: .8rem; position: relative; }
  .adm-tabs .adm-ic { font-size: 1.15rem; line-height: 1.2; }
  .adm-count, .adm-dot { position: absolute; top: 4px; right: calc(50% - 26px); }
  .adm-count { min-width: 0; padding: 0 5px; font-size: .68rem; }
  .adm-head .btn { width: 100%; }
  .adm-sort { flex: 1 1 100%; }
}
.adm-sec h2 { margin: 0 0 12px; font-size: 1.2rem; }
.adm-sec p { margin: 0 0 10px; }
.adm-invite { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.adm-qr { width: 190px; padding: 8px; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--shadow); cursor: zoom-in; }
.adm-qr svg { width: 100%; height: auto; }
.adm-code b { letter-spacing: .08em; font-size: 1.1rem; }
.adm-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-list { display: grid; }
.adm-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.adm-row .adm-who { flex: 1 1 auto; }
.adm-row:first-child { border-top: 0; }
.adm-who { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.adm-who > b { display: inline; }
.adm-badge { justify-self: start; font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--brand); color: #fff; }
.adm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.adm-two { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0 10px; }
.adm-full { grid-column: 1 / -1; }
.adm-ok { color: var(--green); }
.adm-inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.adm-inline .field { flex: 1 1 260px; margin-bottom: 0; }
@media (max-width: 760px) {
  .adm-form { grid-template-columns: minmax(0, 1fr); }
  .adm-invite { grid-template-columns: minmax(0, 1fr); }
  .adm-qr { justify-self: center; width: min(220px, 70vw); }
}

/* Editor-Vorschau: bei jeder Änderung neu aufgebaut → ohne Einblend-/Wachstums-Animationen */
.pv-still .pv-frame, .pv-still .pv-frame *, .pv-still .pv-frame *::before, .pv-still .pv-frame *::after,
.pv-still .pv-phone, .pv-still .pv-phone *, .pv-still .pv-phone *::before, .pv-still .pv-phone *::after { animation: none !important; transition: none !important; }
.hist-exp { color: var(--muted); white-space: nowrap; }
/* Quiz-Schalter und Wahr/Falsch im Editor */
.toggle-row.quiz-row { border: 2px solid transparent; }
.toggle-row.quiz-row.on { border-color: color-mix(in srgb, var(--yellow, #ffb020) 70%, transparent); background: color-mix(in srgb, var(--yellow, #ffb020) 12%, var(--surface-2)); }
.tf-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-opt { display: grid; justify-items: center; gap: 2px; padding: 14px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.tf-opt:disabled { cursor: default; opacity: 1; }
.tf-opt .tf-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 1.3rem; font-weight: 900; }
.tf-opt b { font-size: 1.05rem; }
.tf-opt small { color: var(--green); font-weight: 800; }
.tf-edit.quiz .tf-opt:not(.on) { opacity: .6; }
.tf-opt.on { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }

/* Anmeldung: Gerät merken, Code, Links */
.auth-card .auth-sub { margin: 0 0 16px; }
.remember { display: flex; gap: 12px; align-items: flex-start; margin: 2px 0 16px; cursor: pointer; }
.remember input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.remember span { display: flex; flex-direction: column; gap: 2px; }
.remember small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.auth-links:has(> :only-child) { justify-content: center; }
.linkish { border: 0; background: none; padding: 8px 2px; min-height: 40px; color: var(--brand-ink); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.field input.code-input { font-size: 1.7rem; letter-spacing: .35em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Mein Konto: gemerkte Geräte */
.dev-hint { font-size: .88rem; margin: 0 0 10px; }
.dev-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dev-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.dev-item.cur { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.dev-ic { font-size: 1.4rem; flex: none; }
.dev-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dev-txt b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dev-txt small { color: var(--muted); font-size: .8rem; }
.dev-badge { font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(108, 76, 241, .14); color: var(--brand-ink); }
.dev-badge.off { background: rgba(120, 120, 140, .16); color: var(--muted); }
.btn.small { min-height: 36px; padding: .35em .9em; font-size: .88rem; flex: none; }
.adm-2fa { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .92rem; }
.adm-2fa.on { background: rgba(22, 193, 114, .12); font-weight: 700; }
/* Schülergerät: gemerkte Umfragen */
.pupil-list { display: grid; gap: 12px; margin: 6px 0 18px; }
.pupil-item { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.pupil-item-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.pupil-item-main { display: grid; gap: 2px; min-width: 0; }
.pupil-item-main b { overflow-wrap: anywhere; }
.pupil-item-main small, .pupil-until { color: var(--muted); overflow-wrap: anywhere; }
.pupil-item-acts { display: flex; gap: 8px; align-items: center; }
.pupil-item-acts .btn.primary { flex: 1; min-width: 0; }
.pupil-item-acts .btn.ghost { flex: none; }
.pupil-live { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: .9rem; }
.pupil-live .btn { margin-left: auto; min-height: 34px; }
.pupil-more { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.pupil-more p { margin: 0; font-size: .9rem; }
.pupil-foot { text-align: center; margin: 16px 0 0; font-size: .9rem; color: var(--muted); }
.pupil-join-wrap { width: 100%; max-width: 420px; }
.pupil-join-wrap:empty { display: none; }
.pupil-join { padding: 16px; display: grid; gap: 8px; text-align: left; }
.pupil-join h2 { margin: 0 0 2px; font-size: 1.05rem; }
.pupil-join-item { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.pupil-join-item:hover { border-color: var(--brand); }
.pupil-join-item b { overflow-wrap: anywhere; }
.pupil-join-item small { grid-column: 1; color: var(--muted); }
.pupil-join-item span { grid-row: 1 / 3; grid-column: 2; color: var(--brand); font-weight: 800; }
/* Gemeinsam bearbeiten: wer ist gerade wo */
.ed-who { display: inline-flex; align-items: center; padding: 3px 8px 3px 4px; min-height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.ed-who[hidden], .who-here[hidden] { display: none; }
.ed-who .who-dot + .who-dot { margin-left: -7px; }
.who-dot { --h: 260; width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .78rem; line-height: 1; color: #fff; background: hsl(var(--h) 62% 44%); border: 2px solid var(--surface); }
.who-more, .who-name { font-size: .8rem; font-weight: 800; margin-left: 6px; color: var(--brand); white-space: nowrap; }
.who-dots { position: absolute; top: 4px; right: 4px; display: flex; z-index: 2; pointer-events: none; }
.who-dots .who-dot { width: 22px; height: 22px; font-size: .68rem; box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
.who-dots .who-dot + .who-dot { margin-left: -6px; }
.who-here { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 16%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, var(--line)); font-weight: 700; font-size: .9rem; }
.who-list { display: grid; gap: 4px; margin-bottom: 14px; }
.who-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.who-row b { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .ed-top .right { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .ed-who { padding: 3px; }
  .who-name { display: none; }
  .ed-top .pupil-chip { padding: 6px 8px; }
}
/* Umfragen als Liste mit Details (Umschalter Kacheln/Liste) */
.show-sm { display: none; }
.view-switch button { min-height: 36px; padding: 6px 12px; }
.dash-tools .view-switch { margin-left: auto; }
.list-wrap { display: block; }
.fold-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; }
.fold-state { font-size: .85rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, #16c172 14%, transparent); color: color-mix(in srgb, #16c172 65%, var(--text)); }
.fold-state.closed { background: color-mix(in srgb, #e5484d 13%, transparent); color: color-mix(in srgb, #e5484d 70%, var(--text)); }
.s-table { --cols: 72px minmax(0, 1fr) 150px 120px 110px 92px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.s-table.st-fold { --cols: 72px minmax(0, 1.7fr) minmax(0, 1fr) 70px 140px 110px 110px 92px; }
.st-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); animation: screenIn .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 25ms); }
.st-row:not(.st-head):hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.st-head { border-top: 0; background: var(--surface-2); padding-top: 4px; padding-bottom: 4px; animation: none; }
.st-c { min-width: 0; }
.st-sort { border: 0; background: none; font: inherit; font-size: .78rem; font-weight: 800; color: var(--muted); padding: 6px 0; cursor: pointer; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
.st-sort:hover, .st-sort.on { color: var(--text); }
.st-arrow { display: inline-block; margin-left: 4px; font-size: .65rem; min-width: .7em; }
.st-head .st-code { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.st-thumb { position: relative; width: 72px; border: 1px solid var(--line); aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; cursor: pointer; background: linear-gradient(135deg, var(--a), var(--b)); }
.st-thumb .thumb { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.st-title { display: grid; gap: 2px; }
.st-title a { font-weight: 800; color: var(--text); text-decoration: none; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-title a:hover { color: var(--brand); }
.st-sub { display: none; color: var(--muted); font-size: .82rem; font-weight: 600; overflow-wrap: anywhere; }
.st-group { font-weight: 700; overflow-wrap: anywhere; }
.st-count { display: grid; gap: 2px; font-size: .9rem; font-weight: 600; }
.st-types { color: var(--muted); letter-spacing: .1em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-date { font-size: .9rem; color: var(--muted); font-weight: 600; }
.st-acts { display: flex; gap: 6px; justify-content: flex-end; }
.st-acts .btn.icon { width: 38px; min-height: 38px; font-size: 1rem; }
@media (max-width: 1000px) {
  .s-table { --cols: 64px minmax(0, 1fr) 140px 100px 92px; }
  .s-table.st-fold { --cols: minmax(0, 1.5fr) minmax(0, 1fr) 60px 110px 96px 86px; }
  .st-fold .st-row > .st-pic { display: none; }
  .st-fold .st-row { gap: 12px; }
  .st-created { display: none; }
  .st-thumb { width: 64px; }
}
@media (max-width: 760px) {
  .show-sm { display: inline; }
  .s-table, .s-table.st-fold { --cols: 56px minmax(0, 1fr) auto; }
  .st-row { gap: 10px; padding: 8px 10px; }
  .st-row:not(.st-head) > .st-group, .st-row:not(.st-head) > .st-code, .st-row:not(.st-head) > .st-count, .st-row:not(.st-head) > .st-date { display: none; }
  .st-sub { display: block; }
  .st-thumb { width: 56px; }
  .s-table:not(.st-fold) .st-thumb > .lv-dots { display: inline-flex; }
  .s-table:not(.st-fold) .st-sub > .lv-dots { display: none; }
  .st-head { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 4px 10px; }
  .st-head > .st-pic, .st-head > .st-acts, .st-head > .st-code { display: none; }
  .st-head > .st-created { display: block; }
  .st-fold .st-row:not(.st-head) > .st-pic { display: block; }
}
/* Play-Dreieck: Schwerpunkt liegt bei 1/3 der Breite → um 1/6 nach rechts schieben, dann wirkt es mittig */
.play-ic { display: inline-block; flex: none; width: .78em; height: .88em; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translateX(.13em); }
.btn:has(> .play-ic + .hide-sm) { gap: .35em; }

/* Sitzung starten: zwei Schritte */
.sd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sd-title { min-width: 0; flex: 1; }
.sd-x { order: 3; width: 40px; min-height: 40px; margin: -6px -8px 0 0; font-size: 1.1rem; color: var(--muted); }
.modal .sd-title h2 { margin: 0; }
.sd-sub { margin: 2px 0 0; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.sd-steps { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.sd-step { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; font-size: .9rem; padding: 6px 14px 6px 6px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.sd-step.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sd-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .8rem; background: color-mix(in srgb, var(--text) 10%, transparent); }
.sd-step.on .sd-num { background: var(--brand); color: #fff; }
.sd-step.done .sd-num { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }
.sd-body h3 { margin: 18px 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sd-body > h3:first-child { margin-top: 0; }
.sd-in { animation: sdIn .28s var(--ease-out) both; }
@keyframes sdIn { from { opacity: 0; transform: translateX(14px); } }
.sd-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sd-tiles.three { grid-template-columns: repeat(3, 1fr); }
.sd-tile { position: relative; display: grid; justify-items: start; align-content: start; gap: 4px; text-align: left; padding: 16px; min-height: 120px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.sd-tile:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.sd-tile:active:not(:disabled) { transform: scale(.98); }
.sd-tile.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.sd-tile.on::after { content: "✓"; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 900; }
.sd-tile.off { opacity: .45; cursor: not-allowed; }
.sd-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.6rem; line-height: 1; margin-bottom: 6px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.sd-tile.on .sd-ic { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.sd-tile b { font-size: 1.05rem; }
.sd-tile small { color: var(--muted); font-weight: 600; font-size: .85rem; line-height: 1.3; }
.sd-tiles.three .sd-tile { min-height: 0; padding: 14px; }
.sd-tiles.three .sd-ic { width: 40px; height: 40px; font-size: 1.35rem; border-radius: 12px; margin-bottom: 4px; }
.sd-hint { margin: 10px 0 0; font-size: .88rem; font-weight: 600; color: var(--muted); }
.sd-sum { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; margin-bottom: 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; }
.sd-sum:hover { border-color: var(--brand); }
.sd-dot { color: var(--muted); }
.sd-edit { color: var(--brand); font-weight: 700; margin-left: 4px; }
.sd-teams { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sd-team-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sd-team-chips .lt-chip { padding: 4px 10px; font-size: .85rem; }
.sd-opts { display: grid; gap: 8px; }
.sd-opts .toggle-row { margin: 0; }
.sd-opt-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sd-opt-t > span:last-child { display: grid; }
.sd-opt-ic { font-size: 1.25rem; width: 28px; text-align: center; flex: none; }
.sd-opt.off { opacity: .5; cursor: not-allowed; }
.sd-opt-na { font-size: .85rem; color: var(--muted); }
.sd-foot { position: sticky; bottom: -24px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 22px -24px -24px; padding: 14px 24px 18px; background: var(--surface); border-top: 1px solid var(--line); z-index: 2; }
.sd-foot-r { display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) {
  .sd-head { margin-bottom: 14px; }
  .sd-steps { width: 100%; order: 4; }
  .sd-step { flex: 1; justify-content: center; }
  .sd-tiles { gap: 8px; }
  .sd-tile { padding: 12px; min-height: 0; border-radius: 16px; }
  .sd-ic { width: 40px; height: 40px; font-size: 1.35rem; border-radius: 12px; }
  .sd-tile b { font-size: .98rem; }
  .sd-tile small { font-size: .8rem; }
  .sd-tiles.three .sd-tile { padding: 10px; }
  .sd-tiles.three .sd-ic { width: 34px; height: 34px; font-size: 1.15rem; }
  .sd-tiles.three small { display: none; }
  .sd-tile.on::after { width: 20px; height: 20px; top: 8px; right: 8px; font-size: .7rem; }
  .modal:has(> .sd) { padding: 18px; }
  .sd-foot { margin: 18px -18px -18px; padding: 12px 18px 14px; bottom: -18px; }
  .sd-foot .btn { padding: .6em 1em; }
}
/* Mit Lehrkräften teilen: Kennzeichnung, Eingang, Auswahl */
:root { --team: #0d9488; }
.team-badge { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand); }
.team-badge.from { background: var(--team); color: #fff; }
.s-card .cover .team-badge { position: absolute; top: 8px; left: 8px; z-index: 2; max-width: calc(100% - 16px); box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.s-card.shared { background: color-mix(in srgb, var(--team) 6%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--team) 55%, transparent), var(--shadow); }
.s-card.shared:hover { box-shadow: 0 0 0 2px var(--team), var(--shadow-lg); }
.st-row.shared { background: color-mix(in srgb, var(--team) 6%, var(--surface)); box-shadow: inset 4px 0 0 var(--team); }
.st-title .team-badge { justify-self: start; font-size: .72rem; padding: 2px 8px; }
.ed-team { flex: none; }
.inbox { margin-bottom: 22px; }
.inbox:empty { display: none; }
.inbox-list { display: grid; gap: 10px; }
.inbox-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--brand); animation: screenIn .35s var(--ease-out) both; }
.inbox-item.collab { border-left-color: var(--team); }
.inbox-main { display: grid; gap: 2px; min-width: 0; }
.inbox-main b { overflow-wrap: anywhere; }
.inbox-main small { color: var(--muted); font-weight: 600; }
.inbox-kind { font-weight: 800; color: var(--brand); }
.inbox-item.collab .inbox-kind { color: var(--team); }
.inbox-acts { display: flex; gap: 6px; }
.share-tabs { flex: none; }
.share-note { margin: 0; font-size: .85rem; color: var(--muted); }
/* Seite „Geteilte Umfrage“ (Link) */
.imp-card { max-width: 560px; }
.imp-lock { font-size: 2.4rem; line-height: 1; margin: 4px 0 8px; }
.imp-meta { margin: -4px 0 12px; color: var(--muted); font-weight: 600; }
.imp-kind { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); text-align: left; }
.imp-kind.collab { background: color-mix(in srgb, var(--team) 13%, var(--surface)); }
.imp-kind-ic { font-size: 1.5rem; line-height: 1.2; }
.imp-kind b { display: block; }
.imp-kind small { display: block; color: var(--muted); font-size: .86rem; margin-top: 2px; }
.imp-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.imp-acts .btn { white-space: normal; }
.imp-small { margin: 0; font-size: .88rem; }
.share-pane h3 { margin: 18px 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.share-pane > h3:first-child { margin-top: 0; }
.share-wait { display: grid; place-items: center; padding: 40px; }
.pick-list { display: grid; gap: 2px; max-height: 236px; overflow: auto; margin-top: 8px; padding: 4px; border-radius: 14px; border: 1px solid var(--line); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.pick-row:hover { background: var(--surface-2); }
.pick-row.on { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.pick-row.off { cursor: default; opacity: .7; }
.pick-row input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
.pick-ava { --h: 260; flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; background: hsl(var(--h) 55% 45%); }
.pick-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pick-st, .acc-st { color: var(--muted); font-weight: 700; white-space: nowrap; }
.pick-none { padding: 10px; margin: 0; }
.share-send { display: flex; justify-content: flex-end; margin-top: 12px; }
.share-access { margin-top: 4px; }
.share-access:empty { display: none; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.acc-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.acc-x { width: 34px; min-height: 34px; font-size: .9rem; color: var(--muted); }
.share-none { padding: 24px; }
@media (max-width: 560px) {
  .inbox-item { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .inbox-item .st-thumb { width: 56px; }
  .inbox-acts { grid-column: 1 / -1; }
  .inbox-acts .btn.primary { flex: 1; }
  .share-tabs { width: 100%; order: 4; }
  .share-tabs button { flex: 1; }
}
