:root {
  --bg: #0B0906;
  --panel: #17130E;
  --card: #1F1912;
  --card-back: #241C13;
  --gold: #E3A63F;
  --gold-soft: rgba(227,166,63,0.12);
  --gold-dim: rgba(227,166,63,0.55);
  --gold-text: #1B1204;
  --text: #F4ECDA;
  --text-2: #C9BDA4;
  --text-3: #A99A80;
  --text-4: #6E6455;
  --line: rgba(244,236,218,0.1);
  --line-soft: rgba(244,236,218,0.08);
  --green: #7FAE8B;
  --red: #C6493B;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); overflow: hidden; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  height: 100dvh;
  display: flex;
  justify-content: center;
}
::-webkit-scrollbar { display: none; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #F0BE66; text-decoration: underline; }

@keyframes scanSweep { 0% { transform: translateY(-120%); } 100% { transform: translateY(120%); } }
@keyframes popIn { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes loadingPulse { 0%, 100% { opacity: .4; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
.loading-pulse { animation: loadingPulse 1.4s ease-in-out infinite; }
@keyframes fadeScale { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }

/* Mobile: the app IS the viewport — edge to edge, no wasted chrome, so
   every screen's content and buttons always fit without scrolling the
   outer page (only #screen-root scrolls internally when a screen's own
   content is taller than the available space). */
#phone {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
#screen-root { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; min-height: 0; }

/* Desktop/tablet: enough room to show the app as a floating phone mockup
   instead of stretching full-height. */
@media (min-width: 431px) {
  body { padding: 32px 16px; align-items: center; overflow: auto; }
  html, body { overflow: auto; height: auto; min-height: 100%; }
  #phone {
    height: min(900px, 100dvh - 64px);
    border-radius: 32px;
    border: 1px solid var(--line-soft);
    box-shadow: 0 40px 90px rgba(0,0,0,0.55);
  }
}
.screen { animation: popIn .35s ease; }

.btn {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  font-weight: 700; font-size: 16px; cursor: pointer; font-family: var(--font-body);
}
.btn-primary { background: var(--gold); color: var(--gold-text); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-outline { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-icon {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer; font-size: 16px; line-height: 1;
}

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-3); text-transform: uppercase; }
.eyebrow-gold { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; text-align: center; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: .5px; }

.leads-pill {
  display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-family: var(--font-mono); font-size: 13px; color: var(--gold);
}
.leads-pill span.unit { color: var(--text-3); }

.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width .2s; }

.dashed-card { border: 1px dashed rgba(244,236,218,0.16); border-radius: 16px; padding: 14px 18px; }

.circle-photo { border-radius: 50%; overflow: hidden; position: relative; background: var(--card); }
.circle-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.circle-photo .placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; color: var(--text-4); font-size: 12px; text-align: center; padding: 12px; cursor: pointer; }
.circle-photo .placeholder-icon { color: var(--gold); border: 1.5px dashed var(--gold-dim); border-radius: 50%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; flex: none; }

.chip { padding: 6px 12px; border-radius: 999px; font-size: 11px; font-family: var(--font-mono); border: 1px solid var(--line); color: var(--text-4); opacity: .6; }
.chip.active { border-color: var(--gold); color: var(--gold); opacity: 1; }

.category-tab {
  flex: none; padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text-3); font-family: var(--font-body);
}
.category-tab.active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }

.match-locked {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 12px 14px; position: relative; overflow: hidden;
}
.match-locked .avatar-blur {
  width: 52px; height: 52px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  filter: blur(9px) saturate(1.15); transform: scale(1.15);
}
.match-locked .avatar-blur img { width: 100%; height: 100%; object-fit: cover; display: block; }
.match-locked .avatar-blur-tint { position: absolute; inset: 0; opacity: .35; mix-blend-mode: color; }
.match-locked .info { flex: 1; filter: blur(3px); opacity: .7; }
.match-locked .platform { font-weight: 600; font-size: 14px; }
.match-locked .meta { font-size: 12px; color: var(--text-3); }
.match-locked .locked-tag { font-size: 11px; font-family: var(--font-mono); color: var(--text-4); flex: none; }
.match-locked-dim { background: rgba(31,25,18,0.55); border-color: rgba(244,236,218,0.05); }

/* Colorful blurred backdrop behind the paywall content — same idea as a
   blurred photo-collage background, but built from our own category
   palette instead of any external imagery, so it stays original. */
.paywall-bg {
  position: absolute; inset: -10%; z-index: 0; filter: blur(50px); opacity: .5; pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, var(--gold) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, var(--red) 0%, transparent 40%),
    radial-gradient(circle at 20% 85%, var(--green) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, var(--gold) 0%, transparent 45%);
}
.paywall-scrim { position: absolute; inset: 0; z-index: 0; background: rgba(11,9,6,0.62); pointer-events: none; }

