/* Nachklang FM — öffentliche Radio-Seite.
   Aurora-Hintergrund (three.js, nachklang/bg.js) + audio-reaktiver Orb
   (nachklang/hero-viz.js), darüber Hero, Player-Karte, Programm, Footer. */

:root {
  --red: #DC0404;
  --cyan: #3FEAFF;
  --paper: #eaf0fa;
  --paper-dim: rgba(234, 240, 250, 0.66);
  --paper-faint: rgba(234, 240, 250, 0.34);
  --panel: rgba(18, 30, 52, 0.58);
  --panel-2: rgba(18, 30, 52, 0.78);
  --border: rgba(125, 160, 215, 0.18);
  --border-strong: rgba(140, 175, 225, 0.34);
  --muted: #90a2bf;
  --radius: 16px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { background: #05070d; }
html, body {
  margin: 0; padding: 0;
  color: var(--paper);
  font-family: "Open Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* body transparent (wie Startseite), sonst verdeckt der opake body-Hintergrund
   den fixierten Aurora-Canvas (#nk-three, z-index -3). */
body.fm-page { background: transparent; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- three.js-Layer (wie auf der Startseite) ---- */
.nk-bg { position: fixed; inset: 0; z-index: -4; background: #05070d; }
.nk-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(118% 92% at 50% 34%, transparent 52%, rgba(0, 0, 0, .6) 100%);
}
#nk-three { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; pointer-events: none; }

.fm-main { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 0 22px 40px; }

/* ---- Hero mit Orb + Strings + Logo ---- */
.fm-hero {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 64px 12px 18px;
}
/* Orb als vollflächiger Hintergrund-Layer (wie die Aurora) — nicht in einer Box,
   damit nichts abgeschnitten wird. Liegt über der Aurora (-3), hinter Inhalten. */
#nk-hero-viz { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
#nk-hero-viz canvas { mix-blend-mode: overlay; } /* kräftigeres Glühen */
.fm-hero-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 0 20px; }

.fm-logo {
  display: block; width: min(840px, 96vw); height: auto; margin: 14px auto 18px;
  filter: drop-shadow(0 0 48px rgba(220, 4, 4, .30));
}
.fm-intro {
  max-width: 660px; margin: 0 auto; color: #c4d0e2; line-height: 1.75; font-size: 15.5px;
  text-wrap: pretty;
}

/* Programm-Umschalter (Nachklang FM / Nachklang Pur) */
.fm-channels {
  display: flex; justify-content: center; gap: 8px; margin: 0 0 18px;
}
.fm-channel {
  display: inline-block; padding: 6px 16px; border-radius: 99px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  letter-spacing: 0.14em; font-weight: 600; text-transform: uppercase;
  color: #8fa0b8; text-decoration: none;
  border: 1px solid rgba(255,255,255,0.14);
  transition: color .15s, border-color .15s, background .15s;
}
.fm-channel:hover { color: #e8eef8; border-color: rgba(255,255,255,0.32); }
.fm-channel.is-active {
  color: #6ee7f2; background: rgba(110,231,242,0.08);
  border-color: rgba(110,231,242,0.45);
}

.fm-live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 99px;
  background: rgba(220,4,4,0.16); color: #ff8080;
  border: 1px solid rgba(220,4,4,0.42);
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  letter-spacing: 0.16em; font-weight: 600;
}
.fm-live.is-off { background: rgba(255,255,255,0.05); color: var(--paper-faint); border-color: var(--border); }
.fm-live-dot {
  width: 8px; height: 8px; border-radius: 99px; background: #ff3b3b;
  box-shadow: 0 0 0 0 rgba(255,59,59,0.6); animation: fm-pulse 2s infinite;
}
.fm-live.is-off .fm-live-dot { background: var(--paper-faint); animation: none; box-shadow: none; }
@keyframes fm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,59,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(255,59,59,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); }
}

/* ---- Player-Karte ("Einschalten") ---- */
.fm-card {
  margin-top: 50px; /* mehr Abstand zwischen Intro-Text und Player */
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fm-now { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; }
.fm-cover {
  position: relative; width: 96px; height: 96px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.fm-cover img#fm-cover-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.fm-cover.has-cover img#fm-cover-img { display: block; }
.fm-cover.has-cover .fm-cover-fallback { display: none; }
.fm-cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.fm-cover-fallback img { width: 70%; opacity: 0.45; }

.fm-meta { min-width: 0; }
.fm-now-label {
  font-family: "JetBrains Mono", monospace; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper);
}
.fm-type { margin: 7px 0 5px; }
.fm-pill {
  display: inline-block; padding: 3px 11px; border-radius: 99px;
  background: var(--cyan); color: #06222a; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.fm-title { font-size: clamp(18px, 3vw, 24px); font-weight: 700; line-height: 1.22; word-break: break-word; }

/* Runder Play/Stop-Button inline mit dem Fortschrittsbalken (kompakt, ohne Lautstärke) */
.fm-controls-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.fm-play-round {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  box-shadow: 0 8px 26px -8px rgba(220,4,4,0.65);
  transition: background .2s, transform .1s;
}
.fm-play-round:hover:not(:disabled) { background: #ff2a2a; }
.fm-play-round:active:not(:disabled) { transform: scale(0.95); }
.fm-play-round:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.fm-play-round svg { width: 22px; height: 22px; fill: currentColor; }
.fm-play-label { display: none; }
.fm-icon-pause { display: none; }
body.fm-playing .fm-icon-play { display: none; }
body.fm-playing .fm-icon-pause { display: block; }

.fm-progress { flex: 1; min-width: 0; }
.fm-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.fm-bar-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), #8af3ff); transition: width 0.4s linear; }
.fm-times { display: flex; justify-content: space-between; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--paper); margin-top: 6px; }

.fm-status {
  margin: 22px 0; padding: 18px 20px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px dashed var(--border-strong);
  color: var(--paper-dim); text-align: center;
}

/* ---- Programm-Tabelle ---- */
.fm-next, .fm-history { margin-top: 30px; }
.fm-next h2, .fm-history h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--paper); font-weight: 600; margin: 0 0 12px; }
.fm-history .row { opacity: 0.82; }
.fm-table .nx-link { color: var(--cyan); }
.fm-table .nx-link:hover { text-decoration: underline; }
/* Link "Diese Hörspielwelt betreten" im Player (nur bei laufendem Hörspiel) */
.fm-world-link {
  display: inline-block; margin: 2px 0 4px; font-size: 13px; font-weight: 600;
  color: var(--cyan);
}
.fm-world-link[hidden] { display: none; }
.fm-world-link:hover { text-decoration: underline; }
.fm-table { display: flex; flex-direction: column; gap: 7px; }
.fm-table .row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: rgba(255,255,255,0.025);
}
.fm-table .row.is-now { border-color: rgba(63,234,255,0.4); background: rgba(63,234,255,0.06); }
.fm-table .nx-pill { flex: 0 0 auto; padding: 2px 9px; border-radius: 99px; background: rgba(255,255,255,0.08); color: var(--paper-dim); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.fm-table .row.is-now .nx-pill { background: var(--cyan); color: #06222a; }
.fm-table .nx-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-table .nx-dur { flex: 0 0 auto; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--paper); }

/* ---- Stream-Adresse / Feed ---- */
.fm-feed { margin-top: 30px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px clamp(16px, 4vw, 26px) 24px; }
.fm-feed h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--paper); font-weight: 600; margin: 0 0 14px; }
.fm-feed-grid { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.fm-feed-main { flex: 1; min-width: 240px; }
.fm-feed p { color: var(--paper-dim); font-size: 14px; line-height: 1.6; margin: 0 0 14px; }
.fm-feed-main > p:first-child { margin-top: 0; }
.fm-feed-qr { flex: 0 0 auto; margin: 0; text-align: center; }
.fm-feed-qr img { width: 140px; height: 140px; display: block; background: #fff; padding: 9px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
.fm-feed-qr figcaption { margin-top: 9px; font-size: 12px; color: var(--paper-faint); letter-spacing: 0.04em; }
.fm-feed-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.fm-feed-row code { flex: 1; min-width: 220px; display: flex; align-items: center; padding: 11px 14px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--paper); font-family: "JetBrains Mono", monospace; font-size: 15px; word-break: break-all; }
.fm-copy { padding: 11px 20px; border-radius: 8px; border: 1px solid var(--cyan); background: rgba(63,234,255,0.12); color: var(--cyan); font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.fm-copy:hover { background: rgba(63,234,255,0.22); }
.fm-copy.ok, .fm-copy-sm.ok { border-color: #6ee7a8; color: #6ee7a8; background: rgba(110,231,168,0.14); }
.fm-feed-alt { font-size: 13px; color: var(--paper-faint); margin: 14px 0 0; line-height: 1.6; }
.fm-feed-alt code { font-family: "JetBrains Mono", monospace; color: var(--paper-dim); word-break: break-all; }
.fm-copy-sm { background: none; border: none; color: var(--cyan); cursor: pointer; font: inherit; padding: 0 2px; text-decoration: underline; }

/* ---- Footer (wie Startseite) ---- */
.fm-footer { text-align: center; padding: 54px 20px 24px; margin-top: 34px; }
.fm-footer img { width: 180px; max-width: 56vw; height: auto; opacity: .85; filter: drop-shadow(0 0 24px rgba(220,4,4,.25)); margin: 0 auto 16px; display: block; }
.fm-footer nav { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.fm-footer nav a { color: var(--muted); font-size: 13.5px; }
.fm-footer nav a:hover { color: var(--cyan); }

@media (max-width: 560px) {
  .fm-hero { min-height: 360px; padding: 40px 8px 16px; }
  .fm-feed-grid { flex-direction: column; }
  .fm-feed-qr { align-self: center; margin: 4px auto 0; }
  .fm-now { grid-template-columns: 72px 1fr; gap: 14px; }
  .fm-cover { width: 72px; height: 72px; }
  .fm-controls-row { gap: 12px; }
}
