/* ==========================================================================
   Flamerp.site — тёмная неоновая тема
   ========================================================================== */

:root {
    --bg:            #08080c;
    --bg-soft:       #0e0e15;
    --surface:       #12121b;
    --surface-2:     #171722;
    --surface-3:     #1e1e2b;
    --border:        #26263a;
    --border-soft:   #1c1c2b;

    --text:          #ececf5;
    --text-muted:    #9a9ab5;
    --text-dim:      #6c6c88;

    --flame-1:       #ff8a3d;
    --flame-2:       #ff4d2d;
    --flame-3:       #ff2d55;
    --accent:        #ff6a2b;
    --accent-soft:   rgba(255, 106, 43, .14);

    --ok:            #35d07f;
    --warn:          #ffc247;
    --bad:           #ff4d6a;
    --info:          #4da3ff;

    --radius:        14px;
    --radius-sm:     9px;
    --radius-lg:     22px;

    --shadow:        0 18px 50px -22px rgba(0, 0, 0, .95);
    --shadow-glow:   0 0 0 1px rgba(255, 106, 43, .25), 0 12px 40px -14px rgba(255, 77, 45, .45);

    --font:          'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono:          'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    --header-h:      68px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Фоновые эффекты ------------------------------------------------------ */
.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 520px at 12% -8%, rgba(255, 106, 43, .16), transparent 62%),
        radial-gradient(760px 460px at 88% 4%, rgba(255, 45, 85, .13), transparent 60%),
        radial-gradient(1000px 700px at 50% 108%, rgba(120, 60, 255, .10), transparent 65%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .35;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

.site-header,
.main-content,
.site-footer { position: relative; z-index: 1; }

/* --- Типографика ---------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.22; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; transition: color .16s ease; }
a:hover { color: #ffa06a; }

.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.accent { color: var(--accent); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* --- Сетка ---------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content { padding: 34px 20px 70px; }

.grid { display: grid; gap: 20px; }
.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-sidebar { grid-template-columns: minmax(0, 1fr) 320px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }

/* --- Шапка ---------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    background: rgba(8, 8, 12, .82);
    backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid var(--border-soft);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 0 12px rgba(255, 106, 43, .55)); }
.brand-text { display: flex; align-items: baseline; gap: 1px; font-size: 1.22rem; letter-spacing: -.03em; }
.brand-text strong { font-weight: 800; }
.brand-text small { font-size: .78rem; color: var(--text-dim); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }

.nav-link {
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .92rem;
    transition: background .16s ease, color .16s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, .28); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.server-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-muted);
}
.server-pill .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 0 0 rgba(53, 208, 127, .6);
}
.server-pill .dot.is-online { background: var(--ok); animation: pulse 2.2s infinite; }
.server-pill .dot.is-offline { background: var(--bad); }
.server-online { color: var(--text); font-weight: 700; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(53, 208, 127, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(53, 208, 127, 0); }
    100% { box-shadow: 0 0 0 0 rgba(53, 208, 127, 0); }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* --- Меню пользователя ---------------------------------------------------- */
.user-menu { position: relative; }

.user-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 11px 5px 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .16s ease;
}
.user-trigger:hover { border-color: rgba(255, 106, 43, .5); }
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    gap: 2px;
}
.dropdown.is-open { display: flex; }
.dropdown a,
.dropdown-logout {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}
.dropdown a:hover,
.dropdown-logout:hover { background: var(--surface-3); color: var(--text); }
.dropdown form { margin: 0; }

/* --- Кнопки --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .93rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--flame-1), var(--flame-3));
    color: #fff;
    box-shadow: 0 10px 30px -12px rgba(255, 77, 45, .8);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 38px -12px rgba(255, 77, 45, .95); }

.btn-ghost {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { border-color: rgba(255, 106, 43, .5); color: var(--text); }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: rgba(255, 77, 106, .14); border-color: rgba(255, 77, 106, .4); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 77, 106, .22); color: var(--bad); }

.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --- Карточки ------------------------------------------------------------- */
.card {
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card-tight { padding: 16px; }
.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: rgba(255, 106, 43, .35); transform: translateY(-2px); }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.card-head h2, .card-head h3 { margin: 0; }

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--flame-1), var(--flame-3));
    box-shadow: 0 0 14px rgba(255, 106, 43, .7);
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 54px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(700px 340px at 82% 12%, rgba(255, 106, 43, .20), transparent 62%),
        radial-gradient(560px 300px at 8% 92%, rgba(255, 45, 85, .16), transparent 60%),
        linear-gradient(160deg, var(--surface-2), var(--bg-soft));
    box-shadow: var(--shadow);
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 15px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: rgba(255, 106, 43, .12);
    border: 1px solid rgba(255, 106, 43, .32);
    color: #ffb98a;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hero h1 { margin-bottom: 16px; }
