:root {
  --bg: #f4f6f8;
  --karte: #ffffff;
  --rand: #e2e6ea;
  --text: #1f2933;
  --grau: #6b7683;
  --akzent: #2563eb;
  --gruen: #157347;
  --rot: #b02a37;
  --gelb: #b7791f;
}
* { box-sizing: border-box; }
/* Eigene display-Regeln stechen das hidden-Attribut sonst aus — die Uhr blieb
   nach dem Ende der Aufnahme stehen. */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header .titel { font-weight: 600; }
header .titel a { color: var(--text); }
header nav a { margin-left: 1.2rem; font-size: 0.95rem; }
main { max-width: 900px; margin: 1.5rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.karte h2:first-child { margin-top: 0; }
.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rand); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grau); }
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 999px;
}
.badge.ok { background: #e6f4ea; color: var(--gruen); }
.badge.neutral { background: #eef1f4; color: var(--grau); }
.badge.warn { background: #fdf3e0; color: var(--gelb); }
input, button, select, textarea {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rand);
  border-radius: 7px;
  background: #fff;
  width: 100%;
}
button, .btn {
  background: var(--akzent); color: #fff; border: none; cursor: pointer;
  font-weight: 500; padding: 0.5rem 1rem; border-radius: 7px; width: auto;
}
button.sekundaer { background: #eef1f4; color: var(--text); }
button:hover { opacity: 0.92; }
.feld { margin-bottom: 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.feld label { font-size: 0.85rem; color: var(--grau); }
.hinweis { color: var(--grau); font-size: 0.9rem; }
.zentriert { max-width: 400px; margin: 4rem auto; padding: 0 1.5rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.leer { color: var(--grau); font-style: italic; padding: 1rem 0; }
textarea { resize: vertical; }

/* Rückmeldung: der Auslöser wird ersetzt, nicht nur gesperrt. */
.laeuft {
  display: inline-block; padding: 0.5rem 0; color: var(--grau); font-weight: 500;
}
.laeuft::after {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em;
  margin-left: 0.5em; border: 2px solid var(--rand); border-top-color: var(--akzent);
  border-radius: 50%; animation: dreh 0.8s linear infinite; vertical-align: -0.1em;
}
@keyframes dreh { to { transform: rotate(360deg); } }

.meldung { border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 1rem; }
.meldung.fehler { background: #fdecea; color: var(--rot); border: 1px solid #f5c6cb; }
.meldung.warnung { background: #fdf3e0; color: var(--gelb); border: 1px solid #f3ddb3; }
.badge.fehler { background: #fdecea; color: var(--rot); }

.vorschau {
  display: block; max-width: 100%; border-radius: 8px;
  border: 1px solid var(--rand); margin-bottom: 0.9rem;
}

.kennzahlen { display: flex; gap: 2rem; flex-wrap: wrap; }
.kennzahlen .zahl { display: block; font-size: 1.5rem; font-weight: 600; }
.kennzahlen .etikett { font-size: 0.8rem; color: var(--grau); }

/* --- Landingpage für den Empfänger --------------------------------- */
body.landing { background: #0f1319; color: #e8edf4; }
.buehne { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.buehne h1 { font-size: 1.9rem; margin-bottom: 0.2rem; }
.untertitel { color: #9fb0c6; margin-top: 0; font-size: 1.05rem; }
.spieler { margin: 1.6rem 0; }
.spieler video {
  width: 100%; border-radius: 12px; background: #000; display: block;
}
.cta-text { font-size: 1.05rem; margin-top: 1.4rem; }
.btn.gross {
  display: inline-block; padding: 0.8rem 1.5rem; font-size: 1.02rem;
  margin-top: 0.4rem;
}
.fusszeile {
  margin-top: 3rem; font-size: 0.82rem; color: #7b8ca3;
  border-top: 1px solid #232b36; padding-top: 1rem;
}

/* --- Öffentliche Rechtstexte ---------------------------------------- */
.rechtstext { max-width: 720px; margin: 2.5rem auto 4rem; padding: 0 1.5rem; }
.rechtstext h1 { font-size: 1.7rem; margin-bottom: 1.5rem; }
.rechtstext h2 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.rechtstext h3 { font-size: 0.98rem; margin: 1.3rem 0 0.4rem; }
.rechtstext p, .rechtstext li { max-width: 62ch; }
.rechtstext ul { padding-left: 1.2rem; }
.rechtstext li { margin-bottom: 0.35rem; }
.rechtstext .hervor {
  background: #eef3fb; border-left: 3px solid var(--akzent);
  padding: 0.8rem 1rem; border-radius: 0 7px 7px 0;
}
.fussnav {
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rand);
  font-size: 0.88rem; color: var(--grau);
}

/* --- Aufnahme im Browser (Stufe 1c) --------------------------------- */
.knopfreihe { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.knopfreihe + .hinweis { margin-top: 0.8rem; }
.buehne-wrap {
  background: #0f1319; border-radius: 10px; overflow: hidden;
  margin-bottom: 0.9rem;
}
#buehne { display: block; width: 100%; height: auto; cursor: default; }
#buehne.greift { cursor: grabbing; }
.uhr {
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rot);
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.uhr::before {
  content: ""; width: 0.65em; height: 0.65em; border-radius: 50%;
  background: var(--rot); animation: pulsieren 1.4s ease-in-out infinite;
}
@keyframes pulsieren { 50% { opacity: 0.25; } }
.rueckblick {
  width: 100%; border-radius: 10px; background: #000; display: block;
  margin-bottom: 1rem;
}
input[type="range"] { padding: 0; }

.eigenes {
  width: 100%; max-width: 640px; border-radius: 10px; background: #000;
  display: block; margin-bottom: 0.8rem;
}
a.btn { display: inline-block; text-decoration: none; }
a.btn:hover { text-decoration: none; }
