/* ============================================================================
   Kyber-Arena — тема standart.
   Светлая тема по умолчанию, тёмная — через <html data-theme="dark">.
   Акцент — индиго. Макет: шапка + 3 колонки (левый/контент/правый).
   ========================================================================= */

:root {
    --accent: #4f46e5;
    --accent-strong: #4338ca;
    --accent-2: #7c83ff;
    --accent-soft: rgba(79, 70, 229, .10);
    --on-accent: #ffffff;

    --bg: #eef1f7;
    --bg-soft: #ffffff;
    --bg-card: #ffffff;
    --bg-elev: #f4f6fb;
    --text: #1b2130;
    --text-muted: #69728a;
    --border: #e4e8f1;

    --green: #16a34a;
    --green-soft: rgba(22, 163, 74, .12);
    --red: #dc2626;
    --red-soft: rgba(220, 38, 38, .12);
    --amber: #d97706;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 4px 20px rgba(30, 41, 79, .07);
    --shadow-lg: 0 12px 34px rgba(30, 41, 79, .12);
    --container: 1260px;
    --header-h: 66px;
}

html[data-theme="dark"] {
    --accent: #6d76ff;
    --accent-strong: #5b64f0;
    --accent-2: #9aa0ff;
    --accent-soft: rgba(109, 118, 255, .16);
    --on-accent: #ffffff;

    --bg: #0d1017;
    --bg-soft: #141a24;
    --bg-card: #161d29;
    --bg-elev: #1f2734;
    --text: #e7eaf2;
    --text-muted: #8b93a7;
    --border: #28313f;

    --green: #34d17a;
    --green-soft: rgba(52, 209, 122, .14);
    --red: #f2554d;
    --red-soft: rgba(242, 85, 77, .14);
    --amber: #f0a038;

    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", "Inter", Roboto, Arial, sans-serif;
    background:
        radial-gradient(1000px 520px at 82% -6%, var(--accent-soft), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 { line-height: 1.2; }

img { max-width: 100%; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }
.ta-right { text-align: right; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

.page-title { font-size: 26px; font-weight: 800; margin: 0 0 18px; }
.page-subtitle { font-size: 18px; font-weight: 700; margin: 22px 0 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .page-title { margin: 0; }

/* --- Кнопки --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; transition: all .15s;
    background: var(--bg-elev); color: var(--text); line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--on-accent); box-shadow: 0 6px 16px var(--accent-soft); }
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 10px 22px var(--accent-soft); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-login { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* --- Формы --- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
input, textarea, select {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: var(--bg-elev); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 96px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.inline-form { display: inline-block; }
.form-error, .form-success {
    padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px;
    border: 1px solid transparent;
}
.form-error { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.form-success { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.form-error ul { margin: 0; padding-left: 18px; }

/* --- Таблицы --- */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { background: var(--bg-elev); font-weight: 700; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-elev); }

/* --- Бейджи --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; background: var(--bg-elev); color: var(--text-muted); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--amber { background: rgba(217, 119, 6, .12); color: var(--amber); }

/* --- Вкладки --- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- Шапка -- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo__mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff; font-weight: 900; font-size: 21px; box-shadow: 0 5px 14px var(--accent-soft);
}
.logo__text { font-size: 19px; font-weight: 800; letter-spacing: .2px; }

.main-nav { flex: 1; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.menu a { display: block; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 14px; }
.menu a:hover { background: var(--accent-soft); color: var(--accent); }
.menu .collapsible { position: relative; }
.menu .collapsible > a::after { content: " ▾"; font-size: 11px; opacity: .7; }
.menu .collapsible > ul { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; list-style: none; margin: 6px 0 0; z-index: 30; }
.menu .collapsible.open > ul { display: block; }
@media (min-width: 901px) {
    .menu .collapsible:hover > ul { display: block; }
}

.userbar { display: flex; align-items: center; gap: 12px; }
.userbar__balance { background: var(--accent-soft); color: var(--accent); padding: 8px 13px; border-radius: var(--radius-sm); font-weight: 800; font-size: 14px; }
.userbar__name { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.userbar__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.userbar__exit { color: var(--text-muted); font-weight: 600; font-size: 14px; }
.userbar__exit:hover { color: var(--red); }

.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; display: grid; place-items: center; font-size: 17px; color: var(--text); transition: all .15s; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 42px; height: 40px; align-items: center; justify-content: center; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* -------------------------------------------------------------- Макет --- */
.layout {
    display: grid; grid-template-columns: 256px minmax(0, 1fr) 300px;
    grid-template-areas: "left content right"; gap: 22px; align-items: start;
    max-width: var(--container); margin: 24px auto; padding: 0 20px;
}
.col-side--left { grid-area: left; }
.col-content { grid-area: content; min-width: 0; }
.col-side--right { grid-area: right; }
.col-side { position: sticky; top: calc(var(--header-h) + 16px); }
.col-side:empty { display: none; }
.layout--bare { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; max-width: 860px; }

/* ------------------------------------------------------- Блоки-карточки -- */
.block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; box-shadow: var(--shadow); }
.block__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--border); }
.block__head::before { content: ""; flex: 0 0 auto; width: 4px; height: 17px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-strong)); }
.block__body { padding: 18px; }

