/* Keep the reference slot sizes and margins. The two SVG layers share one
   cell so a pause can show the still without resetting the animated phase. */
.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode] {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}

.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode] > svg.ym-player-art {
  --ym-ink: #b9b9b9;
  --ym-surface: #202020;
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  /* Every supplied SVG keeps its own viewBox and xMidYMid meet. Filling the
     existing viewport fits its geometry uniformly, without axis stretching. */
  stroke: none;
  pointer-events: none;
}

.pullupSlider[data-ym-player-cards][data-bg="grey"] .item-icon[data-ym-player-mode] > svg.ym-player-art {
  --ym-ink: #202020;
  --ym-surface: #b9b9b9;
}

.pullupSlider[data-ym-player-cards][data-bg="orange"] .item-icon[data-ym-player-mode] > svg.ym-player-art,
.pullupSlider[data-ym-player-cards] .pullupSlider-item:hover .item-icon[data-ym-player-mode] > svg.ym-player-art {
  --ym-ink: #202020;
  --ym-surface: #ff5841;
}

/* Opaque front faces hide the rear edges and follow the card's own transition. */
.pullupSlider[data-ym-player-cards] .ym-player-art .ym-face {
  transition: fill .2s ease-in-out;
}

/* Keep both native SVGs in one cell. Visibility and play-state preserve the
   supplied 8.4 s phase; popup deliberately restarts at its open frame on entry.
   No fetch, DOM replacement or display:none on hover. */
:where(.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode]) > svg[data-ym-player-animation] {
  visibility: hidden;
}

:where(.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode]) > svg[data-ym-player-animation],
:where(.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode]) > svg[data-ym-player-animation] * {
  animation-play-state: paused !important;
}

/* The popup is fully open from 29% to 68%. Offset every part together to 30%
   so the first animated frame matches its visible still, including re-entry. */
.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode="popup"] > svg[data-ym-player-animation] * {
  animation-delay: -2.52s;
}

/* Like the Music / Radio cards, intentional hover opts into motion. The
   supplied SVGs still respect reduced motion outside these marked cards. */
@media (any-hover: hover) {
  :where(.pullupSlider[data-ym-player-cards] .pullupSlider-item:hover .item-icon[data-ym-player-mode]:not([data-ym-player-touch])) > svg[data-ym-player-fallback] {
    visibility: hidden;
  }

  :where(.pullupSlider[data-ym-player-cards] .pullupSlider-item:hover .item-icon[data-ym-player-mode]:not([data-ym-player-touch])) > svg[data-ym-player-animation] {
    visibility: visible;
  }

  :where(.pullupSlider[data-ym-player-cards] .pullupSlider-item:hover .item-icon[data-ym-player-mode]:not([data-ym-player-touch])) > svg[data-ym-player-animation],
  :where(.pullupSlider[data-ym-player-cards] .pullupSlider-item:hover .item-icon[data-ym-player-mode]:not([data-ym-player-touch])) > svg[data-ym-player-animation] * {
    animation-play-state: running !important;
  }
}

/* Two attributes outrank the one-attribute hover rule, including when the
   cursor stays over a card as its page is hidden or scrolled offscreen. */
:where(.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode]) > svg[data-ym-player-animation][data-ym-paused="true"],
:where(.pullupSlider[data-ym-player-cards] .item-icon[data-ym-player-mode]) > svg[data-ym-player-animation][data-ym-paused="true"] * {
  animation-play-state: paused !important;
}
