* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: #0f1115;
  color: white;
  text-align: center;
  padding: 30px;
}

/* =========================
   HEADER
========================= */
h1 span {
  color: #7c5cff;
}

/* =========================
   BUTTONS
========================= */
button {
  margin: 10px;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #7c5cff;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

button:hover {
  background: #6848ff;
  transform: translateY(-1px);
}

/* =========================
   CANVAS
========================= */
canvas {
  margin-top: 20px;
  max-width: 100%;
  border: 1px solid #2d3345;
  border-radius: 10px;
  background: #0f1115;
}

/* =========================
   OVERLAY (FIXED)
========================= */
#overlay {
  position: fixed;
  inset: 0;
  display: none;
  cursor: crosshair;

  /* 👇 mais leve e evita artefato */
  background: rgba(0, 0, 0, 0.5);

  /* 👇 evita flicker e bug visual */
  will-change: opacity;
  backface-visibility: hidden;

  z-index: 9999;
}

/* =========================
   SELECTION BOX
========================= */
#selectionBox {
  position: absolute;

  border: 2px dashed #7c5cff;

  /* 👇 evita borda branca fantasma */
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 92, 255, 0.8);

  background: transparent;

  pointer-events: none;

  /* 👇 melhora renderização */
  transform: translateZ(0);
}

#newCapture {
  background: #22c55e;
}

#newCapture:hover {
  background: #16a34a;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  button {
    width: 100%;
  }
}