/* twitch.kaipfstr.de — staiy
   Regel des Hauses: alles Gemessene steht in der Monospace (Zeiten, Zahlen,
   Etiketten). Fliesstext in der Systemschrift. Keine Webschrift — die CSP
   erlaubt keine (default-src 'none' => font-src 'none'). */

:root {
  --grund:       #131019;
  --tief:        #0c0a11;
  --platte:      #1b1626;
  --platte-hoch: #241d33;
  --linie:       rgba(169,112,255,.14);
  --linie-stark: rgba(169,112,255,.30);

  --lila:        #a970ff;
  --lila-tief:   #9147ff;
  --rot:         #ff3b47;
  --bernstein:   #ffb46b;

  --text:        #efeaf8;
  --gedaempft:   #9d93b5;
  --leise:       #6f6685;

  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace;

  --rand: clamp(1rem, 4vw, 2.5rem);
  --breit: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(90rem 40rem at 50% -14rem, rgba(145,71,255,.20), transparent 62%),
    var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.022em; }

img { max-width: 100%; display: block; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.leise { color: var(--leise); }
.klein { font-size: .8125rem; line-height: 1.5; }

.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sprung {
  position: absolute; left: -999px; top: 0; z-index: 50;
  background: var(--lila); color: #12091f; padding: .6rem 1rem;
  border-radius: 0 0 8px 0; font: 600 .875rem var(--schrift);
}
.sprung:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--lila);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Kopf ---------- */

.kopf {
  border-bottom: 1px solid var(--linie);
  background: linear-gradient(180deg, rgba(12,10,17,.85), rgba(12,10,17,.25));
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}

.band {
  max-width: var(--breit);
  margin: 0 auto;
  padding: .8rem var(--rand);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}

.kopf-links { display: flex; align-items: center; gap: .85rem; min-width: 0; }

.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--linie-stark);
  background: var(--platte);
}

.kopf-text h1 { font-size: 1.35rem; line-height: 1.15; }
#kennung { margin: .1rem 0 0; font-size: .75rem; letter-spacing: .04em; }

.kopf-rechts { text-align: right; display: flex; align-items: center; gap: .9rem; }
#stand { margin: 0; font-size: .72rem; letter-spacing: .02em; }

.ampel {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .28rem .6rem .28rem .5rem;
  border: 1px solid var(--linie-stark);
  border-radius: 999px;
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
}
.ampel .punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--leise); flex: none; }
.ampel-live { color: #ffd7d9; border-color: rgba(255,59,71,.5); background: rgba(255,59,71,.10); }
.ampel-live .punkt { background: var(--rot); animation: puls 1.8s ease-out infinite; }
.ampel-aus { color: var(--bernstein); border-color: rgba(255,180,107,.38); background: rgba(255,180,107,.07); }
.ampel-aus .punkt { background: var(--bernstein); }
.ampel-warte { color: var(--leise); }

@keyframes puls {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,71,.65); }
  70%  { box-shadow: 0 0 0 9px rgba(255,59,71,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,71,0); }
}

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

.buehne-huelle { max-width: var(--breit); margin: 0 auto; padding: clamp(1.2rem,4vw,2.4rem) var(--rand) 0; }

.buehne {
  position: relative;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--platte);
  isolation: isolate;
}

.buehne-bild {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: .40;
  transform: scale(1.04);
  transition: opacity .8s ease;
}
.buehne::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, var(--platte) 6%, rgba(27,22,38,.90) 42%, rgba(27,22,38,.42) 100%);
}
.buehne-inhalt {
  position: relative; z-index: 2;
  padding: clamp(1.3rem, 5vw, 3rem);
  min-height: clamp(15rem, 34vw, 22rem);
  display: flex; flex-direction: column; justify-content: flex-end;
}

