/* ============================================================
   ALEXANDRIA RP — HL2RP / City 17
   Тёмная тема в духе Альянса: сталь, оранжевый акцент, янтарь ламбды
   ============================================================ */

/* ---------- Шрифты (self-hosted) ---------- */
@font-face {
    font-family: 'Russo One';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/russo-one-400-cyr.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Russo One';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/russo-one-400-lat.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/inter-var-cyr.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/inter-var-lat.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */
:root {
    --bg: #0a0e13;
    --bg-2: #0d1219;
    --surface: #111823;
    --surface-2: #17202d;
    --line: rgba(148, 184, 212, 0.14);
    --line-strong: rgba(148, 184, 212, 0.3);
    --text: #dfe7ee;
    --text-dim: #93a5b6;
    --text-faint: #64778c;
    --accent: #f28b30;
    --accent-bright: #ffaa5e;
    --accent-dim: rgba(242, 139, 48, 0.16);
    --amber: #ffb03a;
    --amber-deep: #cf8a1d;
    --amber-ink: #201302;
    --green: #3ecf8e;
    --red: #ff5d5d;
    --font-display: 'Russo One', 'Arial Black', sans-serif;
    --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Consolas, monospace;
    --header-h: 72px;
    --radius: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* ---------- Reset ---------- */
html, body, div, span, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
*, *:before, *:after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--text);
    background:
        radial-gradient(1100px 500px at 80% -10%, rgba(242, 139, 48, 0.06), transparent 60%),
        radial-gradient(900px 480px at 10% 110%, rgba(242, 139, 48, 0.04), transparent 60%),
        var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(242, 139, 48, 0.35); color: #fff; }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #26313f; border-radius: 6px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #33445a; }

img { max-width: 100%; height: auto; }
ul { list-style: none; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; cursor: pointer; }
a:hover { color: var(--accent-bright); }
strong, b { font-weight: 700; }
em, i { font-style: italic; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.18;
    margin-bottom: 1rem;
    color: #f2f7fa;
    letter-spacing: 0.02em;
}
h1 { font-size: 3.2rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.15rem; }
p { margin-bottom: 1rem; }

/* ---------- Контейнеры ---------- */
.wrapper { padding: 84px 24px; position: relative; }
.wrapper .inner, .inner { max-width: 1120px; margin: 0 auto; }

header.major { text-align: center; margin-bottom: 48px; }
header.major h2 {
    display: inline-block;
    position: relative;
    text-transform: uppercase;
    padding-bottom: 14px;
    margin-bottom: 10px;
}
header.major h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
header.major p { color: var(--text-dim); font-size: 1.02rem; }

/* ---------- Кнопки ---------- */
.button, .btn-ghost, .btn-amber, .connect-button, .payment-button, .profile-nav-button, .steam-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-height: 46px;
    padding: 11px 26px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: rgba(23, 32, 45, 0.6);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.button:hover, .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
    background: var(--accent-dim);
}
.btn-amber, .connect-button, .payment-button {
    background: linear-gradient(180deg, var(--amber) 0%, var(--amber-deep) 100%);
    border-color: rgba(255, 176, 58, 0.5);
    color: var(--amber-ink);
    font-weight: 700;
    box-shadow: 0 8px 26px rgba(255, 176, 58, 0.22);
}
.btn-amber:hover, .connect-button:hover, .payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 176, 58, 0.34);
    color: var(--amber-ink);
}
.btn-amber:active, .connect-button:active, .payment-button:active { transform: translateY(0); }

