/* TESTBILD – Link-Seite im Look eines alten Fernsehers.
   Lädt nichts von fremden Domains: Schrift des Geräts, alles andere hier. */

:root {
  --grund: #400000;          /* das Dunkelrot der Band, wie die Wand hinter dem Fernseher */
  --tief: #1a0000;
  --karte: rgba(0, 0, 0, .38);
  --linie: rgba(255, 210, 190, .16);
  --text: #f6efe6;
  --grau: #d0b8b0;
  --gehaeuse: #e8e0cc;       /* das Beige des Fernsehers */
  /* Videotext-Farben */
  --gelb: #ffe600;
  --cyan: #00e5ff;
  --gruen: #19e619;
  --magenta: #ff3df5;
  --rot: #ff3b30;
  --blau: #2a3cff;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--grund); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse 120% 70% at 50% 18%, #5a0606 0%, var(--grund) 45%, var(--tief) 100%) fixed;
  overflow-x: hidden;
}

/* Bildröhre: Zeilen und Vignette über allem */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.22) 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%);
}

/* Rauschen */
.rauschen {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 19;
  opacity: .07;
}
.rauschen canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Heller Balken, der langsam durchs Bild läuft */
.rollbalken {
  position: fixed;
  left: 0;
  right: 0;
  top: -20vh;
  height: 18vh;
  pointer-events: none;
  z-index: 18;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.035), rgba(255,255,255,0));
  animation: rollen 9s linear infinite;
}
@keyframes rollen { to { transform: translateY(140vh); } }

.bildschirm {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 84px;   /* unten Platz für den Ton-Knopf */
  animation: einschalten .7s ease-out both;
}
@keyframes einschalten {
  0%   { transform: scale(1, .004); filter: brightness(4); opacity: 0; }
  40%  { transform: scale(1, .004); filter: brightness(4); opacity: 1; }
  70%  { transform: scale(1, 1.03); filter: brightness(1.6); }
  100% { transform: none; filter: none; }
}

/* Videotext-Kopfzeile */
.videotext-kopf {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  padding: 4px 2px 10px;
  white-space: nowrap;
}
.vt-seite { color: var(--text); }
.vt-name { color: var(--gelb); background: var(--blau); padding: 0 6px; }
.vt-zeit { color: var(--gelb); margin-left: auto; }

/* Kopf: Bandname und Fernseher */
.kopf { margin-bottom: 18px; }
.bandname {
  margin: 4px 0 12px;
  text-align: center;
  line-height: 0;
}
.bandname img {
  width: 46%;
  max-width: 210px;
  height: auto;
  /* leichter Rot-Blau-Versatz wie bei schlechtem Empfang */
  filter: drop-shadow(2px 0 0 rgba(255, 40, 60, .6)) drop-shadow(-2px 0 0 rgba(0, 220, 255, .5));
}

.fernseher {
  position: relative;
  width: 100%;
  aspect-ratio: 608 / 436;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .55));
}
.fernseher .gehaeuse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Werte aus quellen/bilder_machen.py */
.schirm {
  position: absolute;
  left: 5.26%;
  top: 12.84%;
  width: 75.66%;
  height: 78.90%;
  border-radius: 11.3% / 15.1%;
  overflow: hidden;
  background: #000;
  animation: anschalten 1.1s ease-out .3s both;
}
.schirm img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.08);
  animation: flimmern 7s steps(1) infinite;
}
/* Zeilen, Wölbung und Glanz der Bildröhre */
.schirm::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 1px, rgba(0,0,0,.3) 2px),
    radial-gradient(ellipse 70% 55% at 30% 22%, rgba(255,255,255,.14), rgba(255,255,255,0) 60%),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%);
}
@keyframes anschalten {
  0%   { clip-path: inset(50% 50% 50% 50%); filter: brightness(6); }
  25%  { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(6); }
  60%  { clip-path: inset(0 0 0 0); filter: brightness(2); }
  100% { clip-path: inset(0 0 0 0); filter: none; }
}
@keyframes flimmern {
  0%, 90%, 100% { opacity: 1; transform: none; }
  91% { opacity: .75; transform: translateX(3px); }
  92% { opacity: 1; transform: translateX(-2px); }
  93% { opacity: .85; transform: none; }
}
.claim {
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--grau);
}

