/* VideoOverlayEngine host (video-overlay-engine.js). Sized to the rendered
   picture of one <video> and moved with a transform when that picture moves.

   Page-level stacking: the watch player's video layer sits at z 40, the NPC
   characters beside it at 60; this host sits between them at 55 so an NPC
   standing over the frame edge still reads in front of a monster. The layers
   inside it are ordered by OVERLAY_LAYERS (entities 10 … hud 60).

   Inert by default. Children opt into clicks with pointer-events: auto. */

.video-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 55;
  pointer-events: none;
  overflow: hidden;
  contain: layout paint;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.video-overlay--fixed { position: fixed; z-index: 2147483000; }
.video-overlay[hidden] { display: none; }

.video-overlay__layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Fullscreen that keeps the overlays (engine: enterFullscreen). The player
   container is what goes fullscreen, so give it the video's black. */
.exp-video-window:fullscreen { background: #000; border-radius: 0; }
/* Separate rule: a selector list containing one a browser does not know is
   thrown away whole. */
.exp-video-window:-webkit-full-screen { background: #000; border-radius: 0; }

/* Where a page element cannot go fullscreen (iPhone Safari), the player fills
   the window instead. !important because the dock writes inline sizes. */
.video-overlay-pseudo-fs {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  z-index: 2147482500 !important;
  background: #000 !important;
}
.video-overlay-pseudo-fs video { width: 100% !important; height: 100% !important; object-fit: contain !important; }
html.video-overlay-pseudo-fs-on,
html.video-overlay-pseudo-fs-on body { overflow: hidden !important; }
/* Above the filled player, which itself sits just under the host's fixed tier. */
html.video-overlay-pseudo-fs-on .video-overlay { z-index: 2147482600; }
