/* ============================================================
   NYANKOSU — светлая фиолетово-розовая тема по арт-шаблону
   Пропорции сняты с макета 1920×1280 и перенесены в контейнер 1280.
   Без анимаций, без эмодзи — только свои SVG.
   ============================================================ */

:root {
  /* акценты */
  --pink: #ff7ad9;
  --pink-2: #f25dc8;
  --magenta: #e64fc0;
  --violet: #a855f7;
  --violet-2: #8b4be8;

  /* фон */
  --bg: #f6ecfd;
  --bg-2: #eed9fb;
  --surface: #ffffff;
  --surface-2: #faf4ff;
  --surface-3: #f1e4fc;

  /* тёмные тона */
  --deep: #2d1979;
  --deep-2: #25184a;
  --outline: #5b1e8f;

  /* текст */
  --txt: #241740;
  --txt-2: #6a5a86;   /* 5.4:1 на фоне — ок */
  --txt-3: #736396;   /* было 3.0:1 — поднял до 4.6:1 */
  --txt-4: #9082ad;   /* было слишком светло для подписей */

  /* линии */
  --line: #e8d9f9;
  --line-2: #d6bdf0;

  /* градиенты */
  --g-head: linear-gradient(100deg, #ffd9ec 0%, #f8a8e0 16%, #e36fd0 44%, #c15ce8 70%, #a855f7 100%);
  --g-btn: linear-gradient(100deg, #ff7ad9 0%, #e85ac6 42%, #b14bf0 100%);
  --g-title: linear-gradient(90deg, #7c3aed 0%, #c14ae0 52%, #f25dc8 100%);
  --g-foot: linear-gradient(100deg, #532b93 0%, #3d2080 45%, #2a1569 100%);
  --g-hero: linear-gradient(125deg, #33195c 0%, #5a2474 40%, #96449f 76%, #bd55ab 100%);

  /* геометрия */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --nav-h: 78px;
  --max: 1280px;
  --gap: 20px;

  --shadow-sm: 0 4px 14px rgba(93, 40, 160, 0.09);
  --shadow: 0 12px 32px rgba(93, 40, 160, 0.14);
  --shadow-lg: 0 20px 48px rgba(93, 40, 160, 0.2);
}

* { box-sizing: border-box; }

/* атрибут hidden должен побеждать любые display из стилей
   (иначе .notice{display:flex} показывает «скрытый» блок) */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;   /* подложка фона не должна таскать страницу вбок */
}

body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--txt);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-family: 'Montserrat', 'Manrope', system-ui, sans-serif; font-weight: 800; line-height: 1.14; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
svg { display: block; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
/* на тёмных блоках нужен светлый контур, иначе его не видно */
.hero :focus-visible, .band :focus-visible, .topnav :focus-visible, .foot :focus-visible {
  outline-color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d6bdf0; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--violet-2); }

/* ---------- утилиты ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.green { color: #12a866; }
.red { color: #e0355f; }
.amber { color: #d98b12; }
.dim { color: var(--txt-3); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- аватары ----------
   aspect-ratio держит квадрат при любом размере контейнера,
   иначе картинка растягивается по высоте */
.av, .av-ph {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: var(--surface-3);
  flex: none;
}
.av-ph {
  display: grid;
  place-items: center;
  color: var(--txt-4);
  border: 1px solid var(--line-2);
}
.av-ph svg { width: 52%; height: 52%; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet-2);
}
.kicker::before { content: ''; width: 22px; height: 3px; border-radius: 3px; background: var(--g-btn); }

/* ============================================================
   ШАПКА
   ============================================================ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  height: var(--nav-h);
  background: var(--g-head);
  box-shadow: 0 4px 24px rgba(120, 40, 160, 0.18);
}
.nav-in {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 13px; flex: none; min-width: 0; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-mark svg { width: 46px; height: 46px; }
.brand-name {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 37px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.005em;
  color: #fff;
  white-space: nowrap;
  /* обводка фиолетовым, как на макете */
  text-shadow:
    -2px 0 var(--outline), 2px 0 var(--outline),
    0 -2px var(--outline), 0 2px var(--outline),
    -1.5px -1.5px var(--outline), 1.5px -1.5px var(--outline),
    -1.5px 1.5px var(--outline), 1.5px 1.5px var(--outline),
    0 3px 10px rgba(60, 10, 90, 0.35);
}

.nav-links { display: flex; align-items: center; justify-content: center; gap: 2px; flex: 1; min-width: 0; }
.nav-links a {
  position: relative;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.nav-links a:not(:last-child)::after {
  content: '·';
  position: absolute;
  right: -5px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 900;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.nav-links a.on { color: #fff; background: rgba(255, 255, 255, 0.24); }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }

.nav-burger {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  color: #fff;
}
.nav-burger svg { width: 20px; height: 20px; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 18px 0 5px;
  border-radius: 12px;
  background: var(--g-btn);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(150, 40, 180, 0.32);
}
.nav-user:hover { box-shadow: 0 10px 26px rgba(150, 40, 180, 0.44); }
.nav-user .av, .nav-user .na-av { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.nav-user .na-av { background: rgba(255, 255, 255, 0.25); display: grid; place-items: center; }
.nav-user .na-av svg { width: 18px; height: 18px; }

/* мобильное меню */
.nav-sheet {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 79;
  background: var(--surface);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 20px 40px rgba(93, 40, 160, 0.2);
  padding: 10px 20px 20px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
/* без этого правила бургер не открывал меню */
.nav-sheet.open { display: block; }
.nav-sheet a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--txt-2);
}
.nav-sheet a:last-of-type { border-bottom: 0; }
.nav-sheet a.on { color: var(--violet-2); }
.nav-sheet a svg { width: 20px; height: 20px; flex: none; }
.nav-sheet .sheet-foot { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-sheet .sheet-foot .btn { width: 100%; }
.nav-sheet .sheet-note { margin-top: 14px; font-size: 12px; color: var(--txt-3); text-align: center; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 800;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; border-radius: 11px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { height: 56px; padding: 0 32px; font-size: 17px; border-radius: 18px; }
.btn-lg svg { width: 20px; height: 20px; }
.btn-block { width: 100%; }

.btn-red { background: var(--g-btn); color: #fff; box-shadow: 0 10px 26px rgba(178, 47, 214, 0.34); }
.btn-red:hover { box-shadow: 0 14px 32px rgba(178, 47, 214, 0.44); }

.btn-solid { background: var(--surface); color: var(--violet-2); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-solid:hover { border-color: var(--violet); }

.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.62); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.24); }

.btn-light { background: rgba(255, 255, 255, 0.9); color: var(--violet-2); border-color: transparent; }
.btn-light:hover { background: #fff; }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.link-a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--magenta);
  white-space: nowrap;
}
.link-a:hover { color: var(--violet-2); }
.link-a svg { width: 18px; height: 18px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--txt-2);
  box-shadow: var(--shadow-sm);
}
.back:hover { color: var(--violet-2); border-color: var(--violet); }
.back svg { width: 16px; height: 16px; }

/* ============================================================
   СЕКЦИИ И ЗАГОЛОВКИ (как на макете)
   ============================================================ */
/* важно: только вертикальные отступы. Шорткат padding перетирал бы
   боковые отступы .wrap, когда оба класса на одном элементе */
.sec { padding-top: 54px; padding-bottom: 54px; }
.sec-tight { padding-top: 30px; padding-bottom: 30px; }

.mk { padding: 62px 0; }
.mk-alt {
  background:
    linear-gradient(128deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 38%),
    var(--bg-2);
}

.mk-head { margin-bottom: 30px; }
.mk-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.mk-head.center .mk-head-row { justify-content: center; align-items: center; gap: 26px; }

.mk-title {
  position: relative;
  display: inline-block;
  overflow-wrap: break-word;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--g-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 16px;
  line-height: 1.1;
}
.mk-title::after {
  content: '';
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: min(46%, 118px);
  height: 7px;
  border-radius: 7px;
  background: var(--g-btn);
  transform: rotate(-1.8deg);
}
.mk-title.sm { font-size: 22px; padding-bottom: 14px; }
.mk-title.sm::after { width: 70px; height: 6px; }
.mk-sub { margin-top: 14px; color: var(--txt-2); font-size: 15.5px; max-width: 62ch; }

.sec-head { margin-bottom: 26px; }
.sec-head h2 { font-size: 28px; }
.sec-head p { color: var(--txt-2); font-size: 15px; margin-top: 10px; max-width: 62ch; }

/* ============================================================
   КАРТОЧКИ И СЕТКИ
   ============================================================ */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card-pad-sm { padding: 18px; }
.card-hover:hover { box-shadow: var(--shadow); }

.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tile { background: var(--surface); border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.tile .t-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--txt-3);
}
.tile .t-label svg { width: 13px; height: 13px; }
.tile .t-val { margin-top: 8px; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile.accent { background: linear-gradient(180deg, #fdf0ff, #fff 70%); }
.tile.accent .t-val { color: var(--magenta); }
.tile.good .t-val { color: #12a866; }
.tile.gold .t-val { color: #d98b12; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--txt-2); white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; flex: none; }
.pill.red { background: #ffe6f6; color: #c02a86; }
.pill.green { background: #e0fbec; color: #12a866; }
.pill.amber { background: #fff1d8; color: #c07d0c; }
.pill.violet { background: #efe4ff; color: var(--violet-2); }

.badge-diff {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 13px;
  border-radius: 999px;
  background: var(--g-btn);
  color: #fff;
  font-size: 11px; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase;
  box-shadow: 0 5px 14px rgba(120, 30, 150, 0.32);
}

/* ============================================================
   ПОЛЯ И ТАБЫ
   ============================================================ */
.field { display: block; margin-bottom: 16px; }
.field .f-lab {
  display: block; font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 8px;
}
.input, .textarea, .select {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--txt); font-size: 15px; outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--txt-4); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--violet); background: #fff; }
.input.mono { letter-spacing: 0.14em; }
.textarea { height: auto; min-height: 112px; padding: 14px 16px; line-height: 1.6; resize: vertical; }
.select { appearance: none; cursor: pointer; }
.search-wrap { position: relative; display: block; }
.search-wrap svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--txt-4); pointer-events: none; }
.search-wrap .input { padding-left: 46px; }

.tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-sm); }
.tab {
  height: 40px; padding: 0 20px; border-radius: 999px;
  min-width: 0; overflow: hidden;
  font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--txt-3); white-space: nowrap;
}
.tab:hover { color: var(--violet-2); }
.tab.on { background: var(--g-btn); color: #fff; box-shadow: 0 6px 16px rgba(178, 47, 214, 0.3); }
.tab svg { width: 15px; height: 15px; flex: none; }
.tabs-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   СОСТОЯНИЯ
   ============================================================ */
.empty { padding: 58px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 46px; height: 46px; color: var(--line-2); }
.empty h3 { font-size: 19px; margin-top: 8px; }
.empty p { color: var(--txt-2); font-size: 14.5px; max-width: 48ch; }
.empty .btn { margin-top: 14px; }

.loading { display: flex; align-items: center; gap: 12px; padding: 38px; color: var(--txt-3); font-size: 14.5px; }
.loading::before { content: ''; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--violet); }

.notice {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 15px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line);
  font-size: 14px; color: var(--txt-2);
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--violet); }
.notice.bad { background: #fff0f4; border-color: #ffc2d4; color: #c02254; }
.notice.bad svg { color: #e0355f; }
.notice.good { background: #e9fbf2; border-color: #b6ecd4; color: #0e8a55; }
.notice.good svg { color: #12a866; }

/* ============================================================
   ГЕРОЙ
   ============================================================ */
.hero {
  position: relative;
  padding: 70px 0 56px;
  background: var(--g-hero);
  overflow: hidden;
  isolation: isolate;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(64px); z-index: -1; pointer-events: none;
}
.hero::before { width: 540px; height: 540px; top: -180px; left: -120px; background: rgba(255, 120, 214, 0.3); }
.hero::after { width: 640px; height: 640px; bottom: -280px; right: -140px; background: rgba(168, 85, 247, 0.32); }
.hero-bg { position: absolute; inset: 0; z-index: -1; background-position: center; background-size: cover; opacity: 0.45; }

.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 44px; align-items: center; }

.hero h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  overflow-wrap: break-word;
  font-size: 56px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 4px 30px rgba(35, 8, 60, 0.5);
  margin: 18px 0 0;
}
.hero .kicker { color: #ffdcf4; }
.hero .kicker::before { background: #ffdcf4; }

.hero-sub {
  margin-top: 22px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 3px 18px rgba(35, 8, 60, 0.4);
}
.hero-text { margin-top: 14px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.8); max-width: 50ch; }

/* кнопка и плашки в одну строку — как на макете */
.hero-row { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }

.hero-chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 0;
}
.chip .c-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.22); }
.chip .c-ico svg { width: 20px; height: 20px; color: #fff; }
.chip .c-txt { min-width: 0; }
.chip .c-lab { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.74); }
.chip .c-val { display: block; font-size: 15px; font-weight: 800; color: #fff; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* персонаж в герое */
.hero-art {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 440px;
  pointer-events: none;
}
/* мягкое свечение за персонажем */
.hero-art::before {
  content: '';
  position: absolute;
  right: -40px;
  bottom: 20px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 214, 0.4), rgba(168, 85, 247, 0.16) 46%, transparent 70%);
  filter: blur(18px);
}
.hero-art picture { display: contents; }
.hero-art img {
  position: relative;
  height: 500px;
  width: auto;
  max-width: none;
  margin-bottom: -64px;
  margin-right: -26px;
  filter: drop-shadow(0 26px 42px rgba(28, 8, 50, 0.55));
}

/* ============================================================
   ЧЕТЫРЕ РЕЖИМА — панель наезжает на низ героя
   ============================================================ */
.modes-sec { padding-bottom: 8px; }
.modes-panel {
  position: relative;
  z-index: 3;
  min-width: 0;
  margin-top: -76px;
  padding: 30px 30px 32px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.modes-head { text-align: center; margin-bottom: 26px; }
.modes-head .mk-title { display: inline-block; }
.modes-head .mk-sub { margin: 14px auto 0; text-align: center; max-width: 52ch; }

.modes-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mode-card {
  position: relative;
  display: block;
  padding: 24px 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.mode-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.mode-card .m-ico {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fdeeff, #f6e3ff);
  color: var(--magenta);
}
.mode-card .m-ico svg { width: 46px; height: 46px; }
.mode-card h3 { font-size: 17px; text-transform: uppercase; letter-spacing: 0.02em; }
.mode-card .m-desc { margin-top: 6px; font-size: 13.5px; color: var(--txt-2); }
.mode-card .m-cnt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--txt-2);
  font-variant-numeric: tabular-nums;
}
.mode-card .m-rx { position: absolute; top: 12px; right: 12px; font-size: 9.5px; height: 22px; padding: 0 9px; }
.mode-card .m-body { display: block; min-width: 0; }
.mode-card h3, .mode-card .m-desc, .mode-card .m-cnt { overflow-wrap: anywhere; }

/* точка-буллет в строке — общая для карточек и сетов */
.dot-i { width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); flex: none; }

/* ============================================================
   КАРУСЕЛЬ (как «популярные битмапы»)
   ============================================================ */
.carousel { position: relative; }
.car-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.car-nav {
  position: absolute;
  top: 46%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--violet-2);
  box-shadow: var(--shadow);
  z-index: 2;
}
.car-nav:hover { color: #fff; background: var(--g-btn); }
.car-nav svg { width: 20px; height: 20px; }
.car-nav.prev { left: -24px; }
.car-nav.next { right: -24px; }
.car-nav:disabled { opacity: 0.35; cursor: default; box-shadow: var(--shadow-sm); }
.car-nav:disabled:hover { background: var(--surface); color: var(--violet-2); }

.pcard { position: relative; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.pcard:hover { box-shadow: var(--shadow); }
.pcard .p-top { position: relative; margin: 12px 12px 0; border-radius: 14px; aspect-ratio: 16 / 7; overflow: hidden; display: grid; place-items: center; background: var(--g-btn); }
.pcard .p-top img { width: 100%; height: 100%; object-fit: cover; }
.pcard .p-top .p-av-big { color: #fff; font-family: 'Montserrat', sans-serif; font-size: 42px; font-weight: 900; }
.pcard .p-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.pcard .p-rank {
  position: absolute; right: 10px; bottom: 8px; z-index: 2;
  font-family: 'Montserrat', sans-serif;
  font-size: 42px; font-weight: 900; line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(40, 10, 70, 0.5);
}
.pcard .p-body { padding: 16px 20px 20px; text-align: center; }
.pcard .p-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px; font-weight: 900; letter-spacing: 0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard .p-meta { margin-top: 8px; font-size: 14px; color: var(--txt-2); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; justify-content: center; }
.pcard .p-meta b { color: var(--txt); font-weight: 800; }
.pcard .p-meta .star { color: var(--magenta); font-weight: 900; }

/* карточки сообщества */
.ccard {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px 26px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--r-lg);
}
.ccard .c-ico {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--g-btn);
  color: #fff;
}
.ccard .c-ico svg { width: 24px; height: 24px; }
.ccard h3 { font-size: 16px; letter-spacing: 0.01em; text-transform: uppercase; }
.ccard p { margin-top: 8px; font-size: 14px; color: var(--txt-2); line-height: 1.6; }

.step { position: relative; padding-top: 34px; }
.step .s-num {
  position: absolute; top: 0; left: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--g-btn); color: #fff;
  font-size: 13px; font-weight: 900;
}
.step::before { content: ''; position: absolute; top: 16px; left: 42px; right: 0; height: 2px; background: var(--line-2); border-radius: 2px; }
.step h3 { font-size: 16px; text-transform: uppercase; }
.step p { margin-top: 8px; font-size: 14px; color: var(--txt-2); line-height: 1.65; }