/* Blöcke */
.block {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}
.kanal {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--cyan);
}
.live { color: var(--rot); animation: blinken 1.6s steps(1) infinite; }
@keyframes blinken { 50% { opacity: .35; } }

h1, h2 { margin: 0; line-height: 1.1; }
h2 { font-size: 24px; }
.single h2 { font-size: 30px; letter-spacing: -.01em; }
h2.klein { font-size: 18px; }
.zeile { margin: 4px 0 0; color: var(--grau); font-size: 15px; }

/* Aktuelle Single */
.single-inhalt {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.cover {
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.platzhalter {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: #fff;
  background:
    repeating-linear-gradient(90deg, #c0c0c0 0 15%, #c0c000 15% 29%, #00c0c0 29% 43%, #00c000 43% 57%, #c000c0 57% 71%, #c00000 71% 86%, #0000c0 86% 100%);
}
.cover.platzhalter span { background: #000; padding: 3px 6px; }

/* Ausklappmenü Streamingdienste */
.dienste summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: var(--text);
  color: #000;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .02em;
  user-select: none;
}
.dienste summary::-webkit-details-marker { display: none; }
.dienste summary:hover { background: var(--gelb); }
.dienste summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.pfeil { display: inline-block; transition: transform .2s; }
.dienste[open] .pfeil { transform: rotate(180deg); }
.dienste ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dienste[open] ul { animation: aufklappen .25s ease-out; }
@keyframes aufklappen {
  from { opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
.dienste a {
  display: block;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--linie);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.dienste a:hover { border-color: var(--cyan); color: var(--cyan); }

/* Countdown */
.uhr {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  text-align: center;
}
.uhr div {
  background: #000;
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 10px 0 8px;
}
.uhr span {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--gelb);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255,230,0,.35);
}
.uhr small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grau);
}
.countdown .single-inhalt { margin-bottom: 0; }
.countdown.da .uhr { display: none; }

/* Kanäle */
.kanaele ul { list-style: none; margin: 0; padding: 0; }
.kanaele li + li { border-top: 1px solid var(--linie); }
.kanaele a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 2px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
}
.kanaele .nr {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gruen);
  min-width: 2ch;
}
.kanaele .neben {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--grau);
}
.kanaele a:hover, .kanaele a:focus-visible { color: var(--gelb); }
.kanaele a:hover .nr { color: var(--gelb); }
.kanaele a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.shows .leer { margin: 6px 0 0; color: var(--grau); font-size: 15px; }

