/* scanner.css — Aurore dark mode design system */
/* Follows theme.css tokens: --accent #6C63FF, --bg-dark, glassmorphism */

/* ─── Dark body ───────────────────────────────────────────────── */
:root {
  --scan-bg: #080B14;
  --scan-surface: rgba(255,255,255,0.05);
  --scan-surface-2: rgba(255,255,255,0.08);
  --scan-border: rgba(255,255,255,0.1);
  --scan-border-accent: rgba(108,99,255,0.4);
  --scan-text: #E8EAF0;
  --scan-muted: #8A8FA8;
  --scan-glow: rgba(108,99,255,0.3);
}
html, body { background: var(--scan-bg); color: var(--scan-text); }

/* ─── Nav ─────────────────────────────────────────────────────── */
.scanner-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,11,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--scan-border);
  padding: 0 1.25rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: 1.25rem;
  color: var(--scan-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-album-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--scan-muted);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.nav-album-btn:hover { color: var(--accent); background: var(--scan-surface-2); }
.nav-back { display: none; }
.back-btn {
  background: none; border: none; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-size: 0.85rem;
  color: var(--accent); font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: background 0.15s;
}
.back-btn:hover { background: var(--scan-surface-2); }

/* ─── Section eyebrow ──────────────────────────────────────────── */
.section-eyebrow {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--scan-muted); margin-bottom: 0.6rem;
}

/* ─── Home panel ──────────────────────────────────────────────── */
.scanner-home {
  max-width: 480px; margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  min-height: calc(100vh - 56px);
}

/* Profile card — glassmorphism dark */
.profile-card {
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(108,99,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.profile-score { text-align: center; flex: 1; }
.score-num {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 3rem; font-weight: 800;
  color: var(--accent);
  line-height: 1; letter-spacing: -0.03em;
  text-shadow: 0 0 24px var(--scan-glow);
}
.score-label {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--scan-muted);
  font-weight: 500; margin-top: 0.2rem;
}
.profile-right { display: flex; flex-direction: column; gap: 0.75rem; }
.profile-stat { text-align: right; }
.stat-num {
  font-family: 'Manrope', sans-serif;
  font-size: 1.7rem; font-weight: 700;
  color: var(--scan-text);
  line-height: 1;
}
.stat-label {
  display: block; font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--scan-muted); margin-top: 0.15rem;
}

/* Scan action */
.scan-action { text-align: center; }
.scan-btn {
  width: 200px; height: 200px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #5A52E0);
  border: none; cursor: pointer;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 16px 48px var(--scan-glow), 0 0 0 1px rgba(255,255,255,0.08) inset;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s;
  color: white; position: relative; overflow: hidden;
}
.scan-btn::after {
  content: '';
  position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.15), transparent 30%);
  animation: scan-rotate 3s linear infinite;
}
.scan-btn:active {
  transform: scale(0.94);
  box-shadow: 0 8px 24px var(--scan-glow);
}
.scan-btn:active::after { animation-play-state: paused; }
.scan-icon-wrap { display: block; position: relative; z-index: 1; }
.scan-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  color: white; letter-spacing: 0.01em;
  position: relative; z-index: 1;
}
.scan-hint {
  font-size: 0.8rem; color: var(--scan-muted);
  margin-top: 0.75rem; max-width: 28ch; margin-left: auto; margin-right: auto;
}
@keyframes scan-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Scanning animation */
.scanning-state {
  display: none; flex-direction: column;
  align-items: center; padding: 2rem 0; gap: 1rem;
}
.scan-animation {
  position: relative; width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
}
.radar-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
  animation: radar-ping 2s ease-out infinite;
}
.r1 { width: 80px;  height: 80px;  animation-delay: 0s; }
.r2 { width: 130px; height: 130px; animation-delay: 0.4s; }
.r3 { width: 180px; height: 180px; animation-delay: 0.8s; }
@keyframes radar-ping {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1);   opacity: 0; }
}
.radar-center { font-size: 2rem; position: relative; z-index: 1; }
.scanning-label { font-size: 0.9rem; color: var(--scan-muted); font-weight: 500; }

/* Badges */
.badges-section, .collection-section { display: flex; flex-direction: column; }
.badge-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 100px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--scan-text);
  backdrop-filter: blur(8px);
}
.badge-chip-icon { font-size: 0.9rem; }

