:root {
  --playerOverlayRgb: 0, 0, 0;
  --playerFrameRgb: 8, 8, 8;
  --playerPanelRgb: 0, 0, 0;
  --playerTextRgb: 255, 255, 255;
  --playerSubtitleRgb: 245, 245, 245;
  --playerAccentRgb: 245, 45, 42;
  --playerControlRgb: 255, 255, 255;
}

body.playerIsOpen {
  overflow: hidden;
}

#player_bg {
  position: fixed;
  inset: 0;
  z-index: 1000;
  box-sizing: border-box;
  display: none;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  padding: 5.8rem 2.6rem 3rem;
  vertical-align: top;
  background-color: rgba(var(--playerOverlayRgb), 0.9);
}

#player_bg *,
#player_bg *::before,
#player_bg *::after {
  box-sizing: border-box;
}

#player_bg.player_isOpen {
  display: block;
}

#player_bg:fullscreen,
#player_bg.player_fullScreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

#player_top {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 3.2rem;
  background-color: rgba(var(--playerPanelRgb), 0.58);
}

#player_top #player_close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
}

#player_frameBgGradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#player_frameBgGradient::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.07), transparent 45%);
  content: "";
  pointer-events: none;
}

#player_frame {
  position: relative;
  display: block;
  width: min(70rem, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  color: rgb(var(--playerTextRgb));
  background-color: rgb(var(--playerFrameRgb));
  border-radius: 0.75rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45), 0 0.2rem 1.1rem rgba(0, 0, 0, 0.28);
  outline: none !important;
}

#player_bg:fullscreen #player_frame,
#player_bg.player_fullScreen #player_frame {
  width: 100vw;
  max-width: none;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

#player_imageEl,
#player_videoEl,
#player_holdFrame,
#player_youtubeElement {
  position: absolute;
  inset: 0;
  display: inline-block;
  width: 100%;
  height: 100%;
  line-height: 0;
  outline: none !important;
}

#player_imageEl,
#player_videoEl,
#player_holdFrame {
  object-fit: contain;
  background-color: rgb(var(--playerPanelRgb)) !important;
}

#player_imageEl {
  display: none;
}

#player_holdFrame {
  z-index: 3;
  display: none;
  pointer-events: none;
}

#player_visualLayer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.playerVisualClick {
  position: absolute;
  z-index: 7;
  width: 2rem;
  height: 2rem;
  border: 0.18rem solid rgba(var(--playerControlRgb), 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 0.25rem rgba(var(--playerAccentRgb), 0.75), 0 0 0 0.55rem rgba(var(--playerAccentRgb), 0.22);
  transform: translate(-50%, -50%) scale(0.56);
  opacity: 0;
  pointer-events: none;
  animation: playerVisualClick 760ms ease-out forwards;
}

.playerVisualHighlight {
  position: absolute;
  z-index: 7;
  width: var(--playerHighlightStartSizePx, 22rem);
  height: var(--playerHighlightStartSizePx, 22rem);
  border: var(--playerHighlightStartBorderPx, 0.95rem) solid rgba(50, 129, 188, 0.96);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.34;
  pointer-events: none;
  animation: playerVisualHighlight 1300ms cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes playerVisualClick {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes playerVisualHighlight {
  0% {
    opacity: 0.34;
    width: var(--playerHighlightStartSizePx, 22rem);
    height: var(--playerHighlightStartSizePx, 22rem);
    border-width: var(--playerHighlightStartBorderPx, 0.95rem);
  }

  62% {
    width: var(--playerHighlightEndSizePx, 3.3rem);
    height: var(--playerHighlightEndSizePx, 3.3rem);
    border-width: var(--playerHighlightEndBorderPx, 0.32rem);
    opacity: 0.34;
  }

  100% {
    width: var(--playerHighlightEndSizePx, 3.3rem);
    height: var(--playerHighlightEndSizePx, 3.3rem);
    border-width: var(--playerHighlightEndBorderPx, 0.32rem);
    opacity: 0;
  }
}

#player_close,
.player_button,
#player_controlsBackground {
  font: inherit;
  cursor: pointer;
}

#player_close,
.player_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  color: rgba(var(--playerControlRgb), 0.78);
  text-align: center;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  outline: none !important;
  opacity: 0.82;
}