a:focus-visible, button:focus-visible, input:focus-visible, .button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Лоадер ---------- */
#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 15, 0.86);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
.loader-spinner {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(242, 139, 48, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Шапка ---------- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(10, 14, 19, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 10000;
}

.site-logo a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f2f7fa;
}
.site-logo img { width: 34px; height: 34px; display: block; filter: drop-shadow(0 0 8px rgba(242, 139, 48, 0.35)); }
.site-logo .lg-name {
    font-family: var(--font-display);
    font-size: 1.06rem;
    letter-spacing: 0.14em;
    white-space: nowrap;
}
.site-logo .lg-name b { color: var(--accent); font-weight: 400; }
.site-logo a:hover .lg-name b { color: var(--accent-bright); }

#header nav { display: flex; align-items: center; }
#header nav > ul { display: flex; align-items: center; gap: 4px; }
#header nav > ul > li { position: relative; }
#header nav > ul > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: 6px;
}
#header nav > ul > li > a:hover { color: #fff; background: rgba(148, 184, 212, 0.08); }

/* выпадашки */
.dropdown { position: relative; }
.dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 10001;
}
.dropdown:hover .dropdown-menu, .dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.dropdown .dropdown-menu li a {
    display: block;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--text-dim);
    border-radius: 6px;
    white-space: nowrap;
}
.dropdown .dropdown-menu li a:hover { color: #fff; background: rgba(148, 184, 212, 0.08); }

/* Steam / профиль */
.steam-login {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.85rem;
    border-color: rgba(242, 139, 48, 0.45);
    color: var(--accent);
    background: var(--accent-dim);
}
.steam-login:hover { background: rgba(242, 139, 48, 0.26); color: #fff; border-color: var(--accent); }

.user-dropdown .user-toggle { display: inline-flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    display: block;
}
.user-dropdown .dropdown-menu li { display: flex; flex-direction: column; }

/* бургер */
.menuToggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ---------- Мобильное меню ---------- */
#menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 290px;
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--line);
    z-index: 10002;
    transition: right 0.28s ease;
    overflow-y: auto;
    padding: 84px 18px 32px;
}
#menu.active { right: 0; }
#menu ul li a {
    display: block;
    padding: 13px 14px;
    color: var(--text-dim);
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.98rem;
}
#menu ul li a:hover { color: #fff; background: rgba(148, 184, 212, 0.08); }
#menu .steam-login { margin: 14px; display: inline-flex; }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 11, 0.66);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 10001;
}
.menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-dropdown .mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.mobile-dropdown.active .mobile-dropdown-menu { max-height: 320px; }
.mobile-dropdown .mobile-dropdown-menu li a { padding-left: 30px; font-size: 0.92rem; }
.mobile-dropdown-toggle::after { content: " ▾"; color: var(--text-faint); }

/* ---------- ГЛАВНАЯ: hero ---------- */
#main-banner {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-h) + 40px) 24px 90px;
    overflow: hidden;
    isolation: isolate;
}
#main-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/static/images/hero.jpg?v=2') center 30% / cover no-repeat;
    filter: saturate(0.82) brightness(0.6);
    z-index: -3;
    transform: scale(1.02);
}
#main-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(10, 14, 19, 0.72) 0%, rgba(10, 14, 19, 0.28) 40%, var(--bg) 98%);
}
#main-banner .content { max-width: 860px; }

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-bright);
    border: 1px solid rgba(242, 139, 48, 0.4);
    background: rgba(10, 14, 19, 0.55);
    padding: 8px 16px;
    border-radius: 999px;
    margin-bottom: 26px;
}
.hero-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

#main-banner h1, #main-banner h2 {
    font-size: clamp(2.7rem, 7.2vw, 5.2rem);
    letter-spacing: 0.045em;
    text-shadow: 0 4px 34px rgba(0, 0, 0, 0.65), 0 0 60px rgba(242, 139, 48, 0.18);
    margin-bottom: 18px;
}
#main-banner .hero-sub, #main-banner p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(223, 231, 238, 0.88);
    max-width: 640px;
    margin: 0 auto 34px;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }

.hero-online {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
}
.hero-online.show { display: inline-flex; }
.hero-online::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 9px var(--green);
    animation: pulse 2s ease infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

