/* In-app camera scanner overlay (views/scanner.js) — press-to-scan stickers
   into the cart or trade. Shared by both surfaces. */

.v9-scan-overlay {
  position: fixed; inset: 0; z-index: 260;
  display: grid; place-items: center;
  background: rgba(4, 4, 6, 0.82);
  backdrop-filter: blur(6px);
  padding: var(--v9-space-4);
}

.v9-scan-panel {
  width: min(26rem, 100%);
  display: grid; gap: var(--v9-space-3);
  background: var(--v9-bg-1, #0b0b0e);
  border: 1px solid var(--v9-line);
  padding: var(--v9-space-4);
}

.v9-scan-head { display: flex; align-items: center; justify-content: space-between; gap: var(--v9-space-3); }

.v9-scan-stage {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #000;
  border: 1px solid var(--v9-line);
}
.v9-scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.v9-scan-reticle {
  position: absolute; inset: 18%;
  border: 2px solid color-mix(in srgb, var(--v9-accent) 75%, transparent);
  pointer-events: none;
}
.v9-scan-reticle::before, .v9-scan-reticle::after { content: none; }

.v9-scan-flash {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--v9-accent); opacity: 0;
}
.v9-scan-flash.is-hit { animation: v9-scan-hit 320ms ease-out; }
@keyframes v9-scan-hit { from { opacity: 0.55; } to { opacity: 0; } }

.v9-scan-status { color: var(--v9-text-dim); font-size: var(--v9-text-sm); min-height: 1.4em; }

/* Camera-shutter capture: big, round, centered — a thumb target, not a form
   button (Donovan: "hard to tap with my fingers"). Flat accent ring, no blur. */
.v9-scan-capture {
  justify-self: center;
  width: 4.5rem; height: 4.5rem;
  padding: 0;
  border-radius: 50%;
  font: 700 var(--v9-text-sm) var(--v9-font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--v9-accent) 28%, transparent);
}
.v9-scan-capture:active:not(:disabled) { transform: scale(0.94); }
.v9-scan-capture:disabled { box-shadow: 0 0 0 4px rgba(246, 246, 248, 0.08); }

@media (max-width: 560px) {
  .v9-scan-overlay { padding: var(--v9-space-2); align-items: end; }
  .v9-scan-panel { width: 100%; }
}

/* touch devices: the overlay blur is a GPU cost — solid tint instead */
@media (pointer: coarse) {
  .v9-scan-overlay { backdrop-filter: none; background: rgba(4, 4, 6, 0.94); }
}