.hero h1 .grad {
    background: linear-gradient(120deg, var(--flame-1), var(--flame-3) 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead { font-size: 1.06rem; color: var(--text-muted); max-width: 620px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Статистика ----------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.stat {
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    text-align: center;
}
.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(120deg, var(--flame-1), var(--flame-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.15;
}
.stat-label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* --- Бейджи и метки ------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-ok   { background: rgba(53, 208, 127, .13); color: var(--ok);   border-color: rgba(53, 208, 127, .3); }
.badge-warn { background: rgba(255, 194, 71, .13); color: var(--warn); border-color: rgba(255, 194, 71, .3); }
.badge-bad  { background: rgba(255, 77, 106, .13); color: var(--bad);  border-color: rgba(255, 77, 106, .3); }
.badge-info { background: rgba(77, 163, 255, .13); color: var(--info); border-color: rgba(77, 163, 255, .3); }
.badge-flame{ background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 106, 43, .35); }

.role-admin     { background: rgba(255, 77, 45, .16); color: #ff8a5c; border-color: rgba(255, 77, 45, .38); }
.role-moderator { background: rgba(77, 163, 255, .14); color: var(--info); border-color: rgba(77, 163, 255, .32); }
.role-vip       { background: rgba(255, 194, 71, .14); color: var(--warn); border-color: rgba(255, 194, 71, .32); }

/* --- BBcode-редактор ------------------------------------------------------ */
.bb-editor { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.bb-editor textarea {
    display: block; width: 100%; border: 0; border-radius: 0; background: transparent;
    padding: 12px 14px; font: 15px/1.65 var(--font); color: var(--text); resize: vertical; min-height: 160px;
}
.bb-editor textarea:focus { outline: none; }
.bb-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.bb-toolbar button {
    min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text-muted); border-radius: 7px; cursor: pointer;
    font-size: 13px; font-weight: 600; transition: .15s;
}
.bb-toolbar button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.bb-preview {
    padding: 12px 14px; border-top: 1px solid var(--border); background: var(--bg);
    font-size: 15px; line-height: 1.65; color: var(--text); min-height: 80px; word-wrap: break-word;
}
.bbcode-code {
    background: #0b0b12; border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5;
}
.bbcode-quote {
    border-left: 3px solid var(--accent); background: var(--accent-soft);
    padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 8px 0; color: var(--text-muted);
}
.bbcode-size-small  { font-size: .85em; }
.bbcode-size-medium { font-size: 1em; }
.bbcode-size-large  { font-size: 1.2em; }
.post-content img { max-width: 100%; border-radius: 8px; }
.post-content ul, .post-content ol { padding-left: 22px; margin: 8px 0; }
.post-content blockquote { margin: 0; }

/* --- Аватары -------------------------------------------------------------- */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-3);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.avatar-xs { width: 26px; height: 26px; }
.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 96px; height: 96px; border-width: 2px; }

/* --- Формы ---------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

label {
    display: block;
    margin-bottom: 7px;
    font-size: .86rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .01em;
}
label .req { color: var(--flame-3); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .94rem;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(255, 106, 43, .16);
}

input::placeholder,
textarea::placeholder { color: var(--text-dim); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239a9ab5' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.field-error { margin-top: 6px; font-size: .82rem; color: var(--bad); font-weight: 600; }
input.is-invalid, textarea.is-invalid, select.is-invalid { border-color: rgba(255, 77, 106, .6); }

.form-hint { margin-top: 6px; font-size: .8rem; color: var(--text-dim); }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--text-muted); font-weight: 500; }
.checkbox input { width: auto; margin-top: 3px; accent-color: var(--accent); }

/* --- Алерты --------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 17px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: .92rem;
    font-weight: 600;
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-success { background: rgba(53, 208, 127, .1); border-color: rgba(53, 208, 127, .32); color: #7ee2ac; }
.alert-error   { background: rgba(255, 77, 106, .1); border-color: rgba(255, 77, 106, .32); color: #ff8fa3; }
.alert-info    { background: rgba(77, 163, 255, .1); border-color: rgba(77, 163, 255, .3); color: #8fc4ff; }

/* --- Таблицы -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
    padding: 13px 16px;
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left;
    white-space: nowrap;
}
tbody td { padding: 13px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:hover { background: rgba(255, 255, 255, .017); }

/* --- Список тем форума ---------------------------------------------------- */
.forum-category {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    transition: border-color .18s ease, transform .18s ease;
}
.forum-category:hover { border-color: rgba(255, 106, 43, .35); transform: translateX(3px); }

.forum-icon {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(140deg, rgba(255, 106, 43, .18), rgba(255, 45, 85, .1));
    border: 1px solid rgba(255, 106, 43, .28);
    font-size: 1.5rem;
    flex-shrink: 0;
}
.forum-category-body { flex: 1; min-width: 0; }
.forum-category-body h3 { margin: 0 0 3px; font-size: 1.06rem; }
.forum-category-body p { margin: 0; font-size: .87rem; color: var(--text-muted); }
.forum-category-stats { display: flex; gap: 22px; flex-shrink: 0; text-align: center; }
.forum-category-stats .n { font-weight: 800; font-size: 1.05rem; }
.forum-category-stats .l { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

.topic-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--surface);
    transition: border-color .16s ease, background .16s ease;
}
.topic-row:hover { border-color: rgba(255, 106, 43, .3); background: var(--surface-2); }
.topic-row-body { flex: 1; min-width: 0; }
.topic-row-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-weight: 700; font-size: .98rem; }
.topic-row-meta { margin-top: 4px; font-size: .8rem; color: var(--text-dim); display: flex; gap: 14px; flex-wrap: wrap; }
.topic-row-count { text-align: center; flex-shrink: 0; min-width: 62px; }
.topic-row-count .n { font-weight: 800; }
.topic-row-count .l { font-size: .7rem; color: var(--text-dim); text-transform: uppercase; font-weight: 700; }