.buehne-marke {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .2em; text-transform: uppercase;
  margin: 0 0 .9rem;
}
.buehne-marke .punkt { width: 9px; height: 9px; border-radius: 50%; }
.marke-live { color: #ffc9cd; }
.marke-live .punkt { background: var(--rot); animation: puls 1.8s ease-out infinite; }
.marke-aus { color: var(--bernstein); }
.marke-aus .punkt { background: var(--bernstein); box-shadow: 0 0 12px rgba(255,180,107,.7); }

.buehne-kopfzeile {
  font-size: clamp(1.5rem, 4.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  margin: 0 0 .5rem;
  max-width: 22ch;
  text-wrap: balance;
}
.buehne-kopfzeile .warm { color: var(--bernstein); }

.buehne-unter { margin: 0; color: var(--gedaempft); font-size: clamp(.95rem, 2vw, 1.05rem); max-width: 46ch; }
.buehne-unter strong { color: var(--text); font-weight: 600; }

.uhrwerk {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  letter-spacing: -.02em;
  color: var(--text);
  margin: 1.1rem 0 .3rem;
  display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
}
.uhrwerk .einheit { font-size: .42em; letter-spacing: .16em; color: var(--leise); text-transform: uppercase; }

.zuschauer {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  margin: 1rem 0 .2rem;
}
.zuschauer .wert {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  line-height: 1; letter-spacing: -.045em;
  color: #fff;
  text-shadow: 0 0 34px rgba(255,59,71,.34);
}
.zuschauer .etikett {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gedaempft);
}

/* width/height im HTML halten den Platz frei, bis das Bild da ist — die
   Seitenverhaeltnisse macht danach das CSS (height:auto), sonst gewinnt
   das HTML-Attribut und das Bild wird verzerrt. */
.vorschau {
  border-radius: 10px; border: 1px solid var(--linie-stark);
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  margin: 0 0 1.3rem;
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
  background: rgba(0,0,0,.35);
}
.live-text { min-width: 0; }

/* Live: Bild rechts, Text links — auf dem Handy Bild zuerst. */
@media (min-width: 860px) {
  .buehne-inhalt.ist-live {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,440px);
    gap: 2.4rem; align-items: end;
  }
  .buehne-inhalt.ist-live .vorschau { grid-column: 2; grid-row: 1; margin: 0; }
  .buehne-inhalt.ist-live .live-text { grid-column: 1; grid-row: 1; }
}

.zuletzt {
  margin-top: 1.4rem; padding-top: 1.1rem;
  border-top: 1px solid var(--linie);
  display: flex; gap: .9rem; align-items: flex-start;
}
.zuletzt img { width: 46px; height: auto; border-radius: 5px; flex: none; border: 1px solid var(--linie); }
.zuletzt .txt { min-width: 0; }
.zuletzt .etikett {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--leise); margin: 0 0 .2rem;
}
.zuletzt p.titel { margin: 0; font-size: .95rem; color: var(--text); }
.zuletzt p.spiel { margin: .15rem 0 0; font-size: .8125rem; color: var(--gedaempft); }

/* ---------- Felder ---------- */

.feld {
  max-width: var(--breit);
  margin: clamp(2.6rem, 7vw, 4.5rem) auto 0;
  padding: 0 var(--rand);
  scroll-margin-top: 5.5rem;   /* der Kopf klebt oben */
}

.feld-kopf {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--linie);
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 0;
  color: var(--lila);
}
.eyebrow.leise { color: var(--leise); letter-spacing: .14em; }

/* Sanftes Erscheinen — nur wenn JS laeuft, sonst bleibt alles sichtbar. */
.js-an .enthuellen { opacity: 0; transform: translateY(16px); }
.js-an .enthuellen.sichtbar {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1);
}

/* ---------- Sendeplan-Band ---------- */

.plan { display: flex; flex-direction: column; gap: .55rem; }

.plan-tag {
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem .9rem;
  padding: .7rem .85rem;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(36,29,51,.55), rgba(27,22,38,.45));
}
.plan-tag.ist-heute { border-color: var(--linie-stark); background: linear-gradient(180deg, rgba(145,71,255,.14), rgba(27,22,38,.5)); }

.plan-links { min-width: 0; }
.plan-zeile { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }
.plan-kat {
  margin: .1rem 0 0; font-size: .78rem; color: var(--gedaempft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-etikett { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.plan-tagname {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text); font-weight: 600;
}
.plan-relativ { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lila); }
.plan-zeit { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--gedaempft); }
.plan-dauer { font-family: var(--mono); font-size: .72rem; color: var(--leise); }
.plan-wieder {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--leise); border: 1px solid var(--linie); border-radius: 999px; padding: .05rem .45rem;
}