.scroll-indicator {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-faint);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.2s ease;
}
.scroll-indicator:hover { color: var(--accent); }
.scroll-indicator::after {
    content: "";
    display: block;
    width: 1px;
    height: 26px;
    margin: 8px auto 0;
    background: linear-gradient(180deg, var(--accent), transparent);
    animation: drip 1.8s ease infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- ГЛАВНАЯ: панель сервера ---------- */
#servers { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.server-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.server-panel::before, .server-panel::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid var(--accent);
    opacity: 0.75;
    z-index: 3;
    pointer-events: none;
}
.server-panel::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.server-panel::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

.server-art {
    position: relative;
    min-height: 280px;
    background: url('/static/images/server-card.jpg?v=3') center / cover no-repeat;
}
.server-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 55%, var(--surface) 100%),
                linear-gradient(0deg, rgba(10, 14, 19, 0.35), transparent 45%);
}

.server-meta { padding: 34px 38px; display: flex; flex-direction: column; gap: 14px; }

.status-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    background: rgba(10, 14, 19, 0.4);
}
.status-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.status-badge.on { color: var(--green); border-color: rgba(62, 207, 142, 0.45); }
.status-badge.on::before { background: var(--green); box-shadow: 0 0 9px var(--green); animation: pulse 2s ease infinite; }

.server-meta h3 { font-size: 1.5rem; margin-bottom: 2px; }
.server-map { color: var(--text-dim); font-size: 0.94rem; margin: 0; }
.server-map .map-name { font-family: var(--font-mono); color: var(--text); font-size: 0.9em; }

.online-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}
.online-row .online-label { font-size: 0.86rem; color: var(--text-dim); letter-spacing: 0.04em; text-transform: uppercase; }
.online-row .online-nums { font-family: var(--font-mono); font-size: 1.05rem; color: #fff; }
.online-row .online-nums .online-count { color: var(--green); font-weight: 700; }

.online-bar { height: 8px; background: rgba(148, 184, 212, 0.12); border-radius: 99px; overflow: hidden; }
.online-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #2f9e6e, var(--green));
    box-shadow: 0 0 12px rgba(62, 207, 142, 0.5);
    transition: width 0.7s ease;
}

.server-ip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 11px 14px;
    background: rgba(8, 11, 15, 0.55);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent-bright);
    flex-wrap: wrap;
}
.server-ip .ip-label { color: var(--text-faint); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-body); }
.server-ip .ip-value { user-select: all; }
.copy-ip {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: var(--font-body);
    padding: 6px 12px;
    min-height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.copy-ip:hover { color: var(--accent); border-color: var(--accent); }
.copy-ip.copied { color: var(--green); border-color: var(--green); }
.copy-ip svg { width: 14px; height: 14px; }

.server-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.no-servers-message { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.no-servers-message .no-servers-text { font-size: 1.06rem; color: var(--text); }
.updating-text { color: var(--text-faint); font-size: 0.9rem; }
.dots::after { content: ""; animation: dots 1.6s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- ГЛАВНАЯ: фракции ---------- */
#factions { position: relative; }
.factions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.faction-card {
    --fc: var(--accent);
    --faction-image: linear-gradient(180deg, var(--surface) 0%, rgba(17, 24, 35, 0.6) 100%);
    position: relative;
    background:
        linear-gradient(180deg, rgba(10, 14, 19, 0.10) 0%, rgba(10, 14, 19, 0.88) 70%, rgba(10, 14, 19, 0.96) 100%),
        linear-gradient(90deg, rgba(10, 14, 19, 0.66), rgba(10, 14, 19, 0.12)),
        var(--faction-image) center / cover no-repeat;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px 28px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.faction-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fc), transparent 70%);
    opacity: 0.85;
}
.faction-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--fc) 55%, transparent);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}
.faction-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--fc);
    opacity: 0.9;
    display: block;
    margin-bottom: 14px;
}
.faction-card h3 { font-size: 1.3rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.faction-card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }
.faction-card .faction-glyph {
    position: absolute;
    right: -18px;
    bottom: -24px;
    font-family: var(--font-display);
    font-size: 7rem;
    line-height: 1;
    color: var(--fc);
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
}
.f-cp { --fc: #aebfce; --faction-image: url('/static/images/faction-cp.jpg?v=3'); }
.f-combine { --fc: #93a0bd; --faction-image: url('/static/images/faction-combine.jpg?v=3'); }
.f-res { --fc: #ffb03a; --faction-image: url('/static/images/faction-resistance.jpg?v=3'); }

/* ---------- ГЛАВНАЯ: преимущества ---------- */
#features { background: var(--bg-2); border-top: 1px solid var(--line); }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature:hover { border-color: rgba(242, 139, 48, 0.4); transform: translateY(-3px); }
.feature .feature-ico, .feature .placeholder-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-dim);
    border: 1px solid rgba(242, 139, 48, 0.3);
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 1.2rem;
}
.feature .feature-ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.02rem; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 0.92rem; margin: 0; }

