/* Reset-ish */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
:root { --pad: clamp(10px, 2vw, 24px); --blur: 8px; }

/* Video background layer */
#videoContainer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
}
#videoContainer > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* don’t steal clicks from overlays */
}

/* Overlay layout */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto; /* header, spacer, footer */
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Top-left HUD */
.hud {
  align-self: start;
  padding: var(--pad);
  max-width: min(800px, 90vw);
}
.hud h1 {
  margin: 0 0 6px 0;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
}
.status-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
  flex-wrap: wrap;
  font-size: clamp(12px, 1.6vw, 16px);
}
.status-line .label { opacity: .85; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,.15);
}

/* Bottom controls */
.controls {
  align-self: end;
  padding: var(--pad);
  display: grid;
  gap: .6rem;
  justify-items: center;
}
.hint {
  margin: 0;
  font-size: clamp(12px, 1.6vw, 14px);
  opacity: .9;
  background: rgba(0,0,0,.35);
  padding: .3rem .6rem;
  border-radius: 8px;
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,.12);
}

/* Control pad */
.control-pad {
  display: inline-block;
  margin: .2em 0 0;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: .6rem .8rem;
}
.row {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin: .35em 0;
}
.ctrl-btn {
  font-size: clamp(22px, 4.5vw, 34px);
  width: clamp(56px, 12vw, 84px);
  height: clamp(56px, 12vw, 84px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  backdrop-filter: blur(calc(var(--blur) / 2));
}
.ctrl-btn:hover { border-color: rgba(255,255,255,.5); }
.ctrl-btn:active {
  transform: scale(.96);
  background: rgba(255,255,255,.2);
}

/* Readability gradients at top/bottom */
.overlay::before,
.overlay::after {
  content: "";
  position: fixed;
  left: 0; right: 0;
  height: 18vh;
  pointer-events: none;
  z-index: -1;
}
.overlay::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent);
}
.overlay::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
}

/* Small screens */
@media (max-width: 420px) {
  .chip { display: none; } /* keep HUD tight */
}
