.player-active {
  overflow: hidden;
}

.player-overlay {
  z-index: 50;
  padding: 0;
  overflow: hidden;
  background: #08090b;
  place-items: stretch center;
}

.player-v2 {
  position: relative;
  width: min(520px, 100%);
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
}

.player-stage {
  position: relative;
  width: 100%;
  height: min(78dvh, 760px);
  min-height: 560px;
  overflow: hidden;
  background: #08090b;
}

.player-stage video,
.player-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.player-poster {
  background-position: center;
  background-size: cover;
}

.player-v2 .player-close {
  top: calc(15px + env(safe-area-inset-top));
  left: 15px;
}

.stage-title {
  right: 76px;
  bottom: 164px;
  left: 16px;
}

.stage-title h2 {
  max-width: 360px;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.16;
}

.transport {
  bottom: 100px;
  gap: 30px;
}

.player-progress {
  right: 16px;
  bottom: 55px;
  left: 16px;
}

.stage-bottom {
  right: 15px;
  bottom: calc(11px + env(safe-area-inset-bottom));
  left: 15px;
}

.player-social {
  position: absolute;
  z-index: 5;
  top: auto;
  right: 10px;
  bottom: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: none;
}

.player-social button {
  display: grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(10,11,14,.42);
  color: #fff;
  box-shadow: 0 3px 16px rgba(0,0,0,.2);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  place-items: center;
}

.player-social button.active {
  background: rgba(254,91,146,.92);
  color: #fff;
}

.player-social small {
  color: inherit;
  font-size: 9px;
  line-height: 1;
}

.player-panel {
  min-width: 0;
  background: #fff;
}

.player-meta-v2 {
  display: block;
  min-height: 0;
  padding: 20px 16px 24px;
}

.player-meta-v2 h3 {
  margin: 7px 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.player-comments[hidden] {
  display: none;
}

.episode-drawer {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: min(62dvh, 620px);
  transform: translateY(105%);
}

.episode-drawer.open {
  transform: translateY(0);
}

.payment-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 11px;
  border: 1px solid #ffd0dc;
  border-radius: 6px;
  background: #fff5f7;
  color: #a93458;
  font-size: 12px;
  line-height: 1.45;
}

.payment-error svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.payment-modal button:disabled {
  cursor: wait;
  opacity: .62;
}

@media (max-width: 420px) {
  .player-stage {
    height: 100svh;
    min-height: 620px;
  }

  .stage-title {
    right: 68px;
    bottom: 164px;
  }

  .stage-title h2 {
    font-size: 20px;
  }

  .transport {
    bottom: 99px;
    gap: 24px;
  }

  .player-progress {
    right: 12px;
    left: 12px;
  }

  .player-social {
    right: 8px;
    bottom: 118px;
  }

  .player-social button {
    width: 43px;
    min-width: 43px;
    height: 43px;
    min-height: 43px;
  }
}

@media (min-width: 860px) {
  .player-overlay {
    padding: 18px;
    place-items: center;
  }

  .player-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    width: min(1240px, 100%);
    height: min(900px, calc(100dvh - 36px));
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    background: #08090b;
    box-shadow: 0 24px 80px rgba(0,0,0,.42);
  }

  .player-stage {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    min-height: 0;
  }

  .player-panel {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    overflow-y: auto;
  }

  .player-meta-v2 {
    padding: 30px 26px 26px;
  }

  .player-meta-v2 h3 {
    font-size: 22px;
  }

  .player-meta-v2 p {
    font-size: 13px;
  }

  .player-comments {
    padding-right: 26px;
    padding-left: 26px;
  }

  .stage-title {
    right: 96px;
    bottom: 170px;
    left: 30px;
  }

  .stage-title h2 {
    max-width: 620px;
    font-size: 28px;
  }

  .transport {
    bottom: 101px;
  }

  .player-progress {
    right: 28px;
    left: 28px;
  }

  .stage-bottom {
    right: 28px;
    left: 28px;
  }

  .player-social {
    right: 20px;
    bottom: 116px;
  }

  .episode-drawer {
    right: 0;
    left: auto;
    width: 380px;
    max-height: 72%;
  }

  .episode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-height: 680px) and (max-width: 859px) {
  .player-stage {
    height: 100svh;
    min-height: 520px;
  }
}