/* ---------- ГЛАВНАЯ: как начать ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px 26px;
}
.step-num {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--accent);
    opacity: 0.85;
    display: block;
    line-height: 1;
    margin-bottom: 14px;
    text-shadow: 0 0 22px rgba(242, 139, 48, 0.4);
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { color: var(--text-dim); font-size: 0.93rem; margin: 0; }
.step a { border-bottom: 1px dotted rgba(242, 139, 48, 0.5); }

/* ---------- ГЛАВНАЯ: финальный CTA ---------- */
#join-cta {
    position: relative;
    text-align: center;
    padding: 88px 24px;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px),
        radial-gradient(700px 300px at 50% 0%, rgba(242, 139, 48, 0.12), transparent 70%),
        var(--bg-2);
    border-top: 1px solid var(--line);
}
#join-cta h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 12px; }
#join-cta p { color: var(--text-dim); margin-bottom: 28px; }
#join-cta .hero-actions { margin-bottom: 0; }

/* ---------- ПРАВИЛА ---------- */
.rules-header {
    position: relative;
    min-height: 46svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-h) + 40px) 24px 60px;
    isolation: isolate;
    overflow: hidden;
}
.rules-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/static/images/hero.jpg?v=2') center 25% / cover no-repeat;
    filter: saturate(0.6) brightness(0.42);
    z-index: -2;
}
.rules-header::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(10, 14, 19, 0.6) 0%, var(--bg) 96%);
}
.rules-header h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.rules-header p { color: var(--text-dim); margin: 0; }
.rules-header .scroll-indicator { display: none; }

.rules-content { padding-top: 30px; }
.rules-content .inner { max-width: 1320px; }

/* Лейаут правил: оглавление + контент */
.rules-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}
.rules-body { min-width: 0; }

