:root {
  --bg: #0a0a18;
  --bg-2: #14142b;
  --card: #1a1a30;
  --text: #f7f7ff;
  --muted: #9a9ac0;
  --snap: #fffc00;
  --pink: #ff4fa3;
  --pink-2: #ff7ad6;
  --good: #3ddc97;
  --r: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Background glow (fixed, doesn't affect layout) */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 320px at 15% 10%, rgba(255, 79, 163, 0.30), transparent 60%),
    radial-gradient(420px 320px at 100% 100%, rgba(255, 252, 0, 0.12), transparent 60%);
}

.phone {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ===== SCREEN BASE — full-viewport, vertically centered ===== */
.screen[hidden] { display: none !important; }
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: max(20px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom));
  animation: fade 0.3s ease both;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== INTRO ===== */
.intro__art {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 0 16px;
  display: grid;
  place-items: center;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.85;
  animation: float 6s ease-in-out infinite;
}
.orb-1 { width: 105px; height: 105px; background: var(--pink); top: 10px; left: 14px; }
.orb-2 { width: 88px;  height: 88px;  background: var(--snap); bottom: 10px; right: 8px; animation-delay: -2s; }
.orb-3 { width: 70px;  height: 70px;  background: #6a4cff; top: 48px; right: 38px; animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-10px) scale(1.05); }
}
.ghost {
  position: relative;
  font-size: 88px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.pill {
  display: inline-block;
  background: rgba(255, 252, 0, 0.12);
  color: var(--snap);
  border: 1px solid rgba(255, 252, 0, 0.4);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  margin-bottom: 14px;
}
.intro__text { width: 100%; }
.intro__text h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.intro__text p {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 22px;
}
.intro__text p strong {
  color: var(--text);
  font-weight: 800;
}

.cta {
  width: 100%;
  max-width: 360px;
  border: 0;
  background: linear-gradient(135deg, var(--pink), var(--pink-2));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  border-radius: 999px;
  padding: 16px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(255, 79, 163, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.cta:active { transform: scale(0.98); }
.cta__arrow { transition: transform 0.2s ease; }
.cta:hover .cta__arrow { transform: translateX(3px); }

.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
}
.trust__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.trust__item strong {
  color: var(--text);
  font-weight: 800;
}
.trust__free {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 252, 0, 0.14);
  color: var(--snap);
  border: 1px solid rgba(255, 252, 0, 0.45);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 0 18px rgba(255, 252, 0, 0.18);
}

/* ===== QUESTION ===== */
.screen-q { text-align: left; }
.q__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  width: 100%;
}
.q__back {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.q__progress {
  display: flex;
  gap: 8px;
}
.dot-p {
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  transition: background 0.25s ease, width 0.25s ease;
}
.dot-p.active {
  background: linear-gradient(90deg, var(--pink), var(--snap));
}
.q__step {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}
.q__title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 18px;
  letter-spacing: -0.4px;
  width: 100%;
}
.q__options {
  display: grid;
  gap: 10px;
  width: 100%;
}
.option {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  text-align: left;
  padding: 15px 18px;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.option::after {
  content: '→';
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.15s ease;
}
.option:active { transform: scale(0.99); }
.option:hover { border-color: rgba(255, 79, 163, 0.5); }
.option:hover::after { transform: translateX(4px); color: var(--pink); }

/* ===== LOADING ===== */
.screen-loading { /* uses centered flex from .screen */ }
.pulse {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.pulse div {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse 1.2s ease-in-out infinite;
}
.pulse div:nth-child(2) { background: var(--pink-2); animation-delay: 0.15s; }
.pulse div:nth-child(3) { background: var(--snap); animation-delay: 0.3s; }
@keyframes pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.4; }
  50%      { transform: scale(1.0); opacity: 1; }
}
.loading-text {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
  min-height: 22px;
}

/* ===== RESULT ===== */
/* Result has more content — natural flow from top, sticky CTA below */
.screen-result {
  justify-content: flex-start;
  text-align: left;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: 140px;
}
.match__badge {
  align-self: center;
  background: linear-gradient(135deg, var(--pink), var(--snap));
  color: #111;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  margin: 0 0 12px;
}

.carousel {
  position: relative;
  width: 100%;
  height: 55dvh;
  max-height: 520px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 30px 50px rgba(0,0,0,0.5);
}
.carousel__track {
  display: flex;
  width: 100%;
  height: 100%;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track img {
  flex: 0 0 100%;
  scroll-snap-align: start;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-drag: none;
  -webkit-user-drag: none;
}
.carousel__dots {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.carousel__dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: width 0.2s ease, background 0.2s ease;
}
.carousel__dots span.active {
  width: 18px;
  background: #fff;
}

.match__info {
  width: 100%;
  margin: 16px 0 8px;
}
.match__info h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}
.match__nearby {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}
.match__status-text { color: var(--text); font-weight: 600; }
.match__sep { color: var(--muted); }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.18);
}
.status-dot[data-state="online"] {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.18);
  animation: live 1.6s ease-in-out infinite;
}
.status-dot[data-state="offline"] {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(154, 154, 192, 0.15);
  animation: none;
}
.status-dot[data-state="last_active"] {
  background: #ffb84d;
  box-shadow: 0 0 0 4px rgba(255, 184, 77, 0.20);
  animation: none;
}
@keyframes live {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.match__bio {
  width: 100%;
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--card);
  border-radius: var(--r);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Sticky CTA */
.snap-cta {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  padding: 14px 22px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(180deg, transparent, rgba(10, 10, 24, 0.92) 30%);
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}
.snap-btn {
  width: 100%;
  border: 0;
  background: var(--snap);
  color: #111;
  border-radius: 999px;
  padding: 17px 22px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(255, 252, 0, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.snap-btn:active { transform: scale(0.98); }
.snap-btn:disabled { opacity: 0.7; cursor: progress; }
.snap-btn__ghost { font-size: 22px; line-height: 1; }
.snap-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.snap-hint__free {
  background: rgba(61, 220, 151, 0.14);
  color: var(--good);
  border: 1px solid rgba(61, 220, 151, 0.4);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.snap-hint__sep { color: var(--muted); }
