/* ============================================================
   ASPIC — тёмная неоновая тема
   ============================================================ */

:root {
    --bg: #0f0f0f;
    --bg-alt: #131417;
    --card: #17181c;
    --border: #23252b;
    --accent: #869ab8;
    --accent-strong: #aebdd6;
    --text: #e8eaf0;
    --muted: #9aa0ae;
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.container { width: min(1140px, 92%); margin: 0 auto; }

.text-accent { color: var(--accent); }

/* ---------- Фоновый канвас ---------- */

#particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#weather {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* ---------- Темы панелек под погоду ---------- */

body.wx-rain {
    --accent: #6f9fd8;
    --accent-strong: #9cc3ee;
    --card: #141821;
    --bg-alt: #10141b;
}

body.wx-snow {
    --accent: #a9c6e2;
    --accent-strong: #cfe2f4;
    --card: #15181e;
    --bg-alt: #11141a;
}

body.wx-autumn {
    --accent: #d29a55;
    --accent-strong: #e8bd85;
    --card: #1b1712;
    --bg-alt: #17130e;
}

body.wx-rain .card:hover,
body.wx-snow .card:hover,
body.wx-autumn .card:hover {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--accent);
}

main, .footer, .navbar { position: relative; z-index: 1; }

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

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 14px 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand img {
    height: 72px;
    width: 72px;
    border-radius: 50%;
    object-fit: cover;
    image-rendering: auto;
    box-shadow: 0 0 0 2px rgba(134, 154, 184, 0.45), 0 6px 20px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s, box-shadow 0.25s;
}

.brand:hover img {
    transform: scale(1.06);
    box-shadow: 0 0 0 2px var(--accent), 0 8px 26px rgba(0, 0, 0, 0.6);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: rgba(134, 154, 184, 0.1); }
.nav-link.active { color: var(--text); }
.nav-link--accent { color: var(--accent); }
.nav-link--accent:hover { color: var(--accent-strong); }

.nav-link--promo {
    background: none;
    border: 0;
    font-family: inherit;
    line-height: normal;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
    cursor: pointer;
}

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

.btn:disabled,
.btn[disabled],
.btn.is-gift-done {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn-accent {
    background: var(--accent);
    color: #0f0f0f;
    box-shadow: 0 8px 28px rgba(134, 154, 184, 0.25);
}

.btn-accent:hover { background: var(--accent-strong); transform: translateY(-2px); }

.btn-ghost {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Hero ---------- */

/* Внутренние страницы: как было — фон-картинка с текстом поверх */
.page-hero {
    position: relative;
    padding: 170px 0 110px;
    text-align: center;
    background:
        radial-gradient(1000px 500px at 50% -10%, rgba(134, 154, 184, 0.16), transparent 60%),
        url("../img/page-hero.jpg") center 55% / cover no-repeat;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(15, 15, 15, 1) 0%, rgba(15, 15, 15, 0.72) 100%);
}

.page-hero .container { position: relative; }

/* Главная: скриншот — баннер-шапка сверху, тексты — под ним */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    text-align: center;
    background: var(--bg);
}

.hero-media {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: clamp(240px, 44vh, 520px);
    overflow: hidden;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.10) 0%, rgba(15, 15, 15, 0.35) 65%, rgba(15, 15, 15, 1) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 46px 0 90px;
}

.hero .hero-title { font-size: clamp(3rem, 11vw, 7.5rem); }

/* Положение текстов под баннером (задаётся в консоли редактора) */
.hero.hero-pos-top .hero-content { justify-content: flex-start; }
.hero.hero-pos-center .hero-content { justify-content: center; }
.hero.hero-pos-bottom .hero-content { justify-content: flex-end; }
.hero.hero-pos-bottom .scroll-hint { display: none; }

@media (max-width: 640px) {
    .hero-media { height: 34vh; }
    .hero-content { padding: 32px 0 70px; }
}

