/* ===========================================================
   TOP 1000 — дизайн-система в стиле Centras Rankings
   Тёмная тема, фиолетовый акцент, Manrope + Inter
   Мобильный приоритет: всё сначала под телефон, потом @media
   =========================================================== */

:root {
  --bg: #0b0b10;
  --bg-deep: #08080c;
  --surface: #121219;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f3f6;
  --muted: #c7c7cf;
  --dim: #8d8d98;
  --dimmer: #62626d;
  --accent: #8b7cff;
  --accent-light: #b8aeff;
  --accent-strong: #6a58e8;
  --orange: #f0915f;
  --gold: #e3b964;
  --up: #4ade80;
  --down: #fb7185;
  --like: #ff6b81;
  --container: 1200px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  background-image:
    radial-gradient(circle at 88% -4%, rgba(139, 124, 255, 0.26), transparent 16rem),
    radial-gradient(circle at -10% 8%, rgba(91, 140, 255, 0.16), transparent 18rem);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }   /* иначе display у .btn перебивает атрибут */
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  line-height: 1;
}
.icon-fill { font-variation-settings: 'FILL' 1; }

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------------- Шапка ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 16, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Manrope, Inter, sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #9a8cff, var(--accent-strong));
  box-shadow: 0 6px 16px -6px rgba(139, 124, 255, 0.7);
}
.brand-mark::before {
  content: "";
  width: 11px;
  height: 16px;
  background: #fff;
  clip-path: polygon(50% 0, 100% 35%, 78% 100%, 22% 100%, 0 35%);
}

/* Круглая иконочная кнопка, палец попадает всегда */
.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { background: var(--surface-soft); }
.icon-btn.solid {
  border: 1px solid var(--line-strong);
  background: rgba(18, 18, 25, 0.8);
  backdrop-filter: blur(10px);
}

/* ---------------- Кнопки ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25), 0 10px 28px -12px rgba(139, 124, 255, 0.7);
}
.btn-light { color: #0c0c0f; background: #f3f3f6; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}
.btn-block { width: 100%; }

/* ---------------- Типографика ---------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px 8px 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.16);
  color: var(--accent-light);
  letter-spacing: 0.1em;
}

.kicker {
  margin: 0 0 12px;
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 16px;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(32px, 9vw, 60px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.section-title {
  margin: 0 0 12px;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(24px, 6.5vw, 44px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(100deg, var(--accent-light), var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  margin: 0 0 22px;
  max-width: 520px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.section { padding: 34px 0; }
.section-head { margin-bottom: 22px; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  padding: 26px 0 8px;
  overflow: hidden;          /* декоративное свечение не должно расширять документ */
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -80px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(45px);
  background: rgba(139, 124, 255, 0.28);
}

