:root {
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: "Playfair Display", Georgia, serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-button: 16px;
  --bg-primary: #0d0d1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e36;
  --text-primary: #f0f0ff;
  --text-secondary: #b8b8d0;
  --text-muted: #7878a0;
  --accent-primary: #ff4d8d;
  --accent-secondary: #8a70ff;
  --accent-gradient: linear-gradient(135deg, #ff4d8d, #8a70ff);
  --accent-soft: rgba(255, 77, 141, 0.15);
  --border-color: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(13, 13, 26, 0.85);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.35);
  --gold: #e8c36a;
  --mint: #6ed3ae;
  --focus: #8a70ff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; }

.bg-glow {
  position: fixed;
  top: -160px;
  left: 50%;
  width: 480px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 77, 141, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
.nav-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 56px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav-logo img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}

.lang-selector { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-weight: 600;
  font-size: 0.875rem;
  min-height: 40px;
}
.lang-btn:hover { background: rgba(255, 77, 141, 0.16); }
.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 30;
}
.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.lang-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 0.9rem;
}
.lang-option:hover,
.lang-option.active {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.screen { display: none; }
.screen.is-active { display: block; animation: fadeSlide 0.32s ease; }
.screen.is-active.from-back { animation-name: fadeSlideBack; }
html.quiz-autostart #screen-intro { display: none !important; }
html.quiz-autostart #screen-quiz { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeSlideBack {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}

.intro-title,
.result-title,
.question-text,
.gift-title {
  letter-spacing: -0.02em;
  line-height: 1.25;
}

#screen-intro {
  text-align: center;
}
.intro-title {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: clamp(1.65rem, 6vw, 2.2rem);
  margin-bottom: 16px;
}
.intro-copy {
  max-width: 34em;
  margin: 0 auto;
}
.intro-copy p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.intro-meta {
  display: block;
  margin: 18px 0 22px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(255, 77, 141, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255, 77, 141, 0.28); }
.cta-btn:active { transform: scale(0.98); }
.cta-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 28px;
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.cta-btn-outline:hover { background: var(--accent-soft); transform: translateY(-2px); }
#startBtn {
  display: inline-flex;
  margin-left: auto;
  margin-right: auto;
}
.cta-btn:active { transform: scale(0.98); }

.helper {
  margin-top: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-count {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.progress-track {
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.question-text {
  font-size: clamp(1.12rem, 4vw, 1.38rem);
  font-weight: 600;
  line-height: 1.45;
}
.question-text strong { color: #ffb0cc; }

.answers { display: grid; gap: 10px; }
.answer-btn {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.answer-yes {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 77, 141, 0.2);
}
.answer-no {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.answer-btn:hover { transform: translateY(-1px); }
.answer-yes.is-selected,
.answer-btn.is-picked {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent-primary);
}
.answer-no.is-selected {
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-color));
  background: var(--accent-soft);
}

.back-btn {
  display: inline-flex;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 40px;
}
.back-btn:hover { color: var(--text-primary); }
.back-btn[hidden] { display: none; }

.result-head { text-align: center; margin-bottom: 10px; }
.result-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.score-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}
.score-num {
  font-family: var(--font-accent);
  font-size: clamp(2.6rem, 9vw, 3.2rem);
  font-weight: 700;
  color: var(--accent-primary);
}
.score-den {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.15rem;
}
.score-line.band-mid .score-num { color: var(--gold); }
.score-line.band-high .score-num { color: var(--mint); }
.score-line.band-top .score-num { color: var(--accent-primary); }
.score-line.band-low .score-num { color: var(--accent-secondary); }

.insight { text-align: center; margin-bottom: 16px; }
.result-title {
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.insight p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.result-close {
  color: var(--text-primary) !important;
  font-weight: 700;
}

.gift-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 77, 141, 0.22);
  border-radius: var(--radius-lg);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-sm);
}
.gift-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gift-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.gift-free {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.gift-items {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.gift-items li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
}
.gift-ico { font-size: 1.05rem; line-height: 1.4; }
.gift-items strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 1px;
}
.gift-items p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}
.gift-more {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-bottom: 14px;
}
.gift-micro {
  margin-top: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.restart-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 40px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
}
.restart-btn:hover { color: var(--text-primary); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  .page { padding-top: 36px; }
  .gift-card { padding: 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .screen.is-active,
  .screen.is-active.from-back { animation: none; }
  .cta-btn, .answer-btn, .progress-fill, .lang-dropdown { transition: none; }
}
