/* =============================================
   Twinby Synastry — Unified Responsive Styles
   Mobile-first + Desktop (>=769px) overrides
   ============================================= */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; }
body { min-height: 100%; -webkit-font-smoothing: antialiased; }
body {
  font-family: "Suisse Int'l", Helvetica, Arial, sans-serif;
  background: #2d0e5a;
  color: #fff;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; outline: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input[type="checkbox"] { margin: 0; }

/* --- Tokens --- */
:root {
  --pink: #f67bff;
  --blue: #478aff;
  --white90: rgba(255,255,255,0.9);
  --white80: rgba(255,255,255,0.8);
  --white56: rgba(255,255,255,0.56);
  --white16: rgba(255,255,255,0.16);
  --white8: rgba(255,255,255,0.08);
  --white6: rgba(255,255,255,0.06);
  --bg: #2d0e5a;
  --btn-gradient: linear-gradient(161deg, #a73cff 0%, #aa2ad8 100%);
  --btn-text: #e8cdf8;
  --shadow: 0px 10px 20px rgba(30,24,31,0.4);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* =============================================
   PAGE — shared layout
   ============================================= */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  overflow-y: auto;
}

/* --- Background --- */
.bg {
  position: fixed;
  top: -50px;
  left: 0;
  width: 100%;
  height: calc(100% + 200px);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg__color {
  position: absolute;
  inset: 0;
  background: var(--bg);
}
.bg__gradient {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top center;
  animation: softBreathe 14s ease-in-out infinite;
  will-change: opacity;
  backface-visibility: hidden;
}
.bg__stars {
  position: absolute;
  will-change: opacity;
  backface-visibility: hidden;
}

/* Mobile star positions */
.bg__stars--1 { top: 0; left: 0; width: 100%; pointer-events: none; animation: twinkle1 7s ease-in-out infinite; }
.bg__stars--2 { bottom: 0; left: 0; width: 100%; pointer-events: none; animation: twinkle2 9s ease-in-out infinite; }

/* Desktop star positions — hidden on mobile */
.bg__stars--center,
.bg__stars--left,
.bg__stars--right,
.bg__stars--bl,
.bg__stars--br,
.bg__stars--bottom-wide { display: none; }

/* --- Ambient Animations --- */
@keyframes twinkle1 {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.55; }
  50% { opacity: 0.35; }
  75% { opacity: 0.7; }
}
@keyframes twinkle2 {
  0%, 100% { opacity: 0.8; }
  20% { opacity: 0.45; }
  50% { opacity: 1; }
  80% { opacity: 0.55; }
}
@keyframes twinkle3 {
  0%, 100% { opacity: 0.9; }
  30% { opacity: 1; }
  60% { opacity: 0.45; }
  85% { opacity: 0.75; }
}
@keyframes softBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}
@keyframes shimmerGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}
@keyframes butterflyPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}
@keyframes butterflyFloat {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.9; }
  50% { transform: scale(0.95) translateY(3px); opacity: 1; }
}
@keyframes gentleFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -6px, 0); }
}
@keyframes gentleFloatDown {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 6px, 0); }
}
@keyframes starShimmer {
  0%, 100% { opacity: 1; }
  33% { opacity: 0.75; }
  66% { opacity: 1.0; }
}
@keyframes sparkle1 {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}
@keyframes sparkle2 {
  0%, 100% { opacity: 0.4; }
  30% { opacity: 0.1; }
  70% { opacity: 0.6; }
}
@keyframes sparkle3 {
  0%, 100% { opacity: 0.08; }
  40% { opacity: 0.5; }
  80% { opacity: 0.12; }
}
@keyframes glowStar {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* --- Animated Star Particles (CSS-only) --- */
.star-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.star-particles--1 {
  background-image:
    radial-gradient(1px 1px at 10% 6%, rgba(255,255,255,0.9) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 18%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 42% 4%, rgba(255,255,255,0.8) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 15%, rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 78% 10%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 90% 22%, rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 33% 32%, rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 52% 40%, rgba(255,255,255,0.8) 50%, transparent 100%),
    radial-gradient(1px 1px at 8% 52%, rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 58%, rgba(255,255,255,0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 18% 65%, rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 48% 72%, rgba(255,255,255,0.9) 50%, transparent 100%),
    radial-gradient(1px 1px at 62% 80%, rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 35% 88%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 80% 85%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: sparkle1 4s ease-in-out infinite;
}
.star-particles--2 {
  background-image:
    radial-gradient(1px 1px at 5% 12%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 15% 35%, rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 30% 10%, rgba(255,255,255,0.9) 50%, transparent 100%),
    radial-gradient(1px 1px at 45% 25%, rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 50%, rgba(255,255,255,0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 72% 30%, rgba(255,255,255,0.8) 50%, transparent 100%),
    radial-gradient(1px 1px at 82% 42%, rgba(255,255,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 12% 75%, rgba(255,255,255,0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 65% 70%, rgba(255,255,255,0.8) 50%, transparent 100%),
    radial-gradient(1px 1px at 88% 78%, rgba(255,255,255,0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 22% 90%, rgba(255,255,255,0.7) 50%, transparent 100%),
    radial-gradient(1px 1px at 52% 85%, rgba(255,255,255,0.5) 50%, transparent 100%);
  animation: sparkle2 6s ease-in-out infinite;
}
.star-particles--3 {
  background-image:
    radial-gradient(1.5px 1.5px at 8% 28%, rgba(200,170,255,0.45) 50%, transparent 100%),
    radial-gradient(1px 1px at 22% 48%, rgba(246,123,255,0.25) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 38% 18%, rgba(200,170,255,0.35) 50%, transparent 100%),
    radial-gradient(1px 1px at 55% 62%, rgba(246,123,255,0.25) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 68% 38%, rgba(200,170,255,0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 82% 68%, rgba(246,123,255,0.2) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 82%, rgba(200,170,255,0.35) 50%, transparent 100%),
    radial-gradient(1px 1px at 12% 92%, rgba(246,123,255,0.25) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 12%, rgba(200,170,255,0.3) 50%, transparent 100%),
    radial-gradient(1px 1px at 92% 48%, rgba(246,123,255,0.2) 50%, transparent 100%);
  animation: sparkle3 8s ease-in-out infinite;
}

/* =============================================
   FORM PAGE
   ============================================= */

/* --- Hero illustration (mobile) --- */
.hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  animation: shimmerGlow 10s ease-in-out infinite;
  will-change: opacity;
  backface-visibility: hidden;
}

/* --- Desktop illustrations (hidden on mobile) --- */
.illust { display: none; }

/* --- Logo (hidden on mobile) --- */
.logo { display: none; }

/* --- Content --- */
.content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 227px 16px 0;
  padding-top: calc(227px + var(--safe-top));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Title --- */
.title {
  font-weight: 700;
  font-size: 32px;
  line-height: 38px;
  text-align: left;
  color: #fff;
  align-self: stretch;
  padding: 0 8px;
  margin-bottom: 0;
}

/* --- Form --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  margin-top: 52px;
}

/* --- Info Section --- */
.info-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.info-legend {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  position: relative;
}

.info-legend__text {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--white90);
}

.info-legend__select {
  display: inline-flex;
  height: 22px;
  align-items: center;
}

.gender-btn {
  display: inline-flex;
  flex-direction: column;
  height: 22px;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
}
.gender-btn__label {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  position: relative;
  padding-bottom: 3px;
}
.gender-btn__label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  border-bottom: 1.5px dashed currentColor;
}
.gender-btn__label--pink { color: var(--pink); }
.gender-btn__label--blue { color: var(--blue); }
.gender-btn__line { display: none; }

.gender-icon {
  width: 24px;
  height: 24px;
  margin-top: -1px;
  margin-bottom: -1px;
}

/* --- Gender Dropdown --- */
.gender-dropdown {
  display: none;
  position: fixed;
  z-index: 1001;
}
.gender-dropdown.is-open { display: block; }

.gender-popup {
  display: flex;
  flex-direction: column;
  background: rgba(35, 32, 43, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 1px 0 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 20px rgba(0, 0, 0, 0.13),
    inset -1px 0 20px rgba(0, 0, 0, 0.11);
  overflow: hidden;
  padding: 2px 0;
}
.gender-popup__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 16px;
  line-height: 20px;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.gender-popup__item:active {
  background: rgba(255, 255, 255, 0.04);
}
.gender-popup__item:not(:last-child) {
  border-bottom: 1px solid var(--white6);
}
.gender-popup__item--selected.gender-popup__item--female {
  color: var(--pink);
}
.gender-popup__item--selected.gender-popup__item--male {
  color: var(--blue);
}

/* --- Fields --- */
.fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.fields__row {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* --- Custom Select --- */
.select { position: relative; flex: 1; min-width: 0; }
.select--wide { flex: none; width: 100%; }

.select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 12px;
  width: 100%;
  background: var(--white8);
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--white56);
  text-align: left;
  outline: none;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.select--active .select__trigger { background: var(--white16); }
.select--filled .select__value { color: #fff; }
.select--error .select__trigger { box-shadow: 0 0 0 1px #ff4d6a; }
.select--disabled .select__trigger {
  opacity: 0.4;
  pointer-events: none;
}

.select__arrow { width: 24px; height: 24px; flex-shrink: 0; }
.select__value {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select__gmt { font-size: 14px; color: var(--white56); margin-left: auto; }

/* --- Dropdown (non-city, inline — mobile) --- */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(35, 32, 43, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 20px;
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 1px 0 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 20px rgba(0, 0, 0, 0.13),
    inset -1px 0 20px rgba(0, 0, 0, 0.11);
  overflow: hidden;
  max-height: 240px;
  z-index: 1000;
  padding: 0;
}
.dropdown.is-open { display: block; }
.dropdown[hidden] { display: none !important; }

.dropdown__scroll-wrap,
.dropdown__scroll {
  overflow-y: auto;
  max-height: 240px;
  padding: 0 16px;
}
.dropdown__scroll-wrap::-webkit-scrollbar,
.dropdown__scroll::-webkit-scrollbar { width: 4px; }
.dropdown__scroll-wrap::-webkit-scrollbar-track,
.dropdown__scroll::-webkit-scrollbar-track { background: transparent; }
.dropdown__scroll-wrap::-webkit-scrollbar-thumb,
.dropdown__scroll::-webkit-scrollbar-thumb { background: var(--white16); border-radius: 4px; }

.dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 16px;
  line-height: 20px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dropdown__item:active { background: rgba(255, 255, 255, 0.04); }
.dropdown__item--selected { color: var(--pink); }
.dropdown__item:not(:last-child) { border-bottom: 1px solid var(--white6); }
.dropdown__item-gmt { font-size: 14px; color: var(--white56); }

/* Desktop dropdown search */
.dropdown__search {
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--white6);
  flex-shrink: 0;
}
.dropdown__search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: #fff;
  outline: none;
}
.dropdown__search-input::placeholder { color: var(--white56); }

.dropdown__item--custom {
  color: var(--pink);
  font-weight: 500;
}

/* --- Bottom Sheet (city picker, mobile) --- */
.bottom-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  flex-direction: column;
  justify-content: flex-end;
}
.bottom-sheet.is-open {
  display: flex;
}

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.bottom-sheet__panel {
  position: relative;
  z-index: 1;
  background: #1e0a3c;
  border-radius: 20px 20px 0 0;
  max-height: 80vh;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  transition: max-height 0.25s ease, margin-bottom 0.25s ease;
}

.bottom-sheet__handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
  flex-shrink: 0;
}
.bottom-sheet__handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--white16);
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.bottom-sheet__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}
.bottom-sheet__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.bottom-sheet__close img { width: 24px; height: 24px; }

.bottom-sheet__search {
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.bottom-sheet__search-input {
  width: 100%;
  padding: 15px 12px;
  background: var(--white8);
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  color: #fff;
  outline: none;
}
.bottom-sheet__search-input::placeholder { color: var(--white56); }

.bottom-sheet__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bottom-sheet__list::-webkit-scrollbar { width: 4px; }
.bottom-sheet__list::-webkit-scrollbar-track { background: transparent; }
.bottom-sheet__list::-webkit-scrollbar-thumb { background: var(--white16); border-radius: 4px; }

.bottom-sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 20px;
  color: var(--white90);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bottom-sheet__item:active { background: var(--white8); }
.bottom-sheet__item--selected { color: var(--pink); }
.bottom-sheet__item:not(:last-child) { border-bottom: 1px solid var(--white8); }
.bottom-sheet__item-gmt { font-size: 14px; color: var(--white56); }

.bottom-sheet__item--custom {
  color: var(--pink);
  font-weight: 500;
}

/* --- Checkbox --- */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--white56);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.checkbox:checked {
  background: var(--pink);
  border-color: var(--pink);
}
.checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: var(--white56);
}

/* --- Submit Button --- */
.submit-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 32px;
  padding-bottom: calc(43px + var(--safe-bottom));
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 72px;
  padding: 4px 0;
  border-radius: 999px;
  background: var(--btn-gradient);
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-submit:active { transform: scale(0.98); }
.btn-submit img { width: 24px; height: 24px; }

.private-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 18px;
  color: var(--white56);
}
.private-note img { width: 20px; height: 20px; }

/* =============================================
   LOADING PAGE
   ============================================= */

.page--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.loading {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading__star {
  width: 120px;
  height: 98px;
  animation: glowStar 3s ease-in-out infinite;
}

.loading__text {
  font-size: 16px;
  line-height: 20px;
  color: var(--white90);
  text-align: center;
}

.loading__overlay {
  position: absolute;
  top: 0; right: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  object-fit: cover;
}

/* =============================================
   RESULT PAGE
   ============================================= */

/* Prevent horizontal overflow from decor-star */
.page--result {
  overflow-x: hidden;
}

/* Decorative gold star */
.decor-star {
  position: absolute;
  top: calc(71px + var(--safe-top));
  right: 8px;
  width: 68px;
  height: 63px;
  z-index: 2;
  pointer-events: none;
  animation: gentleFloat 6s ease-in-out infinite, starShimmer 5s ease-in-out infinite;
  will-change: transform, opacity;
  backface-visibility: hidden;
  overflow: hidden;
}

/* Desktop result decorative illustrations */
.result-illust { display: none; }

/* Back nav */
.back-nav {
  position: relative;
  z-index: 3;
  padding: 28px 20px 0;
  padding-top: calc(28px + var(--safe-top));
}
.back-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--white56);
  -webkit-tap-highlight-color: transparent;
}
.back-nav__link img { width: 24px; height: 24px; }

