/* ==========================================================================
  0. GLOBALE VARIABLEN & DESIGN-SYSTEM (RSD AUDIO PLAYER)
========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gap-sm: 6px;
  --gap-md: 14px;
  
  --space-xs: 4px;
  --space-sm: 6px;
  --space-md: 12px;
  --space-lg: 16px;
  
  --panel-size: 220px;
  --knob-size: 90px;
  
  /* WHEEL & CONTROL FARBEN (Harmonisch zum Gehäuse & Display) */
  --wheel-base-color: #1e2429;    
  --theme-border-color: rgba(235, 186, 100, 0.25);
  --theme-icon-color: #ffffff;    
  --theme-click-color: #ebba64;   
  --theme-knob-blend: #121619;

  /* FLÄCHEN-TRANSPARENZEN DES CLICK-WHEELS */
  --slice-normal: rgba(255, 255, 255, 0.04);  
  --slice-hover: rgba(255, 255, 255, 0.12);   
  --slice-active: rgba(235, 186, 100, 0.22);         
  --slice-border: rgba(0, 0, 0, 0.35);
  --volume-border: rgba(0, 0, 0, 0.6);
  
  --icon-fill-default: rgba(255, 255, 255, 0.45); 
  --accent-color: #ffffff;                       
  
  --gold-accent: #ebba64;
  --gold-glow: rgba(235, 186, 100, 0.4);
  --green-active: rgb(106, 245, 0);

  --icon-size: 20px;
  --icon-size-sm: 18px;
  --icon-size-lg: 22px;
  --icon-edge-padding: 24px;
  --icon-play-pause-size: 20px; /* 16px; */
  --icon-play-pause-width: 44px; /* 38px; */
  --dimming-duration: 6.0s;
}

