:root {
  font-family: 'DM Mono', monospace;
  color: #ff3333;
  background: #000;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #000; }
button { font: inherit; color: inherit; border: 0; border-radius: 0; cursor: pointer; }
.app-shell { position: fixed; inset: 0; background: #000; }
.camera-view { position: absolute; inset: 0; visibility: hidden; overflow: hidden; }
#camera, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
#camera { object-fit: cover; }
#camera.is-mirrored { transform: scaleX(-1); }
#overlay { pointer-events: none; }
#camera-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  font-size: clamp(14px, 3.5vw, 20px);
  text-align: center;
}
#button-copy { max-width: 36ch; line-height: 1.6; }
.is-scanning .camera-view { visibility: visible; }
.is-scanning #camera-button { display: none; }
.stats {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  gap: 20px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
#switch-camera {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  min-height: 48px;
  padding: 12px 16px;
  background: #000;
  font-size: 14px;
  max-width: calc(100% - 32px);
  white-space: normal;
}
button:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
button:disabled { cursor: wait; }
#switch-camera:disabled { opacity: .5; }
@media (orientation: landscape) {
  #switch-camera {
    top: 50%;
    right: max(16px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
  }
}
