/* =====================================================================
   Tovruna — дизайн-система
   1. Токены   2. База   3. Каркас (rail / col / side / tabbar)
   4. Компоненты: кнопки, аватар, карточки, строки, табы, поля, меню,
      диалоги, тосты, композер, пост, чат, медиа, markdown
   5. Страницы (профиль, вход, приветствие)   6. Адаптив
   Правило: новые стили — только через токены и существующие компоненты.
   ===================================================================== */

/* ---------- 0. Шрифт заголовков (Unbounded, OFL, свой хостинг) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600 900; font-display: swap; src: url("../fonts/unbounded-cyr.3a5ed4d11365.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600 900; font-display: swap; src: url("../fonts/unbounded-lat.8616dc355070.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 1. Токены ---------- */
:root {
  color-scheme: dark;
  /* палитра оформления (меняется выбором «Цвет оформления»: data-accent на <html>) */
  --brand: #8b5cf6; --brand-2: #ec4899; --glow-3: #22d3ee;
  --brand-hover: color-mix(in srgb, var(--brand) 85%, white);
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --brand-soft: color-mix(in srgb, var(--brand) 20%, transparent);
  --pop: #c6f432; --pop-ink: #121608;
  --like: #ff3d7f; --ok: #3ddc97; --danger: #ff5c6c;
  /* фирменный приём: «стикер» — толстая обводка и жёсткая салатовая тень */
  --ink: #0c0918;
  --stroke: 2px solid var(--ink);
  --hard: 3px 3px 0 var(--pop);
  --hard-lg: 5px 5px 0 var(--pop);
  --hard-brand: 4px 4px 0 var(--brand);
  --font-display: "Unbounded", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* поверхности: тёмно-фиолетовая база и «стекло» поверх цветного фона */
  --bg: #0d0e12;
  --bg-tint: #0d0e12;
  --surface: #17191f;
  --surface-solid: #16171d;
  --surface-2: #1e2027;
  --surface-3: #272a33;
  --col-bg: transparent;
  --line: #262832;
  --text: #eef0f5;
  --text-2: #969bab;
  --bubble-in: #1e2027;
  --bubble-out: var(--grad);
  --bubble-out-text: #ffffff;
  --bubble-out-meta: rgba(255, 255, 255, .75);
  --mark: color-mix(in srgb, var(--pop) 35%, transparent);
  --shadow: 0 16px 40px rgba(6, 3, 20, .55);
  --blur-bg: rgba(13, 14, 18, .96);
  --aurora-a: .16;
  --av-l: 50%;

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-xs: .78rem; --fs-sm: .875rem; --fs: .9375rem; --fs-md: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.6rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: .12s; --t: .2s;
  --rail-w: 260px; --col-w: 680px; --side-w: 350px; --tab-h: 58px; --head-h: 56px;

  /* совместимость со старыми именами (профиль меняет их через свои стили) */
  --panel: var(--surface); --card: var(--surface); --edge: var(--line); --fg: var(--text);
  --muted: var(--text-2); --accent: var(--brand); --field: var(--surface-2);
  --btn: var(--brand); --btn-fg: var(--brand-ink); --err: var(--danger);
}
/* палитры */
:root[data-accent="ocean"]  { --brand: #0ea5e9; --brand-2: #6366f1; --glow-3: #2dd4bf; }
:root[data-accent="lime"]   { --brand: #22c55e; --brand-2: #a3e635; --glow-3: #06b6d4; --brand-ink: #06210f; }
:root[data-accent="sunset"] { --brand: #f97316; --brand-2: #ec4899; --glow-3: #facc15; }
:root[data-accent="berry"]  { --brand: #e11d48; --brand-2: #a855f7; --glow-3: #fb7185; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f6; --bg-tint: #f2f3f6;
  --surface: #ffffff; --surface-solid: #ffffff;
  --surface-2: #f0f1f5;
  --surface-3: #e5e7ee;
  --col-bg: transparent;
  --line: #e2e4ea;
  --text: #14151a; --text-2: #5d6170;
  --brand-hover: color-mix(in srgb, var(--brand) 85%, black);
  --brand-soft: color-mix(in srgb, var(--brand) 13%, transparent);
  --bubble-in: #ffffff;
  --mark: color-mix(in srgb, var(--pop) 70%, transparent);
  --shadow: 0 16px 40px rgba(60, 30, 120, .16);
  --blur-bg: rgba(242, 243, 246, .96);
  --aurora-a: .1; --av-l: 56%;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f3f6; --bg-tint: #f2f3f6;
    --surface: #ffffff; --surface-solid: #ffffff;
    --surface-2: #f0f1f5;
    --surface-3: #e5e7ee;
    --col-bg: transparent;
    --line: #e2e4ea;
    --text: #14151a; --text-2: #5d6170;
    --brand-hover: color-mix(in srgb, var(--brand) 85%, black);
    --brand-soft: color-mix(in srgb, var(--brand) 13%, transparent);
    --bubble-in: #ffffff;
    --mark: color-mix(in srgb, var(--pop) 70%, transparent);
    --shadow: 0 16px 40px rgba(60, 30, 120, .16);
    --blur-bg: rgba(242, 243, 246, .96);
    --aurora-a: .1; --av-l: 56%;
  }
}

/* тихое свечение по краям — только на компьютере и без анимации (на телефоне это тормозит) */
@media (min-width: 1020px) {
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(40vmax 30vmax at 0% 0%, color-mix(in srgb, var(--brand) calc(var(--aurora-a) * 100%), transparent), transparent 70%),
      radial-gradient(36vmax 28vmax at 100% 100%, color-mix(in srgb, var(--brand-2) calc(var(--aurora-a) * 80%), transparent), transparent 70%);
  }
}

/* цвет ника пользователя (тег nickcolor): тёмная тема — --nd, светлая — --nl */
[style*="--nd:"] { color: var(--nd) !important; }
:root[data-theme="light"] [style*="--nd:"] { color: var(--nl) !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) [style*="--nd:"] { color: var(--nl) !important; } }

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--head-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); isolation: isolate;
  font: var(--fs)/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-anchor: none;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: var(--fs-xl); font-weight: 900; }
h2 { font-size: var(--fs-lg); font-weight: 750; }
h3 { font-size: var(--fs-md); font-weight: 700; }
p { margin: 0 0 var(--s3); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
[hidden] { display: none !important; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.muted { color: var(--text-2); }
small, .small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s4); top: var(--s4); z-index: 100; background: var(--surface); padding: var(--s2) var(--s4); border-radius: var(--r-sm); }
.ic { flex: none; display: block; }
/* пара иконок: контурная обычно, залитая у активного пункта */
.i-on { display: none; }
.is-active > .i-on { display: block; }
.is-active > .i-off { display: none; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- 3. Каркас ---------- */
.app { display: flex; justify-content: center; gap: var(--s5); min-height: 100vh; }
.col { width: 100%; max-width: var(--col-w); min-width: 0; display: flex; flex-direction: column; background: var(--col-bg); }
main { flex: 1; padding: var(--s4); display: flex; flex-direction: column; min-width: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; line-height: 1; }
.logo-mark { flex: none; display: block; filter: drop-shadow(2px 2px 0 var(--pop)); transition: transform var(--t) var(--ease); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-word { font-family: var(--font-display); font-weight: 900; font-size: 1.45rem; letter-spacing: -.04em; color: var(--text); }
.brand i { font-style: normal; color: var(--pop); }
.brand em { font-style: normal; background: linear-gradient(90deg, var(--pop), #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* левая панель */
.rail { position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--rail-w); flex: none; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4) var(--s3); overflow-y: auto; }
.rail-brand { padding: var(--s2) var(--s3) var(--s4); }
.rail-link { position: relative; display: flex; align-items: center; gap: var(--s4); padding: 11px 18px 11px 14px; border: 2px solid transparent; border-radius: var(--r-pill); color: var(--text); font-size: var(--fs-md); font-weight: 600; text-decoration: none !important; transition: background var(--t-fast), transform var(--t-fast); width: fit-content; }
.rail-link:hover { background: var(--surface-2); }
.rail-link.is-active { font-weight: 800; background: var(--grad); color: #fff; border-color: var(--ink); box-shadow: var(--hard); }
.rail-link.is-active .ic { color: #fff; }
.rail-link .cnt { position: absolute; left: 32px; top: 2px; }
.rail-post { margin-top: var(--s3); width: 100%; }
.rail-me { margin-top: auto; display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s2) var(--s3); border: 0; background: none; border-radius: var(--r-pill); cursor: pointer; text-align: left; }
.rail-me:hover { background: var(--surface-2); }
.rail-me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rail-me-txt b, .rail-me-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-me-txt small { color: var(--text-2); }

/* заголовок колонки */
.pagehead { position: sticky; top: 0; z-index: 20; background: var(--blur-bg); transition: transform .22s var(--ease); will-change: transform; }
.pagehead.is-hidden { transform: translateY(-100%); }
.ph-bar { display: flex; align-items: center; gap: var(--s3); min-height: var(--head-h); padding: var(--s2) var(--s4); }
.ph-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); }
.ph-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-title:empty { display: none; }
.ph-sub { display: block; font-size: var(--fs-xs); color: var(--text-2); font-weight: 400; }
.ph-me { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.pagehead:has(.ph-title:empty):not(:has(.ph-tabs)) { display: none; }
.ph-back { margin-left: calc(-1 * var(--s2)); }

/* правая колонка */
.side { position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--side-w); flex: none; padding: var(--s3) var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s4); }
.side-search { position: relative; display: flex; align-items: center; }
.side-search .ic { position: absolute; left: 16px; color: var(--text-2); pointer-events: none; }
.side-search input { width: 100%; padding: 12px 16px 12px 44px; border-radius: var(--r-pill); border: 2px solid transparent; background: var(--surface); color: var(--text); font: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.side-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--hard-brand); }
.side-foot { font-size: var(--fs-xs); padding: 0 var(--s2); }