/* Mission Statement */
.mission p:not(.kanal) {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.mission .hervor {
  font-weight: 700;
  color: #fff;
}
.mission .kanal + p { margin-top: 0; }

/* Ton-Knopf unten rechts */
.ton {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: rgba(10, 0, 0, .82);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  animation: locken 2.4s ease-in-out 1.5s 3;
}
.ton:hover { border-color: var(--gelb); color: var(--gelb); }
.ton:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.ton[aria-pressed="true"] { border-color: var(--cyan); animation: none; }
@keyframes locken {
  50% { box-shadow: 0 0 0 6px rgba(255, 230, 0, .18), 0 6px 18px rgba(0, 0, 0, .5); }
}
/* kleiner Pegel: steht still, solange kein Ton läuft */
.ton-balken { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.ton-balken i {
  display: block;
  width: 3px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
}
.ton[aria-pressed="true"] .ton-balken i { background: var(--cyan); animation: pegel .9s ease-in-out infinite alternate; }
.ton[aria-pressed="true"] .ton-balken i:nth-child(2) { animation-delay: -.3s; }
.ton[aria-pressed="true"] .ton-balken i:nth-child(3) { animation-delay: -.6s; }
.ton[aria-pressed="true"] .ton-balken i:nth-child(4) { animation-delay: -.15s; }
@keyframes pegel { from { height: 3px; } to { height: 14px; } }
.ton.laedt .ton-text { opacity: .6; }

/* Fuß */
.fuss {
  text-align: center;
  font-size: 13px;
  color: var(--grau);
  padding-top: 8px;
}
.fuss a { color: var(--grau); margin: 0 8px; }
.fuss p { margin: 10px 0 0; font-family: var(--mono); font-size: 12px; }

/* Einwilligungs-Banner für den Pixel: beide Knöpfe gleich groß und gleich auffällig */
.einwilligung {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  z-index: 40;
  padding: 14px 16px 16px;
  background: #0b0000;
  border: 1px solid var(--linie);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .7);
  animation: aufklappen .3s ease-out;
}
.einwilligung[hidden] { display: none; }
.einwilligung p:not(.kanal) { margin: 0; font-size: 14px; line-height: 1.5; }
.einwilligung a { color: var(--gelb); }
.ew-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ew-knoepfe button {
  padding: 12px 8px;
  border: 1px solid var(--text);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 700 15px var(--sans);
  cursor: pointer;
}
.ew-knoepfe button:hover { background: var(--text); color: #000; }
.ew-knoepfe button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
body.frage-offen .ton { display: none; }
.fuss .einstellungen {
  background: none;
  border: 0;
  padding: 0;
  margin: 0 8px;
  color: var(--grau);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Impressum und Datenschutz */
.rechtstext { padding-bottom: 40px; animation: none; }
.rechtstext .zurueck { margin: 8px 0 14px; font-family: var(--mono); font-size: 13px; }
.rechtstext a { color: var(--gelb); }
.rechtstext h1 { font-size: 26px; margin-bottom: 6px; }
.rechtstext h2 { font-size: 16px; margin: 22px 0 0; color: #fff; }
.rechtstext p, .rechtstext li { font-size: 15px; line-height: 1.6; }
.rechtstext p { margin: 8px 0 0; }
.rechtstext ul { margin: 8px 0 0; padding-left: 20px; }
.rechtstext .stand { margin-top: 22px; color: var(--grau); font-size: 13px; }

/* Entwurf: was noch fehlt, ist sichtbar markiert */
mark.offen-text {
  background: none;
  color: var(--magenta);
  outline: 2px dashed var(--magenta);
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 13px;
}
a.offen {
  outline: 2px dashed var(--magenta);
  outline-offset: -2px;
  position: relative;
}
a.offen::after {
  content: "OFFEN";
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--magenta);
  margin-left: 6px;
  vertical-align: middle;
}

/* Bildstörung beim Klick */
body.stoerung .bildschirm { animation: stoerung .22s steps(2) both; }
body.stoerung .rauschen { opacity: .45; }
@keyframes stoerung {
  0%   { transform: translateX(0) skewX(0); filter: none; }
  25%  { transform: translateX(-8px) skewX(6deg); filter: hue-rotate(90deg) saturate(3) contrast(1.4); }
  50%  { transform: translateX(10px) skewX(-4deg); filter: drop-shadow(4px 0 0 rgba(255,0,60,.8)) drop-shadow(-4px 0 0 rgba(0,229,255,.8)); }
  75%  { transform: translateY(6px) scaleY(.96); filter: brightness(1.8); }
  100% { transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bildschirm, .rollbalken, .schirm, .schirm img, .live, .dienste[open] ul, .ton,
  .ton[aria-pressed="true"] .ton-balken i { animation: none; }
  .ton[aria-pressed="true"] .ton-balken i { height: 10px; }
  .rollbalken { display: none; }
  body.stoerung .bildschirm { animation: none; }
}