/* Füllt den Bildschirm ohne äußere Scrollbalken aus */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #191c1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Zentrierungs-Käfig für den Desktop */
.wrapper {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: radial-gradient(circle at center, #24292e 0%, #121416 100%);
}

/* ==========================================================================
  1. DAS HAUPTGEHÄUSE (Mobile-First)
========================================================================== */
.main {
  position: relative;
  display: grid;
  grid-template-rows: 
    auto    /* .header-bar */
    auto    /* .wrap-top */
    auto    /* .scrubber-box */
    1fr     /* .playlist-frame */
    auto;   /* .control-panel-wrapper */
    
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 10px var(--space-md) var(--space-md) var(--space-md);
  row-gap: var(--gap-md); 
  
  color: #ffffff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;

  /* Physisches Gehäuse mit OKLCH-Farbe & Glanzkanten */
  background-color: #1e2226; 
  background-image: linear-gradient(145deg, #373e44 0%, #2c3237 15%, #21262a 33%, #181b1e 55%, #0e1012 78%, #000000 100%);
}

@supports (background: linear-gradient(in oklch, red, blue)) {
  .main {
    background-image: linear-gradient(145deg in oklch, #373e44 0%, #2c3237 15%, #21262a 33%, #181b1e 55%, #0e1012 78%, #000000 100%);
  }
}

/* ==========================================================================
  2. DESKTOP-BEGRENZUNG (Ab 1024px)
========================================================================== */
@media (min-width: 1024px) {
  .main {
    width: 380px;
    max-width: 380px;
    height: 720px;
    max-height: 720px;
    margin: 0 auto;
    padding: 10px var(--space-lg) var(--space-lg) var(--space-lg);
    border: 2px solid #16191c;
    border-radius: 26px;
    box-shadow: 
      inset 1px 1px 0px rgba(255, 255, 255, 0.08), 
      inset -1px -1px 0px rgba(0, 0, 0, 0.5), 
      0 20px 45px rgba(0,0,0,0.85);
  }
}

/* ==========================================================================
  3. HEADER-BAR (SCHLANK & MINIMALISTISCH)
========================================================================== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  position: relative;
  z-index: 20;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  background: transparent;
  border: none;
  color: var(--gold-accent);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

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

.home-btn:hover {
  color: #ffffff;
  transform: scale(1.08);
}

.home-btn:active {
  transform: scale(0.94);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.header-action-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(235, 186, 100, 0.35);
  color: var(--gold-accent);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-action-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header-action-btn:hover {
  background: rgba(235, 186, 100, 0.15);
  border-color: var(--gold-accent);
  color: #ffffff;
}

.header-action-btn:active {
  transform: scale(0.96);
}

.btn-tools-icon-only {
  padding: 5px 7px;
  gap: 0;
}

/* ==========================================================================
  4. DROPDOWN-MENÜ (#library-dropdown mit #library-trigger)
========================================================================== */
#library-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #182028;
  border: 1px solid rgba(235, 186, 100, 0.4);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
  padding: 6px;
  z-index: 50;
  
  display: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#library-dropdown.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  color: #e0e5eb;
  font-size: 12px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: inherit;
  fill: currentColor;
  flex-shrink: 0;
  transition: color 0.15s ease, fill 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(235, 186, 100, 0.15);
  color: #ffffff;
}

.dropdown-item:hover svg {
  color: #ffffff;
  fill: #ffffff;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* ==========================================================================
  5. COVER ART & TRACK-METADATEN (MIT RSD MUSIC H1 & MARQUEE-SLIDE)
========================================================================== */
.wrap-top {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--gap-md);
  width: 100%;
}

.cover-box {
  width: 110px;
  height: 110px;
  border: 1px solid #1a1e22;
  box-shadow: inset 0 1px 8px rgba(0,0,0,0.8), 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
  border-radius: 8px;
  background: #0f1214;
  overflow: hidden;
}

.cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

.meta-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 110px;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.brand-h1 {
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  text-align: right;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

.meta-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.track-meta {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  width: 100%;
  min-width: 0;
}

/* SANFTES SLIDEN BEI LANGEM TEXT (MARQUEE) */
.marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

/* Mobile: automatisches Hin- und Her-Sliden bei Overflow */
@media (hover: none) or (pointer: coarse) {
  .marquee-container.has-overflow .marquee-content {
    animation: marquee-slide 7s ease-in-out infinite alternate;
  }
}

/* Desktop: nur wenn die Maus drüber ist (hover) */
@media (hover: hover) and (pointer: fine) {
  .marquee-container.has-overflow:hover .marquee-content {
    animation: marquee-slide 6s ease-in-out infinite alternate;
  }
}

@keyframes marquee-slide {
  0%, 18% {
    transform: translateX(0%);
  }
  82%, 100% {
    transform: translateX(calc(-100% + 140px));
  }
}

.meta-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#info-artist {
  color: var(--gold-accent);
  font-weight: 700;
  font-size: 13px;
}

#info-album {
  color: #8a95a0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#info-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

/* ==========================================================================
  6. SCRUBBER (FORTSCHRITTSBALKEN MIT TOUCH-GUARD)
========================================================================== */
.scrubber-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 20px;
}

.scrubber-box span {
  color: var(--gold-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  width: 36px;
}
#time-total { text-align: right; }

.scrubber-track {
  position: relative;
  flex-grow: 1;
  margin: 0 10px;
  height: 7px;
  background-color: #1a1e22;
  border: 1px solid #2d333a;
  border-radius: 4px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

#scrubber-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a7803e, var(--gold-accent));
  border-radius: 3px;
  pointer-events: none;
}

#scrubber-thumb {
  position: absolute;
  top: -3px;
  left: 0%;
  width: 24px;
  height: 11px;
  background: var(--gold-accent);
  border-radius: 3px;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* ==========================================================================
  7. PLAYLIST-SCREEN (AKTIVE PLAYLIST)
========================================================================== */
.playlist-frame {
  width: 100%;
  padding: var(--space-sm);
  border-radius: 6px;
  overflow-y: auto;
  background-color: var(--gold-accent);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.15);
  scrollbar-width: thin;
  scrollbar-color: #0d1620 rgba(19, 32, 45, 0.1);
}

.playlist-frame::-webkit-scrollbar {
  width: 6px;
}
.playlist-frame::-webkit-scrollbar-track {
  background: rgba(19, 32, 45, 0.1);
}
.playlist-frame::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #1c2a38;
}

#playlist-screen {
  list-style: none;
  width: 100%;
}

#playlist-screen li {
  padding: 6px 8px;
  color: #1a2026;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s ease;
  min-width: 0;
}

#playlist-screen li:hover {
  background: rgba(19, 32, 45, 0.12);
}

#playlist-screen li.active-track {
  background: #13202d;
  color: #ffffff;
}

#playlist-screen li.active-track svg {
  color: #ffffff;
}

.btn-remove-custom-track {
  background: #da5345;
  border: none;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  margin-left: auto;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-remove-custom-track:hover {
  opacity: 1;
  transform: scale(1.3);
}

.btn-remove-custom-track svg {
  fill: var(--theme-icon-color);
  color: var(--theme-icon-color);
}

#playlist-screen li.active-track .btn-remove-custom-track {
  color: #ffffff;
  opacity: 0.65;
}

#playlist-screen li.active-track .btn-remove-custom-track:hover {
  opacity: 1;
  color: #ff8a80;
  background: rgba(255, 255, 255, 0.18);
}

