:root {
  --bg: #0e0b16;
  --surface: #1a1524;
  --surface-2: #241d33;
  --border: #342a49;
  --text: #f2eef8;
  --muted: #a99fc0;
  --primary: #b892ff;
  --primary-ink: #1a0f33;
  --gold: #e7c27d;
  --danger: #ff6b8a;
  --radius: 18px;
}

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

/* A display rule (e.g. .btn) beats the [hidden] UA style; force it back. */
[hidden] {
  display: none !important;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(120% 80% at 50% -10%, #241a3d 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 460px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  text-align: center;
  padding: 14px 0 4px;
}
.brand__mark {
  display: inline-block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    var(--primary),
    var(--gold),
    var(--primary)
  );
  box-shadow: 0 0 34px rgba(184, 146, 255, 0.55);
}
.brand h1 {
  font-size: 30px;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-top: 8px;
}
.brand__tag {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.center {
  text-align: center;
  padding: 40px 16px;
}

.camera {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera__guide {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58%;
  height: 72%;
  top: 8%;
  border: 2px dashed rgba(231, 194, 125, 0.7);
  border-radius: 50% / 42%;
  pointer-events: none;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 12px 0;
}
.privacy {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin-top: 12px;
  opacity: 0.8;
}

.actions {
  display: flex;
  gap: 10px;
}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    filter 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.btn--primary:hover {
  filter: brightness(1.05);
}
.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.report__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.thumb {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.score {
  font-size: 40px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.score__label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
}
.block__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.block__value {
  font-size: 17px;
  font-weight: 700;
  text-transform: capitalize;
}
.block__note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}
.block ul {
  list-style: none;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.block li {
  font-size: 13.5px;
  padding-left: 16px;
  position: relative;
}
.block li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.block li.no::before {
  background: var(--danger);
}

.palette {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.inspo {
  margin: 14px 0 0;
  text-align: center;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery .inspo__frame {
  border-radius: 10px;
}
.gallery .inspo__load .spinner {
  width: 22px;
  height: 22px;
}
.inspo__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}
.inspo__load {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.inspo__load .spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  margin: 0;
}
.inspo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 4, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.inspo__cap {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  opacity: 0.85;
}

.meta {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin: 14px 0;
  opacity: 0.85;
}
.error {
  color: var(--danger);
  text-align: center;
  font-size: 14px;
  padding: 10px;
}
#again {
  margin-top: 4px;
}
