:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --fg: #f4f4f6;
  --accent: #ff5d73;
  --muted: #8a8a94;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.screen {
  height: 100dvh;
  width: 100vw;
  display: flex;
}

.screen[hidden] {
  display: none;
}

/* ---------- setup screen ---------- */
#setup {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
}

#setup h1 {
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.tagline {
  color: var(--muted);
  max-width: 320px;
  margin: 0 0 8px;
}

.pick-btn {
  background: var(--accent);
  color: #1a0006;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 16px 32px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.error {
  color: var(--accent);
  max-width: 320px;
}

/* ---------- display screen ---------- */
#display {
  padding: 4vmin;
}

.frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3vmin;
}

.photo-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.qr-badge {
  flex: none;
  width: 22vmin;
  height: 22vmin;
  max-width: 140px;
  max-height: 140px;
  padding: 6px;
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.qr-badge.expanded {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  background: #fff;
}

.qr-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-badge.expanded .qr-canvas {
  width: min(80vw, 80dvh);
  height: min(80vw, 80dvh);
}

.qr-canvas img, .qr-canvas canvas, .qr-canvas table {
  width: 100% !important;
  height: 100% !important;
}
