:root {
  color-scheme: dark;
  --bg: #06080b;
  --panel: rgba(8, 12, 17, 0.88);
  --panel-strong: rgba(10, 15, 21, 0.96);
  --line: rgba(255, 255, 255, 0.13);
  --text: #eef4f7;
  --muted: #9eadb8;
  --green: #61d394;
  --gold: #e7c66a;
  --blue: #6aa9ff;
  --warn: #ffbd74;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  cursor: pointer;
}

button:hover {
  background: rgba(255, 255, 255, 0.14);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

#vrScene,
a-scene,
.a-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.a-enter-vr {
  right: 18px;
  bottom: 18px;
}

.sidebar {
  position: fixed;
  top: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  width: 284px;
  padding: 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 780;
}

.mini-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.mini-status span,
.focus-line {
  min-width: 0;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-status span {
  text-align: center;
  color: var(--muted);
}

.focus-line {
  margin-bottom: 6px;
}

.focus-line strong {
  color: var(--gold);
}

.focus-line.subtle {
  color: var(--muted);
}

.panel-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.command-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
  margin-top: 6px;
}

.command-form input,
.ai-settings input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.26);
  padding: 0 9px;
}

.target-buttons,
.shot-grid,
.lighting-grid,
.gesture-modes,
.gesture-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gesture-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gesture-actions button {
  min-width: 0;
  padding-inline: 6px;
  font-size: 12px;
}

.target-buttons button {
  color: var(--green);
}

.wide-button {
  width: 100%;
  margin-bottom: 6px;
  color: var(--gold);
}

.shot-grid button[data-shot="cinematic"],
.lighting-grid button[data-light="cinematic"] {
  color: var(--gold);
}

.gesture-panel {
  display: grid;
  gap: 6px;
}

.gesture-status {
  min-height: 28px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gesture-help {
  padding: 7px 8px;
  border: 1px solid rgba(231, 198, 106, 0.16);
  border-radius: 6px;
  background: rgba(231, 198, 106, 0.07);
  color: #c5d0d8;
  font-size: 11px;
  line-height: 1.35;
}

.gesture-modes button.active,
.gesture-actions button.active {
  border-color: rgba(231, 198, 106, 0.62);
  color: var(--gold);
  background: rgba(231, 198, 106, 0.12);
}

#gestureVideo,
#gestureCanvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  object-fit: cover;
  transform: scaleX(-1);
}

.gesture-cursor {
  position: fixed;
  z-index: 3;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  pointer-events: none;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: rgba(231, 198, 106, 0.16);
  box-shadow: 0 0 22px rgba(231, 198, 106, 0.36);
  transform: scale(1);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.gesture-cursor.idle {
  border-color: rgba(158, 173, 184, 0.72);
  background: rgba(158, 173, 184, 0.12);
  box-shadow: 0 0 16px rgba(158, 173, 184, 0.22);
}

.gesture-cursor.grab::after,
.gesture-cursor.grabbing::after {
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: var(--gold);
  content: "";
}

.gesture-cursor.grabbing {
  border-color: var(--green);
  background: rgba(97, 211, 148, 0.18);
  box-shadow: 0 0 24px rgba(97, 211, 148, 0.42);
  transform: scale(0.78);
}

.ai-settings {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ai-settings summary {
  cursor: pointer;
}

.ai-settings label {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-top: 7px;
}

#saveAiButton {
  width: 100%;
  margin-top: 7px;
}

.info-panel {
  position: static;
  margin-top: 11px;
  padding: 11px;
  border: 1px solid rgba(231, 198, 106, 0.34);
  border-radius: 8px;
  background: rgba(231, 198, 106, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.info-close {
  float: right;
  min-height: 28px;
  padding: 0 10px;
}

.info-panel h2 {
  margin: 4px 0 7px;
  font-size: 18px;
}

.info-panel p {
  margin: 0 0 10px;
  color: #c8d3dc;
  font-size: 12px;
  line-height: 1.4;
}

.info-panel dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.info-panel dl div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-panel dt {
  color: var(--muted);
  font-size: 12px;
}

.info-panel dd {
  margin: 0;
  font-size: 12px;
}

body.is-object-active #scene {
  cursor: grab;
}

body.is-object-dragging #scene {
  cursor: grabbing;
}

body.is-object-active .a-canvas {
  cursor: grab;
}

body.is-object-dragging .a-canvas {
  cursor: grabbing;
}

@media (max-width: 760px) {
  .sidebar {
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    max-height: 54vh;
  }
}
