/* Soluce playlist — tout sur PlayJoystick (desktop + mobile) */

.sv-ytpl-wrap {
  width: min(var(--gh-width, 1120px), calc(100% - 40px));
  margin: 0 auto 22px;
  padding: 0;
  box-sizing: border-box;
}

.sv-ytpl {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--nx-line);
  background: color-mix(in srgb, var(--nx-bg) 78%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  color: var(--nx-ink);
}

html[data-theme="light"] .sv-ytpl {
  background: var(--nx-bg-2);
  box-shadow: 0 12px 32px rgba(20, 20, 35, 0.08);
}

.sv-ytpl__stage {
  background: var(--nx-bg-2);
  padding: 1rem 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sv-ytpl__cover {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--nx-line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.sv-ytpl__player.nx-media--yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sv-ytpl__player.nx-media--yt .nx-media__hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.sv-ytpl__player.nx-media--yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sv-ytpl__player.nx-media--yt.is-playing {
  background: #000;
}

.sv-ytpl__player.nx-media--yt.is-playing iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sv-ytpl__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.3;
  font-weight: 700;
  color: var(--nx-ink);
}

.sv-ytpl__by {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--nx-ink);
}

.sv-ytpl__stats,
.sv-ytpl__desc,
.sv-ytpl__item-channel,
.sv-ytpl__idx {
  color: color-mix(in srgb, var(--nx-ink) 58%, transparent);
}

.sv-ytpl__stats {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
}

.sv-ytpl__desc {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sv-ytpl__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.sv-ytpl__playall {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.45rem;
  padding: 0.45rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--nx-accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

.sv-ytpl__playall::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent currentColor;
}

.sv-ytpl__playall:hover {
  filter: brightness(1.08);
}

.sv-ytpl__open {
  display: inline-flex;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--nx-line);
  background: var(--nx-bg-2);
  color: var(--nx-ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.8125rem;
}

.sv-ytpl__open:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent);
}

.sv-ytpl__rail {
  background: var(--nx-bg);
  border-top: 1px solid var(--nx-line);
  display: flex;
  flex-direction: column;
}

.sv-ytpl__list {
  list-style: none;
  margin: 0;
  padding: 0.45rem 0.4rem 0.85rem;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--nx-ink) 30%, transparent) transparent;
}

.sv-ytpl__item {
  width: 100%;
  display: grid;
  grid-template-columns: 1.5rem 9rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sv-ytpl__item:hover,
.sv-ytpl__item:focus-visible {
  background: color-mix(in srgb, var(--nx-ink) 6%, transparent);
  outline: none;
}

.sv-ytpl__item.is-active {
  background: color-mix(in srgb, var(--nx-accent) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nx-accent) 40%, transparent);
}

.sv-ytpl__idx {
  font-size: 0.75rem;
  padding-top: 1.9rem;
  text-align: center;
}

.sv-ytpl__item.is-active .sv-ytpl__idx {
  color: var(--nx-accent);
  font-weight: 700;
}

.sv-ytpl__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--nx-ink) 8%, transparent);
  border: 1px solid var(--nx-line);
}

.sv-ytpl__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sv-ytpl__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.sv-ytpl__item-title {
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--nx-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sv-ytpl__item-channel {
  font-size: 0.75rem;
}

/* Mobile : player sticky + liste complète scrollable (tout sur PJ) */
@media (max-width: 959px) {
  .sv-ytpl-wrap {
    width: calc(100% - 24px);
  }

  .sv-ytpl {
    overflow: visible;
  }

  .sv-ytpl__stage {
    position: sticky;
    top: var(--nx-header, 56px);
    z-index: 6;
    padding: 0.75rem 0.75rem 0.7rem;
    gap: 0.55rem;
    border-bottom: 1px solid var(--nx-line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }

  /* Sous le titre : pas d’Adwuin / stats / boutons */
  .sv-ytpl__by,
  .sv-ytpl__stats,
  .sv-ytpl__desc,
  .sv-ytpl__actions,
  .sv-ytpl__item-channel {
    display: none !important;
  }

  .sv-ytpl__meta {
    margin: 0;
  }

  .sv-ytpl__title {
    font-size: 1rem;
    margin: 0;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .sv-ytpl__rail {
    max-height: none;
    border-top: 0;
  }

  .sv-ytpl__list {
    max-height: none;
    overflow: visible;
    padding: 0.35rem 0.35rem 1rem;
  }

  .sv-ytpl__item {
    grid-template-columns: 1.35rem 5.75rem 1fr;
    gap: 0.45rem;
    padding: 0.45rem 0.4rem;
    min-height: 3.4rem;
    align-items: center;
  }

  .sv-ytpl__idx {
    padding-top: 0;
    font-size: 0.7rem;
  }

  .sv-ytpl__body {
    padding-top: 0;
    justify-content: center;
  }

  .sv-ytpl__item-title {
    font-size: 0.8125rem;
  }
}

@media (min-width: 960px) {
  .sv-ytpl {
    grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
    min-height: min(70vh, 40rem);
  }

  .sv-ytpl__stage {
    position: sticky;
    top: 0;
    max-height: min(70vh, 40rem);
    overflow: auto;
  }

  .sv-ytpl__rail {
    border-top: 0;
    border-left: 1px solid var(--nx-line);
    max-height: min(70vh, 40rem);
    overflow: hidden;
  }

  .sv-ytpl__list {
    overflow-y: auto;
  }

  .sv-ytpl__item {
    grid-template-columns: 1.6rem 10rem 1fr;
  }
}