/* FOLDER-STRUKTUR IM PLAYLIST-SCREEN */
.playlist-dir-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-weight: 700 !important;
  color: #0d1620 !important;
  border-bottom: 1px solid rgba(19, 32, 45, 0.08);
}

.playlist-dir-item .dir-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.playlist-dir-item .dir-badge {
  font-size: 10px;
  opacity: 0.75;
  font-weight: 600;
  white-space: nowrap;
  padding-left: 6px;
  flex-shrink: 0;
}

.playlist-breadcrumb {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 10px 0 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #13202d;
  background: rgba(19, 32, 45, 0.15);
  border-radius: 4px;
  margin-bottom: 6px;
  overflow: hidden;
  height: 28px;
  min-height: 28px;
  box-sizing: border-box;
}

.btn-breadcrumb-up,
#btn-playlist-up {
  background: rgba(19, 32, 45, 0.12);
  border: none;
  border-right: 1px solid rgba(19, 32, 45, 0.15);
  color: #13202d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  margin: 0;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  border-radius: 4px 0 0 4px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-breadcrumb-up:hover,
#btn-playlist-up:hover {
  background: rgba(19, 32, 45, 0.28);
  color: #000000;
}

.btn-breadcrumb-up svg,
#btn-playlist-up svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.breadcrumb-path {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0%;
  min-width: 0;
  line-height: 1;
}

.playlist-track-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 0%;
  min-width: 0;
}

/* ==========================================================================
  8. CONTROL PANEL (5-ZONEN-KREIS MIT SVG-SLICES & KINETIK)
========================================================================== */
.control-panel-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 4px 0;
}

