:root {
  --bg: #0b0a12;
  --bg-elev: #14121f;
  --bg-elev2: #1c1930;
  --border: #2a2542;
  --text: #ece9f7;
  --text-dim: #8f89a8;
  --accent: #8b5cf6;
  --accent-soft: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(139, 92, 246, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- URL-Leiste im Playlist-Panel ---------- */
.sp-urlbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sp-urlbar form {
  display: flex;
  gap: 6px;
}

.sp-urlbar input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.sp-urlbar input:focus { border-color: var(--accent); }
.sp-urlbar input::placeholder { color: var(--text-dim); }

.sp-urlbar button {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}

.sp-urlbar button:disabled { filter: grayscale(0.6); cursor: wait; }
.sp-urlbar button svg { width: 16px; height: 16px; }

#load-btn {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
}

#load-btn:hover { filter: brightness(1.15); }

#append-btn {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border);
  color: var(--accent-soft);
}

#append-btn:hover { border-color: var(--accent); }

/* ---------- Layout ---------- */
.layout {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Player ---------- */
.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-inline: auto;
  width: 100%;
}

/* Offenes Panel schiebt den Inhalt zusammen statt ihn zu überlappen */
.video-shell { --panel-w: 0px; }
.video-shell.panel-open { --panel-w: min(340px, 85%); }

#video {
  width: calc(100% - var(--panel-w, 0px));
  height: 100%;
  display: block;
  object-fit: contain;
  transition: width 0.25s ease;
}

.video-shell.audio-mode #video { opacity: 0; }

.video-shell.audio-mode::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 10, 0.35);
  pointer-events: none;
  z-index: 1;
}

/* Immer sichtbare Mini-Fortschrittslinie am unteren Rand */
.mini-progress {
  position: absolute;
  left: 0;
  right: var(--panel-w, 0px);
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 3;
  transition: opacity 0.2s, right 0.25s ease;
}

#mini-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.video-shell.ui-visible .mini-progress,
.video-shell.paused .mini-progress { opacity: 0; }

/* ---------- Login-Gate (geschlossene Beta) ---------- */
/* Bewusst UNTER Controls (4), Ecken-Buttons (4) und Panels (5): Besucher
   sollen den Player samt Bedienleiste sehen, nicht nur die Anmeldekarte.
   Das untere Padding hält die Karte frei von der Steuerleiste. */
.login-gate {
  position: absolute;
  inset: 0;
  right: var(--panel-w, 0px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 96px;
  background: linear-gradient(160deg, rgba(20, 18, 31, 0.96), rgba(11, 10, 18, 0.98));
  transition: right 0.25s ease;
}

.lg-card {
  max-width: 420px;
  text-align: center;
}

.lg-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.lg-card h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.lg-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}

.lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 26px;
  border-radius: 11px;
  background: #5865f2;           /* Discord-Blurple */
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: filter 0.15s, transform 0.1s;
}

.lg-btn:hover { filter: brightness(1.12); }
.lg-btn:active { transform: scale(0.98); }
.lg-btn svg { width: 20px; height: 20px; fill: currentColor; }

.lg-hint {
  margin-top: 16px;
  font-size: 12.5px !important;
  opacity: 0.75;
}

/* Gesperrter Zustand: Bedienelemente sichtbar, aber wirkungslos */
body.locked .sp-urlbar,
body.locked .sp-import-row,
body.locked .sp-import-btn,
body.locked #queue-import {
  opacity: 0.45;
  pointer-events: none;
}

/* Ohne laufendes Video gibt es nichts zu verbergen – Steuerleiste und
   Ecken-Buttons bleiben dauerhaft sichtbar, damit man den Player sieht */
body.locked .controls,
body.locked .corner-controls {
  opacity: 1;
}

/* ---------- Ecken-Buttons oben rechts (Playlist/Infos) ---------- */
.corner-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s;
}

.video-shell.ui-visible .corner-controls,
.video-shell.paused .corner-controls,
.corner-controls:focus-within { opacity: 1; }

.video-shell.panel-open .corner-controls {
  opacity: 0;
  pointer-events: none;
}