/* Result content (mobile: single column) */
.result-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0;
  padding-bottom: calc(240px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  margin-top: 16px;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* Result layout — desktop two-column, hidden on mobile */
.result-layout { display: none; }

/* Score + Users block */
.result-block {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-self: stretch;
}

/* Score */
.result-score {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 0 20px;
}
.result-score__number {
  font-size: 42px;
  font-weight: 700;
  line-height: 48px;
  color: #e7d6ff;
}
.result-score__label {
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  color: #fefeff;
}

/* Users */
.result-users { display: flex; flex-direction: column; gap: 20px; align-self: stretch; }
.result-user { display: flex; align-items: center; gap: 16px; padding-left: 16px; }
.result-user__zodiac {
  width: 52px; height: 52px;
  border-radius: 26px;
  background: rgba(173, 68, 201, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-user__zodiac-symbol { font-size: 19px; }
.result-user__info { display: flex; flex-direction: column; gap: 5px; }
.result-user__name {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--white90);
}
.result-user__name img { width: 24px; height: 24px; }
.result-user__data {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
  line-height: 18px;
  color: var(--white90);
  opacity: 0.7;
  flex-wrap: wrap;
  overflow: hidden;
}
.result-user__data-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: currentColor;
  opacity: 0.5;
}

/* General description */
.result-general {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: stretch;
  padding: 0 16px;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.result-general__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--white90);
}
.result-general__text {
  font-size: 16px;
  line-height: 24px;
  color: var(--white80);
}

