/* ----- Quiz ----- */
.quiz-container {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  height: 100%;
  min-height: 0;
  padding: 12px 16px;
}

.quiz-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.quiz-timer {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.quiz-timer-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.quiz-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.quiz-ring-bg {
  fill: none;
  stroke: var(--bg-soft);
  stroke-width: 14;
}

.quiz-ring-fg {
  fill: none;
  stroke: var(--timer-ok);
  stroke-width: 14;
  stroke-linecap: round;
}

.quiz-timer[data-urgency="warn"] .quiz-ring-fg,
.quiz-timer-wrap[data-urgency="warn"] .quiz-ring-fg {
  stroke: var(--timer-warn);
}

.quiz-timer[data-urgency="critical"] .quiz-ring-fg,
.quiz-timer-wrap[data-urgency="critical"] .quiz-ring-fg {
  stroke: var(--timer-critical);
}

/* Endspurt: Puls in den letzten 5 s, Hintergrundpuls in den letzten 3 s, bei 0 eingefroren. */
.quiz-timer[data-pulse] .quiz-timer-wrap {
  animation: quiz-ring-pulse 1s ease-in-out infinite;
}

.quiz-timer[data-bg-pulse] {
  animation: quiz-bg-pulse 1s ease-in-out infinite;
}

.quiz-timer[data-frozen] .quiz-timer-wrap,
.quiz-timer[data-frozen] {
  animation: none;
}

@keyframes quiz-ring-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes quiz-bg-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--timer-critical) 18%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-timer[data-pulse] .quiz-timer-wrap,
  .quiz-timer[data-bg-pulse] {
    animation: none;
  }
}

.quiz-seconds {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}

.quiz-timer[data-urgency="warn"] .quiz-seconds,
.quiz-timer-wrap[data-urgency="warn"] .quiz-seconds {
  color: var(--timer-warn);
}

.quiz-timer[data-urgency="critical"] .quiz-seconds,
.quiz-timer-wrap[data-urgency="critical"] .quiz-seconds {
  color: var(--timer-critical);
}

/* Lineare Progress-Bar zusätzlich zum Ring — bei wenig Zeit Orange/Rot */
.quiz-timer-bar {
  width: min(280px, 70vw);
  height: 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.quiz-timer-bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--timer-frac, 1));
  background: var(--timer-ok);
  border-radius: inherit;
  will-change: transform;
}

.quiz-timer[data-urgency="warn"] .quiz-timer-bar-fill {
  background: var(--timer-warn);
}

.quiz-timer[data-urgency="critical"] .quiz-timer-bar-fill {
  background: var(--timer-critical);
}

.quiz-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  align-content: start;
}

.quiz-card {
  text-align: left;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  min-height: 44px;
  min-width: 44px;
}

.quiz-card[data-color="0"] { border-left: 6px solid var(--c1); }
.quiz-card[data-color="1"] { border-left: 6px solid var(--c2); }
.quiz-card[data-color="2"] { border-left: 6px solid var(--c3); }
.quiz-card[data-color="3"] { border-left: 6px solid var(--c4); }
.quiz-card[data-color="4"] { border-left: 6px solid var(--c5); }
.quiz-card[data-color="5"] { border-left: 6px solid var(--c6); }

.quiz-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--focus);
  background: var(--bg-soft);
}

.quiz-card.is-selected {
  outline: 3px solid var(--focus);
}

.quiz-card.is-correct {
  outline: 3px solid var(--c3);
  background: color-mix(in srgb, var(--c3) 18%, var(--bg-elev));
}

.quiz-card.is-wrong {
  outline: 3px dashed var(--status-err);
}

/* Auflösung: richtige Karte bekommt Häkchen, übrige treten zurück (Farbe plus Häkchen, nie Farbe allein). */
.quiz-card.is-revealed {
  position: relative;
}