.hero-title {
    font-size: clamp(4rem, 14vw, 9rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 60px rgba(134, 154, 184, 0.45);
}

.hero-subtitle {
    margin-top: 18px;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    color: var(--text);
    font-weight: 300;
}

.hero-vk-count {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(134, 154, 184, 0.35);
    background: rgba(15, 15, 15, 0.45);
    color: var(--text);
    font-size: 0.95rem;
}

.hero-vk-count i { color: var(--accent); }
.hero-vk-count b { color: var(--accent-strong); font-weight: 800; }

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

.scroll-hint {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 1.3rem;
    animation: bounce 2s infinite;
    z-index: 2;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* ---------- Внутренние страницы: заголовок ---------- */

.page-hero { padding: 160px 0 70px; }

.page-title {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 800;
    text-shadow: 0 0 40px rgba(134, 154, 184, 0.35);
}

.page-subtitle { margin-top: 10px; color: var(--muted); font-weight: 300; }

/* ---------- Секции ---------- */

.section { padding: 90px 0; position: relative; }

.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.section-lead {
    max-width: 720px;
    margin: 0 auto 12px;
    color: var(--muted);
    text-align: center;
    font-size: 1.05rem;
}

#about .section-lead:first-of-type { margin-top: 26px; }

/* ---------- Карточки ---------- */

.cards-grid {
    margin-top: 44px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 26px;
    box-shadow: var(--shadow);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(134, 154, 184, 0.55);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(134, 154, 184, 0.25);
}

.card-wide { grid-column: 1 / -1; }

.badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(134, 154, 184, 0.15);
    color: var(--accent);
    border: 1px solid rgba(134, 154, 184, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 999px;
}

.card-tag {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-bottom: 12px;
}

.card-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(134, 154, 184, 0.12);
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 18px;
}

.card-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.card-role { color: var(--accent); font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.card-text { color: var(--muted); font-size: 0.95rem; }

/* Аватарка участника команды: тёмно-синий круг с человечком.
   Один и тот же для всех — задаётся в main.js (renderTeam). */

.team-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #1b2c4f 0%, #101c33 60%, #0b1424 100%);
    border: 2px solid rgba(134, 154, 184, 0.4);
    box-shadow: 0 0 24px rgba(24, 48, 92, 0.55), inset 0 0 18px rgba(134, 154, 184, 0.08);
    color: var(--accent-strong);
    font-size: 2.1rem;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.card-actions { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

.card-wide .card-text { max-width: 820px; }

/* ---------- Соцсети ---------- */

.socials {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    font-weight: 600;
    transition: transform 0.2s, border-color 0.2s, color 0.2s;
}

.social-btn i { color: var(--accent); font-size: 1.2rem; }
.social-btn:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

/* ---------- Текстовые страницы ---------- */

.content { max-width: 760px; font-size: 1.05rem; }
.content p { margin-bottom: 18px; color: var(--muted); }
.content a { border-bottom: 1px dashed var(--accent); }
.content a.btn { border-bottom: 0; }

.content-title { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 900; margin-bottom: 6px; }
.content-lead { color: var(--accent) !important; font-weight: 700; margin-bottom: 26px !important; }
.content-subtitle { font-size: 1.2rem; font-weight: 800; margin: 30px 0 14px; color: var(--text); }
.content-list { list-style: none; padding: 0; margin: 0 0 22px; }
.content-list li { position: relative; padding-left: 22px; margin-bottom: 10px; color: var(--muted); }
.content-list li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); font-weight: 900; }
.content-list b { color: var(--text); }

/* Длинные биографии в портфолио — с переносами строк */
.card-wide .card-text { white-space: pre-line; }

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

.footer {
    background: #0b0b0c;
    border-top: 1px solid var(--border);
    padding: 54px 0 40px;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.9rem; }
.footer-brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

.footer-social { list-style: none; display: flex; gap: 10px; }
.footer-social a {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.footer-social a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.footer-vk { margin-top: 40px; border-top: 3px dashed #1d1e22; padding-top: 34px; }
.footer-vk iframe { border-radius: 12px; }

/* ---------- Чат-виджет (связь с администратором) ---------- */

.support-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #0f0f0f;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(134, 154, 184, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    display: grid;
    place-items: center;
}

.support-fab:hover { transform: translateY(-3px) scale(1.05); }

.support-chat {
    position: fixed;
    right: 22px;
    bottom: 94px;
    z-index: 200;
    width: min(340px, calc(100vw - 44px));
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

.support-chat.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.support-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(134, 154, 184, 0.08);
    border-bottom: 1px solid var(--border);
}

.support-chat-head img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(134, 154, 184, 0.35);
}

.support-chat-name { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
.support-chat-owner { color: var(--muted); font-size: 0.78rem; }

.support-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.support-chat-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.support-chat-body { padding: 16px; }
.support-chat-body p { color: var(--muted); font-size: 0.92rem; }

.support-chat-actions { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.support-chat-actions .btn { width: 100%; justify-content: center; }

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

@media (max-width: 900px) {
    .nav-toggle { display: block; }

    .nav-links {
        position: absolute;
        top: calc(100% + 10px);
        right: 4%;
        left: 4%;
        flex-direction: column;
        align-items: stretch;
        background: rgba(17, 18, 20, 0.97);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 10px;
        display: none;
    }

    .nav-links.open { display: flex; }
    .nav-link { padding: 12px 16px; }
}

@media (max-width: 560px) {
    .page-hero { padding-top: 130px; }
    .brand img { height: 56px; width: 56px; }
    .section { padding: 64px 0; }
    .card-wide { grid-column: auto; }
}

/* ---------- Карточка проекта: подпись внизу ---------- */

.card-note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ---------- Ежедневный подарок ---------- */

body.gift-open { overflow: hidden; }

.gift-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.gift-modal[hidden] { display: none; }

.gift-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.gift-card {
    position: relative;
    width: min(400px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 26px 22px;
    text-align: center;
}

.gift-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.gift-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.gift-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(134, 154, 184, 0.14);
    color: var(--accent);
    font-size: 1.5rem;
}

.gift-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.gift-sub { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 18px; }

.gift-field { display: block; text-align: left; margin-bottom: 12px; }
.gift-field span { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.gift-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}
.gift-field input:focus { outline: none; border-color: var(--accent); }

.gift-submit { width: 100%; justify-content: center; }
.gift-submit:disabled { opacity: 0.7; cursor: wait; }

.gift-status { min-height: 1.3em; margin-top: 12px; font-size: 0.86rem; line-height: 1.45; }
.gift-status.ok { color: #7fc98a; }
.gift-status.err { color: #d76a6a; }
.gift-status.info { color: var(--accent); }

.gift-note { margin-top: 10px; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

/* ---------- Промокоды ---------- */

body.promo-open { overflow: hidden; }

.promo-card { width: min(420px, 100%); }

#promo-code {
    letter-spacing: 0.14em;
    font-weight: 700;
    text-transform: uppercase;
}

.promo-reward {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    text-align: left;
}

.promo-reward-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.9rem;
}

.promo-reward-row span { color: var(--muted); }
.promo-reward-row b { color: var(--text); }
.promo-reward-row i { width: 16px; color: var(--accent); }

/* ---------- Игровой контент: онлайн и рейтинг ---------- */

.game-section { padding-top: 40px; }

.game-online-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 26px;
    background: linear-gradient(120deg, rgba(134, 154, 184, 0.12), rgba(17, 18, 20, 0.5));
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.game-online-pulse {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #46d39a;
    box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.55);
    animation: onlinePulse 2.2s infinite;
}

.game-online-card.is-offline .game-online-pulse {
    background: #8a8f98;
    animation: none;
    box-shadow: none;
}

@keyframes onlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(70, 211, 154, 0); }
    100% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0); }
}