/* Result details wrapper */
#result-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: stretch;
  padding: 0 16px;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Result section */
.result-section { display: flex; flex-direction: column; gap: 18px; }
.result-section__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--white90);
}
.result-section__text {
  font-size: 16px;
  line-height: 24px;
  color: var(--white80);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.result-section__review {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}
.result-section__rating-label {
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  color: var(--white90);
}
.result-section__stars { display: inline-flex; gap: 4px; }
.result-section__star { width: 20px; height: 20px; }

/* Divider */
.result-divider {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-divider__line { flex: 1; height: 1px; opacity: 0.3; }
.result-divider__star { width: 14px; height: 14px; flex-shrink: 0; }

/* --- Invisible viewport anchor (mobile Chrome fix) --- */
.vv-anchor {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* --- Sticky bottom banner (mobile result page) --- */
.sticky-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--offset-bottom, 0px);
  z-index: 10;
  transform: translateZ(0);
  will-change: bottom;
}
.sticky-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 100px;
  background: linear-gradient(288deg, rgba(69, 17, 123, 1) 0%, rgba(47, 16, 97, 1) 100%);
}
.sticky-banner__butterflies {
  position: absolute;
  top: -54px;
  right: 10px;
  width: 108px;
  height: 108px;
  pointer-events: none;
  z-index: 2;
}
.sticky-banner__butterfly-big {
  position: absolute;
  top: 0;
  left: 11px;
  width: 100px;
  height: 100px;
  animation: butterflyPulse 5s ease-in-out infinite;
}
.sticky-banner__butterfly-small {
  position: absolute;
  top: 70px;
  left: 9px;
  width: 37px;
  height: 37px;
  animation: butterflyFloat 4s ease-in-out infinite 1s;
}
.sticky-banner__inner {
  position: relative;
  width: 100%;
  height: 218px;
  border-radius: 40px 40px 0 0;
  background: linear-gradient(288deg, rgba(69, 17, 123, 1) 0%, rgba(47, 16, 97, 1) 100%);
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
}
.sticky-banner__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.sticky-banner__text {
  position: absolute;
  top: 28px;
  left: 16px;
  width: calc(100% - 32px);
  max-width: 318px;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  color: #fff;
}
.sticky-banner__btn {
  display: flex;
  width: calc(100% - 32px);
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0;
  position: absolute;
  left: 16px;
  bottom: calc(30px + var(--safe-bottom));
  border-radius: 999px;
  background: var(--btn-gradient);
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.sticky-banner__btn:active { transform: scale(0.98); }

/* --- Twinby Popup (mobile) --- */
.twinby-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
}
.twinby-popup.is-open {
  display: block;
}

