:root {
  /* Safe area for iOS notches */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #1e1e1e;
  overscroll-behavior: contain;
}

body {
  min-height: 100dvh; /* dynamic viewport height for mobile */
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

/* Player wrapper fills viewport */
#player-container {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: black;
}

/* OvenPlayer injects <video> inside #player */
#player {
  width: 100vw;
  height: 100vh;
}

#player video {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* crop to fill screen */
  background: black;
}

/* Rotate hint in portrait */
@media (orientation: portrait) {
  #rotate-hint { display: block; }
}
@media (orientation: landscape) {
  #rotate-hint { display: none; }
}

#rotate-hint {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 6px 10px;
  font: 500 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e0e0e0;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  pointer-events: none;
}

/* Big friendly unmute button */
#unmute {
  position: fixed;
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  z-index: 10;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: white;
  font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
#unmute[hidden] { display: none; }

/* Viewer counter pill */
#viewer-pill {
  position: fixed;
  right: calc(12px + var(--safe-right));
  top: calc(12px + var(--safe-top));
  z-index: 10000;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  pointer-events: none;
}
#viewer-pill [data-dot] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80; /* green dot */
}
#viewer-pill[hidden] { display: none; }
