/* MANA Scanner — 720x1280 portrait, dark theme, touch-optimized */
:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #333;
  --text: #e8e8e8;
  --text-secondary: #999;
  --accent: #c8a94e;        /* MANA gold */
  --accent-dim: #8a7535;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --purple: #a855f7;
  --blue: #3b82f6;
  --foil-gradient: linear-gradient(135deg, #c8a94e, #e8d88e, #a8892e, #e8d88e, #c8a94e);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.kiosk {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* dynamic viewport for mobile Safari */
}

/* ── Top Bar ─────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.top-bar-controls {
  display: flex;
  gap: 8px;
}

.hw-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.hw-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200, 169, 78, 0.1);
}

.hw-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: background 0.15s;
}

.hw-toggle.active .hw-toggle-dot {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* ── Card Area ───────────────────────────────────────── */
.card-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40vh;
  min-height: 180px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image {
  max-height: calc(40vh - 20px);
  max-width: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: none;
}

.card-image.matched {
  border: 3px solid var(--green);
}

.card-image.uncertain {
  border: 3px solid var(--yellow);
}

.card-image.not-found {
  border: 3px solid var(--red);
}

.card-image.foil {
  animation: foilShimmer 3s ease-in-out infinite;
}

@keyframes foilShimmer {
  0%, 100% { box-shadow: 0 4px 24px rgba(200, 169, 78, 0.3); }
  50% { box-shadow: 0 4px 32px rgba(200, 169, 78, 0.6), 0 0 48px rgba(200, 169, 78, 0.2); }
}

/* Placeholder state */
.card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.card-placeholder-icon {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

.card-placeholder-text {
  font-size: 18px;
  font-weight: 500;
}

/* Scanning spinner */
.scanning-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  gap: 10px;
  z-index: 10;
  padding: 20px;
  overflow: hidden;
}

.scanning-overlay.active {
  display: flex;
}