.twinby-popup__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -100px;
  background: rgba(0,0,0,1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.twinby-popup__panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.twinby-popup__close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 20px;
  width: 24px;
  height: 24px;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.twinby-popup__close img { width: 24px; height: 24px; }

.twinby-popup__illustration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-height: 55%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
}

.twinby-popup__bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65%;
}

.twinby-popup__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(110px + var(--safe-bottom));
  z-index: 2;
}

.twinby-popup__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 34px;
  color: #fefeff;
}

.twinby-popup__desc {
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: var(--white56);
}

.twinby-popup__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 32px);
  height: 56px;
  position: absolute;
  left: 16px;
  bottom: calc(30px + var(--safe-bottom));
  border-radius: 999px;
  background: var(--btn-gradient);
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.twinby-popup__btn:active { transform: scale(0.98); }
.twinby-popup__btn img { width: 24px; height: 24px; }

/* Desktop result banner (hidden on mobile — mobile uses sticky-banner instead) */
.result-banner { display: none; }
.result-sidebar { display: none; }

/* =============================================
   DESKTOP OVERRIDES (>=769px)
   ============================================= */

@media (min-width: 769px) {
  /* --- Page --- */
  .page {
    overflow: hidden;
  }

  /* --- Background: switch to desktop stars --- */
  .bg__gradient {
    min-height: 100%;
    object-fit: fill;
    object-position: center center;
  }
  .bg__stars--1,
  .bg__stars--2 { display: none; }
  .bg__stars--center,
  .bg__stars--left,
  .bg__stars--right,
  .bg__stars--bl,
  .bg__stars--br,
  .bg__stars--bottom-wide { display: block; }

  .bg__stars--center { top: 0; left: calc(50% - 193px); width: 386px; height: 388px; animation: twinkle1 6s ease-in-out infinite; }
  .bg__stars--left { top: 0; left: 0; width: 390px; height: 386px; animation: twinkle2 8s ease-in-out infinite; }
  .bg__stars--right { top: 0; right: 0; width: 390px; height: 386px; animation: twinkle3 7s ease-in-out infinite; }
  .bg__stars--bl { left: 0; bottom: 0; width: 390px; height: 158px; animation: twinkle2 9s ease-in-out infinite; }
  .bg__stars--br { right: 0; bottom: 0; width: 390px; height: 158px; animation: twinkle1 10s ease-in-out infinite; }
  .bg__stars--bottom-wide { left: 619px; bottom: 0; width: calc(100% - 619px); height: 390px; object-fit: cover; animation: twinkle3 8s ease-in-out infinite; }

  /* --- Hero: hide mobile hero, show desktop illustrations --- */
  .hero { display: none; }

  .illust {
    display: block;
    position: absolute;
    z-index: 1;
    pointer-events: none;
  }
  .illust--woman {
    left: 0; bottom: 0; width: 544px; height: 601px;
    animation: gentleFloatDown 12s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
  }
  .illust--stars {
    top: 0; right: 0; width: 497px; height: 863px;
    animation: gentleFloat 14s ease-in-out infinite reverse;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
  }

  /* --- Logo (desktop) --- */
  .logo {
    display: block;
    position: absolute;
    top: 34px; left: 40px;
    font-weight: 500;
    font-size: 28px;
    color: transparent;
    z-index: 2;
  }

  /* --- Content (desktop) --- */
  .content {
    width: 620px;
    margin: 0 auto;
    padding: 120px 0 60px;
    gap: 36px;
    align-items: center;
  }

  /* --- Title (desktop) --- */
  .title {
    font-size: 36px;
    line-height: 42px;
    text-align: center;
    white-space: nowrap;
    padding: 0;
    align-self: auto;
  }

  /* --- Form (desktop) --- */
  .form {
    width: 424px;
    margin-top: 0;
  }

  /* --- Info Section centering (desktop) --- */
  .info-section {
    align-items: center;
  }

  /* --- Submit block (desktop) --- */
  .submit-block {
    margin-top: 0;
    padding-bottom: 0;
  }

  .btn-submit {
    height: 56px;
    color: var(--btn-text);
  }
  .btn-submit:hover { opacity: 0.9; }

  .private-note {
    font-size: 12px;
    line-height: 14px;
  }

  /* --- Select hover (desktop) --- */
  .select__trigger:hover { background: var(--white16); }
  .gender-popup__item:hover { background: rgba(255, 255, 255, 0.04); }
  .dropdown__item:hover { background: rgba(255, 255, 255, 0.04); border-radius: 8px; }

  /* --- City bottom sheet hidden on desktop (use dropdown instead) --- */
  .bottom-sheet { display: none !important; }

  /* --- Dropdown portal (desktop) for fixed-position dropdowns --- */
  #dropdown-portal .dropdown {
    position: fixed;
    display: flex;
    flex-direction: column;
  }
  #dropdown-portal .dropdown .dropdown__scroll {
    padding: 8px 16px 16px;
  }

  /* --- Loading star bigger --- */
  .loading__star {
    width: 161px;
    height: 131px;
  }

  /* ── RESULT PAGE (desktop) ── */
  .page--result {
    height: 100vh;
    overflow: hidden;
    contain: layout style;
  }

  /* Hide mobile result elements */
  .result-content { display: none; }
  .sticky-banner { display: none; }
  .twinby-popup { display: none !important; }
  .decor-star { display: none; }
  .vv-anchor { display: none; }

  /* Show desktop result layout */
  .result-layout {
    display: flex;
    position: relative;
    z-index: 2;
    gap: 72px;
    width: 860px;
    margin: 0 auto;
    padding: 24px 0 0;
    height: calc(100vh - 80px);
  }

  .result-illust {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
  }
  .result-illust__woman {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 680px;
    height: 298px;
  }
  .result-illust__star-l1 {
    position: absolute;
    top: 56px;
    left: 0;
    width: 125px;
    height: 188px;
    animation: starShimmer 5s ease-in-out infinite;
    will-change: opacity;
    backface-visibility: hidden;
  }
  .result-illust__star-l2 {
    position: absolute;
    top: 61px;
    left: 118px;
    width: 54px;
    height: 59px;
    animation: starShimmer 4s ease-in-out infinite 1s;
    will-change: opacity;
    backface-visibility: hidden;
  }
  .result-illust__cloud {
    position: absolute;
    top: -60px;
    right: 0;
    width: 450px;
    height: 554px;
  }
  .result-illust__star-r1 {
    position: absolute;
    top: 667px;
    right: 0;
    width: 74px;
    height: 199px;
    animation: starShimmer 6s ease-in-out infinite;
    will-change: opacity;
    backface-visibility: hidden;
  }
  .result-illust__star-r2 {
    position: absolute;
    top: 620px;
    right: 80px;
    width: 101px;
    height: 94px;
    animation: starShimmer 7s ease-in-out infinite 2s;
    will-change: opacity;
    backface-visibility: hidden;
  }

  /* Left sidebar */
  .result-sidebar {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 12px;
    align-self: flex-start;
    overflow: hidden;
  }

  /* Desktop score */
  .result-sidebar .result-score {
    padding: 0;
    gap: 2px;
  }
  .result-sidebar .result-score__label {
    font-size: 28px;
    font-weight: 700;
    line-height: 34px;
  }

  /* Desktop users */
  .result-sidebar .result-users { width: 100%; }
  .result-sidebar .result-user { padding-left: 0; }
  .result-sidebar .result-user__name {
    gap: 6px;
    font-size: 16px;
    line-height: 20px;
  }
  .result-sidebar .result-user__name img { width: 20px; height: 20px; }
  .result-sidebar .result-user__data {
    align-items: flex-start;
  }
  .result-sidebar .result-user__data-sep {
    background: var(--white56);
  }

  /* Desktop banner */
  .result-banner {
    display: block;
    position: relative;
    width: 347px;
    height: 544px;
  }
  .result-banner__bg {
    position: absolute;
    top: 76px;
    left: 0;
    width: 348px;
    height: 468px;
    border-radius: 20px;
  }
  .result-banner__illustration {
    position: absolute;
    top: -16px;
    left: 0;
    width: 344px;
    height: 207px;
    pointer-events: none;
  }
  .result-banner__text-block {
    position: absolute;
    top: 164px;
    left: calc(50% - 154px);
    width: 308px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .result-banner__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    color: #fefeff;
  }
  .result-banner__desc {
    font-size: 14px;
    line-height: 22px;
    color: var(--white56);
  }
  .result-banner__links {
    position: absolute;
    top: 374px;
    left: 20px;
    display: flex;
    width: 308px;
    align-items: center;
    gap: 16px;
  }
  .result-banner__qr {
    display: inline-flex;
    padding: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    flex-shrink: 0;
  }
  .result-banner__qr img { width: 98px; height: 98px; }
  .result-banner__stores { display: flex; flex-direction: column; gap: 12px; flex: 1; }
  .store-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px 10px 20px;
    background: var(--white6);
    border-radius: 16px;
    font-size: 14px;
    line-height: 22px;
    color: var(--white90);
    transition: background 0.2s;
  }
  .store-badge:hover { background: var(--white16); }
  .store-badge img { width: 24px; height: 24px; }
  .result-banner__cta {
    position: absolute;
    top: 482px;
    left: 20px;
    width: 308px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    line-height: 24px;
    color: #fff;
  }
  .result-banner__cta-arrow {
    width: 62px;
    height: 31px;
    position: absolute;
    top: 0;
    left: 75px;
  }
  .result-banner__cta-text {
    position: absolute;
    top: 14px;
    left: calc(50% - 11px);
    white-space: nowrap;
  }

  /* Right column — result details */
  .result-details {
    display: flex;
    flex-direction: column;
    width: 441px;
    gap: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
  }
  .result-details::-webkit-scrollbar { width: 4px; }
  .result-details::-webkit-scrollbar-track { background: transparent; }
  .result-details::-webkit-scrollbar-thumb { background: var(--white16); border-radius: 4px; }

  .result-details .result-divider__star { width: 20px; height: 20px; }

  /* Desktop back nav */
  .back-nav {
    width: 860px;
    margin: 0 auto;
    padding: 56px 0 0;
  }
  .back-nav__link {
    font-size: 16px;
    line-height: 20px;
    color: var(--white90);
    transition: opacity 0.2s;
  }
  .back-nav__link:hover { opacity: 0.7; }
}

/* Shrink illustrations on narrower desktop */
@media (min-width: 769px) and (max-width: 1100px) {
  .illust--woman { width: 380px; height: auto; }
  .illust--stars { width: 350px; height: auto; }
}
/* Hide illustrations on tablet-ish */
@media (min-width: 769px) and (max-width: 960px) {
  .illust--woman { display: none; }
  .illust--stars { display: none; }
  .content { padding-top: 80px; }
}
/* Narrow desktop */
@media (min-width: 769px) and (max-width: 700px) {
  .content {
    width: 100%;
    max-width: 100%;
    padding: 60px 20px 40px;
  }
  .title {
    white-space: normal;
    font-size: 28px;
    line-height: 34px;
  }
  .form {
    width: 100%;
    max-width: 424px;
  }
}
