:root {
  color-scheme: dark;
  --ink: #20151a;
  --night: #120d11;
  --rose: #ff6f91;
  --berry: #b8325f;
  --peach: #ffbea7;
  --mint: #67d6c2;
  --ivory: #fff7f0;
  --soft: #f7dce5;
  --muted: #b99aa6;
  --line: rgba(255, 247, 240, 0.18);
  --glass: rgba(32, 21, 26, 0.68);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(145deg, rgba(18, 13, 17, 0.94), rgba(77, 20, 43, 0.86)),
    #120d11;
  color: var(--ivory);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.camera-stage {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
}

.topbar,
.action-bar {
  z-index: 4;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ivory);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 190, 167, 0.62);
  border-radius: 50%;
  background: rgba(255, 111, 145, 0.18);
  color: var(--peach);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select {
  min-width: 142px;
  height: 42px;
  padding: 0 12px;
  color: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 13, 17, 0.72);
}

.member-pill {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 13, 17, 0.66);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

#memberStatus {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#authButton {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 247, 240, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.video-wrap {
  position: relative;
  min-height: 0;
  display: grid;
  align-items: center;
  overflow: hidden;
}

video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  background: #090609;
}

.video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 13, 17, 0.48), transparent 28%, rgba(18, 13, 17, 0.62)),
    linear-gradient(90deg, rgba(18, 13, 17, 0.62), transparent 34%, transparent 66%, rgba(18, 13, 17, 0.62));
  pointer-events: none;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.face-guide {
  position: absolute;
  top: 50%;
  width: min(30vw, 280px);
  aspect-ratio: 0.78;
  transform: translateY(-50%);
  border: 2px solid rgba(255, 247, 240, 0.78);
  border-radius: 48% 48% 45% 45%;
  box-shadow:
    0 0 0 999px rgba(18, 13, 17, 0.02),
    0 0 32px rgba(255, 111, 145, 0.42);
}

.left-guide {
  left: max(11vw, 28px);
}

.right-guide {
  right: max(11vw, 28px);
}

.scan-line {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mint), var(--peach), transparent);
  box-shadow: 0 0 18px rgba(103, 214, 194, 0.95);
  animation: scan 3.4s ease-in-out infinite;
}

.camera-copy {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 3;
  width: min(430px, calc(100% - 32px));
  padding: 16px 18px;
  border: 1px solid rgba(255, 247, 240, 0.16);
  border-radius: 18px;
  background: rgba(18, 13, 17, 0.46);
  backdrop-filter: blur(14px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--peach);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

#statusText {
  margin: 14px auto 0;
  max-width: 540px;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.45;
}

.action-bar {
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--soft);
  line-height: 1.35;
}

.consent input {
  width: 18px;
  height: 18px;
  accent-color: var(--rose);
}

#startButton {
  width: clamp(132px, 18vw, 210px);
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 16px 42px rgba(255, 111, 145, 0.35);
}

#startButton:disabled {
  cursor: progress;
  filter: grayscale(0.5);
  opacity: 0.58;
}

.result-panel {
  width: min(1080px, calc(100% - 32px));
  margin: 28px auto 72px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 247, 240, 0.08);
  backdrop-filter: blur(18px);
}

.hidden {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 6, 9, 0.72);
  backdrop-filter: blur(14px);
}

.modal-layer.hidden {
  display: none;
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 247, 240, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.16), rgba(103, 214, 194, 0.1)),
    #170f14;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 48px);
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--soft);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--peach);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 247, 240, 0.08);
  color: var(--ivory);
}

.auth-form input:focus {
  border-color: rgba(255, 190, 167, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 190, 167, 0.13);
}

.auth-form button,
#buyCreditsButton {
  min-height: 50px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  color: var(--ink);
  font-weight: 950;
}

.modal-close {
  margin-top: 12px;
  min-height: 44px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 247, 240, 0.08);
  color: var(--ivory);
  font-weight: 900;
}

.credit-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 13, 17, 0.58);
}

.credit-pack strong {
  font-size: 22px;
}

.credit-pack span {
  color: var(--muted);
  font-weight: 800;
}

.ad-zone {
  position: relative;
  width: 100%;
  min-height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid rgba(255, 247, 240, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 190, 167, 0.07), rgba(103, 214, 194, 0.06)),
    rgba(18, 13, 17, 0.5);
}

.ad-zone:empty {
  display: none;
}

.ad-zone-between {
  width: min(970px, calc(100% - 32px));
  margin: 22px auto 0;
}

.ad-zone-compact {
  min-height: 76px;
}

.ad-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

html[dir="rtl"] .ad-label {
  right: 10px;
  left: auto;
}

.ad-placeholder-text {
  color: rgba(255, 247, 240, 0.52);
  font-size: 13px;
  font-weight: 800;
}

.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.result-hero {
  padding: clamp(22px, 4vw, 42px);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.18), rgba(103, 214, 194, 0.12)),
    rgba(18, 13, 17, 0.7);
}

.result-label {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.score-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.score-ring {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 190, 167, 0.7);
  border-radius: 50%;
  background: rgba(255, 111, 145, 0.12);
  box-shadow: inset 0 0 28px rgba(255, 111, 145, 0.18);
}

.score-ring span {
  font-size: 46px;
  font-weight: 950;
}

.score-ring small {
  margin-top: -34px;
  color: var(--muted);
  font-weight: 800;
}

#verdict {
  margin: 0;
  color: var(--soft);
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.45;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.score-audit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.result-grid article,
.date-strip,
.score-audit section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 13, 17, 0.62);
}

h3 {
  margin: 0 0 9px;
  color: var(--peach);
  font-size: 15px;
  text-transform: uppercase;
}

p {
  overflow-wrap: anywhere;
}

.result-grid p,
.date-strip p,
.share-caption,
.disclaimer {
  margin: 0;
  color: var(--soft);
  line-height: 1.55;
}

.score-audit ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--soft);
  line-height: 1.45;
}

html[dir="rtl"] .score-audit ul {
  padding-right: 18px;
  padding-left: 0;
}

.date-strip {
  margin-top: 14px;
}

.date-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.share-row button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--ink);
  font-weight: 900;
}

.share-row button:first-child {
  background: var(--mint);
}

.share-caption {
  margin-top: 18px;
  color: var(--peach);
  font-weight: 800;
}

.disclaimer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes scan {
  0%,
  100% {
    transform: translateY(-120px);
    opacity: 0.25;
  }

  50% {
    transform: translateY(120px);
    opacity: 0.9;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 74px;
  }

  .top-controls {
    gap: 8px;
  }

  .brand small,
  .select-label span {
    display: none;
  }

  .member-pill {
    max-width: 158px;
    padding-left: 10px;
  }

  #memberStatus {
    max-width: 78px;
  }

  select {
    min-width: 116px;
  }

  .face-guide {
    top: 44%;
    width: min(40vw, 176px);
  }

  .left-guide {
    left: 6vw;
  }

  .right-guide {
    right: 6vw;
  }

  .camera-copy {
    bottom: 14px;
    padding: 13px 14px;
  }

  h1 {
    font-size: clamp(25px, 8vw, 38px);
  }

  .action-bar {
    min-height: 136px;
    grid-template-columns: 1fr;
    align-content: center;
  }

  .consent {
    border-radius: 14px;
  }

  #startButton {
    width: 100%;
    height: 58px;
  }

  .score-wrap,
  .score-audit,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }

  .ad-zone-between {
    margin-top: 16px;
  }
}