.quiz-card.is-revealed::after {
  content: "\2713";
  position: absolute;
  top: 8px;
  right: 12px;
  font-weight: 800;
  color: var(--ink);
}

.quiz-card.is-dimmed {
  opacity: 0.6;
}

/* Ausscheidungs-Quiz: Ring über der Frage, Auflösung der Antworten, Verteilung darunter */
.qe-timer {
  margin: 12px auto;
}

.qe-results {
  margin-top: 16px;
}

.stage-quiz-opt.is-revealed {
  position: relative;
}

.stage-quiz-opt.is-revealed::after {
  content: "\2713";
  margin-left: 0.5em;
  font-weight: 800;
}

.stage-quiz-opt.is-dimmed {
  opacity: 0.6;
}

/* Ausscheidungs-Quiz: Name und Foto (freiwillig) auf dem Handy, Ausblenden-Liste der Moderation */
.quiz-elimination-profile {
  display: grid;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

/* Pubquiz auf dem Handy: „Weiter als {name}?“ – gemerkte Figur, Mitmachen, Ändern, Vergessen (kompakt, damit „Mitmachen“ ohne Scrollen erreichbar bleibt) */
.pq-remember {
  gap: 10px;
  width: 100%;
  text-align: center;
}
.pq-remember__figure {
  justify-self: center;
}
.pq-remember__figure .pq-figure--phone {
  margin-bottom: 0;
}
.pq-remember__title {
  margin: 0;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.pq-remember__row {
  display: grid;
  gap: 10px;
}
.pq-remember__btn {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
}
.pq-remember__row .pq-remember__btn {
  width: 100%;
}
/* Vergessen: ruhiger Textlink, aber mit voller Tippfläche */
.pq-remember__forget {
  display: block;
  margin: 0 auto;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.pq-remember__forget:hover {
  color: var(--ink);
}
.pq-remember__forget:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.pq-remember__hint,
.pq-remember__forgotten {
  margin: 0;
  text-align: center;
}
.pq-remember__forgotten {
  padding: 10px 0;
}

/* Pubquiz-Abend E6: Rückblick auf dem eigenen Handy im Endstand (n von m richtig, Platz, Auszeichnungen, Urkunde löschen). */
.pq-review {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f1f3f7;
  color: #16161d;
  text-align: left;
}
.pq-review__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
}
.pq-review__sub {
  margin: 4px 0 0;
  font-size: 1rem;
}
.pq-review__lines,
.pq-review__awards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pq-review__line {
  font-size: 1.05rem;
  font-weight: 600;
}
.pq-review__award {
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.pq-review__actions:empty {
  display: none;
}
.pq-review__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pq-review__actions .btn {
  min-height: 44px;
}
/* Urkunde per E-Mail (Aufgabe 8): Formular unter den Knöpfen, volle Breite, alle Ziele mindestens 44 px hoch. */
.pq-review__mail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pq-review__mail[hidden],
.pq-review__mail-form[hidden],
.pq-review__mail-form [hidden],
.pq-review__mail-status[hidden],
.pq-review__mail-open[hidden] {
  display: none;
}
.pq-review__mail-open {
  min-height: 44px;
}
.pq-review__mail-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.pq-review__mail-label {
  font-weight: 600;
}
.pq-review__mail-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
}
.pq-review__mail-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.35;
}
.pq-review__mail-consent input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
}
.pq-review__mail-consent label {
  min-height: 44px;
  overflow-wrap: anywhere;
}
.pq-review__mail-privacy {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  box-sizing: border-box;
}
.pq-review__mail-form .btn {
  min-height: 44px;
  align-self: flex-start;
}
.pq-review__mail-status {
  margin: 0;
}
/* Urkunde (Aufgabe 6): Bild über die ganze Kartenbreite, Knöpfe darunter. */
.pq-review__cert {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pq-review__cert[hidden],
.pq-review__cert-figure[hidden],
.pq-review__cert-status[hidden] {
  display: none;
}
.pq-review__cert-status {
  margin: 0;
}
.pq-review__cert-figure {
  margin: 0;
}
.pq-review__cert-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(22, 22, 29, 0.25);
}
.pq-review__cert-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pq-review__cert-tools .btn {
  min-height: 44px;
}
.pq-review__deleted {
  margin: 0;
}
.pq-review__delete-open {
  display: block;
  margin: 4px 0 0;
  padding: 10px 0;
  min-height: 44px;
  border: 0;
  background: none;
  color: #4a4a57;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
  cursor: pointer;
}
.pq-review__delete-open:hover {
  color: #16161d;
}
.pq-review__delete-open:focus-visible {
  outline: 3px solid var(--focus, #2e5eaa);
  outline-offset: 2px;
}
.pq-review__confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.pq-review__confirm-text {
  margin: 0;
  font-size: 0.95rem;
}
.pq-review__confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-elimination-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.quiz-elimination-photo label:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.quiz-elimination-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.quiz-elimination-waiting {
  text-align: center;
}

/* Comic-Avatare (SVG aus frontend/js/avatar/comicAvatar.js): füllen ihren Rahmen; Foto hat überall Vorrang. */
.person-comic,
.qe-roster-comic,
.quiz-elimination-roster-comic,
.qe-own-comic,
.list-comic {
  display: block;
  line-height: 0;
}

.person-comic svg,
.qe-roster-comic svg,
.quiz-elimination-roster-comic svg,
.qe-own-comic svg,
.list-comic svg {
  display: block;
  width: 100%;
  height: 100%;
}

.person-comic,
.qe-roster-comic {
  width: 100%;
  height: 100%;
}

.quiz-elimination-roster-comic {
  width: 32px;
  height: 32px;
}

/* Handy: großer eigener Avatar im Profilschritt (und kleiner im Wartebild) */
.qe-avatar-big {
  justify-self: center;
  width: 160px;
  height: 160px;
}

.quiz-elimination-profile .qe-avatar-big + .quiz-elimination-photo {
  justify-content: center;
}

.qe-avatar-big--wait {
  width: 120px;
  height: 120px;
}

/* Warteraum mit Figur und Emote-Leiste: Höhe richtet sich nach dem Inhalt */
.qe-avatar-big--fig {
  width: 100%;
  max-width: 320px;
  height: auto;
}

.qe-avatar-big .quiz-elimination-photo-preview,
.qe-avatar-big .qe-own-comic {
  width: 100%;
  height: 100%;
}

/* Ranglisten, Schätzungen, Top-Scorer: kleiner Avatar vor dem Namen */
.pq-name-cell .list-comic,
.pq-nearest li .list-comic,
.pq-topscorers li .list-comic {
  display: inline-block;
  width: 1.8em;
  height: 1.8em;
  margin-right: 0.45em;
  vertical-align: middle;
}

.quiz-podium-step .list-comic {
  width: 96px;
  height: 96px;
  margin: 0 auto 4px;
}

.pq-me-avatar {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.pq-me-avatar > * {
  width: 96px;
  height: 96px;
}

.quiz-elimination-roster-admin {
  margin-top: 16px;
}

.quiz-elimination-roster-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.quiz-elimination-roster-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.quiz-elimination-roster-list li > :first-child {
  flex: none;
}

.quiz-elimination-roster-list .quiz-elimination-roster-name {
  flex: 1 1 6rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quiz-elimination-roster-list img,
.quiz-elimination-roster-ph {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
}

.quiz-elimination-roster-list li.is-hidden .quiz-elimination-roster-name {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Nachzügler (E2 T6): „wartet“ in der Personenliste der Moderation */
.pq-late-tag {
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* „Gerät zuordnen“ (E2 W4): Auswahl und Bestätigung als eigene Zeile unter der Person */
.quiz-elimination-roster-list li.pq-device-panel {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, currentColor);
  border-radius: 0.5rem;
  background: var(--bg-soft);
}

.pq-device-panel__title {
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.pq-device-panel .btn-row {
  margin-top: 0.5rem;
}

.pq-device-list {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz-elimination-roster-list .pq-device-list li {
  display: block;
}

.pq-device-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}

.pq-device-sure {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pq-device-loses {
  margin: 0.25rem 0;
  padding: 0.4rem 0.6rem;
  border-left: 4px solid currentColor;
  font-weight: 600;
}

.pq-device-comic {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  line-height: 0;
}

.pq-device-comic svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Leinwand: Teilnehmerübersicht "Wer spielt mit?" (bis 100 Personen ohne Scrollen) */
.qe-roster {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  gap: 8px;
}

.qe-roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.qe-roster-head .stage-question {
  margin: 0;
}

.qe-roster-count {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 40px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Pubquiz-Vorspann: „Im Spiel: … Fragen aus … Kategorien · … Musiktitel“ als eigene Zeile unter Überschrift und Zähler. */
.qe-roster-head:has(> .pq-facts) {
  flex-wrap: wrap;
  row-gap: 2px;
}

.qe-roster-head > .pq-facts {
  flex-basis: 100%;
  margin: 0;
  font-size: clamp(16px, 1.5vw, 28px);
  font-weight: 600;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.qe-roster-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--qe-cols, 1), var(--qe-cell-w, auto));
  grid-auto-rows: var(--qe-cell-h, auto);
  align-content: start;
  justify-content: center;
  overflow: hidden;
}

.qe-roster-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.qe-roster-photo {
  display: block;
  width: var(--qe-photo, 64px);
  height: var(--qe-photo, 64px);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
}

.qe-roster-photo img,
.qe-roster-symbol {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qe-roster-symbol {
  background: radial-gradient(circle at 50% 38%, var(--ink-muted, #8a93a0) 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, var(--ink-muted, #8a93a0) 0 38%, transparent 39%);
  opacity: 0.55;
}

.qe-roster-name {
  max-width: 100%;
  font-size: var(--qe-font, 16px);
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: var(--qe-lines, 1);
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.qe-roster-grid.is-nameless .qe-roster-name {
  display: none;
}

.qe-roster-more {
  margin: 0;
  text-align: center;
  font-size: clamp(14px, 1.6vw, 28px);
}

/* Bis 40 Personen: Figuren statt Köpfe (frontend/js/quizStage/roster.js, --pq-k aus figureLayout). Bewegungen (Hüpfen, Winken)
 * dürfen über die Kachel hinausragen; das Raster ist so gerechnet, dass die ruhenden Figuren sich nie überlappen. */
.qe-roster-grid.is-figures {
  overflow: visible;
  align-content: center;
  box-sizing: border-box;
  padding-top: calc(3 * var(--pq-k));
}

/* Springt eine Figur der ersten Reihe, bleiben Überschrift und Zähler vorn lesbar. */
.qe-roster-head {
  position: relative;
  z-index: 3;
}

.qe-roster-tile.is-figure {
  justify-content: flex-end;
  gap: 0;
  overflow: visible;
}

.qe-roster-tile.is-figure .pq-figure__pedestal {
  display: none;
}

.qe-roster-tile.is-figure .qe-roster-team {
  font-size: calc(2.4 * var(--pq-k));
}

/* Editor des Ausscheidungs-Quiz: Kopf, Griff, Marken, Ablegen */
.qe-level-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qe-handle {
  cursor: grab;
  user-select: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.qe-handle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.qe-handle[aria-pressed="true"] {
  background: var(--bg-soft);
  border-color: var(--timer-ok);
}

.qe-chip {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.qe-chip--ok { border-color: var(--c3); }
.qe-chip--ok::before { content: "\2713 "; }
.qe-chip--noQuestion::before,
.qe-chip--emptyOption::before,
.qe-chip--noSolution::before { content: "! "; font-weight: 900; }
.qe-chip--noQuestion,
.qe-chip--emptyOption,
.qe-chip--noSolution { border-color: var(--timer-warn); color: var(--timer-warn); }

.qe-level.qe-drop-before { box-shadow: 0 -4px 0 0 var(--timer-ok); }
.qe-level.qe-drop-after { box-shadow: 0 4px 0 0 var(--timer-ok); }

.qe-level-actions .qe-pos select {
  min-height: 32px;
}

.qe-sub-toggle {
  margin-top: 4px;
}

.qe-sublist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 0 8px;
  display: grid;
  gap: 4px;
}

.qe-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
}

/* Editor des Ausscheidungs-Quiz: eine Zeile je Antwort mit Kennzeichen "richtig" */
.qe-opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
}

.qe-opt-row > label:first-child {
  flex: 1 1 220px;
}

/* Punkte-Quiz, Welle 4: Podium */
.quiz-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.quiz-podium-step {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 140px;
  text-align: center;
}

.quiz-podium-name {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.quiz-podium-points {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.quiz-podium-block {
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: var(--timer-ok);
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
}

.quiz-podium-step--1 .quiz-podium-block { height: 36px; }
.quiz-podium-step--2 .quiz-podium-block { height: 64px; }
.quiz-podium-step--3 .quiz-podium-block { height: 92px; }

/* Beteiligung auf der Leinwand: neutraler Lichtlauf zum Zähler */
.qe-answered {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
}

.qe-answered.is-pulse {
  animation: qe-answered-pulse 600ms ease-out;
}

@keyframes qe-answered-pulse {
  0% { text-shadow: 0 0 0 transparent; transform: scale(1); }
  40% { text-shadow: 0 0 14px var(--timer-ok); transform: scale(1.06); }
  100% { text-shadow: 0 0 0 transparent; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .qe-answered.is-pulse { animation: none; }
}

/* „Alle haben geantwortet“: grünes Häkchen neben der Zahl; poppt einmal auf und bleibt dann ruhig */
.qe-all-answered {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-inline: 0.6em 0.5em;
  color: #22a559;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}
.qe-all-answered__icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
.qe-all-answered.is-pop .qe-all-answered__icon {
  animation: qe-all-answered-pop 420ms cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
@keyframes qe-all-answered-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .qe-all-answered.is-pop .qe-all-answered__icon { animation: none; }
}

/* Ausscheidungs-Quiz (Handy): Antworten als große Knöpfe zum Antippen, genau einmal */
.quiz-elimination .quiz-options {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.quiz-elimination .quiz-opt {
  width: 100%;
  min-height: 64px;
  padding: 14px 52px 14px 18px;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  background: var(--bg-elev);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.quiz-elimination .quiz-opt:disabled {
  cursor: default;
  opacity: 0.75;
}

/* Ausscheidungs-Quiz (Handy): Antwort einloggen */
.quiz-elimination .quiz-opt {
  position: relative;
  overflow: hidden;
  transition: transform 120ms ease-out, border-color 150ms ease-out, background-color 150ms ease-out;
}

.quiz-elimination .quiz-opt:active:not(:disabled) {
  transform: scale(0.97);
}

.quiz-elimination .quiz-opt.is-selected {
  border-color: var(--timer-ok);
  background: var(--bg-soft);
}

.quiz-elimination .quiz-opt.is-sending::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--timer-ok) 35%, transparent), transparent);
  animation: qe-answer-streak 900ms ease-in-out infinite;
}

@keyframes qe-answer-streak {
  to { left: 100%; }
}

.quiz-elimination .quiz-opt.is-confirmed {
  outline: 3px solid var(--timer-ok);
  outline-offset: -3px;
}

.quiz-elimination .quiz-opt.is-confirmed::after {
  content: "\2713";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
}

.qe-answer-status {
  margin: 8px 0 0;
  text-align: center;
  font-weight: 700;
}

.qe-answer-status.is-failed {
  color: var(--status-err, #b91c1c);
}

@media (prefers-reduced-motion: reduce) {
  .quiz-elimination .quiz-opt.is-sending::before { animation: none; display: none; }
  .quiz-elimination .quiz-opt { transition: none; }
}

/* Ausscheidungs-Quiz: Status, Auflösung, Aussage der Runde, Übergang */
.qe-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 8px 0;
}

.qe-status > div {
  display: grid;
  justify-items: center;
}

.qe-status dt {
  font-size: 0.85rem;
  color: var(--muted, inherit);
}

.qe-status dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quiz-elimination-closed,
.qe-resolve-banner,
.quiz-elimination-ready {
  text-align: center;
  font-weight: 800;
  margin: 8px 0;
}

.qe-resolve-arc {
  display: block;
  width: min(420px, 80%);
  height: 40px;
  margin: 0 auto;
}

.qe-resolve-arc path {
  fill: none;
  stroke: var(--timer-ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.qe-resolve-arc.is-drawing path {
  animation: qe-arc-draw 600ms ease-in-out forwards;
}

@keyframes qe-arc-draw {
  to { stroke-dashoffset: 0; }
}

.qe-highlight {
  margin: 12px 0 0;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.qe-transition-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .qe-resolve-arc.is-drawing path { animation: none; stroke-dashoffset: 0; }
}

/* Ausscheidungs-Quiz, Welle 4: Siegerfolie */
.qe-finale {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  min-height: 280px;
  margin: 12px 0;
}

.qe-finale-ring {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 400ms ease-out;
}

.qe-finale.is-ring .qe-finale-ring {
  opacity: 1;
}

.qe-finale-ring-bg,
.qe-finale-ring-fg {
  fill: none;
  stroke-width: 10;
}

.qe-finale-ring-bg {
  stroke: var(--bg-soft);
}

.qe-finale-ring-fg {
  stroke: var(--timer-ok);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 900ms ease-in-out;
}

.qe-finale.is-close .qe-finale-ring-fg {
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px var(--timer-ok));
}

.qe-finale-winners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.qe-finale.is-reveal .qe-finale-winners {
  opacity: 1;
  transform: scale(1);
}

.qe-finale-winners .person-card {
  width: 200px;
}

.qe-finale-winners .person-photo {
  width: 150px;
  height: 150px;
  outline: 4px solid var(--timer-ok);
  outline-offset: 4px;
}

.qe-finale-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.qe-finale-ray {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 4px;
  height: 120px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--timer-ok);
  transform-origin: 50% 0;
  transform: rotate(calc(var(--i) * 40deg)) scaleY(0);
  opacity: 0;
}

.qe-finale.is-lines .qe-finale-ray {
  animation: qe-ray 1s ease-out both;
}

@keyframes qe-ray {
  0% { opacity: 0; transform: rotate(calc(var(--i) * 40deg)) translateY(40px) scaleY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: rotate(calc(var(--i) * 40deg)) translateY(140px) scaleY(1); }
}

/* Ehrenrahmen aus Marken und "Gewonnen!" */
.qe-finale-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.qe-finale-mark {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--timer-ok);
  opacity: 0;
  transform: scale(0.2);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
  transition-delay: calc(var(--i) * 18ms);
}

.qe-finale-mark:nth-child(even) {
  background: var(--accent);
}

.qe-finale.is-frame .qe-finale-mark {
  opacity: 1;
  transform: scale(1);
}

.qe-finale-win {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--timer-ok);
  opacity: 0;
  transform: scale(0.6);
}

.qe-finale-win[hidden] {
  display: none;
}

.qe-finale.is-win .qe-finale-win {
  opacity: 1;
  transform: scale(1);
  animation: qe-win-pop 600ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes qe-win-pop {
  0% { opacity: 0; transform: scale(0.4); }
  60% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}

.qe-finale-ray:nth-child(odd) {
  background: var(--accent);
}

.qe-finale.is-still .qe-finale-mark,
.qe-finale.is-still .qe-finale-win {
  transition: none;
  animation: none;
}

.qe-finale.is-still .qe-finale-ring,
.qe-finale.is-still .qe-finale-ring-fg,
.qe-finale.is-still .qe-finale-winners {
  transition: none;
}

.qe-ring-retreat {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border: 8px solid var(--timer-ok);
  border-radius: 50%;
  animation: qe-ring-retreat 1200ms ease-in forwards;
}

@keyframes qe-ring-retreat {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.4); opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .qe-ring-retreat { animation: none; opacity: 0.25; transform: scale(0.4); }
  .qe-finale-ray { display: none; }
}

/* Punkte-Quiz, Welle 3: Kacheln und persönliche Werte */
.quiz-tiles {
  width: 100%;
}

.quiz-personal {
  display: grid;
  gap: 2px;
  font-weight: 700;
  animation: quiz-personal-in 400ms ease-out both;
}

.quiz-personal p {
  margin: 0;
}

@keyframes quiz-personal-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-personal { animation: none; }
}

/* Ausscheidungs-Quiz, Welle 3: Schar "Noch dabei", Personenkarten, Kacheln, Übergang */
.qe-crowd {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 8px 0;
}

.qe-crowd-label {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qe-crowd-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.qe-crowd-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--timer-ok);
}

.qe-crowd-icon.is-out {
  background: var(--ink-muted, #8a93a0);
  opacity: 0.3;
  transform: scale(0.8);
}

.qe-crowd-ring {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.qe-crowd-ring-bg,
.qe-crowd-ring-fg {
  fill: none;
  stroke-width: 12;
}

.qe-crowd-ring-bg {
  stroke: var(--bg-soft);
}

.qe-crowd-ring-fg {
  stroke: var(--timer-ok);
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms ease-out;
}

.qe-people {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  justify-items: center;
}

.qe-people h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  text-align: center;
}

.qe-people-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.person-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 112px;
}

.qe-people-fastest .person-card {
  width: 180px;
}

.person-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
}

.qe-people-fastest .person-photo {
  width: 140px;
  height: 140px;
}

.person-img,
.person-symbol {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-symbol {
  background: radial-gradient(circle at 50% 38%, var(--ink-muted, #8a93a0) 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, var(--ink-muted, #8a93a0) 0 38%, transparent 39%);
  opacity: 0.55;
}

.person-name {
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.person-secs {
  font-variant-numeric: tabular-nums;
}

.qe-people-more {
  margin: 8px 0 0;
  text-align: center;
}

.qe-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.qe-tile {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
}

.qe-tile-value {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}

.qe-tile-label {
  text-align: center;
  font-size: 0.9rem;
}

.is-transition-line::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: var(--timer-ok);
  animation: qe-line-draw 600ms ease-in-out both;
}

@keyframes qe-line-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .qe-crowd-ring-fg { transition: none; }
  .is-transition-line::after { animation: none; }
}

/* Ergebnisbalken */
.quiz-bars {
  display: grid;
  gap: 10px;
  width: 100%;
}

.quiz-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(120px, 3fr) auto;
  align-items: center;
  gap: 12px;
}

.quiz-bar-track {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.quiz-bar-fill {
  display: block;
  height: 100%;
  background: var(--c1);
  border-radius: inherit;
  transform-origin: left center;
}

.quiz-bar-row.is-correct .quiz-bar-fill {
  background: var(--c3);
}

.quiz-bar-row.is-duel .quiz-bar-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.quiz-bar-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quiz-result {
  font-weight: 750;
  color: var(--ink);
}

.quiz-verdict {
  font-size: 1.4rem;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-board {
  width: 100%;
  display: block;
}

