:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #1c2027;
  --line: #262b33;
  --text: #e8eaed;
  --mute: #8b93a0;
  --accent: #7c8cff;
  --live: #ff4d5e;
  --ok: #3ddc97;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

/* ---------- Kopfzeile ---------- */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 22px; height: 22px; }
.spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--panel-2); color: var(--mute);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.live { background: rgba(255, 77, 94, .14); color: var(--live); }
.badge.live .dot { animation: pulse 1.6s ease-in-out infinite; }
.viewers { color: var(--mute); font-size: 13px; }
.link {
  background: none; border: 0; color: var(--mute); cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.link:hover { color: var(--text); background: var(--panel-2); }

/* ---------- Bühne ---------- */
main { padding: 20px; display: grid; place-items: center; min-height: calc(100% - 59px); }
.stage { width: min(100%, 1280px); }
.screen {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.screen video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.screen[hidden], .offline[hidden] { display: none; }

.offline {
  width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(124, 140, 255, .10), transparent 60%),
    var(--panel);
  display: grid; place-items: center; text-align: center; padding: 24px;
}
.offline h1 { margin: 14px 0 6px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.01em; }
.offline p { margin: 0; color: var(--mute); }
.offline .icon { width: 56px; height: 56px; color: var(--mute); opacity: .8; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .35); color: #fff; text-align: center; pointer-events: none;
}
.overlay[hidden] { display: none; }
.overlay .spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 0.9s linear infinite;
  margin: 0 auto 10px;
}
.unmute {
  position: absolute; left: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20, 22, 27, .85); border: 1px solid rgba(255, 255, 255, .15); color: #fff;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; backdrop-filter: blur(6px);
}
.unmute:hover { background: rgba(40, 44, 52, .95); }
.unmute[hidden] { display: none; }
.unmute svg { width: 18px; height: 18px; }

.hint { margin-top: 12px; color: var(--mute); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.center { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.card {
  width: min(100%, 380px); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.card h1 { margin: 0 0 4px; font-size: 22px; }
.card p.sub { margin: 0 0 22px; color: var(--mute); }
label { display: block; font-size: 13px; color: var(--mute); margin: 14px 0 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); outline: none;
}
input:focus { border-color: var(--accent); }
.btn {
  width: 100%; margin-top: 20px; padding: 11px 14px; border: 0; border-radius: 10px;
  background: var(--accent); color: #0b0d12; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.error { margin-top: 14px; color: var(--live); font-size: 14px; min-height: 1em; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  main { padding: 12px; }
  .top { padding: 12px 14px; }
  .viewers { display: none; }
}
