/* =========================================================
   Structure de la page
   ========================================================= */
html, body {
  margin: 0;
  padding: 0;
  background: #000;
}

#set-height {
  display: block;
  /* La hauteur réelle est injectée par le JS au chargement. */
}

/* =========================================================
   HUD temporel
   ========================================================= */
p#time {
  position: fixed;
  bottom: 8px;
  left: 8px;
  margin: 0;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 4px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  z-index: 10;
  pointer-events: none;
}

/* =========================================================
   Scène vidéo et vidéos
   ========================================================= */
#video-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000;
  overflow: hidden;
  pointer-events: none;
}

.scrub-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* remplit le viewport, rogne les bords si ratio différent */
  display: block;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms linear;
}

.scrub-video[data-active="true"] {
  opacity: 1;
  visibility: visible;
}

/* Neutralise d'éventuelles anciennes règles */
#v0, #v1, #v2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* =========================================================
   Fallback global
   ========================================================= */
#video-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 2;
  background: #000;
  color: #fff;
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}

#video-fallback[data-visible="true"] {
  display: flex;
}

#video-retry {
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

#video-retry:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* =========================================================
   Préférences utilisateur
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .scrub-video {
    transition: none;
  }
}