/* ===== Базовые сбросы ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: hidden;               /* запрет горизонтальной прокрутки */
  width: 100%;
}

:root {
  --bg-1: #171226;
  --bg-2: #0e0b18;
  --text: #f4f1ff;
  --muted: #b9b2d0;
  --accent: #ff4d8d;
  --accent-2: #8b5cf6;
  --card: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.12);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 77, 141, 0.28), transparent 60%),
    radial-gradient(800px 500px at 110% 15%, rgba(139, 92, 246, 0.28), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ===== Контейнер ===== */
.app {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 44px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ===== Экраны ===== */
.screen { animation: fade .35s ease; }
.hidden { display: none; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ===== Стартовый экран ===== */
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 77, 141, 0.12);
  border: 1px solid rgba(255, 77, 141, 0.35);
  padding: 7px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.title {
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

.teaser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 26px;
}

.teaser span {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
}

.fineprint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ===== Кнопки ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 15px 20px;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease;
  text-align: center;
  line-height: 1.25;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 77, 141, 0.35);
}

.btn-primary .hint {
  font-weight: 600;
  font-size: 14px;
  opacity: 0.85;
}

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
}

/* ===== Экран вопросов ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease;
}

.icon-btn:active { transform: scale(0.95); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.progress-text {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .3s ease;
}

.question {
  font-size: clamp(21px, 5.4vw, 27px);
  line-height: 1.25;
  font-weight: 800;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.option:active {
  transform: scale(0.98);
  background: rgba(255, 77, 141, 0.18);
  border-color: var(--accent);
}

/* ===== Экран результата ===== */
.result-emoji {
  font-size: 72px;
  text-align: center;
  margin: 6px 0 14px;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-name {
  font-size: clamp(24px, 6.4vw, 34px);
  line-height: 1.15;
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
}

.result-name span { text-transform: uppercase; }

.result-text {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-note {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 22px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-feedback {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #7ef29a;
}

.cta {
  margin-top: 24px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ===== Кому подходишь ===== */
.match-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.match-prefix {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c4b5fd;
}

.match-value {
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== Ссылки на шаринг ===== */
.share-links {
  margin-top: 18px;
  text-align: center;
}

.share-links-title {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.share-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .06s ease, background .15s ease;
}

.share-chip:active { transform: scale(0.97); }

/* ===== Футер (дисклеймер) ===== */
.quiz-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.footer-joke {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.footer-credits {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.footer-credits a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

/* ===== Десктоп ===== */
@media (min-width: 640px) {
  .app { padding-top: 48px; }
  .option:hover { background: rgba(255, 255, 255, 0.1); }
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
}
