/* Nightclub AR — bare UI */

.abyss-body {
  --accent: #8ff4ff;
  --accent-ink: #041014;
  background: #02070a;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(100% 70% at 50% 30%, #0a2028 0%, #041016 45%, #02070a 85%);
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}

#stage canvas {
  touch-action: none;
}

#camerafeed {
  display: none;
}

.abyss-body.ar-running #stage,
.abyss-body.ar-running #backdrop,
.abyss-body.ar-running #landing,
.abyss-body.ar-running #device,
.abyss-body.ar-running #previewbar {
  display: none !important;
}

.abyss-body.ar-running #camerafeed {
  display: block;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* -- panels ------------------------------------------------------- */

.panel {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(400px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(3, 9, 12, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

.panel.centered {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.panel h1 {
  font: 600 25px/1.1 "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.panel h2 {
  font: 600 19px/1.2 "Inter", system-ui, sans-serif;
  margin: 0 0 6px;
}

.panel p {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
}

/* -- buttons ------------------------------------------------------ */

.btn {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: 600 13px "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #041014;
  background: #f2f6f7;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 120ms ease, transform 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
}

.btn.ghost {
  background: transparent;
  color: #eef4f5;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn[aria-pressed="true"] {
  background: #8ff4ff;
  color: #041014;
  border-color: #8ff4ff;
}

.panel .btn + .btn {
  margin-top: 8px;
}

.bar {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(3, 9, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
}

.bar .btn {
  margin-top: 0;
  width: auto;
  height: 40px;
  padding: 0 14px;
  flex: 0 0 auto;
}

#scanbar {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

#scanbar p {
  margin: 2px 4px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

#scanbar .row {
  display: flex;
  gap: 8px;
}

#scanbar .row .btn {
  flex: 1;
  width: auto;
}

#scanbar .link {
  align-self: flex-start;
}

#worldbar .btn,
#previewbar .btn {
  flex: 0 0 auto;
}

#worldbar #recenter,
#previewbar #recenter-preview {
  flex: 1;
}

/* -- text links --------------------------------------------------- */

.link {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font: 500 11px "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link:hover {
  color: rgba(255, 255, 255, 0.75);
}

.links {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

/* -- scan frame --------------------------------------------------- */

.scan-frame {
  position: fixed;
  left: 50%;
  top: 42%;
  width: min(64vw, 260px);
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  pointer-events: none;
  z-index: 6;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #8ff4ff;
}

.scan-frame::before {
  left: -1px;
  top: -1px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px 0 0 0;
}

.scan-frame::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 8px 0;
}

/* -- veil --------------------------------------------------------- */

#veil {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

#veil.on {
  opacity: 1;
}

/* -- attribution (required by the engine licence) ------------------ */

.attrib {
  font-size: 10px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.33);
}

.attrib a {
  color: rgba(255, 255, 255, 0.48);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.attrib.fixed {
  position: fixed;
  left: 50%;
  bottom: calc(2px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 7;
  white-space: nowrap;
  pointer-events: auto;
  font-size: 9px;
}

/* -- qr ----------------------------------------------------------- */

#qr {
  display: block;
  width: 176px;
  height: 176px;
  margin: 6px auto 14px;
  padding: 8px;
  border-radius: 10px;
  background: #f2f2ee;
  image-rendering: pixelated;
}

/* -- toast -------------------------------------------------------- */

.abyss-body .toast {
  z-index: 8;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

/* -- AR camera vignette (kept minimal) ---------------------------- */

.abyss-body.ar-running::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.32), transparent 24%);
}

/* -- desktop tuning ----------------------------------------------- */

@media (min-width: 900px) {
  .panel {
    left: clamp(32px, 6vw, 96px);
    bottom: 30px;
    transform: none;
    width: 360px;
  }
  .panel.centered {
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
  }
  .bar {
    bottom: 26px;
  }
}