/* --- Сообщения форума ----------------------------------------------------- */
.post {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: var(--surface);
    overflow: hidden;
}
.post-author {
    padding: 20px;
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    text-align: center;
}
.post-author .name { margin-top: 10px; font-weight: 800; font-size: .95rem; word-break: break-word; }
.post-author .role { margin-top: 6px; }
.post-author .joined { margin-top: 10px; font-size: .76rem; color: var(--text-dim); }
.post-body { padding: 20px 22px; min-width: 0; }
.post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: .82rem;
    color: var(--text-dim);
}
.post-content { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 8px; }

/* --- Новости -------------------------------------------------------------- */
.news-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.news-cover {
    height: 150px;
    background: linear-gradient(140deg, rgba(255, 106, 43, .22), rgba(255, 45, 85, .12));
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    border-bottom: 1px solid var(--border-soft);
}
.news-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.news-card-body h3 { font-size: 1.08rem; margin-bottom: 8px; }
.news-card-body p { font-size: .88rem; color: var(--text-muted); flex: 1; }
.news-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--text-dim); margin-top: 12px; }

.article { max-width: 800px; }
.article-body { font-size: 1.02rem; line-height: 1.8; white-space: pre-wrap; }
.article-body p { margin-bottom: 1.1em; }

/* --- Магазин -------------------------------------------------------------- */
.product {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.product:hover { border-color: rgba(255, 106, 43, .45); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.product.is-featured { border-color: rgba(255, 106, 43, .5); }
.product-badge {
    position: absolute;
    top: 14px; right: 14px;
    padding: 4px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--flame-1), var(--flame-3));
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.product h3 { font-size: 1.15rem; margin-bottom: 6px; }
.product-desc { font-size: .87rem; color: var(--text-muted); margin-bottom: 16px; }
.product-perks { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-perks li { display: flex; gap: 9px; font-size: .87rem; color: var(--text-muted); }
.product-perks li::before { content: '✓'; color: var(--ok); font-weight: 800; flex-shrink: 0; }
.product-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.product-price .now { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }
.product-price .old { font-size: .95rem; color: var(--text-dim); text-decoration: line-through; }

/* --- Профиль -------------------------------------------------------------- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, var(--surface-2), var(--bg-soft));
    border: 1px solid var(--border);
    flex-wrap: wrap;
}
.profile-header .info { flex: 1; min-width: 220px; }
.profile-header h1 { font-size: 1.7rem; margin-bottom: 6px; }
.profile-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
.profile-stats .n { font-size: 1.3rem; font-weight: 800; }
.profile-stats .l { font-size: .74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

/* --- Пагинация ------------------------------------------------------------ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pagination a,
.pagination span {
    min-width: 38px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-align: center;
    font-size: .88rem;
    font-weight: 700;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .is-current { background: var(--accent-soft); border-color: rgba(255, 106, 43, .45); color: var(--accent); }

/* --- Пустое состояние ----------------------------------------------------- */
.empty {
    padding: 46px 24px;
    text-align: center;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    background: var(--surface);
    color: var(--text-muted);
}
.empty .icon { font-size: 2.4rem; margin-bottom: 12px; opacity: .7; }

/* --- Список игроков ------------------------------------------------------- */
.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--surface);
    transition: border-color .16s ease;
}
.player-row:hover { border-color: rgba(255, 106, 43, .3); }
.player-row .name { flex: 1; font-weight: 700; font-size: .92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row .rep { font-family: var(--mono); font-size: .82rem; color: var(--accent); font-weight: 600; }

/* --- Прогресс-бар --------------------------------------------------------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--flame-1), var(--flame-3)); transition: width .5s ease; }

/* --- Мониторинг ----------------------------------------------------------- */
.monitor-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.monitor-tile {
    padding: 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    text-align: center;
}
.monitor-tile .v { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.monitor-tile .l { font-size: .76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 4px; }

/* --- Правила -------------------------------------------------------------- */
.rule-block { counter-reset: rule; }
.rule {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
}
.rule:last-child { border-bottom: 0; }
.rule-num {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 106, 43, .35);
    color: var(--accent);
    font-weight: 800;
    font-size: .88rem;
    flex-shrink: 0;
}
.rule-body h4 { margin: 0 0 4px; font-size: .98rem; }
.rule-body p { margin: 0; font-size: .88rem; color: var(--text-muted); }

/* --- Подвал --------------------------------------------------------------- */
.site-footer {
    margin-top: 40px;
    padding: 46px 0 26px;
    border-top: 1px solid var(--border-soft);
    background: linear-gradient(180deg, transparent, rgba(255, 106, 43, .035));
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; }
.footer-brand p { font-size: .88rem; max-width: 340px; margin-top: 12px; }
.brand-footer { margin-bottom: 4px; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 4px; }
.footer-col a { color: var(--text-muted); font-size: .89rem; font-weight: 600; }
.footer-col a:hover { color: var(--accent); }
.footer-col .btn { margin-top: 6px; align-self: flex-start; }

.socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.socials a {
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 700;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    font-size: .8rem;
}

/* --- Хлебные крошки ------------------------------------------------------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .84rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); }

/* --- Страницы авторизации ------------------------------------------------- */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 30px 0 60px;
}
.auth-card { width: 100%; max-width: 460px; padding: 32px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-head p { margin: 0; font-size: .92rem; }
.auth-foot {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    font-size: .9rem;
}

/* --- Загрузка файлов ------------------------------------------------------ */
input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: .86rem;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text);
    font-family: inherit;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-soft); color: var(--accent); }

