:root {
  color-scheme: dark;
  --lab-bg: #07090d;
  --lab-panel: rgba(11, 14, 20, 0.84);
  --lab-border: rgba(255, 255, 255, 0.12);
  --lab-text: #f3f5f8;
  --lab-dim: #9aa3b2;
  --lab-accent-soft: rgba(229, 32, 32, 0.22);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }

#lab-topbar {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
#lab-topbar[hidden] { display: none; }
#lab-topbar > * { pointer-events: auto; }

.bar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--lab-panel);
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.brand-group { gap: 8px; padding: 4px 6px 4px 12px; }
.brand-mark {
  font: 800 13px/1 inherit;
  letter-spacing: 0.18em;
  color: #fff;
  text-decoration: none;
}
.brand-tag {
  font: 700 10px/1 inherit;
  letter-spacing: 0.14em;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--lab-accent-soft);
  color: #ff8078;
}

.nav-link,
.bar-btn,
.mode-btn,
.cam-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 12px;
  font: 600 12.5px/1.2 inherit;
  letter-spacing: 0.02em;
  color: var(--lab-dim);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.06s, color 0.06s, border-color 0.06s;
}
.mode-btn { padding: 8px 16px; font-size: 13px; }
.nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.nav-link:hover,
.bar-btn:hover,
.mode-btn:hover,
.cam-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}
.mode-btn[aria-pressed="true"],
.bar-btn[aria-pressed="true"],
.cam-btn[aria-pressed="true"] {
  color: #fff;
  background: rgba(196, 0, 0, 0.8);
  border-color: rgba(255, 96, 80, 0.55);
}

.bar-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--lab-border);
}

#camera-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--lab-panel);
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  max-width: calc(100vw - 28px);
}
#camera-bar[hidden] { display: none; }
.camera-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
}
.orbit-hint {
  font-size: 11px;
  color: var(--lab-dim);
  white-space: nowrap;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.lab-disclaimer {
  position: fixed;
  bottom: 18px;
  left: 18px;
  margin: 0;
  z-index: 2;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(26, 30, 42, 0.92), #050609 75%);
  padding: 24px;
}
.overlay-screen[hidden] { display: none; }
.overlay-card {
  max-width: 420px;
  padding: 26px 28px;
  border-radius: 14px;
  background: rgba(12, 15, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  align-items: center;
}
.overlay-kicker {
  font: 700 11px/1 inherit;
  letter-spacing: 0.18em;
  color: #ff8078;
}
.overlay-card h1 { margin: 0; font-size: 20px; }
.overlay-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--lab-dim); }

@media (max-width: 820px) {
  .orbit-hint, .lab-disclaimer { display: none; }
}
