:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  background: #101713;
  color: #f5f8f3;
  --muted: #b4c1b7;
  --accent: #bcf29e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; }
main {
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 3.5rem) 1.25rem 2rem;
}
h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.65rem); line-height: 1.1; letter-spacing: -.035em; }
header p { margin: .55rem 0 1.3rem; color: var(--muted); }
.camera {
  position: relative;
  isolation: isolate;
  background: #1b2921;
  border: 1px solid #405147;
  border-radius: 1rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
video { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 57%;
  max-width: 13rem;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.guide i { position: absolute; width: 1.3rem; height: 1.3rem; border: 3px solid var(--accent); }
.guide i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: .45rem; }
.guide i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: .45rem; }
.guide i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: .45rem; }
.guide i:nth-child(4) { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: .45rem; }
button {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: var(--accent);
  color: #13210e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover:enabled { background: #d1f7bd; }
button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
button:disabled { opacity: .62; cursor: default; }
#status { min-height: 1.5em; margin: .6rem 0 0; color: var(--muted); }
#result { margin-top: 1rem; padding: .85rem 1rem; border: 1px solid #405147; border-radius: .65rem; }
h2 { margin: 0; font-size: .95rem; color: var(--accent); }
pre { margin: .4rem 0 0; font: .95rem/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
