:root {
  --lx-bg: #090a10;
  --lx-card: rgba(18, 20, 32, 0.95);
  --lx-border: rgba(255, 255, 255, 0.08);
  --lx-accent: #7b2cbf;
  --lx-accent-2: #3a86ff;
  --lx-gradient: linear-gradient(135deg, #3a86ff 0%, #7b2cbf 100%);
  --lx-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --lx-text: #f8fafc;
  --lx-muted: #94a3b8;
  --lx-text-strong: #ffffff;
  --lx-overlay-03: rgba(255,255,255,0.03);
  --lx-overlay-06: rgba(255,255,255,0.06);
  --lx-overlay-08: rgba(255,255,255,0.08);
  --lx-input-bg: rgba(0,0,0,0.4);
  --lx-popover-bg: #1a1d2e;
}

/* Принудительная темная тема */
.lx-wrap { background: var(--lx-bg) !important; color: var(--lx-text); min-height: 100vh; display: flex; flex-direction: row; }

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* --- САЙДБАР --- */
.lx-sidebar {
  width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 24px 16px; border-right: 1px solid var(--lx-border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--lx-bg);
}
.lx-logo-sidebar { font-weight: 900; font-size: 24px; background: var(--lx-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; padding: 0 12px 0; cursor: pointer; }
.lx-side-divider { height: 1px; background: var(--lx-border); margin: 12px 0; }
.lx-side-link {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px;
  background: transparent; border: none; color: var(--lx-muted); font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: left; width: 100%; transition: 0.2s; position: relative;
}
.lx-side-link:hover { background: var(--lx-overlay-06); color: var(--lx-text-strong); }
.lx-side-link.active { background: rgba(58, 134, 255, 0.12); color: var(--lx-accent-2); }
.lx-side-login { background: var(--lx-gradient); color: #fff !important; justify-content: center; margin-top: 10px; border: none; }
.lx-side-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }

/* --- КОНТЕНТ --- */
.lx-content { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--lx-bg); }
.lx-topbar { padding: 20px 24px; border-bottom: 1px solid var(--lx-border); background: var(--lx-bg); display: flex; align-items: center; justify-content: center; position: sticky; top: 0; z-index: 40; }
.lx-global-search { margin-bottom: 0; background: var(--lx-overlay-06) !important; border-radius: 100px; padding: 12px 18px; border: 1px solid transparent; transition: 0.2s; width: 100%; }
.lx-global-search:focus { border-color: var(--lx-accent-2); background: var(--lx-card); }
.lx-page-body { padding: 24px; flex: 1; }

/* --- ОБЩИЕ КОМПОНЕНТЫ --- */
.lx-btn {
  background: var(--lx-gradient); color: #fff; border: none; padding: 10px 18px;
  border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.lx-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(58, 134, 255, 0.4); }
.lx-btn-sec {
  background: var(--lx-overlay-06); color: var(--lx-text-strong); border: 1px solid var(--lx-border);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.lx-btn-danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); font-size: 11px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.lx-input, .lx-textarea, .lx-select { width: 100%; background: var(--lx-input-bg); border: 1px solid var(--lx-border); color: var(--lx-text); padding: 11px; border-radius: 8px; margin-bottom: 12px; outline: none; font-size: 13.5px; }

.lx-page { display: none; }
.lx-page.active { display: block; }

.lx-modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.lx-modal-card { background: var(--lx-card); border: 1px solid var(--lx-border); border-radius: 20px; width: 90%; max-width: 520px; padding: 30px; }
.hidden { display: none !important; }

/* --- ТОП-АВТОРЫ --- */
.lx-top-author-card { display: flex; flex-direction: column; align-items: center; min-width: 110px; flex: 1; gap: 6px; margin-bottom: 12px; text-align: center; }
.lx-top-author-card img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.lx-top-author-card .lx-top-rank {
  width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: -20px; margin-right: -20px; align-self: flex-end; position: relative; top: -6px;
}
.lx-top-rank-1 { background: #3a86ff; }
.lx-top-rank-2 { background: #7b2cbf; }
.lx-top-rank-3 { background: #f59e0b; }
.lx-top-rank-other { background: var(--lx-muted); }
.lx-top-author-card a { font-size: 13px; font-weight: 600; color: var(--lx-text-strong); text-decoration: none; line-height: 1.2; }
.lx-top-author-card span { font-size: 11px; color: var(--lx-muted); }

/* --- КАРТОЧКА ПОСТА --- */
.lx-post-card { background: var(--lx-card); border-radius: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--lx-border); }
.lx-post-title { font-size: 18px; font-weight: 700; margin: 8px 0; color: var(--lx-text-strong); text-decoration: none; display: block; }
.lx-filter-area { display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--lx-border); padding-bottom: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.lx-filter-btn { background: transparent; border: none; color: var(--lx-muted); padding: 6px 0; font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; }
.lx-filter-btn.active { color: var(--lx-text-strong); border-bottom-color: var(--lx-accent-2); }

.lx-avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.lx-post-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--lx-border); padding-top: 14px; margin-top: 14px; }
.lx-post-actions { display: flex; gap: 20px; color: var(--lx-muted); font-size: 14px; align-items: center; }
.lx-post-actions span { display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* --- ПРОЧИЕ СТИЛИ ФОРУМА И ЧАТОВ (оставлены нетронутыми) --- */
.lx-auth-tabs { display: flex; border-bottom: 1px solid var(--lx-border); margin-bottom: 20px; }
.lx-auth-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-weight: 600; color: var(--lx-muted); border-bottom: 2px solid transparent; }
.lx-auth-tab.active { color: #fff; border-color: var(--lx-accent-2); }
.lx-comment-box { background: var(--lx-overlay-03); border: 1px solid var(--lx-border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.lx-notif-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* --- КВИЛЛ --- */
.ql-toolbar { background: #1a1d2d; border-color: var(--lx-border) !important; border-radius: 8px 8px 0 0; }
.ql-container { background: rgba(0,0,0,0.3); border-color: var(--lx-border) !important; color: #fff; border-radius: 0 0 8px 8px; min-height: 160px; font-size: 14.5px; }
.ql-stroke { stroke: #fff !important; } .ql-fill { fill: #fff !important; } .ql-picker { color: #fff !important; }
.ql-editor pre.ql-syntax { background: #1e1e2e; border-radius: 10px; }

/* --- ПРОФИЛЬ --- */
.profile-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; background: var(--lx-card); border: 1px solid var(--lx-border); border-radius: 20px; padding: 30px 28px; margin-bottom: 24px; }
.lx-avatar-lg { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--lx-accent-2); }
.lx-profile-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--lx-border); margin-bottom: 24px; flex-wrap: wrap; }
.lx-tab { background: transparent; border: none; color: var(--lx-muted); padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
.lx-tab.active { color: var(--lx-text-strong); border-bottom-color: var(--lx-accent-2); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.lx-stats-grid { display: flex; gap: 30px; flex-wrap: wrap; background: var(--lx-overlay-03); padding: 14px 20px; border-radius: 16px; border: 1px solid var(--lx-border); }

/* --- МОБИЛЬНЫЕ СТИЛИ --- */
.lx-mobile-nav { display: none; }
@media (max-width: 900px) {
  .lx-sidebar { display: none; }
  .lx-topbar { padding: 12px 16px; flex-wrap: wrap; justify-content: center; }
  .lx-topbar > div { max-width: 100%; }
  .lx-page-body { padding: 16px; padding-bottom: 80px; }
  .lx-mobile-nav {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--lx-card);
    border-top: 1px solid var(--lx-border); padding: 12px 8px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
  }
  .lx-mobile-link { background: transparent; border: none; padding: 8px 10px; border-radius: 12px; cursor: pointer; color: var(--lx-muted); }
  .lx-mobile-link.active { color: var(--lx-accent-2); background: rgba(58,134,255,0.1); }
  .lx-mobile-icon { font-size: 22px; display: block; line-height: 1; }
}

/* --- ДОСТИЖЕНИЯ И ИГРЫ --- */
.lx-level-title { font-size: 17px; font-weight: 800; background: var(--lx-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.lx-progress-track { width: 100%; height: 10px; background: rgba(255,255,255,0.06); border-radius: 20px; overflow: hidden; margin-top: 10px; }
.lx-progress-fill { height: 100%; background: var(--lx-gradient); border-radius: 20px; transition: width 0.4s ease; }
.lx-progress-fill.gold { background: var(--lx-gold); }
.lx-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--lx-muted); margin-top: 6px; }
.lx-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.lx-ach-item { border-radius: 12px; padding: 12px 10px; text-align: center; border: 1px solid var(--lx-border); background: rgba(255,255,255,0.03); opacity: 0.35; filter: grayscale(1); }
.lx-ach-item.unlocked { opacity: 1; filter: none; background: rgba(123, 44, 191, 0.12); border-color: rgba(123, 44, 191, 0.4); }

.lx-project-card { background: var(--lx-overlay-03); border: 1px solid var(--lx-border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.lx-news-card { background: var(--lx-card); border: 1px solid var(--lx-border); border-radius: 16px; padding: 22px; margin-bottom: 16px; position: relative; }
.lx-news-date { font-size: 11.5px; color: var(--lx-muted); margin-bottom: 8px; }
.lx-news-title { font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.lx-news-body { font-size: 14.5px; line-height: 1.7; color: var(--lx-text); white-space: pre-wrap; }

.lx-notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--lx-border); margin-bottom: 10px; cursor: pointer; background: var(--lx-overlay-03); }
.lx-notif-item.unread { background: rgba(123, 44, 191, 0.1); border-color: rgba(123, 44, 191, 0.35); }