/* Stilvorlage der Hoerer-Seite. Eigenstaendig im Aufbau (keine dritte
   Datei), teilt sich aber die PACIFIC-Farbwelt und die lokalen Schriften mit
   der Regie: eine Stahlfarbe auf fast schwarzem Grund, kein Rot, kein Rund. */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-condensed-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #070a0e;
  --surface: #0b1015;
  --border: rgba(148, 188, 227, 0.17);
  --text: #e4edf6;
  --text-hi: #eaf3fc;
  --muted: #8ba3b8;
  --accent: #94bce3;
  --accent-strong: #dcecfb;
  --contrast: #0a0d11;
  --glow: rgba(148, 188, 227, 0.45);
  --font-body: "Barlow", system-ui, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background-color: var(--bg);
  color: var(--text);
  font: 400 1rem/1.4 var(--font-body);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* Unterdrückt das iOS-Kontextmenü (Kopieren/Teilen) bei langem Halten –
     sonst reißt es genau die Halten-und-Ziehen-Geste der Lautstärkebalken ab. */
  -webkit-touch-callout: none;
}

.live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 26rem;
  text-align: center;
}

.live__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Das einzige, was sich unabhaengig vom Ton bewegt: dieselbe Lampe wie im
   Sender-Dock der Regie – eckig, nicht rund, zeigt nur, dass gesendet wird. */
.live__signal {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--muted);
  transition: background-color 200ms ease;
}

.live[data-on="true"] .live__signal {
  background-color: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  animation: puls 1.4s ease-in-out infinite;
}

@keyframes puls {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .live[data-on="true"] .live__signal { animation: none; }
}

.live__on {
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  color: var(--accent-strong);
}

.live__listeners {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: #5f7a91;
  font-variant-numeric: tabular-nums;
}

.live__intro {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.live__kicker {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.live__kicker:empty { display: none; }

.live__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-hi);
  text-wrap: balance;
  /* Zwei Zeilen genuegen; ein langer Titel soll die Mitte nicht verschieben. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live__sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.live__sub:empty { display: none; }

/* Das laufende Band: der aktuelle Titel mit echter Klangkurve, umgeben von
   den Titeln davor und danach. Kein Spulen – die Sprungmarke steht fest,
   das Band selbst zieht im Takt der echten Sendeposition vorbei. */
.live__tape {
  position: relative;
  width: 100%;
  height: 5.75rem;
}

.live__tape-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  mask: linear-gradient(90deg, transparent, #000 14%, #000 93%, transparent);
  -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 93%, transparent);
}

.live__strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  will-change: transform;
}

.live__block {
  flex: 0 0 auto;
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid var(--border);
}

