/* jukon - eine Datei, keine Verlaeufe, keine Abhaengigkeiten.
   Farben kommen aus Variablen; .theme-dark ist die Beamer-Ansicht. */

:root {
  --accent: #2f6df6;
  --accent-fg: #ffffff;
  --bg: #ffffff;
  --fg: #14181d;
  --muted: #5d6975;
  --line: #e3e7ec;
  --card: #f5f7f9;
  --danger: #c0392b;
  --ok: #1e8a4c;
  --radius: 12px;
}

.theme-dark {
  --bg: #0b0d11;
  --fg: #f3f5f8;
  --muted: #97a1b0;
  --line: #222833;
  --card: #141922;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

/* ---- Layout ---- */
.wrap { max-width: 40rem; margin: 0 auto; padding: 1.25rem 1.1rem 3rem; }
.wrap-wide { max-width: 56rem; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.grow { flex: 1 1 auto; }
.center { text-align: center; }

/* ---- Typografie ---- */
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; }
label { display: block; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
p { margin: 0; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.big-number { font-variant-numeric: tabular-nums; font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 650; color: var(--muted); }

/* ---- Karten ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem;
  min-height: 2.75rem; padding: .6rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 2.25rem; padding: .35rem .75rem; font-size: .875rem; }

/* ---- Antwort-Buttons (Handy) ---- */
.choice {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; min-height: 3.5rem; padding: .9rem 1rem;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  font: inherit; font-size: 1.05rem; font-weight: 600; text-align: left;
  cursor: pointer;
}
.choice:active { transform: scale(.99); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.choice .mark {
  flex: 0 0 auto; width: 1.4rem; height: 1.4rem;
  border: 2px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem; color: var(--accent-fg);
}
.choice[data-multi="1"] .mark { border-radius: 6px; }
.choice[aria-pressed="true"] .mark { background: var(--accent); border-color: var(--accent); }

/* ---- Ergebnisbalken ---- */
.result { margin-bottom: 1.1rem; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .35rem; }
.result-label { font-weight: 600; }
.result-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-value .pct { font-weight: 700; }
.bar-track { height: .85rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; width: 0;
  background: var(--accent); border-radius: 999px;
  transition: width .7s cubic-bezier(.2,.8,.25,1);
}

/* ---- Statusleiste ---- */
.statusbar {
  position: sticky; top: 0; z-index: 10;
  padding: .5rem 1rem; text-align: center;
  background: var(--danger); color: #fff; font-size: .85rem; font-weight: 600;
}
.flash { padding: .75rem 1rem; border-radius: var(--radius); font-weight: 600; }
.flash-ok { background: color-mix(in srgb, var(--ok) 14%, var(--bg)); color: var(--ok); }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, var(--bg)); color: var(--danger); }

/* ---- Beamer ---- */
.present {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 5vw, 5rem);
  gap: clamp(1rem, 3vh, 2.5rem);
}
.present-main { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: clamp(1rem, 3vh, 2rem); }
.present h1 { font-size: clamp(1.8rem, 4.4vw, 3.4rem); line-height: 1.15; }
.present .result-label { font-size: clamp(1.1rem, 2.2vw, 1.9rem); }
.present .result-value { font-size: clamp(1.1rem, 2.2vw, 1.9rem); }
.present .bar-track { height: clamp(1.1rem, 2.4vh, 2rem); }
.present .result { margin-bottom: clamp(1rem, 2.6vh, 2rem); }
.present-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; color: var(--muted); font-size: clamp(.8rem, 1.3vw, 1.1rem); }
.counter { font-size: clamp(2.5rem, 9vw, 7rem); font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.qr { background: #fff; padding: 1rem; border-radius: var(--radius); width: clamp(11rem, 26vh, 20rem); }

/* Warteschirm: Ueberschrift, QR, Zaehler - sonst nichts. */
.lobby { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(1.5rem, 4vh, 3rem); text-align: center; }
.lobby-title { font-size: clamp(1.6rem, 5vw, 4rem); letter-spacing: .01em; text-transform: uppercase; }
.qr-lobby { width: clamp(13rem, 42vh, 26rem); padding: clamp(.75rem, 2vh, 1.5rem); }
.lobby-count { font-size: clamp(1rem, 2.2vw, 1.9rem); font-variant-numeric: tabular-nums; }
.qr svg { display: block; width: 100%; height: auto; }
.join-url { font-size: clamp(1.2rem, 3vw, 2.4rem); font-weight: 700; word-break: break-all; }
/* Fragenkopf: nur das Icon steht mittig, Text bleibt linksbuendig. */
.q-head { display: flex; flex-direction: column; gap: .5rem; }
.q-head .eyebrow { margin-top: .25rem; }
.q-icon { color: var(--accent); line-height: 0; align-self: center; }
.q-icon svg { width: clamp(3.5rem, 12vh, 9rem); height: auto; display: block; }
.q-icon-small svg { width: clamp(2.25rem, 5vh, 3.5rem); }
.q-icon-join svg { width: clamp(2.75rem, 13vw, 4.5rem); }
.q-head-small { gap: .35rem; margin-bottom: .9rem; }

.summary-grid { display: grid; gap: clamp(1rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.summary-grid h2 { font-size: clamp(1rem, 1.6vw, 1.4rem); margin-bottom: .75rem; }
.summary-grid .result-label, .summary-grid .result-value { font-size: clamp(.85rem, 1.1vw, 1.05rem); }
.summary-grid .bar-track { height: .8rem; }

/* ---- Moderator ---- */
/* Eine Zeile je Schirm, von oben nach unten der Ablauf des Abends. */
.screen-row {
  display: flex; align-items: center; gap: .9rem;
  padding: .75rem .9rem .75rem .6rem;
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); background: var(--bg);
}
.screen-row.is-active { border-color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.screen-num {
  flex: 0 0 auto; width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--card); color: var(--muted);
  font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.screen-row.is-active .screen-num { background: var(--accent); color: var(--accent-fg); }
.screen-title { font-weight: 650; line-height: 1.3; }
.screen-actions { flex: 0 0 auto; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.screen-actions .btn { white-space: nowrap; }
.live-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .1rem .45rem; border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 16%, var(--bg)); color: var(--ok);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
@media (max-width: 40rem) {
  .screen-row { flex-wrap: wrap; }
  .screen-actions { width: 100%; justify-content: stretch; }
  .screen-actions form, .screen-actions .btn { flex: 1 1 auto; }
}
.danger-zone { border: 1px dashed var(--danger); border-radius: var(--radius); padding: 1rem; }
input[type="text"], input[type="password"] {
  width: 100%; min-height: 2.75rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--fg); font: inherit;
}
@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}
