/* ==============================================================
   L2VM Forum — тёмная тема
   ============================================================== */

:root {
  --bg: #0c1015;
  --bg-alt: #131922;
  --card: #171e29;
  --card-2: #1c2431;
  --border: #262f3d;
  --border-light: #37455a;
  --text: #dbe2ec;
  --text-muted: #8992a6;
  --text-dim: #5c6579;
  --accent: #4fb3ff;
  --accent-dark: #2f8fd6;
  --accent-2: #8b6cf0;
  --accent-glow: rgba(79, 179, 255, 0.22);
  --danger: #ff5c7a;
  --ok: #3fce7a;
  --warn: #ffb84f;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --ease: 0.18s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

/* Сбрасываем нативный вид <button> в Chromium/Edge — иначе поверх наших
   стилей остаётся системная скруглённая рамка/тень кнопки, из-за которой
   подчёркивания и границы визуально "обрезаются" по её скруглению. */
button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  margin: 0;
}

html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 12% -10%, rgba(79, 179, 255, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(139, 108, 240, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-glow); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: #fff; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* --- Header --- */
.site-header {
  background: rgba(19, 25, 34, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, var(--shadow-sm);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
}
.logo-img {
  height: 30px;
  width: auto;
  display: block;
  vertical-align: middle;
}
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; height: 100%; }
.main-nav a {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--ease), background var(--ease);
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.user-box { display: flex; align-items: center; gap: 12px; position: relative; }
.user-group { color: var(--text-muted); font-size: 13px; }

/* --- Account dropdown menu --- */
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background var(--ease), border-color var(--ease);
}
.account-trigger:hover { background: var(--card); border-color: var(--border); }
.account-trigger .user-name { font-weight: 700; }
.account-trigger .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-light); }

.account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--card-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  animation: dropdown-in 0.16s ease;
}
.account-dropdown.open { display: block; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: linear-gradient(160deg, rgba(79, 179, 255, 0.1), transparent 70%), var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.account-dropdown-name { font-weight: 800; font-size: 16px; }

.account-dropdown-stats {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.account-stat {
  flex: 1;
  text-align: center;
  padding: 12px 2px;
  border-right: 1px solid var(--border);
  transition: background var(--ease);
}
.account-stat:hover { background: rgba(255, 255, 255, 0.02); }
.account-stat:last-child { border-right: none; }
.account-stat .num { display: block; font-weight: 800; color: #fff; font-size: 16px; }
.account-stat .muted { font-size: 11px; }

.account-dropdown-menu { padding: 6px; border-bottom: 1px solid var(--border); }
.account-dropdown-menu:last-child { border-bottom: none; }
.account-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--ease), color var(--ease), padding-left var(--ease);
}
.account-dropdown-menu a:hover { background: var(--card); color: var(--accent); text-decoration: none; padding-left: 14px; }
.menu-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); transition: color var(--ease); }
.account-dropdown-menu a:hover .menu-icon { color: var(--accent); }
.account-dropdown-logout a { color: var(--danger); }
.account-dropdown-logout .menu-icon { color: var(--danger); }
.account-dropdown-logout a:hover { background: rgba(255, 92, 122, 0.1); }

