/* Before play overlay on theme Video embed (parent page, not player-x.php). */
.video-player {
  position: relative;
}

.video-player > .wps-player__happy-inside--page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  isolation: isolate;
  box-sizing: border-box;
  padding: 6px;
  overflow: hidden;
}

.video-player > .wps-player__happy-inside--page.wps-player__happy-inside--closed,
.wps-player__happy-inside--page.wps-player__happy-inside--closed {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.wps-player__happy-inside--page .wps-player__happy-inside-zone {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  gap: 8px;
  line-height: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  max-height: calc(100% - 52px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.wps-player__happy-inside--page a,
.wps-player__happy-inside--page iframe,
.wps-player__happy-inside--page img {
  display: block !important;
  line-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  max-width: 100% !important;
}

.wps-player__happy-inside--page iframe,
.wps-player__happy-inside--page img {
  width: auto !important;
  height: auto !important;
  max-height: 250px !important;
  max-width: 300px !important;
  position: static !important;
  object-fit: contain;
}

.wps-player__happy-inside--page .wps-player__happy-inside-btn-close {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  margin: 6px 0 0;
  padding: 0 20px;
  min-height: 44px;
  min-width: 120px;
  height: 44px;
  line-height: 44px;
  font-weight: normal;
  color: #fff;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

@media (max-width: 767.98px) {
  .wps-player__happy-inside--page iframe,
  .wps-player__happy-inside--page img {
    max-width: min(300px, 100%) !important;
    max-height: 140px !important;
  }

  .wps-player__happy-inside--page .wps-player__happy-inside-btn-close {
    width: calc(100% - 8px);
    max-width: 280px;
  }
}

@media (max-width: 479.98px) {
  .wps-player__happy-inside--page iframe,
  .wps-player__happy-inside--page img {
    max-height: 96px !important;
  }
}

@media (max-height: 500px) {
  .wps-player__happy-inside--page iframe,
  .wps-player__happy-inside--page img {
    max-height: 90px !important;
  }
}
