:root {
    --primary: #5865F2;
    --secondary: #2c2f33;
    --bg: #0f0f1e;
    --card: #1a1a2e;
    --text: #e0e0e0;
    --accent: #00d9a3;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #5865F2 0%, #8B5CF6 100%);
    border-radius: 20px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,...') repeat;
    opacity: 0.1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.pulse {
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,217,163,0.7); }
    50% { box-shadow: 0 0 0 15px rgba(0,217,163,0); }
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.player-card {
    background: var(--card);
    padding: 1rem;
    border-radius: 15px;
    display: flex;
    gap: 1rem;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(88,101,242,0.3);
}

.player-card img {
    width: 64px; height: 64px;
    border-radius: 10px;
    image-rendering: pixelated;
}

.player-name { font-weight: 600; font-size: 1.1rem; }
.player-world { color: #888; font-size: 0.9rem; }
.player-time { color: var(--accent); font-size: 0.85rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Кликабельная карточка статистики */
a.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.stat-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.35);
    border-color: var(--primary);
}

a.stat-link .stat-label::after {
    content: '';
}

/* ===== Навигация (адаптивная) ===== */
.topnav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15,15,30,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 2rem;
    position: relative;
}
.nav-brand { font-weight: 800; font-size: 1.2rem; color: #fff; text-decoration: none; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a, .nav-links .nav-dropdown-toggle { color: #bbb; text-decoration: none; font-size: 0.95rem; background: none; border: none; cursor: pointer;}
.nav-links a:hover, .nav-links .nav-dropdown-toggle:hover { color: #fff; }
.nav-btn {
    padding: 0.45rem 1.1rem !important;
    background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
    border-radius: 10px; color: #fff !important; font-weight: 600;
}
.nav-btn.ghost { background: transparent !important; border: 1px solid rgba(255,255,255,0.2); }

/* Бургер-кнопка (скрыта на десктопе) */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.08); }

@media (max-width: 768px) {
    .nav-inner { padding: 0.7rem 1rem; }
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: rgba(15,15,30,0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem;
        gap: 0.4rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links .nav-dropdown-toggle {
        padding: 0.8rem 1rem;
        border-radius: 8px;
        background: none;
        border: none;
        cursor: pointer;
    }
    .nav-links a:hover, .nav-links .nav-dropdown-toggle:hover  { background: rgba(255,255,255,0.06); }
    .nav-btn { text-align: center; }
}

/* ===== Инфо о сервере в hero ===== */
.server-info { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; position: relative; }
.ip-chip, .info-chip {
    background: rgba(0,0,0,0.3); padding: 0.55rem 1.2rem; border-radius: 12px;
    font-size: 0.95rem; backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15); color: #fff;
}
.ip-chip { cursor: pointer; transition: transform 0.2s, border-color 0.2s; font-family: monospace; font-weight: 700; }
.ip-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.copy-ico { opacity: 0.6; }
.motd { margin-top: 1rem; font-style: italic; opacity: 0.9; position: relative; }

