/* =====================================================================
   Teilnahme (Handy) – Gestaltung aus dem Prototyp
   ===================================================================== */
:root {
  --bg: #f5f2f1; --surface: #fffdfc; --sunken: #ece6e4; --ink: #1e1a1a; --muted: #6b6161; --line: #ddd4d2;
  --accent: var(--vereinsfarbe, #c8102e); --accent-ink: #fff; --accent-soft: #f8e0e3;
  --ok: #1b7446; --ok-soft: #dbeee3; --warn: #8f5600; --warn-soft: #f6e7cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151213; --surface: #1f1b1c; --sunken: #2a2425; --ink: #f2ecea; --muted: #a79d9c; --line: #3a3335;
    --accent: color-mix(in srgb, var(--vereinsfarbe, #c8102e) 72%, #ffffff);
    --accent-soft: color-mix(in srgb, var(--vereinsfarbe, #c8102e) 28%, #1f1b1c);
    --ok: #62d396; --ok-soft: #173826; --warn: #f0b450; --warn-soft: #3d2c10;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ph { max-width: 460px; min-height: 100dvh; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.ph-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ph-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-code { font-family: var(--f-mono); font-size: 12px; background: var(--sunken); padding: 2px 9px; border-radius: 999px; flex: none; }
.ph-brand { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1, h2 { font-family: var(--f-display); font-weight: 700; line-height: 1.05; margin: 0; text-transform: uppercase; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 28px; }
p { margin: 0; color: var(--muted); }
.ph-nr { font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.form { display: grid; gap: 10px; }
.form label { font-size: 14px; font-weight: 700; }
.code-input { font-family: var(--f-mono); font-size: 24px; letter-spacing: 0.08em; text-transform: uppercase; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; width: 100%; }
.code-input:focus { border-color: var(--accent); outline: none; }
.fehler { color: var(--accent); font-weight: 700; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 13px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 17px; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.link { border: 0; background: none; padding: 8px 4px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: center; }

.choices { display: grid; gap: 10px; }
.choice { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 16px; font-size: 19px; font-weight: 700; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; }
.choice i { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice .haken { margin-left: auto; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 16px; flex: none; }
.choice[aria-pressed="true"] .haken { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.zaehler { font-size: 14px; font-weight: 700; color: var(--muted); }
.auswahl-box { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 14px; padding: 16px; font-size: 21px; font-weight: 700; text-align: center; display: grid; gap: 4px; }

.center { flex: 1; display: grid; place-content: center; text-align: center; gap: 12px; justify-items: center; }
.icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.icon-ok { background: var(--ok-soft); color: var(--ok); }
.icon-wait { background: var(--sunken); color: var(--muted); }
.dots { display: inline-flex; gap: 6px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); animation: puls 1.2s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
.big-code { font-family: var(--f-mono); font-size: 22px; letter-spacing: 0.08em; background: var(--sunken); border-radius: 10px; padding: 8px 14px; color: var(--ink); }
.verbindung { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.15); }
.footer { margin-top: auto; display: flex; justify-content: center; }

/* ---------- Bewertung / Skala ---------- */
.skala { display: grid; grid-template-columns: repeat(var(--spalten), 1fr); gap: 8px; }
.skala-knopf { aspect-ratio: 1; min-height: 52px; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; color: inherit; }
.skala-knopf:active { border-color: var(--accent); background: var(--accent-soft); }
.skala-enden { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.skala-enden span:last-child { text-align: right; }
.choice-leise { font-size: 16px; padding: 12px 16px; font-weight: 600; }

/* ---------- Schätzfrage ---------- */
.zahl-zeile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.zahl-input { flex: 1 1 auto; width: 0; min-width: 0; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-align: right; }
.zahl-input:focus { border-color: var(--accent); outline: none; }
.zahl-einheit { font-size: 22px; font-weight: 700; color: var(--muted); }

/* ---------- Online-Abstimmung: Übersicht der Fragen ---------- */
h3 { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.1; margin: 0; text-transform: uppercase; text-wrap: balance; }
.fragen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.frage-zeile { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 13px 14px; font-size: 17px; font-weight: 700; }
button.frage-zeile { cursor: pointer; }
.frage-nr { width: 30px; height: 30px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.frage-titel { overflow-wrap: anywhere; }
.frage-stand { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.frage-zeile.ist-erledigt { background: var(--sunken); border-color: transparent; color: var(--muted); }
.frage-zeile.ist-erledigt .frage-stand { color: var(--ok); }
.frage-zeile.ist-erledigt .frage-nr { background: var(--ok-soft); color: var(--ok); }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.klein { font-size: 13px; }
p b { color: var(--ink); }
.ok-box b { color: inherit; }

/* ---------- Online-Abstimmung: Ergebnisse ---------- */
.erg { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 16px; display: grid; gap: 8px; }
.erg-urteil { font-size: 19px; font-weight: 700; color: var(--ink); }
.erg-ok { color: var(--ok); }
.erg-no { color: var(--accent); }
.erg-warn { color: var(--warn); }
.erg-detail { font-size: 13px; }
.erg-balken { display: grid; gap: 8px; margin-top: 4px; }
.erg-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 15px; font-weight: 600; }
.erg-name { overflow-wrap: anywhere; }
.erg-zahl { font-variant-numeric: tabular-nums; font-weight: 700; }
.erg-spur { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.erg-spur div { height: 100%; border-radius: 4px; background: var(--accent); }
.erg-zeile.ist-richtig .erg-spur div { background: var(--ok); }
.erg-zeile.ist-richtig .erg-name::after { content: " ✓"; color: var(--ok); }

/* ---------- Countdown ---------- */
.countdown { font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown-gross { font-size: 20px; font-weight: 700; color: var(--accent); }