/* нижние вкладки (телефон) */
.tabbar { display: none; }

/* ---------- 4. Компоненты ---------- */

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); padding: 10px 18px; border: var(--stroke); border-radius: 14px; font-weight: 800; font-size: var(--fs); line-height: 1.2; cursor: pointer; text-decoration: none !important; background: var(--surface-3); color: var(--text); box-shadow: var(--hard); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast); white-space: nowrap; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--pop); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--pop); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary, .btn:not(.btn-ghost):not(.btn-danger):not(.btn-pop):not(.btn-soft):not(.ghost) { background: var(--grad); color: var(--brand-ink); }
.btn-ghost, .btn.ghost { background: var(--surface-solid); color: var(--text); }
.btn-ghost:hover, .btn.ghost:hover { background: var(--surface-3); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-pop { background: var(--pop); color: var(--pop-ink); box-shadow: 3px 3px 0 var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 22px; font-size: var(--fs-md); border-radius: 16px; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); border-radius: 11px; box-shadow: 2px 2px 0 var(--pop); }
.btn-block { width: 100%; }
.ibtn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); text-decoration: none !important; }
.ibtn:hover { background: var(--surface-2); color: var(--text); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.linkbtn:hover { text-decoration: underline; }

/* счётчик-бейдж */
.cnt { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--pop); color: var(--pop-ink); border: 2px solid var(--ink); font-size: 11px; font-weight: 900; font-style: normal; line-height: 1; transform: rotate(-6deg); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; }
.chip-brand { background: var(--grad); color: #fff; border-color: var(--ink); }
.chip-pop { background: var(--pop); color: var(--pop-ink); border-color: var(--ink); }

/* аватар: тег {% avatar %} */
.av { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; font-weight: 800; color: #fff; text-decoration: none !important; background: linear-gradient(140deg, hsl(calc(var(--h, 1) * 47) 85% var(--av-l)), hsl(calc(var(--h, 1) * 47 + 60) 90% calc(var(--av-l) - 10%))); user-select: none; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-xs { width: 24px; height: 24px; font-size: 11px; }
.av-sm { width: 36px; height: 36px; font-size: 15px; }
.av-md { width: 44px; height: 44px; font-size: 18px; }
.av-lg { width: 64px; height: 64px; font-size: 26px; }
.av-xl { width: 112px; height: 112px; font-size: 44px; border: 4px solid var(--card); }
.av-link { flex: none; border-radius: 50%; }

/* карточки и блоки */
.card, .box { background: var(--card); border-radius: var(--r-lg); }
.card { padding: var(--s5); margin-bottom: var(--s4); }
.box { overflow: hidden; }
.box-pad { padding: var(--s4) var(--s5); }
.box-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 900; margin: 0; padding: var(--s4) var(--s5) var(--s2); }
.box-more { display: block; padding: var(--s4) var(--s5); color: var(--brand); }
.box-more:hover { background: var(--surface-2); text-decoration: none; }
.hello h2 { margin-bottom: var(--s2); }

/* строка списка (группы, диалоги, участники) */
.row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); color: var(--text); text-decoration: none !important; transition: background var(--t-fast); min-width: 0; }
.row:hover { background: var(--surface-2); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.row-title .ic { color: var(--text-2); }
.row-sub { color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--text-2); font-size: var(--fs-xs); }
.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s4); }
.list-title { font-family: var(--font-display); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 800; margin: var(--s5) var(--s2) var(--s2); }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--text-2); }
.empty-ico { font-size: 2.6rem; display: block; margin-bottom: var(--s2); }
.empty b { display: block; color: var(--text); font-size: var(--fs-md); margin-bottom: 4px; }

/* табы */
.ph-tabs, .tabs { display: flex; gap: 4px; padding: 4px; margin: 0 var(--s4) var(--s3); background: var(--surface-2); border-radius: var(--r-pill); }
.tabs { margin: 0 0 var(--s4); }
.ph-tabs a, .tabs a { flex: 1; text-align: center; padding: 8px var(--s2); border-radius: var(--r-pill); color: var(--text-2); font-weight: 700; text-decoration: none !important; transition: background var(--t-fast), color var(--t-fast); }
.ph-tabs a:hover, .tabs a:hover { color: var(--text); }
.ph-tabs a.is-active, .tabs a.is-active { color: #fff; font-weight: 800; background: var(--grad); box-shadow: 2px 2px 0 var(--pop); }

/* поля форм */
.field { margin: 0 0 var(--s4); }
.field > label, form p > label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
form p { margin: 0 0 var(--s4); }
.input, form input[type=text], form input[type=password], form input[type=email], form input[type=search]:not(.side-search input), form textarea:not(.cmp-input), form select {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, form input:focus, form textarea:not(.cmp-input):focus, form select:focus { outline: none; border-color: var(--brand); box-shadow: var(--hard-brand); }
form textarea { resize: vertical; }
input[type=file] { color: var(--text-2); max-width: 100%; }
input[type=file]::file-selector-button { margin-right: var(--s3); background: var(--surface-3); color: var(--text); border: 0; border-radius: var(--r-pill); padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.helptext, form ul:not(.errorlist) { color: var(--text-2); font-size: var(--fs-xs); margin: 6px 0 0; padding-left: 1.1rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 0 0 var(--s2); font-size: var(--fs-sm); }
.switch { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--r); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }

/* меню «⋯» и выдвижная панель аккаунта */
.pop { position: fixed; z-index: 60; min-width: 13rem; padding: 6px; background: var(--surface-solid); border: var(--stroke); border-radius: var(--r); box-shadow: var(--hard-lg); animation: pop-in var(--t) var(--ease); }
.pop-item, .sheet-item { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none !important; }
.pop-item:hover, .sheet-item:hover { background: var(--surface-2); }
.pop-item .ic, .sheet-item .ic { color: var(--text-2); }
.pop-item.is-danger, .sheet-item.is-danger, .pop-item.is-danger .ic, .sheet-item.is-danger .ic { color: var(--danger); }
.sheet form { margin: 0; }
dialog.sheet { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; background: var(--surface-solid); color: var(--text); width: 18rem; box-shadow: var(--shadow); margin: auto auto 80px calc(max(0px, (100vw - var(--rail-w) - var(--col-w) - var(--side-w)) / 2) + 12px); }
dialog.sheet[open] { animation: pop-in var(--t) var(--ease); }
dialog.sheet::backdrop, dialog.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.sheet-head { display: flex; align-items: center; gap: var(--s3); padding: 8px 10px 12px; margin-bottom: 6px; }
.sheet-head span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* диалог подтверждения */
dialog.dlg { border: var(--stroke); border-radius: var(--r-lg); padding: var(--s5); background: var(--surface-solid); color: var(--text); width: min(22rem, calc(100vw - 32px)); box-shadow: var(--hard-lg); }
dialog.dlg[open] { animation: pop-in var(--t) var(--ease); }
.dlg-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 900; margin-bottom: var(--s2); }
.dlg-acts { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); }

/* тосты */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 14px; background: var(--grad); color: var(--brand-ink); font-weight: 800; border: var(--stroke); box-shadow: var(--hard); animation: toast-in .25s var(--ease); }
.toast.is-error { background: var(--danger); color: #fff; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* выбор цвета оформления */
.swatches { display: flex; gap: 10px; padding: 8px 12px 12px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 0 2px var(--surface-solid) inset; transition: transform var(--t-fast); }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.sheet-label { display: block; padding: 10px 12px 0; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }

/* плашка «сайт обновился» */
.update { position: fixed; z-index: 95; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s3); padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--surface-solid); color: var(--text); font-weight: 700; border: var(--stroke); box-shadow: var(--hard); animation: pop-in var(--t) var(--ease); white-space: nowrap; }

/* предложение установить приложение */
.install { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) var(--s4) 0; padding: var(--s3); border-radius: var(--r-lg); background: var(--surface); border: var(--stroke); box-shadow: var(--hard); }
.install > svg, .install-emoji { flex: none; }
.install-emoji { font-size: 1.8rem; line-height: 1; }
.install span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.install small { color: var(--text-2); }
.sheet-item.is-pop { color: var(--pop); }
.sheet-item.is-pop .ic { color: var(--pop); }
:root[data-theme="light"] .sheet-item.is-pop, :root[data-theme="light"] .sheet-item.is-pop .ic { color: var(--brand); }