.scanning-progress {
  width: 70%;
  max-width: 280px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.scanning-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.scanning-mascot {
  width: 168px;
  height: 168px;
  margin-bottom: 4px;
  animation: mascotBob 1.5s ease-in-out infinite;
  object-fit: contain;
  flex-shrink: 0;
  max-height: 50%;
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.scanning-text {
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  max-width: 90%;
  line-height: 1.3;
}

/* Sub-line under the scanning text: reassurance detail + (dev only) "Stage N · …" */
.scanning-sub {
  font-size: 12px;
  color: #8b97a5;
  font-weight: 500;
  font-family: 'Space Mono', ui-monospace, monospace;
  letter-spacing: .02em;
  min-height: 14px;
  text-align: center;
}

/* ── Info Area ───────────────────────────────────────── */
.info-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.info-main {
  padding: 16px 20px 12px;
  border-top: 1px solid var(--border);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-back:active {
  background: var(--border);
}

.card-name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.card-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  flex: 1;
}

.wrong-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-wrong, .btn-wrong-foil, .btn-fake {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--red);
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-wrong-foil {
  border-color: var(--yellow);
  background: rgba(234, 179, 8, 0.1);
  color: var(--yellow);
}

.btn-fake {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.btn-wrong:active, .btn-wrong-foil:active, .btn-fake:active {
  transform: scale(0.95);
}

.btn-wrong.sending, .btn-wrong-foil.sending, .btn-fake.sending {
  opacity: 0.6;
  pointer-events: none;
}

.btn-wrong.flagged {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-wrong-foil.flagged {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
}

.btn-fake.flagged {
  background: #ec4899;
  border-color: #ec4899;
  color: #fff;
}

.card-set {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}

.badge-confidence {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.badge-confidence.uncertain {
  background: rgba(234, 179, 8, 0.15);
  color: var(--yellow);
}

.badge-confidence.not-found {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.badge-lang {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.badge-lang.jp {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.badge-foil {
  background: linear-gradient(135deg, rgba(200,169,78,0.2), rgba(232,216,142,0.2));
  color: var(--accent);
}

.badge-nonfoil {
  background: rgba(100, 100, 100, 0.15);
  color: var(--text-secondary);
}

.badge-timing {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 11px;
}

/* Roca Vision-style confidence tier badges (post-2026-05-17).
   Color-coded per tier so customers can read accuracy at a glance.
   GOOD = green, FAIR = amber, POOR = red, MANUAL = blue. */
.badge-tier {
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: help;  /* signals title-tooltip with advice */
}
.badge-tier.tier-good {
  background: rgba(63, 185, 80, 0.18);
  color: #46c45c;
  border: 1px solid rgba(63, 185, 80, 0.4);
}
.badge-tier.tier-fair {
  background: rgba(245, 200, 66, 0.18);
  color: #f5c842;
  border: 1px solid rgba(245, 200, 66, 0.4);
}
.badge-tier.tier-poor {
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
}
.badge-tier.tier-manual {
  background: rgba(34, 211, 238, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.4);
}
/* REVIEW + HARD_REVIEW (post-2026-05-24, economic-risk routing).
   Same color family as FAIR (amber) but more saturated for REVIEW,
   and HARD_REVIEW gets a high-contrast warning red distinct from POOR
   (POOR = "retake the photo", HARD_REVIEW = "verify printing"). */
.badge-tier.tier-review {
  background: rgba(245, 158, 11, 0.22);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.55);
}
.badge-tier.tier-hard_review {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.7);
  font-weight: 800;
}
/* Transparency panel — shown below the main match when REVIEW or
   HARD_REVIEW fires. Lists picked-printing price + runner-up
   alternatives with their prices so customer can see WHY confidence
   is reduced (TCGPlayer Roca Vision pattern: honest about uncertainty). */
.price-risk-panel {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text);
}
.price-risk-panel.hard {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.55);
}
.price-risk-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f59e0b;
}
.price-risk-panel.hard .price-risk-title { color: #fca5a5; }
.price-risk-runner {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 0.5rem;
}
.price-risk-runner:first-of-type { border-top: none; }
.price-risk-runner .pr-label { color: var(--muted); font-family: 'Space Mono', monospace; font-size: 0.75rem; }
.price-risk-runner .pr-price { font-weight: 700; }
.price-risk-runner .pr-delta { color: var(--accent); font-weight: 700; }

.badge-slab {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.badge-ocr {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  font-size: 11px;
}

/* ── Price Area ──────────────────────────────────────── */
.price-area {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.price-idr {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.price-usd {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.price-none {
  font-size: 20px;
  color: var(--text-secondary);
  font-style: italic;
}

.btn-add-collection {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  background: rgba(200, 169, 78, 0.12);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-add-collection svg {
  width: 18px;
  height: 18px;
}

.btn-add-collection:active {
  transform: scale(0.98);
  background: rgba(200, 169, 78, 0.2);
}

.btn-add-collection.sending {
  opacity: 0.6;
  pointer-events: none;
}

.btn-add-collection.added {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--green);
  color: var(--green);
}

.btn-add-collection.failed {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--red);
  color: var(--red);
}

.btn-add-collection-login {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s;
  min-height: 40px;
  touch-action: manipulation;
}

.btn-add-collection-login:active {
  background: var(--surface2);
  color: var(--accent);
}

.top-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s;
  touch-action: manipulation;
}

.top-bar-link svg {
  width: 16px;
  height: 16px;
}

.top-bar-link:active {
  background: var(--border);
}

/* ── Other Printings ─────────────────────────────────── */
.printings-area {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.printings-header {
  padding: 10px 20px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.printing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.printing-row:active,
.printing-row.selected {
  background: var(--surface2);
}

.printing-row.selected {
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}

.printing-thumb {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}

.printing-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.printing-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.printing-setname {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.printing-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  flex-shrink: 0;
}

/* ── Empty state (before first scan) ─────────────────── */
.info-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  gap: 8px;
  padding: 40px;
  text-align: center;
}

.info-empty-title {
  font-size: 20px;
  font-weight: 600;
}

.info-empty-sub {
  font-size: 15px;
  opacity: 0.7;
}

/* ── Bottom Bar ──────────────────────────────────────── */
.bottom-bar {
  height: 100px;
  min-height: 100px;
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  /* safe area for notch/home-indicator devices */
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.btn-scan {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.btn-scan:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.btn-scan:disabled {
  opacity: 0.4;
  transform: none;
}

.btn-scan svg {
  width: 28px;
  height: 28px;
}

.btn-gallery {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-gallery:active {
  transform: scale(0.95);
}

.btn-gallery svg {
  width: 24px;
  height: 24px;
}

.btn-history {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-history:active {
  transform: scale(0.95);
}

.btn-history svg {
  width: 24px;
  height: 24px;
}

.btn-history .history-count {
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ── History Panel ───────────────────────────────────── */
.history-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
  flex-direction: column;
}

.history-panel.open {
  display: flex;
}

.history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.history-title {
  font-size: 18px;
  font-weight: 700;
}

.history-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  border-radius: 8px;
}

.history-close:active {
  background: var(--surface2);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.history-item:active {
  background: var(--surface2);
}

.history-item-img {
  width: 48px;
  height: 67px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface2);
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-set {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.history-item-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-item-right {
  text-align: right;
}

.hist-add {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: rgba(200, 169, 78, 0.12);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
  margin-left: 4px;
}

.hist-add svg {
  width: 18px;
  height: 18px;
}

.hist-add:active { transform: scale(0.92); background: rgba(200, 169, 78, 0.24); }
.hist-add.sending { opacity: 0.5; pointer-events: none; }
.hist-add.added {
  background: rgba(34, 197, 94, 0.18);
  border-color: var(--green);
  color: var(--green);
  cursor: default;
}
.hist-add.failed {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--red);
  color: var(--red);
}

.hist-add-qty {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.history-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
}

/* ── Upload overlay ──────────────────────────────────── */
.upload-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
}

.btn-upload {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-upload:active {
  background: var(--border);
}

.btn-upload svg {
  width: 22px;
  height: 22px;
}

/* ── Scrollbar (thin, subtle) ────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Desktop simulation ──────────────────────────────── */
@media (min-width: 721px) {
  html, body {
    max-width: 720px;
    max-height: 1280px;
    margin: 0 auto;
    border: 1px solid #333;
  }
}

/* ── Landscape (Pi 5 DSI 1280x720, landscape tablets) ──────
   Portrait base is a vertical stack; in landscape we switch to a
   2-column grid: card on the left (full height), info + SCAN on the
   right. Reuses the existing markup via grid-template-areas. */
@media (orientation: landscape) and (min-width: 720px) {
  html, body { max-width: none; max-height: none; margin: 0; border: none; }

  body.kiosk {
    display: grid;
    grid-template-columns: 46% 54%;
    grid-template-rows: 56px 1fr auto;
    grid-template-areas:
      "topbar topbar"
      "card   info"
      "card   bottom";
    height: 100dvh;
  }

  .top-bar    { grid-area: topbar; }
  .card-area  { grid-area: card; height: auto; min-height: 0; border-right: 1px solid var(--border); }
  .info-area  { grid-area: info; overflow-y: auto; }
  .bottom-bar { grid-area: bottom; }

  /* card fills the tall left column instead of the portrait 40vh cap */
  .card-image { max-height: calc(100dvh - 84px); max-width: 94%; }

  /* station webcam is physically mounted rotated — rotate the live
     preview 90deg CW so the card reads upright (capture is rotated to
     match in scanner.js). */
  .cam-video { transform: rotate(90deg); }
}

/* ── Live webcam capture ─────────────────────────────── */
.cam-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.btn-shutter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 11;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.btn-shutter:active { transform: translateX(-50%) scale(0.92); }
.btn-shutter svg { width: 30px; height: 30px; }

.btn-cam-cancel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 11;
}

.btn-cam-cancel svg { width: 20px; height: 20px; }

.btn-autoscan {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(calc(-100% - 44px));
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  z-index: 11;
}

.btn-autoscan.active {
  background: var(--accent);
  color: #000;
  border-color: #fff;
}

.btn-autoscan svg { width: 18px; height: 18px; }
.btn-autoscan.active svg { animation: spin 2s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
