/* Веб-админка ChimeraDm. Тёмная, как интерфейс сервера: графит и золото. */

:root {
    --bg: #0e0f11;
    --side: #121316;
    --panel: #16171b;
    --panel-2: #1c1d22;
    --line: #25262c;
    --line-2: #31323a;
    --text: #e9e6df;
    --muted: #9b988f;
    --dim: #66645e;
    --accent: #d4a24c;
    --accent-2: #e9bb62;
    --accent-ink: #1c1407;
    --accent-soft: rgba(212, 162, 76, .13);
    --ok: #5dbb84;
    --ok-soft: rgba(93, 187, 132, .13);
    --bad: #e3614f;
    --bad-soft: rgba(227, 97, 79, .13);
    --warn: #dc9a44;
    --warn-soft: rgba(220, 154, 68, .14);
    --info: #6ea6d9;
    --info-soft: rgba(110, 166, 217, .13);
    --radius: 6px;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SFMono-Regular", Menlo, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.boot { padding: 40px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.dim { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 160px; max-width: 440px; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }

/* ── Каркас ─────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 24px;
    padding: 22px 14px 18px;
    background: var(--side); border-right: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; gap: 3px; padding: 0 10px; }
.brand-mark { font-weight: 800; font-size: 15px; letter-spacing: .24em; color: var(--accent); }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .03em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; border-radius: var(--radius);
    color: var(--muted); font-weight: 500;
}
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-2); }
.nav-count {
    display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px;
    border-radius: 9px; background: var(--warn); color: #1d1204;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.side-foot { margin-top: auto; display: grid; gap: 2px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.me-name { font-weight: 600; overflow-wrap: anywhere; }
.me-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.top {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
    padding: 18px 30px; border-bottom: 1px solid var(--line);
}
.page-title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
.server {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13px; color: var(--muted);
}
.server .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.server.up { color: var(--text); }
.server.up .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.server.down .dot { background: var(--warn); }

.main { padding: 24px 30px 56px; outline: none; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

/* ── Карта города с территориями ─────────────────────────── */
/* Карта — главный объект экрана, поэтому высокая и во всю ширину панели */
.terr-map {
    position: relative;
    /* Сетка квадратов шире, чем выше: низкий бокс упирался бы в высоту и оставлял
       по бокам пустой океан, поэтому держим карту высокой */
    height: clamp(740px, 76vh, 940px);
    border-radius: var(--radius); overflow: hidden;
    background: #05070b; border: 1px solid var(--line);
}
.terr-map .leaflet-container { background: #05070b; font: inherit; }
.terr-map .leaflet-control-attribution { display: none; }
/* Тайлы города — светлая вода и почти чёрная суша, то есть обратная картинка к карте
   захватов. Разворачиваем яркость (hue-rotate возвращает цвет шоссе): получается чёрная
   вода и светло-серая суша. Фильтр вешаем на всю панель тайлов — до отдельных картинок
   он не доходил, потому что в leaflet.css у .leaflet-tile стоит filter: inherit */
.terr-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.62) contrast(1.08) saturate(.7); }
.terr-map .leaflet-tile-pane img.leaflet-tile { filter: none; }
/* Единый тёмный скрим между тайлами и квадратами: цвет семьи читается одинаково
   и над сушей, и над водой. Размер заведомо больше любого сдвига карты */
.terr-map .terr-scrim {
    position: absolute; left: -20000px; top: -20000px; width: 40000px; height: 40000px;
    background: rgba(4, 6, 11, .45); pointer-events: none;
}

