:root:has(.opening-video[open]) { overflow: hidden; }

dialog.opening-video {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(60rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: .9rem;
  background: #0d1511;
  box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, .38);
}

.opening-video::backdrop { background: rgba(6, 16, 10, .72); }

.opening-video video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 2.1rem);
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.opening-video-close,
.opening-video-play {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 19, 14, .86);
  cursor: pointer;
}

.opening-video-close {
  top: .4rem;
  right: .4rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.opening-video-close::before,
.opening-video-close::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.opening-video-close::before {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 50%;
  background: rgba(16, 23, 22, .68);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.opening-video-close::after {
  width: .75rem;
  height: .75rem;
  background:
    linear-gradient(#fff, #fff) center / 100% 1.5px no-repeat,
    linear-gradient(#fff, #fff) center / 1.5px 100% no-repeat;
  transform: rotate(45deg);
}

@media (hover: hover) {
  .opening-video-close:hover::before {
    border-color: rgba(255, 255, 255, .45);
    background-color: rgba(16, 23, 22, .88);
  }
}

.opening-video .opening-video-close:focus-visible { outline: none; }

.opening-video-close:focus-visible::before {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.opening-video-play {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 0 1rem;
  white-space: nowrap;
  font-size: 1rem;
}

.opening-video button:focus-visible { outline-color: #fff; }

@media (max-width: 480px) {
  dialog.opening-video { border-radius: .7rem; }
}

.opening-video-progress {
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    transparent 0 var(--played, 0%),
    #c4e2a7 var(--played, 0%) 100%
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.25px), #000 calc(100% - 1.75px));
}

.opening-video-close:focus-visible::before {
  outline-offset: 5px;
}

.hero-video-replay {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  margin-top: .45rem;
  padding: .15rem .5rem .15rem 0;
  border: 0;
  border-radius: .4rem;
  color: #214932;
  background: transparent;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-video-icon {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid #c4d8b5;
  border-radius: 50%;
  background: #edf4e7;
}

.hero-video-icon::after {
  content: "";
  margin-left: .1rem;
  border-block: .25rem solid transparent;
  border-left: .38rem solid currentColor;
}

@media (hover: hover) {
  .hero-video-replay:hover .hero-video-icon { background: #dbeacd; }
  .hero-video-replay:hover span:last-child { text-decoration: underline; }
}
