/* Farben und Masse aus constants/Colors.ts und constants/theme.ts der App,
   damit sich die Webversion wie dieselbe App anfuehlt. */
:root {
  --primary: #FF6A00;
  --primary-dark: #FF4500;
  --gradient-start: #FF6A00;
  --gradient-end: #FFB347;
  --text: #FFFFFF;
  --text-on-light: #333333;
  --text-on-light-muted: #666666;
  --secondary: #007AFF;
  --success: #4CAF50;
  --success-deep: #2E7D32;
  --danger: #E5484D;
  --danger-deep: #D32F2F;
  --info: #2196F3;
  --surface: rgba(255, 255, 255, 0.14);
  --surface-strong: rgba(255, 255, 255, 0.22);
  --surface-border: rgba(255, 255, 255, 0.28);
  --card: #FFFFFF;

  --xs: 4px; --sm: 8px; --md: 12px; --lg: 16px; --xl: 20px; --xxl: 24px; --xxxl: 32px;
  --r-sm: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--primary);
  -webkit-tap-highlight-color: transparent;
}
/* Verlauf als fixierte Ebene: iOS Safari kann kein background-attachment: fixed */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
}
button, input { font: inherit; }
[hidden] { display: none !important; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--xxl) + env(safe-area-inset-top)) var(--lg) calc(var(--xxl) + 48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--xl);
}

/* ---------- Typo ---------- */
h1 { font-size: 32px; margin: 0; letter-spacing: -0.5px; }
h2 { font-size: 24px; margin: 0; }
h3 { font-size: 17px; margin: 0 0 var(--sm); }
.muted { opacity: 0.85; font-size: 14px; }
.center { text-align: center; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; opacity: 0.85; font-weight: 600; }

/* ---------- Flaechen ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: var(--lg);
}
.card.light { background: var(--card); color: var(--text-on-light); border: none; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.stack { display: flex; flex-direction: column; gap: var(--md); }
.row { display: flex; align-items: center; gap: var(--md); }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: none; cursor: pointer;
  width: 100%;
  padding: 16px var(--xl);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.secondary { background: var(--surface-strong); color: var(--text); box-shadow: none; border: 1px solid var(--surface-border); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { width: auto; padding: 10px var(--lg); font-size: 14px; }
.link {
  appearance: none; background: none; border: none; color: var(--text);
  text-decoration: underline; opacity: .85; cursor: pointer; padding: var(--sm);
  font-size: 14px;
}

/* ---------- Eingaben ---------- */
.input {
  width: 100%;
  padding: 14px var(--lg);
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border);
  background: #fff; color: var(--text-on-light);
  font-size: 17px;
}
.input.code { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 700; font-size: 22px; }
label.field { display: flex; flex-direction: column; gap: var(--xs); font-size: 14px; font-weight: 600; }

/* ---------- Start ---------- */
.hero { text-align: center; padding-top: var(--xxxl); }
.hero .logo { align-self: center; width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.divider { display: flex; align-items: center; gap: var(--md); opacity: .8; font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--surface-border); }

/* ---------- Lobby ---------- */
.code-box { text-align: center; }
.code-box .code {
  font-size: 44px; font-weight: 800; letter-spacing: 10px; margin: var(--xs) 0 var(--md);
  font-variant-numeric: tabular-nums;
}
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sm); }
.player {
  display: flex; align-items: center; gap: var(--md);
  padding: var(--md) var(--lg);
  border-radius: var(--r-md);
  background: var(--surface);
}
.player .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--primary); font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.player .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player.offline { opacity: .5; }
.player.out { opacity: .45; text-decoration: line-through; }
.player.current { background: #fff; color: var(--text-on-light); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.player.current .avatar { background: var(--primary); color: #fff; }
.player.done .avatar { background: var(--success); color: #fff; }
.badge {
  font-size: 12px; font-weight: 700; padding: 3px var(--sm);
  border-radius: var(--r-sm); background: var(--surface-strong);
}
.badge.host { background: #fff; color: var(--primary); }
.badge.ok { background: var(--success); }
.badge.danger { background: var(--danger); }
.badge.away { background: rgba(0, 0, 0, .25); }
.icon-btn {
  appearance: none; border: none; background: var(--surface-strong); color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
}

.chips { display: flex; flex-wrap: wrap; gap: var(--sm); }
.chip {
  appearance: none; cursor: pointer;
  padding: var(--sm) var(--md);
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface); color: #fff;
  font-size: 14px; font-weight: 600;
}
.chip.on { background: #fff; color: var(--primary); border-color: #fff; }
.chip:disabled { cursor: default; }

.stepper { display: flex; align-items: center; gap: var(--md); }
.stepper button {
  appearance: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--primary); font-size: 20px; font-weight: 800;
}
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper .value { min-width: 24px; text-align: center; font-weight: 800; font-size: 18px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--md); padding: var(--sm) 0; }
.setting + .setting { border-top: 1px solid var(--surface-border); }
.setting .label { font-weight: 600; }
.setting .hint { font-size: 13px; opacity: .8; }

.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-strong); cursor: pointer; transition: background .15s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { cursor: default; opacity: .7; }

/* ---------- Rundenkopf ---------- */
.round-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border-radius: 999px; padding: var(--sm) var(--lg);
  font-size: 14px; font-weight: 700;
}
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-strong); }
.dots i.on { background: #fff; }

/* ---------- Sprecher ---------- */
.speaker { text-align: center; padding: var(--xxl) var(--lg); }
.speaker .who { font-size: 36px; font-weight: 800; margin: var(--sm) 0; word-break: break-word; }
.speaker.me { background: #fff; color: var(--primary); border: none; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255,255,255,.25); } }

/* ---------- Abstimmung ---------- */
.vote-option {
  appearance: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: var(--md);
  padding: var(--md) var(--lg);
  border-radius: var(--r-md);
  border: 2px solid transparent;
  background: var(--surface); color: #fff; font-weight: 600; font-size: 16px; text-align: left;
}
.vote-option.picked { background: #fff; color: var(--danger-deep); border-color: #fff; }
.vote-option.picked .avatar { background: var(--danger); color: #fff; }
.vote-option:disabled { cursor: default; }
.vote-option .avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--primary); font-weight: 800; font-size: 14px;
}
.progress { height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.progress > i { display: block; height: 100%; background: #fff; transition: width .25s; }

/* ---------- Fusszeile, Meldungen ---------- */
.footer { margin-top: auto; text-align: center; }
.topbar { display: flex; margin-bottom: calc(var(--sm) * -1); }
.back-btn {
  appearance: none; cursor: pointer;
  padding: var(--sm) var(--lg) var(--sm) var(--md);
  border-radius: 999px; border: 1px solid var(--surface-border);
  background: var(--surface); color: #fff; font: inherit; font-size: 14px; font-weight: 700;
  transition: background .2s, transform .15s;
}
.back-btn:hover { background: var(--surface-strong); }
.back-btn:active { transform: scale(.96); }
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--danger-deep); color: #fff; text-align: center;
  padding: calc(var(--sm) + env(safe-area-inset-top)) var(--lg) var(--sm); font-size: 14px; font-weight: 600;
}
.wait { display: flex; flex-wrap: wrap; gap: var(--xs); justify-content: center; }
