:root {
  --bg-0: #02030a;
  --bg-1: #081327;
  --panel-bg: rgba(4, 10, 24, 0.7);
  --panel-border: rgba(106, 181, 255, 0.45);
  --text-main: #d8ebff;
  --text-soft: rgba(216, 235, 255, 0.78);
  --accent: #57d7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(120% 85% at 10% -10%, rgba(49, 91, 194, 0.35), transparent 62%),
    radial-gradient(90% 80% at 100% 100%, rgba(0, 175, 182, 0.24), transparent 58%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1));
  color: var(--text-main);
}

.app {
  width: 100%;
  height: 100%;
  padding: 0;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(10px, 1.2vw, 16px);
  border: 1px solid rgba(99, 162, 255, 0.22);
  box-shadow:
    0 25px 90px rgba(0, 0, 0, 0.45),
    inset 0 0 80px rgba(23, 108, 204, 0.18);
}

#camera,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
  transform-origin: center;
}

#camera {
  object-fit: cover;
  filter: contrast(1.08) saturate(1.04);
  background: #000;
}

#overlay {
  pointer-events: auto;
  touch-action: none;
}

.debug-overlay {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: grid;
  gap: 0.2rem;
  max-width: min(72vw, 300px);
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(132, 198, 255, 0.45);
  background: rgba(6, 14, 30, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  color: rgba(228, 241, 255, 0.92);
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 120ms ease, transform 140ms ease;
  pointer-events: none;
}

.debug-overlay p {
  margin: 0;
}

.debug-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

.status-chip {
  position: absolute;
  bottom: 0.95rem;
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 4;
  max-width: min(82vw, 420px);
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(150, 214, 255, 0.58);
  background: rgba(6, 16, 34, 0.86);
  color: #e9f5ff;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 140ms ease, transform 160ms ease;
  pointer-events: none;
}

.status-chip.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 700px) {
  .stage {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}