.corner-controls .ctrl-btn {
  background: rgba(13, 11, 22, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.corner-controls .ctrl-btn:hover {
  background: rgba(139, 92, 246, 0.35);
  color: var(--accent-soft);
}

/* ---------- Inline-Panel (Playlist/Infos im Player) ---------- */
.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85%);
  background: rgba(13, 11, 22, 0.92);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--border);
  z-index: 5;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.side-panel.open { transform: translateX(0); }

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sp-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-close { width: 30px; height: 30px; flex-shrink: 0; }
.sp-close svg { width: 16px; height: 16px; }

.sp-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.sp-content::-webkit-scrollbar { width: 6px; }
.sp-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.sp-content::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.sp-hint {
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 24px 16px;
}

.sp-empty .sp-hint { padding: 0; }

.sp-import-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sp-import-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--accent);
}

.sp-import-btn svg { width: 16px; height: 16px; }

/* Import als Listeneintrag am Ende der Panel-Liste */
.sp-import-row {
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  border-left: 3px solid transparent;
}

.sp-import-row svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Drag & Drop aufs Video ---------- */
.video-shell.dropping::after {
  content: "Playlist oder URL hier ablegen";
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.14);
  color: var(--accent-soft);
  font-size: 15px;
  font-weight: 600;
  z-index: 8;
  pointer-events: none;
}

/* ---------- Füllmodus: Player über die komplette Fensterfläche ---------- */
body.fill { overflow: hidden; }

body.fill .video-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto !important;
  max-width: none !important;
  margin: 0;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: var(--panel-w, 0px);
  transition: padding-right 0.25s ease;
  z-index: 40;
}

/* Video behält sein (Zuschnitt-)Seitenverhältnis – zentriert eingepasst,
   nie gestreckt; object-fit: cover schneidet exakt die erkannten Balken.
   Ein offenes Panel verkleinert die verfügbare Fläche entsprechend. */
body.fill #video {
  width: min(
    calc(100vw - var(--panel-w, 0px)),
    calc(100vh * var(--content-ratio, 1.77778))
  );
  height: min(
    100vh,
    calc((100vw - var(--panel-w, 0px)) / var(--content-ratio, 1.77778))
  );
  object-fit: cover !important;
}

/* Hover über den Inline-Panels aktiviert die Player-Controls nicht */
.video-shell:has(.side-panel:hover):not(.paused) .controls { opacity: 0; }
.video-shell:has(.side-panel:hover):not(.paused) .np-overlay { opacity: 0; }

.sp-item {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.sp-item:hover { background: rgba(139, 92, 246, 0.1); }

.sp-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), transparent);
  border-left-color: var(--accent);
}

.sp-thumb {
  width: 78px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-elev2);
  flex-shrink: 0;
}

.sp-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-soft);
}

.sp-thumb.placeholder svg { width: 16px; height: 16px; }

.sp-item-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.sp-item-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-item.active .sp-item-title { color: var(--accent-soft); }

.sp-item-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-info-thumb {
  width: calc(100% - 32px);
  margin: 14px 16px 0;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.sp-info-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  margin: 12px 16px 0;
}

.sp-info-channel {
  font-size: 12.5px;
  color: var(--accent-soft);
  margin: 6px 16px 0;
}

.sp-info-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--text-dim);
  margin: 8px 16px 0;
}

.sp-info-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 12px 16px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.live-badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 10px;
  vertical-align: middle;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  right: var(--panel-w, 0px);
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  background: linear-gradient(160deg, var(--bg-elev), #0d0b16);
  text-align: center;
  padding: 20px;
  cursor: pointer;
}

.placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  margin-bottom: 8px;
}

.placeholder-icon svg { width: 32px; height: 32px; }

.placeholder-sub { font-size: 13px; opacity: 0.7; }

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 3px solid rgba(139, 92, 246, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 5;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- Controls ---------- */
.controls {
  position: absolute;
  left: 0;
  right: var(--panel-w, 0px);
  bottom: 0;
  padding: 26px 16px 12px;
  background: linear-gradient(transparent, rgba(5, 4, 10, 0.85));
  opacity: 0;
  transition: opacity 0.2s, right 0.25s ease;
  z-index: 4;
}

.video-shell.ui-visible .controls,
.video-shell.paused .controls,
.controls:focus-within { opacity: 1; }

.progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  margin-bottom: 10px;
}