.game-online-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.game-online-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.game-online-value {
    font-size: 2.1rem;
    line-height: 1.05;
    color: var(--text);
}

.game-online-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.rating-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.rating-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.rating-title { font-size: 1.35rem; }
.rating-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.rating-status {
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 11px;
    border-radius: 999px;
    white-space: nowrap;
}

.rating-scroll {
    max-height: 620px;
    overflow: auto;
    border-radius: 12px;
}

.rating-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

.rating-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #101114;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.rating-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.rating-row:hover td { background: rgba(134, 154, 184, 0.06); }
.rating-row.is-banned { opacity: 0.55; }

.col-place { width: 58px; }
.col-lvl, .col-rating, .col-record,
th.col-lvl, th.col-rating, th.col-record { text-align: right; white-space: nowrap; }
.col-record { color: var(--muted); }

.place-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-weight: 800;
    font-size: 0.82rem;
}

.rank-1 .place-badge { background: rgba(245, 196, 81, 0.16); color: #f5c451; }
.rank-2 .place-badge { background: rgba(207, 227, 255, 0.14); color: #cfe3ff; }
.rank-3 .place-badge { background: rgba(224, 146, 89, 0.16); color: #e09259; }

.player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rating-avatar-wrap {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 2px;
    background: conic-gradient(from 180deg, var(--frame, rgba(255, 255, 255, 0.18)), rgba(255, 255, 255, 0.06));
}

.rating-avatar-letter {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #17181c;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--muted);
}

.rating-avatar {
    position: absolute;
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 50%;
    object-fit: cover;
    background: #17181c;
}

.player-names {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.player-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #46d39a;
    box-shadow: 0 0 6px rgba(70, 211, 154, 0.8);
}

.player-title { font-size: 0.72rem; font-weight: 700; color: #5aa9ff; }
.player-ban { font-size: 0.7rem; color: #ff7a7a; }

.lvl-badge {
    display: inline-block;
    min-width: 34px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(134, 154, 184, 0.12);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
}

.rec-win { color: #6fd39b; font-weight: 700; }
.rec-loss { color: #e07a7a; font-weight: 700; }
.rec-sep { color: var(--muted); margin: 0 5px; }

.rating-loading td {
    padding: 26px 12px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Вступить в команду ---------- */

.partner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    margin-top: 26px;
}

.partner-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.partner-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.partner-card-head i {
    color: var(--accent);
    font-size: 1.15rem;
    margin-top: 4px;
}

.partner-card-title {
    font-size: 1.1rem;
    line-height: 1.35;
}

.partner-list {
    list-style: none;
    counter-reset: partner;
    margin: 0;
    padding: 0;
}

.partner-list li {
    counter-increment: partner;
    position: relative;
    padding-left: 38px;
    margin-bottom: 14px;
    color: var(--muted);
    line-height: 1.55;
}

.partner-list li:last-child { margin-bottom: 0; }

.partner-list li::before {
    content: counter(partner);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(134, 154, 184, 0.14);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
    display: grid;
    place-items: center;
}

.partner-list b { color: var(--text); }

.partner-title { color: #5aa9ff; font-weight: 800; white-space: nowrap; }

.partner-note {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    opacity: 0.85;
}

.partner-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(134, 154, 184, 0.12), rgba(17, 18, 20, 0.45));
}

.partner-cta p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.partner-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Шапка: больше пунктов меню ---------- */

@media (max-width: 1100px) and (min-width: 901px) {
    .nav-links { gap: 2px; }
    .nav-link { padding: 7px 7px; font-size: 0.78rem; }
}

@media (max-width: 1000px) and (min-width: 901px) {
    .nav-links .nav-link--accent { display: none; }
}

@media (max-width: 900px) {
    .partner-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .game-online-card { flex-wrap: wrap; padding: 16px; gap: 14px; }
    .game-online-info { flex: 1 1 calc(100% - 34px); }
    .game-online-label { white-space: nowrap; }
    .game-online-card .btn { width: 100%; justify-content: center; }
    .game-online-value { font-size: 1.8rem; }
    .rating-panel { padding: 14px; }
    .rating-table { font-size: 0.86rem; }
    .rating-table td, .rating-table th { padding: 9px 8px; }
    .col-record, th.col-record { display: none; }
    .col-place { width: 46px; }
    /* Не даём плавающей кнопке чата закрывать числа рейтинга. */
    .rating-table th:last-child,
    .rating-table td:last-child { padding-right: 64px; }
}

/* На узких экранах в таблице остаются место, игрок и рейтинг. */
@media (max-width: 560px) {
    .col-lvl, th.col-lvl { display: none; }
}

/* ---------- Поделиться страницей ---------- */

.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.share-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: 4px;
}

.share-label i { color: var(--accent); margin-right: 6px; }

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(134, 154, 184, 0.08);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}

.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.share-btn i { font-size: 0.95rem; }
.share-vk i { color: #5a9fdc; }
.share-tg i { color: #58a9e0; }
.share-copy.is-done { border-color: #46d39a; color: #46d39a; }
.share-copy.is-done i { color: #46d39a; }

/* ---------- Страница 404 ---------- */

.error-page { text-align: center; }

.error-code {
    font-size: clamp(5rem, 18vw, 11rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    background: linear-gradient(180deg, rgba(134, 154, 184, 0.9), rgba(134, 154, 184, 0.24));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}

/* ---------- Видимый фокус для клавиатуры ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

@media (max-width: 560px) {
    .share-btn span { display: none; }
    .share-btn { padding: 9px 12px; }
    .share-label { width: 100%; margin-bottom: 2px; }
}