/* Строка контроля над картой — тёмная плашка-«таблетка» */
.terr-top {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
    width: fit-content; max-width: 100%;
    padding: 7px 10px; border-radius: 999px;
    background: rgba(12, 14, 18, .9); border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
    font-size: 12px; color: var(--muted);
}
.terr-top-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; }
.terr-top-item + .terr-top-item { border-left: 1px solid var(--line); }
.terr-top-item b { color: var(--text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.terr-top-fight, .terr-top-fight b { color: var(--bad); }
/* Иконки плашки и кнопок — контурный SVG, а не текстовый глиф */
.terr-ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Если разметка кладёт плашку внутрь карты — она встаёт в левый верхний угол поверх тайлов */
.terr-map .terr-top { position: absolute; z-index: 800; top: 12px; left: 12px; pointer-events: none; }

/* Кнопки в правом верхнем углу карты: своя атака, расписание, колокольчик */
.terr-actions { position: absolute; z-index: 800; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; }
.terr-act {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 11px; border-radius: 8px; cursor: pointer;
    background: rgba(12, 14, 18, .9); border: 1px solid rgba(255, 255, 255, .11);
    color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.terr-act:hover { background: rgba(255, 255, 255, .13); color: var(--text); }
.terr-act.attacking {
    background: rgba(196, 38, 38, .92); border-color: #ff6b6b; color: #fff; font-weight: 700;
}
.terr-act.attacking b { font-weight: 700; font-variant-numeric: tabular-nums; }
.terr-act.attacking:hover { background: rgba(224, 48, 48, .96); color: #fff; }
.terr-act.ico { padding: 0 8px; }
.terr-act.ico.off { opacity: .5; }
/* На узком экране кнопки съезжают под плашку, иначе они налезают друг на друга */
@media (max-width: 900px) {
    .terr-map { height: clamp(460px, 62vh, 700px); }
    .terr-actions { top: 56px; }
    .terr-act { height: 26px; padding: 0 8px; font-size: 11px; }
}

/* Квадраты территорий и подписи */
.terr-defs { position: absolute; width: 0; height: 0; }
/* Полосы штриховки живут в SVG-узоре, из CSS красим их сами: так штриховка заметна поверх заливки */
.terr-defs pattern rect { fill: rgba(255, 255, 255, .78); }
.terr-map .terr-rect {
    cursor: pointer; stroke-opacity: .95; stroke-linejoin: miter;
    transition: fill-opacity .15s, stroke-opacity .15s;
}
.terr-map .terr-rect:hover { fill-opacity: .72; stroke-opacity: 1; }
/* Точка в бою: отчётливая диагональная штриховка и красный ореол */
.terr-map .terr-hatch {
    fill: url(#terrHatch); fill-opacity: .62;
    filter: drop-shadow(0 0 6px rgba(255, 70, 60, .55));
    animation: terrPulse 1.6s ease-in-out infinite;
}
@keyframes terrPulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .terr-map .terr-hatch { animation: none; } }
/* Выбранный квадрат — заметная рамка со светлым ореолом */
.terr-map .terr-sel {
    stroke-dasharray: none; stroke-width: 3; stroke-opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, .55));
}
/* Номер территории поверх заливки: белый, жирный, с тенью. Череп и таймер — в столбик */
.terr-label {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    font-size: 12px; font-weight: 800; line-height: 1;
    color: #fff; font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 7px rgba(0, 0, 0, .8);
    pointer-events: none; white-space: nowrap;
}
/* Свободная территория — номер чуть тусклее занятого, но с тем же плотным ореолом:
   над светлой водой приглушённый серый сливался с фоном */
.terr-label.free, .terr-label-free {
    color: rgba(238, 241, 246, .88); font-weight: 700;
    text-shadow: 0 0 4px rgba(0, 0, 0, .95), 0 1px 2px #000;
}
.terr-map .leaflet-marker-icon { background: none; border: 0; }
.terr-skull { font-size: 14px; line-height: 1; }
.terr-timer {
    font-size: 10.5px; font-weight: 700; color: #ffd0d0;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
}
/* Стили Leaflet подключаются позже наших, поэтому селектор с запасом по весу */
.terr-map .leaflet-tooltip.terr-tip {
    padding: 4px 8px; border-radius: var(--radius);
    background: rgba(10, 11, 13, .92); border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .6);
    color: #fff; font-size: 11.5px; font-weight: 650; text-shadow: none;
}
.terr-map .leaflet-tooltip.terr-tip::before { display: none; }

/* Кнопки управления войнами под картой — два компактных ряда, тёмные с тонкой рамкой */
.terr-tools { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.terr-tools .btn {
    height: auto; min-height: 32px; padding: 6px 10px;
    font-size: 12px; font-weight: 550; line-height: 1.15;
    white-space: normal; text-align: center;
    background: #14151a; border-color: var(--line); color: var(--muted);
}
.terr-tools .btn:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
@media (max-width: 1180px) { .terr-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .terr-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Список территорий: плотная сетка квадратов ───────────── */
.terr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; }
.terr-cell {
    display: grid; gap: 1px; align-content: center; justify-items: center;
    min-height: 58px; padding: 6px 4px; border-radius: 4px; cursor: pointer;
    border: 1px solid var(--line); background: var(--panel-2);
    color: var(--text); text-align: center; font: inherit; overflow: hidden;
}
.terr-cell:hover { border-color: var(--line-2); }
.terr-cell.free { color: var(--dim); }
.terr-cell.free .terr-id { color: var(--muted); font-weight: 700; text-shadow: none; }
/* Идёт захват — те же диагональные полосы, что и на карте (важнее инлайнового цвета семьи) */
.terr-cell.attack {
    border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad);
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .14) 0 4px, rgba(255, 255, 255, 0) 4px 10px) !important;
}
.terr-cell.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.terr-id {
    font-size: 13px; font-weight: 800; color: #fff;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}
.terr-name { font-size: 10px; max-width: 100%; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terr-owner { font-size: 9.5px; max-width: 100%; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terr-swatch {
    width: 12px; height: 12px; border-radius: 3px; flex: none;
    border: 1px solid var(--line-2); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
    display: inline-block; vertical-align: -2px;
}
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.loading { color: var(--muted); padding: 24px 0; }
.error-box { padding: 16px; border: 1px solid var(--bad-soft); background: var(--bad-soft); color: #f1b0a6; border-radius: var(--radius); }

/* ── Плитки ─────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile {
    display: grid; gap: 4px; align-content: start;
    padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
a.tile:hover { background: var(--panel-2); border-color: var(--line-2); }
.tile-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.tile-value { font-size: 26px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12px; color: var(--dim); }
.tile.warn .tile-value { color: var(--warn); }
.tile.accent .tile-value { color: var(--accent-2); }
.tile.muted .tile-value { color: var(--dim); }

/* ── Панели ─────────────────────────────────────────────── */
.panel {
    display: flex; flex-direction: column; gap: 12px; min-width: 0;
    padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.panel-title { margin: 0; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.panel-link { align-self: flex-start; font-size: 13px; color: var(--accent); }
.panel-link:hover { text-decoration: underline; }

/* ── Таблицы ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { margin: 0 -16px; background: transparent; border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    position: sticky; top: 0; z-index: 1;
    padding: 9px 12px; text-align: left; white-space: nowrap;
    font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
    background: var(--panel); border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel-2); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.actions-cell { text-align: right; white-space: nowrap; }
.table tr.faded td { color: var(--dim); }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.panel .empty { padding: 16px 0; border: 0; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.pager-page { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Графики и показатели ───────────────────────────────── */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart-area { fill: var(--accent-soft); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-peak { fill: var(--accent-2); }
.chart-label { fill: var(--dim); font-size: 11px; font-family: var(--font); }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 2px 12px; align-items: baseline; padding: 5px 0; }
.kv-label { color: var(--muted); font-size: 12.5px; }
.kv-value { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.kv-sub { grid-column: 1 / -1; color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }

.meter { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin: 2px 0 8px; }
.meter-fill { height: 100%; background: var(--ok); }
.meter-fill.warn { background: var(--warn); }
.meter-fill.bad { background: var(--bad); }

/* ── Консоль сервера ────────────────────────────────────── */
.console {
    height: 340px; overflow-y: auto; padding: 10px 12px;
    background: #0a0b0d; border: 1px solid var(--line); border-radius: var(--radius);
    font-family: var(--mono); font-size: 12px; line-height: 1.5;
}
.console-line { display: flex; gap: 10px; }
.console-line.warn .console-text { color: var(--warn); }
.console-line.bad .console-text { color: var(--bad); }
.console-time { color: var(--dim); flex: none; }
.console-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; height: auto; }

/* ── Метки и ссылки на игроков ──────────────────────────── */
.badge {
    display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin: 0 4px 2px 0;
    border-radius: 4px; border: 1px solid var(--line);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    color: var(--muted); background: var(--panel-2);
}
.badge:last-child { margin-right: 0; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.accent { color: var(--accent-2); background: var(--accent-soft); border-color: transparent; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges .badge { margin: 0; }

.who { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.who-id { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.table .who { flex-wrap: nowrap; white-space: nowrap; }
a.who:hover .who-name, a.who:hover .who-id { color: var(--accent-2); }

/* ── Кнопки и поля ──────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: var(--radius);
    border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
    font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #43444d; background: #22232a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: var(--bad-soft); border-color: rgba(227, 97, 79, .45); color: #f2a497; }
.btn-danger:hover { background: rgba(227, 97, 79, .24); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }

input, select, textarea {
    width: 100%; min-width: 0; padding: 7px 10px;
    background: #101114; border: 1px solid var(--line-2); border-radius: var(--radius);
}
input, select { height: 34px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--dim); }

.field { display: grid; gap: 5px; }
.field-label { font-size: 12.5px; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--dim); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar .search { flex: 1 1 280px; max-width: 460px; }
.toolbar .date { width: 150px; flex: none; }
.toolbar select { width: auto; min-width: 170px; }
.toolbar-gap { flex: 1; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.preset:hover, .preset.on { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }

/* ── Вкладки ────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: #101114; }
.seg a { padding: 4px 12px; border-radius: 4px; color: var(--muted); font-size: 13px; font-weight: 550; }
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--panel-2); color: var(--text); }

/* ── Карточка игрока ────────────────────────────────────── */
.player-head { display: grid; gap: 14px; }
.player-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.player-name { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.player-id { font-family: var(--mono); color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px 24px; margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.back { font-size: 13px; color: var(--muted); }
.back:hover { color: var(--text); }

/* ── Репорты ────────────────────────────────────────────── */
.reports { display: grid; grid-template-columns: minmax(260px, 370px) minmax(0, 1fr); gap: 20px; align-items: start; }
.report-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.report-item { display: grid; gap: 3px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.report-item:last-child { border-bottom: 0; }
.report-item:hover { background: var(--panel-2); }
.report-item.active { background: var(--accent-soft); }
.report-top { display: flex; justify-content: space-between; gap: 8px; }
.report-subject { font-weight: 600; overflow-wrap: anywhere; }
.report-meta { font-size: 12px; color: var(--muted); }

.thread { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.msg { max-width: 80%; padding: 9px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.msg.admin { align-self: flex-end; background: var(--accent-soft); border-color: rgba(212, 162, 76, .28); }
.msg-head { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 3px; font-size: 12px; color: var(--muted); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { display: grid; gap: 8px; }
.reply-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a:hover { color: var(--accent-2); }

/* ── Окна и уведомления ─────────────────────────────────── */
.backdrop {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center; padding: 16px;
    background: rgba(5, 5, 7, .66);
}
.modal {
    width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
    display: grid; gap: 14px; padding: 20px;
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.modal-title { margin: 0; font-size: 17px; font-weight: 650; }
.modal-text { margin: 0; color: var(--muted); }
.modal-error { padding: 8px 10px; border-radius: var(--radius); background: var(--bad-soft); color: #f2a497; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
    padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--line-2);
    background: #1f2026; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    transition: opacity .25s, transform .25s;
}
.toast.ok { border-color: rgba(93, 187, 132, .45); }
.toast.warn { border-color: rgba(220, 154, 68, .5); }
.toast.bad { border-color: rgba(227, 97, 79, .5); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Вход ───────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
    width: min(360px, 100%); display: grid; gap: 16px; padding: 28px 24px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.brand-login { padding: 0 0 6px; }
.login-error { padding: 8px 10px; border-radius: var(--radius); background: var(--bad-soft); color: #f2a497; font-size: 13px; }
.login-hint { margin: 0; font-size: 12px; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
}

@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; }
    .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; }
    .nav-link { flex: none; }
    .side-foot { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; }
    .me-meta { margin: 0; }
    .grid-2, .reports { grid-template-columns: 1fr; }
    .top, .main { padding-left: 16px; padding-right: 16px; }
    .msg { max-width: 92%; }
}
