/* Reproductor alineado al ancho del karaoke (columna principal) */
.has-radio {
  --radio-h: 78px;
  --ytm-radius: 28px;
  --ytm-red: #ff0033;
  --ytm-glass: #17191e;
  --ytm-border: rgba(255, 255, 255, 0.08);
  --content-pad: clamp(14px, 3vw, 44px);
}
.has-radio .app {
  padding-bottom: calc(var(--radio-h) + var(--safe-b) + 14px);
}
.has-radio .sidebar {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  bottom: 0;
}

.radio-root {
  position: fixed;
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  z-index: 40;
  pointer-events: none;
  padding: 0 var(--content-pad) calc(10px + var(--safe-b)) var(--content-pad);
  transition: left 0.2s ease;
}
body.nav-collapsed .radio-root,
.app.nav-collapsed ~ .radio-root {
  left: 0;
}
@media (max-width: 860px) {
  .radio-root,
  body.nav-collapsed .radio-root,
  .app.nav-collapsed ~ .radio-root {
    left: 0;
    padding-left: max(14px, var(--safe-l));
    padding-right: max(14px, var(--safe-r));
  }
}
.radio-root > * {
  pointer-events: auto;
}

/* Misma “pantalla” que karaoke: fondo sólido, radio 28px */
.radio-dock.ytm-bar {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--ytm-radius);
  overflow: hidden;
  border: 1px solid var(--ytm-border);
  background: var(--ytm-glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #fff;
  min-height: 72px;
}
.radio-dock audio {
  display: none;
}

/* Seek fino encima de toda la barra */
.ytm-seek-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  display: flex;
  align-items: flex-start;
  z-index: 3;
  padding-top: 0;
}
.ytm-seek {
  --seek: 0%;
  width: 100%;
  height: 3px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0;
}
.ytm-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    var(--ytm-red) 0 var(--seek),
    rgba(255, 255, 255, 0.22) var(--seek) 100%
  );
}
.ytm-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--ytm-red);
  border: 0;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.ytm-seek:hover::-webkit-slider-thumb,
.ytm-seek:focus::-webkit-slider-thumb {
  opacity: 1;
  transform: scale(1.05);
}
.ytm-seek::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
}
.ytm-seek::-moz-range-progress {
  height: 3px;
  background: var(--ytm-red);
}
.ytm-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--ytm-red);
  opacity: 0;
}
.ytm-seek:hover::-moz-range-thumb {
  opacity: 1;
}

/* Tres zonas: controles | ahora suena | extras */
.ytm-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 1.4fr) minmax(120px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 14px 10px;
}

.ytm-left,
.ytm-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ytm-left {
  justify-content: flex-start;
}
.ytm-right {
  justify-content: flex-end;
}

.ytm-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.ytm-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.ytm-btn.on {
  color: #ff8a9a;
  background: rgba(255, 0, 51, 0.14);
}
.ytm-play {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.14) !important;
}
.ytm-play:hover {
  background: rgba(255, 255, 255, 0.24) !important;
  transform: scale(1.04);
}

.ytm-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.78);
  padding-inline: 8px;
  white-space: nowrap;
}

.ytm-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-content: center;
}
.ytm-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 0, 51, 0.45), transparent 55%),
    linear-gradient(145deg, #3a3a3a, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.ytm-copy {
  min-width: 0;
  text-align: left;
}
.ytm-title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ytm-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.ytm-vol {
  display: none;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.85);
  padding-inline: 4px;
}
.ytm-vol input {
  width: 84px;
  height: 3px;
  accent-color: #fff;
  cursor: pointer;
}

.radio-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 15, 15, 0.5);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 650;
  font-size: 0.86rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

/* Audio nativo en fichas */
.yt-audio-shell {
  display: block;
  padding: 10px 12px 8px;
  border-radius: var(--ytm-radius);
  overflow: hidden;
  background: rgba(18, 18, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.yt-audio-shell audio,
.panel audio,
.sidepanels audio,
.yt-audio {
  width: 100%;
  height: 40px;
  margin: 0;
  border-radius: 10px;
  background: transparent;
  color-scheme: dark;
}
.panel:has(> .yt-audio-shell) {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.panel:has(> .yt-audio-shell) h3 {
  margin: 0 0 8px;
  padding-inline: 4px;
}

@media (min-width: 760px) {
  .ytm-vol {
    display: inline-flex;
  }
  .ytm-row {
    padding-inline: 18px;
  }
}

@media (max-width: 640px) {
  .has-radio {
    --radio-h: 72px;
  }
  .ytm-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px 10px;
    min-height: 62px;
  }
  .ytm-time {
    display: none;
  }
  .ytm-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 1.05rem;
  }
  .ytm-title {
    font-size: 0.82rem;
  }
  .ytm-meta {
    font-size: 0.68rem;
  }
  .ytm-btn {
    width: 36px;
    height: 36px;
  }
  .ytm-play {
    width: 40px;
    height: 40px;
  }
}

.full-screen .radio-root {
  display: none;
}
.full-screen.has-radio .app {
  padding-bottom: 0;
}
