:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #100c15;
  color: #fff4fa;
  font-synthesis: none;
  --pink: #ff2786;
  --muted: #c1b5c7;
  --line: #47354d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button, .photo-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, .photo-button:focus-within {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
.app {
  width: min(100%, 570px);
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}
.heading { margin: 0 0 24px; }
.eyebrow { color: var(--pink); font-size: 12px; font-weight: 800; letter-spacing: .19em; }
h1 { font-size: clamp(29px, 8vw, 39px); margin: 8px 0; letter-spacing: -.04em; }
h2 { font-size: 18px; line-height: 1.35; margin: 0 0 8px; }
p { line-height: 1.55; }
.subtitle { color: var(--muted); margin: 0; font-size: 15px; }
.notice {
  border: 1px solid #683946;
  border-left: 4px solid var(--pink);
  background: #2a1926;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.notice p { color: #e6cfdc; margin: 0; font-size: 15px; }
.viewfinder {
  background: #070609;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
}
video { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewfinder-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #bfb2c7;
  line-height: 1.5;
  pointer-events: none;
}
.qr-glyph { color: var(--pink); font-size: 58px; line-height: 1; }
.camera-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #211424ed;
  padding: 8px 12px;
  border-radius: 30px;
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 700;
}
.controls { display: grid; gap: 12px; margin-top: 16px; }
button, .photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 55px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 750;
  font-size: 16px;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
}
.primary { background: var(--pink); color: #160410; }
.secondary { background: #2c2234; color: #fff4fa; border-color: #5c4665; }
button:disabled, .photo-button.is-disabled { opacity: .5; cursor: not-allowed; }
.photo-button { position: relative; overflow: hidden; }
.photo-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.status { margin: 16px 0 24px; color: #ead5a2; min-height: 24px; font-size: 15px; overflow-wrap: anywhere; }
.status.is-error { color: #ffb2c7; }
.code-panel { border-top: 1px solid var(--line); padding-top: 24px; }
.read-warning { font-size: 15px; color: #ead5a2; margin-top: 0; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 18px 0 8px; }
.code-value {
  width: 100%;
  border: 1px solid #765878;
  border-radius: 10px;
  padding: 15px 12px;
  background: #08060b;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  margin-bottom: 12px;
}
.code-panel button + button { margin-top: 12px; }
.small-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.return-panel { margin-top: 24px; }
footer { color: var(--muted); border-top: 1px solid var(--line); margin-top: 28px; padding-top: 16px; text-align: center; }
footer p { margin: 8px 0; }
@media (min-width: 480px) {
  .app { padding-left: 30px; padding-right: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease; }
  .primary:hover { background: #ff59a1; }
  .secondary:hover { background: #392c43; }
}
