/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Video Layout
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

[data-media-player] .vds-video-layout:not([data-match]) {
  display: none !important;
}

[data-media-player][data-layout='video'] {
  background-color: var(--video-bg, black);
}

[data-media-player][data-layout='video']:not([data-fullscreen]) {
  border-radius: var(--video-border-radius, 6px);
  border: var(--video-border, 1px solid rgb(255 255 255 / 0.1));
}

:where(.vds-video-layout) {
  --media-brand: var(--video-brand, #f5f5f5);
  --media-font-family: var(--video-font-family, sans-serif);
  --media-controls-color: var(--video-controls-color, #f5f5f5);
  --media-tooltip-y-offset: 6px;
  --media-menu-y-offset: 6px;
  --media-focus-ring-color: var(--video-focus-ring-color, rgb(78 156 246));
  --media-focus-ring: var(--video-focus-ring, 0 0 0 3px var(--media-focus-ring-color));
  color: var(--video-controls-color, #f5f5f5);
  display: contents;
}

:where([data-media-player][data-focus]:not([data-playing]) .vds-video-layout .vds-controls) {
  border-radius: var(--video-border-radius, 6px);
  box-shadow: var(--media-focus-ring);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Controls
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-controls[data-visible]) {
  border-radius: var(--video-border-radius, 6px);
  background-image: linear-gradient(
    to top,
    rgb(0 0 0 / 0.6),
    10%,
    transparent,
    95%,
    rgb(0 0 0 / 0.3)
  );
}

.vds-video-layout .vds-controls-group {
  align-items: center;
  display: flex;
  pointer-events: auto;
  z-index: 0;
  padding: 4px 6px;
}

.vds-video-layout .vds-controls-group:first-child {
  z-index: 50;
}

/* second last group */
.vds-video-layout .vds-controls-group:nth-last-child(2) {
  padding: 0 12px;
  z-index: 11;
  margin-bottom: -16px;
}

.vds-video-layout:not([data-sm]) .vds-controls-group:last-child {
  --media-menu-y-offset: 26px;
  --media-tooltip-y-offset: 26px;
  --media-slider-preview-offset: 26px;
  z-index: 10;
}

:where(.vds-video-layout .vds-button) {
  margin-right: 2.5px;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Title
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout[data-sm] .vds-chapter-title) {
  font-size: var(--video-sm-chapter-title-font-size, 15px);
}

:where([data-fullscreen] .vds-video-layout .vds-chapter-title) {
  font-size: var(--video-fullscreen-chapter-title-font-size, 16px);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Buttons
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout:not([data-sm]) .vds-mute-button) {
  margin-left: -2.5px;
  margin-right: -5px;
}

:where(.vds-video-layout[data-sm]) {
  --media-button-size: var(--video-sm-button-size, 36px);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Sliders
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-time-slider) {
  --media-slider-height: 45px;
  flex-grow: 0;
}

:where(.vds-video-layout .vds-slider-thumbnail) {
  --media-thumbnail-border: var(--video-slider-thumbnail-border, 1px solid #f5f5f5);
  border-radius: var(--video-slider-thumbnail-border-radius, 2px);
}

.vds-video-layout .vds-time-slider .vds-slider-value {
  background-color: var(--video-time-bg, unset);
  text-shadow:
    -1px -1px 0 #333333,
    1px -1px 0 #333333,
    -1px 1px 0 #333333,
    1px 1px 0 #333333;
}

:where(.vds-video-layout[data-sm] .vds-time) {
  text-shadow: unset;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Large Layout Volume Slider
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout[data-lg] .vds-volume) {
  --gap: var(--video-volume-gap, 10px);
  display: contents;
}

:where(.vds-video-layout[data-lg] .vds-volume-popup) {
  display: contents;
}

:where(.vds-video-layout[data-lg] .vds-volume-slider) {
  margin: 0;
  max-width: 0;
  transition: all 0.15s ease;
}

:where(.vds-video-layout[data-lg] .vds-volume[data-active] .vds-volume-slider),
:where(.vds-video-layout[data-lg] .vds-volume:has([data-active]) .vds-volume-slider) {
  margin-left: var(--gap);
  opacity: 1;
  visibility: visible;
  max-width: var(--video-volume-slider-max-width, 72px);
}

/* safe area. */
.vds-video-layout[data-lg] .vds-volume-slider::after {
  content: '';
  position: fixed;
  top: 0;
  left: calc(-1 * var(--gap));
  width: var(--gap);
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Small Layout Volume Slider
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout[data-sm] .vds-volume) {
  --media-slider-height: var(--video-volume-height, 96px);
  --media-slider-preview-offset: calc(-200% - 6px);
  --gap: var(--video-volume-gap, 10px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(.vds-video-layout[data-sm] .vds-volume-popup) {
  display: block;
  position: absolute;
  top: calc(100% + var(--gap));
  left: 50%;
  opacity: 0;
  transform: translateX(-50%);
  transition:
    opacity 150ms ease-out,
    visibility 150ms ease-out;
  border-radius: var(--video-volume-border-radius, 8px);
  filter: var(--media-volume-filter, drop-shadow(0 1px 1px rgb(0 0 0 / 0.05)));
  visibility: hidden;
}

/* safe area. */
.vds-video-layout[data-sm] .vds-mute-button::after {
  content: '';
  position: fixed;
  bottom: calc(-1 * var(--gap));
  right: 0;
  width: 100%;
  height: var(--gap);
  z-index: 1;
  pointer-events: auto;
}

.vds-video-layout .vds-volume-popup {
  background-color: var(--video-volume-bg, var(--media-menu-bg, var(--default-bg)));
  border: var(--video-volume-border, var(--default-border));
}

.light .vds-video-layout .vds-volume-popup,
.vds-video-layout.light .vds-volume-popup {
  --default-bg: rgb(250 250 250);
  --default-border: 1px solid rgb(10 10 10 / 0.1);
}

.dark .vds-video-layout .vds-volume-popup,
.vds-video-layout.dark .vds-volume-popup {
  --default-bg: rgb(10 10 10);
  --default-border: 1px solid rgb(255 255 255 / 0.1);
}

:where(.vds-video-layout[data-sm] .vds-volume[data-active] .vds-volume-popup),
:where(.vds-video-layout[data-sm] .vds-volume:has([data-active]) .vds-volume-popup) {
  transition:
    opacity 150ms ease-in,
    visibility 150ms ease-in;
  opacity: 1;
  visibility: visible;
}

:where(.vds-video-layout[data-sm] .vds-volume[data-active] .vds-tooltip-content) {
  display: none !important;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Time
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-time[data-type='current']) {
  margin-right: 2px;
}

:where(.vds-video-layout .vds-time[data-type='current'][remainder]) {
  margin-left: 2px;
}

.vds-video-layout .vds-time {
  --default-color: #f5f5f5 !important;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Captions
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where([data-preview] .vds-video-layout .vds-captions) {
  opacity: 0;
}

:where(.vds-video-layout .vds-captions) {
  z-index: 10;
  transition: var(--video-captions-transition, bottom 0.3s ease-in-out);
}

@media (min-width: 980px) {
  :where([data-fullscreen] .vds-video-layout .vds-captions) {
    bottom: var(--video-lg-fullscreen-captions-offset, 54px);
  }
}

:where([data-media-player][data-controls] .vds-video-layout .vds-captions) {
  bottom: var(--video-captions-offset, 78px);
}

:where([data-media-player][data-controls] .vds-video-layout[data-sm] .vds-captions) {
  bottom: var(--video-sm-captions-offset, 48px);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Chapters
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-time-slider .vds-slider-chapter-title) {
  width: 100%;
  text-align: center;
  text-shadow:
    -1px -1px 0 #212121,
    1px -1px 0 #212121,
    -1px 1px 0 #212121,
    1px 1px 0 #212121;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Gestures
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-gesture) {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

:where(.vds-video-layout .vds-gesture[action='seek:-10']) {
  width: var(--video-gesture-seek-width, 20%);
  z-index: 1;
}

:where(.vds-video-layout .vds-gesture[action='seek:10']) {
  left: unset;
  right: 0;
  width: var(--video-gesture-seek-width, 20%);
  z-index: 1;
}

@media (pointer: coarse) {
  :where(.vds-video-layout .vds-gesture[action='toggle:paused']) {
    display: none;
  }
}

@media not (pointer: coarse) {
  :where([data-media-player] .vds-video-layout .vds-gesture[action='toggle:controls']) {
    display: none;
  }
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Live Button
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-live-button) {
  margin-left: 12px;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Time Group
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout:not([data-sm]) .vds-time-group) {
  margin-left: 10px;
}

:where(.vds-video-layout[data-sm] .vds-time) {
  font-size: var(--video-sm-time-font-size, 14px);
}

:where([data-fullscreen] .vds-video-layout .vds-time) {
  font-size: var(--video-fullscreen-time-font-size, 16px);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Load Container
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout .vds-load-container) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 99;
}

:where(
  [data-media-player][data-load='play']:not([data-started])
    .vds-video-layout[data-match]
    .vds-load-container
) {
  display: flex;
}

:where(.vds-video-layout .vds-load-container .vds-play-button) {
  --size: var(--video-load-button-size, 56px);
  --color: var(--video-load-button-color, rgb(0 0 0 / 0.8));
  --bg-color: var(--video-load-button-bg, var(--media-brand));

  --media-button-hover-transform: 0;
  --media-button-border: var(--video-load-button-border, var(--color));
  --media-button-hover-bg: var(--video-load-button-bg, var(--media-brand));

  width: var(--size);
  height: var(--size);
  pointer-events: auto;
  margin-bottom: 2px;
  overflow: hidden;
}

.vds-video-layout .vds-load-container .vds-play-button {
  border-radius: var(--video-load-button-border-radius, 100%);
  color: var(--color);
}

.vds-video-layout .vds-load-container .vds-play-button {
  background-color: var(--bg-color);
}

:where(.vds-video-layout[data-sm] .vds-load-container .vds-play-button) {
  --size: var(--video-sm-load-button-size, 48px);
  --media-button-hover-transform: translateY(0%);
  width: var(--size);
  height: var(--size);
  transform: translateY(0%);
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Small Layout
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where(.vds-video-layout[data-sm] .vds-controls-group:nth-last-child(2)) {
  pointer-events: none;
}

:where(.vds-video-layout[data-sm] .vds-controls-group:last-child) {
  z-index: 2;
  margin-top: -2.5px;
  margin-bottom: -6px;
}

:where([data-fullscreen] .vds-video-layout[data-sm] .vds-controls-group:last-child) {
  margin-bottom: 0;
}

.vds-video-layout[data-sm] .vds-controls-group {
  padding: 2px;
}

:where(.vds-video-layout[data-sm])
  :where(
    .vds-button,
    .vds-slider:not(.vds-time-slider),
    .vds-time,
    .vds-time-divider,
    .vds-chapter-title
  ) {
  transition: opacity 0.15s ease;
}

:where([data-media-player]:not([data-started]) .vds-video-layout[data-sm])
  :where(.vds-button .vds-slider, .vds-time-group) {
  opacity: 0;
  visibility: hidden;
}

:where(.vds-video-layout[data-sm] .vds-time-slider) {
  transition: transform 0.1s linear;
}

@media (pointer: coarse) {
  :where([data-preview] .vds-video-layout:not([data-no-scrub-gesture]))
    :where(
      .vds-button,
      .vds-slider:not(.vds-time-slider),
      .vds-time,
      .vds-chapter-title,
      .vds-time-divider,
      .vds-captions,
      .vds-live-button
    ) {
    opacity: 0;
  }

  :where([data-preview] .vds-video-layout:not([data-no-scrub-gesture]) .vds-time-slider) {
    --track-height: var(--video-sm-slider-focus-track-height, 12px);
    transform: translateY(-6px);
    transition: transform 0.1s linear;
  }
}

:where(.vds-video-layout[data-sm] .vds-controls .vds-play-button) {
  --size: var(--video-sm-play-button-size, 45px);
  --media-button-hover-transform: translateY(25%);
  width: var(--size);
  height: var(--size);
  transform: translateY(25%);
  border-radius: 100%;
  pointer-events: auto;
  margin-bottom: 2px;
  overflow: hidden;
}

.vds-video-layout[data-sm] .vds-controls .vds-play-button {
  background-color: var(--video-sm-play-button-bg, rgba(0 0 0 / 0.6));
}

:where(
  [data-media-player]:not([data-started])
    .vds-video-layout[data-sm]
    .vds-controls-group:not(:nth-child(3))
) {
  opacity: 0;
  visibility: hidden;
}

/* center big play button inside buffering indicator. */
:where(.vds-video-layout[data-sm] .vds-buffering-indicator) {
  --media-buffering-size: 64px;
  transform: translate(-2px, -4px);
}

:where(.vds-video-layout .vds-start-duration .vds-time) {
  position: absolute;
  right: 8px;
  bottom: 8px;
  margin-right: 8px;
  margin-bottom: 8px;
  z-index: 10;
}

.vds-video-layout .vds-start-duration .vds-time {
  padding: var(--video-sm-start-duration-padding, 3px 6px);
  color: var(--video-sm-start-duration-color, var(--video-controls-color));
  background-color: var(--video-sm-start-duration-bg, rgba(0 0 0 / 0.64));
}

:where([data-started] .vds-video-layout .vds-start-duration .vds-time) {
  display: none;
}

:where([data-media-player]:not([data-can-play]) .vds-video-layout .vds-start-duration .vds-time) {
  opacity: 0;
}

:where(.vds-video-layout[data-sm] .vds-time[data-type='current']) {
  margin-left: 8px;
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Fullscreen
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

:where([data-fullscreen] .vds-video-layout .vds-controls-group:nth-last-child(2)) {
  margin-bottom: -16px;
}

@media (orientation: portrait) {
  :where([data-fullscreen] .vds-video-layout .vds-captions) {
    bottom: 30lvh;
    bottom: 10dvh;
  }
}

@media (orientation: landscape) {
  :where([data-fullscreen] .vds-video-layout .vds-controls-group:nth-last-child(2)) {
    margin-bottom: -12px;
  }
}

/*
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Notflix Modern Rework — Balanced, Clean, Proportional
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

/* --- Bottom controls group wrapper --- */
.vds-video-layout .vds-controls-group-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 8px;
}

/* --- All buttons: circular, no boxy look --- */
:where(.vds-video-layout .vds-button) {
  border-radius: 50%;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

/* --- Buttons in bottom bar: balanced 40px --- */
:where(.vds-video-layout .vds-controls-group-bottom .vds-button) {
  --media-button-size: 40px;
  --media-button-icon-size: 22px;
  background: transparent;
  border-radius: 50%;
  margin: 0;
}

@media (hover: hover) and (pointer: fine) {
  .vds-video-layout .vds-controls-group-bottom .vds-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }
}

/* --- Play button: slightly bigger than the rest --- */
:where(.vds-video-layout .vds-controls-group-bottom .vds-play-button) {
  --media-button-size: 44px;
  --media-button-icon-size: 26px;
}

/* --- Seek buttons --- */
:where(.vds-video-layout .vds-controls-group-bottom .vds-seek-button) {
  --media-button-size: 38px;
  --media-button-icon-size: 20px;
}

/* --- Episode button: same row, same size --- */
.vds-video-layout .vds-episode-button {
  --media-button-size: 40px;
  --media-button-icon-size: 22px;
  border-radius: 50%;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .vds-video-layout .vds-episode-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }
}

/* --- Scrim: cinematic gradient --- */
:where(.vds-video-layout .vds-scrim) {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.2) 20%,
    transparent 45%,
    transparent 80%,
    rgba(0, 0, 0, 0.15) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

:where([data-media-player][data-controls] .vds-video-layout .vds-scrim) {
  opacity: 1;
}

/* --- Menu: glassmorphism, rounded --- */
:where(.vds-video-layout .vds-menu-items[data-root]) {
  --root-border-radius: 12px;
  --item-border-radius: 8px;
  border-radius: 12px;
  backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(15, 15, 15, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

:where(.vds-video-layout .vds-menu-item, .vds-video-layout .vds-radio) {
  border-radius: 8px;
  transition: background-color 0.12s ease;
}

/* --- Slider: slightly thicker than default — more grippable --- */
:where(.vds-video-layout .vds-time-slider) {
  --media-slider-height: 44px;
  --media-slider-track-height: 4px;
  --media-slider-track-focus-height: 6px;
}

:where(.vds-video-layout .vds-slider-track) {
  border-radius: 9999px;
}

:where(.vds-video-layout .vds-slider-track-fill) {
  border-radius: 9999px;
}

/* --- Tooltip: compact pill --- */
:where(.vds-video-layout .vds-tooltip-content) {
  border-radius: 8px;
  backdrop-filter: blur(10px);
  background-color: rgba(20, 20, 20, 0.92);
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  letter-spacing: 0.01em;
}

/* --- Time text --- */
:where(.vds-video-layout .vds-time) {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* --- Caption flag slot --- */
:where(.vds-video-layout .vds-caption-radio) {
  display: flex;
  align-items: center;
  gap: 8px;
}

:where(.vds-video-layout .vds-caption-radio .vds-caption-flag) {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

/* --- Small (mobile) layout --- */
.vds-video-layout[data-sm] .vds-controls-group-bottom .vds-button {
  --media-button-size: 36px;
  --media-button-icon-size: 20px;
}

.vds-video-layout[data-sm] .vds-controls-group-bottom .vds-play-button {
  --media-button-size: 40px;
  --media-button-icon-size: 24px;
}

.vds-video-layout[data-sm] .vds-controls-group-bottom .vds-seek-button {
  --media-button-size: 34px;
  --media-button-icon-size: 18px;
}

/* --- Episodes fullscreen sidebar --- */
.vds-video-layout .vds-episodes-backdrop {
  position: absolute;
  inset: 0;
  z-index: 19;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  background: linear-gradient(90deg, rgb(0 0 0 / 0%) 56%, rgb(0 0 0 / 42%) 100%);
}

.vds-video-layout .vds-episodes-backdrop[data-open='true'] {
  opacity: 1;
  pointer-events: auto;
}

.vds-video-layout .vds-episodes-panel {
  position: absolute;
  top: 50%;
  right: max(16px, 1.5vw);
  width: min(34vw, 400px);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(180deg, rgb(12 12 12 / 96%) 0%, rgb(6 6 6 / 94%) 100%);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 14px;
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 24px 48px rgb(0 0 0 / 55%),
    inset 0 1px 0 rgb(255 255 255 / 6%);
  z-index: 20;
  opacity: 0;
  transform: translate3d(16px, -50%, 0);
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.26s ease;
  filter: blur(2px);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 28%) transparent;
}

.vds-video-layout .vds-episodes-panel[data-open='true'] {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
  pointer-events: auto;
  filter: blur(0);
}

.vds-video-layout .vds-episodes-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 13px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgb(12 12 12 / 98%), rgb(10 10 10 / 88%));
  backdrop-filter: blur(10px);
}

.vds-video-layout .vds-episodes-close-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / 78%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.vds-video-layout .vds-episodes-close-btn:hover {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

.vds-video-layout .vds-episodes-panel-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.vds-video-layout .vds-episodes-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 10px 10px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 28%) transparent;
}

/* Each row must keep its full height — min-height:0 on items was collapsing rows and stacking text. */
.vds-video-layout .vds-episodes-list > .vds-episode-item {
  flex: 0 0 auto;
}

.vds-video-layout .vds-episodes-empty {
  padding: 12px;
  font-size: 12px;
  color: rgb(255 255 255 / 72%);
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  -webkit-appearance: none;
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
  -webkit-appearance: none;
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-button:single-button {
  display: none;
  width: 0;
  height: 0;
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 12%);
  background: linear-gradient(180deg, rgb(255 255 255 / 30%) 0%, rgb(255 255 255 / 16%) 100%);
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-thumb:hover {
  border-color: rgb(255 255 255 / 20%);
  background: linear-gradient(180deg, rgb(255 255 255 / 42%) 0%, rgb(255 255 255 / 24%) 100%);
}

.vds-video-layout .vds-episodes-panel::-webkit-scrollbar-corner {
  background: transparent;
}

.vds-video-layout .vds-episodes-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  -webkit-appearance: none;
}

.vds-video-layout .vds-episodes-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.vds-video-layout .vds-episodes-list::-webkit-scrollbar-button,
.vds-video-layout .vds-episodes-list::-webkit-scrollbar-button:single-button {
  display: none;
  width: 0;
  height: 0;
  -webkit-appearance: none;
}

.vds-video-layout .vds-episodes-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 12%);
  background: linear-gradient(180deg, rgb(255 255 255 / 30%) 0%, rgb(255 255 255 / 16%) 100%);
}

.vds-video-layout .vds-episodes-list::-webkit-scrollbar-thumb:hover {
  border-color: rgb(255 255 255 / 20%);
  background: linear-gradient(180deg, rgb(255 255 255 / 42%) 0%, rgb(255 255 255 / 24%) 100%);
}

.vds-video-layout .vds-episode-item {
  display: grid !important;
  grid-template-columns: 148px minmax(0, 1fr) !important;
  grid-template-rows: auto;
  align-items: start;
  align-content: start;
  width: 100%;
  min-height: min-content;
  box-sizing: border-box;
  gap: 12px;
  padding: 10px 10px 10px 8px;
  border-radius: 10px;
  border: 1px solid rgb(255 255 255 / 6%);
  background: rgb(255 255 255 / 3%);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.vds-video-layout .vds-episode-item:hover {
  background: rgb(255 255 255 / 6%);
  border-color: rgb(255 255 255 / 10%);
}

.vds-video-layout .vds-episode-item[data-active='true'] {
  cursor: default;
  background: linear-gradient(135deg, rgb(229 9 20 / 14%) 0%, rgb(255 255 255 / 5%) 100%);
  border-color: rgb(229 9 20 / 45%);
  box-shadow: inset 3px 0 0 #e50914;
}

.vds-video-layout .vds-episode-item:not([data-active='true']) {
  cursor: pointer;
}

.vds-video-layout .vds-episode-item[data-active='true'] .vds-episode-thumb {
  filter: brightness(0.88);
}

.vds-video-layout .vds-episode-item[data-active='true'] .vds-episode-label {
  color: #ffb4b4;
}

.vds-video-layout .vds-episode-item:focus-visible {
  outline: 2px solid rgb(255 255 255 / 45%);
  outline-offset: 1px;
}

.vds-video-layout .vds-episode-item[data-active='true']:focus-visible {
  outline-color: rgb(229 9 20 / 55%);
}

.vds-video-layout .vds-episode-meta-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.vds-video-layout .vds-episode-now-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e50914;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.2;
}

.vds-video-layout .vds-episode-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: rgb(255 255 255 / 22%);
}

.vds-video-layout .vds-episode-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e50914 0%, #ff4d4d 100%);
  transition: width 0.35s linear;
}

.vds-video-layout .vds-episode-thumb {
  display: block;
  width: 148px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  background: #151515;
  border: 1px solid rgb(255 255 255 / 10%);
}

.vds-video-layout .vds-episode-thumb-wrap {
  position: relative;
  width: 148px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  align-self: start;
}

.vds-video-layout .vds-episode-thumb-placeholder {
  background: linear-gradient(125deg, rgb(255 255 255 / 6%), rgb(255 255 255 / 2%));
}

.vds-video-layout .vds-episode-body {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: start;
  gap: 5px;
  padding-top: 1px;
}

.vds-video-layout .vds-episode-title,
.vds-video-layout .vds-episode-subtitle {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vds-video-layout .vds-episode-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vds-video-layout .vds-episode-meta-row .vds-episode-runtime {
  flex-shrink: 0;
  margin-top: 1px;
}

.vds-video-layout .vds-episode-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e50914;
}

.vds-video-layout .vds-episode-runtime {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgb(255 255 255 / 72%);
}

.vds-video-layout .vds-episode-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.28;
}

.vds-video-layout .vds-episode-subtitle {
  margin-top: 1px;
  font-size: 12px;
  color: rgb(255 255 255 / 82%);
}

.vds-video-layout .vds-episode-desc {
  margin: 0;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
  color: rgb(255 255 255 / 68%);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  min-height: 0;
}

@media (max-width: 640px) {
  .vds-video-layout[data-sm] .vds-controls .vds-play-button {
    --media-button-size: 38px;
    --media-button-icon-size: 22px;
    transform: translateY(0);
    margin-bottom: 0;
  }

  .vds-video-layout .vds-episodes-backdrop {
    background: linear-gradient(180deg, rgb(0 0 0 / 18%) 0%, rgb(0 0 0 / 52%) 100%);
  }

  .vds-video-layout .vds-episodes-panel {
    left: 8px;
    right: 8px;
    width: auto;
    top: auto;
    bottom: 56px;
    max-height: min(64vh, 520px);
    border-radius: 12px;
    transform: translate3d(0, 10px, 0);
  }

  .vds-video-layout .vds-episodes-panel[data-open='true'] {
    transform: translate3d(0, 0, 0);
  }

  .vds-video-layout .vds-episode-item {
    grid-template-columns: 116px minmax(0, 1fr) !important;
    min-height: 84px;
    gap: 10px;
    padding: 8px 0;
  }

  .vds-video-layout .vds-episode-thumb {
    width: 116px;
    height: 66px;
  }

  .vds-video-layout .vds-episode-thumb-wrap {
    width: 116px;
    height: 66px;
  }
}