#player_close:hover,
.player_button:hover {
  color: rgb(var(--playerControlRgb));
  background-color: rgba(var(--playerControlRgb), 0.1);
  opacity: 1;
}

.player_buttonInert {
  display: none;
  pointer-events: none;
}

#player_controlsBackground {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
}

#player_controlsBackground::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5rem;
  background: linear-gradient(
    to top,
    hsla(0deg, 0%, 0%, 34%) 0%,
    hsla(0deg, 0%, 0%, 33.6%) 8.1%,
    hsla(0deg, 0%, 0%, 32.3%) 15.5%,
    hsla(0deg, 0%, 0%, 30.5%) 22.5%,
    hsla(0deg, 0%, 0%, 28%) 29%,
    hsla(0deg, 0%, 0%, 25.2%) 35.3%,
    hsla(0deg, 0%, 0%, 22%) 41.2%,
    hsla(0deg, 0%, 0%, 18.7%) 47.1%,
    hsla(0deg, 0%, 0%, 15.3%) 52.9%,
    hsla(0deg, 0%, 0%, 12%) 58.8%,
    hsla(0deg, 0%, 0%, 8.8%) 64.7%,
    hsla(0deg, 0%, 0%, 6%) 71%,
    hsla(0deg, 0%, 0%, 3.5%) 77.5%,
    hsla(0deg, 0%, 0%, 1.7%) 84.5%,
    hsla(0deg, 0%, 0%, 0.4%) 91.9%,
    hsla(0deg, 0%, 0%, 0%) 100%
  );
  content: "";
  pointer-events: none;
  transition: opacity 180ms ease;
}

.playerMiddleButton {
  display: none;
}

.playerMiddleButton::before {
  width: 0;
  height: 0;
  margin-left: 0.3rem;
  border-top: 0.86rem solid transparent;
  border-bottom: 0.86rem solid transparent;
  border-left: 1.34rem solid currentColor;
  content: "";
}

.playerMiddleButtonPause::before,
.playerMiddleButtonPause::after {
  width: 0.42rem;
  height: 1.45rem;
  margin: 0 0.17rem;
  background: currentColor;
  border: 0;
  border-radius: 999px;
  content: "";
}

#player_controls {
  position: absolute;
  right: 0.5rem;
  bottom: 0;
  left: 0.5rem;
  z-index: 8;
  display: flex;
  align-items: center;
  width: calc(100% - 1rem);
  height: 3.35rem;
  padding: 0.28rem 0 0.2rem;
  border-bottom-right-radius: 999px;
  border-bottom-left-radius: 999px;
  outline: none !important;
  opacity: 1;
  transition: opacity 180ms ease;
}

#player_bg.player_controlsHidden #player_controls,
#player_bg.player_controlsHidden #player_progress,
#player_bg.player_controlsHidden #player_progressTooltip,
#player_bg.player_controlsHidden #player_controlsBackground::after {
  opacity: 0;
  pointer-events: none;
}

#player_bg.player_isPlaying #player_play,
#player_bg:not(.player_isPlaying) #player_pause {
  display: none;
}

.playerButtonIcon {
  position: relative;
  display: block;
  width: 1.52rem;
  height: 1.52rem;
  color: currentColor;
  filter: drop-shadow(0 0 0.35rem rgba(0, 0, 0, 0.3));
}

.playerButtonImg {
  display: block;
  width: 1.58rem;
  height: 1.58rem;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 0.35rem rgba(0, 0, 0, 0.3));
  opacity: 0.88;
  pointer-events: none;
}

.playerButtonIconPlay::before {
  position: absolute;
  top: 0.16rem;
  left: 0.39rem;
  width: 0;
  height: 0;
  border-top: 0.51rem solid transparent;
  border-bottom: 0.51rem solid transparent;
  border-left: 0.76rem solid currentColor;
  content: "";
}