/* «Недавно просмотренные» */
.box-head { display: flex; align-items: center; justify-content: space-between; padding-right: var(--s5); }
.box-head .box-title { padding-right: 0; }
.recent { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); color: var(--text); text-decoration: none !important; transition: background var(--t-fast); }
.recent:hover { background: var(--surface-2); }
.recent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.recent-body small { color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; }
.recent-body b { font-weight: 700; font-size: var(--fs-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recent img { flex: none; width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); }

/* «сейчас в сети» */
.live-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2s infinite; vertical-align: 1px; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.online-avs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px var(--s5) var(--s4); }
.online-avs a, .online-strip a { position: relative; border-radius: 50%; }
.online-avs a::after, .online-strip a::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.online-strip { display: none; align-items: center; gap: var(--s2); overflow-x: auto; padding: 2px 2px var(--s3); scrollbar-width: none; }
.online-strip::-webkit-scrollbar { display: none; }
.online-strip-label { flex: none; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: 700; }
.online-strip a::after { border-color: var(--bg); }
@media (max-width: 1019px) { .online-strip { display: flex; } }

/* чек-лист новичка */
.onboard { margin-bottom: var(--s3); padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); }
.onboard-head { display: flex; align-items: center; gap: var(--s2); margin: -6px -8px var(--s2) 0; }
.onboard-head b { font-family: var(--font-display); font-weight: 900; }
.onboard-head .muted { margin-right: auto; font-size: var(--fs-sm); }
.onboard-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-bottom: var(--s2); }
.onboard-bar span { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.onboard-step { display: flex; align-items: center; gap: var(--s3); padding: 10px 4px; color: var(--text); font-weight: 600; text-decoration: none !important; }
.onboard-step.is-done { color: var(--text-2); text-decoration: line-through !important; }
.onboard-step.is-done .ic { color: var(--ok); }
.onboard-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }

/* плашка «↑ N новых постов» */
.newpill { position: sticky; top: calc(var(--head-h) + 52px); z-index: 15; align-self: center; display: inline-flex; align-items: center; gap: 6px; margin: 0 auto var(--s2); padding: 6px 16px 6px 6px; border: var(--stroke); border-radius: var(--r-pill); background: var(--grad); color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: var(--hard); animation: pop-in var(--t) var(--ease); }
.newpill img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; margin-right: -12px; }
.newpill img:last-of-type { margin-right: 4px; }
.newpill span:only-child { padding-left: 10px; }

/* ---------- композер (единый для постов, ответов, групп и чатов) ---------- */
.composer { display: flex; flex-direction: column; gap: 6px; }
.cmp-ctx { display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: var(--r-sm); }
.cmp-ctx-body { flex: 1; min-width: 0; line-height: 1.3; }
.cmp-ctx-body b { display: block; color: var(--brand); font-size: var(--fs-sm); }
.cmp-ctx-body span { display: block; color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-files { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px; }
.cmp-file { position: relative; flex: none; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: var(--fs-xs); color: var(--text-2); text-align: center; padding: 4px; word-break: break-all; }
.cmp-file img, .cmp-file video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-file button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.cmp-err { color: var(--danger); font-size: var(--fs-sm); margin: 0 6px; }
.cmp-row { display: flex; align-items: flex-end; gap: 4px; padding: 5px; background: var(--surface-2); border: 2px solid transparent; border-radius: 22px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cmp-row:focus-within { border-color: var(--brand); box-shadow: var(--hard-brand); }
.composer.is-drop .cmp-row { border-color: var(--pop); border-style: dashed; }
.cmp-input { flex: 1; min-width: 0; min-height: 40px; max-height: 220px; padding: 9px 6px; border: 0; background: transparent; color: var(--text); font: inherit; line-height: 1.45; resize: none; overflow-y: auto; }
.cmp-input:focus { outline: none; }
.cmp-attach { position: relative; cursor: pointer; }
.cmp-count { align-self: center; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; padding: 0 4px; }
.cmp-count.is-warn { color: var(--danger); font-weight: 700; }
.cmp-send { flex: none; width: 40px; height: 40px; border: var(--stroke); border-radius: 13px; background: var(--grad); box-shadow: 2px 2px 0 var(--pop); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast); }
.cmp-send:hover { filter: brightness(1.1); }
.cmp-send:active { transform: translate(2px, 2px); box-shadow: none; }
.cmp-send:disabled { opacity: .45; cursor: default; }
.composer.is-empty .cmp-send { opacity: .45; }
.cmp-dock { position: sticky; bottom: 0; z-index: 10; margin: auto calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); background: var(--blur-bg); }
.cmp-card { display: flex; gap: var(--s3); padding: var(--s4); margin-bottom: var(--s3); background: var(--surface); border-radius: var(--r-lg); }
.cmp-card .composer { flex: 1; min-width: 0; }
.is-editing { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r); }