.rules-toc {
    position: sticky;
    top: calc(var(--header-h) + 18px);
    max-height: calc(100vh - var(--header-h) - 38px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 10px 16px 14px;
    scrollbar-width: thin;
}
.rules-toc::-webkit-scrollbar { width: 7px; }
.toc-title {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 2px 10px 10px;
}
.toc-list li.toc-group {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 16px 10px 6px;
}
.toc-link {
    display: block;
    padding: 6px 10px;
    font-size: 0.86rem;
    line-height: 1.4;
    color: var(--text-dim);
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.toc-link:hover { color: #fff; background: rgba(148, 184, 212, 0.07); }
.toc-link.active {
    color: var(--accent-bright);
    border-left-color: var(--accent);
    background: var(--accent-dim);
}
.toc-num { font-family: var(--font-mono); font-size: 0.8em; color: var(--text-faint); }
.toc-link.active .toc-num { color: var(--accent); }

.toc-select-wrap { display: none; }
.toc-select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(8, 11, 15, 0.7);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    cursor: pointer;
}
.toc-select:focus { outline: none; border-color: var(--accent); }

@media (max-width: 1099px) {
    .rules-layout { grid-template-columns: 1fr; gap: 18px; }
    .rules-toc {
        position: sticky;
        top: calc(var(--header-h) + 8px);
        z-index: 100;
        max-height: none;
        overflow: visible;
        padding: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
    .rules-toc .toc-list, .rules-toc .toc-title { display: none; }
    .toc-select-wrap { display: block; }
}

.rule-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    margin-bottom: 26px;
}
.rule-header { margin-bottom: 14px; }
.rule-header.major { text-align: center; margin: 4px 0 10px; }
.rule-header h3 { font-size: 1.22rem; }
.category-title { letter-spacing: 0.06em; text-transform: uppercase; }

.rule-separator {
    height: 1px;
    margin: 30px auto;
    max-width: 320px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.rule-list { margin: 0; }
.rule-item { padding: 10px 0; }
.rule-content { color: var(--text); }
.rule-text { margin-bottom: 0.6rem; }

.rule-section { scroll-margin-top: calc(var(--header-h) + 22px); }
.rule-item.numbered-item { scroll-margin-top: calc(var(--header-h) + 90px); }

.sec-num { color: var(--accent); font-family: var(--font-mono); }

.rule-list-container { margin: 8px 0 8px 6px; padding-left: 18px; border-left: 2px solid rgba(242, 139, 48, 0.25); }
.rule-list-item { padding: 5px 0; color: var(--text-dim); }

.rule-category { margin: 14px 0; }
.rule-category .category-title {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.rule-category.allowed .category-title { color: var(--green); }
.rule-category.forbidden .category-title { color: var(--red); }
.rule-category.allowed .rule-list { border-left: 2px solid rgba(62, 207, 142, 0.35); padding-left: 14px; }
.rule-category.forbidden .rule-list { border-left: 2px solid rgba(255, 93, 93, 0.35); padding-left: 14px; }
.rule-numbered-list { margin: 8px 0; padding-left: 0; list-style: none; color: var(--text-dim); }
.rule-numbered-list li { padding: 4px 0; }

.rule-item.numbered-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.rule-item.numbered-item:hover { background: rgba(148, 184, 212, 0.05); }
.rule-num {
    flex: 0 0 auto;
    min-width: 46px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--accent);
    user-select: none;
    text-align: right;
}
.rule-item-text { flex: 1 1 auto; min-width: 0; color: var(--text); }
.rule-item .rule-link { opacity: 0; transition: opacity 0.15s ease; }
.rule-item:hover .rule-link, .rule-item:target .rule-link { opacity: 1; }

.rule-item:target, .rule-section:target {
    background: rgba(242, 139, 48, 0.09);
    outline: 1px solid rgba(242, 139, 48, 0.35);
    outline-offset: 0;
}
.rule-section:target { border-color: rgba(242, 139, 48, 0.4); }

.rule-section-title { background: none; border: none; padding: 14px 0 0; }
.rule-section-title .rule-header.major { margin-bottom: 0; }

.rule-note {
    margin: 12px 0;
    padding: 13px 16px;
    background: rgba(255, 176, 58, 0.08);
    border: 1px solid rgba(255, 176, 58, 0.3);
    border-left: 3px solid var(--amber);
    border-radius: 8px;
    color: #ffd9a0;
    font-size: 0.94rem;
}
.rule-warning, .text-center.rule-warning {
    margin: 12px 0;
    padding: 13px 16px;
    background: rgba(255, 93, 93, 0.08);
    border: 1px solid rgba(255, 93, 93, 0.32);
    border-left: 3px solid var(--red);
    border-radius: 8px;
    color: #ffc2c2;
    font-size: 0.94rem;
}
.rule-examples {
    margin: 10px 0;
    padding: 12px 16px;
    background: rgba(8, 11, 15, 0.5);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.92rem;
}
.rule-subsection { margin-top: 18px; }
.subsection-title { color: var(--accent-bright); font-size: 1.02rem; margin-bottom: 8px; }
.rule-transition { color: var(--text-faint); font-style: italic; }
.rule-link { border-bottom: 1px dotted rgba(242, 139, 48, 0.5); }

.text-center { text-align: center; }
.text-accent { color: var(--accent-bright); }
.text-primary { color: var(--accent); }
.text-warning { color: var(--amber); }

/* ---------- ОПЛАТА ---------- */
#payment-banner {
    min-height: calc(100svh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 40px) 24px 80px;
}
.payment-container {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 38px 36px;
    box-shadow: var(--shadow);
}
.payment-title { text-align: center; font-size: 1.5rem; margin-bottom: 26px; }

.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-dim);
    margin-bottom: 7px;
}
.form-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: rgba(8, 11, 15, 0.6);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder { color: var(--text-faint); }
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(242, 139, 48, 0.18);
}
.form-input.error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(255, 93, 93, 0.14); }