.playerButtonIconPause::before,
.playerButtonIconPause::after {
  position: absolute;
  top: 0.2rem;
  width: 0.3rem;
  height: 0.94rem;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.playerButtonIconPause::before {
  left: 0.34rem;
}

.playerButtonIconPause::after {
  right: 0.34rem;
}

.playerButtonIconSkipBack::before,
.playerButtonIconSkipBack::after,
.playerButtonIconSkipForward::before,
.playerButtonIconSkipForward::after {
  position: absolute;
  top: 0.25rem;
  width: 0;
  height: 0;
  border-top: 0.32rem solid transparent;
  border-bottom: 0.32rem solid transparent;
  content: "";
}

.playerButtonIconSkipBack::before {
  left: 0.12rem;
  border-right: 0.46rem solid currentColor;
}

.playerButtonIconSkipBack::after {
  left: 0.48rem;
  border-right: 0.46rem solid currentColor;
}

.playerButtonIconSkipForward::before {
  right: 0.48rem;
  border-left: 0.46rem solid currentColor;
}

.playerButtonIconSkipForward::after {
  right: 0.12rem;
  border-left: 0.46rem solid currentColor;
}

.playerButtonIconFullscreen::before {
  position: absolute;
  inset: 0.12rem;
  border: 0.14rem solid currentColor;
  border-radius: 0.08rem;
  content: "";
}

.playerButtonIconClose::before,
.playerButtonIconClose::after {
  position: absolute;
  top: 0.18rem;
  left: 0.51rem;
  width: 0.16rem;
  height: 0.8rem;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.playerButtonIconClose::before {
  transform: rotate(45deg);
}

.playerButtonIconClose::after {
  transform: rotate(-45deg);
}

.playerButtonIconSound::before {
  position: absolute;
  top: 0.34rem;
  left: 0.1rem;
  width: 0.38rem;
  height: 0.42rem;
  background: currentColor;
  clip-path: polygon(0 25%, 42% 25%, 100% 0, 100% 100%, 42% 75%, 0 75%);
  content: "";
}

.playerButtonIconSound::after {
  position: absolute;
  top: 0.23rem;
  left: 0.62rem;
  width: 0.34rem;
  height: 0.66rem;
  border: 0.13rem solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  content: "";
}

.playerButtonIconSide::before {
  position: absolute;
  inset: 0.16rem;
  border: 0.13rem solid currentColor;
  border-radius: 0.1rem;
  content: "";
}

.playerButtonIconSide::after {
  position: absolute;
  top: 0.16rem;
  right: 0.28rem;
  bottom: 0.16rem;
  width: 0.13rem;
  background: currentColor;
  content: "";
}

.playerButtonIconMore::before,
.playerButtonIconMore::after,
.playerButtonIconMore {
  border-radius: 50%;
}

.playerButtonIconMore {
  width: 0.24rem;
  height: 0.24rem;
  background: currentColor;
  box-shadow: 0 0.39rem 0 currentColor, 0 -0.39rem 0 currentColor;
}

#player_counter,
#player_playbackSpeed {
  display: inline-flex;
  align-items: center;
  height: 2.8rem;
  overflow: hidden;
  color: rgba(var(--playerControlRgb), 0.72);
  font-size: 1rem;
  font-weight: 650;
  line-height: 2.8rem;
  white-space: nowrap;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

#player_counter {
  flex: 1;
  padding: 0 0.45rem;
  cursor: default;
}

#player_playbackSpeed {
  justify-content: center;
  width: 3.2rem;
  font-family: inherit;
  cursor: pointer;
}

#player_progress {
  --playerProgressPcnt: 0%;
  position: absolute;
  right: 0.5rem;
  bottom: 3.02rem;
  left: 0.5rem;
  z-index: 9;
  display: block;
  width: calc(100% - 1rem);
  height: 1.12rem;
  padding: 0.58rem 0 0.28rem;
  margin: 0;
  background: linear-gradient(
    to right,
    rgb(var(--playerAccentRgb)) 0%,
    rgb(var(--playerAccentRgb)) var(--playerProgressPcnt),
    rgba(var(--playerControlRgb), 0.34) var(--playerProgressPcnt),
    rgba(var(--playerControlRgb), 0.34) 100%
  );
  background-clip: content-box;
  border: 0;
  border-radius: 0;
  outline: none !important;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  opacity: 1;
  transition: opacity 180ms ease;
}

#player_progress::-webkit-slider-runnable-track {
  height: 0.26rem;
  background: transparent;
}

