:root {
  --bg: #0a0e17;
  --panel: #11172566;
  --panel-solid: #11172a;
  --border: #232b3d;
  --text: #e8ecf4;
  --muted: #8b93a7;
  --accent: #5dd6ff;
  --accent2: #7c5cff;
  --real: #34d399;
  --screen: #fb7185;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(92, 92, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(93, 214, 255, 0.14), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(124, 92, 255, 0.12), transparent 50%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.accent { color: var(--accent); }

.badge {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffffff08;
}

.stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro { text-align: center; margin-bottom: 28px; }
.intro h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.intro p { color: var(--muted); margin: 0; line-height: 1.5; }

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px -20px #000a;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #ffffff26;
  border-radius: 14px;
  padding: 56px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: #5dd6ff0d;
}
.dropzone.drag-over { transform: scale(1.01); }

.upload-icon {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.dz-title { font-weight: 600; margin: 0 0 4px; font-size: 1.05rem; }
.dz-sub { color: var(--muted); margin: 0; font-size: 0.85rem; }

.hidden { display: none !important; }

/* Scan stage */
.scan-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.scan-frame {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #000;
}

.scan-frame img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #000;
}

.scan-line {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, #fff 50%, var(--accent) 80%, transparent);
  box-shadow: 0 0 16px 4px #5dd6ffaa, 0 0 40px 8px #5dd6ff55;
  animation: sweep 1.8s ease-in-out infinite;
  opacity: 0;
}
.scan-stage.scanning .scan-line { opacity: 1; }

@keyframes sweep {
  0%   { top: 0%; }
  50%  { top: 100%; }
  100% { top: 0%; }
}

.scan-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#5dd6ff14 1px, transparent 1px),
    linear-gradient(90deg, #5dd6ff14 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.scan-stage.scanning .scan-grid { opacity: 1; }

.scan-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: #000a;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #5dd6ff33;
  opacity: 0;
  transition: opacity .3s ease;
}
.scan-stage.scanning .scan-label { opacity: 1; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color .2s ease, background .2s ease;
}
.ghost-btn:hover { border-color: var(--accent); background: #5dd6ff0d; }

/* Result */
.result {
  margin-top: 18px;
  animation: rise .4s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.verdict-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.verdict-icon.real   { background: #34d39922; color: var(--real); }
.verdict-icon.screen { background: #fb718522; color: var(--screen); }

.verdict-label { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.verdict-label.real   { color: var(--real); }
.verdict-label.screen { color: var(--screen); }
.verdict-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}
.meter-row:first-child { margin-top: 0; }

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: #ffffff10;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.meter-fill.real   { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.meter-fill.screen { background: linear-gradient(90deg, #fb7185, #fda4af); }

.error-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fb718522;
  border: 1px solid #fb718555;
  color: #fecdd3;
  font-size: 0.88rem;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding-bottom: 30px;
}

@media (max-width: 520px) {
  .topbar { padding: 18px; }
  .badge { display: none; }
  .panel { padding: 16px; }
  .dropzone { padding: 40px 14px; }
}