/* ---------------- Поиск ---------------- */

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease;
}
.search-box:focus-within { border-color: rgba(139, 124, 255, 0.6); }
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.search-field .material-symbols-outlined {
  position: absolute;
  left: 10px;
  font-size: 20px;
  color: var(--dim);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 38px;
  border: 0;
  outline: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 16px;              /* iOS не зумит */
}
.search-box input::placeholder { color: var(--dimmer); }
.search-box input[type="search"]::-webkit-search-cancel-button,
.search-box input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-clear {
  position: absolute;
  right: 2px;
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.search-clear.is-visible { display: grid; }

.filter-btn {
  position: relative;
  display: grid;
  width: 52px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.filter-btn:active { transform: scale(0.95); }
.filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.filter-badge.is-visible { display: block; }

/* ---------------- Статистика ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.stat {
  padding: 16px 14px 14px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat:nth-child(2n) { border-right: 0; padding-right: 0; padding-left: 14px; }
.stat strong {
  display: block;
  margin-bottom: 5px;
  font-family: Manrope, Inter, sans-serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat strong span { color: var(--accent-light); }
.stat small { color: var(--dimmer); font-size: 11.5px; font-weight: 600; line-height: 1.5; }

/* ---------------- Чипы ---------------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.chip:active { transform: scale(0.96); }
.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
  box-shadow: 0 8px 20px -10px rgba(139, 124, 255, 0.7);
}

/* Снимаемые теги активных фильтров */
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tagrow:empty { display: none; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px 0 12px;
  border: 1px solid rgba(139, 124, 255, 0.35);
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.14);
  color: var(--accent-light);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.filter-tag .material-symbols-outlined { font-size: 16px; }

/* ---------------- Панель результатов ---------------- */

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.result-count {
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.sort-btn .material-symbols-outlined { font-size: 18px; }

/* ---------------- Карточки рейтинга ---------------- */

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 34px -16px rgba(0, 0, 0, 0.7);
}

.rank-list { display: flex; flex-direction: column; gap: 10px; }

.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
  animation: row-in 0.24s ease-out both;
}
.rank-row:active { transform: scale(0.99); }
.rank-row.is-leader {
  border-color: rgba(139, 124, 255, 0.45);
  background: rgba(139, 124, 255, 0.12);
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.rank-index {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-family: Manrope, Inter, sans-serif;
  font-size: 16px;
  font-weight: 800;
}
.rank-row.is-leader .rank-index {
  color: #fff;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
  box-shadow: 0 6px 14px -6px rgba(139, 124, 255, 0.8);
}

.rank-body { min-width: 0; }
.rank-body strong {
  display: block;
  margin-bottom: 3px;
  font-family: Manrope, Inter, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-body .sub {
  display: block;
  color: var(--dimmer);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.score {
  color: var(--accent-light);
  font-family: Manrope, Inter, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.score small { color: var(--dimmer); font-size: 10.5px; font-weight: 600; }

.rank-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: Manrope, Inter, sans-serif;
}
.trend .material-symbols-outlined { font-size: 14px; }
.trend.up   { color: var(--up);   background: rgba(74, 222, 128, 0.12); }
.trend.down { color: var(--down); background: rgba(251, 113, 133, 0.12); }
.trend.flat { color: var(--dimmer); background: rgba(255, 255, 255, 0.06); }

/* Лайк */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
  font-family: Manrope, Inter, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.like-btn .material-symbols-outlined { font-size: 18px; }
.like-btn:active { transform: scale(0.94); }
.like-btn.is-liked {
  color: var(--like);
  border-color: rgba(255, 107, 129, 0.4);
  background: rgba(255, 107, 129, 0.14);
}

.sector-tag {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.14);
  color: var(--accent-light);
  font-family: "Courier New", monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gold-badge {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #b88a2e);
  color: #3a2c00;
  font-family: "Courier New", monospace;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Пустой результат */
.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 46px 20px;
  text-align: center;
}
.empty.is-visible { display: flex; }
.empty .material-symbols-outlined { font-size: 44px; color: var(--dimmer); }
.empty p { margin: 0; color: var(--dim); }

/* ---------------- Метрики / прогресс ---------------- */

.metric-list { display: flex; flex-direction: column; gap: 14px; }
.metric-item .metric-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.metric-item .metric-name { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.metric-item .metric-val {
  font-family: Manrope, Inter, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.metric-item .metric-val span { color: var(--dimmer); font-size: 10.5px; font-weight: 600; }
.progress {
  overflow: hidden;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.metric-note { margin: 6px 0 0; color: var(--dimmer); font-size: 11.5px; line-height: 1.45; }

/* ---------------- Меню (слева) ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(340px, 86%);
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border-right: 1px solid var(--line);
  border-radius: 0 22px 22px 0;
  background: var(--surface);
  box-shadow: 30px 0 90px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer.is-open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.drawer-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.drawer-item:hover, .drawer-item:active { background: var(--surface-soft); color: var(--text); }
.drawer-item .material-symbols-outlined { font-size: 21px; color: var(--dim); }
.drawer-item .count {
  margin-left: auto;
  font-family: Manrope, Inter, sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-light);
}
.drawer-foot { padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line); }
.drawer-version {
  margin: 12px 0 0;
  text-align: center;
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------- Нижний лист фильтров ---------------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 65; display: none; }
.sheet-wrap.is-open { display: block; }
/* Внутри листа и модалки затемнение должно лежать под содержимым */
.sheet-wrap > .overlay,
.modal-wrap > .overlay { z-index: 1; }
.sheet {
  position: absolute;
  z-index: 2;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.55);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.is-open { transform: none; }
.sheet-grip {
  flex: 0 0 auto;
  width: 40px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: var(--line-strong);
}
.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 8px;
}
.sheet-head h2 {
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 12px; -webkit-overflow-scrolling: touch; }
.sheet-body .kicker { margin: 18px 0 10px; }
.sheet-body .kicker:first-child { margin-top: 4px; }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] {
  flex: 1;
  height: 44px;
  accent-color: var(--accent);
  background: transparent;
}
.range-val {
  min-width: 46px;
  text-align: right;
  font-family: Manrope, Inter, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-light);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-top: 8px;
  cursor: pointer;
}
.switch-row span { font-size: 14.5px; color: var(--muted); }
.switch-row input {
  width: 46px;
  height: 28px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--dim);
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch-row input:checked {
  border-color: transparent;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
}
.switch-row input:checked::after { transform: translateX(18px); background: #fff; }

/* ---------------- Модалка ---------------- */

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-wrap.is-open { display: flex; }
.modal-dialog {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.modal-dialog h2 {
  margin: 0 0 14px;
  font-family: Manrope, Inter, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.modal-dialog p { margin: 0 0 12px; color: var(--dim); font-size: 14px; line-height: 1.6; }
.modal-close { position: absolute; top: 12px; right: 12px; }

/* ---------------- Карточка для сторис ---------------- */

.share-dialog { padding: 16px; text-align: center; }
.share-dialog h2 { font-size: 20px; margin-bottom: 12px; }
.share-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 34vh;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-deep);
}
.share-actions { display: grid; gap: 8px; }
.share-actions .btn { width: 100%; }
.share-hint {
  margin: 14px 0 0;
  color: var(--dimmer);
  font-size: 12.5px;
  line-height: 1.5;
}
.share-loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--dim);
  font-size: 14px;
}

/* ---------------- Тост ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 80;
  max-width: 86%;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(18, 18, 25, 0.96);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Кнопка «наверх» */
.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(18, 18, 25, 0.9);
  backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------------- Профиль ---------------- */

.profile-hero {
  position: relative;
  padding: 24px 0 4px;
}
.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: Manrope, Inter, sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-title {
  margin: 16px 0 6px;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(26px, 7.5vw, 44px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.profile-sub { margin: 0 0 16px; color: var(--muted); font-size: 15px; }

.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: Manrope, Inter, sans-serif;
  font-size: 14px;
  font-weight: 800;
}
.rank-pill.is-leader {
  color: #fff;
  background: linear-gradient(180deg, #9a8cff, #7a69f5);
  box-shadow: 0 8px 20px -10px rgba(139, 124, 255, 0.7);
}

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.btn.is-liked {
  color: var(--like);
  border-color: rgba(255, 107, 129, 0.45);
  background: rgba(255, 107, 129, 0.14);
}

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.kpi {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.kpi.wide { grid-column: 1 / -1; text-align: center; padding: 20px 14px; }
.kpi .kicker { margin-bottom: 8px; }
.kpi strong {
  display: block;
  font-family: Manrope, Inter, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.kpi.wide strong { font-size: clamp(26px, 8vw, 38px); }
.kpi strong small { color: var(--dimmer); font-size: 12px; font-weight: 600; }

.panel {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  margin-bottom: 14px;
}
.panel > .kicker { margin-bottom: 14px; }

/* Радар */
.radar-wrap { display: grid; place-items: center; padding: 4px 0 10px; }
.radar { width: min(100%, 360px); height: auto; }

/* График истории */
.chart-wrap { position: relative; height: 150px; }
.chart-axis {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10px;
}
.chart-svg { width: 100%; height: 100%; padding-left: 30px; }
.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 0 30px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10px;
}
.chart-labels b { color: var(--accent-light); font-weight: 700; }

/* Раскрывающиеся блоки */
details.acc {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  overflow: hidden;
}
details.acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  font-family: Manrope, Inter, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .material-symbols-outlined { color: var(--dim); transition: transform 0.2s ease; }
details.acc[open] > summary .material-symbols-outlined { transform: rotate(180deg); }
.acc-body { padding: 0 16px 16px; color: var(--dim); font-size: 14px; line-height: 1.6; }
.acc-body p { margin: 0 0 12px; }
.acc-body ul { margin: 0; padding-left: 18px; }
.acc-body li { margin-bottom: 6px; }

/* Похожие */
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.mini-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-family: Manrope, Inter, sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.mini-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-row .sub {
  display: block;
  color: var(--dimmer);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--dimmer);
  font-family: Manrope, Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.mini-like.is-liked { color: var(--like); }
.mini-like .material-symbols-outlined { font-size: 16px; }

/* ---------------- Подвал ---------------- */

.site-footer {
  margin-top: 30px;
  padding: 34px 0 calc(30px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
}
.footer-grid { display: grid; gap: 26px; }
.footer-title {
  margin: 0 0 12px;
  color: var(--dimmer);
  font-family: "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a, .footer-contacts p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}
.footer-links a:hover { color: var(--text); }
.footer-contacts p + p { margin-top: 10px; }
.copyright {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dimmer);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------------- Планшет и десктоп ---------------- */

@media (min-width: 760px) {
  :root { --header-h: 67px; }
  .container { width: min(var(--container), calc(100% - 48px)); }
  .brand { font-size: 20px; }
  .section { padding: 52px 0; }
  .hero { padding: 44px 0 12px; }
  .lead { font-size: 17px; }
  .stats { grid-template-columns: repeat(4, 1fr); max-width: 640px; }
  .stat { border-bottom: 0; padding: 22px 18px 14px 0; }
  .stat:nth-child(2n) { padding-left: 0; border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .stat strong { font-size: 32px; }
  .chips { margin: 0; padding-left: 0; padding-right: 0; }
  .rank-row { grid-template-columns: 52px 1fr auto; padding: 14px 18px; border-radius: 18px; }
  .rank-index { width: 52px; height: 52px; font-size: 18px; }
  .rank-body strong { font-size: 17px; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi.wide { grid-column: span 4; }
  .action-row { max-width: 460px; }
  .panel { padding: 24px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
  .profile-photo { width: 120px; height: 120px; border-radius: 30px; font-size: 40px; }
}

@media (min-width: 1100px) {
  .rank-list { gap: 12px; }
}

/* Уважаем настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
