:root {
  color-scheme: dark;
  --panel: rgba(10, 12, 14, 0.68);
  --panel-edge: rgba(255, 255, 255, 0.16);
  --glass-a: rgba(209, 232, 238, 0.62);
  --glass-b: rgba(132, 185, 205, 0.36);
  --ink: rgba(235, 246, 248, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #090c0f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #090c0f;
}

.fallback-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(38, 45, 50, 0.9), rgba(12, 16, 18, 0.92) 46%, rgba(48, 45, 40, 0.9)),
    linear-gradient(90deg, rgba(24, 33, 41, 0.35), rgba(92, 105, 98, 0.24), rgba(36, 28, 29, 0.28));
}

.fallback-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 98px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 92px);
  transform: perspective(660px) rotateX(58deg) translateY(34vh);
  transform-origin: 50% 100%;
  opacity: 0.42;
}

.camera-feed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
}

.camera-feed.is-active {
  opacity: 1;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.status-pill {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(4, 8, 10, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(1.15);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f5b85e;
  box-shadow: 0 0 12px rgba(245, 184, 94, 0.8);
}

.status-dot.is-live {
  background: #68e09a;
  box-shadow: 0 0 12px rgba(104, 224, 154, 0.8);
}

.control-bar {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 8px 18px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 42px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px) saturate(1.18);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  color: rgba(244, 250, 251, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-decoration: none;
  position: relative;
}

.icon-button.is-hidden {
  display: none;
}

.icon-button.primary {
  color: #0a0d0f;
  background: rgba(246, 249, 249, 0.94);
  border-color: rgba(255, 255, 255, 0.88);
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quicklook-poster {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 8px;
  pointer-events: none;
}

.xr-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.is-xr-active #stage,
body.is-xr-active .camera-feed,
body.is-xr-active .fallback-scene {
  opacity: 0;
}

@media (min-width: 720px) {
  .control-bar {
    min-height: 68px;
  }

  .icon-button {
    width: 54px;
    height: 54px;
  }
}