/* ---------- пост (стена) ---------- */
.feed { display: flex; flex-direction: column; gap: var(--s3); }
.post { position: relative; padding: var(--s4); background: var(--surface); border-radius: var(--r-lg); content-visibility: auto; contain-intrinsic-size: auto 320px; }
.post.is-link { cursor: pointer; }
@media (hover: hover) {
  .post.is-link { transition: background var(--t); }
  .post.is-link:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
}
.post.is-new { animation: post-new 1.8s var(--ease); }
@keyframes post-new { 0% { transform: translateY(-14px) scale(.98); opacity: 0; border-color: var(--pop); } 25% { transform: none; opacity: 1; border-color: var(--pop); } 100% { } }
.post-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: var(--s3); min-width: 0; }
.post-who { min-width: 0; line-height: 1.25; }
.post-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.post-name { min-width: 0; font-weight: 800; font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; }
.post-name:hover { text-decoration: underline !important; }
.post-line .ubadge { flex: none; display: inline-flex; align-items: center; }
.post-sub { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; }
.post-sub .u { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.post-sub > :not(.u) { flex: none; }
.post-sub a { color: inherit; }
.post-more { margin-right: -8px; }
.post-reply-to { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--s2); font-size: var(--fs-sm); color: var(--text-2); }
.post-text { margin-top: var(--s3); overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.5; }
.post-text:empty { display: none; }
.post-docs { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.post .media { margin-top: var(--s3); }
/* действия под постом: ❤ 💬 ✈ слева рядом, просмотры справа (как в Instagram) */
.post-acts { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: none !important; -webkit-tap-highlight-color: transparent; transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.act .n { min-width: 1ch; }
@media (hover: hover) { .act:hover { background: var(--surface-3); } .act-like:hover { color: var(--like); } }
.act-like.is-on { background: color-mix(in srgb, var(--like) 16%, var(--surface-2)); }
@media (max-width: 400px) { .act-label { display: none; } .act { padding: 0 12px; } }
.act:active { transform: scale(.9); }
.act-like.is-on { color: var(--like); }
.act-like .i-on { display: none; }
.act-like.is-on .i-on { display: block; }
.act-like.is-on .i-off { display: none; }
.act-like.is-pop .ic { animation: like-pop .45s var(--ease); }
.act-repost.is-on { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--surface-2)); }
.act-repost.is-pop .ic { animation: spin-pop .5s var(--ease); }
@keyframes spin-pop { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.3); } 100% { transform: rotate(360deg) scale(1); } }
.post-repost { display: flex; align-items: center; gap: 6px; margin: -4px 0 var(--s2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 700; }
.post-repost a { color: inherit; }
.post-repost .ic { color: var(--ok); }
.act-views { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 2px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes like-pop { 0% { transform: scale(1); } 30% { transform: scale(1.45); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
.burst { position: absolute; z-index: 5; pointer-events: none; color: var(--like); transform: translate(-50%, -50%); animation: burst .8s var(--ease) forwards; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -90%) scale(.9); } }

.post-thread { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.thread-list { display: flex; flex-direction: column; gap: var(--s2); }
.post-thread .post, .post.is-reply { background: var(--surface-2); border-radius: var(--r); padding: var(--s3); content-visibility: visible; }
.post-thread .composer { padding-top: var(--s3); }
.post.is-reply .post-text { font-size: var(--fs); }
.post-detail .post-text { font-size: 1.2rem; }
.section-head { font-family: var(--font-display); font-size: 1rem; font-weight: 900; padding: var(--s5) var(--s2) var(--s2); margin: 0; }

/* документ .md в посте */
.doc { border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.doc summary { display: flex; align-items: center; gap: var(--s2); cursor: pointer; padding: 10px 14px; font-weight: 700; list-style: none; overflow-wrap: anywhere; }
.doc summary::-webkit-details-marker { display: none; }
.doc[open] summary { background: var(--surface-3); }
.doc-body { padding: 4px 16px 14px; max-height: 32rem; overflow: auto; overflow-wrap: anywhere; line-height: 1.6; }

/* медиа-сетка (как в Twitter: 1–4 вложения) */
.media { display: grid; gap: 2px; border-radius: var(--r); overflow: hidden; max-width: 100%; background: var(--surface-3); }
.media > * { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--surface-3); min-height: 0; }
.media .gifv { cursor: zoom-in; }
/* видеоплеер */
.vp { position: relative; overflow: hidden; background: #000; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.vp::before { content: ""; position: absolute; inset: -24px; background: var(--poster, none) center / cover; filter: blur(22px) brightness(.55) saturate(1.2); }
.vp video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.vp-big, .vp-bar { z-index: 2; }
.vp:fullscreen video { object-fit: contain; }
.vp-big { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; background: rgba(13, 14, 18, .55); color: #fff; display: grid; place-items: center; padding: 0 0 0 4px; pointer-events: none; transition: opacity var(--t), transform var(--t); }
.vp.is-playing .vp-big { opacity: 0; transform: scale(.8); }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 4px; padding: 18px 6px 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); opacity: 0; transition: opacity var(--t); }
.vp.is-started .vp-bar { opacity: 1; }
.vp.is-playing.is-idle .vp-bar { opacity: 0; }
.vp-btn { flex: none; width: 40px; height: 40px; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.vp-track { flex: 1; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-track::before { content: ""; position: absolute; }
.vp-fill { position: relative; display: block; width: calc(var(--p, 0) * 100%); height: 4px; border-radius: 4px; background: #fff; }
.vp-fill::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.vp-track { position: relative; }
.vp-track::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, .28); z-index: -1; }
.vp-time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; padding: 0 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.media img { cursor: zoom-in; }

/* размытие 18+ и спойлеров (как в Telegram) */
.car-slide.is-blur:not(.is-shown) > img, .car-slide.is-blur:not(.is-shown) > video, .car-slide.is-blur:not(.is-shown) > .vp { filter: blur(38px) saturate(1.3); transform: scale(1.15); pointer-events: none; }
.car-slide.is-blur:not(.is-shown)::before { filter: blur(40px) brightness(.4); }
.car-slide.is-shown > img, .car-slide.is-shown > video, .car-slide.is-shown > .vp { transition: filter .35s var(--ease), transform .35s var(--ease); }
.blur-cover { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; padding: var(--s4); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .08) 0 1px, transparent 1.5px) 0 0 / 14px 14px, rgba(10, 10, 14, .25); color: #fff; font: inherit; cursor: pointer; text-align: center; animation: sparkle 3s linear infinite; }
@keyframes sparkle { to { background-position: 14px 14px, 0 0; } }
.blur-cover b { padding: 6px 14px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .55); font-size: var(--fs-md); font-weight: 900; letter-spacing: .02em; }
.blur-cover span { font-size: var(--fs-sm); font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.car-slide.is-gone { display: grid; place-items: center; background: var(--surface-3); }
.gone { padding: var(--s4); color: var(--text-2); font-weight: 700; text-align: center; }
.cmp-flags { display: flex; gap: var(--s2); padding: 0 4px; }
.cmp-flag { cursor: pointer; }
.cmp-flag input { position: absolute; opacity: 0; pointer-events: none; }
.cmp-flag span { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 700; transition: background var(--t-fast); }
.cmp-flag input:checked + span { background: var(--grad); color: #fff; }
.cmp-flag input:focus-visible + span { outline: 2px solid var(--brand); }
.rules h2 { font-size: 1.05rem; margin-top: var(--s5); }
.rules ul { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; }

.flag-wrap { position: relative; }
.flag-wrap.is-blur > :not(.flag-cover) { filter: blur(16px); pointer-events: none; user-select: none; }
.flag-wrap.is-blur { min-height: 120px; border-radius: var(--r); overflow: hidden; }
.flag-cover { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; padding: var(--s4); background: rgba(10, 10, 14, .35); color: #fff; font: inherit; cursor: pointer; text-align: center; border-radius: var(--r); }
.flag-cover b { padding: 6px 14px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .6); font-weight: 900; }
.flag-cover span { font-size: var(--fs-sm); font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }

/* пометка бота */
.chip-bot { margin-left: 4px; padding: 1px 8px; background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); color: var(--brand); border-color: transparent; font-size: 11px; white-space: nowrap; }
/* кнопки системного бота */
.sysbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.sysbtn { flex: 1 1 auto; padding: 8px 12px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--brand) 18%, var(--surface-3)); color: var(--text); font: inherit; font-weight: 800; font-size: var(--fs-sm); text-align: center; cursor: pointer; text-decoration: none !important; }
.sysbtn:hover { background: color-mix(in srgb, var(--brand) 30%, var(--surface-3)); }
.sysbtn:disabled { opacity: .6; cursor: default; }
/* пересланный пост */
.fwd { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; padding: 8px 10px; border-left: 3px solid var(--ok); border-radius: 10px; background: color-mix(in srgb, var(--text) 6%, transparent); color: inherit; text-decoration: none !important; }
.fwd-head { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 800; color: var(--ok); }
.fwd-body { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.fwd-text { font-size: var(--fs-sm); opacity: .9; }
.fwd img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; }
.fwd-dlg { width: min(26rem, calc(100vw - 24px)); }
.fwd-pad { padding: 0 var(--s5) var(--s3); }
.fwd-list { max-height: 60vh; overflow-y: auto; padding-bottom: var(--s3); }
.fwd-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
/* опрос */
.poll { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s3); }
.poll-opt { padding: 10px 14px; border: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); border-radius: 12px; background: none; color: var(--brand); font: inherit; font-weight: 800; text-align: left; cursor: pointer; transition: background var(--t-fast); }
.poll-opt:hover { background: var(--brand-soft); }
.poll-row { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); overflow: hidden; font-weight: 700; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand) 26%, transparent); border-radius: 12px; transition: width .5s var(--ease); }
.poll-row.is-mine .poll-bar { background: color-mix(in srgb, var(--brand) 45%, transparent); }
.poll-text { position: relative; flex: 1; display: flex; align-items: center; gap: 6px; }
.poll-row b { position: relative; font-variant-numeric: tabular-nums; }
.poll-total { color: var(--text-2); }
.cmp-poll { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cmp-poll .input { padding: 9px 12px; }
.cmp-pollbtn.is-on { color: var(--brand); background: var(--brand-soft); }
/* группа в ленте */
.groupcard { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface)); color: var(--text); text-decoration: none !important; }
.groupcard-head { display: flex; align-items: center; gap: var(--s3); }
.groupcard-kicker { color: var(--brand); font-weight: 800; font-size: var(--fs-xs); }
.groupcard-msg { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groupcard-msg b { color: var(--text); }
.groupcard-btn { align-self: flex-start; }
/* рейтинг и серия */
.leader-n { width: 18px; font-family: var(--font-display); font-weight: 900; color: var(--text-2); text-align: center; }
.leader:nth-child(2) .leader-n { color: #facc15; }
.prof-streak b { color: #f97316; }
.appeal { display: flex; flex-direction: column; gap: var(--s2); }
.appeal-img { max-width: 100%; max-height: 360px; border-radius: var(--r-sm); margin-top: 6px; }

/* превью ссылки */
.lcard { display: flex; margin-top: var(--s3); border-radius: var(--r); overflow: hidden; background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: background var(--t-fast); }
a.lcard:hover { background: var(--surface-3); }
.lcard > img { flex: none; width: 120px; min-height: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-3); }
.lcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: var(--s3) var(--s4); line-height: 1.3; color: var(--text); text-decoration: none !important; }
.lcard-body small { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; text-transform: lowercase; }
.lcard-body b { font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lcard-body span { color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lcard-yt { flex-direction: column; }
.lcard-yt-play, .lcard-yt-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #000; cursor: pointer; }
.lcard-yt-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcard-yt-btn { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 14px; background: #ff0033; color: #fff; display: grid; place-items: center; padding-left: 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); transition: transform var(--t-fast); }
.lcard-yt-play:hover .lcard-yt-btn { transform: scale(1.08); }
.bubble .lcard { margin: 6px -4px 2px; }
@media (max-width: 400px) { .lcard > img { width: 88px; } }

/* ---------- чат (группы и личные сообщения) ---------- */
.chat { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--s2); }
.msg { display: flex; gap: var(--s2); align-items: flex-end; max-width: 100%; }
.is-ready .msg { animation: msg-in .18s var(--ease); } /* при открытии страницы сообщения не анимируются, только новые */
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.own { justify-content: flex-end; }
.msg + .msg { margin-top: 2px; }
.msg .av-link { align-self: flex-end; }
.msg-more { width: 30px; height: 30px; opacity: 0; transition: opacity var(--t-fast), background var(--t-fast); align-self: center; }
.msg:hover .msg-more, .msg-more:focus-visible { opacity: 1; }
.own .msg-more { order: -1; }
@media (hover: none) { .msg-more { display: none; } }
.msg { transition: transform .18s var(--ease); touch-action: pan-y; }
.time .edited { opacity: .8; }
.is-chat main { padding-bottom: 0; }
.is-chat .chat { flex: 1; }
.bubble { position: relative; background: var(--bubble-in); border-radius: 18px 18px 18px 6px; padding: 6px 12px 5px; max-width: min(34rem, calc(100% - 48px)); min-width: 0; overflow-wrap: anywhere; }
.own .bubble { background: var(--bubble-out); color: var(--bubble-out-text); border-color: transparent; box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent); border-radius: 18px 18px 6px 18px; max-width: min(34rem, 88%); }
.aline { display: flex; align-items: center; min-width: 0; font-size: var(--fs-sm); }
.aline .ubadge { flex: none; display: inline-flex; align-items: center; }
.author { display: block; font-weight: 800; text-decoration: none !important; color: hsl(calc(var(--h, 1) * 47) 75% 68%); }
:root[data-theme="light"] .author { color: hsl(calc(var(--h, 1) * 47) 65% 38%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .author { color: hsl(calc(var(--h, 1) * 47) 65% 38%); } }
.own .aline, .own .author { display: none; }
.text { margin: 2px 0 0; }
.time { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.own .time { color: var(--bubble-out-meta); }
.own .text a { color: inherit; text-decoration: underline; }
.ticks { letter-spacing: -.2em; }
.ticks.rd { color: var(--pop); }
:root[data-theme="light"] .own .ticks.rd { color: var(--brand); }
.bubble .media { margin: 4px -8px 2px; border-radius: 14px; }
.bubble:has(.carousel) { width: min(22rem, 78vw); } /* у пузыря с фото/видео — нормальная ширина, иначе плеер схлопывается */
.quote { display: block; border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 6px; padding: 3px 8px; margin: 4px 0; color: inherit; text-decoration: none !important; font-size: var(--fs-sm); }
.quote b { display: block; color: var(--brand); font-size: var(--fs-xs); }
.own .quote b { color: inherit; }
.quote span { display: block; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.flash .bubble { animation: flash 1.4s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--pop); } 100% { box-shadow: none; } }
.sysmsg { align-self: center; margin: var(--s2) 0; padding: 3px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); text-align: center; max-width: 90%; }
.sysmsg a { color: inherit; font-weight: 700; }
.older { text-align: center; margin: 0 0 var(--s3); }

/* шапка чата, панель «о группе», заметки */
.chathead { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); padding: 4px 8px; margin-left: -8px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); text-decoration: none !important; }
.chathead:hover { background: var(--surface-2); }
.chathead-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.chathead-txt b { display: flex; align-items: center; gap: 4px; font-size: var(--fs-md); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chathead-txt small { color: var(--text-2); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.on { color: var(--ok); font-weight: 700; }
.chat-note { text-align: center; color: var(--text-2); margin: auto 0 0; padding: var(--s4); }
.typing { margin: 0 0 6px 14px; font-size: var(--fs-sm); color: var(--brand); font-weight: 700; }
.dots { display: inline-flex; gap: 3px; margin-left: 4px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
dialog.panel { border: var(--stroke); border-radius: var(--r-lg); padding: 0; background: var(--surface-solid); color: var(--text); width: min(28rem, calc(100vw - 24px)); max-height: 88vh; overflow: auto; box-shadow: var(--hard-lg); }
dialog.panel[open] { animation: pop-in var(--t) var(--ease); }
dialog.panel::backdrop { background: rgba(0, 0, 0, .5); }
.panel-x { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0, 0, 0, .45); color: #fff; }
.panel .prof-banner { aspect-ratio: 3 / 1; }
.panel .prof-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel-body { padding: 0 var(--s5) var(--s3); }
.panel-av { margin-top: -36px; }
.panel-av .av { border: 4px solid var(--surface-solid); box-shadow: 3px 3px 0 var(--pop); }
.panel-title { margin: var(--s2) 0 2px; overflow-wrap: anywhere; }
.panel-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.panel-acts form { margin: 0; }
.panel-pad { padding: 0 var(--s5); }
.panel-list { padding-bottom: var(--s3); }
.copyline { display: flex; align-items: center; gap: var(--s2); width: 100%; margin: var(--s2) 0; padding: 10px 14px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.copyline span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copyline b { color: var(--brand); font-size: var(--fs-sm); }
.copyline:hover { border-color: var(--brand); }
.row-chat.is-unread .row-title { color: var(--text); }
.row-chat.is-unread .row-sub { color: var(--text); font-weight: 600; }
.row-sub .you { color: var(--brand); font-weight: 700; }

/* ---------- markdown в тексте ---------- */
.text h1, .text h2, .text h3, .text h4, .text h5, .text h6, .post-text h1, .post-text h2, .post-text h3, .post-text h4, .post-text h5, .post-text h6 { margin: .5em 0 .25em; font-size: 1.1em; font-weight: 800; }
.text p, .post-text p { margin: 0; }
.text p + p, .post-text p + p { margin-top: .5em; }
.text ul, .text ol, .post-text ul, .post-text ol { margin: .3em 0; padding-left: 1.4em; }
.text blockquote, .post-text blockquote, .doc-body blockquote { margin: .3em 0; padding-left: .7em; border-left: 3px solid color-mix(in srgb, currentColor 35%, transparent); opacity: .9; }
.text code, .post-text code, .doc-body code { background: color-mix(in srgb, currentColor 12%, transparent); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.text pre, .post-text pre, .doc-body pre { background: color-mix(in srgb, currentColor 10%, transparent); padding: 10px 12px; border-radius: var(--r-sm); overflow-x: auto; margin: .4em 0; }
.text pre code, .post-text pre code, .doc-body pre code { background: none; padding: 0; }
.text table, .post-text table, .doc-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: .4em 0; }
.text th, .text td, .post-text th, .post-text td, .doc-body th, .doc-body td { border: 1px solid color-mix(in srgb, currentColor 25%, transparent); padding: 3px 9px; }
.text hr, .post-text hr, .doc-body hr { border: 0; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); margin: .6em 0; }
.text > :first-child, .post-text > :first-child { margin-top: 0; }

/* ---------- значки пользователей ---------- */
.ubadge { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ubadge img { filter: drop-shadow(0 0 1.5px color-mix(in srgb, var(--text) 55%, transparent)) drop-shadow(0 0 4px color-mix(in srgb, var(--text) 20%, transparent)); }
#ubback { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .5); }
#ubpop { position: fixed; z-index: 1000; width: min(380px, calc(100vw - 32px)); padding: 24px 22px 20px; border-radius: var(--r-lg); background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; animation: pop-in var(--t) var(--ease); }
#ubpop .ubi { width: 7rem; height: 7rem; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 4.5rem; border-radius: var(--r-lg); background: var(--surface-2); }
#ubpop .ubi img { width: 100%; height: 100%; object-fit: contain; padding: 10px; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .45)); }
#ubpop .ubn { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; }
#ubpop .ubd { margin: 12px 0 0; color: var(--text-2); white-space: pre-wrap; }
#ubpop .ubs { margin: 12px 0 0; font-size: var(--fs-xs); color: var(--text-2); }

/* ---------- просмотр фото: полноэкранная карусель ---------- */
dialog.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: rgba(0, 0, 0, .96); color: #fff; overflow: hidden; }
dialog.viewer[open] { display: block; animation: fade-in .15s; }
@keyframes fade-in { from { opacity: 0; } }
dialog.viewer::backdrop { background: #000; }
.vw-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; transition: transform .2s var(--ease), opacity .2s; }
.vw-track::-webkit-scrollbar { display: none; }
.vw-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; padding: 56px 0 64px; }
.vw-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: transform .25s var(--ease); cursor: zoom-in; }
.vw-slide img.is-zoom { transform: scale(2.2); cursor: zoom-out; }
.vwx, .vwprev, .vwnext { position: absolute; z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background var(--t-fast); }
.vwx:hover, .vwprev:hover, .vwnext:hover { background: rgba(255, 255, 255, .28); }
.vwx { top: max(10px, env(safe-area-inset-top, 0px)); right: 10px; }
.vwprev { left: 14px; top: 50%; transform: translateY(-50%); }
.vwnext { right: 14px; top: 50%; transform: translateY(-50%) scaleX(-1); }
.vwcnt { position: absolute; z-index: 2; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 12px); left: 16px; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.vw-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.vw-dots i, .car-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: width var(--t), background var(--t); }
.vw-dots i.on, .car-dots i.on { width: 18px; border-radius: 3px; background: #fff; }
@media (hover: none) { .vwprev, .vwnext { display: none; } }

/* ---------- карусель в посте ---------- */
.carousel { position: relative; margin-top: var(--s3); border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: var(--ar, 1); max-height: min(36rem, 75vh); width: 100%; }
.carousel .car-slide > .vp { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; }
.post .carousel { margin-top: var(--s3); }
.car-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; background: #000; }
.car-slide::before { content: ""; position: absolute; inset: -30px; background: var(--bg, none) center / cover; filter: blur(26px) brightness(.5) saturate(1.2); }
.car-slide > img, .car-slide > video { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.car-slide > .vp { width: 100%; height: 100%; }
.car-count { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .55); color: #fff; font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.car-count b { font-weight: 800; }
.car-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.car-btn { position: absolute; z-index: 2; top: 50%; width: 38px; height: 38px; margin-top: -19px; border: 0; border-radius: 50%; background: rgba(20, 20, 24, .72); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; opacity: 0; transition: opacity var(--t); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.car-prev { left: 10px; }
.car-next { right: 10px; transform: scaleX(-1); }
.car-btn:not([hidden]) { opacity: 1; }
.car-btn:hover { background: rgba(20, 20, 24, .9); }
.carousel.is-single .car-track { overflow: hidden; }
@media (hover: none) { .car-btn { display: none; } }
.bubble .carousel { margin: 4px -8px 2px; border-radius: 14px; }

/* ---------- 5. Страницы ---------- */

/* профиль пользователя */
.profile { position: relative; margin-bottom: var(--s4); padding: 0; overflow: hidden; color: var(--fg); background-color: var(--card); border-radius: 26px; --pat: color-mix(in srgb, var(--fg) 9%, transparent); }
.prof-banner { aspect-ratio: 3 / 1; background: radial-gradient(60% 120% at 20% 0%, color-mix(in srgb, var(--pop) 55%, transparent), transparent 60%), var(--grad); }
.prof-banner-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.prof-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); padding: 0 var(--s5); margin-top: -64px; position: relative; }
.prof-av { padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; flex: none; transition: transform var(--t) var(--ease); }
.prof-av:hover { transform: rotate(-4deg) scale(1.03); }
.prof-av .av-xl { width: 128px; height: 128px; font-size: 52px; border: 5px solid var(--card); box-shadow: 4px 4px 0 var(--pop); }
.prof-actions { display: flex; align-items: center; gap: var(--s2); padding-bottom: 6px; flex-wrap: wrap; justify-content: flex-end; }
.prof-share { }
.prof-info { padding: var(--s3) var(--s5) var(--s5); }
.prof-name { margin: 0; font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.1; color: var(--pname, var(--fg)); overflow-wrap: anywhere; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.prof-name .ubadge { font-size: 1.4rem; display: inline-flex; }
.prof-handle { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-top: 6px; color: var(--muted); font-weight: 600; }
.prof-bio { margin: var(--s3) 0 0; font-size: var(--fs-md); white-space: pre-line; }
.prof-blocked { margin: var(--s3) 0 0; color: var(--danger); font-weight: 800; }
.prof-meta { display: flex; align-items: center; gap: 6px; margin: var(--s3) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.prof-stats { display: flex; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }
.prof-stat { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 14px; background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.prof-stat b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; color: var(--fg); }
/* кнопки внутри оформленного профиля берут его акцент */
.profile[style*="--accent"] .btn-primary { background: var(--accent); color: var(--accent-fg, #fff); }

/* узоры фона и рамки аватара (Оформление профиля) */
.profile.pp-dots { background-image: radial-gradient(var(--pat) 1.5px, transparent 1.6px); background-size: 18px 18px; }
.profile.pp-grid { background-image: linear-gradient(var(--pat) 1px, transparent 1px), linear-gradient(90deg, var(--pat) 1px, transparent 1px); background-size: 24px 24px; }
.profile.pp-diag { background-image: repeating-linear-gradient(45deg, var(--pat) 0 2px, transparent 2px 14px); }
.profile.pp-arcs { background-image: repeating-radial-gradient(circle at 50% 100%, transparent 0 14px, var(--pat) 14px 16px); background-size: 48px 24px; }
.profile.pp-checker { background-image: conic-gradient(var(--pat) 25%, transparent 0 50%, var(--pat) 0 75%, transparent 0); background-size: 28px 28px; }
.profile.pp-stars { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 8l2.4 6.2 6.6.4-5.1 4.2 1.7 6.4L20 21.5l-5.6 3.7 1.7-6.4-5.1-4.2 6.6-.4z' fill='%23999' fill-opacity='.22'/%3E%3C/svg%3E"); background-size: 40px 40px; }
.profile.pf-ring .av-xl { box-shadow: 0 0 0 4px var(--accent); }
.profile.pf-double .av-xl { box-shadow: 0 0 0 4px var(--card), 0 0 0 8px var(--accent); }
.profile.pf-duo .av-xl { box-shadow: 0 0 0 4px var(--accent), 0 0 0 8px var(--pname, var(--fg)); }
.profile.pf-glow .av-xl { box-shadow: 0 0 22px 6px var(--accent); }
.profile.pf-dashed .av-xl { outline: 3px dashed var(--accent); outline-offset: 5px; }

/* панель «Оформление профиля» */
.pst-title { font-size: 1.1rem; margin-bottom: 4px; }
.pst .list-title { display: block; margin: var(--s4) 0 var(--s2); }
.pst-presets, .pst-opts, .pst-colors { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pst-preset { padding: 8px 14px; border-radius: 12px; border: 2px solid var(--b); background: var(--a); color: var(--c); font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 var(--b); transition: transform var(--t-fast); }
.pst-preset:hover { transform: translate(-1px, -1px) rotate(-2deg); }
.pst-color { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-weight: 700; }
.pst-color input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.pst-color input[type=color] { width: 32px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.pst-opt { cursor: pointer; }
.pst-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pst-opt span { display: inline-block; padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 700; font-size: var(--fs-sm); transition: background var(--t-fast); }
.pst-opt input:checked + span { background: var(--grad); color: #fff; border-color: var(--ink); box-shadow: 2px 2px 0 var(--pop); }
.pst-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pst-btns { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s5); }

/* сетка «Медиа» */
.media.gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r-lg); }
.media.gallery > * { aspect-ratio: 1; }

/* формы с картинками: шапка и аватар выбираются кликом */
.formcard { padding: 0; }
.pick { position: relative; display: block; cursor: pointer; }
.pick:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.prof-banner.pick { display: block; }
.prof-banner.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-hint { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .55); color: #fff; font-size: var(--fs-xs); font-weight: 700; pointer-events: none; }
.pick-av { width: fit-content; border-radius: 50%; }
.pick-av .av { border: 5px solid var(--card); box-shadow: 4px 4px 0 var(--pop); }
.pick-av .av img { position: absolute; inset: 0; }
.pick-av .av { position: relative; }
.prefixed { display: flex; align-items: center; gap: 0; border: 2px solid transparent; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.prefixed span { padding-left: 14px; color: var(--text-2); white-space: nowrap; }
.prefixed input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 2px !important; }
.prefixed:focus-within { border-color: var(--brand); box-shadow: var(--hard-brand); }

/* карточка группы в каталоге */
.gcard { display: block; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); color: var(--text); text-decoration: none !important; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.gcard:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.gcard-cover { display: block; width: 100%; height: 110px; object-fit: cover; background: var(--surface-3); }
.gcard-main { display: flex; gap: var(--s3); padding: var(--s4); align-items: flex-start; }
.gcard-cover + .gcard-main .av { margin-top: -40px; border: 4px solid var(--surface-solid); }
.gcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gcard-title { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; overflow-wrap: anywhere; }
.gcard-desc { color: var(--text-2); overflow-wrap: anywhere; }
.gcard-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; color: var(--text-2); font-size: var(--fs-xs); }

/* поиск */
.search-page { margin-bottom: var(--s4); }
.hit { align-items: flex-start; }
.hit-text { display: block; margin: 2px 0; color: var(--text); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.pager { display: flex; gap: var(--s4); align-items: center; justify-content: center; margin: var(--s4) 0; }

/* вход и регистрация */
.auth { max-width: 26rem; width: 100%; margin: var(--s5) auto; padding: var(--s6) var(--s5); box-shadow: var(--hard-lg); border: var(--stroke); }
.auth-logo { display: block; margin: 0 auto var(--s3); filter: drop-shadow(3px 3px 0 var(--pop)); }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth .sub { text-align: center; color: var(--text-2); margin: 0 0 var(--s5); }
.auth .btn { width: 100%; }
.auth .alt { text-align: center; margin: var(--s4) 0 0; color: var(--text-2); }

/* приветствие для гостей */
.hero { text-align: center; padding: var(--s6) var(--s5); margin-bottom: var(--s4); border-radius: 26px; border: var(--stroke); box-shadow: var(--hard-lg); background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--brand) 45%, transparent), transparent 65%), var(--surface); }
.hero-compact { padding: var(--s5) var(--s4); }
.hero-logo { display: block; margin: 0 auto var(--s3); filter: drop-shadow(3px 3px 0 var(--pop)); animation: wobble 3s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }
.hero h1 { font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1.1; margin-bottom: var(--s3); }
.hero .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .hl i { font-style: normal; color: var(--pop); -webkit-text-fill-color: var(--pop); }
.hero .lead { color: var(--text-2); font-size: var(--fs-md); max-width: 30rem; margin: 0 auto var(--s5); }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.feat { padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); }
.feat-ico { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.feat h2 { font-size: 1rem; margin-bottom: 4px; }
.feat p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }

/* инструкция установки */
.steps ol { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: var(--s2); }
.steps li::marker { color: var(--brand); font-weight: 900; }

/* мои фото в настройках */
.phgrid { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s4); }
.phitem { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.ph-av { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; cursor: zoom-in; border: 2px solid var(--line); }
.ph-bn { width: 180px; height: 60px; border-radius: var(--r-sm); object-fit: cover; cursor: zoom-in; border: 2px solid var(--line); }

/* страницы ошибок */
.errpage { text-align: center; margin: auto; padding: var(--s6) var(--s4); }
.err-ico { font-size: 3.5rem; display: block; animation: wobble 3s ease-in-out infinite; }
.err-code { font-family: var(--font-display); font-size: 4.5rem; font-weight: 900; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.errpage h1 { font-size: 1.3rem; margin: var(--s3) 0 var(--s2); }
.errpage .btn { margin-top: var(--s3); }

/* админ-панель */
.pn { padding:1rem; margin-bottom:1rem; }
.pnwrap { overflow-x:auto; }
.pntable { width:100%; border-collapse:collapse; }
.pntable th, .pntable td { text-align:left; padding:.45rem .5rem; border-bottom:1px solid color-mix(in srgb, currentColor 12%, transparent); vertical-align:middle; }
.pnbad { color:#f87171; }
.pnrow { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; margin:.5rem 0; }
.pn input:not([type=color]), .pn select { padding:.4rem .6rem; border-radius:8px; border:1px solid color-mix(in srgb, currentColor 25%, transparent); background:color-mix(in srgb, currentColor 8%, transparent); color:inherit; }
.pnchip { display:inline-flex; align-items:center; gap:.3rem; margin:0; padding:.2rem .3rem .2rem .7rem; border-radius:999px; border:1px solid var(--bc, currentColor); }
.pnstats { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:.75rem; }
.pnstat { padding:.8rem; }
.pnnum { font-size:1.6rem; font-weight:700; }
.pnh { font-size:1rem; margin:1.2rem 0 .6rem; }

/* ---------- 6. Адаптив ---------- */
@media (min-width: 1500px) { :root { --rail-w: 280px; --col-w: 760px; --side-w: 380px; } .app { gap: var(--s6); } }
@media (max-width: 1239px) {
  :root { --rail-w: 88px; --side-w: 300px; }
  .rail { align-items: center; padding-inline: var(--s2); }
  .rail-link span, .rail-me-txt, .rail-me > .ic, .rail-post span { display: none; }
  .rail-brand .logo-word { display: none; }
  .rail-post { width: 52px; height: 52px; padding: 0; }
  .rail-link { padding: 12px; }
  .rail-me { width: auto; padding: 6px; }
}
@media (max-width: 1019px) {
  .side { display: none; }
  .col { max-width: 640px; }
}
@media (min-width: 700px) {
  .m-only { display: none !important; }
}
@media (max-width: 699px) {
  :root { --head-h: 52px; --tab-h: 60px; }
  .rail { display: none; }
  .col { border: 0; max-width: none; }
  main { padding: var(--s3) var(--s3) calc(var(--tab-h) + var(--s4) + env(safe-area-inset-bottom, 0px)); }
  .ph-bar { padding: 6px var(--s3); }
  .ph-brand { font-size: 1.35rem; }
  .ph-main:has(.ph-title:not(:empty)) .ph-brand { display: none; }
  .pagehead:has(.ph-title:empty):not(:has(.ph-tabs)) { display: block; }
  .ph-tabs { margin-inline: var(--s3); }
  .post { padding: var(--s3) var(--s3) var(--s1); border-radius: var(--r); }
  .post-text { font-size: 1rem; }
  .feed { gap: var(--s2); }
  .ph-tabs a { padding: 6px var(--s2); font-size: var(--fs-sm); }
  .ph-tabs { margin-bottom: var(--s2); }
  .cmp-card { padding: var(--s3); }
  .cmp-dock { margin: auto calc(-1 * var(--s3)) calc(-1 * var(--tab-h) - var(--s4) - env(safe-area-inset-bottom, 0px)); padding-inline: var(--s3); }
  .card { padding: var(--s4); border-radius: var(--r); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--blur-bg); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); font-size: 10.5px; font-weight: 700; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
  .tab:active .ic { transform: scale(.88); }
  .tab .ic { transition: transform var(--t-fast); }
  .tab.is-active { color: var(--text); }
  .tab.is-active .ic { color: var(--brand); }
  .tab .cnt { position: absolute; top: 4px; left: calc(50% + 4px); }

  .tab-post .ic { width: 52px; height: 36px; padding: 6px 14px; border-radius: 12px; background: var(--pop); color: var(--pop-ink); border: var(--stroke); box-shadow: 2px 2px 0 var(--brand); }
  .tab-post span { display: none; }
  /* на экранах переписки нижние вкладки скрываются, как в Telegram */
  body:has(.cmp-dock) .tabbar, body.is-chat .tabbar { display: none; }
  body:has(.cmp-dock) main, body.is-chat main { padding-bottom: var(--s3); }
  body:has(.cmp-dock) .cmp-dock { margin-bottom: calc(-1 * var(--s3)); }
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  .av-xl { width: 92px; height: 92px; font-size: 36px; }
  .prof-top { padding: 0 var(--s4); margin-top: -48px; }
  .prof-av .av-xl { width: 96px; height: 96px; font-size: 40px; border-width: 4px; }
  .prof-info { padding: var(--s3) var(--s4) var(--s4); }
  .prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .prof-stat { flex-direction: column; align-items: flex-start; gap: 0; }
  .profile { border-radius: var(--r-lg); }
}

/* переключение аккаунтов */
.acct-item .av { flex: none; }
.acct-item small { font-weight: 500; }
.sheet-sep { border: 0; height: 6px; margin: 2px 0; }

/* правая колонка: плитки не сжимаются (раньше обрезались), колонка прокручивается; длинные списки — со своей прокруткой */
.side > * { flex-shrink: 0; }
.side { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; overscroll-behavior: contain; }
.side::-webkit-scrollbar { width: 6px; } .side::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
.side .recent-list { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.side .online-avs { max-height: 132px; overflow-y: auto; }

/* значки и достижения (профиль → Значки) */
.bhint { margin: 0 var(--s4) var(--s3); font-size: var(--fs-sm); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); padding: 0 var(--s4) var(--s5); }
.btile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s4) var(--s3); border-radius: var(--r-lg); background: var(--card); text-align: center; border: 2px solid transparent; }
.btile.is-worn { border-color: var(--brand); box-shadow: var(--hard-brand); }
.btile.is-locked { opacity: .78; }
.btile.is-locked .btile-ic { filter: grayscale(1); opacity: .55; }
.btile-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); font-size: 2rem; line-height: 1; }
.btile-ic img { max-width: 52px; max-height: 52px; width: auto; height: auto; }
.btile-name { font-weight: 800; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.btile-cond { color: var(--text-2); font-size: var(--fs-xs); line-height: 1.3; }
.btile-cnt { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; }
.btile form { margin-top: auto; }
.bbar { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bbar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
@media (max-width: 420px) { .bgrid { grid-template-columns: repeat(2, 1fr); } }

/* гости профиля */
.guests { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s3); margin-top: var(--s3); padding: 10px 12px; border-radius: var(--r-md, 14px); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.guests-title { font-weight: 800; font-size: var(--fs-sm); }
.guests-new { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--grad); color: var(--brand-ink); animation: guest-pulse 1.6s ease-in-out 3; }
.guests-avs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; max-height: 80px; overflow-y: auto; }
.guest { border-radius: 50%; animation: guest-in .45s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.guest.is-new .av { box-shadow: 0 0 0 2px var(--brand); }
.guests-note { flex: 1 1 100%; font-size: var(--fs-xs); }
@keyframes guest-in { from { opacity: 0; transform: translateY(8px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes guest-pulse { 50% { transform: scale(1.18); } }
/* живая плашка «к вам заглянули» */
.guest-pop { position: fixed; z-index: 95; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(92vw, 440px); padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--surface-solid, var(--card)); color: var(--text); border: var(--stroke); box-shadow: var(--hard); font-weight: 700; font-size: var(--fs-sm); text-decoration: none !important; animation: gpop-in .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.guest-pop.is-out { opacity: 0; transform: translate(-50%, -16px); transition: opacity .35s, transform .35s; }
.guest-avs { display: flex; flex: none; }
.guest-avs .av { border: 2px solid var(--surface-solid, var(--card)); animation: gpop-av .6s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(.15s + var(--i) * 90ms); }
.guest-avs .av + .av { margin-left: -10px; }
.guest-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes gpop-in { from { opacity: 0; transform: translate(-50%, -30px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes gpop-av { from { opacity: 0; transform: scale(0) rotate(-30deg); } to { opacity: 1; transform: none; } }
/* почётные статусы за популярность */
.chip-honor { font-weight: 800; }
.honor-noticed { background: color-mix(in srgb, #0ea5e9 22%, transparent); }
.honor-popular { background: linear-gradient(90deg, #f59e0b, #facc15); color: #1a1200; }
.honor-star { background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6, #f59e0b); background-size: 300% 100%; color: #fff; animation: honor-shift 4s linear infinite; }
.profile.is-famous .prof-av { position: relative; isolation: isolate; }
.profile.is-famous .prof-av::before { content: ""; position: absolute; inset: -7px; z-index: -1; border-radius: 50%; background: conic-gradient(from 0deg, #f59e0b, #fde68a, #facc15, #b45309, #f59e0b); animation: fame-spin 4s linear infinite; }
.profile.is-famous .prof-av .av-xl { box-shadow: none; }
.profile.is-star { position: relative; overflow: hidden; }
.profile.is-star::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%); background-size: 250% 100%; animation: star-shine 5s ease-in-out infinite; }
@keyframes honor-shift { to { background-position: 300% 0; } }
@keyframes fame-spin { to { transform: rotate(1turn); } }
@keyframes star-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .guest, .guest-pop, .guest-avs .av, .guests-new, .honor-star, .profile.is-famous .prof-av::before, .profile.is-star::after { animation: none !important; } }

/* синяя галочка */
.verified { display: inline-block; flex: none; margin-left: .25rem; vertical-align: -.16em; }
/* временные эффекты ника (колесо дня) */
[data-flair="rainbow"] { background: linear-gradient(90deg, #ff4d4d, #ffb84d, #f9f871, #5cff8d, #4dc3ff, #b06bff, #ff4d4d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; animation: flair-shift 3s linear infinite; }
[data-flair="gold"] { background: linear-gradient(90deg, #b45309, #facc15, #fef3c7, #facc15, #b45309); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; animation: flair-shift 2.5s linear infinite; }
@keyframes flair-shift { to { background-position: -200% 0; } }
/* конфетти */
.confetti { position: fixed; z-index: 120; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; animation: confetti 1.3s cubic-bezier(.15, .6, .4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 420px)) rotate(var(--r)); opacity: 0; } }
/* баннер колеса в ленте */
.wheel-cta { display: flex; align-items: center; gap: var(--s3); margin: 0 var(--s4) var(--s3); padding: 10px 14px; border-radius: var(--r-lg); background: var(--grad); color: var(--brand-ink) !important; border: var(--stroke); box-shadow: var(--hard); text-decoration: none !important; }
.wheel-cta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.wheel-cta small { opacity: .85; font-weight: 600; }
.wheel-cta-ic { font-size: 1.8rem; animation: fame-spin 6s linear infinite; }
.wheel-cta-arr { transform: rotate(180deg); }
.cnt-dot { font-size: 0; min-width: 12px; height: 12px; padding: 0; position: absolute; left: 34px; top: 6px; }
/* страница игр */
.play { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s3) var(--s4) var(--s6); }
.game { padding: var(--s5); }
.game-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; margin: 0; }
.game-sub { margin: 4px 0 var(--s4); font-size: var(--fs-sm); }
.game-result { min-height: 1.5em; text-align: center; font-weight: 700; margin: var(--s4) 0 0; }
.game-result.is-win { animation: gpop-av .5s cubic-bezier(.2, 1.6, .4, 1); }
.game-me { margin: var(--s3) 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.game-top { margin: var(--s3) 0 0; padding: 0; list-style: none; counter-reset: top; display: flex; flex-direction: column; gap: 4px; }
.game-top li { counter-increment: top; display: flex; align-items: center; gap: var(--s2); padding: 6px 10px; border-radius: 12px; background: var(--surface-2); }
.game-top li::before { content: counter(top); width: 18px; font-family: var(--font-display); font-weight: 900; color: var(--text-2); }
.game-top li:nth-child(1)::before { color: #facc15; } .game-top li:nth-child(2)::before { color: #cbd5e1; } .game-top li:nth-child(3)::before { color: #d97706; }
.game-top a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; text-decoration: none !important; }
.game-top a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wheel-wrap { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.wheel { position: absolute; inset: 0; border-radius: 50%; border: 5px solid var(--ink); box-shadow: var(--hard); transition: transform 4.2s cubic-bezier(.12, .8, .1, 1);
  background: conic-gradient(#8b5cf6 0 45deg, #ec4899 0 90deg, #facc15 0 135deg, #22c55e 0 180deg, #0ea5e9 0 225deg, #f97316 0 270deg, #64748b 0 315deg, #38bdf8 0 360deg); }
.wheel-seg { position: absolute; inset: 0; transform: rotate(calc(var(--i) * 360deg / var(--n) + 180deg / var(--n))); display: flex; justify-content: center; padding-top: 8%; pointer-events: none; }
.wheel-seg b { font-size: clamp(1.4rem, 6vw, 2rem); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.wheel-pin { position: absolute; z-index: 2; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--pop); filter: drop-shadow(0 2px 0 var(--ink)); }
.wheel-hub { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30%; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--ink); background: var(--surface-solid, var(--card)); color: var(--text); font-family: var(--font-display); font-weight: 900; cursor: pointer; box-shadow: var(--hard); }
.wheel-hub:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.06); }
.wheel-hub:disabled { cursor: default; opacity: .9; }
.react-pad { width: 100%; min-height: 170px; border-radius: var(--r-lg); border: var(--stroke); box-shadow: var(--hard); font-family: var(--font-display); font-size: 1.3rem; color: #fff; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background .08s; background: #334155; }
.react-pad[data-state="wait"] { background: #dc2626; }
.react-pad[data-state="go"] { background: #22c55e; color: #052e12; }
.react-pad[data-state="done"] { background: var(--grad); color: var(--brand-ink); }
.tap-zone { display: grid; place-items: center; padding: var(--s3) 0; }
.tap-bubble { width: min(190px, 56vw); aspect-ratio: 1; border-radius: 50%; border: var(--stroke); box-shadow: var(--hard); background: radial-gradient(circle at 35% 30%, #fff8, transparent 40%), var(--grad); color: var(--brand-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tap-bubble b { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.tap-bubble.is-pop { animation: tap-pop .12s ease-out; }
.tap-bubble.is-on small { font-weight: 800; }
.tap-plus { position: fixed; z-index: 110; pointer-events: none; font-weight: 900; color: var(--pop); text-shadow: 0 1px 0 var(--ink); transform: translate(-50%, -50%); animation: tap-up .7s ease-out forwards; }
@keyframes tap-pop { 50% { transform: scale(.92); } }
@keyframes tap-up { to { transform: translate(-50%, -260%); opacity: 0; } }
.play-note { text-align: center; }
@media (prefers-reduced-motion: reduce) { [data-flair], .wheel-cta-ic { animation: none !important; } }

/* дизлайк и продвижение */
.act-dislike.is-on { color: #60a5fa; }
.act-dislike.is-on .ic { color: #60a5fa; }
.act-dislike .n:empty { display: none; }
.chip-promo { background: linear-gradient(90deg, #f97316, #ec4899); color: #fff; font-weight: 800; }
/* искры */
.spk-chip { margin-left: auto; }
.spk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); }
.spk-bal { display: flex; align-items: center; gap: var(--s3); }
.spk-bal b { display: block; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.1; }
.spk-bal b.is-bump { animation: gpop-av .45s cubic-bezier(.2, 1.6, .4, 1); }
.spk-ic { font-size: 2.2rem; animation: guest-pulse 2.4s ease-in-out infinite; }
.spk-how { flex: 1 1 100%; margin: 0; }
.bet-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-weight: 700; margin-bottom: var(--s3); }
.bet-input { width: 120px; }
.bet-quick { display: flex; gap: 4px; }
.bet-quick button { padding: 6px 10px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; }
.bet-games { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.bet-btn, .shop-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s4) var(--s3); border-radius: var(--r-lg); border: var(--stroke); background: var(--surface-2); color: var(--text); box-shadow: var(--hard); cursor: pointer; font: inherit; text-align: center; transition: transform var(--t-fast); }
.bet-btn:hover:not(:disabled), .shop-item:hover:not(.is-info) { transform: translateY(-2px); }
.bet-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.bet-btn b, .shop-item b { font-size: 1.05rem; }
.bet-btn small, .shop-item small { color: var(--text-2); font-weight: 600; }
.shop-item.is-info { cursor: default; box-shadow: none; }
.game-result.is-roll { animation: guest-pulse .5s ease-in-out infinite; }
.game-result.is-win { color: var(--ok); }
.game-result.is-lose { color: var(--danger); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.crash-sky { --h: 0; position: relative; height: 190px; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, #0b1023, #1e1b4b 60%, #4c1d95); display: grid; place-items: center; margin-bottom: var(--s3); }
.crash-m { position: relative; z-index: 1; font-family: var(--font-display); font-size: 2.6rem; color: #fff; text-shadow: 0 2px 0 #000; }
.crash-rocket { position: absolute; left: calc(10% + var(--h) * 70%); bottom: calc(8% + var(--h) * 62%); font-size: 2.4rem; transform: rotate(-10deg); transition: none; }
.crash-sky.is-fly .crash-rocket { animation: rocket-shake .18s linear infinite; }
.crash-sky.is-boom { background: linear-gradient(180deg, #450a0a, #7f1d1d); }
.crash-sky.is-boom .crash-rocket { opacity: 0; }
.crash-sky.is-won { background: linear-gradient(180deg, #052e16, #166534); }
.crash-ctl { display: flex; gap: var(--s2); }
.crash-ctl .btn { flex: 1; }
@keyframes rocket-shake { 50% { transform: rotate(-10deg) translate(1px, -1px); } }
.spk-hist summary { cursor: pointer; }
.spk-hist ul { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.spk-hist li { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); }
.spk-hist .is-plus { color: var(--ok); } .spk-hist .is-minus { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .spk-ic, .crash-sky.is-fly .crash-rocket { animation: none !important; } }

.pngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); align-items: end; }
.pnfield { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 700; }
.pntable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.pntable th, .pntable td { text-align: left; padding: 6px 8px; }
