:root {
  --c-bg: #101218;
  --c-surface: #161a24;
  --c-surface-2: #1c2132;
  --c-text: #eaecf2;
  --c-dim: #aab2be;
  --c-brand: #ff3568;
  --c-brand-2: #ff668d;
  --c-link: #6d8eff;
  --c-ok: #24c760;
  --c-err: #f04546;
  --r-base: 13px;
  --r-sm: 9px;
  --container: 480px;
  --topbar-h: 54px;
}

* { box-sizing: border-box }
html, body { height: 100% }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 40px) }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--c-text);
  background: linear-gradient(155deg, #060912 0%, #0b1729 33%, #0d1934 53%, #091122 73%, #040609 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main { display: flex; flex-direction: column; flex: 1 0 auto }
img { max-width: 100%; display: block }
[hidden] { display: none !important }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 14px }

/* === TOPBAR === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,18,.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar__row { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--c-text); text-decoration: none }
.brand:hover { opacity: .9; cursor: pointer }
.logo { font-size: 20px; color: var(--c-brand) }
.brand__name { font-size: 15px; letter-spacing: .3px }
.topbar__online { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-dim); font-weight: 600 }
.topbar__online strong { color: var(--c-text) }
.topbar__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ok); box-shadow: 0 0 6px rgba(34,197,94,.6); animation: dotPulse 2s ease-in-out infinite }

/* === TIMER BAR === */
.timer-bar {
  position: sticky; top: 54px; z-index: 49;
  background: rgba(255,51,102,.12);
  border-bottom: 1px solid rgba(255,51,102,.25);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  color: #ffb0c2;
  font-weight: 500;
}
.timer-bar strong { color: #fff; font-weight: 700 }

/* === CATALOG / GRID === */
.catalog { padding: 16px 0 8px }
.section__title { font-size: 18px; margin: 0 0 14px; text-align: center; line-height: 1.3 }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px }
.profile {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.profile--link:active { transform: scale(.97) }
.profile__photo { position: relative; aspect-ratio: 3/4; overflow: hidden }
.profile__photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.03) }
.profile__details { padding: 10px 12px; flex: 1 }
.profile h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700 }
.profile-dist { font-size: 12px; color: var(--c-link); margin: 0 0 4px; font-weight: 600 }
.bio { font-size: 12px; color: var(--c-dim); margin: 0; line-height: 1.4 }

/* Blurred teaser card */
.profile--blurred { cursor: pointer }
.profile--blurred .profile__photo img { filter: blur(12px) saturate(1.2) brightness(.7); transform: scale(1.1) }
.profile__photo--placeholder {
  background: linear-gradient(135deg, #1a1e2e 0%, #2a1f3d 40%, #1e2a3a 70%, #1a1e2e 100%);
}
.profile__lock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 16px;
  font-size: 12px; color: rgba(255,255,255,.85); font-weight: 600; line-height: 1.4;
}
.profile__lock span { font-size: 20px; font-weight: 800; color: #fff }

/* Status tag */
.status-tag {
  position: absolute; top: 6px; right: 6px;
  display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 2px 6px; border-radius: 999px;
  font-size: 8px; font-weight: 700; letter-spacing: .3px; color: #fff; text-transform: uppercase; z-index: 2;
}
.status-tag__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c-ok); box-shadow: 0 0 6px rgba(34,197,94,.7); animation: dotPulse 2s ease-in-out infinite }

/* === QUIZ === */
.quiz-section { padding: 20px 0 24px; scroll-margin-top: calc(var(--topbar-h) + 40px) }
.quiz-section__inner { display: flex; justify-content: center; padding: 0 14px }
.quiz-section__card {
  width: 100%; max-width: 420px;
  background: rgba(21,25,38,.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
  animation: pulseCard 2.4s ease-in-out infinite;
  text-align: center;
}
@keyframes pulseCard {
  0%,100% { box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 0 0 rgba(255,51,102,.2) }
  50% { box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 0 6px rgba(255,51,102,.06) }
}
.qz-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--c-dim);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; padding: 5px 12px; margin: 0 auto 16px; letter-spacing: .2px;
}
.qz-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.6);
  animation: dotPulse 2s ease-in-out infinite; flex-shrink: 0;
}
.qz-badge strong { color: var(--c-text) }

.quiz-step__title { font-size: 20px; font-weight: 700; margin: 0 0 16px; text-align: center; line-height: 1.3 }
.quiz-step__options { display: flex; flex-direction: column; gap: 10px }

