/* ==========================================================================
   КАЛИБР · игровой форум проекта
   Классическая структура форума: тёмная шапка, разделы, темы и сообщения
   с панелью автора. Красный акцент, светлая и тёмная темы.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #e9ebef;
  --bg-soft: #dfe3e9;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #e6e9ee;
  --text: #171a1f;
  --muted: #6a7280;
  --line: #d8dce3;
  --line-strong: #c3c9d3;
  --accent: #d21f2b;
  --accent-hover: #b31621;
  --accent-soft: #fdecee;
  --accent-text: #b31621;
  --good: #2f9e6a;
  --bad: #c62828;
  --gold: #d99b21;
  --header-bg: #14161b;
  --header-bg-2: #0f1115;
  --header-text: #eceae7;
  --header-muted: #9aa1ab;
  --header-line: #282c34;
  --shadow: 0 1px 2px rgba(17, 22, 30, .06), 0 10px 26px rgba(17, 22, 30, .08);
  --shadow-sm: 0 1px 2px rgba(17, 22, 30, .07);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --wrap: 1220px;
  --pad: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0f;
  --bg-soft: #08090b;
  --surface: #14161b;
  --surface-2: #1a1d23;
  --surface-3: #22262e;
  --text: #ece9e6;
  --muted: #99a0aa;
  --line: #272b33;
  --line-strong: #373c46;
  --accent: #ff3b3b;
  --accent-hover: #ff5a5a;
  --accent-soft: rgba(255, 59, 59, .13);
  --accent-text: #ff8a8a;
  --good: #52c98f;
  --bad: #ff6b6b;
  --gold: #f0b43c;
  --header-bg: #101216;
  --header-bg-2: #0a0b0e;
  --header-text: #f1efec;
  --header-muted: #949ba6;
  --header-line: #23262d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .32);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(120% 70% at 50% -20%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%);
  background-repeat: no-repeat;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

img { max-width: 100%; display: block; }

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, p { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

svg { display: block; flex: 0 0 auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip:focus { left: 0; top: 0; }

.wrap {
  width: min(100% - var(--pad) * 2, var(--wrap));
  margin-inline: auto;
}

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.main { min-height: 60vh; padding-bottom: 8px; }

/* --------------------------------------------------------------------------
   Загрузка
   -------------------------------------------------------------------------- */

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.boot-mark {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e62935, #8f0d15);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(210, 31, 43, .34);
}
.boot-title { font-size: 22px; font-weight: 800; letter-spacing: .14em; margin-top: 12px; }
.boot-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.boot-line {
  width: 160px;
  height: 3px;
  border-radius: 999px;
  background: var(--surface-3);
  margin-top: 16px;
  overflow: hidden;
}
.boot-line span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: boot 1.1s ease-in-out infinite;
}
@keyframes boot {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-size: 13px;
  z-index: 200;
}

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
}

.header-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e62935, #8f0d15);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px rgba(0, 0, 0, .3);
  flex: 0 0 auto;
}
.brand-text { display: grid; line-height: 1.05; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .16em; color: #fff; }
.brand-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--header-muted); margin-top: 4px; }

