:root {
  --ink: #140c18;
  --ink-2: #1c121f;
  --panel: #fff8fa;
  --panel-soft: #f4ecef;
  --rose: #ff4d7a;
  --rose-deep: #e0195a;
  --blush: #ffc9d9;
  --mint: #3ecf8e;
  --sky: #2f7dff;
  --cream: #fff4f7;
  --muted: #6f6170;
  --line: #ead8df;
  --shadow: 0 18px 40px rgba(8, 4, 12, 0.42);
  --radius: 18px;
  --font: "Figtree", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Syne", "Figtree", sans-serif;
  color: #1a1218;
  background: var(--ink);
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -10%, #3a1f33 0%, transparent 55%),
    linear-gradient(180deg, #1a1018, #0d0811 70%);
}

button,
a,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 20;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus {
  left: 8px;
}

#app {
  min-height: 100dvh;
}

.shell {
  position: relative;
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
  background: #2a2228;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
}

.hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #140c18;
}

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-poster {
  z-index: 0;
  background: #140c18;
}

.hero-video {
  z-index: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hero-video.is-ready {
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(20, 12, 24, 0.12),
    rgba(20, 12, 24, 0.28) 55%,
    rgba(12, 8, 16, 0.48) 100%
  );
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--blush);
  opacity: 0.92;
}

.lang-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 201, 217, 0.4);
  background: rgba(20, 12, 24, 0.55);
  color: var(--blush);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 28px 18px 0;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-copy h1 {
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-copy h1 span {
  display: block;
  color: var(--blush);
}

.hero-copy p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  max-width: 18em;
}

.hero-bottom {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: max(28px, env(safe-area-inset-bottom));
  color: #fff;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(18, 12, 22, 0.58);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.features span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.features span::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 5px;
  background: var(--mint);
  color: #07301d;
  font-size: 11px;
  font-weight: 800;
}

.tags {
  margin-top: 14px;
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(15px, 4.4vw, 19px);
  letter-spacing: 0.04em;
  color: var(--blush);
  text-shadow: 0 2px 0 rgba(173, 40, 90, 0.45);
}

.shade {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: rgba(10, 8, 14, 0.28);
  animation: fade-in 0.28s ease;
}

.center,
.step,
.selection {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 36px), 372px);
  animation: rise-in 0.32s ease;
}

.welcome,
.matching,
.success {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.welcome h2,
.success h2,
.matching h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 22px;
  color: var(--rose-deep);
  letter-spacing: -0.02em;
}

.welcome p,
.success p,
.matching p,
.success li {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.55;
  color: #2a1f28;
}

.welcome .lead {
  font-weight: 700;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.row button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  color: #1b1218;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.row button.primary {
  color: #fff;
  border-color: var(--sky);
  background: linear-gradient(180deg, #4a91ff, var(--sky));
  box-shadow: 0 8px 18px rgba(47, 125, 255, 0.28);
}

.row button.mint {
  color: #fff;
  border-color: #2fb873;
  background: linear-gradient(180deg, #4adb98, #2fb873);
  box-shadow: 0 8px 18px rgba(47, 184, 115, 0.28);
}

.row button:active {
  transform: scale(0.98);
}

.step {
  text-align: center;
}

.step-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 700;
}

.step-question {
  border-radius: 16px;
  background: #fff;
  padding: 20px 16px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
  box-shadow: var(--shadow);
  color: #1a1218;
}

.step .row {
  max-width: 280px;
  margin: 24px auto 0;
}

.step .row button {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  font-size: 16px;
}

.matching .bar {
  height: 10px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #ead8df;
}

.matching .bar span {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7aa0, var(--rose));
  animation: fill-bar 0.9s ease forwards;
}

.selection {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 12px 16px;
  box-shadow: var(--shadow);
}

.selection h2 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #1a1218;
}

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  text-align: center;
}

.progress span {
  font-size: 11px;
  color: #9a8b96;
  font-weight: 600;
}

.progress span.active {
  color: var(--rose-deep);
  font-weight: 800;
}

.progress i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 4px auto 0;
  border: 2px solid #eee;
  border-radius: 50%;
  background: #f5f0f2;
  font-style: normal;
  color: #8a7884;
}

.progress i img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.65;
}

.progress .active i {
  border-color: var(--rose);
  color: var(--rose-deep);
  background: #ffe8f0;
  box-shadow: 0 0 0 4px rgba(255, 77, 122, 0.12);
}

.progress .active i img {
  opacity: 1;
}