#player_progress::-moz-range-track {
  height: 0.26rem;
  background: rgba(var(--playerControlRgb), 0.34);
}

#player_progress::-moz-range-progress {
  height: 0.26rem;
  background: rgb(var(--playerAccentRgb));
}

#player_progress::-webkit-slider-thumb {
  width: 0;
  height: 0;
  margin-top: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  appearance: none;
}

#player_progress::-moz-range-thumb {
  width: 0;
  height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

#player_progressTooltip {
  position: absolute;
  bottom: 3.72rem;
  left: var(--playerProgressTooltipLeft, 50%);
  z-index: 10;
  display: none;
  min-width: 3rem;
  padding: 0.26rem 0.45rem;
  color: rgb(var(--playerTextRgb));
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  background: rgba(var(--playerPanelRgb), 0.9);
  border-radius: 999px;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.3);
  opacity: 1;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
  font-variant-numeric: tabular-nums;
}

#player_progress.playerProgressHover + #player_progressTooltip {
  display: block;
}

#player_subtitlesParent {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 7;
  display: flex;
  justify-content: center;
  line-height: 0;
  text-align: center;
  pointer-events: none;
}

#player_subtitlesStr {
  display: inline-block;
  max-width: 90%;
  padding: 0.42rem 1.05rem 0.48rem;
  overflow: hidden;
  color: rgb(var(--playerSubtitleRgb));
  font-size: 1.5rem;
  font-weight: 430;
  line-height: 1.24;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.2), 1px -1px 0 rgba(0, 0, 0, 0.2), -1px 1px 0 rgba(0, 0, 0, 0.2), 1px 1px 0 rgba(0, 0, 0, 0.2);
  background-color: rgba(var(--playerPanelRgb), 0.78);
  border-radius: 999px;
  pointer-events: all;
}

#player_bg:fullscreen #player_subtitlesStr,
#player_bg.player_fullScreen #player_subtitlesStr {
  padding: 0.5rem 1.25rem 0.58rem;
  font-size: 1.9rem;
  line-height: 1.2;
}

#player_subtitlesStr:empty {
  display: none !important;
}

#player_transcript {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: none;
  width: min(22rem, 38%);
  padding: 4rem 0.8rem 4.2rem;
  overflow: auto;
  background: rgba(var(--playerPanelRgb), 0.8);
  border-left: 1px solid rgba(var(--playerControlRgb), 0.12);
}

#player_frame.player_showTranscript #player_transcript {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.playerTranscriptRow {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem;
  color: rgba(var(--playerTextRgb), 0.72);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0.45rem;
  cursor: pointer;
}

.playerTranscriptRow:hover,
.playerTranscriptRow.isActive {
  color: rgb(var(--playerTextRgb));
  background: rgba(var(--playerControlRgb), 0.1);
}

.playerTranscriptRow span {
  font-size: 0.72rem;
  font-weight: 800;
}

.playerTranscriptRow b {
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
}

@media (max-width: 760px) {
  #player_bg {
    display: none;
    width: 100vw;
    height: 100vh;
    min-height: 100dvh;
    padding: 4.4rem 0.75rem 2.25rem;
    overflow: hidden;
  }

  #player_bg.player_isOpen {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  #player_frame {
    width: min(23rem, calc(100vw - 1.5rem));
    max-width: min(23rem, calc(100vw - 1.5rem));
    margin: 0;
    border-radius: 0.5rem;
  }

  #player_controlsBackground {
    height: 100%;
    background: transparent;
  }

  #player_controls {
    right: 0.35rem;
    left: 0.35rem;
    width: calc(100% - 0.7rem);
  }

  #player_progress {
    right: 0.35rem;
    left: 0.35rem;
    width: calc(100% - 0.7rem);
  }

  #player_audioMute,
  #player_sideOpen,
  #player_openMenuLink {
    display: none;
  }

  #player_subtitlesParent {
    right: auto;
    bottom: auto;
    left: 0;
  }

  #player_subtitlesStr {
    max-width: 100%;
    padding: 0.36rem 0.72rem 0.42rem;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .playerVisualClick,
  .playerVisualHighlight,
  .playerMiddleButton {
    animation: none;
    transition: none;
  }
}
