/* ===== АТЛАС - стили приложения ===== */
:root {
  --bg: #131A24;
  --surface: #1C2634;
  --surface2: #243145;
  --accent: #D4875A;
  --accent-soft: rgba(212,135,90,.16);
  --gold: #E8C58A;
  --text: #F1E9DC;
  --muted: #8E9AAD;
  --line: #2E3B4F;
  --ok: #83B58C;
  --danger: #C96A5A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
  min-height: 100vh;
}
#root { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* --- шапка --- */
#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 8px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 75%, transparent);
}
#logo-mark { width: 34px; height: 34px; }
#topbar-title { font-family: Georgia, serif; font-size: 17px; letter-spacing: .04em; flex: 1; }
#topbar-back {
  background: none; border: none; color: var(--gold);
  font-size: 26px; line-height: 1; padding: 2px 8px 4px 0;
  cursor: pointer; font-family: inherit;
}
#topbar-back.hidden { display: none; }
.chip {
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 10px; font-size: 13px; color: var(--gold);
  white-space: nowrap;
}
.chip-click { cursor: pointer; font-family: inherit; }
.chip-streak { color: var(--accent); }

/* --- контент --- */
#screen { flex: 1; padding: 8px 16px 96px; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 500; margin: .4em 0; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin: 12px 0;
}
.card.tap { cursor: pointer; transition: border-color .15s, transform .1s; }
.card.tap:active { transform: scale(.985); border-color: var(--accent); }
.card .card-title { font-family: Georgia, serif; font-size: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; }
.glyph-canvas { width: 44px; height: 44px; flex: none; }

.btn {
  display: inline-block; width: 100%;
  background: var(--accent); color: #1A1310;
  border: none; border-radius: 14px; padding: 14px 18px;
  font-size: 15.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; margin: 10px 0 4px; text-align: center;
}
.btn:active { transform: scale(.98); }
.btn.ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--line);
}
.btn.small { width: auto; padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; }
/* Кнопка-самостоятельный блок между карточками (Профиль, «Пополнить Люмы»):
   отступы сверху и снизу одинаковые (10px), зазор до соседних карточек симметричный (22px) */
.btn.cta-block { margin: 10px 0; }

/* --- онбординг --- */
.onb-page { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; }
.onb-page canvas { width: 180px; height: 180px; margin: 0 auto; }
.onb-title { text-align: center; margin-top: 6px; }
.onb-text { text-align: center; color: var(--muted); padding: 0 12px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--accent); }

/* --- шкала ответа --- */
.scale-opts { display: flex; gap: 6px; margin-top: 18px; }
.scale-opts button {
  flex: 1; background: var(--surface2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 0; font-size: 15px; font-family: inherit; cursor: pointer;
}
.scale-opts button.picked { background: var(--accent); color: #1A1310; border-color: var(--accent); font-weight: 700; }
.scale-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.3; margin-top: 6px; text-align: center; }
.progress { height: 4px; background: var(--surface2); border-radius: 4px; overflow: hidden; margin: 10px 0 18px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }

/* --- карты --- */
.card-face-wrap { display: flex; flex-direction: column; align-items: center; }
.card-face-wrap canvas { width: min(84vw, 320px); height: auto; aspect-ratio: 3/4.7; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.ritual-text { font-size: 15px; color: var(--text); margin: 16px 0; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-soft); background: var(--accent-soft); padding: 2px 10px; border-radius: 10px; }

/* --- списки --- */
.deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deck-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; min-height: 120px; display: flex; flex-direction: column; }
.deck-cell canvas { width: 40px; height: 40px; }
.deck-cell.locked { opacity: .55; }
.deck-cell .dc-title { font-family: Georgia, serif; font-size: 14px; margin-top: 8px; }
.deck-cell .dc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; flex: 1; }
.deck-cell .dc-cta { font-size: 12px; color: var(--gold); margin-top: 6px; }