/* ===== Топ игроков ===== */
.top-section { margin-top: 3rem; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.top-col { background: var(--card); border-radius: 15px; padding: 1.2rem; }
.top-col h3 { margin-bottom: 1rem; font-size: 1rem; color: #ccc; }
.top-list { list-style: none; }
.top-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.6rem; border-radius: 10px; cursor: pointer;
    transition: background 0.15s;
}
.top-item:hover { background: rgba(88,101,242,0.15); }
.top-item img { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; }
.top-rank { width: 26px; text-align: center; font-weight: 700; }
.top-name { flex: 1; font-weight: 600; }
.top-value { color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.top-empty { color: #666; padding: 0.5rem; }

/* ===== Формы / кабинет ===== */
.container.narrow { max-width: 480px; }
.form-card {
    background: var(--card); border-radius: 20px; padding: 2rem;
    display: flex; flex-direction: column; gap: 0.6rem;
}
.form-card h1 { margin-bottom: 0.5rem; }
.form-card h2 { margin-bottom: 0.8rem; font-size: 1.2rem; }
.form-label { font-size: 0.85rem; color: #999; margin-top: 0.5rem; }
.form-input {
    width: 100%; padding: 0.7rem 1rem; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text); font-size: 0.95rem; outline: none; font-family: inherit;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary); }
textarea.form-input { resize: vertical; }
.btn {
    padding: 0.7rem 1.5rem; border: none; border-radius: 10px;
    background: #333; color: #fff; font-weight: 600; cursor: pointer;
    transition: transform 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: linear-gradient(135deg, var(--primary), var(--accent));}
.form-hint { font-size: 0.85rem; color: #888; line-height: 1.5; }
.form-foot { margin-top: 1rem; font-size: 0.9rem; color: #999; }
.form-foot a { color: var(--primary); }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; margin-top: 2rem; }

/* ===== Тосты ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    padding: 0.9rem 1.5rem; border-radius: 12px; font-weight: 600;
    background: #222; color: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    opacity: 0; transform: translateY(20px); transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-left: 4px solid var(--accent); }
.toast.err { border-left: 4px solid #ff5050; }

/* ===== Кнопка «Назад» — единый вид на всех страницах ===== */
.back-link {
    display: inline-block;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 2rem;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s, transform 0.2s;
}
.back-link:hover {
    background: #2a2a3e;
    transform: translateX(-3px);
}

/* ===== Плашка «единый аккаунт» в формах входа/регистрации ===== */
.auth-note {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    margin: 1.1rem 0 1.4rem;
    padding: 0.95rem 1.2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(88,101,242,0.12), rgba(0,217,163,0.10));
    border: 1px solid rgba(0,217,163,0.35);
    font-size: 0.9rem;
    line-height: 1.55;
    color: #d7e6e2;
}
.auth-note b { color: #fff; }
.auth-note .note-icon { font-size: 1.25rem; line-height: 1.4; }
.auth-note code {
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-size: 0.85em;
}

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; }
.action-btn { margin-top: 0; font-size: 0.85rem; }

/* ===== Админ-таблица ===== */
.admin-table { width: 100%; table-layout: fixed; }
.admin-table th:nth-child(1) { width: 40%; }
.admin-table th:nth-child(2) { width: 30%; }
.admin-table th:nth-child(3) { width: 30%; }
.admin-table td { vertical-align: middle; }

.admin-name {
    display: flex; align-items: center; gap: .7rem;
    font-weight: 600;
}
.admin-name img {
    width: 36px; height: 36px;
    border-radius: 8px;
    image-rendering: pixelated;
}

.group-select {
    width: 100%; max-width: 220px;
    padding: .55rem .8rem;
    background: #232338;
    color: var(--text);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    font-size: .9rem;
    transition: border-color .2s;
}
.group-select:hover  { border-color: rgba(255,255,255,.35); }
.group-select:focus  { border-color: var(--primary); }
.group-select option { background: #1a1a2e; color: #eee; }

/* ===== Галерея скинов ===== */
.skin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: .6rem;
    max-height: 340px;
    overflow-y: auto;
    padding: .4rem;
    margin: .8rem 0;
    scrollbar-width: thin;
}
.skin-card {
    background: rgba(255,255,255,.04);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: .5rem .3rem;
    text-align: center;
    cursor: pointer;
    transition: .2s;
}
.skin-card:hover { background: rgba(88,101,242,.15); transform: translateY(-2px); }
.skin-card.selected { border-color: var(--accent); background: rgba(0,217,163,.12); }
.skin-card img { height: 72px; image-rendering: pixelated; }
.skin-card span {
    display: block; font-size: .72rem; color: #bbb; margin-top: .3rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.skin-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }

/* Кнопка домена — чуть акцентнее, чтобы отличалась от IP */
.host-chip {
    border-color: rgba(0, 217, 163, 0.6);
    color: #eafff8;
}
.host-chip:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 217, 163, 0.35);
}

/* Подсказка под кнопками */
.connect-hint {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    opacity: 0.75;
    position: relative;
}

.online-badge.offline { background: rgba(255, 80, 80, 0.25); }
.online-badge.offline .pulse { background: #ff5050; animation: none; }
.perm-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.perm-chip {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    padding: .25rem .7rem;
    border-radius: 20px;
    font-family: monospace;
    font-size: .78rem;
    color: #ccc;
}
.perm-chip.wild { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* Перенос длинных команд и прав */
.admin-table td.name-cell {
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}
.admin-table td:first-child {
    max-width: 280px;
}
@media (max-width: 768px) {
    .admin-table td:first-child { max-width: none; }
}

/* Значок OP */
.op-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffb347, #ffcc33);
    color: #201200;
    font-weight: 800;
    font-size: .66rem;
    letter-spacing: .03em;
    padding: .18rem .55rem;
    border-radius: 20px;
    margin-left: .45rem;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(255, 179, 71, .35);
}

/* Чип команды в таблице прав */
.cmd-chip {
    background: #232338;
    border: 1px solid rgba(255,255,255,.1);
    padding: .2rem .55rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: .78rem;
    color: #e8e8ff;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Пагинация */
.perms-pager { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; }
.pager-info  { color: #888; font-size: .85rem; margin-right: .8rem; }
.page-btn {
    min-width: 34px; height: 34px;
    background: #232338; color: #ccc;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.page-btn:hover:not(:disabled) { background: #2d2d4a; color: #fff; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: default; }
.dots { color: #666; padding: 0 .2rem; }

/* ===== Таблица лога действий ===== */
.log-wrap { overflow-x: auto; }          /* на телефоне — горизонтальный скролл */

.log-table {
    width: 100%;
    table-layout: auto;                  /* браузер сам распределит ширины */
}
.log-table th { white-space: nowrap; }
.log-table td { vertical-align: top; }
.log-type { white-space: nowrap; }

.log-when {
    white-space: nowrap;
    color: #aaa;
    font-size: .85rem;
}
.log-action { min-width: 260px; }        /* действие — самая широкая колонка */
.log-action .cmd-chip {
    display: inline-block;
    white-space: normal;                 /* длинные команды переносятся по словам */
    word-break: break-word;
}

/* ===== Логотип ===== */
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.nav-logo {
    height: 30px;          /* компактно, в высоту строки навигации */
    width: auto;
    border-radius: 6px;
    display: block;
}

.hero-logo {
    height: 76px;          /* пропорционально ~110px ширины — заголовок не ломается */
    width: auto;
    vertical-align: middle;
    margin-right: .5rem;
    border-radius: 14px;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35));
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-logo { height: 48px; border-radius: 10px; }
    .nav-logo { height: 26px; }
}

#login-form .btn-accent, #reg-form .btn-accent{
    margin-top: 1rem;
}

/* ===== Футер с правовыми документами ===== */
.site-footer {
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.18);
    padding: 2.2rem 1rem 2.6rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .8rem 2.4rem;
    margin-bottom: 1.4rem;
}

.footer-links a {
    color: #9aa0b4;
    text-decoration: none;
    font-size: .9rem;
    transition: color .2s;
}

.footer-links a:hover {
    color: var(--accent, #00d9a3);
}

.footer-copy {
    color: #6b7186;
    font-size: .9rem;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: .9rem;
    }
}

/* ===== Страницы документов ===== */
.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.legal-page h1 {
    margin-bottom: .5rem;
    font-size: 2rem;
}
.legal-page .legal-update {
    color: #888;
    font-size: .9rem;
    margin-bottom: 2rem;
}
.legal-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent, #00d9a3);
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-bottom: .5rem;
}
.legal-content h3 {
    margin-top: 1.2rem;
    margin-bottom: .5rem;
    font-size: 1.05rem;
}
.legal-content p, .legal-content li {
    line-height: 1.65;
    color: #d4d4d8;
}
.legal-content ul, .legal-content ol {
    padding-left: 1.5rem;
    margin: .7rem 0;
}
.legal-content li {
    margin-bottom: .4rem;
}
.legal-content strong {
    color: #fff;
}
.legal-content a {
    color: var(--accent, #00d9a3);
}
.requisites-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.requisites-table td {
    padding: .6rem .8rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    vertical-align: top;
}
.requisites-table td:first-child {
    width: 35%;
    color: #aaa;
}
.services-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.services-table th, .services-table td {
    padding: .6rem .8rem;
    border: 1px solid rgba(255,255,255,.1);
    text-align: left;
}
.services-table th {
    background: rgba(255,255,255,.05);
}

.consent-block {
    margin: 1.2rem 0;
    padding: 1rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
}
.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    cursor: pointer;
    user-select: none;
    margin-bottom: .7rem;
    line-height: 1.4;
}
.consent-checkbox:last-of-type { margin-bottom: 0; }
.consent-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.25);
    border-radius: 5px;
    margin-top: 2px;
    transition: .2s;
    position: relative;
}
.consent-input:checked + .checkmark {
    background: var(--accent, #00d9a3);
    border-color: var(--accent, #00d9a3);
}
.consent-input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.consent-checkbox:hover .checkmark {
    border-color: rgba(255,255,255,.5);
}
.consent-text {
    font-size: .9rem;
    color: #ccc;
}
.consent-text a {
    color: var(--accent, #00d9a3);
    text-decoration: underline;
    text-decoration-style: dotted;
}
.consent-text a:hover {
    text-decoration-style: solid;
}
.consent-error {
    margin-top: .7rem;
    padding: .6rem .8rem;
    background: rgba(255,70,70,.1);
    border: 1px solid rgba(255,70,70,.3);
    border-radius: 6px;
    color: #ff6b6b;
    font-size: .85rem;
}
#reg-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.3);
}
#reg-submit:disabled:hover {
    transform: none;
}

/* ===== admin ===== */
.console-out {
    margin-top: 1rem;
    background: #000;
    color: #0f0;
    padding: 1rem;
    border-radius: 10px;
    min-height: 40px;
    font-size: 0.85rem;
    white-space: pre-wrap;
}
.srv-busy {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(88,101,242,.15), rgba(0,217,163,.10));
    border: 1px solid rgba(0,217,163,.25);
    display: flex;
    align-items: center;
    gap: .9rem;
}
.srv-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.15);
    border-top-color: var(--accent);
    animation: srvspin .8s linear infinite;
    flex: 0 0 auto;
}
@keyframes srvspin {
    to { transform: rotate(360deg); }
}
.btn-disabled,
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(.25);
}
.btn-disabled:hover,
.btn:disabled:hover {
    transform: none !important;
}