.live__block-label {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.live__block-wave--ghost {
  height: 14px;
  opacity: 0.8;
}

.live__block-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.live__block-eta {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live__block--now .live__block-eta {
  font-family: var(--font-head);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.live__block[data-offset="-2"],
.live__block[data-offset="2"] { border-color: rgba(148, 188, 227, 0.14); }
.live__block[data-offset="-2"] .live__block-label,
.live__block[data-offset="2"] .live__block-label { color: #4d667c; }

.live__block[data-offset="-1"] { border-color: rgba(148, 188, 227, 0.18); }
.live__block[data-offset="-1"] .live__block-label { color: #5f7a91; }

.live__block--now {
  height: 86px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px;
  border-color: var(--accent);
  background: rgba(148, 188, 227, 0.09);
  /* Glüht im Takt der echten Lautstärke – `--level` kommt pro Bildlauf aus
     dem Analyser (`TapeStrip`), nicht aus einer Animation. */
  box-shadow: 0 0 calc(20px + var(--level, 0) * 46px) rgba(148, 188, 227, calc(0.16 + var(--level, 0) * 0.4));
  transition: box-shadow 90ms linear;
}

.live__block-wave {
  width: 100%;
  height: 38px;
}

.live__block--now .live__block-label {
  font-family: var(--font-head);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.live__block[data-offset="1"] {
  height: 58px;
  border: 1px dashed rgba(148, 188, 227, 0.28);
}

.live__block-kicker {
  font-family: var(--font-head);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.live__block[data-offset="2"] {
  border-style: dashed;
}

.live__playhead-line {
  position: absolute;
  left: 38%;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: var(--accent-strong);
  box-shadow: 0 0 14px rgba(220, 236, 251, 0.8);
}

.live__playhead-dot {
  position: absolute;
  left: 38%;
  top: -11px;
  margin-left: -3.5px;
  width: 8px;
  height: 8px;
  background: var(--accent-strong);
}

.live__tape-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Ohne laufenden Titel gibt es nichts, worauf die Sprungmarke zeigen
   könnte – sie verschwindet, statt ins Leere zu zeigen. */
.live__tape[data-empty="true"] .live__playhead-line,
.live__tape[data-empty="true"] .live__playhead-dot {
  display: none;
}
.live__tape[data-empty="true"] .live__tape-empty {
  display: flex;
}

/* Die Lautstaerke als elf klickbare Stufen. Ein zweiter Tipp auf die bereits
   aktive erste Stufe schaltet stumm – ein eigener Wiedergabeknopf entfaellt
   bewusst. */
.live__volume-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.live__volume {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1 1 auto;
  height: 44px;
  /* Ziehen ist eine eigene Geste hier – die Seite soll dabei nicht
     mitscrollen. */
  touch-action: none;
}

/* Dezente, live mitlaufende Prozentanzeige der gewählten Stufe. */
.live__volume-percent {
  flex: 0 0 auto;
  padding-bottom: 2px;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live__volume-bar {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}

/* Der 7. Balken markiert leise, aber dauerhaft die 100%-Marke (die normale
   Lautstärke) – unabhängig davon, welche Stufe gerade aktiv ist. */
.live__volume-bar[data-reference="true"] {
  border-bottom: 1px solid var(--accent);
}

.live__volume-bar > span {
  width: 100%;
  display: block;
  background-color: rgba(148, 188, 227, 0.16);
  transition: background-color 120ms ease;
}

.live__volume-bar--on > span {
  background-color: var(--accent);
}

/* Nur für echte Zeigergeräte – auf iOS bliebe ein Hover sonst nach dem
   Antippen "hängen", bis woanders hingetippt wird. Farbwechsel statt
   Opazität: auf dem fast schwarzen Grund ist eine Aufhellung viel
   deutlicher zu erkennen als ein leichtes Abdunkeln. */
@media (hover: hover) and (pointer: fine) {
  .live__volume-bar:hover > span {
    background-color: rgba(148, 188, 227, 0.32);
  }
  .live__volume-bar--on:hover > span {
    background-color: var(--accent-strong);
  }
}

/* Wie viel der Begrenzer gerade wirklich abzieht – echte Anzeige aus
   `DynamicsCompressorNode.reduction`, keine Simulation. Bei voller
   Lautstärke ohne Eingriff bleibt die Fläche leer. */
.live__limiter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* Die Stärke-Wahl sitzt kompakt VOR dem Begrenzer-Balken in derselben Zeile:
   sanft/normal/stark · BEGRENZER ─────────
   Doppelte Selektoren mit Absicht: die allgemeine .live__eq-Regel (width:
   100 %) steht später im Blatt und würde die Kompakt-Fassung sonst
   überstimmen – dann frisst die Nav die Zeile und der Balken kollabiert. */
.live__limiter .live__eq {
  width: auto;
  flex: none;
  gap: 4px;
}
.live__limiter .live__eq-button {
  padding: 0.2rem 0.45rem;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
}

.live__limiter-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.live__limiter-meter {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(148, 188, 227, 0.14);
  overflow: hidden;
}

.live__limiter-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent-strong);
  transition: width 80ms linear;
}

/* Dezente Klangbild-Voreinstellungen – wirkt nur lokal im eigenen Browser. */
.live__eq {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.live__eq-button {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  cursor: default;
  touch-action: manipulation;
  transition: border-color 120ms ease, color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .live__eq-button:hover {
    color: var(--text-hi);
    border-color: var(--accent);
  }
}

.live__eq-button[data-active="true"] {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.live__eq-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Die Sender-Reiter – echte Sparten, kein fester Satz. */
.live__tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior: none;
}
.live__tabs::-webkit-scrollbar { display: none; }

.live__tab {
  appearance: none;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  min-width: 2.75rem;
  padding: 0.65rem 0.6rem 0.5rem;
  color: #4d667c;
  cursor: default;
  touch-action: manipulation;
  transition: color 120ms ease, border-color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .live__tab:hover {
    color: var(--text-hi);
    border-bottom-color: var(--border);
  }
}

.live__tab[data-active="true"] {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.live__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Nur Stoerungen werden gezeigt. Dass alles laeuft, sagt die Lampe – ein
   Geraet, das dauernd "verbunden" meldet, redet ueber sich selbst statt
   ueber das Programm. Auch hier kein Rot: hell und auffaellig genuegt. */
.live__state {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-hi);
}

.live__state:empty,
.live__state[data-tone="success"],
.live__state[data-tone="busy"] {
  display: none;
}

/* ---- Hinweis, wenn der Browser den Ton verweigert ---- */

.gate {
  margin: auto;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  text-align: center;
  max-width: 20rem;
}

.gate::backdrop {
  background-color: rgba(4, 7, 10, 0.72);
  backdrop-filter: blur(2px);
}

.gate__text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.gate__ok {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent);
  background-color: var(--accent);
  color: var(--contrast);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
  touch-action: manipulation;
  transition: background-color 120ms ease;
}

.gate__ok:active { background-color: var(--accent-strong); }

@media (hover: hover) and (pointer: fine) {
  .gate__ok:hover { background-color: var(--accent-strong); }
}

.gate__ok:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