.plan-spur {
  position: relative;
  height: 16px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px var(--rasterschritt, 25%));
  background-color: rgba(255,255,255,.035);
  overflow: hidden;
}
.plan-balken {
  position: absolute; top: 0; bottom: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--lila-tief), var(--lila));
  box-shadow: 0 0 18px rgba(169,112,255,.35);
  min-width: 4px;
}
.plan-tag.ist-heute .plan-balken { background: linear-gradient(90deg, var(--lila), #d7b3ff); }
.plan-jetzt {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--bernstein);
  box-shadow: 0 0 10px rgba(255,180,107,.9);
}

.plan-achse {
  display: flex; justify-content: space-between;
  margin-top: .35rem; padding: 0 .85rem;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; color: var(--leise);
}
.plan-achse span { flex: 1; text-align: left; }
.plan-achse span:last-child { flex: none; }

.plan-fuss { margin: .9rem 0 0; }

@media (min-width: 620px) {
  .plan-tag { grid-template-columns: 15rem 1fr; align-items: center; }
  .plan-achse { padding-left: calc(.85rem + 15rem + .9rem); }
}

/* ---------- Follower ---------- */

.follower-raster { display: grid; gap: 1.6rem; align-items: center; }
@media (min-width: 720px) { .follower-raster { grid-template-columns: auto minmax(0,1fr); gap: 2.4rem; } }

.follower-zahl-block { min-width: 0; }

.riesenzahl {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1; letter-spacing: -.045em;
  margin: 0; white-space: nowrap;
  background: linear-gradient(160deg, #fff 20%, var(--lila) 130%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
#fnotiz { margin: .55rem 0 0; }

.kurve-block svg { width: 100%; height: auto; display: block; }
.kurve-hinweis {
  border: 1px dashed var(--linie-stark);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  color: var(--gedaempft);
  font-size: .875rem;
  margin: 0;
}
.kurve-hinweis .mono { color: var(--lila); }

/* ---------- Emotes ---------- */

.lesefeld {
  margin: 0 0 1.1rem;
  font-size: .82rem; letter-spacing: .04em;
  color: var(--gedaempft);
  min-height: 1.4em;
}
.lesefeld b { color: var(--lila); font-weight: 600; }

.emote-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: .4rem;
}
@media (min-width: 480px) { .emote-raster { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: .5rem; } }

.emote {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255,255,255,.035);
  border-radius: 10px;
  aspect-ratio: 1;
  display: grid; place-items: center;
  padding: .3rem;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.emote img { width: 100%; height: auto; max-width: 44px; object-fit: contain; }
.emote:hover, .emote:focus-visible {
  background: rgba(169,112,255,.16);
  border-color: var(--linie-stark);
  transform: translateY(-3px) scale(1.06);
}
.emote.gewaehlt { background: rgba(169,112,255,.22); border-color: var(--lila); }
.emote.ohne-bild { aspect-ratio: auto; padding: .45rem .3rem; }
.emote-ersatz {
  font-family: var(--mono); font-size: .58rem; color: var(--gedaempft);
  overflow-wrap: anywhere; line-height: 1.25;
}

/* ---------- Treue-Abzeichen ---------- */

.abz-hinweis { margin: -.6rem 0 1rem; }

.abz-jahr {
  display: grid; gap: .3rem .9rem;
  padding: .5rem 0;
  border-top: 1px solid var(--linie);
  align-items: center;
}
.abz-jahr:first-child { border-top: 0; padding-top: 0; }
.abz-jahr-name {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--leise); margin: 0; align-self: center;
  white-space: nowrap;
}
.abz-reihe { display: flex; flex-wrap: wrap; gap: .3rem; }
.abz {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  background: rgba(255,255,255,.05);
  border-radius: 7px; padding: .22rem;
  display: grid; place-items: center;
  transition: transform .14s ease, background-color .14s ease, border-color .14s ease;
}
.abz img { width: 26px; height: 26px; }
.abz:hover, .abz:focus-visible {
  background: rgba(169,112,255,.2); border-color: var(--linie-stark);
  transform: translateY(-2px);
}
.abz.gewaehlt { background: rgba(169,112,255,.26); border-color: var(--lila); }
@media (min-width: 620px) { .abz-jahr { grid-template-columns: 5.5rem 1fr; } }

/* ---------- Sitzungen ---------- */

.leerfall {
  border: 1px dashed var(--linie-stark);
  border-radius: 12px;
  padding: clamp(1.2rem, 4vw, 2rem);
  color: var(--gedaempft);
  background: rgba(255,255,255,.02);
}
.leerfall p { margin: 0; max-width: 56ch; }
.leerfall .kopf {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bernstein);
  position: static; background: none; border: 0; backdrop-filter: none;
  margin: 0 0 .5rem; padding: 0;
}

