/* wowoshare - Oberflaeche
   Dunkel gehalten, damit der geteilte Bildschirm im Mittelpunkt steht. */

:root {
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #1a232e;
  --line: #26313d;
  --text: #e8eef5;
  --muted: #8b9bad;
  --accent: #22b8e0;
  --accent-ink: #04222c;
  --danger: #ef4b5c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

[hidden] { display: none !important; }

/* --- Logo ---------------------------------------------------------------- */

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  letter-spacing: -.01em;
}

.logo__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  position: relative;
  flex: none;
}

.logo__mark::after {
  content: "";
  position: absolute;
  inset: 7px 5px;
  border-radius: 3px;
  background: var(--bg);
}

.logo__text { color: var(--muted); font-weight: 500; }
.logo__text strong { color: var(--text); font-weight: 600; }
.logo--sm { font-size: 16px; }
.logo--sm .logo__mark { width: 22px; height: 22px; border-radius: 7px; }
.logo--sm .logo__mark::after { inset: 6px 4px; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  font: inherit;
  font-weight: 550;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .12s ease, opacity .18s ease;
}

.btn:hover { background: #22303e; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }

.btn--primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn--primary:hover { background: #3fc8ea; }

.btn--ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.btn--stop { background: var(--danger); color: #fff; min-height: 36px; padding: 0 14px; }
.btn--stop:hover { background: #ff5d6d; }

.btn--small { min-height: 36px; padding: 0 12px; font-size: 13.5px; }

.btn--block { width: 100%; }

/* --- Anmeldung ----------------------------------------------------------- */

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #16303c 0%, var(--bg) 60%);
}

.gate__card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.gate__lead {
  margin: 18px 0 26px;
  color: var(--muted);
}

.gate__error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 14px;
}

/* Profil-Auswahl: ein Klick statt Namen tippen */

.who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.who__card {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}

.who__card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.who__card:active { transform: translateY(1px); }
.who__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.who__card[aria-busy="true"] { border-color: var(--accent); opacity: .7; }

.who__avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: .02em;
}

.who__card:hover .who__avatar { background: var(--accent); color: var(--accent-ink); }

.who__name {
  font-size: 15px;
  font-weight: 550;
}

.gate__other {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate__other:hover { color: var(--text); }

.field { display: block; margin-bottom: 16px; }

.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- Grundlayout --------------------------------------------------------- */

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.bar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}

.bar__status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar__stats {
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #6f8296;
  white-space: nowrap;
}

@media (max-width: 860px) { .bar__stats { display: none; } }

.bar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.dot[data-state="on"] { background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .14); }
.dot[data-state="off"] { background: var(--danger); }
.dot[data-state="live"] { background: var(--accent); box-shadow: 0 0 0 4px rgba(34, 184, 224, .16); }

/* --- Buehne -------------------------------------------------------------- */

.stage {
  position: relative;
  background: #05080b;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
}

.stage__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05080b;
}

.empty {
  text-align: center;
  padding: 32px 24px;
  max-width: 460px;
}

.empty__icon {
  width: 72px;
  margin: 0 auto 22px;
  color: #33475b;
}

.empty__icon svg { width: 100%; height: auto; }

.empty__arrow { color: var(--accent); stroke: var(--accent); }

.empty__title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.empty__text {
  margin: 0;
  color: var(--muted);
}

.peers {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.peers li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.peers li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
}

/* --- Eigene Vorschau ----------------------------------------------------- */

.preview {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 20;
}

.preview video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #05080b;
}

.preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 12px;
}

.preview__actions {
  display: flex;
  gap: 6px;
}

.preview__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

/* --- Hinweis-Einblendung ------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  max-width: min(90vw, 460px);
  padding: 12px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 30;
}

/* --- Mobil / schmal ------------------------------------------------------ */

@media (max-width: 640px) {
  .bar { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .bar__actions { width: 100%; margin-left: 0; }
  .bar__actions .btn { flex: 1; padding: 0 12px; }
  .preview { width: 150px; right: 12px; bottom: 12px; }
  .preview__bar { padding: 8px; }
  .preview__label { display: none; }
  .preview__actions { width: 100%; flex-direction: column; }
  .preview .btn { width: 100%; }
}

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