.field-hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 6px; }
.error-message { display: none; font-size: 0.82rem; color: var(--red); margin-top: 6px; }

.amount-limits { font-size: 0.8rem; color: var(--text-faint); margin-top: 6px; }
.amount-error { font-size: 0.82rem; color: var(--red); margin-top: 6px; }

.payment-button { width: 100%; margin-top: 8px; min-height: 50px; font-size: 0.98rem; }

.notification { padding: 13px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.93rem; }
.notification.success { background: rgba(62, 207, 142, 0.1); border: 1px solid rgba(62, 207, 142, 0.35); color: #a7ecd0; }
.notification.error { background: rgba(255, 93, 93, 0.1); border: 1px solid rgba(255, 93, 93, 0.35); color: #ffc2c2; }

.test-mode-banner {
    background: rgba(255, 176, 58, 0.1);
    border: 1px solid rgba(255, 176, 58, 0.4);
    border-radius: 8px;
    padding: 13px 16px;
    margin-bottom: 18px;
}
.test-mode-text strong { color: var(--amber); display: block; margin-bottom: 3px; letter-spacing: 0.06em; }
.test-mode-text p { color: #ffd9a0; font-size: 0.86rem; margin: 0; }

/* ---------- ПРОФИЛЬ ---------- */
.profile-section { padding: calc(var(--header-h) + 50px) 24px 80px; min-height: 70svh; }
.profile-wrapper { max-width: 1000px; margin: 0 auto; }
.profile-loading { text-align: center; padding: 80px 0; color: var(--text-dim); }
.profile-loading .loader-spinner { margin: 0 auto 18px; }
.profile-error { display: none; text-align: center; padding: 60px 0; }

.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }

.profile-sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
}
.profile-avatar img, .profile-avatar {
    border-radius: 14px;
    max-width: 140px;
    margin: 0 auto;
}
.profile-avatar img { border: 2px solid var(--line-strong); display: block; }
.profile-name { font-size: 1.2rem; margin: 16px 0 6px; word-break: break-word; }
.profile-meta { color: var(--text-faint); font-size: 0.85rem; }
.profile-meta-divider { margin: 0 6px; opacity: 0.5; }
.profile-meta-text { color: var(--text-dim); }

.profile-balance {
    margin: 18px 0;
    padding: 16px;
    background: rgba(8, 11, 15, 0.5);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.profile-balance h3, .profile-balance span { font-family: var(--font-mono); color: var(--amber); font-size: 1.3rem; }

.profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.profile-nav-button { width: 100%; min-height: 44px; font-size: 0.85rem; }
.profile-nav-button:hover { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-dim); }
.logout-button:hover { border-color: var(--red); color: var(--red); background: rgba(255, 93, 93, 0.08); }

.profile-main { display: flex; flex-direction: column; gap: 20px; }
.profile-container .profile-content { display: none; }
.profile-header { margin-bottom: 6px; }
.profile-steamids {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
}
.steamid-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin: 8px 0;
    background: rgba(8, 11, 15, 0.5);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    flex-wrap: wrap;
}
.current-user { color: var(--accent-bright); }

/* ---------- ЮРИДИЧЕСКИЕ / КОНТАКТЫ ---------- */
.legal-container { max-width: 820px; margin: 0 auto; padding: calc(var(--header-h) + 50px) 24px 30px; }
.legal-title { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; }
.legal-subtitle { text-align: center; color: var(--text-dim); margin-bottom: 10px; }
.legal-date { text-align: center; color: var(--text-faint); font-size: 0.86rem; margin-bottom: 30px; }

