/* ----- Presenter ----- */
.view-present {
  /* Kopf | Bühne (dominant) | Steuerung */
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.view-present .present-head {
  min-height: 0;
}

.view-present .present-stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.present-stage-head {
  flex: 0 0 auto;
  padding: 12px 16px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg-elev, #fff) 96%, transparent);
  /* Über #results-teaser (z-index: 2) — Frage bleibt beim Folienwechsel sichtbar */
  position: relative;
  z-index: 3;
}

.present-stage-live-meta {
  margin: 0 0 8px;
  font-size: clamp(0.75rem, 1.6vw, 0.88rem);
  font-weight: 650;
  line-height: 1.35;
  color: color-mix(in srgb, var(--ink, #111) 68%, transparent);
}

.present-stage-question {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.3;
  font-weight: 700;
}

.present-stage-subtitle,
.present-stage-prompt {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

/* Multiple Choice: Antwortoptionen in der Presenter-Infobox */
.present-stage-choice-options {
  margin-top: 10px;
}

.present-stage-choice-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.present-stage-choice-option {
  margin: 0;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-soft, #f5f5f5) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line, #ddd) 80%, transparent);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink, #111);
}

.present-stage-choice-option[data-color="0"] { border-left: 5px solid var(--c1, #b42318); }
.present-stage-choice-option[data-color="1"] { border-left: 5px solid var(--c2, #175cd3); }
.present-stage-choice-option[data-color="2"] { border-left: 5px solid var(--c3, #027a48); }
.present-stage-choice-option[data-color="3"] { border-left: 5px solid var(--c4, #93370d); }
.present-stage-choice-option[data-color="4"] { border-left: 5px solid var(--c5, #6941c6); }
.present-stage-choice-option[data-color="5"] { border-left: 5px solid var(--c6, #155eef); }

.view-present .present-stage > .stage-panel,
.view-present .present-stage > .wordcloud-stage,
.view-present .present-stage > .present-slide-canvas {
  flex: 1 1 auto;
  min-height: 0;
}

.view-present #present-question {
  /* Frage nur in der Vorschau — Header bleibt kompakt */
}

/* ----- Presenter Overview-First ----- */
.present-top--overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 0;
}

.present-top-brand {
  flex: 1 1 12rem;
  min-width: 0;
}

.present-top-back {
  flex-shrink: 0;
  white-space: nowrap;
}

.present-top-sep {
  opacity: 0.45;
  margin: 0 2px;
}

.present-event-title {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(28vw, 20rem);
  display: inline-block;
  vertical-align: bottom;
}

.present-top-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

.present-live-badge {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.present-live-badge[data-state="live"] {
  color: var(--status-ok, #0a7);
}

.present-live-badge[data-state="pause"],
.present-live-badge[data-state="countdown"] {
  color: var(--status-warn, #c80);
}

.present-live-badge[data-state="ended"] {
  color: var(--danger, #c33);
}

.present-header-stat,
.present-header-join {
  font-size: 0.82rem;
  min-height: 34px;
  padding: 4px 10px;
}

.present-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.present-live-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
  color: color-mix(in srgb, var(--ink, #111) 88%, transparent);
}

/* Kontext steht in #present-stage-head — alte Zeile unter der Box ausblenden */
.present-live-status:not(.sr-only) {
  display: none;
}

.present-control-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink, #111) 55%, transparent);
}

.present-slide-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.present-slide-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  max-width: 11rem;
  padding: 4px 10px;
  border-radius: var(--radius-pulse-sm, 0.75rem);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.8rem;
  cursor: pointer;
  scroll-snap-align: start;
}

.present-slide-chip.is-active {
  border-color: color-mix(in srgb, var(--accent, #0066cc) 55%, var(--line));
  background: color-mix(in srgb, var(--accent, #0066cc) 10%, var(--bg-elev));
  font-weight: 650;
}

.present-slide-chip-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.75;
}

.present-slide-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.present-slide-chip-add {
  justify-content: center;
  min-width: 36px;
  font-size: 1.1rem;
  font-weight: 700;
}

.present-special-bar {
  min-height: 0;
}

.present-special-bar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.present-special-bar-btn {
  min-height: 38px;
  font-size: 0.82rem;
}

.present-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.view-present .present-nav-overflow {
  position: relative;
}

.present-toolbar-stage {
  font-size: 0.82rem;
  min-height: 36px;
}

.present-toolbar-more {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pulse-sm, 0.75rem);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-weight: 750;
  font-size: 1.1rem;
}

.present-panel-dialog {
  max-width: min(92vw, 28rem);
  border: none;
  border-radius: 16px;
  padding: 0;
}

.present-panel-dialog::backdrop {
  background: color-mix(in srgb, #000 45%, transparent);
}

.present-panel-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.present-panel-dialog-head h2 {
  margin: 0;
  font-size: 1rem;
}

.present-panel-close {
  min-width: 36px;
  min-height: 36px;
  font-size: 1.25rem;
  line-height: 1;
}

.present-panel-dialog .presenter-stats {
  border: none;
  border-radius: 0;
  margin: 0;
}

.present-join-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 18px;
}

.present-join-url {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  word-break: break-all;
}

.present-join-fallback {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

.present-join-code-line {
  margin: 0;
  font-size: 1.05rem;
}

.present-join-qr {
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1;
}

/* Status-Badge oben rechts in der Hauptbox (aktive Sonderfolie) */
.present-stage-status {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 6;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink, #111);
  background: color-mix(in srgb, var(--bg-elev, #fff) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink, #111) 12%, transparent);
  box-shadow: 0 1px 4px color-mix(in srgb, #000 8%, transparent);
  pointer-events: none;
}

.present-stage-status[hidden] {
  display: none !important;
}

.present-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 52px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.92rem;
}

.present-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.lobby-overlay[hidden] {
  display: none !important;
}

.lobby-qr {
  width: min(42vh, 240px);
  height: auto;
  aspect-ratio: 1 / 1;
}

/* Deckt nur die Folienfläche — Kopf (#present-stage-head) bleibt darüber sichtbar */
.results-teaser {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.results-teaser[hidden] {
  display: none !important;
}

.reaction-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.reaction-float {
  position: absolute;
  bottom: 6%;
  font-size: 2.4rem;
  animation: reaction-rise 1.6s ease-out forwards;
}

.reaction-float--subtle {
  font-size: 1.85rem;
  opacity: 0.88;
  animation-duration: 2s;
}

.reaction-float--reduced {
  animation: reaction-rise-reduced 0.9s ease-out forwards;
}

@keyframes reaction-rise {
  to {
    transform: translateY(-72vh) scale(1.35);
    opacity: 0;
  }
}

@keyframes reaction-rise-reduced {
  to {
    transform: translateY(-24vh);
    opacity: 0;
  }
}

.reaction-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
  padding-top: 8px;
}

.join-lobby {
  text-align: center;
  font-size: 1.1rem;
}

.stage-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.stage-panel[hidden] {
  display: none !important;
}

.wordcloud-stage {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 22%);
  min-height: 0;
  height: 100%;
}

.wordcloud-stage .wordcloud-surface {
  min-height: 0;
  height: 100%;
}

#wordcloud-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.deck-chip-add {
  font-size: 1.2rem;
}

/* Sonderfolien-Chips in der Presenter-Folienleiste (Countdown / Pause / Ende) */
.deck-chip-special {
  min-width: auto;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-style: dashed;
}

.deck-chip-special-icon {
  font-size: 1rem;
  line-height: 1;
}

.deck-chip-special-label {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-chip-special.is-active {
  border-style: solid;
  border-color: var(--btn-primary-bg, var(--accent, #2563eb));
  background: color-mix(in srgb, var(--btn-primary-bg, var(--accent, #2563eb)) 12%, var(--bg-soft));
}

.deck-chip-special--end.is-active.is-confirmed {
  font-weight: 700;
}

@media (max-width: 640px) {
  .deck-chip-special-label {
    display: none;
  }

  .deck-chip-special {
    min-width: 44px;
    padding: 0;
  }
}

.join-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slide-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ----- Teilnehmer ----- */
.view-join {
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.join-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.join-top strong {
  font-family: var(--mono);
  letter-spacing: 0.2em;
}

.join-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow: auto;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.rating-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

@media (max-width: 860px) {
  .wordcloud-stage,
  .present-top,
  .qa-top3,
  .quiz-head,
  .quiz-cards {
    grid-template-columns: 1fr;
  }

  .present-top {
    justify-items: start;
  }

  .slide-question {
    text-align: left;
  }

  .word-rank {
    display: none;
  }

  .poll-row {
    grid-template-columns: 1fr auto;
  }

  .poll-label {
    grid-column: 1 / -1;
  }

  .qa-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

}

