:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: #f8f8f4;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -20%, #343434 0, #151515 38%, #080808 72%),
    #080808;
}

button, a { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

.shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.panel {
  width: 100%;
  padding: 36px 26px;
  border: 1px solid #424242;
  border-radius: 24px;
  background: rgba(18, 18, 18, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: #b5ff63;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 8vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

p { line-height: 1.55; }

.lede {
  max-width: 34ch;
  margin: 18px auto 0;
  color: #d2d2cc;
  font-size: 1.05rem;
}

.hint {
  margin: 20px auto 0;
  color: #969690;
  font-size: 0.85rem;
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.button {
  width: 100%;
  min-height: 52px;
  display: inline-grid;
  place-items: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.panel > .button { margin-top: 28px; }

.primary {
  color: #0a0a0a;
  background: #b5ff63;
}

.secondary {
  color: #f8f8f4;
  border-color: #4b4b4b;
  background: #1d1d1d;
}

.button:focus-visible, .icon-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.countdown {
  margin: 22px 0 10px;
  color: #b5ff63;
  font-size: clamp(5rem, 28vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.scanner-shell {
  display: block;
  padding-left: 0;
  padding-right: 0;
}

.scanner-shell > .panel { margin: max(24px, env(safe-area-inset-top)) 20px; width: calc(100% - 40px); }

.scanner-view {
  width: 100%;
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 20px 16px;
}

.scanner-header h1 { font-size: clamp(1.55rem, 7vw, 2.15rem); }

.scanner-header .eyebrow { margin-bottom: 6px; }

.icon-button {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #4b4b4b;
  border-radius: 50%;
  color: #fff;
  background: #1d1d1d;
  font: 400 2rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.camera-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 56dvh;
  overflow: hidden;
  background: #000;
}

.camera-frame video {
  width: 100%;
  height: 100%;
  min-height: 56dvh;
  display: block;
  object-fit: cover;
}

.scan-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72vw, 340px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 3px solid rgba(181, 255, 99, 0.88);
  border-radius: 28px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.camera-status {
  min-height: 52px;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  color: #d2d2cc;
  text-align: center;
}

@media (min-width: 640px) {
  .scanner-shell { padding-left: 20px; padding-right: 20px; }
  .scanner-view { overflow: hidden; border: 1px solid #424242; border-radius: 28px; }
}