/* --- Утилиты -------------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 34px; }
.hidden { display: none !important; }
.text-sm { font-size: .86rem; }
.text-xs { font-size: .78rem; }
.fw-700 { font-weight: 700; }
.flex-1 { flex: 1; }
.divider { height: 1px; background: var(--border-soft); margin: 22px 0; border: 0; }

/* --- Возвращение легенды: таймлайн, отсчёт, команда ---------------------- */
.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    max-width: 560px;
}

.countdown-cell {
    background: rgba(18, 18, 27, .72);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.countdown-value {
    font-family: var(--mono);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff, #ffb27a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.countdown-label {
    margin-top: 4px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
    font-weight: 700;
}

.timeline { position: relative; padding-left: 30px; }

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(255, 45, 85, .25), transparent);
}

.timeline-item { position: relative; padding-bottom: 26px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 43, .12);
}

.timeline-item.is-past::before { border-color: var(--text-dim); box-shadow: none; }
.timeline-item.is-now::before { background: var(--accent); animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 106, 43, .14); }
    50%      { box-shadow: 0 0 0 10px rgba(255, 106, 43, .04); }
}

.timeline-date {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--accent);
    letter-spacing: .04em;
}

.timeline-title { margin: 4px 0 6px; font-size: 1.05rem; }
.timeline-text { margin: 0; color: var(--text-muted); font-size: .92rem; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }

.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color .18s ease, transform .18s ease;
}

.team-card:hover { border-color: rgba(255, 106, 43, .35); transform: translateY(-2px); }
.team-card .avatar { width: 64px; height: 64px; margin: 0 auto 12px; }
.team-card .name { font-weight: 700; }
.team-card .role { font-size: .8rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 2px; }
.team-card .note { margin: 10px 0 0; font-size: .86rem; color: var(--text-muted); }

.feature-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.feature-strip .card { padding: 20px; }
.feature-strip .icon { font-size: 1.6rem; margin-bottom: 8px; }

/* --- Адаптивность --------------------------------------------------------- */
@media (max-width: 1080px) {
    .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 20px 18px;
        background: rgba(10, 10, 16, .98);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(16px);
        display: none;
    }
    .main-nav.is-open { display: flex; }
    .nav-link { padding: 12px 14px; }
    .server-pill { display: none; }
    .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .post { grid-template-columns: minmax(0, 1fr); }
    .post-author { border-right: 0; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 14px; text-align: left; }
    .post-author .name { margin-top: 0; }
    .post-author .joined { margin-top: 0; margin-left: auto; }
    .hero { padding: 36px 24px; }
    .form-row { grid-template-columns: minmax(0, 1fr); }
    .forum-category-stats { display: none; }
}

@media (max-width: 620px) {
    .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .header-actions .btn-ghost { display: none; }
    .user-name { display: none; }
    .profile-header { padding: 20px; }
    .main-content { padding: 22px 16px 50px; }
    .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .countdown-value { font-size: 1.5rem; }
}
