/* ReactionSync – Gestaltung: Bildregie. Dunkles Pflaumen-Graphit, jede:r Creator hat eine Signalfarbe,
   Rot nur als Tally-Licht ("auf Sendung"). Signatur: der Programmstreifen (Original grau, Reactions farbig). */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #16131d; --surface: #1e1a27; --raised: #282233; --line: #362f44; --line-soft: #2a2436;
  --text: #f2eef7; --muted: #a49bb4; --faint: #6f6680;
  --tally: #ff3d57; --ok: #5fe3a1; --warn: #ffc45c; --bad: #ff7a7a;
  --orig: #534a63;
  --k-pause: #ffc45c; --k-talkover: #6cc6ff; --k-rewind: #c4a3ff; --k-skip: #5fe3a1; --k-intro: #a49bb4; --k-outro: #ff8fb8;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --ui: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--ui); font-size: 15px; line-height: 1.5;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

button, a.btn {
  background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; cursor: pointer;
  font-weight: 500; transition: background .15s, border-color .15s;
}
/* a.btn: a link that looks like a button (a download), instead of a button nested in a link */
a.btn { display: inline-block; color: inherit; text-decoration: none; }
button:hover:not(:disabled), a.btn:hover { border-color: #4a4160; background: #302941; }
button:disabled { opacity: .45; cursor: default; }
/* Hauptaktion: hell auf dunkel wie die Taste eines Regiepults – Rot bleibt dem Tally vorbehalten */
button.primary, a.btn.primary { background: var(--text); border-color: var(--text); color: var(--ink); font-weight: 650; }
button.primary:hover:not(:disabled), a.btn.primary:hover { background: #fff; border-color: #fff; }
/* button.link: an action inside running text or the header, looks like a link */
button.link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 7px; }
button.link:hover:not(:disabled) { background: none; }
ol.steps { margin: 12px 0 4px; padding-left: 22px; display: grid; gap: 8px; }
ol.steps li::marker { color: var(--muted); }
.ext-hint { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { color: var(--text); background: var(--raised); }
button.hidden { display: none; }
input, textarea { background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus { border-color: #5b5175; outline: none; }
textarea { min-height: 92px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
kbd { font: 600 11px var(--ui); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); }

/* ---------- Kopf ---------- */
header.top {
  display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 58px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: rgba(22,19,29,.92); backdrop-filter: blur(10px); z-index: 20;
}
.logo { font: 800 19px/1 var(--display); letter-spacing: -.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
/* Logo-Marke: drei Tally-Balken unterschiedlicher Länge = mehrere Spuren auf einer Zeitachse */
.logo .mark { display: inline-grid; gap: 2px; width: 18px; }
.logo .mark i { display: block; height: 4px; border-radius: 2px; background: var(--text); }
.logo .mark i:nth-child(1) { width: 100%; } .logo .mark i:nth-child(2) { width: 62%; background: var(--tally); margin-left: 38%; } .logo .mark i:nth-child(3) { width: 80%; }
header.top nav { display: flex; gap: 4px; }
header.top nav a { text-decoration: none; color: var(--muted); padding: 6px 11px; border-radius: 7px; font-weight: 500; }
header.top nav a:hover { color: var(--text); }
header.top nav a[aria-current] { color: var(--text); background: var(--raised); }
header.top .spacer { flex: 1; }
@media (max-width: 640px) {
  header.top { gap: 12px; padding: 0 16px; }
  header.top .lang { margin-right: 0; }
  /* the extension runs only in desktop Chrome */
  header.top .ext-state { display: none; }
}
/* Language switch: two buttons, the current language pressed (like the current page in the navigation) */
header.top .lang { display: inline-flex; gap: 2px; margin-right: -14px; }
header.top .lang button { padding: 4px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
header.top .lang button[aria-pressed="true"] { color: var(--text); background: var(--raised); }
.ext-state { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ext-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.ext-state .dot.on { background: var(--ok); }
.ext-state .dot.update { background: var(--warn); }
.ext-state a { color: var(--text); }

/* ---------- Seiten-Rahmen ---------- */
main.page { max-width: 1180px; margin: 0 auto; padding: 44px 24px 96px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 36px; }
.intro h1 { font: 800 clamp(34px, 5vw, 54px)/1.02 var(--display); letter-spacing: -.035em; margin: 0 0 14px; max-width: 14ch; }
.intro p { color: var(--muted); max-width: 58ch; margin: 0; font-size: 16px; }
h2 { font: 700 22px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 14px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 7em; gap: 16px; }
@media (max-width: 800px) { .grid2, .grid3, .intro { grid-template-columns: 1fr; } }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty h3 { font: 700 20px var(--display); color: var(--text); margin: 0 0 6px; }
.empty a { color: var(--text); }

/* Avatar: Initialen in der Signalfarbe des Creators */
.avatar {
  --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--c); color: #16131d; font: 700 calc(var(--s) * .38)/1 var(--ui); letter-spacing: -.02em;
  box-shadow: 0 0 0 2px var(--surface); position: relative; overflow: hidden;
}
/* The channel picture covers the initials; the creator's colour stays as its ring */
.avatar img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); border-radius: 50%; object-fit: cover; }

/* Programmstreifen: die Signatur. Grau = Original, farbig = eingeschobene Reaction des jeweiligen Creators */
.strip { position: relative; height: 8px; border-radius: 4px; background: var(--orig); overflow: hidden; }
.strip i { position: absolute; top: 0; bottom: 0; min-width: 1px; background: var(--c); }

/* ---------- Katalog ---------- */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 28px 24px; }
.work { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; border-radius: 14px; }
.work .poster { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--surface); }
.work .poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.work:hover .poster img { transform: scale(1.03); }
.work .poster .len {
  position: absolute; right: 10px; bottom: 10px; background: rgba(22,19,29,.86); border-radius: 6px; padding: 3px 8px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.work .poster .len s { text-decoration: none; color: var(--muted); font-weight: 500; margin-right: 6px; }
.work .poster .play {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(22,19,29,.35); transition: opacity .2s;
}
.work .poster .play span { width: 62px; height: 62px; border-radius: 50%; background: var(--text); display: grid; place-items: center; }
.work:hover .poster .play, .work:focus-visible .poster .play { opacity: 1; }
.work h3 { font: 700 19px/1.25 var(--display); letter-spacing: -.015em; margin: 0; }
.work .by { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lineup { display: flex; align-items: center; gap: 10px; }
.lineup .faces { display: flex; }
.lineup .faces .avatar + .avatar { margin-left: -7px; }
.lineup .names { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.projects { display: grid; gap: 16px; }
.proj { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 18px; }
@media (max-width: 640px) { .proj { grid-template-columns: 1fr; } }
.proj img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; background: #000; }
.proj h3 { margin: 0 0 4px; font: 700 18px/1.25 var(--display); letter-spacing: -.01em; }
.proj .status { font-size: 13px; color: var(--muted); }
.proj .status b { color: var(--warn); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip {
  font-size: 13px; padding: 3px 6px 3px 4px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line);
  display: inline-flex; gap: 7px; align-items: center; max-width: 100%;
}
.chip .avatar { --s: 20px; box-shadow: none; }
.chip.pending .avatar, .chip.rejected .avatar { filter: grayscale(1) brightness(.75); }
.chip.rejected { border-style: dashed; color: var(--muted); }
.chip a { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .x { color: var(--faint); padding: 0 3px; }
.chip .x:hover { color: var(--text); }
.chip .state { font-size: 12px; color: var(--muted); }
.chip .mini { width: 38px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; display: inline-block; }
.chip .mini i { display: block; height: 100%; background: var(--warn); transition: width .6s ease; }
.analysis { margin: 12px 0 4px; padding: 11px 13px; border-radius: 10px; background: var(--raised); font-size: 13px; }
.analysis-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.analysis-head .pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.pbar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--text); transition: width .6s ease; }
.spin { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text); animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.side-col { display: grid; gap: 16px; position: sticky; top: 78px; }
.side-col h2 { font-size: 18px; margin-bottom: 4px; }
.side-col p { margin: 0 0 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; }

/* ---------- Player ---------- */
body.player { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.player header.top { height: 52px; }
.player-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.player-title strong { font: 700 16px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.left { display: flex; flex-direction: column; min-height: 0; padding: 14px 18px 12px; gap: 10px; }
/* .screen: stage, deck, controls and program bar – the part that goes fullscreen */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.theater { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-ph { position: relative; flex: 1; min-height: 200px; border-radius: 12px; background: #000; }
.deck { display: flex; gap: 10px; height: 92px; flex: none; }
.deck .ph { width: 164px; height: 92px; border-radius: 9px; background: var(--surface); border: 1px dashed var(--line); }
.deck .hint { align-self: center; font-size: 13px; color: var(--muted); }
/* Reaction hinzufügen: leere Kachel direkt neben den Live-Reactions */
.deck .add-tile {
  width: 164px; height: 92px; flex: 0 1 auto; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 6px;
  border: 1px dashed #5b5175; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
}
.deck .add-tile .plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--ink); font: 700 20px/1 var(--ui); }
.deck .add-tile:hover:not(:disabled) { color: var(--text); border-color: var(--text); background: var(--surface); }
.add-row { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.add-row button { width: 100%; }
.empty .primary { margin-top: 14px; }

.slot {
  position: absolute; overflow: hidden; border-radius: 9px; background: #000; z-index: 2;
  transition: left .45s cubic-bezier(.2,.8,.2,1), top .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1), box-shadow .3s, opacity .3s;
}
.slot.orig { --c: var(--orig); }
.slot.active { z-index: 1; border-radius: 12px; }
.slot.off { opacity: 0; pointer-events: none; }
.slot iframe { width: 100%; height: 100%; display: block; border: 0; pointer-events: none; }
.slot .catch { position: absolute; inset: 0; cursor: pointer; }
.slot .label {
  position: absolute; left: 0; bottom: 0; right: 0; font-size: 12px; font-weight: 600; padding: 14px 7px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  box-shadow: inset 0 -3px 0 var(--c, transparent);
}
.slot.active .label { display: none; }
/* Tally: wer gerade spricht, bekommt das rote Licht */
.slot.speaking { box-shadow: 0 0 0 3px var(--tally), 0 0 28px rgba(255,61,87,.45); }
.slot .skipflag { position: absolute; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.66); font-size: 12px; color: var(--muted); text-align: center; padding: 6px; pointer-events: none; }
.slot.skipped .skipflag { display: grid; }
.slot.active .skipflag { display: none; }

.overlay { position: absolute; z-index: 6; pointer-events: none; }
.badge {
  top: 14px; left: 14px; display: none; align-items: center; gap: 11px; padding: 7px 14px 7px 7px;
  background: rgba(22,19,29,.84); backdrop-filter: blur(8px); border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
}
.badge.show { display: flex; }
.badge .onair { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--tally); }
.badge .onair::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 8px var(--tally); }
.badge .who { font: 700 15px/1.2 var(--display); }
.badge .what { font-size: 12px; color: var(--muted); }
.badge .bar { width: 90px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.badge .bar i { display: block; height: 100%; background: var(--c, var(--text)); width: 0; }
.subtitle {
  left: 50%; transform: translateX(-50%); bottom: 22px; max-width: 80%; text-align: center; font-size: 18px; line-height: 1.35;
  background: rgba(0,0,0,.74); padding: 6px 12px; border-radius: 6px; display: none;
}
.subtitle.show { display: block; }
.bigplay { inset: 0; display: grid; place-items: center; pointer-events: auto; cursor: pointer; background: rgba(22,19,29,.4); }
.bigplay .btn { width: 84px; height: 84px; border-radius: 50%; background: var(--text); display: grid; place-items: center; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.bigplay.hide { display: none; }

/* Steuerleiste */
.controls { display: flex; align-items: center; gap: 8px; flex: none; }
.controls .play { width: 44px; height: 38px; padding: 0; display: grid; place-items: center; }
.controls .clock { display: grid; line-height: 1.15; margin: 0 6px; white-space: nowrap; }
.controls .time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
.controls .otime { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.controls .switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 0 6px; cursor: pointer; }
.controls .now { flex: 1; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
#skipBtn { border-color: var(--tally); }
.controls .fs:not(.hidden), .controls .icon { width: 44px; height: 38px; padding: 0; display: grid; place-items: center; }
/* An icon toggle (subtitles): off muted, on in --text with a bar under it, so the state is not colour alone */
.controls .icon { color: var(--muted); }
.controls .icon[aria-pressed="true"] { color: var(--text); border-color: var(--text); box-shadow: inset 0 -3px 0 var(--text); }

/* Gesamtablauf (schrubbbar) */
.progbar { flex: none; position: relative; height: 24px; cursor: pointer; touch-action: none; user-select: none; }
.progbar .pieces { position: absolute; left: 0; right: 0; top: 8px; height: 8px; border-radius: 4px; background: var(--orig); overflow: hidden; transition: top .15s, height .15s; }
.progbar:hover .pieces, .progbar.drag .pieces { top: 6px; height: 12px; }
.progbar .pieces canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.progbar .ph { position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; background: var(--text); border-radius: 2px; pointer-events: none; left: 0; box-shadow: 0 0 0 2px var(--ink); }
/* The preview: where a click jumps — program time, and the original's position or the creator commenting there */
.progbar .tip { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 9px; white-space: nowrap; pointer-events: none; display: none; z-index: 5; text-align: center; }
.progbar .tip .at { display: block; font-family: var(--display); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.progbar .tip .on { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.progbar .tip .on b { color: var(--text); font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
/* With a mouse on hover; on touch only while dragging (a tap would leave a sticky :hover behind) */
.progbar.drag .tip { display: block; }
@media (hover: hover) { .progbar:hover .tip { display: block; } }

/* Creator-Leiste: an- und ausschalten */
/* Creators under the program bar: their faces and the count, a button into the list (Creators tab) */
.creators { display: flex; gap: 8px; flex: none; align-items: center; flex-wrap: wrap; }
.creators .faces { display: inline-flex; align-items: center; gap: 12px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--surface); font-size: 13px; }
.creators .stack { display: inline-flex; align-items: center; }
.creators .face { display: inline-grid; border-radius: 50%; }
.creators .face + .face, .creators .face + .more { margin-left: -8px; }
.creators .face[data-off] .avatar { filter: grayscale(1) brightness(.55); }
.creators .face.live { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--tally); }
.creators .more { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 12px; }
.creators .sum { font-weight: 600; white-space: nowrap; }
.creators .go { color: var(--muted); font-size: 18px; line-height: 1; }

/* Zeitstrahl je Creator (Original-Zeit) */
.timeline { flex: none; max-height: 190px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); position: relative; }
.tl-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; height: 20px; border-bottom: 1px solid var(--line-soft); }
.tl-row[hidden] { display: none; }
.tl-row .nm { font-size: 12px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.tl-row .nm::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--orig)); flex: none; }
.tl-row .nm:hover { color: var(--text); }
.tl-row.hot .nm { color: var(--text); font-weight: 700; }
.tl-row .lane { position: relative; height: 100%; cursor: pointer; }
.tl-row .cov { position: absolute; top: 8px; height: 4px; background: var(--line); border-radius: 2px; }
.tl-row.orig .cov { background: var(--orig); }
.tl-row .mk { position: absolute; top: 4px; height: 12px; min-width: 6px; border-radius: 3px; transform: translateX(-3px); cursor: pointer; }
.tl-row .mk:hover { outline: 2px solid #fff; z-index: 2; }
.tl-ruler { position: sticky; top: 0; z-index: 3; background: var(--surface); height: 22px; border-bottom: 1px solid var(--line-soft); }
.tl-ruler .lane { position: absolute; left: 140px; right: 0; top: 0; bottom: 0; cursor: pointer; }
.tl-ruler .tick { position: absolute; top: 3px; font-size: 11px; color: var(--faint); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; z-index: 4; left: 140px; }

.k-pause { background: var(--k-pause); } .k-talkover { background: var(--k-talkover); } .k-rewind { background: var(--k-rewind); }
.k-skip { background: var(--k-skip); } .k-intro { background: var(--k-intro); } .k-outro { background: var(--k-outro); }

/* Seitenleiste */
aside.side { border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.tabs { display: flex; border-bottom: 1px solid var(--line-soft); padding: 0 8px; }
.tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 13px 8px 11px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button:hover { background: transparent; color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.pane { flex: 1; overflow-y: auto; min-height: 0; }
.pane.hidden, .filters.hidden { display: none; }
.feed-item { display: grid; grid-template-columns: 30px 1fr; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.feed-item[hidden] { display: none; }
/* Long lists: the browser skips layout and paint of the rows out of view (on a phone they lie in the page's own
   flow, so every layout of the page would otherwise go through all of them); the size is a first guess, then remembered */
.feed-item, .creator-list .reactor { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.feed-item:hover { background: var(--raised); }
.feed-item.past { opacity: .5; }
.feed-item.now { background: rgba(255,61,87,.09); box-shadow: inset 3px 0 0 var(--tally); opacity: 1; }
.feed-item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.feed-item .meta b { color: var(--text); }
.feed-item .meta .t { font-variant-numeric: tabular-nums; color: var(--faint); }
.feed-item .meta .k { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.feed-item .txt { font-size: 14px; margin-top: 3px; line-height: 1.45; color: #d9d3e3; }
/* Creators tab: search, all on/off, one row per creator (picture, name, sync, section, video, switch) */
.creator-tools { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.creator-tools input { flex: 1; min-width: 0; }
.creator-list { list-style: none; margin: 0; padding: 0; }
.creator-list .empty, #creatorNone { padding: 14px 16px; margin: 0; }
.reactor { display: grid; grid-template-columns: 40px minmax(0, 1fr) 72px auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.reactor[hidden] { display: none; }
.reactor.live { box-shadow: inset 3px 0 0 var(--tally); }
.reactor:has(.toggle:not(:checked)) .avatar, .reactor:has(.toggle:not(:checked)) .pick img { filter: grayscale(1) brightness(.55); }
.reactor:has(.toggle:not(:checked)) .n { color: var(--muted); }
.reactor .who { min-width: 0; }
.reactor .n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reactor .pick { padding: 0; border: 0; background: none; border-radius: 6px; line-height: 0; }
.reactor .pick img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--c); }
/* On/off switch: a checkbox with role="switch" */
input.toggle { appearance: none; padding: 0; border: 0; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.toggle:checked { background: var(--c, var(--text)); }
.toggle:checked::after { transform: translateX(16px); background: var(--ink); }
.toggle:disabled { opacity: .45; cursor: default; }
.filters { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.filters label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.shortcuts { padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px 12px; }

/* Player on narrow screens and in fullscreen. Below 1100 px the player is a page that scrolls: the stage keeps
   16:9 at full width, the live tiles share the row below it, the comments follow the player. A phone held
   sideways puts the tiles in a column beside the stage; the stage and the control row fill the first screen. */
@media (max-width: 1100px) {
  body.player { height: auto; overflow: visible; display: block; }
  body.player header.top { position: static; }
  .layout { display: block; }
  .left { padding: 12px 16px; }
  .screen, .theater { flex: none; }
  .stage-ph { flex: none; min-height: 0; aspect-ratio: 16 / 9; max-height: calc(100svh - 112px); }
  .deck { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: auto; }
  .deck .ph, .deck .add-tile { width: auto; height: auto; aspect-ratio: 16 / 9; }
  .deck .hint { display: none; }
  .controls { flex-wrap: wrap; }
  .controls .now { order: 1; flex-basis: 100%; text-align: left; }
  aside.side { border-left: 0; border-top: 1px solid var(--line-soft); }
  .pane { flex: none; overflow: visible; }
}
@media (max-width: 640px) {
  body.player header.top nav, .player-title span { display: none; }
  .deck { gap: 6px; }
  .deck .add-tile { display: none; }
  .timeline { display: none; }
  .slot .label { font-size: 11px; padding: 8px 5px 3px; }
  .badge { top: 8px; left: 8px; gap: 8px; padding: 4px 10px 4px 4px; }
  .badge .avatar { --s: 24px !important; }
  .badge .who { font-size: 13px; }
  .badge .bar { display: none; }
  .subtitle { bottom: 10px; max-width: 92%; font-size: 14px; padding: 4px 9px; }
  .bigplay .btn { width: 64px; height: 64px; }
}
@media (max-width: 1100px) and (orientation: landscape) and (max-height: 540px) {
  .screen { --stage-h: calc(100svh - 120px); }
  .theater { flex-direction: row; }
  .stage-ph { flex: 1; aspect-ratio: auto; height: var(--stage-h); max-height: none; }
  .deck { grid-auto-flow: row; grid-auto-columns: auto; grid-auto-rows: minmax(0, 1fr); height: var(--stage-h);
    width: calc((var(--stage-h) - 30px) / 4 * 16 / 9); }
  .deck .ph { aspect-ratio: auto; }
  .deck .add-tile { display: none; }
  /* fullscreen: the theater's own height decides, whatever the rows below it take */
  .screen:fullscreen .theater { container-type: size; }
  .screen:fullscreen .stage-ph, .screen:fullscreen .deck { height: auto; }
  .screen:fullscreen .deck { width: calc((100cqh - 30px) / 4 * 16 / 9); }
}
.screen:fullscreen { background: var(--ink); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.screen:fullscreen .theater { flex: 1; min-height: 0; }
.screen:fullscreen .stage-ph { flex: 1; min-height: 0; aspect-ratio: auto; max-height: none; }
/* held upright, a taller stage would only add black bars around the 16:9 video */
@media (orientation: portrait) {
  .screen:fullscreen .theater { justify-content: center; }
  .screen:fullscreen .stage-ph { flex: none; aspect-ratio: 16 / 9; }
}
/* Touch: no keys to show, and fingers need 44 px */
@media (hover: none) { .shortcuts { display: none; } }
@media (pointer: coarse) {
  .controls button, .controls .switch { min-height: 44px; }
  .controls .play, .controls .fs:not(.hidden), .controls .icon { width: 44px; height: 44px; }
  .creators .faces, .creator-tools button, .creator-tools input { min-height: 44px; }
  input.toggle { width: 46px; height: 28px; } .toggle::after { top: 4px; left: 4px; width: 20px; height: 20px; } .toggle:checked::after { transform: translateX(18px); }
}

/* Sperre: Player nur mit Erweiterung */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(22,19,29,.94); padding: 24px; }
.gate .panel { max-width: 520px; }
.gate h2 { font-size: 26px; }
.gate ol { color: var(--muted); padding-left: 20px; margin: 10px 0 18px; }
dialog.panel { color: var(--text); width: min(520px, calc(100vw - 32px)); padding: 22px; }
dialog::backdrop { background: rgba(10,8,14,.7); }
dialog h2 { margin-bottom: 8px; }
dialog .row { justify-content: flex-end; margin-top: 16px; }

/* Reaction hinzufügen / Abschnitt / laufende Analysen */
details.multi { margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
details.multi summary { cursor: pointer; font-size: 13px; font-weight: 600; }
details.multi[open] summary { margin-bottom: 6px; }
.range { display: flex; gap: 10px; margin: 8px 0 2px; }
.range label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; margin-top: 3px; font-size: 12px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; cursor: pointer; }
.linkish:hover:not(:disabled) { background: none; color: var(--text); }
.pending-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 13px; color: var(--muted); padding: 5px 10px; border: 1px dashed var(--line); border-radius: 999px; }
.pending-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: rs-pulse 1.4s ease-in-out infinite; }
@keyframes rs-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pending-chip i { animation: none; } }
.others h4 { margin: 14px 16px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.others .other { display: grid; grid-template-columns: 72px 1fr auto; gap: 11px; align-items: center; padding: 8px 16px; opacity: .8; }
.others .other img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; filter: grayscale(.6); }
.others .other .n { font-size: 13px; font-weight: 600; }
.fresh-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 12px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.45); font-size: 14px; }
.chip .cut { font-size: 12px; color: var(--muted); text-decoration: none; border-left: 1px solid var(--line); padding-left: 7px; }
.chip .cut:hover { color: var(--text); }

/* Startseite: Suche und "nicht dabei?" */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.find { margin: -8px 0 28px; max-width: 560px; }
.find input { padding: 12px 14px; font-size: 16px; border-radius: 10px; }
.missing { margin-top: 48px; display: grid; grid-template-columns: 1fr minmax(280px, 440px); gap: 24px; align-items: center; }
.missing h2 { margin-bottom: 6px; }
.add-form { display: flex; gap: 8px; }
.add-form button { flex: none; }
@media (max-width: 760px) { .missing { grid-template-columns: 1fr; } .add-form { flex-direction: column; } }
.grid2.tight, .grid3.tight { gap: 10px; margin: 12px 0; }
#importForm input[type=number] { width: 100px; }

/* Platzhalter-Karten beim Laden */
.work.skeleton { pointer-events: none; }
.work.skeleton .poster, .work.skeleton .strip, .sk-line { background: linear-gradient(90deg, var(--raised) 0%, #332b40 40%, var(--raised) 80%); background-size: 300% 100%; animation: rs-sheen 1.4s ease-in-out infinite; }
.work.skeleton .poster { aspect-ratio: 16 / 9; border-radius: 12px; }
.sk-line { height: 12px; border-radius: 6px; margin: 6px 0; }
.sk-line.w70 { width: 70%; height: 16px; } .sk-line.w40 { width: 40%; } .sk-line.w55 { width: 55%; }
@keyframes rs-sheen { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .work.skeleton .poster, .work.skeleton .strip, .sk-line { animation: none; } }

/* ---------- Startseite: Formate → Staffeln → Folgen ---------- */
/* Formatwahl wie ein Senderwähler: große Namen, der gewählte hell, die anderen gedimmt */
.formats { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0 0 22px; border-bottom: 1px solid var(--line-soft); }
.formats button {
  background: none; border: 0; border-radius: 0; padding: 4px 0 12px; display: flex; align-items: baseline; gap: 10px;
  color: var(--faint); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.formats button:hover:not(:disabled) { background: none; color: var(--muted); }
.formats button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }
.formats .fname { font: 800 clamp(24px, 3.4vw, 34px)/1.05 var(--display); letter-spacing: -.03em; }
.formats .fcount { font-size: 13px; font-weight: 500; color: var(--muted); }

.seasons { display: flex; flex-direction: column; gap: 12px; }
.season { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; }
.season > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 16px 20px;
}
.season > summary::-webkit-details-marker { display: none; }
.season > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; align-self: center; }
.season[open] > summary::before { transform: rotate(45deg); }
.season .s-name { font: 700 21px/1.2 var(--display); letter-spacing: -.015em; }
.season .s-meta { font-size: 13px; color: var(--muted); }
.episodes { list-style: none; margin: 0; padding: 0 8px 8px; }
.ep > a, .ep.off { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; }
.ep > a:hover { background: var(--raised); }
.ep + .ep { border-top: 1px solid var(--line-soft); }
.ep .thumb { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--raised); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep .thumb .len { position: absolute; right: 6px; bottom: 6px; background: rgba(22,19,29,.86); border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ep .thumb .len s { text-decoration: none; color: var(--muted); font-weight: 500; margin-right: 5px; }
.ep-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ep-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ep-n { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.6em; }
.ep-t { font: 700 17px/1.25 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep.off { opacity: .55; }
.ep.off .thumb img { filter: grayscale(1); }
@media (max-width: 640px) {
  .ep > a, .ep.off { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 6px; }
  .ep .lineup .names { display: none; }
  .ep-n { min-width: 0; }
  .ep-head { flex-direction: column; gap: 2px; }
  .ep-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; }
  .ep .thumb .len s { display: none; }
}

/* Known reaction channels in the studio */
#addChannel { margin: 4px 0 14px; }
#addChannel .row { gap: 8px; flex-wrap: nowrap; }
#addChannel input { flex: 1; min-width: 0; }
.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.channels li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.channels li > .small { flex-basis: 100%; }
.channels li.failed b { color: var(--warn); }
.channels a { text-decoration: none; font-weight: 600; }
