* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#camerafeed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#overlay-2d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#hud {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #4eff4e;
  font-family: monospace;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  line-height: 1.6;
  max-width: 260px;
}

#phase-indicator {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.phase-scanning {
  background: rgba(255, 200, 0, 0.3);
  color: #ffc800;
}

.phase-tracking {
  background: rgba(78, 255, 78, 0.2);
  color: #4eff4e;
}

#objects-line {
  color: #aaa;
  font-size: 11px;
  word-break: break-word;
}

#bottom-bar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

#reset-btn {
  background: rgba(255, 60, 60, 0.8);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: bold;
  padding: 12px 32px;
  border-radius: 24px;
  cursor: pointer;
  letter-spacing: 2px;
}

#reset-btn:active {
  background: rgba(255, 60, 60, 1);
}

#debug-toggle {
  background: rgba(100, 100, 100, 0.6);
  color: #ccc;
  border: none;
  font-size: 12px;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 24px;
  cursor: pointer;
  letter-spacing: 1px;
}

#debug-toggle:active {
  background: rgba(100, 100, 100, 0.9);
}

#debug-panel {
  display: none;
  position: absolute;
  bottom: 80px;
  left: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #0ff;
  font-family: monospace;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 10;
  word-break: break-all;
}

#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: sans-serif;
  z-index: 20;
}

#loading-overlay.hidden {
  display: none;
}

.loading-content {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #4eff4e;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