/* Collection list */
.landmark-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lm-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}
.lm-item:hover { border-color: var(--scan-border-accent); }
.lm-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.lm-item-info { display: flex; align-items: center; justify-content: space-between; flex: 1; }
.lm-item-name { font-size: 0.9rem; font-weight: 500; color: var(--scan-text); }
.lm-item-points { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

.empty-state {
  font-size: 0.85rem; color: var(--scan-muted);
  font-style: italic;
}

/* ─── Step panels ────────────────────────────────────────────── */
.scanner-step-panel {
  max-width: 480px; margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  align-items: center;
  min-height: 80vh;
}
.step-header { text-align: center; width: 100%; }
.step-label {
  display: inline-block;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.25);
  padding: 0.3rem 0.85rem; border-radius: 100px;
  margin-bottom: 0.75rem;
}
.step-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--scan-text); line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.step-subtitle {
  font-size: 0.85rem; color: var(--scan-muted); line-height: 1.6;
}

/* Viewfinder — replaces the raw white circle */
.viewfinder-wrap {
  position: relative;
  width: 220px; height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.viewfinder-ring {
  position: absolute; inset: 0;
  border-radius: 24px;
  border: 2px solid rgba(108,99,255,0.5);
  animation: viewfinder-pulse 2.5s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(108,99,255,0.2) inset, 0 0 40px rgba(108,99,255,0.1);
}
.viewfinder-corners {
  position: absolute; inset: -2px;
  border-radius: 24px;
  overflow: hidden;
}
.corner {
  position: absolute;
  width: 28px; height: 28px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
}
.corner-tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 24px; }
.corner-tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 24px; }
.corner-bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 24px; }
.corner-br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 24px; }
.viewfinder-center {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.2) 0%, rgba(108,99,255,0.05) 70%, transparent 100%);
  border: 1px solid rgba(108,99,255,0.3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 32px rgba(108,99,255,0.15);
  position: relative; z-index: 1;
}
.viewfinder-center svg { color: var(--accent); opacity: 0.8; }
@keyframes viewfinder-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.03); }
}

