body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  background: transparent;
}
#err-msg {
  display: none;
  background-color: white;
  color: #aa0000;
  font-family: sans;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  height: 200px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  padding: 20px;
  max-width: 400px;
  transform: translateX(-50%) translateY(-50%);
}
.stage {
  position: relative;
  background: transparent;
  overflow: hidden;
  display: grid;
  place-items: center;
}
video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: transparent;
}

/* loading overlay */
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 600 15px/1.3 system-ui;
  background: linear-gradient(#0007, #0007);
}
.loading.hidden {
  display: none;
}
.loading .spinner {
  width: 52px;
  height: 52px;
  /* draw a 360° ring with a 45° gap (315° filled, 45° empty) */
  background: conic-gradient(#fff 0 315deg, transparent 315deg 360deg);
  /* punch a hole to make it a thin ring (3px thick) */
  -webkit-mask: radial-gradient(
    farthest-side,
    #0000 calc(100% - 3px),
    #000 calc(100% - 3px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 3px)
  );
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.stage video {
  position: relative;
  z-index: 1;
}
.loading {
  z-index: 5;
} /* sits above the video + its UI */

/* centered play overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 4; /* below .loading, above video/logo */
  pointer-events: none; /* let clicks pass through when hidden; button re-enables */
}

.play-overlay.hidden {
  display: none;
}

.play-btn {
  pointer-events: auto;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.play-btn:hover {
  transform: scale(1.05);
}
.play-btn:active {
  transform: scale(0.98);
}

/* triangle arrow */
.play-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px; /* optically center the triangle */
  border-left: 20px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

/* camera logo overlay */
.cam-logo {
  position: absolute;
  z-index: 1000;
  max-width: 22%;
  max-width: 180px !important;
  max-height: 18%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.cam-logo.hidden {
  display: none;
}

.cam-logo.top-left {
  top: 14px;
  left: 14px;
}

.cam-logo.top-right {
  top: 14px;
  right: 14px;
}

.cam-logo.bottom-left {
  bottom: 50px;
  left: 14px;
}

.cam-logo.bottom-right {
  right: 14px;
  bottom: 50px;
}

@media (max-width: 600px) {
  .cam-logo {
    max-width: 28%;
    max-height: 20%;
  }
}