.nav { flex: 1 1 auto; min-width: 0; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 5px;
  color: var(--header-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-link svg { width: 15px; height: 15px; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(210, 31, 43, .35);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  margin-left: auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--header-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: var(--header-text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); border-color: #3a3f49; }
.icon-btn svg { width: 17px; height: 17px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--header-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  max-width: 220px;
  transition: border-color .15s, background .15s;
}
.user-chip:hover { border-color: #3a3f49; background: rgba(255, 255, 255, .08); }
.chip-avatar {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e62935, #8f0d15);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.chip-text { display: grid; line-height: 1.15; min-width: 0; }
.chip-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-rank {
  font-size: 10.5px;
  color: var(--header-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-login { flex: 0 0 auto; }
.mobile-toggle { display: none; }

.header-strip {
  background: var(--header-bg-2);
  border-top: 1px solid var(--header-line);
}
.header-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--header-muted);
}
.strip-status { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; white-space: nowrap; }
.strip-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(210, 31, 43, .18);
}
.strip-links { display: flex; align-items: center; gap: 16px; }
.strip-links a { color: var(--header-muted); text-transform: uppercase; }
.strip-links a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-primary,
.btn-solid {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(210, 31, 43, .26);
}
.btn-primary:hover,
.btn-solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}
.btn-light:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); }
.btn-primary:disabled:hover,
.btn-solid:disabled:hover { background: var(--accent); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
}
.link-arrow svg { width: 14px; height: 14px; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Хлебные крошки
   -------------------------------------------------------------------------- */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px 0 12px;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs svg { width: 12px; height: 12px; opacity: .6; }
.breadcrumbs a { color: var(--muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent-text); }
.breadcrumbs span { color: var(--text); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Главная · баннер
   -------------------------------------------------------------------------- */

.home-hero { padding: 22px 0 0; }

.home-hero-inner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: center;
  padding: 34px 36px;
  border: 1px solid #2a2d34;
  border-radius: 10px;
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(214, 32, 43, .5), transparent 56%),
    linear-gradient(120deg, #15171c, #0f1115);
  color: #f5f2ef;
  box-shadow: 0 18px 44px rgba(12, 14, 18, .28);
}
.home-hero-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(100deg, rgba(0, 0, 0, .6), transparent 72%);
  -webkit-mask-image: linear-gradient(100deg, rgba(0, 0, 0, .6), transparent 72%);
  pointer-events: none;
}
.home-hero-inner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  pointer-events: none;
}
.home-hero-text, .home-hero-stats { position: relative; z-index: 1; }

.home-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 106, 106, .34);
  border-radius: 4px;
  background: rgba(214, 32, 43, .16);
  color: #ffb4b4;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.home-hero-kicker svg { width: 14px; height: 14px; }

.home-hero-title {
  margin-top: 16px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: .12em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(210, 31, 43, .35);
}
.home-hero-desc {
  margin-top: 13px;
  max-width: 600px;
  color: #b9b4b1;
  font-size: 14px;
  line-height: 1.65;
}
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.hero-stat {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  background: rgba(255, 255, 255, .045);
}
.hero-stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; color: #fff; }
.hero-stat span { display: block; margin-top: 3px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #9d9794; }

/* --------------------------------------------------------------------------
   Раскладка главной
   -------------------------------------------------------------------------- */

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
  padding: 24px 0 6px;
}
.home-main { display: grid; gap: 22px; min-width: 0; }
.home-aside { display: grid; gap: 14px; min-width: 0; }

.block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.block-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.block-title svg { width: 16px; height: 16px; color: var(--accent); }

/* Разделы форума */

