:root {
  --bg: #020817;
  --divider: rgba(255, 255, 255, 0.08);
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

/* ── Stereo shell ─────────────────────────────────────────────────────────── */
.stereo-shell {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.eye-view {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  background: #000;
}

.background-video,
.eye-view a-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── QR scan canvas (processamento — invisível) ───────────────────────────── */
.qr-scan-canvas {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  top: 0;
  left: 0;
}

/* ── QR preview visível — canto inferior esquerdo ────────────────────────── */
.qr-preview {
  position: fixed;
  bottom: 18px;
  left: 18px;
  width: 120px;
  height: 120px;
  z-index: 100;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #18e7ff;
  box-shadow: 0 0 12px rgba(24, 231, 255, 0.4);
  display: none; /* aparece só quando câmera estiver ativa */
}

.qr-preview.active {
  display: block;
}

.qr-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* espelhar para parecer natural */
}

/* Mira de scan */
.qr-preview-frame {
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(24, 231, 255, 0.7);
  border-radius: 4px;
}
.qr-preview-frame::before,
.qr-preview-frame::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #18e7ff;
  border-style: solid;
}
.qr-preview-frame::before {
  top: -2px; left: -2px;
  border-width: 3px 0 0 3px;
}
.qr-preview-frame::after {
  bottom: -2px; right: -2px;
  border-width: 0 3px 3px 0;
}

.qr-preview-label {
  position: absolute;
  bottom: 4px;
  left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #18e7ff;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(24,231,255,0.8);
}

/* Flash verde quando QR detectado */
.qr-preview.qr-found {
  border-color: #2dd4bf;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.7);
}

/* ── Background video ─────────────────────────────────────────────────────── */
.background-video {
  z-index: 0;
  object-fit: cover;
  background: #000;
  transform: scale(1.07);
}

.eye-left .background-video  { transform-origin: left center;  }
.eye-right .background-video { transform-origin: right center; }

.eye-view a-scene             { z-index: 1; }
.eye-view a-scene canvas      { background: transparent !important; }

/* ── Divisor central ──────────────────────────────────────────────────────── */
.divider-fade {
  position: absolute;
  top: 0; bottom: 0;
  width: 18px;
  z-index: 2;
  pointer-events: none;
}
.divider-left  { right: 0; background: linear-gradient(90deg, transparent, var(--divider)); }
.divider-right { left: 0;  background: linear-gradient(90deg, var(--divider), transparent); }