.sitz-liste { display: grid; gap: .9rem; }
@media (min-width: 760px) { .sitz-liste { grid-template-columns: 1fr 1fr; } }

.sitz {
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(36,29,51,.5), rgba(27,22,38,.4));
}
.sitz-datum {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--lila); margin: 0 0 .55rem;
}
.sitz-titel { margin: 0 0 .8rem; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.sitz-werte { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0; }
.sitz-wert dt {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--leise); margin: 0;
}
.sitz-wert dd {
  margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 1.15rem; color: var(--text);
}
.sitz-wechsel { margin: .9rem 0 0; padding: .7rem 0 0; border-top: 1px solid var(--linie); }
.sitz-wechsel li { list-style: none; display: flex; gap: .6rem; font-size: .8125rem; color: var(--gedaempft); }
.sitz-wechsel ul { margin: .35rem 0 0; padding: 0; display: grid; gap: .3rem; }
.sitz-wechsel .zeit { font-family: var(--mono); color: var(--leise); flex: none; }

/* ---------- Fakten ---------- */

.fakten {
  display: grid; gap: .75rem 1.5rem; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}
.fakten div { border-left: 2px solid var(--linie-stark); padding-left: .8rem; }
.fakten dt {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--leise);
}
.fakten dd { margin: .15rem 0 0; font-size: .95rem; color: var(--text); }
.fakten dd .mono { font-size: .95rem; }

/* ---------- Fuss ---------- */

.fuss {
  max-width: var(--breit);
  margin: clamp(3rem, 8vw, 5rem) auto 0;
  padding: 1.6rem var(--rand) 3rem;
  border-top: 1px solid var(--linie);
  color: var(--leise);
}
.fuss p { margin: 0 0 .55rem; max-width: 62ch; }
.regeln {
  font-size: .875rem; color: var(--gedaempft);
  padding-left: .8rem; border-left: 2px solid var(--bernstein);
}

/* ---------- Fehlerfall ---------- */

.fehler {
  border: 1px solid rgba(255,180,107,.35);
  background: rgba(255,180,107,.06);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  color: var(--gedaempft);
}
.fehler .kopf {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bernstein);
  position: static; background: none; border: 0; backdrop-filter: none;
  margin: 0 0 .4rem; padding: 0;
}
.fehler p { margin: 0; }

/* ---------- 30-Tage-Rueckblick (TwitchTracker) ---------- */

.rueck-raster {
  display: grid; gap: .8rem; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}
.rueck-kachel {
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: .9rem 1rem;
  background: linear-gradient(180deg, rgba(36,29,51,.5), rgba(27,22,38,.4));
}
.rueck-kachel dt {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--leise); margin: 0;
}
.rueck-kachel dd {
  margin: .35rem 0 0; font-variant-numeric: tabular-nums;
  font-size: clamp(1.3rem, 4vw, 1.7rem); line-height: 1;
  letter-spacing: -.02em; color: var(--text);
}
.rueck-kachel.plus dd { color: var(--lila); }
.rueck-kachel.minus dd { color: var(--bernstein); }

.rueck-kat {
  margin: 1.1rem 0 0; padding-left: .8rem;
  border-left: 2px solid var(--linie-stark);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js-an .enthuellen { opacity: 1; transform: none; }
}