.qz-btn {
  appearance: none; border: 2px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.04); color: var(--c-text);
  font-size: 16px; font-weight: 600; padding: 14px 18px;
  border-radius: var(--r-base); cursor: pointer;
  transition: all .2s ease; text-align: center; min-height: 52px;
}
.qz-btn:hover:not([disabled]) { background: rgba(255,51,102,.12); border-color: var(--c-brand); transform: translateY(-1px) }
.qz-btn:active:not([disabled]) { transform: scale(.97) }
.qz-btn--cta {
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-2));
  border-color: transparent; color: #fff; font-weight: 700;
  font-size: 17px; min-height: 58px;
  box-shadow: 0 6px 20px rgba(255,51,102,.35);
  animation: pulseBtn 2s ease-in-out infinite;
}
.qz-btn--cta:hover:not([disabled]) { background: linear-gradient(135deg, #e0294e, var(--c-brand)); border-color: transparent; transform: translateY(-1px) }
.qz-btn--wide { width: 100% }
@keyframes pulseBtn {
  0%,100% { transform: scale(1); box-shadow: 0 6px 20px rgba(255,51,102,.35) }
  50% { transform: scale(1.02); box-shadow: 0 10px 30px rgba(255,51,102,.5) }
}

/* Quiz result: blurred match photos */
.qz-result { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center }
.qz-result__msg { font-size: 15px; color: var(--c-text); margin: 0 }
.qz-matches__photos { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px }
.qz-matches__img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,51,102,.4) }
.qz-matches__img--blur { filter: blur(4px) saturate(1.2); transform: scale(1.05) }
.qz-matches__img--placeholder { background: linear-gradient(135deg, #2a1f3d, #1e2a3a, #2d1a2e); }
.qz-matches__text { font-size: 14px; color: var(--c-dim); margin: 0 }
.qz-matches__text strong { color: var(--c-text); font-size: 18px }
.qz-offer-hint { font-size: 12px; color: var(--c-dim); margin: 0 }

/* Loader */
.quiz-step--loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0 }
.qz-spin { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--c-brand); border-radius: 50%; animation: spin .75s linear infinite }
.qz-status { font-size: 14px; color: var(--c-dim); margin: 0; animation: loaderFade 1.2s ease-in-out infinite }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes loaderFade { 0%,100% { opacity: 1 } 50% { opacity: .5 } }
@keyframes dotPulse { 0%,100% { opacity: 1; box-shadow: 0 0 6px rgba(34,197,94,.7) } 50% { opacity: .55; box-shadow: 0 0 12px rgba(34,197,94,1) } }

/* === FOOTER === */
.footer { border-top: 1px solid rgba(255,255,255,.06); background: rgba(10,12,18,.65); flex-shrink: 0 }
.footer__row { display: flex; align-items: center; justify-content: center; padding: 14px 0; flex-wrap: wrap; gap: 8px }
.legal { display: flex; gap: 8px; align-items: center; color: var(--c-dim); font-size: 11px; flex-wrap: wrap; justify-content: center }
.legal a { color: var(--c-dim) }
.disclaimer-text { opacity: .6 }

/* === NOTIFICATION POPUP === */
.notif-popup {
  position: fixed; bottom: 20px; left: 12px; right: 12px;
  max-width: 340px; z-index: 10000;
  background: rgba(21,25,38,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(20px); visibility: hidden;
  transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
}
.notif-popup.show { opacity: 1; transform: translateY(0); visibility: visible }
.notif-popup__avatar { width: 44px; height: 44px; flex-shrink: 0 }
.notif-popup__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover }
.notif-popup__body { flex: 1; min-width: 0 }
.notif-popup__body strong { display: block; font-size: 14px; color: #fff; margin-bottom: 2px }
.notif-popup__body p { margin: 0; font-size: 12px; color: var(--c-dim) }
.notif-popup__btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--c-brand); color: #fff; font-size: 12px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}

/* === RESPONSIVE === */
@media (min-width: 480px) {
  :root { --container: 520px }
  .grid { gap: 12px }
  .profile h3 { font-size: 16px }
}
@media (min-width: 768px) {
  :root { --container: 720px }
  .grid { grid-template-columns: repeat(3, 1fr) }
  .section__title { font-size: 22px }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-section__card { animation: none }
  .qz-btn--cta { animation: none }
}