/* --- Layout --- */
.content { padding: 24px 16px 60px; flex: 1; width: 100%; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.01em; color: #fff; margin: 0 0 12px; }
h2 { font-size: 19px; font-weight: 700; color: #fff; }

.muted { color: var(--text-muted); font-size: 13px; }
.breadcrumb { margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--accent); }

/* --- Flash messages --- */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.flash-ok { background: rgba(63, 206, 122, 0.1); border: 1px solid rgba(63, 206, 122, 0.35); color: var(--ok); }
.flash-err { background: rgba(255, 92, 122, 0.1); border: 1px solid rgba(255, 92, 122, 0.35); color: var(--danger); }

/* --- Toast-уведомления (авто-скрытие через 5 сек, см. includes/header.php) --- */
.toast-container {
  position: fixed;
  top: 78px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 32px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card-2);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--ok);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text);
  animation: toast-in 0.25s cubic-bezier(.4,0,.2,1);
}
.toast-err { border-left-color: var(--danger); }
.toast-body { flex: 1; }
.toast-close {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  margin: -2px 0 0;
}
.toast-close:hover { color: #fff; }
.toast.toast-hide { animation: toast-out 0.25s cubic-bezier(.4,0,.2,1) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(0.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(24px) scale(0.98); }
}

@media (max-width: 500px) {
  .toast-container { left: 16px; right: 16px; max-width: none; }
}

/* --- Cards --- */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* --- Category / forum list (home page) --- */
.category-block { margin-bottom: 28px; }
.category-title {
  background: linear-gradient(135deg, var(--bg-alt), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 16px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.forum-list { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.forum-row {
  display: grid;
  grid-template-columns: 1fr 120px 220px;
  gap: 12px;
  padding: 15px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  transition: background var(--ease);
}
.forum-row:first-child { border-top: none; }
.forum-row:hover { background: var(--card-2); }
.forum-name { font-size: 16px; font-weight: 700; transition: color var(--ease); }
.forum-row:hover .forum-name { color: var(--accent); }
.forum-desc { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.forum-stats { text-align: center; color: var(--text-muted); font-size: 13px; }
.forum-lastpost { font-size: 13px; text-align: right; }

/* --- Thread list --- */
.thread-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.thread-row {
  display: grid;
  grid-template-columns: 1fr 100px 180px;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  transition: background var(--ease);
}
.thread-row:first-child { border-top: none; }
.thread-row:hover { background: var(--card-2); }
.thread-row.pinned { background: linear-gradient(90deg, rgba(79, 179, 255, 0.08), transparent); }
.thread-title { font-size: 15px; font-weight: 700; }
.thread-row:hover .thread-title { color: var(--accent); }
.thread-stats { text-align: center; color: var(--text-muted); font-size: 13px; }
.thread-lastpost { font-size: 13px; text-align: right; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(63, 206, 122, 0.15);
  border: 1px solid rgba(63, 206, 122, 0.3);
  color: var(--ok);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.badge-lock { background: rgba(255, 92, 122, 0.15); border-color: rgba(255, 92, 122, 0.3); color: var(--danger); }

/* --- Posts --- */
.post-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.post-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  align-items: stretch;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease);
}
.post-row:target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.post-username { font-weight: 700; }
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.post-toolbar { display: flex; align-items: center; gap: 10px; }
.post-num { color: var(--text-muted); font-size: 12px; }
.post-body-col { display: flex; flex-direction: column; }
.post-body { word-wrap: break-word; }
.post-body p { margin: 0 0 10px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body img { border-radius: 6px; }
.post-body blockquote {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.post-body code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: Consolas, monospace;
  font-size: 13px;
}
.post-body details {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.post-body details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.post-signature { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }

.video-embed-wrap { position: relative; padding-top: 56.25%; margin-bottom: 10px; border-radius: 6px; overflow: hidden; }
.video-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.link-btn.active-like { color: var(--accent); }
.rep-controls { display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.rep-score { font-size: 13px; min-width: 14px; text-align: center; }
.icon-btn.active-rep-up { color: var(--ok); }
.icon-btn.active-rep-down { color: var(--danger); }

.post-likes-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.post-likes-bar .menu-icon { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.post-likes-bar span { color: var(--accent); }

/* --- Трофеи --- */
.trophy-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.trophy-row {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  opacity: 0.5;
  transition: opacity var(--ease), border-color var(--ease), transform var(--ease);
}
.trophy-row:hover { opacity: 0.7; transform: translateY(-1px); }
.trophy-row.trophy-earned {
  opacity: 1;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(79, 179, 255, 0.06), var(--card));
  box-shadow: var(--shadow-sm);
}
.trophy-row.trophy-earned:hover { opacity: 1; box-shadow: var(--shadow-md); }
.trophy-points {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
}
.trophy-earned .trophy-points { border-color: var(--accent); color: var(--accent); background: rgba(79, 179, 255, 0.1); }
.trophy-info { flex: 1; min-width: 0; }
.trophy-title { font-weight: 700; margin-bottom: 2px; }
.trophy-earned-label { color: var(--accent); }

/* --- Ваши публикации / поиск по сообщениям --- */
.pub-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.pub-row {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), transform var(--ease);
}
.pub-row:hover { border-color: var(--border-light); transform: translateY(-1px); }
.pub-body { flex: 1; min-width: 0; }
.pub-title { display: block; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.pub-excerpt {
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pub-meta { font-size: 12px; }
.pub-meta a { color: var(--text-muted); font-weight: 600; }
.pub-meta a:hover { color: var(--accent); }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: none;
  transition: background var(--ease), color var(--ease);
}
.link-btn:hover { background: var(--card-2); color: var(--accent); filter: none; transform: none; box-shadow: none; }
.link-btn .menu-icon { width: 15px; height: 15px; }
.link-btn-danger:hover { background: rgba(255, 92, 122, 0.1); color: var(--danger); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  display: flex;
  box-shadow: none;
  transition: background var(--ease), color var(--ease);
}
.icon-btn:hover { background: var(--card-2); color: var(--accent); filter: none; transform: none; box-shadow: none; }
.icon-btn .menu-icon { width: 15px; height: 15px; }

.edit-form { margin-top: 12px; }
.edit-form-buttons { margin-top: 10px; display: flex; }
.btn-cancel-edit {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--text);
  margin-left: 8px;
}
.btn-cancel-edit:hover { border-color: var(--danger); color: var(--danger); }

/* --- Rich text editor (reply / edit / new thread) --- */
.rich-editor { margin-bottom: 14px; }
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 6px 8px;
}
.rt-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  margin-right: 6px;
  border-right: 1px solid var(--border);
}
.rt-group:last-child, .rt-group-right { border-right: none; margin-right: 0; padding-right: 0; }
.rt-group-right { margin-left: auto; }
.rt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  padding: 6px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.rt-btn:hover { background: var(--card); color: var(--text); }
.rt-btn .menu-icon { width: 16px; height: 16px; }
.rt-bold { font-weight: 800; }
.rt-italic { font-style: italic; }
.rt-underline { text-decoration: underline; }
.rt-preview-btn { font-weight: 500; gap: 6px; }
.rt-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 5px 4px;
  border-radius: 5px;
  max-width: 110px;
}
.rt-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.rich-content {
  min-height: 140px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.rich-content { transition: border-color var(--ease), box-shadow var(--ease); }
.rich-content:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.rich-content.is-empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.rich-content.rich-error { border-color: var(--danger); }
.rich-content p { margin: 0 0 10px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content blockquote {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}
.rich-content code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: Consolas, monospace;
}
.rich-content img { max-width: 100%; border-radius: 6px; }

.rich-hidden-input { display: none; }

.rich-preview {
  display: none;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  padding: 12px;
  font-size: 14px;
}
.rich-preview.open { display: block; }

.rich-attach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.rt-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.rt-attach-btn:hover { border-color: var(--accent); color: var(--accent); }
.rt-attach-btn .menu-icon { width: 15px; height: 15px; }

.emoji-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.emoji-panel button {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
}
.emoji-panel button:hover { background: var(--bg-alt); }

.gate-panel {
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-height: 280px;
  overflow-y: auto;
}
.gate-panel button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
}
.gate-panel button:hover { background: var(--bg-alt); color: var(--accent); }

.gated-content-locked {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}
.gated-content-revealed {
  background: rgba(79, 179, 255, 0.1);
  border-radius: 3px;
  padding: 1px 4px;
}

/* --- Avatars & mini-profile (XenForo-style author card) --- */
.avatar { border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 3px var(--bg-alt); }
.avatar-fallback { display: flex; align-items: center; justify-content: center; font-weight: 700; border: 1px solid; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 56px; height: 56px; font-size: 20px; }
.avatar-lg { width: 88px; height: 88px; font-size: 32px; box-shadow: 0 0 0 4px var(--bg-alt), var(--shadow-md); }

.mini-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.mini-profile .post-username { margin-top: 4px; transition: filter var(--ease); }
.mini-profile .post-username:hover { filter: brightness(1.3); }
.author-stats {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.group-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
}

/* --- Full profile page --- */
.profile-banner {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(79, 179, 255, 0.08), transparent 60%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px;
}
.profile-banner-info h1 { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; font-size: 24px; }
.profile-meta-line { margin-top: 4px; }

.profile-stats-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  padding: 14px 0;
  margin-bottom: 20px;
}
.profile-stat { text-align: center; }
.profile-stat .num { display: block; font-size: 22px; font-weight: 700; color: #fff; }

.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.profile-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-muted);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.wall-post-form { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.wall-post-form textarea { flex: 1; margin: 0; }
.wall-post-form button { align-self: flex-start; }

.wall-list { display: flex; flex-direction: column; gap: 12px; }
.wall-post {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease);
}
.wall-post:hover { border-color: var(--border-light); }
.wall-post-body { flex: 1; }
.wall-post-body .link-btn { padding: 2px 4px; margin-top: 4px; font-size: 12px; }

/* --- Sidebar widgets (home page) --- */
.home-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.widget h3 {
  margin: 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--bg-alt), var(--card));
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.widget-list { display: flex; flex-direction: column; }
.widget-item {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  transition: background var(--ease);
}
.widget-item:hover { background: var(--card-2); }
.widget-item:first-child { border-top: none; }
.widget-item a { display: block; font-weight: 600; margin-bottom: 2px; }

.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-item .avatar { flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { display: block; font-weight: 600; margin-bottom: 2px; }
.activity-body .muted { margin-bottom: 2px; }
.activity-body .muted a { display: inline; font-weight: 600; color: var(--text); }
.activity-body .muted a:hover { color: var(--accent); }
.activity-forum { color: var(--accent); font-size: 12px; }

/* --- Forms --- */
form label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form input[type=file],
form select,
form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
form input[type=text]:focus,
form input[type=email]:focus,
form input[type=password]:focus,
form input[type=number]:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
form textarea { resize: vertical; }

.inline-form { display: inline-block; margin-right: 6px; }
.inline-form select, .inline-form input { display: inline-block; width: auto; }

button, .btn-accent {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #06131f;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
  box-shadow: 0 2px 10px rgba(79, 179, 255, 0.25);
}
button:hover, .btn-accent:hover {
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 179, 255, 0.35);
}
button:active, .btn-accent:active { transform: translateY(0); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #d94569); color: #2a0410; box-shadow: 0 2px 10px rgba(255, 92, 122, 0.25); }
.btn-danger:hover { box-shadow: 0 6px 18px rgba(255, 92, 122, 0.35); }

.auth-card { max-width: 420px; margin: 0 auto; }

.avatar-settings-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.avatar-settings-forms { flex: 1; min-width: 240px; }
.avatar-settings-forms form { display: flex; align-items: flex-end; gap: 12px; }
.avatar-settings-forms label { flex: 1; margin-bottom: 0; }

/* --- Tables (admin) --- */
.table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
.table th { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: var(--card); }

/* --- Resources --- */
.category-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.category-filter a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.category-filter a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.category-filter a.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: var(--accent); color: #06131f; font-weight: 700; }

.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.resource-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.resource-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.resource-card-body { flex: 1; min-width: 0; }
.resource-title { font-weight: 700; display: block; margin-bottom: 6px; }
.resource-meta { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }
.resource-meta-author { display: flex; align-items: center; gap: 6px; }

.resource-head { align-items: center; }
.resource-head-main { display: flex; align-items: center; gap: 14px; }
.resource-head-main h1 { margin: 0; }

.resource-icon { border-radius: 8px; object-fit: cover; display: block; flex-shrink: 0; }
.resource-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent);
}
.resource-icon-md { width: 48px; height: 48px; font-size: 18px; }
.resource-icon-lg { width: 64px; height: 64px; font-size: 26px; }

