.video-modal-close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 110;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 9999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.video-modal-close:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: scale(1.04);
}

.video-modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.video-modal-panel {
  position: relative;
  width: min(calc(100vw - 2rem), calc(90vh * 9 / 16));
  max-height: 90vh;
  border-radius: 1rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.35);
}

.video-modal-ready {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.video-modal-ready.is-visible {
  display: flex;
}

.video-modal-ready__spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #a5b4fc;
  border-radius: 9999px;
  animation: video-modal-spin 0.8s linear infinite;
}

.video-modal-ready__text {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
}

@keyframes video-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

.video-modal-panel .plyr {
  --plyr-color-main: #6366f1;
  --plyr-video-background: #000;
  --plyr-menu-background: rgba(15, 23, 42, 0.96);
  --plyr-menu-color: #fff;
  --plyr-font-family: 'Inter', system-ui, sans-serif;
  --plyr-control-radius: 0.5rem;
  border-radius: 1rem;
  width: 100%;
  max-height: 90vh;
}

.video-modal-panel .plyr--video {
  overflow: hidden;
  border-radius: 1rem;
}

.video-modal-panel .plyr__video-wrapper {
  background: #000;
}

.video-modal-panel .plyr video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  background: #000;
}

.video-modal-panel .plyr__control--overlaid {
  background: rgba(99, 102, 241, 0.92);
}

.video-modal-panel .plyr__control--overlaid:hover {
  background: #4f46e5;
}

.video-modal-panel .plyr__controls {
  padding: 0.65rem 0.75rem 0.85rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
}
