/* ============================================================
   SINTESIS · БАЗОВЫЕ СТИЛИ (единые для ВСЕХ страниц)
   Цвета, шрифты, кнопки, шапка, подвал, плавающая кнопка «Назад»
   ============================================================ */

/* ---------- 1. ТОКЕНЫ ---------- */
:root {
  /* фоны */
  --bg: #09090b;
  --bg-elev: #101013;
  --card: #18181b;
  --card-2: #141417;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* золото — основной акцент */
  --gold: #d4af37;
  --gold-light: #f4d06f;
  --gold-dark: #b8860b;
  --grad-gold: linear-gradient(135deg, #d4af37 0%, #f4d06f 50%, #b8860b 100%);

  /* текст */
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  /* состояния */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --info: #60a5fa;

  /* шрифты */
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-text: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* размеры сетки */
  --app-max: 430px;          /* ширина «телефона» на десктопе */
  --header-h: 60px;
  --footer-h: 62px;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 24px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- 2. СБРОС ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: #050506;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: var(--gold-light); text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 3. КАРКАС ПРИЛОЖЕНИЯ ---------- */
.app {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

@media (min-width: 640px) {
  .app {
    min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* контент страницы: место под шапку и подвал */
.page {
  flex: 1;
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: calc(var(--footer-h) + 96px);
  overflow-x: hidden;
}

/* ---------- 4. ШАПКА (единая) ---------- */
.sx-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: var(--header-h);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.sx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sx-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.45));
}

.sx-brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text);
  white-space: nowrap;
}

.sx-brand-text .sep { color: var(--gold); opacity: 0.7; font-weight: 400; }
.sx-brand-text .en  { color: var(--gold); font-size: 14px; letter-spacing: 1px; }

.sx-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sx-points-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
}
.sx-points-chip:active { transform: scale(0.95); }
.sx-points-chip:hover { background: rgba(212, 175, 55, 0.18); }

.sx-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-light);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}
.sx-icon-btn:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.1); }

/* ---------- 5. КНОПКИ (единый размер) ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;              /* единая высота ВСЕХ кнопок */
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-m);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn:active { transform: scale(0.975); }
.btn:disabled,
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* основной — золотой */
.btn-primary {
  background: var(--grad-gold);
  color: #0a0a0a;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.28);
}

/* контурный */
.btn-outline {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--gold-light);
}

/* тёмный */
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

/* зелёный (успех / открыть) */
.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #04120a;
}

/* опасный */
.btn-danger {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* размерные модификаторы — только меняют высоту/шрифт, ширина общая */
.btn-sm { height: 40px; font-size: 13px; padding: 0 14px; border-radius: var(--radius-s); }
.btn-lg { height: 58px; font-size: 16px; }
.btn-inline { width: auto; }

/* пульсация для главного CTA */
.btn-pulse { animation: sx-pulse 2.4s infinite; }
@keyframes sx-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* группа кнопок */
.btn-stack { display: flex; flex-direction: column; gap: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

/* ---------- 6. КАРТОЧКИ ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 18px;
  margin: 0 16px 12px;
  position: relative;
}

.card-gold {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(180deg, #18181b 0%, rgba(212, 175, 55, 0.05) 100%);
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.card-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ---------- 7. ТЕКСТ / ЗАГОЛОВКИ ---------- */
.page-head { padding: 6px 16px 14px; }
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 6px;
}
.page-subtitle { font-size: 14px; color: var(--text-muted); line-height: 1.55; }

.gold { color: var(--gold-light); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
  margin: 18px 0;
}

/* ---------- 8. БЕЙДЖИ И ЧИПЫ ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-gold {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
}
.badge-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.badge-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}
.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.chip.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
}

/* ---------- 9. ПОДВАЛ (навигация) ---------- */
.sx-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: var(--footer-h);
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(12, 12, 14, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.sx-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  position: relative;
}

.sx-nav-item .nav-ico { font-size: 19px; line-height: 1; }
.sx-nav-item.active { color: var(--gold); }
.sx-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-gold);
}

/* ---------- 10. ПЛАВАЮЩАЯ КНОПКА «НАЗАД» ---------- */
.sx-back {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--footer-h) + 14px);
  z-index: 290;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: 24px;
  background: rgba(24, 24, 27, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: 0.2s;
  white-space: nowrap;
}
.sx-back:hover { background: rgba(24, 24, 27, 0.85); border-color: var(--gold); }
.sx-back:active { transform: translateX(-50%) scale(0.95); }
.sx-back.hidden { display: none; }

/* ---------- 11. МОДАЛКИ ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.active { display: flex; }

.modal-content {
  width: 100%;
  max-width: 360px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  position: relative;
  animation: sx-zoom 0.28s ease-out;
  scrollbar-width: none;
}
.modal-content::-webkit-scrollbar { display: none; }

@keyframes sx-zoom {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.75); color: var(--gold); }

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
  padding: 0 22px;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* ---------- 12. ФОРМЫ ---------- */
.field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.input,
.select,
textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}
.input:focus,
.select:focus,
textarea.input:focus { border-color: var(--gold); background: #121215; }
.select { appearance: none; cursor: pointer; }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.5; }

/* выбор одной опции «плиткой» */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  text-align: left;
}
.opt.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
}

/* ---------- 13. ТОСТ ---------- */
.sx-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-h) + 70px);
  transform: translate(-50%, 20px);
  z-index: 1000;
  max-width: 340px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(24, 24, 27, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  box-shadow: var(--shadow);
}
.sx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 14. ПРОГРЕСС-БАР ---------- */
.progress {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--grad-gold);
  transition: width 0.35s ease;
}

/* ---------- 15. УТИЛИТЫ ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }

/* ---------- 15.1. ЗОЛОТЫЕ ИКОНКИ ТИПОВ ---------- */
/* Иконки типов перекрашены в #d4af37 на уровне PNG (assets/icons/*-gold.png),
   поэтому CSS-перекраска не нужна — только мягкое свечение. */
.res-icon,
.result-type-icon,
.tt-icon,
.mtc-icon,
.sx-type-icon,
[data-type-icon],
.icon-gold {
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

/* ---------- 15.2. АКЦЕНТ НА ДЕНЬГАХ И ОТНОШЕНИЯХ ---------- */
.money { color: #ef4444; font-weight: 700; }
.rels  { color: #ef4444; font-weight: 700; }

/* фирменный золотой акцент в тексте */
.gold-accent {
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

.accent-banner {
  margin: 0 0 14px;
  padding: 13px 15px;
  border-radius: var(--radius-m);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.45);
  font-size: 13px;
  line-height: 1.6;
  color: #fecaca;
}
.accent-banner b { color: #fff; }

/* ---------- 16. ФОНОВОЕ ПРИЛОЖЕНИЕ НА ДЕСКТОПЕ ---------- */
@media (min-width: 640px) {
  body { background: radial-gradient(1200px 800px at 50% 0%, #0d0d10 0%, #050506 60%); }
}

/* ---------- 17. АНИМАЦИИ ---------- */
@keyframes sx-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: sx-fade-up 0.4s ease-out both; }