/* Карточка пользователя (левый сайдбар) */
.user-card { text-align: center; }
.user-card__avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); background: var(--bg-elev); margin-bottom: 10px; }
.user-card__name { font-weight: 800; font-size: 17px; }
.user-card__group { font-size: 13px; margin-bottom: 14px; }
.user-card__balance { display: block; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.user-card__balance span { font-weight: 500; font-size: 12px; margin-left: 4px; }
.user-card__nav { display: flex; flex-direction: column; text-align: left; gap: 1px; }
.user-card__link, .side-nav__link { display: block; padding: 9px 13px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 14px; transition: background .15s, color .15s, padding .15s; }
.user-card__link:hover, .side-nav__link:hover { background: var(--accent-soft); color: var(--accent); }
.user-card__exit { display: block; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 14px; }
.user-card__exit:hover { color: var(--red); }
.guest-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav__link:hover { padding-left: 17px; }

/* Правый сайдбар */
.online-total { text-align: center; }
.online-total__num { display: block; font-size: 36px; font-weight: 900; line-height: 1; color: var(--accent); margin-bottom: 4px; }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.top-list__item { display: flex; align-items: center; gap: 10px; }
.top-list__rank { width: 20px; text-align: center; font-weight: 800; color: var(--text-muted); }
.top-list__item:nth-child(1) .top-list__rank { color: #eab308; }
.top-list__item:nth-child(2) .top-list__rank { color: #94a3b8; }
.top-list__item:nth-child(3) .top-list__rank { color: #d97706; }
.top-list__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.top-list__name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.top-list__name:hover { color: var(--accent); }
.top-list__value { font-weight: 800; font-size: 13px; color: var(--accent); }

/* Мониторинг серверов */
.server-item { border-bottom: 1px solid var(--border); padding: 0 0 14px; margin-bottom: 14px; }
.server-item:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.server-item__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.server-item__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.server-item--online .server-item__dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.server-item--offline { opacity: .7; }
.server-item__name { font-weight: 700; font-size: 14px; }
.server-item__status { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.server-item__body { font-size: 13px; margin-bottom: 10px; }
.server-item__row { display: flex; justify-content: space-between; padding: 2px 0; }
.server-item__ip { font-family: ui-monospace, Consolas, monospace; color: var(--text-muted); }

/* -------------------------------------------------------------- Герой --- */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--bg-card), var(--bg-elev)); border: 1px solid var(--border); border-radius: var(--radius); padding: 42px 36px; margin-bottom: 22px; box-shadow: var(--shadow); }
.hero__title { margin: 0 0 12px; font-size: 32px; font-weight: 900; }
.hero__subtitle { margin: 0 0 22px; color: var(--text-muted); max-width: 560px; font-size: 16px; }
.hero__cta { position: relative; z-index: 2; }
.hero__glow { position: absolute; right: -70px; top: -70px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 65%); pointer-events: none; }

/* -------------------------------------------------------------- Новости - */
.news-list { display: flex; flex-direction: column; }
.news-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item__title { font-weight: 700; font-size: 15px; }
.news-item__meta { font-size: 12px; margin-top: 3px; }
.news-list-full { display: flex; flex-direction: column; gap: 16px; }
.news-single { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.news-single__title { font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.news-single__meta { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.news-single__text { line-height: 1.7; }
.news-single__back { display: inline-block; margin-bottom: 16px; }

/* Карточки ленты новостей */
.news-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.news-card--with-thumb { display: grid; grid-template-columns: 240px 1fr; }
.news-card__thumb { display: block; overflow: hidden; background: var(--bg-elev); }
.news-card__thumb img { width: 100%; height: 100%; min-height: 160px; object-fit: cover; display: block; }
.news-card__body { padding: 20px 22px; }
.news-card__title { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.news-card__title a { color: var(--text); }
.news-card__title a:hover { color: var(--accent); }
.news-card__meta { font-size: 13px; margin-bottom: 10px; }
.news-card__preview { color: var(--text-muted); margin: 0 0 12px; line-height: 1.6; }
.news-card__more { font-weight: 700; font-size: 14px; }

/* Картинки внутри пользовательского/новостного контента */
.news-single__text img, .forum-post__text img, .ticket-msg__text img, .static-page__content img {
    max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0;
}
.news-single__text, .forum-post__text, .ticket-msg__text { overflow-wrap: anywhere; }

/* --------------------------------------------------------------- Чат ---- */
.chat.block .block__head { text-transform: none; }
.chat__status { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.chat__messages { height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px; margin-bottom: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chat__empty { margin: auto; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg__avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.chat-msg__body { min-width: 0; flex: 1; }
.chat-msg__head { display: flex; align-items: center; gap: 8px; }
.chat-msg__name { font-weight: 700; color: var(--accent); font-size: 14px; }
.chat-msg__time { font-size: 12px; color: var(--text-muted); }
.chat-msg__del { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.chat-msg__del:hover { color: var(--red); }
.chat-msg__text { word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; }
.chat__form { display: flex; gap: 10px; }
.chat__input { flex: 1; }
.chat__login { padding: 8px 0; }

/* ------------------------------------------------------------- Профиль -- */
.profile__header { display: flex; gap: 24px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 24px; box-shadow: var(--shadow); }
.profile__avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); background: var(--bg-elev); }
.profile__name { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.profile__group, .profile__reg { font-size: 14px; }
.profile__balance { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Профиль: две колонки */
.profile-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-col { display: flex; flex-direction: column; gap: 0; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; }
.profile-actions form { margin: 0; }
.profile-table { width: 100%; border-collapse: collapse; }
.profile-table td { padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.profile-table td:first-child { color: var(--text-muted); width: 42%; }
.profile-table tr:last-child td { border-bottom: none; }
.profile-friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 14px; }
.profile-friend { text-align: center; font-size: 12px; color: var(--text); }
.profile-friend img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; margin: 0 auto 5px; }
.profile-friend span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-friend:hover img { border-color: var(--accent); }
.profile-friend:hover span { color: var(--accent); }

/* --------------------------------------------------------- Магазин ------ */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.price-list-page .data-table td:last-child, .price-list-page .data-table th:last-child { text-align: right; }

/* Шапка магазина */
.store-hero { display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff;
    border-radius: var(--radius); padding: 28px 30px; margin-bottom: 24px; box-shadow: var(--shadow-lg); }
.store-hero__title { margin: 0 0 6px; font-size: 26px; font-weight: 900; }
.store-hero__text { margin: 0; opacity: .92; max-width: 620px; }
.store-hero .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.store-hero .btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }

/* Карточка привилегии */
.priv-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column; }
.priv-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.priv-card__top { position: relative; padding: 20px 22px 18px; text-align: center;
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    border-bottom: 1px solid var(--border); }
.priv-card__server { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--accent); background: var(--bg-card); border: 1px solid var(--border);
    padding: 3px 10px; border-radius: 100px; margin-bottom: 10px; }
.priv-card__name { font-size: 22px; font-weight: 900; margin: 0; letter-spacing: .3px; }
.priv-card__period { font-size: 13px; color: var(--text-muted); }
.priv-card__content { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; }
.priv-card__desc { font-size: 14px; color: var(--text-muted); margin: 0 0 16px; flex: 1; line-height: 1.55; }
.priv-card__price { font-size: 30px; font-weight: 900; color: var(--text); text-align: center; margin-bottom: 16px; }
.priv-card__price span { font-size: 16px; color: var(--text-muted); }
.priv-card__buy { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------- Кошелёк ----- */
.purse__balance { font-size: 40px; font-weight: 900; color: var(--accent); text-align: center; margin: 10px 0 6px; }
.purse__form { max-width: 420px; margin: 0 auto; }

/* ------------------------------------------------------------- Форум ---- */
.forum-sections { display: flex; flex-direction: column; gap: 12px; }
.forum-section { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
.forum-section:hover { border-color: var(--accent); }
.forum-section__title { font-weight: 800; font-size: 17px; color: var(--text); }
.forum-section__descr { font-size: 13px; margin-top: 3px; }
.forum-section__stats { font-size: 13px; text-align: right; white-space: nowrap; }
.forum-posts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.forum-post { display: grid; grid-template-columns: 180px 1fr; gap: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.forum-post__author { background: var(--bg-elev); padding: 18px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); }
.forum-post__body { padding: 18px; }
.forum-post__text { line-height: 1.7; margin-bottom: 10px; }
.forum-post__meta { font-size: 12px; }
.forum-mod { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.forum-reply, .forum-new { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* --------------------------------------------------------- Сообщения ---- */
.pm-dialogs { display: flex; flex-direction: column; gap: 8px; }
.pm-dialog { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.pm-dialog:hover { border-color: var(--accent); }
.pm-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.pm-msg { max-width: 72%; padding: 11px 15px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.pm-msg--out { margin-left: auto; background: var(--accent-soft); border-color: transparent; }
.pm-msg__meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.pm-form { display: flex; gap: 10px; }

/* ------------------------------------------------------- Уведомления ---- */
.notify-list { display: flex; flex-direction: column; gap: 10px; }
.notify-item { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.notify-item--unread { border-left: 3px solid var(--accent); }
.notify-item__text { flex: 1; }
.notify-item__time { font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------------- Друзья --- */
.friends-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.friends-item { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.friends-item img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------- Поддержка --- */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.ticket-msg { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.ticket-msg--staff { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.ticket-msg__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.support-new { max-width: 640px; }

/* ----------------------------------------------------------- Жалобы ----- */
.complaints-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 26px; }
.complaints-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* -------------------------------------------------------- Статистика ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-card__num { font-size: 28px; font-weight: 900; color: var(--accent); }
.stat-card__label { margin-top: 6px; font-size: 14px; color: var(--text-muted); }
.rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--bg-elev); font-weight: 800; font-size: 13px; }

/* -------------------------------------------------------------- События - */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.event-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.event-card:hover { transform: translateY(-3px); }
.event-card__body { padding: 20px; }
.event-card__date { color: var(--accent); font-weight: 700; font-size: 13px; }
.event-single__descr { line-height: 1.7; margin-top: 16px; }

/* -------------------------------------------------- Статические страницы */
.static-page { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.static-page__content { line-height: 1.7; }
.static-page__content h2 { margin-top: 24px; }

/* ------------------------------------------------------------ Авторизация */
.auth-page { display: flex; justify-content: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-lg); }
.auth-card__title { font-size: 22px; font-weight: 800; margin: 0 0 20px; text-align: center; }
.auth-card__alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--text-muted); }
.oauth-buttons { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }

/* ------------------------------------------------------------ Ошибки ---- */
.error-page { text-align: center; padding: 60px 20px; }
.error-page__code { font-size: 90px; font-weight: 900; color: var(--accent); line-height: 1; }
.error-page__title { font-size: 24px; font-weight: 800; margin: 10px 0; }
.error-page__hint { color: var(--text-muted); }

/* ---------------------------------------------------------- Установщик -- */
.install-req { max-width: 520px; margin-bottom: 24px; }
.install-form, .install-done { max-width: 640px; }
.settings-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.avatar-edit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-edit__preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); background: var(--bg-elev); flex-shrink: 0; }
.avatar-edit__form { display: flex; flex-direction: column; gap: 10px; }
.avatar-edit__form input[type="file"] { color: var(--text-muted); }

/* -------------------------------------------------------------- Техработы */
.offsite { min-height: 70vh; display: grid; place-items: center; }
.offsite__box { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 48px; box-shadow: var(--shadow-lg); }

/* -------------------------------------------------------------- Подвал -- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-soft); }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 20px; flex-wrap: wrap; }
.site-footer__copy { color: var(--text-muted); font-size: 14px; }
.site-footer__nav { display: flex; gap: 18px; }
.site-footer__nav a { color: var(--text-muted); font-size: 14px; }
.site-footer__nav a:hover { color: var(--accent); }

/* --------------------------------------------------------- CKEditor ----- */
.cke_chrome { border-radius: var(--radius-sm) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .cke_top, html[data-theme="dark"] .cke_bottom { background: var(--bg-elev) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .cke_toolgroup, html[data-theme="dark"] .cke_combo_button { background: var(--bg-card) !important; }

/* ============================================================ Адаптив === */
@media (max-width: 1200px) {
    .layout { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "left content" "right right"; }
    .col-side--right { position: static; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
    .col-side--right .block { margin-bottom: 0; }
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; grid-template-areas: "content" "left" "right"; margin-top: 14px; }
    .col-side { position: static; }
    .col-side--right { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .site-header__inner { flex-wrap: wrap; height: auto; min-height: var(--header-h); padding: 10px 0; }
    .nav-toggle { display: flex; order: 5; margin-left: auto; }
    .main-nav { display: none; order: 6; flex-basis: 100%; }
    body.nav-open .main-nav { display: block; padding-bottom: 8px; }
    body.nav-open .menu { flex-direction: column; }
    body.nav-open .menu .collapsible > ul { position: static; box-shadow: none; }
    .form-grid { grid-template-columns: 1fr; }
    .forum-post { grid-template-columns: 1fr; }
    .forum-post__author { flex-direction: row; align-items: center; gap: 10px; border-right: none; border-bottom: 1px solid var(--border); }
    .complaints-forms { grid-template-columns: 1fr; }
    .profile__header { flex-direction: column; text-align: center; }
    .profile__balance { justify-content: center; }
    .profile-cols { grid-template-columns: 1fr; }
    .news-card--with-thumb { grid-template-columns: 1fr; }
    .news-card__thumb img { min-height: 180px; max-height: 220px; }
}
@media (max-width: 560px) {
    .site-header__inner { gap: 12px; }
    .logo__text { font-size: 16px; }
    .userbar__balance, .userbar__exit { display: none; }
    .hero { padding: 28px 20px; }
    .hero__title { font-size: 24px; }
    .pm-msg { max-width: 88%; }
    .chat__form { flex-wrap: wrap; }
    .chat__input { flex-basis: 100%; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .col-side--right { grid-template-columns: 1fr; }
}