.forum-blocks { display: grid; }
.forum-block {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 72px 82px 18px;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.forum-block:last-child { border-bottom: 0; }
.forum-block:hover { background: var(--surface-2); }
.forum-block-icon {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--accent-text);
}
.forum-block-icon svg { width: 22px; height: 22px; }
.forum-block-main { display: grid; gap: 3px; min-width: 0; }
.forum-block-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.forum-block-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-block-num { display: grid; justify-items: center; gap: 1px; }
.forum-block-num b { font-size: 14px; font-weight: 800; }
.forum-block-num small { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.forum-block-chev { width: 16px; height: 16px; color: var(--muted); }

/* Список тем */

.topic-list { display: grid; }
.topic-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.topic-item:last-child { border-bottom: 0; }
.topic-item:hover { background: var(--surface-2); border-left-color: var(--accent); }
.topic-avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}
.topic-main { display: grid; gap: 4px; min-width: 0; }
.topic-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
}
.topic-sub .sep { opacity: .5; }
.pin {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: 1px;
}
.topic-side { display: flex; align-items: center; gap: 16px; text-align: center; }
.topic-side > span { display: grid; justify-items: center; gap: 1px; min-width: 42px; }
.topic-side b { font-size: 13.5px; font-weight: 800; line-height: 1.2; }
.topic-side small { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.topic-chev { width: 15px; height: 15px; color: var(--muted); }

/* Боковые панели */

.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.side-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-title svg { width: 15px; height: 15px; color: var(--accent); }
.side-text { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.side-cta .side-text { margin-bottom: 12px; }

.side-news { display: grid; gap: 2px; }
.side-news-item {
  display: grid;
  gap: 3px;
  padding: 9px 8px;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.side-news-item:hover { background: var(--surface-2); border-left-color: var(--accent); }
.side-news-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.side-news-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.side-news-date { font-size: 10.5px; color: var(--muted); }
.side-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-text);
}
.side-more svg { width: 13px; height: 13px; }

.side-links { display: grid; }
.side-link {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s;
}
.side-link:hover { background: var(--surface-2); }
.side-link-icon { display: grid; place-items: center; color: var(--accent-text); }
.side-link-icon svg { width: 17px; height: 17px; }
.side-link b { font-size: 11px; font-weight: 700; color: var(--muted); }

.army-banner {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid #2b2e36;
  border-radius: var(--radius);
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(210, 31, 43, .36), transparent 60%),
    #15171c;
  color: #f5f2ef;
  box-shadow: 0 12px 28px rgba(12, 14, 18, .22);
  transition: border-color .15s, transform .15s;
}
.army-banner:hover { border-color: rgba(255, 106, 106, .5); transform: translateY(-1px); }
.army-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #ffb0b0;
}
.army-banner-icon svg { width: 23px; height: 23px; }
.army-banner-text { display: grid; gap: 2px; min-width: 0; }
.army-banner-text small { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #ff9b9b; font-weight: 700; }
.army-banner-text b { font-size: 15px; font-weight: 800; }
.army-banner-text span { font-size: 11.5px; color: #a8a3a0; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.army-banner > svg { width: 16px; height: 16px; color: #8f8987; }

/* --------------------------------------------------------------------------
   Секции и карточки структур
   -------------------------------------------------------------------------- */

.section { padding: 30px 0 6px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-head-left {
  display: grid;
  gap: 4px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.section-index {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.section-index:empty { display: none; }
.section-title { font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.section-desc { color: var(--muted); font-size: 13px; max-width: 440px; text-align: right; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > *,
.split > *,
.forum-layout > *,
.faction-body > *,
.login-layout > *,
.detail-grid > *,
.home-layout > *,
.profile-grid > * { min-width: 0; }

.structure-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.structure-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.structure-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.structure-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  color: var(--accent-text);
}
.structure-icon svg { width: 22px; height: 22px; }
.structure-kind {
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.structure-title { font-size: 16px; font-weight: 800; line-height: 1.3; }
.structure-desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.structure-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.structure-foot .go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 700; }
.structure-foot svg { width: 14px; height: 14px; }

.army-card {
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(210, 31, 43, .32), transparent 58%),
    #15171c;
  border-color: #2b2e36;
  color: #f5f2ef;
}
.army-card .structure-icon { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #ff9b9b; }
.army-card .structure-kind { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #cfc8c6; }
.army-card .structure-desc { color: #aaa3a1; }
.army-card .structure-foot { color: #9a9391; border-top-color: rgba(255, 255, 255, .1); }
.army-card .structure-foot .go { color: #ff8b8b; }
.army-card .structure-title { font-size: 18px; color: #fff; }
.army-card:hover { border-color: rgba(255, 106, 106, .55); }

/* --------------------------------------------------------------------------
   Новости
   -------------------------------------------------------------------------- */

.news-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.news-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.news-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.news-tag {
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.news-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.news-title { font-size: 15.5px; font-weight: 800; line-height: 1.35; }
.news-excerpt {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-more {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}
.news-more svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   Панели
   -------------------------------------------------------------------------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  color: var(--accent-text);
}
.panel-icon svg { width: 20px; height: 20px; }
.panel-title { font-size: 17px; font-weight: 800; line-height: 1.3; }
.panel-text { color: var(--muted); font-size: 13px; line-height: 1.6; }
.panel .btn { margin-top: 6px; }

.panel-dark {
  border-color: #2b2e36;
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(210, 31, 43, .34), transparent 60%),
    #15171c;
  color: #f5f2ef;
}
.panel-dark .panel-icon { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.panel-dark .panel-text { color: rgba(255, 255, 255, .76); }
.panel-dark .btn { background: #fff; border-color: #fff; color: #a32020; }
.panel-dark .btn:hover { background: rgba(255, 255, 255, .9); color: #a32020; }

/* --------------------------------------------------------------------------
   Заголовки страниц
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}
.page-head-left { display: grid; gap: 6px; max-width: 760px; }
.page-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.page-kicker a { color: inherit; }
.page-title { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
.page-desc { color: var(--muted); font-size: 14px; line-height: 1.6; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   Форум
   -------------------------------------------------------------------------- */

.forum-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 4px 0 40px;
}
.sidebar { display: grid; gap: 14px; position: sticky; top: 118px; }
.forum-main { min-width: 0; display: grid; gap: 16px; }

.cat-list { display: grid; gap: 2px; }
.cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 5px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.cat-link > span:first-child { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cat-link svg { width: 15px; height: 15px; }
.cat-link:hover { background: var(--surface-2); color: var(--text); }
.cat-link.active { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent-text); }
.cat-count {
  min-width: 24px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  flex: 0 0 auto;
}
.cat-link.active .cat-count { background: var(--accent); border-color: var(--accent); color: #fff; }

.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-stats > div {
  display: grid;
  gap: 1px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  text-align: center;
}
.side-stats b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.side-stats span { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.cat-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.cat-head { display: flex; align-items: center; gap: 13px; min-width: 0; }
.cat-head-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--accent-text);
  flex: 0 0 auto;
}
.cat-head-icon svg { width: 23px; height: 23px; }
.cat-head-text { display: grid; gap: 3px; min-width: 0; }
.cat-head-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
.cat-head-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.forum-main .forum-blocks {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.topic-list-full {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Тема и сообщения
   -------------------------------------------------------------------------- */

.topic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 0 18px;
}
.topic-head-main { display: grid; gap: 8px; min-width: 0; }
.topic-head h1 { font-size: clamp(21px, 3vw, 28px); font-weight: 800; line-height: 1.22; letter-spacing: -.015em; overflow-wrap: anywhere; }
.topic-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.topic-head-meta span { display: inline-flex; align-items: center; gap: 5px; }
.topic-head-meta svg { width: 13px; height: 13px; }

.posts { display: grid; gap: 12px; }

.post {
  display: grid;
  grid-template-columns: 194px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-author {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
  padding: 18px 14px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  text-align: center;
  min-width: 0;
}
.post-avatar {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 2px;
  overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-status { font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.post-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: anywhere;
}
.post-name:hover { color: var(--accent-text); }

.post-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.4;
  white-space: nowrap;
}
.rank-badge svg { width: 12px; height: 12px; }
.rank-creator {
  background: linear-gradient(180deg, #ffe6a8, #f0b43c);
  border-color: #d99b21;
  color: #3a2600;
  box-shadow: 0 0 0 1px rgba(240, 180, 60, .35), 0 4px 12px rgba(217, 155, 33, .3);
}
.rank-admin { background: #fdecec; border-color: #f2b8b8; color: #b31621; }
.rank-mod { background: #fff5df; border-color: #f0d49a; color: #8a5a00; }
.rank-helper { background: #e9f8ef; border-color: #a9dfbe; color: #1f7a4a; }
.rank-faction { background: var(--surface-3); border-color: var(--line-strong); color: var(--muted); }
[data-theme="dark"] .rank-admin { background: rgba(255, 59, 59, .16); border-color: rgba(255, 90, 90, .4); color: #ff9b9b; }
[data-theme="dark"] .rank-mod { background: rgba(240, 180, 60, .16); border-color: rgba(240, 180, 60, .4); color: #f0c069; }
[data-theme="dark"] .rank-helper { background: rgba(82, 201, 143, .14); border-color: rgba(82, 201, 143, .36); color: #7cdcaa; }

.rank-title { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.post-role {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-date { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.post-date svg { width: 11px; height: 11px; }

.post-content { display: grid; align-content: start; gap: 12px; padding: 22px 24px; min-width: 0; min-height: 150px; }
.post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
  font-size: 15px;
}
.post-body strong { font-weight: 800; }
.post-body em { font-style: italic; }
.post-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

.creator-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: start;
  padding: 4px 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(240, 180, 60, .18), rgba(240, 180, 60, .04));
  border: 1px solid rgba(217, 155, 33, .4);
  color: #8a5a00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.creator-ribbon svg { width: 13px; height: 13px; }
[data-theme="dark"] .creator-ribbon { color: #f0c069; background: linear-gradient(90deg, rgba(240, 180, 60, .16), transparent); }

.post-creator { border-color: rgba(217, 155, 33, .55); }
.post-creator .post-author {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(240, 180, 60, .16), transparent 60%),
    var(--surface-2);
}
.post-creator .post-avatar {
  background: linear-gradient(160deg, #ffe6a8, #d99b21);
  border-color: #d99b21;
  color: #3a2600;
  box-shadow: 0 6px 18px rgba(217, 155, 33, .35);
}

.reply-card { margin-top: 18px; }
.reply-card .form-card-title { display: inline-flex; align-items: center; gap: 7px; }
.reply-card .form-card-title svg { width: 17px; height: 17px; color: var(--accent); }
.topic-foot { padding: 22px 0 46px; }

/* --------------------------------------------------------------------------
   Формы
   -------------------------------------------------------------------------- */

.form-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.form-card + .form-card { margin-top: 12px; }
.form-card-head { display: grid; gap: 4px; margin-bottom: 16px; }
.form-card-title { font-size: 17px; font-weight: 800; }
.form-card-sub { color: var(--muted); font-size: 12.5px; }

.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder,
.textarea::placeholder { color: var(--muted); }
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.select { appearance: none; cursor: pointer; }

.form-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.code-input {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .28em;
  text-align: center;
  text-transform: uppercase;
  padding: 14px 12px;
}
.code-input::placeholder { letter-spacing: .18em; font-weight: 500; }

.form-error {
  display: none;
  padding: 9px 12px;
  border: 1px solid #f0b8b8;
  border-left: 3px solid var(--bad);
  border-radius: 4px;
  background: #fdecec;
  color: #a11d1d;
  font-size: 12.5px;
  line-height: 1.5;
}
.form-error.show { display: block; }
.form-success {
  display: none;
  padding: 9px 12px;
  border: 1px solid #b5e0c8;
  border-left: 3px solid var(--good);
  border-radius: 4px;
  background: #e9f8ef;
  color: #1f7a4a;
  font-size: 12.5px;
  line-height: 1.5;
}
.form-success.show { display: block; }
[data-theme="dark"] .form-error { background: rgba(255, 59, 59, .12); border-color: rgba(255, 90, 90, .32); color: #ff9b9b; }
[data-theme="dark"] .form-success { background: rgba(82, 201, 143, .12); border-color: rgba(82, 201, 143, .32); color: #7cdcaa; }

/* --------------------------------------------------------------------------
   Значки
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge-outline { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-text); background: var(--accent-soft); }

/* --------------------------------------------------------------------------
   Списки
   -------------------------------------------------------------------------- */

.list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-title { font-size: 14px; font-weight: 700; line-height: 1.4; }
.list-sub { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
}
.list-meta a { color: var(--accent-text); font-weight: 700; }
.list-side { display: grid; justify-items: end; gap: 8px; }
.list-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   Таблицы
   -------------------------------------------------------------------------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}
.table td a { font-weight: 700; }
.table td a:hover { color: var(--accent-text); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Пустые состояния
   -------------------------------------------------------------------------- */

.empty {
  padding: 30px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.error-box {
  margin: 28px 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.error-box h3 { font-size: 19px; font-weight: 800; }
.error-box p { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.error-box .btn { margin-top: 14px; }

.loading {
  display: grid;
  gap: 10px;
  padding: 30px 0;
}
.skeleton {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
}
.skeleton.w40 { width: 40%; height: 16px; }
.skeleton.w60 { width: 60%; height: 16px; }
.skeleton.h80 { height: 80px; }
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   Структура (армия и фракции)
   -------------------------------------------------------------------------- */

.faction-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr);
  gap: 24px;
  align-items: start;
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 140% at 100% 0%, var(--accent-soft), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.faction-hero-left { display: grid; gap: 12px; min-width: 0; }
.faction-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.faction-kicker svg { width: 17px; height: 17px; }
.faction-title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.faction-desc { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 640px; }
.faction-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.leader-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.leader-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.leader-name { font-size: 19px; font-weight: 800; line-height: 1.25; }
a.leader-name:hover { color: var(--accent-text); }
.leader-rank { font-size: 12.5px; color: var(--muted); }
.leader-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11.5px; color: var(--accent-text); font-weight: 700; }
.leader-link svg { width: 14px; height: 14px; }

.faction-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .7fr);
  gap: 24px;
  align-items: start;
  padding: 22px 0 46px;
}
.ranks {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rank-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.rank-row:last-child { border-bottom: 0; }
.rank-num { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.rank-name { font-size: 12.5px; }
.rank-row.top .rank-name { font-weight: 700; }
.rank-row.top .rank-num { color: var(--accent-text); }

/* --------------------------------------------------------------------------
   Профиль
   -------------------------------------------------------------------------- */

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 140% at 0% 0%, var(--accent-soft), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 86px;
  height: 86px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e62935, #8f0d15);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(210, 31, 43, .3);
  flex: 0 0 auto;
}
.profile-info { display: grid; gap: 7px; min-width: 0; flex: 1 1 300px; }
.profile-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.profile-sub { font-size: 12.5px; color: var(--muted); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.metric-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric-num { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.metric-label { margin-top: 3px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.detail-grid > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-key { color: var(--muted); }
.detail-val { font-weight: 700; text-align: right; }

/* --------------------------------------------------------------------------
   Вход
   -------------------------------------------------------------------------- */

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 28px;
  align-items: start;
  padding: 30px 0 50px;
}
.login-copy { display: grid; gap: 14px; align-content: start; min-width: 0; }
.login-title { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; }
.login-copy > p { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 560px; }
.login-steps { display: grid; gap: 8px; max-width: 560px; }
.login-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.login-step b {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
}
.login-box {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-box-title { font-size: 17px; font-weight: 800; }

/* --------------------------------------------------------------------------
   Статья
   -------------------------------------------------------------------------- */

.article {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.article-head { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-title { font-size: clamp(23px, 3.4vw, 32px); font-weight: 800; line-height: 1.18; letter-spacing: -.015em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.article-body { padding: 20px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.75; }
.article-back { padding-top: 14px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.footer {
  margin-top: 34px;
  background: var(--header-bg);
  border-top: 2px solid var(--accent);
  color: var(--header-text);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 24px;
  padding: 30px 0 22px;
}
.footer-wordmark { font-size: 18px; font-weight: 800; letter-spacing: .18em; color: #fff; }
.footer-note { margin-top: 8px; max-width: 340px; color: var(--header-muted); font-size: 12px; line-height: 1.6; }
.footer-title {
  margin-bottom: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
}
.footer-links { display: grid; gap: 6px; }
.footer-links a { color: var(--header-muted); font-size: 12.5px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-top: 1px solid var(--header-line);
  font-size: 11px;
  color: var(--header-muted);
}

/* --------------------------------------------------------------------------
   Тост
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 300;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--header-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Аватары, статусы и закрытые темы
   -------------------------------------------------------------------------- */

.chip-avatar, .topic-avatar, .avatar { overflow: hidden; }
.chip-avatar img,
.topic-avatar img,
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 7px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: 1px;
}
.lock-tag svg { width: 11px; height: 11px; }
.lock-tag.big { margin-right: 10px; padding: 5px 9px; vertical-align: 3px; }
.lock-tag.big svg { width: 16px; height: 16px; }
.lock-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lock-state svg { width: 12px; height: 12px; }
.topic-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Редактор сообщений
   -------------------------------------------------------------------------- */

.composer {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 7px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fmt-btn svg { width: 16px; height: 16px; }
.fmt-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.fmt-preview { width: auto; padding: 0 9px; }
.fmt-preview span { display: none; }
.composer-sep { width: 1px; height: 20px; background: var(--line); margin: 0 5px; }
.composer-colors-label { display: grid; place-items: center; color: var(--muted); }
.composer-colors-label svg { width: 15px; height: 15px; }
.composer-colors { display: flex; align-items: center; gap: 4px; }
.color-dot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
.color-dot:hover { transform: scale(1.14); }
.color-reset {
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.composer-input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--surface) !important;
  min-height: 200px;
  padding: 14px;
  resize: vertical;
  font-size: 14.5px;
  line-height: 1.65;
}
.composer-preview {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  line-height: 1.7;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
}
.composer-hint {
  font-family: var(--mono);
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-count { flex: 0 0 auto; }
.reply-card .composer-input { min-height: 150px; }

/* --------------------------------------------------------------------------
   Профиль · настройка
   -------------------------------------------------------------------------- */

.profile-status { font-size: 13px; font-weight: 700; line-height: 1.4; }
.profile-editor {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-editor .form-card-title { display: inline-flex; align-items: center; gap: 7px; }
.profile-editor .form-card-title svg { width: 17px; height: 17px; color: var(--accent); }
.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.check-line input { accent-color: var(--accent); }

/* --------------------------------------------------------------------------
   Админ-панель
   -------------------------------------------------------------------------- */

.admin-stats { margin: 16px 0 20px; }
.admin-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-list { display: grid; }
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row-main { display: grid; gap: 3px; min-width: 0; }
.admin-row-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
a.admin-row-title:hover { color: var(--accent-text); }
.admin-row-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.admin-row-sub span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-sm { padding: 6px 9px; font-size: 12px; max-width: 190px; }

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .forum-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (max-width: 920px) {
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 10px;
    background: var(--header-bg);
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .35);
  }
  .nav.open { display: block; }
  .nav-list { display: grid; gap: 2px; overflow: visible; }
  .nav-link { padding: 10px 12px; }
  .mobile-toggle { display: grid; }
  .header-main { position: relative; }
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  .home-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forum-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .side-panel:first-child { grid-column: 1 / -1; }
  .faction-hero { grid-template-columns: minmax(0, 1fr); }
  .faction-body { grid-template-columns: minmax(0, 1fr); }
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --pad: 16px; }
  .home-hero-inner { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 20px; }
  .home-hero-title { font-size: clamp(30px, 10vw, 44px); }
  .home-aside { grid-template-columns: minmax(0, 1fr); }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-author {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "avatar badges"
      "avatar role"
      "avatar date";
    justify-items: start;
    text-align: left;
    gap: 3px 12px;
    padding: 13px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .post-avatar { grid-area: avatar; width: 52px; height: 52px; font-size: 16px; align-self: start; }
  .post-name { grid-area: name; align-self: end; }
  .post-badges { grid-area: badges; justify-content: flex-start; }
  .post-role { grid-area: role; border-top: 0; padding-top: 0; width: auto; }
  .post-date { grid-area: date; }
  .post-content { padding: 15px 16px; }
  .topic-head { padding-top: 2px; }
  .topic-side { gap: 10px; }
  .topic-side > span { min-width: 34px; }
  .forum-block { grid-template-columns: 42px minmax(0, 1fr) 18px; gap: 11px; }
  .forum-block-num { display: none; }
  .forum-block-icon { width: 42px; height: 42px; }
  .forum-block-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar .side-panel:first-child { grid-column: auto; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .section-desc { text-align: left; max-width: none; }
  .topic-list-full .topic-item { grid-template-columns: 36px minmax(0, 1fr) 16px; }
  .topic-avatar { width: 36px; height: 36px; font-size: 11px; }
  .topic-side { display: none; }
  .page-head { padding: 16px 0 14px; }
  .header-strip-inner { justify-content: center; }
  .strip-links { display: none; }
  .brand-sub { display: none; }
  .user-chip .chip-text { display: none; }
  .user-chip { padding: 5px; }
  .avatar { width: 68px; height: 68px; font-size: 22px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .header-main { gap: 10px; min-height: 58px; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; }
  .brand-name { font-size: 15px; }
  .header-tools { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .home-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stat { padding: 11px 12px; }
  .hero-stat b { font-size: 21px; }
  .home-hero-actions .btn { flex: 1 1 auto; }
  .block-head { padding: 10px 12px; }
  .topic-item { padding: 11px 12px; gap: 10px; }
  .topic-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cat-head-row { padding: 12px; }
  .cat-head-title { font-size: 17px; }
  .cat-head-icon { width: 40px; height: 40px; }
  .post-body { font-size: 14px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-brand { grid-column: auto; }
  .login-box { padding: 16px; }
  .article { padding: 18px; }
}

/* --------------------------------------------------------------------------
   Дополнительный адаптив для редактора и панели
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .composer-hint { display: none; }
  .admin-row { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-row .badge { display: none; }
  .admin-row-sub span { white-space: normal; }
  .select-sm { max-width: 150px; }
  .profile-editor { padding: 16px; }
  .post-content { min-height: 110px; }
}

@media (max-width: 480px) {
  .composer-toolbar { gap: 1px; padding: 6px; }
  .composer-colors { gap: 3px; }
  .color-dot { width: 16px; height: 16px; }
  .composer-sep { margin: 0 3px; }
  .composer-input { min-height: 170px; }
}
