.story-cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050608;
  opacity: 0;
  transition: opacity 160ms ease;
}

.story-cinematic-overlay[hidden] {
  display: none;
}

.story-cinematic-overlay.visible {
  opacity: 1;
}

.story-cinematic-video {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #050608;
}

.story-cinematic-close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.76);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.story-cinematic-close {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.story-cinematic-controls {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.story-cinematic-toggle {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
}

.story-cinematic-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
  transform: translate(-38%, -50%);
}

.story-cinematic-toggle.is-playing::before {
  width: 4px;
  height: 16px;
  border: 0;
  background: currentColor;
  box-shadow: 8px 0 0 currentColor;
  transform: translate(-6px, -50%);
}

.story-cinematic-progress {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  margin: 0;
  accent-color: #f54291;
  cursor: pointer;
}

.story-cinematic-close[hidden] {
  display: none !important;
}

.story-cinematic-overlay.controls-visible .story-cinematic-close:not([hidden]),
.story-cinematic-overlay.controls-visible .story-cinematic-controls {
  opacity: 1;
  pointer-events: auto;
}

.story-cinematic-close:hover,
.story-cinematic-close:focus-visible,
.story-cinematic-toggle:hover,
.story-cinematic-toggle:focus-visible {
  border-color: #ffffff;
  background: rgba(21, 27, 36, 0.92);
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}
