body {
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Let clicks pass through to canvas for gestures */
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 40px;
  align-items: center;
}

.controls {
  pointer-events: auto;
  /* Enable clicks for buttons */
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 30px;
  display: flex;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

button {
  border: none;
  background: transparent;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.3s ease;
}

button.active {
  background: #007AFF;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

#scanning-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 20px;
  border-radius: 10px;
}

.hidden {
  display: none !important;
}

/* Shared Back Button Style */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(5px);
  pointer-events: auto;
  /* Ensure clickable even in overlay */
}

.back-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}