/* ===== Оверлей-прелоадер для действий с игроками ===== */
.action-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-overlay-box {
    background: #1e1e2e;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    font-weight: 600;
    max-width: 90vw;
    text-align: center;
}
.action-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.15);
    border-top-color: var(--accent, #00d9a3);
    animation: actionspin .8s linear infinite;
}
@keyframes actionspin {
    to { transform: rotate(360deg); }
}

/* ===== Чат ===== */
.chat-box {
    margin-top: 1rem;
    background: #000;
    border-radius: 10px;
    padding: 1rem;
    max-height: 500px;
    min-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.chat-msg {
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.chat-msg:last-child { border-bottom: none; }
.chat-time { color: #666; font-size: 0.75rem; margin-right: 0.5rem; }
.chat-player { font-weight: 700; margin-right: 0.5rem; }
.chat-type-chat .chat-player { color: #00d9a3; }
.chat-type-command .chat-player { color: #ffa502; }
.chat-type-whisper .chat-player { color: #ff4757; }
.chat-type-command .chat-text { color: #ccc; font-style: italic; }
.chat-type-whisper .chat-text { color: #ff6b9d; }
.chat-controls {
    margin-top: 0.8rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.chat-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #aaa;
    cursor: pointer;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.chat-loading {
    color: #666;
    text-align: center;
    padding: 2rem;
}

/* ===== Управление игроками ===== */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 1.1rem;
}

.players-table thead th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}
.players-table thead th[data-sort]:hover {
    background: rgba(255,255,255,.05);
}
.players-table thead th.sort-asc::after {
    content: '↑';
    position: absolute;
    right: 0.5rem;
    color: var(--accent);
    font-weight: 700;
}
.players-table thead th.sort-desc::after {
    content: '↓';
    position: absolute;
    right: 0.5rem;
    color: var(--accent);
    font-weight: 700;
}

.avatar-cell {
    width: 50px;
    text-align: center;
    cursor: pointer;
}
.avatar-cell img {
    border-radius: 6px;
    vertical-align: middle;
}
.name-cell { cursor: pointer; }

/* Бейдж бана */
.ban-badge {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* ===== Селект смены группы, стилизованный под бейдж ===== */
.group-cell {
    padding: 0.4rem 0.5rem !important;
}
.group-select-pill {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    padding: 0.4rem 1.6rem 0.4rem 0.7rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='white' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 6px;
    transition: transform .15s, box-shadow .15s;
}
.group-select-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.group-select-pill:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.group-select-pill option {
    background: #2a2a3e;
    color: #fff;
    padding: 0.4rem;
}

/* ===== Таблица игроков: 5 колонок ===== */
.players-table.admin-table {
    table-layout: auto;
}
.players-table.admin-table th {
    width: auto !important;
}
.players-table.admin-table th:nth-child(1) {
    width: 60px;
}
.players-table.admin-table th:nth-child(4) {
    white-space: nowrap;
}
.players-table.admin-table th:nth-child(5) {
    width: 220px;
}

/* ===== Кнопки действий ===== */
.actions-cell {
    white-space: nowrap;
    padding: 0.4rem 0.5rem !important;
}
.btn-action {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform .12s, filter .12s;
    margin-right: 0.3rem;
}
.btn-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
}
.btn-action:active {
    transform: translateY(0);
}
.btn-ban {
    background: #c0392b;
}
.btn-unban {
    background: #27ae60;
}
.btn-delete {
    background: #8e44ad;
}
.btn-delete:hover {
    background: #a050c0;
}

/* map */
.map-wrap {
    padding: 1rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.map-frame {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    border: 0;
    border-radius: 16px;
    background: #0a0a1a;
    box-shadow: 0 10px 40px rgba(0,0,0,.4);
}

/* Таблица команд меток */
.map-commands { margin-top: 1.5rem; }
.map-cmd-table { width: 100%; table-layout: fixed; }
.map-cmd-table th:nth-child(1) { width: 62%; }
.map-cmd-table th:nth-child(2) { width: 38%; }
.map-cmd-table td { vertical-align: middle; padding: .6rem .8rem; }
.map-cmd-table td:last-child { font-size: .85rem; color: #aaa; }

.copy-cmd {
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    padding: .1rem .45rem;
    margin-left: .4rem;
    font-size: .8rem;
    transition: .2s;
}
.copy-cmd:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 768px) {
    .map-wrap { padding: .5rem .5rem 1rem; }
    .map-frame { height: 70vh; min-height: 350px; }
    .map-cmd-table { table-layout: auto; }
    .map-cmd-table th:nth-child(1),
    .map-cmd-table th:nth-child(2) { width: auto; }
}

/* players */
.ban-badge {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.75rem;
    vertical-align: middle;
}
.status.banned {
    color: #ff6b6b;
    font-weight: 600;
}
.row-banned .name-cell {
    color: #999;
}

/* footer */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2b2b3d;
    box-shadow: 0 -4px 24px rgba(0,0,0,.4);
    z-index: 9999;
    padding: .9rem 1rem;
    animation: cookieSlideUp .45s ease;
}
.cookie-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}
.cookie-text {
    color: #d7d7e0;
    font-size: .9rem;
    line-height: 1.5;
}
.cookie-text a {
    color: var(--accent, #4aa3df);
    text-decoration: underline;
    text-decoration-style: dotted;
}
.cookie-text a:hover {
    text-decoration-style: solid;
}
.cookie-btn {
    flex-shrink: 0;
    background: var(--accent, #2196c9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.6rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}
.cookie-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}
@keyframes cookieSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@media (max-width: 640px) {
    .cookie-inner { flex-direction: column; gap: .8rem; text-align: center; }
    .cookie-btn { width: 100%; }
}

/* ===== Выпадающее меню в шапке ===== */
.nav-dropdown { position: relative; display: inline-block; }
.dropdown-arrow { font-size: .7em; transition: transform .2s; }
.nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    min-width: 200px;
    padding: .5rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .2s;
    z-index: 1000;
}
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block;
    padding: .6rem 1rem;
    color: #ddd;
    text-decoration: none;
    transition: background .15s;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,.08); color: var(--accent); }
.dropdown-divider { height: 1px; background: rgba(255,255,255,.1); margin: .4rem 0; }

/* ===== Навигация внутри админки ===== */
.admin-nav {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 2rem;
    padding: .5rem;
    background: rgba(255,255,255,.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
}
.admin-nav-item {
    padding: .6rem 1rem;
    border-radius: 6px;
    background: rgba(255,255,255,.04);
    color: #ccc;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: all .15s;
    border: 1px solid transparent;
}
.admin-nav-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.admin-nav-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* карта */
.map-placeholder {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    max-height: 820px;
    background: linear-gradient(135deg, #141428, #1a1f3a);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    border: 1px solid rgba(255,255,255,.08);
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0,0,0,.4);
}
.map-placeholder::before {
    content: '🗺️';
    position: absolute;
    font-size: clamp(14rem, 35vw, 28rem);
    opacity: 0.05;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: grayscale(60%) brightness(0.8);
    user-select: none;
}
.map-placeholder::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: 40px 40px;
    pointer-events: none;
}
.map-placeholder-icon {
    font-size: clamp(3rem, 8vw, 5rem);
    opacity: 0.75;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 20px rgba(88, 101, 242, .4));
    animation: map-float 3s ease-in-out infinite;
}
@keyframes map-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.map-placeholder-text {
    font-size: 1.15rem;
    color: #ddd;
    font-weight: 500;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 1rem;
}
.map-placeholder-hint {
    font-size: .85rem;
    color: #888;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.map-placeholder-hint::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5050;
    animation: map-pulse 1.5s ease-in-out infinite;
}
@keyframes map-pulse {
    0%, 100% { opacity: .4; box-shadow: 0 0 0 0 rgba(255, 80, 80, .6); }
    50% { opacity: 1; box-shadow: 0 0 0 8px rgba(255, 80, 80, 0); }
}
.map-placeholder.ready .map-placeholder-icon {
    filter: drop-shadow(0 4px 20px rgba(0, 217, 163, .5));
}
.map-placeholder.ready .map-placeholder-hint::before {
    background: #00d9a3;
}