.test-item { display: flex; align-items: center; gap: 12px; }
.badge { font-size: 11px; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.badge.done { background: rgba(131,181,140,.15); color: var(--ok); }
.badge.todo { background: var(--surface2); color: var(--muted); }
.badge.chain { background: var(--accent-soft); color: var(--accent); }
.badge.stale { background: rgba(201,106,90,.16); color: var(--danger); }

/* --- карта личности --- */
/* Волна 11г: чуть больше воздуха между картой и заголовком карточки над ней */
#radar-box { margin-top: 14px; }
#radar-box canvas { display: block; margin: 0 auto; }
.domain-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.domain-pill { background: var(--surface2); border-radius: 12px; padding: 8px 10px; font-size: 12.5px; }
.domain-pill.ext { border-left: 3px solid rgba(212,135,90,.45); }
.domain-pill b { display: block; font-size: 13px; }
.domain-pill span { color: var(--muted); }
.card.locked { opacity: .55; }

/* --- ранги --- */
.rank-ladder { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rank-step { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface2); }
.rank-step.cur { border: 1px solid var(--accent); background: var(--accent-soft); }
.rank-step .rs-num { width: 26px; height: 26px; flex: none; }
.rank-step b { font-family: Georgia, serif; }
.rank-step .muted { display: block; font-size: 12px; }
.pbar { height: 6px; background: var(--surface2); border-radius: 6px; margin: 10px 0; overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* --- оракул --- */
.theme-chips { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.theme-chip { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; position: relative; transition: border-color .15s, transform .1s; }
.theme-chip:active { transform: scale(.985); border-color: var(--accent); }
.theme-chip.viewed { border-color: rgba(212,135,90,.45); background: var(--accent-soft); }
.theme-chip b { font-family: Georgia, serif; }
.theme-chip .muted { font-size: 12.5px; }
/* Темы выглядят как кнопочные блоки: подпись-действие и стрелка (п.5 правок) */
.theme-chip .tc-cta { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--gold); }
.theme-chip::after { content: "→"; position: absolute; right: 16px; top: 16px; color: var(--gold); font-size: 17px; }
input[type=text], input[type=password], input[type=email], textarea {
  width: 100%; background: var(--surface2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* --- интерпретации --- */
.interp-block { border-left: 3px solid var(--accent); padding: 6px 0 6px 14px; margin: 14px 0; }
.interp-block h3 { margin: 0 0 4px; color: var(--gold); }

/* --- кошелёк --- */
.tx { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.tx .amount { font-weight: 700; }
.tx .amount.plus { color: var(--ok); }
.tx .amount.minus { color: var(--danger); }
.big-light { font-size: 34px; font-family: Georgia, serif; color: var(--gold); text-align: center; padding: 10px 0; }
.big-light span { font-size: 16px; color: var(--muted); }
.pack { display: flex; align-items: center; gap: 12px; }
.pack .pl { flex: 1; }
.pack .pr { font-size: 16px; color: var(--gold); font-weight: 700; }

/* --- низ --- */
#navbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: center; gap: 2px;
  background: rgba(19,26,36,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
#navbar button {
  flex: 1; max-width: 120px;
  background: none; border: none; color: var(--muted);
  font-size: 10.5px; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0;
}
#navbar button .nav-glyph { font-size: 20px; line-height: 1; }
#navbar button.on { color: var(--accent); }

/* --- тосты и модальные окна --- */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #2B3648; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 18px; font-size: 14px; z-index: 50;
  max-width: 88%; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
#toast.ok { border-color: var(--ok); }
#toast.err { border-color: var(--danger); }
#modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10,14,20,.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#modal-box {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; max-width: 460px; width: 100%;
  max-height: 80vh; overflow-y: auto;
}
/* Крестик закрытия модального окна (п.20 правок) */
.modal-x {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: none; border: none; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px;
  font-family: inherit;
}
.modal-x:hover { color: var(--text); }
.hidden { display: none !important; }

/* Волна 9: выбор категорий карт для ритуала (модалка со списком наборов) */
.deck-pick-list { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.deck-pick-row {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.deck-pick-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.deck-pick-row b { display: block; font-size: 14px; }
.deck-pick-row i { display: block; font-style: normal; font-size: 12px; margin-top: 2px; }

.demo-banner {
  background: var(--surface2); border: 1px dashed var(--muted);
  color: var(--muted); font-size: 12px; border-radius: 10px;
  padding: 6px 12px; margin: 8px 0; text-align: center;
}
.safety-note { font-size: 12px; color: var(--muted); text-align: center; padding: 10px 0; }
.safety-note a { color: var(--gold); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.list-plain { margin: 8px 0; padding-left: 18px; }
.list-plain li { margin: 6px 0; }

/* --- добавлено при переходе на веб-версию --- */
.err { color: var(--danger); font-size: 13px; }

/* --- согласие, приветствие, спец-блоки результата, повтор карты --- */
.greet { color: var(--gold); font-family: Georgia, serif; text-align: center; margin: 4px 0 6px; font-size: 16px; }
/* Значок и название уровня под приветствием на главной (п.21 правок) */
.rank-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 14px; color: var(--gold); font-family: Georgia, serif; font-size: 13.5px; }
.rank-line canvas { width: 22px; height: 22px; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.consent-row input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.consent-row a { color: var(--gold); }
.special-note { background: rgba(232,197,138,.08); border: 1px solid rgba(232,197,138,.35); border-radius: 14px; padding: 14px 16px; margin: 14px 0; color: var(--text); font-size: 14.5px; line-height: 1.5; }
.special-note.ghosted { background: transparent; border-color: var(--line); color: var(--muted); }
.repeat-note { background: rgba(212,135,90,.10); border: 1px solid rgba(212,135,90,.45); border-radius: 14px; padding: 14px 16px; margin: 12px 0; font-size: 14.5px; line-height: 1.5; }

/* --- волна 4: Оракул, навигация, капча, соцсети, бот MAX --- */
/* Приветствие на главной - белый шрифт (п.3 правок) */
.greet { color: #ffffff; }
/* Отступ карты от текста выше на главной (п.6 правок) */
.rank-line + .card { margin-top: 18px; }
/* Уровень на главной кликабелен - ведёт в Профиль (п.4 правок) */
.rank-line { cursor: pointer; }
.rank-line:active { transform: scale(.985); }

/* Слайдер-капча «линия света» (волна 5): один понятный жест вместо пазла */
.cap-track {
  position: relative; height: 52px; border-radius: 26px; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--line);
  margin: 8px 0 6px; width: 100%; touch-action: none; user-select: none;
  transition: border-color .3s, box-shadow .3s;
}
.cap-fill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 26px;
  background: linear-gradient(90deg, rgba(212,135,90,.55), rgba(232,197,138,.85));
  box-shadow: 0 0 18px rgba(232,197,138,.35);
  transition: none; pointer-events: none;
}
.cap-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; line-height: 1.25; color: var(--muted); padding: 0 62px; text-align: center;
  pointer-events: none;
}
.cap-handle {
  position: absolute; top: 4px; left: 0; width: 52px; height: 42px;
  border-radius: 21px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #2C3A50, #1C2634);
  color: var(--gold); cursor: grab; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 12px rgba(232,197,138,.18);
  touch-action: none;
}
.cap-handle:active { cursor: grabbing; }
.cap-done-mark {
  position: absolute; right: 16px; top: 0; height: 100%; display: flex; align-items: center;
  font-size: 22px; color: #9BD8A8; opacity: 0; pointer-events: none;
}
.cap-track.cap-done { border-color: rgba(120,190,140,.7); }
.cap-track.cap-done .cap-fill { background: linear-gradient(90deg, rgba(120,190,140,.5), rgba(155,216,168,.9)); box-shadow: 0 0 18px rgba(155,216,168,.4); }
.cap-track.cap-done .cap-hint { color: #16351F; font-weight: 600; }
.cap-track.cap-done .cap-handle { color: #9BD8A8; border-color: rgba(120,190,140,.8); }
.cap-track.cap-done .cap-handle svg { display: none; }
.cap-track.cap-done .cap-handle::after { content: '✓'; font-size: 20px; }
.cap-track.cap-done .cap-done-mark { opacity: 1; }
.cap-track.cap-error { animation: cap-shake .4s; border-color: var(--danger, #C96A5A); }
.cap-err { text-align: left; }
/* Почта в профиле (волна 6): поле и кнопка друг под другом на всю ширину -
   раньше в одну строку поле сжималось до узкой щели рядом с кнопкой */
.email-row { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: 6px; }
.email-row input { width: 100%; min-width: 0; }
.email-row .btn { white-space: nowrap; padding: 10px 14px; font-size: 14px; }

/* Вход через соцсети (п.10 правок) */
.social-row { margin-top: 14px; }
.social-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.social-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.social-btn { text-align: center; width: 100%; }

/* Тряска поля вопроса при пустой отправке (п.3 правок) */
.shake { animation: cap-shake .4s; }
@keyframes cap-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