.selection:not(.selection-1) .tile-label {
  display: none;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.tile {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  text-align: center;
  color: inherit;
}

.tile-photo {
  display: block;
  width: min(100%, 148px);
  height: clamp(118px, 23vh, 150px);
  margin-inline: auto;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 48% / 40%;
  background: #efe6ea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: outline-color 0.15s ease, transform 0.15s ease;
}

.tile.selected .tile-photo {
  outline: 4px solid var(--rose);
  outline-offset: 2px;
  transform: scale(0.98);
}

.tile-label {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #2a1f28;
}

.selection-age .tile-photo {
  filter: saturate(0.9);
}

.success {
  text-align: left;
  max-height: calc(100dvh - 48px);
  overflow: auto;
}

.success h2 {
  text-align: center;
}

.success ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.cta {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(180deg, #ff7a98, var(--rose-deep));
  box-shadow: 0 10px 22px rgba(224, 25, 90, 0.28);
}

.chat,
.download {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: #f7f2f4;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #eadfe4;
  font-weight: 800;
}

.chat-header a {
  position: absolute;
  right: 14px;
  color: var(--rose-deep);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.chat-feed {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 88px;
  background: #fff;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff8aa8, #d94d78);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.bubble {
  max-width: calc(100% - 46px);
  padding: 2px 4px;
  line-height: 1.5;
}

.bubble h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.bubble h2 small {
  color: var(--muted);
  font-weight: 600;
}

.bubble p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #2a1f28;
}

.chat-contact {
  color: var(--rose-deep);
  font-weight: 700;
}

.chat-history-item {
  margin: 18px 0 0 4px;
}

.chat-time {
  color: #b0a4ab;
  font-size: 11px;
  margin-bottom: 4px;
}

.chat-sender {
  color: #4a3f47;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.chat-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #faf4f6;
  border: 1px solid #f0e2e8;
}

.chat-card img {
  width: 72px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
}

.chat-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.chat-card span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.chat-input {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #eadfe4;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5d7dd;
  border-radius: 12px;
  padding: 12px 12px;
  background: #fff;
}

.chat-input button {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  min-width: 72px;
  color: #fff;
  font-weight: 700;
  background: var(--sky);
}

.download {
  padding: 20px;
  background: linear-gradient(160deg, #17101c, #3a2234 55%, #241722);
  color: #fff;
}

.download a {
  color: var(--blush);
  text-decoration: none;
  font-weight: 700;
}

.download .card {
  margin-top: 18vh;
  padding: 28px 22px;
  border-radius: 22px;
  background: #fff;
  color: #1a1218;
  text-align: center;
  box-shadow: var(--shadow);
}

.download .card img {
  width: 68px;
  height: 68px;
  border-radius: 18px;
}

.download .card p {
  line-height: 1.55;
  color: #4a3f47;
}

.download .cta {
  background: linear-gradient(180deg, #b57bff, #7a3fd4);
  box-shadow: 0 10px 22px rgba(122, 63, 212, 0.28);
}

[dir="rtl"] .brand small,
[dir="rtl"] .hero-copy,
[dir="rtl"] .features,
[dir="rtl"] .tags,
[dir="rtl"] .welcome,
[dir="rtl"] .step-question,
[dir="rtl"] .selection,
[dir="rtl"] .success,
[dir="rtl"] .chat-header,
[dir="rtl"] .bubble {
  text-align: right;
}

[dir="rtl"] .features span {
  flex-direction: row-reverse;
}

[dir="rtl"] .chat-header a {
  right: auto;
  left: 14px;
}

[dir="rtl"] .success ol {
  padding-right: 18px;
  padding-left: 0;
}

@media (min-width: 600px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px 0;
  }

  .shell,
  .chat,
  .download {
    min-height: min(920px, calc(100dvh - 48px));
    border-radius: 28px;
    overflow: hidden;
  }

  .hero-copy h1 {
    font-size: 36px;
  }
}

@media (max-height: 720px) {
  .hero-bottom {
    bottom: 12px;
  }

  .features {
    padding: 10px;
    gap: 6px 10px;
    font-size: 12px;
  }

  .tags {
    margin-top: 8px;
    font-size: 14px;
  }

  .selection {
    max-height: calc(100dvh - 20px);
    padding: 10px 10px 12px;
  }

  .selection h2 {
    margin-bottom: 6px;
    font-size: 15px;
  }

  .progress {
    margin-bottom: 6px;
  }

  .tiles {
    gap: 8px 10px;
  }

  .tile-photo {
    height: clamp(96px, 20vh, 128px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shade,
  .center,
  .step,
  .selection,
  .matching .bar span {
    animation: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes fill-bar {
  from {
    width: 12%;
  }
  to {
    width: 100%;
  }
}
