/* Runde im Browser als Controller für den Fernseher. Dunkel wie die Spielfläche der App;
   die Farbe der Person (--tint) färbt den oberen Rand. */
:root {
  color-scheme: dark;
  --bg: #0B0612;
  --surface: #1A1224;
  --surface-2: #261B33;
  --text: #F5F5F7;
  --text-2: #B9AFC8;           /* 8.9:1 auf --bg */
  --line: rgba(255, 255, 255, 0.14);
  --accent: #C2255C;           /* Weiß darauf 5.66:1 */
  --danger: #FF6B6B;
  --tint: #C2255C;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 55%, transparent) 0%, transparent 45%), var(--bg);
  background-attachment: fixed;
  transition: background-color .4s ease;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#root {
  min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ---------- Beitreten ---------- */
.join { display: grid; gap: 22px; padding-top: 4vh; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.15rem var(--round); color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -6px 0 -14px -6px; padding: 0 8px 0 2px; color: var(--text-2); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--text); }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.join h1 { margin: 0; font: 800 2rem/1.1 var(--round); }
.join .lede { margin: -10px 0 0; color: var(--text-2); }
.field { display: grid; gap: 8px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--text-2); }
.field input {
  width: 100%; min-height: 54px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--surface); outline: none;
}
.field input:focus { border-color: #fff; }
.field input.code {
  min-height: 84px; text-align: center; text-transform: uppercase; letter-spacing: .35em; padding-left: .35em;
  font: 800 2.6rem var(--round); font-variant-numeric: tabular-nums;
}
.field input.code::placeholder { color: rgba(255, 255, 255, .22); }
.field .hint { margin: 0; font-size: .85rem; color: var(--text-2); }
.error { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 107, 107, .14); color: #FFC9C9; }
.primary {
  width: 100%; min-height: 56px; border: 0; border-radius: 999px; background: #fff; color: #1D1D1F; font-weight: 700; font-size: 1.05rem;
}
.primary:disabled { opacity: .35; cursor: default; }
.foot-note { margin: 0; font-size: .85rem; color: var(--text-2); text-align: center; }
.foot-note a { color: var(--text); }

/* ---------- Controller ---------- */
.top { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; min-height: 52px; }
.round-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.round-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.top .title { text-align: center; line-height: 1.2; }
.top .title strong { display: block; font-size: 1rem; }
.top .title span { font: .78rem ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(255, 255, 255, .7); }
.pill { padding: 0 12px; height: 32px; display: inline-flex; align-items: center; border-radius: 999px; background: rgba(255, 255, 255, .15); font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top .spacer { width: 44px; }

.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; text-align: center; padding: 16px 0; }
.stage h2 { margin: 0; font: 800 2.2rem/1.1 var(--round); }
.stage p { margin: 0; }
.muted { color: rgba(255, 255, 255, .8); }
.small { font-size: .85rem; color: rgba(255, 255, 255, .7); }
.big-av { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: #000; font: 800 3.4rem var(--round); }
.symbol { font-size: 3.6rem; line-height: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: .92rem; }
.chip i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.chip.off { opacity: .5; }
.roster { display: grid; gap: 10px; text-align: left; width: 100%; }

.q-head { display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .85); font-weight: 600; font-size: .95rem; padding-top: 4px; }
.vote { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 0 6px; }
.opt {
  flex: 1; min-height: 140px; border: 0; border-radius: 28px; padding: 20px; color: #fff; display: grid; place-content: center; gap: 8px;
  font: 800 clamp(1.5rem, 7vw, 2.1rem)/1.15 var(--round); text-wrap: balance; box-shadow: inset 0 0 0 0 #fff;
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease;
}
.opt:active { transform: scale(.97); }
.opt.a { background: linear-gradient(135deg, #C2255C, #7A1640); }
.opt.b { background: linear-gradient(135deg, #1D4ED8, #0F2A78); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 4px #fff; }
.vote.voted .opt[aria-pressed="false"] { opacity: .45; }
.opt .check { font-size: 1.6rem; }
.or { text-align: center; font-weight: 700; color: rgba(255, 255, 255, .7); }

.tally { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 8px; }
.tally div { padding: 12px; border-radius: 18px; display: grid; gap: 4px; }
.tally div:first-child { background: linear-gradient(135deg, rgba(194, 37, 92, .85), rgba(122, 22, 64, .85)); }
.tally div:last-child { background: linear-gradient(135deg, rgba(29, 78, 216, .85), rgba(15, 42, 120, .85)); }
.tally b { font: 800 1.8rem var(--round); }
.tally span { font-size: .85rem; }

.ghost-btn { min-height: 50px; padding: 0 28px; border: 0; border-radius: 999px; background: #fff; color: #000; font-weight: 700; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hinweise und Dialog ---------- */
.banner {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 5;
  padding: 10px 18px; border-radius: 999px; background: #fff; color: #000; font-weight: 600; font-size: .92rem; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 10; }
.dialog {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 11;
  width: min(100% - 32px, 420px); display: grid; gap: 10px;
}
.dialog .box { background: var(--surface-2); border-radius: 18px; padding: 18px; text-align: center; display: grid; gap: 6px; }
.dialog .box p { margin: 0; color: var(--text-2); font-size: .92rem; }
.dialog .box strong { font-size: 1.05rem; }
.dialog button { min-height: 54px; border: 0; border-radius: 16px; font-weight: 700; }
.dialog .danger { background: var(--surface-2); color: var(--danger); }
.dialog .cancel { background: #fff; color: #000; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