.legal-document { max-width: 820px; margin: 0 auto; padding: 0 24px 80px; }
.legal-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 20px;
}
.section-title { font-size: 1.12rem; color: var(--accent-bright); margin-bottom: 12px; }
.section-content { color: var(--text-dim); font-size: 0.96rem; }
.section-content strong { color: var(--text); }
.legal-list { margin: 10px 0 10px 4px; padding-left: 20px; list-style: disc; color: var(--text-dim); }
.legal-list li { padding: 3px 0; }
.legal-footer { text-align: center; color: var(--text-faint); font-size: 0.86rem; padding-bottom: 40px; }
.last-section { margin-bottom: 34px; }

.contact-card-wrapper { max-width: 720px; margin: 0 auto; }
.contact-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 34px 36px;
    box-shadow: var(--shadow);
}
.card-header { margin-bottom: 22px; }
.overline { font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px; }
.headline { font-size: 1.4rem; }

.contact-list { display: flex; flex-direction: column; gap: 4px; }
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}
.list-item:hover, .list-item.highlight { background: rgba(148, 184, 212, 0.06); }
.custom-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent-dim);
    border: 1px solid rgba(242, 139, 48, 0.3);
    color: var(--accent);
}
.custom-icon svg { width: 19px; height: 19px; }
.list-item__content { min-width: 0; }
.list-item__title { font-weight: 600; color: var(--text); }
.list-item__subtitle { color: var(--text-dim); font-size: 0.92rem; word-break: break-word; }
.email-link { color: var(--accent); }
.email-link:hover { color: var(--accent-bright); }

/* ---------- Ошибки ---------- */
.error-section { min-height: 70svh; display: flex; align-items: center; text-align: center; padding-top: var(--header-h); }
.error-section h2 { font-size: 2rem; }
.error-section p { color: var(--text-dim); margin-bottom: 24px; }

/* ---------- Футер ---------- */
#footer {
    background: #070a0e;
    border-top: 1px solid var(--line);
    padding: 56px 28px 30px;
}
#footer .inner { max-width: 1120px; margin: 0 auto; }
.f-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--line);
}
.f-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.f-brand .site-logo a { gap: 10px; }
.f-brand p { color: var(--text-faint); font-size: 0.9rem; margin: 0; max-width: 300px; }
.f-col h4 {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 14px;
    font-family: var(--font-body);
    font-weight: 700;
}
.f-col ul li { padding: 4px 0; }
.f-col ul li a { color: var(--text-dim); font-size: 0.92rem; }
.f-col ul li a:hover { color: var(--accent-bright); }
.f-ip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-bright);
    background: rgba(8, 11, 15, 0.6);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    padding: 9px 13px;
    user-select: all;
}
#footer .copyright {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 22px;
    color: var(--text-faint);
    font-size: 0.84rem;
}
#footer .copyright a { color: var(--text-faint); }
#footer .copyright a:hover { color: var(--accent); }
#footer h2 { font-size: 1rem; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .factions-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .server-panel { grid-template-columns: 1fr; }
    .server-art { min-height: 220px; }
    .server-art::after { background: linear-gradient(0deg, var(--surface) 0%, transparent 55%); }
    .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    #header nav > ul { display: none; }
    .menuToggle { display: flex; }
    .wrapper { padding: 64px 18px; }
}

@media (max-width: 480px) {
    :root { --header-h: 62px; }
    .site-logo .lg-name { font-size: 0.92rem; letter-spacing: 0.1em; }
    .site-logo img { width: 28px; height: 28px; }
    #main-banner { min-height: 92svh; }
    .hero-actions .btn-amber, .hero-actions .btn-ghost, .hero-actions .connect-button { width: 100%; }
    .server-meta { padding: 24px 20px; }
    .server-actions a { flex: 1 1 100%; }
    .copy-ip { margin-left: 0; }
    .features-grid { grid-template-columns: 1fr; }
    .rule-section { padding: 22px 18px; }
    .payment-container { padding: 28px 20px; }
    .contact-card { padding: 26px 20px; }
    .f-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