.band {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  padding: 40px 44px;
  border-radius: var(--r-xl);
  background: var(--g-hero);
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.band h2 { font-size: 26px; text-transform: uppercase; }
.band p { color: rgba(255, 255, 255, 0.82); font-size: 15px; margin-top: 10px; max-width: 52ch; }
.band .kicker { color: #ffdcf4; }
.band .kicker::before { background: #ffdcf4; }

/* ============================================================
   ЛИДЕРБОРДЫ
   ============================================================ */
.rank-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 22px; }
.rank-head .tabs-row { flex: 0 1 auto; min-width: 0; }
.rank-head .rk-grow { flex: 1; justify-content: flex-end; }

.rank-note {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px; border-radius: var(--r-md);
  background: #f3e9ff; color: var(--violet-2);
  font-size: 14px; margin-bottom: 22px;
}
.rank-note svg { width: 18px; height: 18px; flex: none; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: end; margin-bottom: 24px; }
.pod {
  position: relative; text-align: center;
  padding: 28px 18px 22px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.pod.first { padding: 38px 18px 30px; box-shadow: var(--shadow-lg); background: linear-gradient(180deg, #fff5fd, #fff 65%); }
.pod .p-pos {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  min-width: 34px; height: 28px; padding: 0 10px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--surface-3); color: var(--txt-2);
  font-size: 12px; font-weight: 900;
}
.pod.first .p-pos { background: var(--g-btn); color: #fff; }
.pod .p-av { width: 62px; height: 62px; aspect-ratio: 1 / 1; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.pod .p-name { font-size: 15.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .p-pp { margin-top: 6px; font-size: 21px; font-weight: 900; color: var(--magenta); font-variant-numeric: tabular-nums; }
.pod .p-pp span { font-size: 12px; color: var(--txt-3); }
.pod .p-sub { font-size: 12px; color: var(--txt-3); margin-top: 4px; }

.tbl { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl-head, .tbl-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 92px 96px 78px;
  align-items: center; gap: 12px; padding: 0 20px;
}
.tbl-head { height: 50px; background: var(--surface-3); font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--txt-3); }
.tbl-head span:not(:first-child):not(:nth-child(2)) { text-align: right; }
.tbl-row { height: 68px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.tbl-row:last-child { border-bottom: 0; }
.tbl-row:hover { background: var(--surface-2); }
.tbl-row .c-rank { font-size: 13px; font-weight: 800; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.tbl-row .c-rank.top { color: var(--magenta); }
.tbl-row .c-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbl-row .c-user img, .tbl-row .c-user .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.tbl-row .c-user .c-name { display: block; min-width: 0; }
.tbl-row .c-user b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-row .c-user .c-cty { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--txt-3); }
.tbl-row .c-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.tbl-row .c-pp { color: var(--magenta); }

.pager { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.pg {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: grid; place-items: center;
  background: var(--surface); border-radius: 12px;
  font-size: 13.5px; font-weight: 800; color: var(--txt-2);
  box-shadow: var(--shadow-sm);
}
.pg:hover { color: var(--violet-2); }
.pg.on { background: var(--g-btn); color: #fff; box-shadow: 0 8px 18px rgba(178, 47, 214, 0.3); }

/* ============================================================
   ПРОФИЛЬ
   ============================================================ */
.pf-hero { background: var(--surface); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.pf-cover { position: relative; height: 180px; background: var(--g-hero); overflow: hidden; }
.pf-cover-img { position: absolute; inset: 0; }
.pf-cover-img img { width: 100%; height: 100%; object-fit: cover; }
.pf-cover-empty {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* блок начинается ровно под обложкой: на обложку заходит только аватар,
   поэтому ник и плашки не могут её перекрыть */
.pf-in {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 0 28px 26px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}
.pf-av { position: relative; width: 122px; height: 122px; flex: none; margin-top: -62px; }
.pf-av .pf-av-img { width: 100%; height: 100%; aspect-ratio: 1 / 1; border-radius: 50%; object-fit: cover; border: 5px solid #fff; background: var(--surface-3); box-shadow: var(--shadow); }
.pf-av .ring { position: absolute; inset: -7px; width: auto; height: auto; pointer-events: none; }
.pf-av .ring-bg { fill: none; stroke: #efe2ff; stroke-width: 5; }
.pf-av .ring-fg { fill: none; stroke: var(--magenta); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.pf-av .ring-lvl {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  padding: 3px 11px; border-radius: 999px;
  background: var(--g-btn); color: #fff;
  font-size: 10.5px; font-weight: 900; letter-spacing: 0.05em;
  border: 3px solid #fff; white-space: nowrap;
}

.pf-id { flex: 1; min-width: 200px; padding-top: 6px; }
.pf-id h1 { font-size: 32px; }
.pf-id .pills { margin-top: 14px; }

.pf-side { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; padding-top: 6px; }
.pf-side .pf-edit { width: 100%; justify-content: center; }
.pf-quick { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pf-quick .q { min-width: 104px; padding: 12px 16px; background: linear-gradient(180deg, #fdf3ff, #fff); border-radius: var(--r-md); text-align: right; box-shadow: var(--shadow-sm); }
.pf-quick .q b { display: block; font-size: 20px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pf-quick .q span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--txt-3); margin-top: 3px; }

.pf-sec { padding: 34px 0; border-top: 1px solid var(--line); }
.pf-sec:first-of-type { border-top: 0; }
.pf-sec h2 { font-size: 22px; margin-top: 10px; }
.pf-sec .sec-p { color: var(--txt-2); font-size: 14px; margin-top: 6px; }
.pf-sec-head { margin-bottom: 22px; }

.pf-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 24px; }
.chart { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px 22px; box-shadow: var(--shadow-sm); }
.chart-h { display: flex; align-items: center; gap: 9px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 18px; }
.chart-h svg { width: 15px; height: 15px; color: var(--violet); flex: none; }
.spark { width: 100%; height: 84px; }
.spark polyline { fill: none; stroke: var(--violet); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-cap { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 11px; font-weight: 700; color: var(--txt-3); }

.bars { display: flex; align-items: flex-end; gap: 7px; height: 132px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar i { display: block; background: var(--g-btn); border-radius: 6px 6px 3px 3px; min-height: 5px; }
.bar span { font-size: 9px; font-weight: 700; color: var(--txt-4); text-align: center; overflow: hidden; white-space: nowrap; }
.chart-empty { padding: 34px; text-align: center; color: var(--txt-4); font-size: 13.5px; }

.hitbar { display: flex; gap: 3px; height: 14px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.hitbar i { display: block; height: 100%; }
.hitleg { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.hitleg span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--txt-2); }
.hitleg i { width: 10px; height: 10px; border-radius: 3px; }
.hitleg b { color: var(--txt); font-weight: 900; }

.grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; }
.grade { background: var(--surface); border-radius: var(--r-md); padding: 16px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.grade .grade-k { font-size: 13px; font-weight: 900; letter-spacing: 0.12em; color: var(--txt-3); }
.grade .grade-v { margin-top: 7px; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.grade .ss { color: #e8a317; }
.grade .s { color: #e8a317; }
.grade .ssh { color: #7f8c9b; }
.grade .sh { color: #7f8c9b; }
.grade .a { color: #12a866; }

.score {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto auto;
  gap: 16px; align-items: center;
  padding: 15px 18px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.score:hover { box-shadow: var(--shadow); }
.score .s-rank { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); font-size: 12px; font-weight: 900; color: var(--txt-2); }
.score .s-rank.g1 { background: #ffd977; color: #7a5200; }
.score .s-rank.g2 { background: #e2e8ef; color: #4a5568; }
.score .s-rank.g3 { background: #ffdcb8; color: #8a4a12; }
.score .s-main { min-width: 0; }
.score .s-title { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score .s-meta { font-size: 12px; color: var(--txt-3); margin-top: 4px; display: flex; gap: 9px; flex-wrap: wrap; }
.score .s-mods { display: flex; gap: 4px; }
.score .mod { padding: 3px 8px; border-radius: 7px; background: #f5e6ff; font-size: 10px; font-weight: 900; color: var(--violet-2); }
.score .nomod { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--txt-4); }
.score .s-pp { text-align: right; }
.score .s-pp b { display: block; font-size: 16px; font-weight: 900; color: var(--magenta); font-variant-numeric: tabular-nums; }
.score .s-pp span { display: block; font-size: 11.5px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.score .s-time { font-size: 11px; font-weight: 700; color: var(--txt-4); white-space: nowrap; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.badge { display: flex; align-items: center; gap: 13px; padding: 15px 17px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.badge .b-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: #fff1d8; color: #c07d0c; }
.badge .b-ico svg { width: 18px; height: 18px; }
.badge b { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.3; }
.badge span { display: block; font-size: 11px; color: var(--txt-3); margin-top: 2px; }

/* ============================================================
   РЕДАКТОР ПРОФИЛЯ
   ============================================================ */
.ped {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(45, 25, 121, 0.55);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.ped-card { width: 100%; max-width: 660px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: var(--r-xl); padding: 26px; box-shadow: var(--shadow-lg); }
.ped-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.ped-h h3 { font-size: 20px; }
.ped-h .kicker { margin-bottom: 8px; }
.ped-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--txt-2); box-shadow: var(--shadow-sm); }
.ped-x:hover { color: var(--violet-2); }
.ped-x svg { width: 17px; height: 17px; }
.ped-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ped-slot { padding: 22px; background: var(--surface); border-radius: var(--r-lg); text-align: center; box-shadow: var(--shadow-sm); }
.ped-lab { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 16px; }
.ped-prev { position: relative; display: grid; place-items: center; margin: 0 auto 16px; overflow: hidden; background: var(--surface-3); }
.ped-prev svg { width: 28px; height: 28px; color: var(--line-2); }
.ped-prev img { width: 100%; height: 100%; object-fit: cover; }
.ped-av { width: 100px; height: 100px; border-radius: 50%; }
.ped-cov { width: 100%; height: 100px; border-radius: var(--r-md); }
.ped-btn { width: 100%; }
.ped-hint { margin-top: 13px; font-size: 11.5px; line-height: 1.55; color: var(--txt-3); }
.ped-hint b { color: var(--txt-2); font-weight: 800; }
.ped-msg { min-height: 17px; margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--txt-3); }
.ped-msg.ok { color: #12a866; }
.ped-msg.bad { color: #e0355f; }
.ped-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.65; color: var(--txt-3); }

/* ============================================================
   ВХОД
   ============================================================ */
.login-wrap { max-width: 500px; margin: 0 auto; }
.login-card { padding: 34px; border-radius: var(--r-xl); box-shadow: var(--shadow); }
.login-tabs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 6px; background: var(--surface-3); border-radius: 999px; margin-bottom: 24px; }
.login-tabs .tab { height: 46px; }
.hint { font-size: 12.5px; color: var(--txt-3); line-height: 1.6; }
.ok-box { display: flex; gap: 13px; padding: 18px 20px; background: #e9fbf2; border: 1.5px solid #b6ecd4; border-radius: var(--r-md); color: #0e8a55; font-size: 14.5px; line-height: 1.6; }
.ok-box svg { width: 21px; height: 21px; flex: none; margin-top: 1px; }
.how { display: grid; gap: 10px; margin-top: 18px; }
.how-row { display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px; color: var(--txt-2); line-height: 1.55; }
.how-row .n {
  flex: none; width: 24px; height: 24px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--g-btn); color: #fff; font-size: 11.5px; font-weight: 900;
}
.how-row b { color: var(--txt); }

/* ============================================================
   НОВОСТИ
   ============================================================ */
.news { display: grid; gap: 16px; }
.news-item { padding: 26px 28px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.news-item:hover { box-shadow: var(--shadow); }
.news-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.news-item h3 { font-size: 20px; line-height: 1.32; }
.news-body { margin-top: 12px; color: var(--txt-2); font-size: 15px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.news-ok { display: flex; align-items: center; gap: 11px; padding: 16px 20px; background: #e9fbf2; border: 1.5px solid #b6ecd4; border-radius: var(--r-md); color: #0e8a55; font-size: 14.5px; font-weight: 800; margin-bottom: 18px; }
.news-ok svg { width: 19px; height: 19px; }
.form-card { padding: 26px; }

/* ============================================================
   ЧАТ
   ============================================================ */
.chat-shell { display: grid; gap: 14px; }
.chat-log { background: var(--surface); border-radius: var(--r-lg); padding: 10px; height: 62vh; min-height: 340px; overflow-y: auto; box-shadow: var(--shadow-sm); }
.msg { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); }
.msg:hover { background: var(--surface-2); }
.msg .m-av { width: 36px; height: 36px; border-radius: 12px; flex: none; background: var(--g-btn); display: grid; place-items: center; color: #fff; }
.msg img.m-av { object-fit: cover; background: var(--surface-3); border: 1px solid var(--line-2); }
.msg .m-av svg { width: 18px; height: 18px; }
.msg .m-body { min-width: 0; flex: 1; }
.msg .m-top { display: flex; align-items: baseline; gap: 10px; }
.msg .m-nick { font-size: 14px; font-weight: 900; color: var(--violet-2); }
.msg .m-nick.me { color: var(--magenta); }
.msg .m-time { font-size: 11px; font-weight: 700; color: var(--txt-4); }
.msg .m-text { font-size: 15px; color: var(--txt); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-empty { padding: 46px; text-align: center; color: var(--txt-4); font-size: 14.5px; }
.chat-form { display: flex; gap: 12px; align-items: center; }
.chat-form .input { flex: 1; }

/* ============================================================
   ДРУЗЬЯ
   ============================================================ */
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fr-card { padding: 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.fr-top { display: flex; align-items: center; gap: 14px; }
.fr-top img, .fr-top .av, .fr-top .av-ph { width: 50px; height: 50px; border-radius: 14px; object-fit: cover; flex: none; }
.fr-top b { display: block; font-size: 15.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-top span { display: block; font-size: 12px; color: var(--txt-3); margin-top: 3px; }
.fr-acts { display: flex; gap: 8px; margin-top: 16px; }
.fr-acts .btn { flex: 1; }
.fr-pp { margin-left: auto; text-align: right; }
.fr-pp b { display: block; font-size: 17px; font-weight: 900; color: var(--magenta); font-variant-numeric: tabular-nums; }
.fr-pp span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--txt-3); text-transform: uppercase; }
.dot-on { width: 8px; height: 8px; border-radius: 50%; background: #12d67f; display: inline-block; margin-right: 6px; }
.dot-off { width: 8px; height: 8px; border-radius: 50%; background: var(--txt-4); display: inline-block; margin-right: 6px; }

/* ============================================================
   ДОКУМЕНТЫ
   ============================================================ */
.doc { max-width: 860px; margin: 0 auto; }
.doc h1 { font-size: 36px; margin: 14px 0 10px; }
.doc-upd { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--txt-4); text-transform: uppercase; }
.doc-lead { margin-top: 22px; padding: 20px 22px; background: var(--surface); border-radius: var(--r-md); border-left: 4px solid var(--magenta); color: var(--txt-2); font-size: 15px; line-height: 1.7; box-shadow: var(--shadow-sm); }
.doc-sec { padding: 30px 0; border-top: 1px solid var(--line); }
.doc-sec h2 { font-size: 21px; margin-bottom: 14px; }
.doc-sec p { color: var(--txt-2); font-size: 15.5px; line-height: 1.78; margin-bottom: 14px; }
.doc-sec p:last-child { margin-bottom: 0; }
.doc-sec ul { display: grid; gap: 9px; margin-bottom: 14px; }
.doc-sec li { position: relative; padding-left: 22px; color: var(--txt-2); font-size: 15px; line-height: 1.7; }
.doc-sec li::before { content: ''; position: absolute; left: 3px; top: 11px; width: 7px; height: 7px; background: var(--magenta); border-radius: 2px; }
.doc-sec b { color: var(--txt); }

.doc-toc { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; padding: 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.doc-toc button { height: 34px; padding: 0 15px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; font-weight: 800; color: var(--txt-2); }
.doc-toc button:hover { background: var(--g-btn); color: #fff; }

.doc-contact { margin-top: 28px; padding: 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.doc-contact h3 { font-size: 17px; margin-bottom: 14px; }
.doc-contact .rows { display: grid; gap: 11px; }
.doc-contact .rows div { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--txt-2); }
.doc-contact .rows svg { width: 17px; height: 17px; color: var(--magenta); flex: none; }
.doc-contact a { color: var(--violet-2); font-weight: 800; }
.doc-contact a:hover { color: var(--magenta); }

/* ============================================================
   ПОДВАЛ — одна строка, как на макете
   ============================================================ */
.foot { background: var(--g-foot); padding: 30px 0 34px; }
.foot-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}
.foot-line a:hover { color: #ffd0f2; }
.foot-line i { font-style: normal; opacity: 0.5; }
.foot-line span { opacity: 0.92; }
.foot-legal {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
}
.foot-legal a { color: rgba(255, 255, 255, 0.62); }
.foot-legal a:hover { color: #fff; }

/* ============================================================
   ОФОРМЛЕНИЕ ПРОФИЛЯ: редактор и варианты
   ============================================================ */

/* ---------- шрифт ника ---------- */
.nf-rounded, .ed-nf-rounded { font-family: 'Montserrat', 'Manrope', system-ui, sans-serif; letter-spacing: 0.01em; }
.nf-mono, .ed-nf-mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: -0.03em; }
.nf-serif, .ed-nf-serif { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; letter-spacing: 0; }

/* ---------- фоны профиля ---------- */
.nbg-none, .ed-nbg-none { background: var(--g-hero); }
.nbg-aurora, .ed-nbg-aurora { background: linear-gradient(120deg, #7c3aed, #e64fc0 46%, #2f9bff); }
.nbg-sunset, .ed-nbg-sunset { background: linear-gradient(120deg, #ff9a3c, #ff5f9e 52%, #8b4be8); }
.nbg-ocean, .ed-nbg-ocean { background: linear-gradient(120deg, #0ea5e9, #22d3ee 50%, #3b82f6); }
.nbg-night, .ed-nbg-night { background: linear-gradient(120deg, #1b1040, #3a1e7c 55%, #6d28d9); }
.nbg-candy, .ed-nbg-candy { background: linear-gradient(120deg, #ffb3e6, #ff7ad9 45%, #a855f7); }

/* когда выбран фон-пресет, клетка-заглушка не нужна */
.pf-cover[class*="nbg-"] .pf-cover-empty { display: none; }

/* ---------- анимация ника ---------- */
@keyframes nf-flow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes nf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.pf-nick.anim-flow, .ed-anim-flow {
  background: linear-gradient(90deg, #ff6fd8, #a855f7, #2f9bff, #22c55e, #f5a524, #ff6fd8);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: nf-flow 6s linear infinite;
}
.pf-nick.anim-pulse, .ed-anim-pulse { animation: nf-pulse 2.6s ease-in-out infinite; }
.pf-nick.anim-wave, .ed-anim-wave {
  background: linear-gradient(90deg, var(--acc, #ff6fd8), #a855f7, var(--acc, #ff6fd8));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: nf-flow 3.6s linear infinite;
}

/* ---------- фон страницы профиля ----------
   красится весь блок, а не только полоска обложки,
   чтобы сразу было видно, куда применился фон */
.pf-page { border-radius: var(--r-xl); }
.pf-page[class*="nbg-"] { padding: 24px; }
.pf-page[class*="nbg-"] .pf-hero { box-shadow: var(--shadow-lg); }

/* ---------- свой арт на фоне профиля ----------
   Пропорции картинки не трогаем: тянем на всю ширину (масштаб задаёт
   переменная) и повторяем вниз до конца блока — пустоты не остаётся,
   но ничего не растягивается и не обрезается по неволе. */
.pf-page.has-bg { padding: 24px; }
.pf-page.has-bg .pf-hero { box-shadow: var(--shadow-lg); }
.pf-cover.has-bg .pf-cover-empty { display: none; }
.pf-page.has-bgimg {
  position: relative;
  overflow: hidden;
}
.pf-page.has-bgimg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: repeat-y;
  background-size: var(--bg-scale, 100%) auto;
  background-position: var(--bg-x, 50%) var(--bg-y, 0%);
  filter: blur(var(--bg-blur, 0px));
  pointer-events: none;
}
.pf-page.has-bgimg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(12, 7, 22, var(--bg-dim, .5));
  pointer-events: none;
}
.pf-page.has-bgimg > * { position: relative; }

/* то же самое в превью редактора */
.ed-prev-bg.has-bgimg {
  background-repeat: repeat-y;
  background-size: var(--bg-scale, 100%) auto;
  background-position: var(--bg-x, 50%) var(--bg-y, 0%);
}
.ed-prev-bg.has-bgimg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(12, 7, 22, var(--bg-dim, .5));
}
.ed-bgt-hint { margin: 0 0 14px; }
.ed-bgt-acts { margin-top: 16px; display: flex; gap: 8px; }

/* ---------- ник, подпись, о себе ---------- */
.pf-nick { color: var(--acc, var(--txt)); }
.pf-status {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--txt-2);
  max-width: 58ch;
  overflow-wrap: anywhere;
}
.pf-about { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 15px; }
.pf-about span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--txt-3); min-width: 0; }
.pf-about svg { width: 15px; height: 15px; color: var(--acc, var(--magenta)); flex: none; }
.pf-about a { color: var(--violet-2); font-weight: 800; overflow-wrap: anywhere; }
.pf-about a:hover { color: var(--magenta); }

/* ============================================================
   РЕДАКТОР
   ============================================================ */
.ped-wide { max-width: 780px; }
.ped-block { margin-top: 22px; }
.ped-block .ped-lab { margin-bottom: 13px; }

.ped-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.ped-foot .ped-msg { flex: 1; margin: 0; min-height: 0; }

/* вкладки редактора */
.ed-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  background: var(--surface-3);
  border-radius: 999px;
  margin-bottom: 22px;
}
.ed-tab {
  flex: 1;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--txt-2);
  min-width: 0;
  white-space: nowrap;
}
.ed-tab svg { width: 16px; height: 16px; flex: none; }
.ed-tab:hover { color: var(--violet-2); }
.ed-tab.on { background: var(--g-btn); color: #fff; box-shadow: 0 6px 16px rgba(178, 47, 214, 0.28); }

.ed-pane { display: none; }
.ed-pane.on { display: block; }

/* живое превью */
.ed-prev {
  position: relative;
  height: 132px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ed-prev-bg { position: absolute; inset: 0; }
.ed-prev-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
  padding: 0 24px;
}
.ed-prev-av {
  position: relative;
  width: 66px;
  height: 66px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.24);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}
.ed-prev-av svg { width: 28px; height: 28px; }
.ed-prev-txt { min-width: 0; }
.ed-prev-txt b { display: block; font-size: 23px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-prev-txt i { display: block; font-style: normal; font-size: 13px; color: rgba(255, 255, 255, 0.86); margin-top: 5px; }
.ed-prev-txt em { display: block; font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, 0.7); margin-top: 4px; }

/* цвет */
.ed-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ed-sw {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  padding: 0;
}
.ed-sw.on { border-color: var(--txt); transform: scale(1.08); }
.ed-sw-custom {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
}
.ed-sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-sw-custom svg { width: 17px; height: 17px; color: var(--txt-2); }

/* цвет с ползунками */
.ed-col {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.ed-col-prev {
  width: 92px;
  height: 92px;
  border-radius: var(--r-md);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}
.ed-ranges { display: grid; gap: 11px; }
.ed-range {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--txt-2);
  -webkit-user-select: none;
  user-select: none;
}
.ed-range > b { text-align: right; font-variant-numeric: tabular-nums; color: var(--txt); font-weight: 800; }
/* свой ползунок: одинаково тянется мышью и пальцем */
.ed-slider {
  position: relative;
  height: 30px;                /* зона захвата повыше — легче попасть пальцем */
  border-radius: 99px;
  cursor: pointer;
  touch-action: none;          /* жест идёт в ползунок, а не в прокрутку страницы */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* без меню по долгому нажатию */
  -webkit-tap-highlight-color: transparent;
}
.ed-slider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--fill, var(--surface-3));
}
.ed-slider i {
  position: absolute;
  top: 4px;
  left: calc(var(--t, 0) * (100% - 22px));
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--violet-2);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.ed-slider:hover i { border-color: var(--magenta); }

/* шкалы */
#ed-h { --fill: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
#ed-s { --fill: linear-gradient(90deg, hsl(var(--h, 316) 0% 58%), hsl(var(--h, 316) 100% 58%)); }
#ed-l { --fill: linear-gradient(90deg, #000, hsl(var(--h, 316) 82% 50%), #fff); }

/* Ползунок нельзя сжимать: на телефоне три колонки съедали всю ширину,
   и трек вырождался в 18px — тянуть было физически не за что.
   Ниже — раскладка, при которой дорожка всегда во всю ширину. */
@media (max-width: 900px) {
  .ed-col { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ed-col-prev { width: 100%; height: 58px; }
}
@media (max-width: 560px) {
  .ed-range {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "lab val" "sld sld";
    column-gap: 10px;
    row-gap: 3px;
  }
  .ed-range > span { grid-area: lab; }
  .ed-range > b { grid-area: val; }
  .ed-range > .ed-hex { grid-area: sld; }
  .ed-slider { grid-area: sld; height: 36px; }
  .ed-slider::before { top: 13px; }
  .ed-slider i { top: 7px; }
}

.ed-hex { height: 40px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; }

/* кнопки-варианты */
.ed-opts { display: flex; flex-wrap: wrap; gap: 9px; }
.ed-opt {
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--surface-3);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--txt-2);
}
.ed-opt:hover { background: #ead9fb; }
.ed-opt.on { background: var(--g-btn); color: #fff; box-shadow: 0 6px 16px rgba(178, 47, 214, 0.28); }

/* плитки фона */
.ed-bgs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ed-bg {
  position: relative;
  height: 66px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  padding: 0;
}
.ed-bg span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  text-align: center;
}
.ed-bg.on { border-color: var(--txt); }

/* ---------- свой арт вместо готового фона ---------- */
.ed-art {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-areas: "prev act" "prev hint" "prev msg";
  column-gap: 14px;
  row-gap: 8px;
  align-items: start;
}
.ed-art-prev {
  grid-area: prev;
  position: relative;
  width: 132px;
  height: 88px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-3);
}
.ed-art-prev svg { width: 26px; height: 26px; }
.ed-art-prev.on { border-style: solid; border-color: var(--violet-2); }
.ed-art-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-art-act { grid-area: act; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-art .ped-hint { grid-area: hint; margin: 0; }
.ed-art .ped-msg { grid-area: msg; margin: 0; }
.ed-art .ped-hint b { color: var(--txt-2); }
.is-hidden { display: none !important; }

@media (max-width: 560px) {
  .ed-art { grid-template-columns: minmax(0, 1fr); grid-template-areas: "prev" "act" "hint" "msg"; }
  .ed-art-prev { width: 100%; height: 132px; }
}

@media (max-width: 760px) {
  .ped-wide { max-width: 100%; }
  .ed-tab { height: 42px; font-size: 12.5px; gap: 0; }
  .ed-tab svg { display: none; }
  .ed-bgs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ed-prev { height: 116px; }
  .ed-prev-txt b { font-size: 19px; }
  .ed-prev-av { width: 56px; height: 56px; }
  .ped-foot { flex-direction: column-reverse; align-items: stretch; }
  .ped-foot .btn { width: 100%; }
  .ed-opts .ed-opt { flex: 1 1 auto; }
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 1180px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-art {
    justify-content: center;
    min-height: 0;
    margin-top: 8px;
  }
  .hero-art::before { right: 50%; transform: translateX(50%); bottom: -40px; }
  .hero-art img { height: 400px; margin: 0 0 -44px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .car-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl-head, .tbl-row { grid-template-columns: 52px minmax(0, 1fr) 84px 88px 70px; padding: 0 16px; }
  .brand-name { font-size: 32px; }
  .brand-mark, .brand-mark svg { width: 40px; height: 40px; }
}

/* на широком экране шторка не нужна */
@media (min-width: 1001px) {
  .nav-sheet { display: none !important; }
}

@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .podium { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .pod.first { order: -1; }
  .car-nav { display: none; }
}

/* ---- телефон: компактная шапка, чтобы ничего не съезжало ---- */
@media (max-width: 760px) {
  :root { --nav-h: 64px; }

  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .nav-in { padding: 0 16px; gap: 10px; }

  .brand { gap: 9px; }
  .brand-mark, .brand-mark svg { width: 30px; height: 30px; }
  .brand-name { font-size: 21px; text-shadow: -1.5px 0 var(--outline), 1.5px 0 var(--outline), 0 -1.5px var(--outline), 0 1.5px var(--outline), -1px -1px var(--outline), 1px -1px var(--outline), -1px 1px var(--outline), 1px 1px var(--outline); }

  .nav-right { gap: 8px; }
  .nav-user { height: 40px; padding: 0 14px 0 4px; font-size: 13.5px; border-radius: 11px; }
  .nav-user .av, .nav-user .na-av { width: 32px; height: 32px; border-radius: 8px; }
  .nav-burger { width: 40px; height: 40px; }

  .sec { padding: 40px 0; }
  .mk { padding: 42px 0; }
  .mk-title { font-size: 22px; padding-bottom: 13px; }
  .mk-title::after { width: 76px; height: 6px; }
  .mk-head-row { gap: 14px; }
  /* табы не сжимаем — даём прокрутку, иначе подписи слипаются */
  .tabs-row {
    flex-wrap: nowrap;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .tabs-row::-webkit-scrollbar { display: none; }
  .tabs-row .tabs { flex: none; }
  .tab { padding: 0 16px; }
  .mk-head.center .mk-head-row { justify-content: flex-start; }
  .link-a { font-size: 13px; }

  .hero { padding: 42px 0 38px; }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 19px; margin-top: 16px; }
  .hero-text { font-size: 14.5px; }
  .hero-row { margin-top: 24px; gap: 12px; }
  .hero-art img { height: 300px; margin-bottom: -30px; }
  .hero-art::before { width: 340px; height: 340px; bottom: -20px; }
  .hero-chips { width: 100%; }
  .chip { flex: 1 1 100%; }
  .chip .c-val { max-width: none; }

  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .car-track { grid-template-columns: minmax(0, 1fr); }
  .modes-panel { margin-top: -44px; padding: 22px 18px 24px; }
  .modes-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mode-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; }
  .mode-card .m-ico { margin: 0; width: 58px; height: 58px; border-radius: 16px; flex: none; }
  .mode-card .m-ico svg { width: 34px; height: 34px; }
  .mode-card .m-body { flex: 1 1 auto; min-width: 0; }
  .mode-card .m-cnt { justify-content: flex-start; margin-top: 9px; padding-top: 9px; }
  .mode-card .m-rx { top: 9px; right: 9px; }
  .mode-card > .m-body { padding-right: 0; }
  /* бейдж RELAX не должен налезать на текст */
  .mode-card:has(.m-rx) .m-body { padding-right: 58px; }
  .band { padding: 26px; }
  .band h2 { font-size: 20px; }
  .band .hero-acts { width: 100%; }
  .band .hero-acts .btn { width: 100%; }

  .pf-cover { height: 132px; }
  .pf-in { padding: 0 18px 22px; gap: 16px; }
  .pf-av { width: 90px; height: 90px; margin-top: -46px; }
  .pf-id h1 { font-size: 24px; }
  .pf-side { width: 100%; align-items: stretch; padding-top: 14px; }
  .pf-quick { justify-content: stretch; }
  .pf-quick .q { flex: 1; min-width: 0; text-align: left; }
  .pf-charts { grid-template-columns: minmax(0, 1fr); }

  .tbl { background: none; box-shadow: none; overflow: visible; }
  .tbl-head { display: none; }
  .tbl-row { display: flex; align-items: center; gap: 12px; height: auto; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
  .tbl-row .c-rank { font-size: 12px; }
  .tbl-row .c-user { flex: 1; }
  /* на телефоне оставляем только pp — иначе строка не помещается */
  .tbl-row .c-acc, .tbl-row .c-games { display: none; }

  .score { grid-template-columns: 32px minmax(0, 1fr) auto; row-gap: 8px; }
  .score .s-rank { grid-row: span 2; }
  .score .s-main { grid-column: 2 / -1; }
  .score .s-mods { grid-column: 2; grid-row: 2; }
  .score .s-pp { grid-column: 3; grid-row: 2; text-align: right; }
  .score .s-time { display: none; }

  .ped-grid { grid-template-columns: minmax(0, 1fr); }
  .ped-card { padding: 20px; }
  .login-card { padding: 22px 18px; }
  .login-tabs { gap: 5px; padding: 5px; }
  .login-tabs .tab { padding: 0 12px; font-size: 12.5px; gap: 7px; }
  .chat-log { height: 54vh; }
  .doc h1 { font-size: 27px; }
  .ccard { padding: 20px; }
  .foot-line { font-size: 14px; gap: 9px; }
  .btn { height: 44px; padding: 0 18px; }
  .btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
}

@media (max-width: 420px) {
  .hero-acts .btn { width: 100%; }
  .chat-form { flex-direction: column; align-items: stretch; }
  .chat-form .btn { width: 100%; }
  .tabs-row .tab { padding: 0 14px; }
}

/* ============================================================
   ЛЁГКИЕ АНИМАЦИИ
   Движение только на фоне и при наведении — в тексте ничего не прыгает.
   ============================================================ */
@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(64px, -46px, 0) scale(1.1); }
  66%      { transform: translate3d(-48px, 34px, 0) scale(0.94); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(-72px, -38px, 0) scale(0.92); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.65); }
  50%      { opacity: 0.75; transform: scale(1); }
}
@keyframes sway {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes sheen {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes rise {
  0%   { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* фон-подложка всего сайта: едва заметное живое свечение */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38vw 38vw at 12% 18%, rgba(255, 122, 217, 0.20), transparent 62%),
    radial-gradient(34vw 34vw at 88% 72%, rgba(168, 85, 247, 0.18), transparent 62%),
    radial-gradient(30vw 30vw at 62% 8%, rgba(177, 125, 255, 0.12), transparent 60%);
  background-size: 180% 180%;
  animation: sheen 34s ease-in-out infinite alternate;
}

/* пятна в герое */
.hero::before { animation: drift-a 28s ease-in-out infinite; }
.hero::after  { animation: drift-b 34s ease-in-out infinite; }

/* искорки в герое */
.hero-sparks { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-sparks i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.55);
  animation: twinkle 5.5s ease-in-out infinite;
}
.hero-sparks i:nth-child(1) { left: 12%;  top: 22%; animation-delay: 0s; }
.hero-sparks i:nth-child(2) { left: 27%;  top: 62%; animation-delay: .9s; width: 4px; height: 4px; }
.hero-sparks i:nth-child(3) { left: 44%;  top: 16%; animation-delay: 1.8s; width: 5px; height: 5px; }
.hero-sparks i:nth-child(4) { left: 58%;  top: 74%; animation-delay: 2.6s; }
.hero-sparks i:nth-child(5) { left: 71%;  top: 34%; animation-delay: 3.4s; width: 4px; height: 4px; }
.hero-sparks i:nth-child(6) { left: 86%;  top: 66%; animation-delay: 4.2s; }

/* персонаж слегка покачивается */
.hero-art img { animation: sway 7s ease-in-out infinite; }

/* заголовки секций переливаются */
.mk-title {
  background-size: 200% auto;
  animation: sheen 9s ease-in-out infinite alternate;
}

/* градиентные кнопки — мягкий блик */
.btn-red { background-size: 180% auto; }
/* блик только на самой главной кнопке — на остальных он раздражает */
.hero-row .btn-red { animation: sheen 9s ease-in-out infinite alternate; }
.link-a, .nav-user { transition: color .18s ease, box-shadow .18s ease; }

/* плавные наведения */
.btn, .card, .pcard, .ccard, .tab, .pg, .back, .chip, .tile, .fr-card, .score, .badge, .chart, .news-item {
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.card-hover:hover, .pcard:hover, .ccard:hover, .fr-card:hover, .news-item:hover, .score:hover, .tile:hover {
  transform: translateY(-4px);
}
.btn:active { transform: translateY(0); }
.tab:hover, .pg:hover, .back:hover { transform: none; }

/* появление секций при прокрутке */
.rise { animation: rise .5s ease both; }

/* Если человек просил меньше движения — уважаем это */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-art img, .hero::before, .hero::after, body::before { animation: none !important; }
}
/* ============================================================
   РЕДАКТОР ПРОФИЛЯ КАК СТРАНИЦА
   Раньше форма висела окном поверх профиля, и при прокрутке профиль
   на фоне ехал вместе с ней. Теперь это обычная страница: поток
   документа один, фон под формой не двигается.
   ============================================================ */
.ped-onpage {
  position: static;
  display: block;
  inset: auto;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ped-onpage .ped-card {
  max-height: none;          /* страница скроллится как обычно, а не внутри коробки */
  overflow: visible;
  max-width: 820px;
  margin: 0 auto;
}

/* ============================================================
   ЧИБИ РЯДОМ С НИКОМ
   ============================================================ */
.pf-nickrow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pf-chibi {
  position: relative;
  display: inline-block;
  width: 76px;
  height: 76px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--line);
}
.pf-chibi img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cb-scale, 100%);
  height: var(--cb-scale, 100%);
  object-fit: contain;
  transform: translate(-50%, -50%) translate(var(--cb-dx, 0%), var(--cb-dy, 0%));
  filter: blur(var(--cb-blur, 0px)) brightness(calc(1 - var(--cb-dim, 0)));
}
/* в превью редактора чиби поменьше — там места мало */
.pf-chibi.ed-chibi-sm { width: 46px; height: 46px; border-width: 1px; }

/* ---------- галерея чиби в редакторе ---------- */
.ed-chibis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.ed-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 6px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-3);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--txt-2);
  text-align: center;
  transition: border-color .15s;
}
.ed-pick:hover { border-color: var(--violet-2); }
.ed-pick.on { border-color: var(--txt); color: var(--txt); }
.ed-pick img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: block;
}
.ed-pick-none {
  width: 66px;
  height: 66px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-3);
}
.ed-pick-none svg { width: 22px; height: 22px; }
.ed-pick span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-art-chibi { height: 132px; border-radius: 50%; }
.ed-art-chibi img { object-fit: contain; }

/* ============================================================
   ПРАВКИ ПО ЗАМЕЧАНИЯМ
   1. Обводка чиби не нужна и обрезала персонажа по кругу.
   2. Чиби должна стоять ПОСЛЕ ника, а не уезжать под него.
   3. Превью закреплено сверху: ползунки живут внизу страницы,
      и раньше результат не было видно, пока тянешь.
   ============================================================ */
.pf-chibi {
  width: 68px;
  height: 68px;
  border-radius: var(--r-md);
  background: none;
  border: none;
}
.pf-nickrow { flex-wrap: nowrap; align-items: center; }
.pf-nickrow > .pf-nick { min-width: 0; }
.pf-chibi.ed-chibi-sm { width: 42px; height: 42px; }

@media (max-width: 560px) {
  .pf-chibi { width: 52px; height: 52px; }
  .pf-chibi.ed-chibi-sm { width: 34px; height: 34px; }
}

/* превью липнет к верху — видно, что делаешь ползунками */
.ped-onpage .ed-prev {
  position: sticky;
  top: 8px;
  z-index: 6;
  box-shadow: var(--shadow-md);
}

/* подпись под регулировками: без картинки ползунки вроде работают,
   а толку нет — говорим об этом прямо */
.ed-bgt-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--txt-3); }
.ed-bgt-note:empty { display: none; }

/* превью профиля в редакторе: обложка, аватар, ник и чиби — всё сразу */
.ed-prev-in { flex-wrap: nowrap; }
.ed-prev-cov {
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--line);
}
.ed-prev-cov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-prev-cov-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--txt-3);
}
.ed-prev-cov-empty svg { width: 22px; height: 22px; }
.ed-prev-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

@media (max-width: 560px) {
  .ed-prev-cov { width: 68px; height: 68px; }
}

/* Прежде превью липло под фиксированную шапку и пропадало из виду:
   отступ отсчитываем от высоты шапки, а не от нуля. */
.ped-onpage .ed-prev {
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  z-index: 6;
  box-shadow: var(--shadow-md);
}

/* ---------- рамки аватара ---------- */
.av-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.av-wrap { position: relative; display: inline-block; }


/* ============================================================
   ДЕКОР АВАТАРА (КРЫЛЬЯ)
   Оригинал 498×224, круглое окно шириной 120px по центру.
   Поэтому картинку растягиваем в 498/120 ≈ 4.15 раза шире аватара
   и ставим точно по его центру — тогда окно ложится на аватар.
   ============================================================ */


/* ============================================================
   ПРЕВЬЮ ПЛАВАЕТ СВЕРХУ
   Раньше стоял position: sticky — но его гасит overflow любого
   предка, и на телефоне превью просто не было видно. Теперь оно
   прибито к экрану: ползунки внизу, результат всегда перед глазами.
   ============================================================ */
.ped-onpage .ed-prev {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 24px));
  z-index: 150;
  height: 132px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  outline: 1px solid rgba(255, 255, 255, .10);
}
.ped-onpage .ed-tabs { margin-top: 150px; }
@media (max-width: 620px) {
  .ped-onpage .ed-prev { height: 118px; }
  .ped-onpage .ed-tabs { margin-top: 134px; }
}

/* ============================================================
   ИГРОКИ СЕРВЕРА
   Карточка показывает оформление игрока: его фон (свой арт или
   готовый), аватар, страну и pp. Фон берём из его nyan_profile,
   поэтому страница выглядит как галерея живых профилей.
   ============================================================ */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.pl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px 13px;
  border-radius: var(--r-lg);
  background: var(--surface);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.pl-card:hover { transform: translateY(-2px); border-color: var(--violet-2); }
/* тёмная подложка, иначе светлый фон игрока съест текст */
.pl-card.has-art::before,
.pl-card.nbg-aurora::before, .pl-card.nbg-sunset::before,
.pl-card.nbg-ocean::before, .pl-card.nbg-night::before,
.pl-card.nbg-candy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(12, 7, 22, .55);
  pointer-events: none;
}
.pl-card.nbg-aurora { background-image: linear-gradient(120deg, #7c3aed, #e64fc0 46%, #2f9bff); }
.pl-card.nbg-sunset { background-image: linear-gradient(120deg, #ff9a3c, #ff5f9e 52%, #8b4be8); }
.pl-card.nbg-ocean { background-image: linear-gradient(120deg, #0ea5e9, #22d3ee 50%, #3b82f6); }
.pl-card.nbg-night { background-image: linear-gradient(120deg, #1b1040, #3a1e7c 55%, #6d28d9); }
.pl-card.nbg-candy { background-image: linear-gradient(120deg, #ffb3e6, #ff7ad9 45%, #a855f7); }

.pl-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}
.pl-av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-3);
  color: var(--txt-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, .22);
  flex: none;
}
.pl-av svg { width: 26px; height: 26px; }
.pl-av .av, .pl-av .av-ph { width: 100%; height: 100%; border: none; border-radius: 50%; }
.pl-nick {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--txt);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-meta {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-3);
  text-align: center;
  min-height: 1.2em;
}
.pl-meta .green { color: #4ade80; font-weight: 800; }

/* счётчик игроков в заголовке — виден сразу, без догадок */
.pl-count {
  font-size: 15px;
  font-weight: 800;
  color: var(--txt-3);
  vertical-align: middle;
}