.seek-tip {
  position: absolute;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(20, 18, 31, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.progress:hover { height: 8px; }

.progress-buffer,
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  width: 0;
  pointer-events: none;
}

.progress-buffer { background: rgba(255, 255, 255, 0.25); }

.progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 10px var(--accent-glow);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s;
  box-shadow: 0 0 8px var(--accent-glow);
  pointer-events: none;
}

.progress:hover .progress-thumb { transform: translate(-50%, -50%) scale(1); }

.controls-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ctrl-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 6px;
  flex-shrink: 0;
}

/* Lautstärke: Regler klappt erst beim Hovern aus */
.vol-wrap {
  display: flex;
  align-items: center;
}

.vol-wrap #volume {
  width: 0;
  opacity: 0;
  margin: 0;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

.vol-wrap:hover #volume,
.vol-wrap:focus-within #volume {
  width: 80px;
  opacity: 1;
  margin-right: 6px;
}

.vol-comp {
  width: 30px;
  height: 30px;
}

.vol-comp svg { width: 16px; height: 16px; }

/* Lautstärke als Tooltip über dem Regler – nur beim Hovern/Ziehen */
.vol-wrap { position: relative; }

.vol-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 34px;
  transform: translateX(-50%);
  background: rgba(20, 18, 31, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 6;
}

.vol-tip.boosted {
  color: var(--accent-soft);
  border-color: rgba(139, 92, 246, 0.5);
}

.vol-wrap:hover .vol-tip,
.vol-wrap:focus-within .vol-tip { opacity: 1; }

.ctrl-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.ctrl-btn:hover { background: rgba(139, 92, 246, 0.2); color: var(--accent-soft); }

.ctrl-btn svg { width: 20px; height: 20px; }

.ctrl-play { background: rgba(139, 92, 246, 0.25); }
.ctrl-play svg { width: 24px; height: 24px; }

/* ---------- Qualitätsmenü ---------- */
.quality-wrap { position: relative; }