/* Camera trigger — styled card */
.camera-trigger {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 2.5rem 2rem;
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 24px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.2s, box-shadow 0.25s;
  backdrop-filter: blur(12px);
  position: relative; overflow: hidden;
}
.camera-trigger::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(108,99,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.camera-trigger:hover {
  border-color: var(--scan-border-accent);
  background: rgba(108,99,255,0.07);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(108,99,255,0.15);
  transform: translateY(-2px);
}
.camera-trigger:active { transform: scale(0.97); }

.camera-lens {
  width: 96px; height: 96px;
  background: radial-gradient(circle, rgba(108,99,255,0.2) 0%, rgba(108,99,255,0.05) 70%, transparent 100%);
  border: 1.5px solid rgba(108,99,255,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  box-shadow: 0 0 40px rgba(108,99,255,0.2);
  animation: lens-glow 3s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes lens-glow {
  0%, 100% { box-shadow: 0 0 32px rgba(108,99,255,0.2); }
  50%       { box-shadow: 0 0 56px rgba(108,99,255,0.35); }
}
.camera-hint {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem; font-weight: 600;
  color: var(--scan-text);
  position: relative; z-index: 1;
}
.camera-or { font-size: 0.78rem; color: var(--scan-muted); }

.camera-actions { display: flex; justify-content: center; }
.step-cancel-btn {
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  padding: 0.7rem 1.5rem; border-radius: 10px;
  font-family: 'Manrope', sans-serif; font-size: 0.85rem;
  color: var(--scan-muted); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.step-cancel-btn:hover {
  border-color: rgba(108,99,255,0.4);
  color: var(--accent);
  background: rgba(108,99,255,0.06);
}

/* Capture preview */
.capture-preview { width: 100%; display: flex; justify-content: center; }
.capture-thumb-wrap {
  width: 200px; height: 200px;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 2px solid rgba(108,99,255,0.4);
  position: relative;
}
.capture-thumb-wrap::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.capture-thumb { width: 100%; height: 100%; object-fit: cover; }

/* Validation rings */
.validation-state { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.validation-rings {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.val-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
  animation: radar-ping 1.8s ease-out infinite;
}
.vr1 { width: 50px;  height: 50px;  animation-delay: 0s; }
.vr2 { width: 75px;  height: 75px;  animation-delay: 0.35s; }
.vr3 { width: 100px; height: 100px; animation-delay: 0.7s; }
.val-icon { font-size: 1.75rem; position: relative; z-index: 1; }
.val-label {
  font-size: 0.85rem; color: var(--scan-muted);
  font-weight: 500; text-align: center; max-width: 26ch;
  font-family: 'Manrope', sans-serif;
}

.capture-actions { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }

/* ─── Result panel ────────────────────────────────────────────── */
.scanner-result {
  max-width: 480px; margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
  display: flex; flex-direction: column; gap: 1.5rem; align-items: center;
}

.result-landmark {
  width: 100%;
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
}
.result-landmark::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #00D4FF);
  border-radius: 20px 20px 0 0;
}
.lm-category-tag {
  display: inline-block;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  padding: 0.25rem 0.75rem; border-radius: 100px; width: fit-content;
}
.lm-name {
  font-family: 'Manrope', sans-serif;
  font-size: 1.7rem; font-weight: 700;
  color: var(--scan-text); line-height: 1.2;
  letter-spacing: -0.02em;
}
.lm-desc {
  font-size: 0.9rem; line-height: 1.7;
  color: var(--scan-muted);
}
.lm-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.lm-points-badge {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, var(--accent), #5A52E0);
  color: white; font-size: 0.9rem; font-weight: 600;
  padding: 0.4rem 1rem; border-radius: 100px;
  box-shadow: 0 4px 16px var(--scan-glow);
  font-family: 'Manrope', sans-serif;
}
.lm-distance { font-size: 0.8rem; color: var(--scan-muted); }

.collect-btn {
  width: 100%; padding: 1rem;
  background: linear-gradient(135deg, var(--accent), #5A52E0);
  color: white; border: none; border-radius: 14px;
  font-family: 'Manrope', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px var(--scan-glow);
}
.collect-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--scan-glow);
}
.collect-btn:active:not(:disabled) { transform: scale(0.98); }
.collect-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.collect-btn.collected {
  background: rgba(255,255,255,0.1);
  cursor: default; transform: none;
}

.result-back-btn {
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  padding: 0.75rem 1.5rem; border-radius: 12px;
  font-family: 'Manrope', sans-serif; font-size: 0.9rem; color: var(--scan-muted);
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.result-back-btn:hover {
  border-color: var(--scan-border-accent);
  color: var(--accent);
  background: rgba(108,99,255,0.06);
}

/* Not found / error cards — glassmorphism */
.notfound-card {
  width: 100%;
  background: var(--scan-surface);
  border: 1px solid var(--scan-border);
  border-radius: 20px; padding: 2.5rem 1.75rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.nf-icon { font-size: 2.5rem; }
.nf-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--scan-text);
}
.nf-body { font-size: 0.9rem; line-height: 1.65; color: var(--scan-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  padding: 0.75rem 1.5rem; border-radius: 100px;
  font-size: 0.85rem; font-weight: 500; font-family: 'Manrope', sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 100; white-space: nowrap;
  animation: toast-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(12px);
}
.toast-success {
  background: rgba(108,99,255,0.9);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
}
.toast-error {
  background: rgba(220,50,50,0.9);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ─── Success panel ───────────────────────────────────────────── */
#success-panel {
  min-height: 100vh; overflow: hidden;
  background: linear-gradient(180deg, #080B14 0%, rgba(108,99,255,0.06) 40%, transparent 70%);
  justify-content: center;
}
.success-card {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  text-align: center;
  padding: 1rem 0;
}
.success-badge {
  width: 88px; height: 88px;
  background: linear-gradient(135deg, var(--accent), #00D4FF);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 48px rgba(108,99,255,0.5), 0 0 0 4px rgba(108,99,255,0.15);
  animation: success-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  position: relative;
}
.success-badge::after {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.2) 0%, transparent 70%);
  animation: badge-glow 2s ease-in-out infinite;
}
.success-check { font-size: 2.5rem; color: white; font-weight: 700; }
@keyframes success-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes badge-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}
.success-points {
  font-family: 'Manrope', sans-serif;
  font-size: 2.8rem; font-weight: 800;
  color: var(--accent);
  line-height: 1; letter-spacing: -0.03em;
  text-shadow: 0 0 32px var(--scan-glow);
}
.success-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--scan-text);
  letter-spacing: -0.02em;
}
.success-landmark { width: 100%; }
.success-landmark .result-landmark { padding: 1.25rem; }
.badge-earned-banner {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #00D4FF);
  color: white; font-size: 0.8rem; font-weight: 600;
  padding: 0.35rem 0.9rem; border-radius: 100px;
  box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}

/* Badge earned in success panel */
.badge-earned {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--scan-surface);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(108,99,255,0.12);
  animation: fade-in-up 0.4s ease-out 0.3s both;
  width: 100%;
}
.badge-earned-icon { font-size: 1.8rem; }
.badge-earned-name { font-size: 0.95rem; font-weight: 600; color: var(--scan-text); }
.badge-earned-desc { font-size: 0.78rem; color: var(--scan-muted); }