/* --- Store --- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.store-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), transform var(--ease);
}
.store-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.store-price {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 10px 0;
}

/* --- Платные повышения (упорядоченный список вместо карточек) --- */
.upgrade-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-wrap: wrap;
  transition: background var(--ease);
}
.upgrade-row:hover { background: var(--card-2); }
.upgrade-row:first-child { border-top: none; }
.upgrade-title { font-weight: 700; font-size: 15px; }
.upgrade-action { display: flex; }
.upgrade-buy-form { display: flex; gap: 8px; align-items: center; }
.upgrade-buy-form select { width: auto; margin: 0; }

.group-edit-row { display: none; }
.group-edit-row.open { display: table-row; }
.group-edit-row form { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 0; }
.group-edit-row label { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.group-edit-row input[type=text], .group-edit-row input[type=number] { width: auto; margin-top: 0; }

/* --- Права групп (матрица форум/категории ресурсов) --- */
.perm-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.perm-table { margin-bottom: 0; min-width: 420px; }
.perm-table th, .perm-table td { text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* --- Admin dashboard --- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), border-color var(--ease);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-card.stat-warn { border-color: var(--danger); }
.stat-num { font-size: 28px; font-weight: 800; color: #fff; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-nav a {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: border-color var(--ease), color var(--ease), transform var(--ease);
}
.admin-nav a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }

/* --- Pagination --- */
.pagination { display: flex; gap: 6px; margin: 20px 0; }
.pagination a {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.pagination a:hover { border-color: var(--border-light); color: #fff; text-decoration: none; }
.pagination a.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #06131f; border-color: var(--accent); }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }

@media (max-width: 500px) {
  .footer-wrap { flex-direction: column; text-align: center; }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .forum-row, .thread-row, .post-row { grid-template-columns: 1fr; }
  .main-nav { flex-wrap: wrap; }
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-stats { justify-content: center; }
}
