/* Erik — дизайн в стиле ВСети.by: светлый фон, зелёная шапка, меню слева */
:root {
  --bg: #d7e8f2;
  --card: #ffffff;
  --card2: #f1f7ee;
  --border: #c3dcc3;
  --text: #1d2b1d;
  --muted: #6e826e;
  --accent: #4a9a20;
  --accent2: #66bb33;
  --accent-dark: #357a15;
  --danger: #d32f2f;
  --ok: #2e7d32;
  --gold: #e8a90c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: linear-gradient(180deg, #cfe4f3 0%, #d7e8f2 220px);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}
a { color: #2f7d1e; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== шапка как у ВСети.by ===== */
.vs-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, #66bb33, #4a9a20);
  border-bottom: 2px solid #3c7f1a;
  box-shadow: 0 2px 8px rgba(46, 90, 20, .35);
  padding: 7px 16px;
  display: flex; align-items: center; gap: 10px;
}
.vs-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.vs-brand:hover { text-decoration: none; }
.vs-logo { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 1px 4px rgba(0,0,0,.3); background: #fff; }
.vs-name { color: #fff; font-size: 27px; font-weight: 800; letter-spacing: .5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.vs-topnav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.vs-topnav a {
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 7px 11px; border-radius: 8px; text-decoration: none; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.vs-topnav a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.vs-coins {
  color: #fff; font-weight: 800; font-size: 14px;
  background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.4);
  padding: 6px 12px; border-radius: 16px; margin-right: 6px; white-space: nowrap;
}
.burger {
  display: none; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-size: 20px; border-radius: 8px; padding: 4px 11px; cursor: pointer;
}

/* ===== каркас: меню слева + контент ===== */
.vs-layout {
  display: flex; gap: 14px; align-items: flex-start;
  max-width: 1020px; margin: 0 auto; padding: 14px 14px 40px;
}
.vs-side {
  width: 205px; flex: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; position: sticky; top: 72px;
  box-shadow: 0 2px 8px rgba(60, 100, 60, .12);
}
.vs-side nav { display: flex; flex-direction: column; gap: 1px; }
.vs-side a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; color: var(--text);
  font-size: 14px; text-decoration: none; position: relative;
}
.vs-side a:hover { background: #eef5e9; text-decoration: none; }
.vs-side a.active { background: #dff0d4; font-weight: 700; color: #2f7d1e; }
.vs-side .s-ico { font-size: 17px; width: 24px; text-align: center; flex: none; }
.vs-side .badge { position: static; margin-left: auto; }
.vs-side .s-ava { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; overflow: hidden; }
.side-overlay { display: none; }
.vs-main { flex: 1; min-width: 0; }

/* зелёный заголовок блока */
.vs-block-head {
  background: linear-gradient(180deg, #5fb32b, #4a9a20);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 8px 14px; border-radius: 8px 8px 0 0; margin: -14px -16px 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* ===== карточки и блоки ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(60, 100, 60, .10);
}
.card.pinned { border: 2px solid var(--accent); }
.pin-tag { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 42px; height: 42px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff; flex-shrink: 0;
}
.avatar.big { width: 72px; height: 72px; font-size: 30px; }
img.avatar { object-fit: cover; padding: 0; }
.who a { color: var(--text); font-weight: 700; }
.who a:hover { color: var(--accent-dark); text-decoration: none; }
.time { color: var(--muted); font-size: 12px; }
.post-text { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.5; margin: 6px 0 10px; }
.post-img { width: 100%; border-radius: 8px; margin: 4px 0 10px; display: block; border: 1px solid var(--border); }
.repost-box {
  border-left: 3px solid var(--accent); padding: 8px 12px; margin: 8px 0;
  background: var(--card2); border-radius: 0 8px 8px 0; font-size: 14px; color: var(--muted);
}
h1.page-title { font-size: 21px; margin: 2px 2px 14px; color: #2c4a22; }

/* ===== кнопки и действия ===== */
.btn {
  background: linear-gradient(180deg, #5fb32b, #478f1d);
  color: #fff; border: 1px solid #3c7f1a; border-radius: 8px; padding: 10px 20px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  text-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: 0 2px 4px rgba(60,120,30,.3);
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--card2); border: 1px solid var(--border); color: var(--text); text-shadow: none; box-shadow: none; }
.btn.secondary { background: #fff; border: 1px solid var(--border); color: var(--text); text-shadow: none; box-shadow: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.act {
  background: #eef4ea; border: 1px solid var(--border); color: #3c5a34;
  border-radius: 16px; padding: 6px 13px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-weight: 600;
}
.act:hover { background: #e2efda; color: var(--accent-dark); border-color: var(--accent); }
.act.on { color: #fff; background: var(--accent); border-color: var(--accent-dark); }
.act.danger:hover { color: var(--danger); border-color: var(--danger); }
.views { margin-left: auto; color: var(--muted); font-size: 12px; }

/* реакции */
.reacts { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.react-btn {
  background: var(--card2); border: 2px solid var(--border); border-radius: 16px;
  padding: 6px 12px; font-size: 16px; cursor: pointer; color: var(--text);
  display: inline-flex; gap: 6px; align-items: center; font-family: inherit; font-weight: 700;
}
.react-btn .n { font-size: 15px; font-weight: 800; color: var(--text); background: var(--card); 
  border-radius: 10px; padding: 2px 8px; margin-left: 2px; border: 1px solid var(--border); }
.react-btn:hover { border-color: var(--accent); }
.react-btn.mine { border-color: var(--accent); background: #dff0d4; color: var(--text); }

/* опросы */
.poll { background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.poll q { font-weight: 700; display: block; margin-bottom: 8px; }
.poll-opt { margin: 6px 0; }
.poll-opt button {
  width: 100%; text-align: left; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  cursor: pointer; font-size: 14px; font-family: inherit; position: relative; overflow: hidden;
}
.poll-opt button:hover { border-color: var(--accent); }
.poll-opt .bar { position: absolute; inset: 0; background: rgba(90,170,50,.25); }
.poll-opt .lbl { position: relative; display: flex; justify-content: space-between; }
.poll-opt.voted button { cursor: default; }

/* комменты */
.comment { border-top: 1px solid var(--border); padding: 10px 2px; font-size: 14px; }
.comment .who { font-size: 13px; margin-bottom: 4px; }

/* ===== формы ===== */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 22px; max-width: 440px; margin: 30px auto;
  box-shadow: 0 3px 12px rgba(60,100,60,.12); }
.form-card h2 { margin-bottom: 16px; color: #2c4a22; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
  width: 100%; background: #fbfdfb; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 15px; font-family: inherit;
  box-sizing: border-box; max-width: 100%;
}
input[type=file] { padding: 8px; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(90,170,50,.2); }
textarea { min-height: 90px; resize: vertical; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; background: #fff; }
.flash.error { background: #fdeceb; border: 1px solid var(--danger); color: #a02121; }
.flash.ok { background: #e8f5e4; border: 1px solid var(--ok); color: #205c26; }

/* ===== профиль ===== */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
/* Блок с именем должен ужиматься внутри flex-строки, иначе на узком
   экране имя со значками выпирает за край и страница едет вбок
   (баг 2026-10-24: «криво имя» в приложении и моб. версии). */
.profile-head > div:not(.ava-col) { min-width: 0; flex: 1; }
.ava-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.rating-under-ava { width: 76px; text-align: center; }
.rating-under-ava .rating-bar { margin-bottom: 2px; }
.profile-head h2 { font-size: 22px; }
.profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 18px; row-gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 10px 0; }
.profile-stats b { color: var(--text); }
.profile-stats a { color: var(--text); }
.bio { color: var(--muted); font-size: 14px; margin: 6px 0; white-space: pre-wrap; }
.xpbar { background: #e3ecdf; border-radius: 8px; height: 8px; margin-top: 6px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
/* Золотой рейтинг как в OpenVK — простая аккуратная полоска */
.rating-bar { position: relative; height: 20px; margin-top: 8px; background: #f5e9c8; border: 1px solid #d4c48a; border-radius: 3px; overflow: hidden; max-width: 100%; }
.rating-fill { height: 100%; background: #e8d48b; border-radius: 2px; min-width: 0; }
.rating-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #5a4a1a; white-space: nowrap; }
.rating-wrap { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rating-bar { flex: 1; background: linear-gradient(180deg, #e8d48a, #d4b95c); border-radius: 2px; height: 28px; overflow: hidden; position: relative; border: 1px solid #b89a3a; }
.rating-bar i { display: block; height: 100%; background: transparent; }
.rating-label { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #6a5a1a; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.rating-buy { background: linear-gradient(180deg, #f7d154, #e8a90c); border: 1px solid #b57e00; border-radius: 8px;
  font-size: 11px; font-weight: 800; color: #3a2a00; padding: 4px 10px; cursor: pointer; }
.badges { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; vertical-align: middle; margin-left: 2px; }
.badge-img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.badge-img-vip { height: 22px; max-width: 90px; object-fit: contain; border-radius: 6px; flex: none; }
.badge-custom { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; vertical-align: middle; }
.stats-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.stats-row b { color: var(--text); }
.user-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.user-row:first-of-type { border-top: none; }

/* ===== диалоги и чат ===== */
.dialog-row { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; position: relative; }
.dialog-row .badge { position: static; margin-left: 4px; }
.dialog-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px;
  position: sticky; top: 66px; z-index: 5; }
.chat-head .back { font-size: 20px; text-decoration: none; color: var(--muted); }
.chat-box { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 12px; }
.msg { max-width: 80%; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg .bubble { padding: 8px 12px; border-radius: 14px; font-size: 15px; word-wrap: break-word; }
.msg.mine .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs .bubble { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: 10px; padding: 8px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; }
.chat-form input { flex: 1; }
.chat-form .btn { padding: 8px 16px; }
.badge { background: var(--accent); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: bold; }

/* ===== видео и рилсы ===== */
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; margin-top: 8px; border-radius: 8px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-wrap video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000; }
.reels-feed { height: calc(100dvh - 160px); min-height: 420px; overflow-y: scroll;
  scroll-snap-type: y mandatory; border-radius: 10px; scrollbar-width: none; }
.reels-feed::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  position: relative; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.reel iframe { width: 100%; height: 100%; border: 0; }
.reel video { width: 100%; height: 100%; background: #000; }
.reel-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; }
.reel-author { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; margin-bottom: 6px; }
.reel-author .avatar { width: 32px; height: 32px; font-size: 14px; border: 2px solid #fff; border-radius: 50%; }
.reel-text { font-size: 14px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.reel-open { display: inline-block; font-size: 13px; color: #fff; text-decoration: none;
  background: rgba(255,255,255,.2); padding: 6px 12px; border-radius: 20px; }

/* ерики */
.coin-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1;
  color: #6d4300; background: radial-gradient(circle at 35% 30%, #ffedb0, #f7b500 55%, #cf8d00);
  border: 1.5px solid #9c6a00; box-shadow: inset 0 1px 2px rgba(255,255,255,.7), 0 1px 2px rgba(0,0,0,.3);
  vertical-align: -4px; }

/* ===== группы ===== */
.group-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.group-row h3 { font-size: 16px; }

/* ===== админка: панель с иконками ===== */
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 6px; }
.adm-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  background: #fbfdfb; border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px;
  text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .12s;
}
.adm-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(60,120,30,.2); border-color: var(--accent); }
.adm-ico { font-size: 38px; line-height: 1; }
.adm-card b { font-size: 14px; color: #2c4a22; }
.adm-card span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.adm-sec { scroll-margin-top: 80px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.admin th, table.admin td { padding: 7px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.admin th { color: var(--muted); font-weight: 600; background: var(--card2); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--card2); border: 1px solid var(--border); margin: 1px; }
.tag.green { border-color: var(--ok); color: var(--ok); }
.tag.gold { border-color: var(--gold); color: #9a6f00; }
.tag.red { border-color: var(--danger); color: var(--danger); }
.mini-btn { background: #fff; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.mini-btn:hover { border-color: var(--accent); background: #f2f8ee; }
.mini-btn.warn { color: var(--danger); }
.inline-form { display: inline; }
.admin-actions { display: flex; flex-direction: column; gap: 6px; }
.arow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.arow input[type=text], .arow input[type=number], .arow select {
  width: auto; font-size: 13px; padding: 7px 10px; border-radius: 8px;
}
.arow .mini-btn { padding: 7px 12px; font-size: 13px; }

/* ===== подарки ===== */
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gift-card { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px; text-align: center; cursor: pointer; }
.gift-card:hover { border-color: var(--accent); }
.gift-card .e { font-size: 34px; }
.gift-img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.gift-card .n { font-size: 12px; color: var(--muted); margin-top: 6px; }
.gift-card .price { font-size: 12px; color: #9a6f00; margin-top: 2px; font-weight: 700; }
.my-gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 10px; }
.my-gifts .g { font-size: 26px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; position: relative; }
.my-gifts .g-img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
/* Карточки подарков в профиле */
.gift-card { position: relative; background: var(--card2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 6px 8px; text-align: center; transition: transform .15s ease, box-shadow .15s ease; }
.gift-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.gift-pinned { border: 2px solid gold; box-shadow: 0 0 10px rgba(255,215,0,.25); }
.gc-img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; cursor: pointer; display: block; margin: 0 auto; }
.gc-emoji { font-size: 42px; cursor: pointer; display: block; line-height: 64px; position: relative; }
.gc-anon { font-size: 12px; position: absolute; top: 0; right: 8px; }
.gc-name { font-size: 11px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); }
.gc-btn { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; font-size: 13px; line-height: 1; border: none; border-radius: 50%; background: rgba(0,0,0,.55); cursor: pointer; opacity: .85; padding: 0; }
.gm-del { background: #d32f2f !important; color: #fff !important; }
@media (hover: hover) {
  .gc-btn { opacity: 0; }
  .gift-card:hover .gc-btn { opacity: .9; }
}
/* Красивый просмотр подарка (как в ВК) */
.gift-modal { position: fixed; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(5px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .22s ease; }
.gift-modal.gm-show { opacity: 1; }
.gm-box { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 36px 36px 26px; max-width: 92vw; max-height: 92vh; overflow: auto; text-align: center; position: relative; transform: scale(.88); transition: transform .22s ease; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.gift-modal.gm-show .gm-box { transform: scale(1); }
.gm-close { position: absolute; top: 10px; right: 12px; border: none; background: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.gm-close:hover { background: var(--card2); color: var(--text); }
.gm-img img { max-width: min(340px, 70vw); max-height: 52vh; border-radius: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.gm-emoji { font-size: 120px; line-height: 1.2; display: block; }
.gm-name { font-size: 21px; font-weight: 700; margin-top: 18px; }
.gm-from { color: var(--text2); margin-top: 6px; font-size: 14px; }
.gm-msg { margin: 14px auto 0; font-style: italic; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; max-width: 320px; font-size: 14px; }
/* Страница подарков (как в OpenVK) */
.gift-page-item { text-align: center; padding: 20px; }
.gpi-title { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.gpi-img img { max-width: min(320px, 80vw); border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.gpi-emoji { font-size: 96px; display: block; }
.gpi-name { font-size: 18px; font-weight: 700; margin-top: 12px; }
.gpi-meta { color: var(--text2); font-size: 13px; margin-top: 6px; }
.gpi-msg { margin-top: 8px; font-style: italic; color: var(--text); }
.gpi-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }
/* Полоска подарков в профиле */
.gifts-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; margin-top: 8px; align-items: center; }
.gs-img { flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; cursor: pointer; border: 1px solid var(--border); transition: transform .15s ease; }
.gs-img:hover { transform: scale(1.08); }
.gs-emoji { flex: 0 0 64px; width: 64px; height: 64px; font-size: 38px; line-height: 64px; text-align: center; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: transform .15s ease; }
.gs-emoji:hover { transform: scale(1.08); }
.btn-sm { padding: 7px 14px !important; font-size: 13px !important; }
.btn-danger { background: #d32f2f !important; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 15px; }

/* награды */
.rewards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.reward-pill { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--card2), var(--card));
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; font-size: 13px; text-align: center;
  color: var(--text); font-weight: 600; cursor: default; transition: transform .15s ease; }
.reward-pill:hover { transform: scale(1.03); }
.reward-pill .reward-ico { font-size: 24px; }

/* ===== музыка ===== */
.music-tabs { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.music-tabs .tab { flex: 1 1 28%; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit; }
.music-tabs .tab.active { background: var(--accent); border-color: var(--accent-dark); color: #fff; font-weight: 600; }
.track-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.track { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.track-art { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: #dde8d8;
  display: flex; align-items: center; justify-content: center; font-size: 20px; }
.track-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track-meta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 10px; padding: 7px 10px; font-size: 13px; cursor: pointer; flex: none; font-family: inherit; }
.tbtn.play { font-size: 15px; padding: 7px 11px; }
.tbtn.ok { border-color: #4caf50; color: #2e7d32; }
.tbtn.danger { border-color: #e5534b; color: #c62828; }
.music-attach { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; margin: 8px 0; flex-wrap: wrap; }
.music-attach img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.music-attach .music-meta { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.music-attach .music-meta b { font-size: 14px; }
.music-attach .music-meta span { font-size: 12px; color: var(--muted); }
.music-attach audio { flex: 1; min-width: 200px; height: 36px; }
.music-pane { margin-top: 8px; }
.modal { position: fixed; inset: 0; background: rgba(30,50,30,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 14px 14px; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; width: 100%; max-width: 480px;
  max-height: 70vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-box .track-list { overflow-y: auto; }
.track.picked { margin-bottom: 8px; }

/* ===== игры ===== */
.game-score-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; font-size: 14px; flex-wrap: wrap; }
.game-score-row b { color: var(--accent-dark); }
.game-wrap { position: relative; display: flex; justify-content: center; }
.game-wrap canvas { border: 2px solid var(--border); border-radius: 10px; max-width: 100%; height: auto; touch-action: none; }
.game-over {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.88); border-radius: 10px;
  font-size: 20px; font-weight: 800; color: #2c4a22;
}
.tfe-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: #c9d8bf; border-radius: 10px; padding: 8px;
  width: 400px; max-width: 100%; aspect-ratio: 1; touch-action: none;
}
.tfe-cell {
  background: rgba(255,255,255,.55); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #5a6b52; aspect-ratio: 1;
}

/* ===== подвал ===== */
.vs-footer, .site-footer {
  display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; text-align: center;
  padding: 18px 12px 30px; color: var(--muted); font-size: 13px;
}
.site-footer .dot { opacity: .5; }
.site-footer b { color: var(--text); }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-music { width: 100%; font-size: 12px; margin-top: 4px; }
.footer-music a { color: #2f7d1e; }

/* промо-арт на главной для гостей */
.promo { text-align: center; margin: 20px 0 4px; }
.promo-flag { font-size: 36px; }
.promo-art { width: 100%; max-width: 460px; border-radius: 12px; display: block; margin: 0 auto 4px; border: 1px solid var(--border); }
.promo-title { font-size: 30px; font-weight: 800; margin: 10px 0 6px; color: #2c4a22; }
.promo-text { font-size: 18px; color: #4a5d4a; max-width: 430px; margin: 0 auto; line-height: 1.5; }

/* ===== мобильная версия ===== */
@media (max-width: 860px) {
  .burger { display: inline-block; }
  .vs-side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 250px; border-radius: 0; border-right: 1px solid var(--border);
    transform: translateX(-105%); transition: transform .25s ease;
    overflow-y: auto; padding-top: 14px;
  }
  body.side-open .vs-side { transform: none; box-shadow: 4px 0 20px rgba(0,0,0,.25); }
  body.side-open .side-overlay {
    display: block; position: fixed; inset: 0; z-index: 150; background: rgba(20,35,20,.45);
  }
  .vs-side { background: #2b2b2b; border-color: #1e1e1e; box-shadow: none; }
  .vs-side a { color: #ededed; }
  .vs-side a:hover { background: #3a3a3a; }
  .vs-side a.active { background: #4a9a20; color: #fff; }
  .vs-side .s-ava { box-shadow: 0 0 0 2px #4a9a20; }
  .vs-topnav a span.t-label { display: none; }
  .vs-topnav a { font-size: 17px; padding: 7px 8px; }
  .vs-name { font-size: 22px; }
  .vs-layout { padding: 10px 10px 30px; }
  table.admin th, table.admin td { padding: 6px 4px; font-size: 12px; }
  .profile-stats { gap: 12px; }
  .adm-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
  .adm-ico { font-size: 30px; }
}
@media (max-width: 520px) {
  .vs-coins { font-size: 12px; padding: 5px 9px; }
  .vs-logo { width: 36px; height: 36px; }
  .vs-topnav a.hide-sm { display: none; }
}

/* ===== радио ===== */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-st { display: flex; gap: 12px; align-items: center; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.radio-st > div { display: flex; flex-direction: column; }
.radio-st.on { border-color: #4a9a20; box-shadow: 0 0 0 1px #4a9a20; }
.radio-play { width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; font-size: 18px; color: #fff; background: linear-gradient(180deg, #5fb32b, #4a9a20); flex-shrink: 0; }
.radio-now { display: flex; gap: 10px; align-items: center; background: #eef7e6; border: 1px solid #bfe0a8; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.radio-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.radio-eq span { width: 3px; background: #4a9a20; animation: eq 0.8s ease-in-out infinite; }
.radio-eq span:nth-child(2) { animation-delay: 0.2s; }
.radio-eq span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 16px; } }
.radio-group { font-size: 14px; font-weight: 700; color: #2e7d32; margin: 14px 2px 8px; }
.attach-menu { position: absolute; z-index: 50; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.18); padding: 6px; min-width: 170px; margin-top: 6px; }
.attach-menu label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.attach-menu label:hover { background: #eef5e9; }
.login-hero { background: linear-gradient(180deg, #bfe6ff 0%, #dff2ff 45%, #e9f7e2 100%); border: 1px solid var(--border); border-radius: 14px; padding: 22px 16px; text-align: center; }
.login-brand { font-size: 34px; font-weight: 800; color: #2e7d32; }
.login-tagline { font-size: 17px; color: #33691e; margin: 4px 0 10px; font-weight: 600; }
.login-photos { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.login-photos span { width: 54px; height: 54px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.login-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.login-cols .form-card { margin: 0; }
.login-reasons { background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; text-align: left; overflow: hidden; }
.login-reasons .reason { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; font-size: 14px; }
.reason-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #4a9a20; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
@media (max-width: 640px) { .login-cols { grid-template-columns: 1fr; } .login-brand { font-size: 28px; } }

/* ===== Мобильный мессенджер (2026-10-10) ===== */
@media (max-width: 640px) {
  /* Список диалогов как в мессенджере */
  .dialogs-list .dialog-item {
    display: flex; gap: 12px; align-items: center;
    padding: 12px; border-bottom: 1px solid var(--border);
  }
  .dialogs-list .dialog-item .avatar {
    width: 52px; height: 52px; flex-shrink: 0;
  }
  .dialogs-list .dialog-item .d-info { flex: 1; min-width: 0; }
  .dialogs-list .dialog-item .d-name {
    font-weight: 700; font-size: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dialogs-list .dialog-item .d-preview {
    font-size: 14px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dialogs-list .dialog-item .d-time {
    font-size: 12px; color: var(--muted); flex-shrink: 0;
  }
  /* Нижнее меню мессенджера */
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card); border-top: 1px solid var(--border);
    z-index: 100; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1; text-align: center; font-size: 11px; color: var(--muted);
    text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .mobile-nav a .ico { font-size: 22px; }
  .mobile-nav a.active { color: #4a9a20; }
  body { padding-bottom: 70px; }
  /* Чат на весь экран */
  .chat-box { max-height: calc(100vh - 220px); }
  .chat-form { position: sticky; bottom: 70px; background: var(--card); padding: 8px; }
}
@media (min-width: 641px) {
  .mobile-nav, .tg-bottom-nav { display: none !important; }
}

/* ===== Чаты как в Telegram (моб) ===== */
@media (max-width: 640px) {
  .dialog-row {
    border: none !important; border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important; margin: 0 !important;
    padding: 10px 12px !important;
    display: flex; gap: 12px; align-items: center;
  }
  .dialog-row .avatar {
    width: 54px !important; height: 54px !important; flex-shrink: 0;
  }
  .dialog-row b { font-size: 16px; }
  .dialog-row .time { font-size: 12px; color: var(--muted); }
  .dialog-row .dialog-preview {
    font-size: 14px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dialog-row .badge {
    background: #2a9df4; color: #fff;
    min-width: 22px; height: 22px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; padding: 0 6px;
  }
  .page-title { padding: 0 12px; }
}

/* ===== Тёмная тема (сова 🦉) ===== */
body.dark-theme {
  --bg: #1a1a1a;
  --card: #2b2b2b;
  --card2: #333333;
  --border: #444444;
  --text: #ededed;
  --muted: #999999;
}
body.dark-theme .vs-header { background: #222; }

/* ===== Telegram-стиль для мобильной версии ===== */
@media (max-width: 640px) {
  body {
    background: #0f0f0f !important;
    background-image: none !important;
    color: #fff !important;
  }
  .vs-header { background: #1a1a1a !important; border: none !important; }
  .vs-layout { background: #0f0f0f; }
  .card {
    background: #1a1a1a !important;
    border: none !important;
    color: #fff;
  }
  .page-title { color: #fff; }
  a { color: #6ab2f5; }
  .dialog-row {
    background: #0f0f0f !important;
    border-bottom: 1px solid #1f1f1f !important;
  }
  .dialog-row b { color: #fff; }
  .dialog-row .time { color: #888; }
  .dialog-row .dialog-preview { color: #888; }
  .mobile-nav {
    background: #1a1a1a !important;
    border-top: 1px solid #2a2a2a !important;
  }
  .mobile-nav a { color: #888; }
  .mobile-nav a.active { color: #2a9df4; }
  .vs-side { background: #1a1a1a !important; }
  .vs-side a { color: #fff !important; }
  input, textarea, select {
    background: #2a2a2a !important;
    color: #fff !important;
    border: 1px solid #3a3a3a !important;
  }
  .btn { background: #2a9df4 !important; }
}

/* ===== Telegram-чаты точь-в-точь ===== */
@media (max-width: 640px) {
  .tg-chats { background: #0f0f0f; min-height: 70vh; margin: -8px -8px 0; padding-bottom: 20px; }
  .tg-chats-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; }
  .tg-chats-header h1 { color: #fff; font-size: 28px; font-weight: 700; margin: 0; }
  .tg-chats-actions { display: flex; gap: 12px; }
  .tg-icon-btn { width: 40px; height: 40px; border-radius: 50%; background: #1e1e1e; display: flex; align-items: center; justify-content: center; font-size: 18px; text-decoration: none; }
  .tg-icon-btn.tg-plus { background: #2a9df4; color: #fff; font-size: 24px; font-weight: 300; }
  .tg-tabs { display: flex; gap: 24px; padding: 8px 16px; border-bottom: 1px solid #1e1e1e; }
  .tg-tab { color: #888; font-size: 15px; padding: 6px 0; position: relative; }
  .tg-tab.active { color: #fff; font-weight: 600; }
  .tg-tab.active::after { content: ''; position: absolute; bottom: -9px; left: 0; right: 0; height: 3px; background: #2a9df4; border-radius: 2px; }
  .tg-dialog-list { padding: 0; }
  .tg-dialog { display: flex; gap: 12px; padding: 10px 16px; text-decoration: none; align-items: center; }
  .tg-dialog:active { background: #1a1a1a; }
  .tg-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
  .tg-avatar-ph { background: #2a9df4; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
  .tg-dialog-main { flex: 1; min-width: 0; border-bottom: 1px solid #1e1e1e; padding-bottom: 10px; }
  .tg-dialog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .tg-dialog-name { color: #fff; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tg-dialog-time { color: #888; font-size: 13px; flex-shrink: 0; }
  .tg-dialog-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
  .tg-dialog-preview { color: #888; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
  .tg-unread { background: #2a9df4; color: #fff; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; padding: 0 6px; flex-shrink: 0; }
}

/* ===== Нижнее меню как в Telegram ===== */
@media (max-width: 640px) {
  .tg-bottom-nav { background: #1a1a1a !important; border-top: 1px solid #2a2a2a !important; }
  .tg-bottom-nav a { color: #888 !important; font-size: 11px; }
  .tg-bottom-nav a .ico { font-size: 24px; }
  .tg-bottom-nav a.active { color: #2a9df4 !important; }
}

/* ===== Экран чата как в Telegram ===== */
@media (max-width: 640px) {
  .chat-head { background: #1a1a1a !important; border: none !important; padding: 8px 12px !important; }
  .chat-head b { color: #fff !important; }
  .chat-head .back { color: #2a9df4 !important; font-size: 24px; }
  .chat-box { background: #0f0f0f; }
  .msg .bubble { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 15px; line-height: 1.4; }
  .msg.mine .bubble { background: #2a9df4 !important; color: #fff !important; border-bottom-right-radius: 4px; }
  .msg.theirs .bubble { background: #1e1e1e !important; color: #fff !important; border-bottom-left-radius: 4px; }
  .msg-time { color: #666 !important; font-size: 11px; }
  .chat-form { background: #1a1a1a !important; border: none !important; padding: 8px 12px calc(8px + 60px) !important; }
  .chat-form input[type="text"] { background: #2a2a2a !important; border-radius: 20px !important; color: #fff !important; border: none !important; padding: 10px 16px !important; }
  .chat-form .btn { background: #2a9df4 !important; border-radius: 50% !important; width: 40px; height: 40px; padding: 0 !important; }
  /* Фикс наложения сообщений */
  .chat-box { display: flex !important; flex-direction: column !important; gap: 10px !important; padding: 12px 8px !important; overflow-y: auto !important; }
  .msg { max-width: 80% !important; display: flex !important; flex-direction: column !important; clear: both !important; margin-bottom: 4px !important; }
  .msg.mine { align-self: flex-end !important; align-items: flex-end !important; margin-left: auto !important; }
  .msg.theirs { align-self: flex-start !important; margin-right: auto !important; }
  .msg .bubble { word-break: break-word !important; overflow-wrap: break-word !important; }
}

/* ===== Бургер на моб — как в Telegram ===== */
@media (max-width: 640px) {
  .burger { display: inline-block !important; }
  body.side-open #sidebar, body.side-open .vs-side { display: block !important; position: fixed !important; left: 0 !important; top: 0 !important; bottom: 0 !important; width: 280px !important; z-index: 1000 !important; background: #1a1a1a !important; overflow-y: auto !important; transform: none !important; }
  body.side-open #sidebar a, body.side-open .vs-side a { color: #fff !important; }
  body.side-open #sidebar .s-ico, body.side-open .vs-side .s-ico { color: #fff !important; }
  body.side-open .side-overlay, body.side-open #sideOverlay { display: block !important; position: fixed !important; inset: 0 !important; background: rgba(0,0,0,0.5) !important; z-index: 999 !important; }
  .vs-layout { display: block !important; }
  .vs-main { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  /* Тёмная тема на моб — только когда включена */
  body.dark-theme, body.dark-theme .vs-layout, body.dark-theme .vs-main { background: #0f0f0f !important; background-image: none !important; color: #fff !important; }
  body.dark-theme .card { background: #1a1a1a !important; border: none !important; color: #fff !important; }
  body.dark-theme .card b, body.dark-theme .card h1, body.dark-theme .card h2, body.dark-theme .card h3 { color: #fff !important; }
  body.dark-theme .page-title { color: #fff !important; }
  /* Награды и прочие светлые блоки в тёмной теме */
  body.dark-theme [style*="background:#fff"], body.dark-theme [style*="background: #fff"],
  body.dark-theme [style*="background:#f5f5f5"], body.dark-theme [style*="background: #f5f5f5"],
  body.dark-theme [style*="background:white"] { background: #2b2b2b !important; color: #fff !important; border-color: #444 !important; }
}

/* ===== Профиль как настройки Telegram (моб) ===== */
@media (max-width: 640px) {
  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .avatar.big { width: 100px !important; height: 100px !important; }
  .profile-name { color: #fff !important; font-size: 22px !important; justify-content: center; }
  .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .act { background: #1e1e1e !important; color: #fff !important; border: none !important; border-radius: 8px !important; padding: 8px 12px !important; }
  .stats-row a, .stats-row span { color: #fff !important; }
  .bio { color: #ccc !important; }
}

/* ===== Чаты на десктопе ===== */
.tg-chats { max-width: 800px; margin: 0 auto; }
.tg-chats-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.tg-chats-header h1 { font-size: 24px; margin: 0; }
.tg-dialog-list { display: flex; flex-direction: column; }
.tg-dialog { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; align-items: center; border-bottom: 1px solid var(--border); color: inherit; }
.tg-dialog:hover { background: var(--hover); }
.tg-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.tg-avatar-ph { background: #2a9df4; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.tg-dialog-main { flex: 1; min-width: 0; }
.tg-dialog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tg-dialog-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-dialog-time { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.tg-dialog-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.tg-dialog-preview { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tg-unread { background: #2a9df4; color: #fff; font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.tg-tabs { display: flex; gap: 24px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.tg-tab { color: var(--muted); font-size: 15px; }
.tg-tab.active { color: var(--accent); font-weight: 600; }

/* ===== Нижнее меню закреплено ===== */
@media (max-width: 640px) {
  .mobile-nav, .tg-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    display: flex !important;
    justify-content: space-around !important;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom)) !important;
  }
  body { padding-bottom: 70px !important; }
}

/* ===== Фикс нижнего меню — все 4 кнопки ===== */
@media (max-width: 640px) {
  .tg-bottom-nav a {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 10px !important;
    padding: 4px 2px !important;
    text-align: center !important;
  }
  .tg-bottom-nav a .ico { font-size: 22px !important; display: block !important; }
}

/* ===== Меню всегда видно ===== */
@media (max-width: 640px) {
  nav.mobile-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    z-index: 9999 !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* ===== Компактное меню — 4 кнопки влезают ===== */
@media (max-width: 640px) {
  nav.mobile-nav.tg-bottom-nav {
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom)) !important;
  }
  nav.mobile-nav.tg-bottom-nav a {
    font-size: 9px !important;
    padding: 2px 0 !important;
    gap: 1px !important;
  }
  nav.mobile-nav.tg-bottom-nav a .ico { font-size: 20px !important; }
}

/* ===== Фикс: меню точно влезает ===== */
@media (max-width: 640px) {
  nav.mobile-nav.tg-bottom-nav {
    display: flex !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  nav.mobile-nav.tg-bottom-nav a {
    flex: 1 1 0 !important;
    width: 25% !important;
    max-width: 25% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
}

/* ===== Хорошая полировка моб версии ===== */
@media (max-width: 640px) {
  /* Шапка компактнее */
  .vs-header { padding: 8px 12px !important; min-height: 56px; }
  .vs-brand { font-size: 18px !important; }
  .vs-logo { width: 32px !important; height: 32px !important; }
  /* Контент без лишних отступов */
  .vs-main { padding: 8px !important; }
  /* Карточки постов */
  .card { border-radius: 12px !important; margin-bottom: 12px !important; padding: 12px !important; }
  /* Кнопки действий */
  .act { font-size: 13px !important; padding: 6px 10px !important; }
  /* Аватары */
  .avatar { width: 40px !important; height: 40px !important; }
  .avatar.big { width: 80px !important; height: 80px !important; }
  /* Заголовки */
  .page-title { font-size: 20px !important; margin: 8px 0 !important; }
  /* Формы */
  input, textarea, select { font-size: 16px !important; /* чтобы iOS не зумил */ }
  /* Нижнее меню */
  nav.mobile-nav.tg-bottom-nav { box-shadow: 0 -2px 10px rgba(0,0,0,0.3) !important; }
}

/* ===== Шапка ровно на моб ===== */
@media (max-width: 640px) {
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  .vs-header { max-width: 100vw !important; overflow: hidden !important; }
  .vs-topnav { overflow: hidden !important; max-width: 100% !important; }
  .vs-coins { max-width: 110px !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; font-size: 12px !important; }
  .vs-topnav .t-label { display: none !important; }
}

/* ===== Тёмная тема совы — полное покрытие ===== */
body.dark-theme {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #ededed !important;
}
body.dark-theme .vs-layout,
body.dark-theme .vs-main {
  background: #1a1a1a !important;
}
body.dark-theme .card {
  background: #2b2b2b !important;
  border-color: #444 !important;
  color: #ededed !important;
}
body.dark-theme .page-title,
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme b {
  color: #fff !important;
}
body.dark-theme .time,
body.dark-theme .vs-side a {
  color: #aaa !important;
}
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
  background: #333 !important;
  color: #fff !important;
  border-color: #555 !important;
}
body.dark-theme .vs-side {
  background: #222 !important;
}

@media (max-width: 640px) {
  .desktop-only { display: none !important; }
}

/* ===== ХЕЛЛОУИН 2026 🎃 ===== */
.halloween-garland {
  display: flex; justify-content: center; gap: 18px;
  padding: 8px 0 4px; background: transparent;
  overflow: hidden;
}
.halloween-garland span {
  width: 12px; height: 12px; border-radius: 50%;
  animation: hween-blink 1.2s infinite;
  box-shadow: 0 0 8px 2px currentColor;
}
.halloween-garland span:nth-child(3n) { color: #ff7518; animation-delay: 0s; }
.halloween-garland span:nth-child(3n+1) { color: #9d4edd; animation-delay: .4s; }
.halloween-garland span:nth-child(3n+2) { color: #39ff14; animation-delay: .8s; }
@keyframes hween-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .25; transform: scale(.7); }
}
.halloween-wire {
  height: 3px; margin: 0 10px;
  background: repeating-linear-gradient(90deg, #333 0 8px, transparent 8px 16px);
  border-radius: 2px;
}
.halloween-corner {
  position: fixed; font-size: 28px; z-index: 9999;
  pointer-events: none; animation: hween-float 4s ease-in-out infinite;
}
.halloween-corner.tl { top: 8px; left: 8px; }
.halloween-corner.tr { top: 8px; right: 8px; animation-delay: 2s; }
@keyframes hween-float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-8px) rotate(8deg); }
}

/* Хеллоуин: дополнительные украшения */
.halloween-banner {
  text-align: center; padding: 6px;
  font-size: 15px; font-weight: bold;
  background: linear-gradient(90deg, #ff7518, #9d4edd, #ff7518);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hween-glow 2s ease-in-out infinite;
}
@keyframes hween-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

/* Гирлянда: ярче */
.halloween-garland span {
  width: 14px; height: 14px;
  box-shadow: 0 0 12px 4px currentColor, 0 0 20px 6px currentColor;
  filter: brightness(1.5);
}

/* Ёлочка 🎄 */
.christmas-tree {
  position: fixed; bottom: 70px; right: 12px;
  font-size: 100px; z-index: 9999; pointer-events: none;
  filter: drop-shadow(0 0 10px #39ff14);
  animation: tree-sway 3s ease-in-out infinite;
}
@keyframes tree-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.tree-lights {
  position: fixed; bottom: 130px; right: 32px;
  font-size: 20px; z-index: 10000; pointer-events: none;
  animation: hween-blink 1s infinite;
}



/* Красивая CSS ёлочка */
.css-tree {
  position: fixed; bottom: 20px; left: 20px;
  width: 220px; height: 300px; z-index: 9999;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(57,255,20,.5));
  animation: tree-sway 4s ease-in-out infinite;
}
.css-tree .star {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  font-size: 44px; animation: hween-blink 1.5s infinite;
}
.css-tree .layer {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 80px solid transparent;
  border-right: 80px solid transparent;
  border-bottom: 95px solid #0d5c0d;
}
.css-tree .layer.l1 { top: 35px; }
.css-tree .layer.l2 { top: 95px; border-left-width: 100px; border-right-width: 100px; border-bottom-width: 115px; }
.css-tree .layer.l3 { top: 170px; border-left-width: 120px; border-right-width: 120px; border-bottom-width: 135px; }
.css-tree .trunk {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 40px; background: #5a3a1a; border-radius: 4px;
}
.css-tree .orn {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  animation: hween-blink 2s infinite;
}
.css-tree .orn.r { background: #ff0000; box-shadow: 0 0 8px #ff0000; }
.css-tree .orn.g { background: #ffd700; box-shadow: 0 0 8px #ffd700; animation-delay: .7s; }
.css-tree .orn.b { background: #00bfff; box-shadow: 0 0 8px #00bfff; animation-delay: 1.3s; }
@media (max-width: 640px) {
  .css-tree { width: 110px; height: 160px; bottom: 80px; left: 10px; }
  .css-tree .layer { border-left-width: 40px !important; border-right-width: 40px !important; border-bottom-width: 50px !important; }
  .css-tree .layer.l2 { border-left-width: 52px !important; border-right-width: 52px !important; border-bottom-width: 62px !important; }
  .css-tree .layer.l3 { border-left-width: 64px !important; border-right-width: 64px !important; border-bottom-width: 74px !important; }
}


/* Ёлочка: единый аккуратный размер, не перекрывает контент */
.christmas-tree {
  font-size: 64px;
  right: 12px; left: auto;
  top: auto; bottom: 70px;
  transform: none;
}
body.app-view .christmas-tree {
  font-size: 64px !important;
  right: 12px !important; left: auto !important;
  bottom: 70px !important; top: auto !important;
  transform: none !important;
}

/* Ёлочка-картинка: большая на сайте, маленькая в приложении */
.sidebar-tree {
  text-align: center;
  padding: 10px 5px;
}
.sidebar-tree img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 8px #39ff14);
}
.sidebar-tree .ded-moroz {
  width: 80px;
  margin-top: 5px;
}
.sidebar-tree .tree-gifts {
  font-size: 28px;
  margin-top: -10px;
}
/* Мобильная ёлка (вне сайдбара) */
.christmas-tree-mobile {
  position: fixed; bottom: 78px; right: 8px;
  width: 52px; z-index: 60; pointer-events: none;
  filter: drop-shadow(0 0 10px #39ff14);
  display: none;
}
body.app-view .christmas-tree-mobile {
  display: block;
}
@media (max-width: 860px) {
  .christmas-tree-mobile { display: block; }
  .sidebar-tree { display: none; }
}
body.app-view .christmas-tree {
  width: 70px !important;
  right: 12px !important; left: auto !important;
  bottom: 70px !important; top: auto !important;
  transform: none !important;
}

/* Новогодние игрушки в шапке */
.xmas-toys {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 100;
  font-size: 22px;
  text-align: center;
  padding-top: 2px;
}
.xmas-toys span {
  display: inline-block;
  margin: 0 15px;
  animation: toy-swing 3s ease-in-out infinite;
}
.xmas-toys span:nth-child(2n) { animation-delay: 0.5s; }
.xmas-toys span:nth-child(3n) { animation-delay: 1s; }
@keyframes toy-swing {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}
.vs-header { position: relative; }

/* Смайл-аватар 😀 */
.eava { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.eava-face { font-size: 1.7em; line-height: 1; }
.eava-acc { position: absolute; left: 50%; transform: translateX(-50%); line-height: 1; }
/* Шапки и головные уборы — сидят на макушке */
.eava-acc.pos-top { top: 0%; font-size: 1.35em; }
/* Очки — точно на глазах (глаза чуть выше центра лица) */
.eava-acc.pos-mid { top: 44%; transform: translate(-50%, -50%); font-size: 1.25em; }
/* Одежда — туловище под лицом */
.eava-acc.pos-bot { bottom: -4%; font-size: 1.5em; }
/* Наушники — поверх головы, как в реальности */
.eava-acc.pos-wear { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.4em; }
/* Мелкие украшения — уголок сверху */
.eava-acc.pos-deco { top: 6%; left: 78%; transform: none; font-size: 0.8em; }
/* Значок на аве — круглый оверлей в правом верхнем углу */
.ava-wrap { position: relative; display: inline-block; line-height: 0; vertical-align: middle; }
.ava-wrap > img, .ava-wrap > div, .ava-wrap > span.eava { display: block; }
/* Контейнер значков: всегда одинаково в углу авы, значки — ровным рядом, не налезают друг на друга */
.ava-badges {
  position: absolute; top: 0; right: 0; transform: translate(32%, -32%);
  display: flex; flex-direction: row; gap: 3px; z-index: 5; line-height: 1;
}
.ava-badge {
  position: relative; flex: none; box-sizing: border-box;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  overflow: hidden; padding: 1px; font-size: 16px;
}
/* На маленьких аватарках (рилсы) значок пропорционально меньше, чтобы сидел ровно */
.reel-author .ava-badge { width: 20px; height: 20px; font-size: 9px; border-width: 1.5px; }
.s-ava-in { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.story-author-ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 17px; }

/* ===== Профиль: двухколоночная раскладка как на ДуровЛох (2026-10-24) ===== */
/* Только раскладка: новых цветов и шрифтов нет, используются существующие
   переменные и классы (.card, .vs-block-head, .act). На узком экране
   колонки схлопываются в одну, ничего не выпирает вбок. */
.profile-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 14px; align-items: start; }
.profile-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.profile-side > .card { margin-bottom: 0; }
.profile-side .ava-col > div { display: block; }
.profile-side .avatar.big { width: 100% !important; height: auto !important; border-radius: 14px; font-size: 88px; }
.profile-side span.avatar.big, .profile-side div.avatar.big { aspect-ratio: 1 / 1; }
.act-big { display: block; width: 100%; box-sizing: border-box; text-align: center; padding: 12px 10px; margin-top: 10px; font-size: 16px; font-weight: 700; color: #fff; background: var(--accent); border: none; border-radius: 10px; cursor: pointer; text-decoration: none; }
.act-big-gray { background: #55565b; }
.profile-main { min-width: 0; }
.profile-info h2, .profile-main .profile-name { font-size: 22px; }
.side-friends { display: flex; flex-wrap: wrap; gap: 8px; }
.side-friend { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 56px; text-decoration: none; color: var(--text); font-size: 11px; line-height: 1.2; text-align: center; }
.side-friend .avatar { width: 48px; height: 48px; font-size: 18px; }
.side-friend span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.side-photos { display: flex; gap: 10px; align-items: center; }
.side-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; }
.photo-strip img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.side-videos { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (max-width: 860px) {
  /* Моб: профиль — ОДНА лента, а не две колонки друг за другом.
     Раньше при схлопывании grid в 1 колонку вся левая колонка целиком
     (ава+рейтинг+подарки, друзья, онлайн, подписчики, альбомы, видео,
     музыка) шла перед правой, и шапка профиля (имя/инфо) оказывалась
     в середине страницы — выглядело как «профиль показан два раза».
     Теперь display:contents растворяет обе колонки в одну ленту
     карточек, а шапка (ава слева + имя/инфо справа) поднята наверх:
     order 1 — карточка с авой, order 2 — карточка с именем/инфо,
     остальные карточки — дальше в исходном порядке. На десктопе
     раскладка не меняется (правила только внутри этого media). */
  .profile-layout { display: flex; flex-direction: column; align-items: stretch; }
  .profile-side, .profile-main { display: contents; }
  .profile-side > .card, .profile-main > .card { order: 3; margin-bottom: 0; }
  .profile-side > .card:first-child { order: 1; }
  .profile-main > .card:first-child { order: 2; }
}