/* Confetti */
#confetti-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 150;
}

/* Shimmer loading on buttons */
.shimmer {
  position: relative; overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}
@keyframes shimmer-sweep {
  from { left: -100%; }
  to   { left: 200%; }
}

/* ─── Success enter animation ─────────────────────────────────── */
@keyframes success-enter {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

/* ─── Fiche panel ────────────────────────────────────────────── */
@keyframes slide-up-fiche {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fiche-panel {
  max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* Photo header */
.fiche-photo-wrap {
  width: 100%; position: relative;
  max-height: 280px; overflow: hidden;
}
.fiche-photo-inner { position: relative; }
.fiche-photo {
  width: 100%; height: 280px; object-fit: cover;
  display: block;
}
.fiche-photo-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 1rem;
}
.fiche-photo-label {
  font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-family: 'Manrope', sans-serif;
}
.fiche-photo-placeholder {
  width: 100%; height: 200px;
  background: var(--scan-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  border-bottom: 1px solid var(--scan-border);
}

/* Fiche header — sits above body */
.fiche-header {
  padding: 1.5rem 1.25rem 0;
  text-align: center;
}
.fiche-category-tag {
  display: inline-block;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  padding: 0.25rem 0.75rem; border-radius: 100px; width: fit-content;
  margin-bottom: 0.75rem;
}
.fiche-name {
  font-family: 'Manrope', sans-serif;
  font-size: 2rem; font-weight: 800;
  color: var(--scan-text); line-height: 1.15;
  letter-spacing: -0.03em; margin-bottom: 0.6rem;
}
.fiche-short-desc {
  font-size: 0.88rem; line-height: 1.65;
  color: var(--scan-muted); margin-bottom: 1rem;
}
.fiche-points-badge {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, var(--accent), #5A52E0);
  color: white; font-size: 0.85rem; font-weight: 600;
  padding: 0.35rem 0.9rem; border-radius: 100px;
  box-shadow: 0 4px 16px var(--scan-glow);
  font-family: 'Manrope', sans-serif;
}

/* Fiche body — dynamic sections */
.fiche-body {
  padding: 0.5rem 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0;
}

/* Fiche actions */
.fiche-actions {
  padding: 1rem 1.25rem 5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.fiche-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.95rem;
  border-radius: 14px;
  font-family: 'Manrope', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.fiche-action-album {
  background: linear-gradient(135deg, var(--accent), #5A52E0);
  color: white; border: none;
  box-shadow: 0 4px 20px var(--scan-glow);
}
.fiche-action-album:hover { opacity: 0.9; transform: translateY(-1px); }
.fiche-action-back {
  background: var(--scan-surface);
  color: var(--scan-muted); border: 1px solid var(--scan-border);
}
.fiche-action-back:hover {
  border-color: var(--scan-border-accent);
  color: var(--accent);
  background: rgba(108,99,255,0.06);
}

/* Discover button in success panel */
.discover-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 1rem;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.4);
  border-radius: 14px;
  color: var(--accent);
  font-family: 'Manrope', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.discover-btn:hover {
  background: rgba(108,99,255,0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108,99,255,0.2);
}
@media (max-width: 480px) {
  .scanner-home { padding: 1rem 1rem 6rem; gap: 1rem; }
  .profile-card {
    flex-direction: row;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
    align-items: center;
  }
  .profile-score { text-align: left; flex: unset; }
  .score-num { font-size: 2.2rem; }
  .score-label { display: none; }
  .profile-right { flex-direction: row; gap: 1rem; }
  .profile-stat { text-align: center; }
  .stat-num { font-size: 1.25rem; }
  .stat-label { font-size: 0.6rem; }

  /* Scan button — compact on mobile, above the fold */
  .scan-action { order: -1; }
  .scan-btn {
    width: 140px; height: 140px;
    margin: 0 auto;
  }
  .scan-icon-wrap svg { width: 36px; height: 36px; }
  .scan-label { font-size: 0.8rem; }
  .scan-hint { font-size: 0.72rem; max-width: 26ch; }

  /* Badges + collection below scan button */
  .badges-section, .collection-section { display: none; }

  .capture-thumb-wrap { width: 160px; height: 160px; }
  .viewfinder-wrap { width: 180px; height: 180px; }
  .camera-trigger { padding: 1.75rem 1.5rem; }
}

/* Always show scan button on first screen (mobile-first safety) */
@media (max-width: 375px) {
  .scan-btn { width: 130px; height: 130px; }
  .profile-card { padding: 0.75rem; gap: 0.5rem; }
  .stat-num { font-size: 1.1rem; }
}