.quality-btn {
  width: auto;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.quality-btn {
  display: flex;
  align-items: center;
  gap: 7px;
}

.quality-menu {
  position: absolute;
  bottom: 48px;
  right: 0;
  width: 200px;
  /* So hoch wie der Player es hergibt – erspart in den meisten Fällen
     das Scrollen, bleibt aber bei kleinen Fenstern im Rahmen */
  max-height: min(62vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(20, 18, 31, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.quality-menu::-webkit-scrollbar { width: 6px; }
.quality-menu::-webkit-scrollbar-track { background: transparent; }
.quality-menu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.quality-menu::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.crop-menu { width: 150px; }

.qo-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
  flex-shrink: 0;
}

.settings-menu { width: 230px; }

/* ---------- Stats für Nerds ---------- */
.stats-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  min-width: 230px;
  background: rgba(13, 11, 22, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px 10px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-soft);
  margin-bottom: 6px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.st-head:active { cursor: grabbing; }

.st-sub {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  margin: 8px 0 4px;
}

.st-sub:first-child { margin-top: 0; }

.st-graph {
  display: block;
  width: 100%;
  height: 26px;
  margin: 4px 0 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.st-close {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.st-close:hover { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.st-close svg { width: 12px; height: 12px; }

.st-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 1.5px 0;
}

.st-row span:first-child { color: var(--text-dim); }

.st-row .st-warn { color: #fbbf24; }

/* Beschriftung unter den Verlaufsgraphen: ohne Zeitbezug sagt eine
   Kurve wenig aus */
.st-caption {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.8;
  margin: 2px 0 4px;
  text-align: right;
}

.st-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.st-user svg {
  width: 13px;
  height: 13px;
  fill: #5865f2;          /* Discord-Blurple */
  flex-shrink: 0;
}

.quality-option {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
}

.qo-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 1px 6px;
  border-radius: 5px;
}

.qo-fps {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.quality-option:hover { background: rgba(139, 92, 246, 0.18); }

/* Aktiv = schmaler Balken links + Akzentfarbe, keine flächige Füllung */
.quality-option.active {
  background: transparent;
  color: var(--accent-soft);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

.quality-option.active:hover { background: rgba(139, 92, 246, 0.12); }

/* ---------- Einstellungs-Menü: Gruppen & Untermenüs ---------- */
.qo-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 12px 4px;
}

.qo-chevron {
  display: flex;
  align-items: center;
  margin-left: 2px;
  color: var(--text-dim);
}

.qo-chevron svg { width: 14px; height: 14px; }

.qo-back {
  color: var(--text-dim);
  font-weight: 600;
  gap: 4px;
}

.qo-back svg { width: 14px; height: 14px; flex-shrink: 0; }
.qo-back:hover { color: var(--text); }

.qo-logout {
  color: #f87171;
  gap: 9px;
}

.qo-logout svg { width: 15px; height: 15px; flex-shrink: 0; }
.qo-logout:hover { background: rgba(248, 113, 113, 0.12); }

/* Qualitätsknopf ohne geladenes Video */
.ctrl-btn.disabled,
.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ---------- Tastenkürzel-Übersicht ---------- */
.shortcuts {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 4, 10, 0.7);
  backdrop-filter: blur(4px);
}

.sc-card {
  background: rgba(20, 18, 31, 0.97);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  max-width: 460px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-soft);
  flex-shrink: 0;
}

.sc-close { width: 30px; height: 30px; }
.sc-close svg { width: 15px; height: 15px; }

.sc-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 18px;
  align-items: center;
  padding: 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.sc-grid kbd {
  justify-self: end;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 4px 9px;
  white-space: nowrap;
}

.sc-grid span {
  font-size: 13px;
  color: var(--text-dim);
}

.time {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time.live-edge {
  color: #ef4444;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.time.live-behind {
  color: #fbbf24;
  font-weight: 600;
  cursor: pointer;
}

.time.live-behind:hover { text-decoration: underline; }

.spacer { flex: 1; }

#volume {
  accent-color: var(--accent);
  cursor: pointer;
}

/* Titel-Overlay oben im Player (erscheint mit den Controls) */
.np-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: var(--panel-w, 0px);
  padding: 14px 16px 34px;
  transition: opacity 0.2s, right 0.25s ease;
  background: linear-gradient(rgba(5, 4, 10, 0.8), transparent);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.video-shell.ui-visible .np-overlay,
.video-shell.paused .np-overlay { opacity: 1; }

/* Infos leben jetzt im Inline-Panel des Players */
.video-meta { display: none; }

/* ---------- Kino-Modus ---------- */
body.cinema .layout {
  grid-template-columns: 1fr;
  max-width: 1800px;
}

body.cinema .queue-pane { max-height: 340px; }

.ctrl-btn.active {
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.25);
}

.np-overlay .np-uploader {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Overlay selbst ist klickdurchlässig – nur die Links fangen Klicks */
.np-overlay .np-link {
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.np-overlay .np-link:hover {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Queue ---------- */
/* Nur noch unsichtbares Datenmodell – die sichtbare Liste lebt im Player */
.queue-pane { display: none; }

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.queue-header h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.queue-clear {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.queue-tool {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.queue-tool:hover {
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.15);
}

.queue-tool svg { width: 15px; height: 15px; }

.sp-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sp-tool { width: 30px; height: 30px; }
.sp-tool svg { width: 15px; height: 15px; }

.queue-clear:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.queue-count {
  font-size: 12px;
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.12);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.queue-count:empty { display: none; }

.queue {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.queue:empty::after {
  content: "Noch nichts geladen.";
  display: block;
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.queue-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.queue-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 7px;
  background: rgba(11, 10, 18, 0.7);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.queue-item:hover .queue-remove { opacity: 1; }

.queue-remove:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.queue-remove svg { width: 14px; height: 14px; }

.queue-item:hover { background: var(--bg-elev2); }

.queue-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), transparent);
  border-left-color: var(--accent);
}

.queue-thumb {
  width: 92px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-elev2);
  flex-shrink: 0;
}

.queue-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-soft);
}

.queue-thumb.placeholder svg { width: 20px; height: 20px; }

.queue-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.queue-item-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.queue-item.active .queue-item-title { color: var(--accent-soft); }

.queue-item-sub {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue::-webkit-scrollbar { width: 8px; }
.queue::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.queue::-webkit-scrollbar-thumb:hover { background: var(--accent); }
