.hide {
  display: none !important;
}

body.noScroll {
  overflow: hidden !important;
}

/* base video box */
.vidBox {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 4px;
  overflow: hidden !important;
  background: #0a0a0a;
  transition:
    box-shadow 0.45s ease,
    border-color 0.45s ease;
}

.vidBox.is-focused {
  border-color: rgba(212, 175, 55, 0.9);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.5),
    0 0 28px rgba(212, 175, 55, 0.55),
    0 0 48px rgba(212, 175, 55, 0.25);
}

/* player always fills .vidBox */
.vid-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  background: #000;
}

.vid-player video {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #000;
}

#videoFocusTarget {
  z-index: 14 !important;
}

.vid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 4;
  transition: opacity 0.35s ease;
}

.vid-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.vid-play-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #fff;
}

@keyframes vidPlayPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
  }
}

.vid-overlay:not(.is-hidden) .vid-play-circle {
  animation: vidPlayPulse 1.2s ease-in-out infinite;
}

.vid-play-circle {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid rgba(255, 232, 140, 0.95);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(180deg, #ffe889 0%, #d4af37 52%, #9f7104 100%);
  color: #070707;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow:
    0 16px 42px rgba(212, 175, 55, 0.48),
    0 0 0 8px rgba(212, 175, 55, 0.12);
}

.vid-play-circle .fas {
  font-size: 36px;
  margin-left: 6px;
}

.vid-play-center:hover .vid-play-circle {
  transform: scale(1.04);
  box-shadow:
    0 20px 52px rgba(212, 175, 55, 0.62),
    0 0 0 10px rgba(212, 175, 55, 0.16);
}

.vid-play-hint {
  padding: 8px 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  font-size: calc(14px * var(--text-scale));
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 220px;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.vid-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.85) 40%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

.vidBox:not(.inFullscreen) .vid-controls {
  opacity: 0;
  pointer-events: none;
}

.vidBox.is-active-playback:not(.inFullscreen) .vid-controls {
  opacity: 1;
  pointer-events: auto;
}

.vid-progress-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  height: 4px;
  z-index: 7;
  padding: 0 12px;
  pointer-events: none;
}

.vidBox.is-debug-seek .vid-progress-wrap {
  height: 14px;
  bottom: 39px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}

.vid-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.vidBox.is-debug-seek .vid-progress {
  margin-top: 5px;
  height: 5px;
}

.vid-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background: #d4af37;
  border-radius: 2px;
  transition: width 0.12s linear;
}

.vid-ctrl-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.vid-ctrl-btn:hover {
  color: #d4af37;
  background: rgba(255, 255, 255, 0.08);
}

.vid-ctrl-btn .fas {
  font-size: 16px;
}

.vid-ctrl-btn[data-action="mute"].is-muted {
  color: #d4af37;
}

.vid-ctrl-btn[data-action="mute"].is-muted .fas {
  opacity: 1;
}

.vid-controls-spacer {
  flex: 1;
}

#closeTrigger {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  z-index: 2147483647;
  display: none;
}

.vidBox.inFullscreen #closeTrigger {
  display: block;
}

#closeTrigger::before,
#closeTrigger::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 17px;
  height: 2px;
  background: #000;
  transform: rotate(45deg);
}

#closeTrigger::after {
  transform: rotate(-45deg);
}

/* fullscreen mode */
body.noScroll .access-panel {
  display: none !important;
}

.vidBox.inFullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  max-width: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  overflow: hidden !important;
}

.vidBox.inFullscreen .vid-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
}

.vidBox.inFullscreen .vid-player video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* hard reset when fullscreen is closed */
.vidBox:not(.inFullscreen) {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 0 !important;
  max-height: none !important;
}

.vidBox:not(.inFullscreen) .vid-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.vidBox:not(.inFullscreen) .vid-player video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

@media (max-width: 767px) {
  .vid-play-circle {
    width: 78px;
    height: 78px;
  }

  .vid-play-circle .fas {
    font-size: 28px;
  }

  .vid-play-hint {
    font-size: calc(12px * var(--text-scale));
  }

  .vid-controls {
    gap: 6px;
    padding: 6px 8px 8px;
  }

  .vid-ctrl-btn {
    width: 28px;
    height: 28px;
  }

  .vid-progress-wrap {
    bottom: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vid-overlay:not(.is-hidden) .vid-play-circle {
    animation: none;
  }
}

.vidBox.inFullscreen .vid-overlay {
  background: rgba(0, 0, 0, 0.1);
}

/* FINAL FULLSCREEN FIX */

body.noScroll {
  overflow: hidden !important;
}

/* во время fullscreen скрываем ВСЁ, кроме секции с видео */
body.noScroll .hero,
body.noScroll .access-panel,
body.noScroll .ticker,
body.noScroll .info-grid,
body.noScroll .results-cta,
body.noScroll .comments-section,
body.noScroll #block_form {
  display: none !important;
}

body.noScroll .main-grid {
  display: block !important;
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: auto !important;
}

body.noScroll .main-grid__inner {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.noScroll .main-grid__video,
body.noScroll .video-section {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* fullscreen */
.vidBox.inFullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  overflow: hidden !important;
}

.vidBox.inFullscreen .vid-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  background: #000 !important;
}

.vidBox.inFullscreen video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* обычное состояние после закрытия */
.vidBox:not(.inFullscreen) {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

.vidBox:not(.inFullscreen) .vid-player {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
}

.vidBox:not(.inFullscreen) video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