.circle-btn {
  position: absolute;
  top: 0; /* 12 Uhr Oberkante des Kreises */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;  
  height: 38px; 
  border: 1px solid rgba(235, 186, 100, 0.35);
  border-radius: 50%;
  z-index: 15;
  color: rgba(255, 255, 255, 0.45); 
  background: linear-gradient(to bottom, #1c2a38 0%, #0d1620 100%);
  cursor: pointer;
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.dir-back-pos { left: 8px; } 
.sort-pos { right: 8px; }

.dir-back-pos.active,
.sort-pos.active {
  color: var(--green-active);
  box-shadow: inset 0px 0px 12px 1px rgba(106, 245, 0, 0.3);
}

.circle-btn svg {
  width: 18px;  
  height: 18px;
}

#btn-sort .icon-active,
#btn-dir-back .icon-active { display: none; }

#btn-sort.active .icon-default,
#btn-dir-back.active .icon-default { display: none; }

#btn-sort.active .icon-active,
#btn-dir-back.active .icon-active { display: inline-block; }

.player-container {
  position: relative;
  width: var(--panel-size);
  height: var(--panel-size);
  border-radius: 50%;
  background: radial-gradient(circle at center, #262c32 0%, #1c2126 70%, #121619 100%);
  border: 1.5px solid rgba(235, 186, 100, 0.35);
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 8px 22px rgba(0, 0, 0, 0.65);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* MATHEMATISCHE SVG-SLICES */
.wheel-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.wheel-slice {
  cursor: pointer;
  outline: none;
  pointer-events: fill !important; 
  fill: var(--slice-normal);
  stroke: var(--slice-border);
  stroke-width: 1.5px;
  transition: fill 0.12s ease;
}

/* HOVER NUR AUF ECHTEN DESKTOP-GERÄTEN MIT MAUS */
@media (hover: hover) and (pointer: fine) {
  .wheel-slice:hover {
    fill: var(--slice-hover) !important;
  }

  .circle-btn:hover {
    color: #ffffff;
    border-color: var(--gold-accent);
  }
}

/* AKTIVER KLICK / TOUCH-FEEDBACK (OPTISCHE VERÄNDERUNG SCHALTFLÄCHE & SVG) */
.wheel-slice.is-active,
.wheel-slice:active {
  fill: var(--slice-active) !important;
}

.icon-wrapper.is-active {
  transform: scale(0.90) !important;
  filter: brightness(1.3) !important;
}

.icon-wrapper.is-active svg,
.icon-wrapper.is-active svg * {
  fill: #ffffff !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

.icon-wrapper.ic-shuffle.is-toggled svg,
.icon-wrapper.ic-loop.is-toggled svg {
  fill: var(--green-active) !important; /*var(--gold-accent)*/
  stroke: var(--green-active) !important; /*var(--gold-accent)*/
  color: var(--green-active) !important; /*var(--gold-accent)*/
  filter: drop-shadow(0 0 5px rgba(235, 186, 100, 0.7));
}

.icon-wrapper.ic-shuffle.is-toggled svg *,
.icon-wrapper.ic-loop.is-toggled svg * {
  fill: var(--green-active) !important;  /*var(--gold-accent)*/
  stroke: var(--green-active) !important;  /*var(--gold-accent)*/
  color: var(--green-active) !important;  /*var(--gold-accent)*/
}

/* ==========================================================================
  10. ICON-EBENE & KINETISCHE LICHT-CHOREOGRAFIE
========================================================================== */
.icon-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none; 
}

.icon-wrapper {
  position: absolute;
  width: var(--icon-size);
  height: var(--icon-size);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.icon-wrapper svg {
  width: 100%;
  height: 100%;
  fill: var(--icon-fill-default);
  stroke: var(--icon-fill-default);
  color: var(--icon-fill-default);
  transition: fill 0.2s ease, stroke 0.2s ease, color 0.2s ease;
}

/* MATRIX POSITIONS-STEUERUNG */
.ic-next    { top: calc(50% - var(--icon-size) / 2); right: var(--icon-edge-padding); }
.ic-back    { top: calc(50% - var(--icon-size) / 2); left: var(--icon-edge-padding); }
.ic-shuffle { bottom: var(--icon-edge-padding); right: 67px; }
.ic-loop    { bottom: var(--icon-edge-padding); left: 67px; }

/* TWIN PLAY-PAUSE MIT EIN- & AUSBLENDEVERHALTEN */
.ic-play-pause {
  top: var(--icon-edge-padding);
  left: calc(50% - var(--icon-play-pause-width) / 2);
  width: var(--icon-play-pause-width);
  display: flex;
  justify-content: space-between;
}

.ic-play-pause svg {
  width: var(--icon-play-pause-size);
  height: var(--icon-play-pause-size);
}

.ic-play-pause.state-playing .twin-play   { fill: var(--green-active); } /*--theme-click-color*/
.ic-play-pause.state-playing .twin-pause  { fill: var(--icon-fill-default); }

.ic-play-pause.state-paused .twin-pause   { fill: var(--green-active); } /*--theme-click-color*/
.ic-play-pause.state-paused .twin-play    { fill: var(--icon-fill-default); }

.ic-play-pause.state-dimming .twin-pause  { 
  fill: var(--icon-fill-default); 
  transition: fill var(--dimming-duration) ease; 
}

.ic-back svg, .ic-next svg {
  position: absolute;
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.icon-wrapper.ic-back.is-active svg *, .icon-wrapper.ic-next.is-active svg * {
  fill: var(--green-active) !important; 
  stroke: var(--green-active) !important;
  color: var(--green-active) !important;
  
  }

.ic-loop svg, .ic-shuffle svg {
  position: absolute;
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  transition: transform 0.08s ease, filter 0.08s ease;
}


/* ==========================================================================
  11. 5.4 VOLUMEN-KNOB MIT PLAYLIST-FRAME GRUNDFARBE & DUNKLEM PUNKT
========================================================================== */
.volume-knob {
  position: absolute;
  top: calc(50% - var(--knob-size) / 2);
  left: calc(50% - var(--knob-size) / 2);
  width: var(--knob-size);
  height: var(--knob-size);
  border-radius: 50%;
  z-index: 10;
  cursor: grab;
  box-sizing: border-box;
  
  background: radial-gradient(
    circle at 35% 35%, 
    #f7d794 0%, 
    var(--gold-accent) 60%, 
    #b88a35 100%
  ); 
  
  border: 1.5px solid #8e6a25;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.55),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.volume-knob:active { cursor: grabbing; }

.knob-rotor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-145deg);
  will-change: transform;
  pointer-events: none;
}

.knob-dot { 
  position: absolute; 
  top: 14px; 
  left: calc(50% - 3px); 
  width: 6px; 
  height: 6px; 
  border-radius: 50%; 
  z-index: 12; 
  background: #121619b0; 
  border: 1px solid #121619;
  box-shadow: inset 0 0.5px 1.5px rgba(0, 0, 0, 0.8);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  pointer-events: none;
  border: 1px solid #12161965;
}

.player-container.knob-is-active .knob-dot {
  background: var(--green-active);
}

/* ==========================================================================
  12. BIBLIOTHEKS-SIDEBAR (RECHTS-SLIDE VIA TRANSLATEX)
========================================================================== */
.library-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 95vw;
  height: 100vh;
  height: 100dvh;
  background: #121619;
  border-left: 1px solid rgba(235, 186, 100, 0.3);
  box-shadow: -12px 0 40px rgba(0,0,0,0.88);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile: volle 100vw Display-Fläche nutzen */
@media (max-width: 480px) {
  .library-sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
    border-left: none;
  }
}

.library-sidebar.is-open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #161c20;
  flex-shrink: 0 !important;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.sidebar-header h2 svg {
  width: 20px;
  height: 20px;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: #a0aab4;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

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

.sidebar-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-search-box {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #14191d;
  flex-shrink: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-search-input {
  width: 100%;
  background: #0d1012;
  border: 1px solid #283038;
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: var(--gold-accent);
}

.sidebar-overview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #8c97a0;
  padding-top: 2px;
}

.sidebar-overview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sidebar-quick {
  background: transparent;
  border: none;
  color: #ebba64;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.btn-sidebar-quick:hover {
  text-decoration: underline;
  color: #ffffff;
}

.sidebar-track-list {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(235, 186, 100, 0.45) rgba(0, 0, 0, 0.3);
}

.sidebar-track-list::-webkit-scrollbar {
  width: 8px;
}

.sidebar-track-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.sidebar-track-list::-webkit-scrollbar-thumb {
  background: rgba(235, 186, 100, 0.35);
  border-radius: 4px;
}

.sidebar-track-list::-webkit-scrollbar-thumb:hover {
  background: rgba(235, 186, 100, 0.65);
}

/* FOLDER-KARTEN IN DER SIDEBAR */
.sidebar-folder-card {
  background: #171d22;
  border: 1px solid rgba(235, 186, 100, 0.22);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  flex-shrink: 0 !important;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1b2329;
  cursor: pointer;
  user-select: none;
  gap: 8px;
  flex-shrink: 0 !important;
  min-height: 44px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.sidebar-folder-header:hover {
  background: #232d36;
}

.sidebar-folder-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0%;
  min-width: 0 !important;
  overflow: hidden;
}

.sidebar-folder-title-box svg,
.sidebar-folder-title-box .folder-state-svg {
  color: #ebba64 !important;
  fill: #ebba64 !important;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.sidebar-folder-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ebba64;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar-folder-count {
  font-size: 11px;
  color: #8c97a0;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-folder-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(235, 186, 100, 0.12);
  border: 1px solid rgba(235, 186, 100, 0.35);
  color: var(--gold-accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0 !important;
  transition: all 0.15s ease;
}

.btn-folder-add svg {
  width: 12px;
  height: 12px;
}

.btn-folder-add:hover {
  background: rgba(235, 186, 100, 0.25);
  border-color: rgba(235, 186, 100, 0.6);
}

.btn-folder-add.in-playlist {
  background: rgba(106, 245, 0, 0.15);
  border-color: var(--green-active);
  color: var(--green-active);
}

.sidebar-folder-tracks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #13181c;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-track-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #1b2126;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0 !important;
  min-height: 52px;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-track-item:hover {
  background: #232a31;
  border-color: rgba(235, 186, 100, 0.25);
}

.sidebar-track-item.is-previewing {
  border-color: var(--gold-accent);
  background: #273038;
  box-shadow: 0 0 10px rgba(235, 186, 100, 0.12);
}

.sidebar-cover {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0 !important;
  background: #0c0f12;
}

.sidebar-track-info {
  flex: 1 1 0%;
  min-width: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sidebar-track-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #f0f2f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.sidebar-track-sub {
  font-size: 11px;
  color: #8c97a0;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 20px !important;
  flex-shrink: 0 !important;
}

.btn-preview {
  background: rgba(235, 186, 100, 0.12);
  border: 1px solid rgba(235, 186, 100, 0.35);
  color: var(--gold-accent);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-preview svg {
  width: 14px;
  height: 14px;
}

.btn-preview:hover {
  background: rgba(235, 186, 100, 0.22);
}

.btn-preview.active {
  background: var(--gold-accent);
  color: #121619;
  border-color: var(--gold-accent);
}

.btn-playlist-sync {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #98a5b0;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0 !important;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-playlist-sync svg {
  width: 14px;
  height: 14px;
}

.btn-playlist-sync:hover {
  border-color: rgba(235, 186, 100, 0.5);
  color: #ebba64;
}

.btn-playlist-sync.in-playlist {
  background: rgba(106, 245, 0, 0.15);
  border-color: var(--green-active);
  color: var(--green-active);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #14191d;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0 !important;
}

.sidebar-footer-btn {
  width: 100%;
  background: var(--gold-accent);
  color: #0e1215;
  font-weight: 700;
  font-size: 12.5px;
  padding: 11px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-footer-btn:hover {
  filter: brightness(1.1);
}

.sidebar-footer-btn:active {
  transform: scale(0.99);
}
