/* ──────────────────────────────────────────────
   Smoke Club Mini App
   Тёмная lounge-эстетика, единая в любой теме Telegram.
   ────────────────────────────────────────────── */

:root {
  --bg: #0d0d10;
  --bg-soft: #16161b;
  --bg-card: #1b1b21;
  --line: #2a2a32;
  --text: #f2f2f5;
  --muted: #8f8f9c;
  --accent: #d4a24c;
  --accent-soft: rgba(212, 162, 76, 0.14);
  --danger: #ff6b5e;
  --ok: #3ecf8e;

  --radius: 16px;
  --radius-sm: 12px;
  --pad: 20px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Классы вроде .btn задают display и перебивают браузерное [hidden] — возвращаем приоритет. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overscroll-behavior-y: none;
}

body { position: relative; overflow-x: hidden; }

/* ── Дымка на фоне ── */
.smoke { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.smoke span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  animation: drift 26s ease-in-out infinite;
}
.smoke span:nth-child(1) { width: 300px; height: 300px; top: -90px; left: -70px; background: #3a2f6b; }
.smoke span:nth-child(2) { width: 260px; height: 260px; top: 32%; right: -110px; background: #6b4a2f; animation-delay: -9s; }
.smoke span:nth-child(3) { width: 320px; height: 320px; bottom: -130px; left: 10%; background: #24513f; animation-delay: -17s; }

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(18px, -26px, 0) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .smoke span { animation: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Каркас экранов ── */
#app { position: relative; z-index: 1; }

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 24px) var(--pad) calc(var(--safe-bottom) + 20px);
}
.screen.is-active { display: flex; animation: fade 0.28s ease both; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; }

/* ── Типографика ── */
.h1 { font-size: 27px; line-height: 1.22; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.hero-title { font-size: 28px; }
.accent { color: var(--accent); }
.lead { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 14px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 600; margin: 26px 0 10px; }
.big-emoji { font-size: 56px; line-height: 1; margin-bottom: 4px; }

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(212, 162, 76, 0.28);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ── Интро ── */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 12px 0 20px; }

.perks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.perks li { display: flex; gap: 13px; align-items: flex-start; }
.perks li > span { font-size: 21px; line-height: 1.2; flex: 0 0 auto; }
.perks b { display: block; font-size: 15px; font-weight: 600; }
.perks small { color: var(--muted); font-size: 13px; }

/* ── Шаги в гейте ── */
.steps { display: grid; gap: 10px; margin: 20px 0 4px; width: 100%; max-width: 340px; }
.step { display: flex; align-items: center; gap: 12px; text-align: left; color: var(--muted); font-size: 14px; }
.step i {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-style: normal; font-size: 13px; font-weight: 700;
}

/* ── Кнопки ── */
.actions { display: grid; gap: 10px; padding-top: 20px; margin-top: auto; }

.btn {
  display: block; width: 100%;
  padding: 15px 18px;
  border: 0; border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; font-weight: 600;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.btn-primary { background: linear-gradient(135deg, #e0b05a, #c78f38); color: #14100a; box-shadow: 0 8px 22px rgba(199, 143, 56, 0.25); }
.btn-ghost { background: var(--bg-card); color: var(--text); border: 1px solid var(--line); }
.btn-link { background: none; color: var(--muted); font-weight: 500; font-size: 14px; padding: 10px; }

/* ── Тест ── */
.screen--quiz { padding-top: calc(var(--safe-top) + 16px); }

.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.progress { flex: 1; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.quiz-counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.quiz-body { flex: 1; }
.q-title { font-size: 22px; line-height: 1.28; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; }
.q-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.options { display: grid; gap: 10px; margin-top: 18px; }

.opt {
  display: flex; gap: 13px; align-items: flex-start;
  width: 100%; text-align: left;
  padding: 15px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.opt:active { transform: scale(0.99); }
.opt.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.opt-emoji { font-size: 20px; line-height: 1.3; flex: 0 0 auto; }
.opt-body { min-width: 0; }
.opt-label { font-weight: 600; font-size: 15px; line-height: 1.35; }
.opt-hint { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.opt-check {
  flex: 0 0 20px; height: 20px; margin-left: auto; margin-top: 2px;
  border: 1.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; color: #14100a;
}
.opt--multi .opt-check { border-radius: 6px; }
.opt.is-picked .opt-check { background: var(--accent); border-color: var(--accent); }
.opt.is-picked .opt-check::after { content: "✓"; }

textarea, input[type="text"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"] {
  width: 100%;
  padding: 14px 15px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
textarea:focus, input:focus { border-color: var(--accent); }
::placeholder { color: #5c5c68; }

/* ── Результат ── */
.result { flex: 1; }
.result-emoji { font-size: 60px; line-height: 1; margin-bottom: 10px; }
.tagline { color: var(--accent); font-size: 15px; font-style: italic; margin: 0 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.chip { font-size: 12px; padding: 6px 11px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line); color: var(--muted); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
}
.card p { margin: 0; font-size: 15px; line-height: 1.6; }
.card-soft { background: var(--bg-soft); }
.card-soft p { color: var(--muted); font-size: 14px; }

.dist { display: grid; gap: 9px; }
.dist-row { display: flex; align-items: center; gap: 11px; font-size: 13px; }
.dist-row .name { flex: 0 0 auto; }
.dist-row .track { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.dist-row .track i { display: block; height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.dist-row .pct { flex: 0 0 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.dist-row.is-me { font-weight: 700; }
.dist-row.is-me .pct { color: var(--text); }

.recs { display: grid; gap: 10px; }
.rec {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 15px;
}
.rec > span { font-size: 19px; flex: 0 0 auto; }
.rec b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.rec p { margin: 0; font-size: 14px; line-height: 1.5; }

.callout {
  margin-top: 24px;
  background: linear-gradient(150deg, rgba(212, 162, 76, 0.16), rgba(212, 162, 76, 0.05));
  border: 1px dashed rgba(212, 162, 76, 0.45);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.callout-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 9px; }
.callout p { margin: 0 0 9px; font-size: 15px; line-height: 1.55; font-weight: 600; }
.callout small { color: var(--muted); font-size: 12px; }

/* ── Форма брони ── */
.form { display: grid; gap: 15px; margin-top: 20px; flex: 1; align-content: start; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field > span small { color: #5c5c68; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  flex: 0 0 46px; height: 46px;
  background: var(--bg-card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
}
.stepper button:active { background: var(--line); }
.stepper input { text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hint { color: var(--muted); font-size: 13px; margin: 0; }
.error-inline { color: var(--danger); font-size: 14px; margin: 0 0 4px; text-align: center; }

/* ── Спиннер ── */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Узкие экраны ── */
@media (max-width: 360px) {
  :root { --pad: 16px; }
  .h1 { font-size: 24px; }
  .hero-title { font-size: 25px; }
  .q-title { font-size: 20px; }
}