.result-card {
  position: relative; display: block; width: 100%; height: 220px; border-radius: 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line-soft); text-decoration: none;
}
.result-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-card-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 28px; color: var(--gold-text);
}
.result-card-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: linear-gradient(180deg, rgba(11,9,6,0.75), transparent);
}
.result-card-platform { font-weight: 700; font-size: 13px; color: var(--text); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.result-card-score {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--gold-text);
  background: var(--gold); padding: 3px 10px; border-radius: 999px;
}
.result-card-source {
  position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(11,9,6,0.6); backdrop-filter: blur(4px); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.pack-card {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-radius: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--card);
}
.pack-card.selected { border: 1.5px solid var(--gold); background: rgba(227,166,63,0.08); }
.pack-radio { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1.5px solid rgba(244,236,218,.3); }
.pack-card.selected .pack-radio { border: 5px solid var(--gold); }
.pack-badge {
  position: absolute; top: -9px; right: 14px; background: var(--gold); color: var(--gold-text);
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .5px;
}

.badge-card { background: var(--card); border-radius: 14px; padding: 14px; text-align: center; }
.badge-card.locked { opacity: .45; }
.badge-stamp {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; border: 1.5px solid var(--gold); color: var(--gold);
}
.badge-card.locked .badge-stamp { border: 1.5px dashed rgba(244,236,218,.25); color: var(--text-4); }
.badge-label { font-size: 11px; color: var(--text-2); line-height: 1.3; }

.stat-tile { flex: 1; background: var(--card); border-radius: 14px; padding: 14px; text-align: center; }
.stat-tile .num { font-family: var(--font-mono); font-size: 18px; color: var(--gold); }
.stat-tile .lbl { font-size: 11px; color: var(--text-3); }

.bottom-nav { display: flex; border-top: 1px solid var(--line); background: var(--panel); flex: none; }
.nav-tab { flex: 1; background: none; border: none; cursor: pointer; padding: 14px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-body); }
.nav-indicator { display: block; width: 18px; height: 2px; border-radius: 2px; background: transparent; }
.nav-tab.active .nav-indicator { background: var(--gold); }
.nav-label { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); }
.nav-tab.active .nav-label { color: var(--gold); }

.overlay { position: absolute; inset: 0; background: rgba(11,9,6,0.82); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10; }
.overlay-card { background: var(--card); border: 1.5px solid var(--gold); border-radius: 18px; padding: 32px 24px; text-align: center; max-width: 280px; animation: fadeScale .35s ease; }

.confidential-watermark {
  position: absolute; top: 40%; left: -20%; font-family: var(--font-display); font-size: 64px; font-weight: 800;
  color: var(--text); opacity: .035; transform: rotate(-18deg); white-space: nowrap; letter-spacing: 4px;
}

.scan-stats { display: flex; gap: 22px; }
.scan-stats-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-4); text-transform: uppercase; text-align: center; margin-bottom: 4px; }
.scan-stats-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--gold); text-align: center; }
.orbit-badge {
  position: absolute; width: 34px; height: 34px; margin: -17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: var(--panel); border: 1.5px solid var(--line); color: var(--text-4);
  opacity: 0.45; transition: opacity .5s ease, border-color .5s ease, color .5s ease, box-shadow .5s ease;
}
.orbit-badge.active { opacity: 1; }

.scan-sweep {
  position: absolute; left: 0; right: 0; height: 40%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(227,166,63,0.55), transparent);
  animation: scanSweep 2.4s linear infinite;
}
.scan-glow-ring { border-radius: 50%; box-shadow: 0 0 0 2px var(--gold), 0 0 24px 4px rgba(227,166,63,0.45); }
.scan-dot {
  position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px 1px rgba(227,166,63,0.8);
  opacity: 0; animation: dotPulse 3.4s ease-in-out infinite;
}
@keyframes dotPulse { 0%, 22%, 100% { opacity: 0; transform: scale(.6); } 45%, 75% { opacity: .85; transform: scale(1); } }

.signin-glow {
  position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 320px; height: 320px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(227,166,63,0.28) 0%, rgba(227,166,63,0.08) 45%, transparent 70%);
  filter: blur(20px);
}

.cropper-box { position: relative; }
.cropper-viewport { position: relative; overflow: hidden; border-radius: 20px; background: var(--card); }
.crop-guide { position: absolute; inset: 0; pointer-events: none; }
.zoom-controls { display: flex; gap: 10px; margin-top: 14px; }
.zoom-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; cursor: pointer; }

.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#toast {
  position: absolute; left: 16px; right: 16px; bottom: 90px; background: var(--card-back); border: 1px solid var(--gold);
  color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 13px; text-align: center;
  z-index: 20; display: none;
}
