:root {
  color-scheme: dark;
  --ink: #050607;
  --panel: rgba(10, 14, 16, 0.68);
  --line: rgba(255, 255, 255, 0.18);
  --glow: rgba(255, 224, 148, 0.55);
  --control: #f8fbff;
  --control-muted: #8bb8c9;
}

* {
  box-sizing: border-box;
}

html,
body,
main {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.source-video {
  position: fixed;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#stage {
  display: block;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 22%, rgba(43, 67, 42, 0.4), transparent 42%),
    linear-gradient(180deg, #050607 0%, #07100b 54%, #030405 100%);
}

.controls {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.34), 0 0 32px var(--glow);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--control);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
}

.icon-button:disabled {
  color: var(--control-muted);
  cursor: default;
  opacity: 0.54;
}

.icon-button:focus-visible,
#density:focus-visible {
  outline: 2px solid #ffdf82;
  outline-offset: 3px;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button svg path,
.icon-button svg circle {
  fill: none;
}

.icon-button svg rect,
.icon-button svg .solid {
  fill: currentColor;
  stroke: none;
}

#sourceToggle.is-active,
#audioToggle.is-active,
#cameraToggle.is-active {
  color: #ffe28e;
  background: rgba(255, 226, 142, 0.16);
}

#density {
  width: 136px;
  min-width: 82px;
  accent-color: #ffe28e;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .controls {
    width: calc(100vw - 28px);
    justify-content: center;
  }

  #density {
    width: min(34vw, 132px);
  }
}
