/* Панель использует те же токены, что и сайт (site.css): чёрный фон, фиолетовый акцент, синий для данных. */
:root {
  --bg: #07070b;
  --bg-2: #0f0f17;
  --bg-3: #181826;
  --line: #222233;
  --text: #ececf3;
  --muted: #8a8aa3;
  --accent: #6d4aff;
  --accent-2: #8467ff;
  --accent-text: #b3a3ff;
  --accent-soft: rgba(109, 74, 255, 0.14);
  --blue: #3d7bff;
  --blue-text: #8fb3ff;
  --danger: #f2555a;
  --ok: #3ccf7a;
  --radius: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
h2 { font: 600 14px/1.2 Inter, sans-serif; letter-spacing: -0.01em; margin: 0; }

/* ---------- шапка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 11, 0.8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--blue)); color: #fff; font: 800 12px/1 var(--mono);
}
.top-links { display: flex; gap: 4px; }
.top-links a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.top-links a:hover { color: var(--text); }
.user { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.guild { font-size: 12px; padding: 6px 8px; max-width: 200px; }

/* ---------- кнопки ---------- */
button, .btn {
  font: inherit; color: var(--text); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover, .btn:hover { border-color: #3a3a55; }
button:active, .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-text); }
.btn.big { padding: 13px 18px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.small { padding: 5px 10px; font-size: 12px; }
.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- вход ---------- */
.login { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  max-width: 420px; width: 100%; text-align: center; padding: 36px 28px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.login-title { font: 700 28px/1.2 Inter, sans-serif; letter-spacing: -0.02em; }
.login-title span { color: var(--accent-text); }
.login-card p { color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- раскладка ---------- */
.app {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 240px 1fr 300px; gap: 14px; padding: 14px;
}
.panel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head h2::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- карты ---------- */
.map-list { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; }
.map-item {
  position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  cursor: pointer; background: var(--bg-3); text-align: left; padding: 0; display: block; width: 100%;
  flex: none; /* иначе при многих картах превью сжимаются в полоски */
}
.map-item img { width: 100%; height: 140px; object-fit: cover; display: block; opacity: .85; }
.map-item .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 14px; font-weight: 700;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.map-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.map-item.active img { opacity: 1; }
.map-item .del {
  position: absolute; top: 6px; right: 6px; padding: 2px 7px; font-size: 12px;
  background: rgba(0,0,0,.7); border-color: transparent; opacity: 0;
}
.map-item:hover .del { opacity: 1; }
.map-item .del:hover { background: var(--danger); }
.map-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* ---------- холст ---------- */
.board { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px;
}
.tools { display: flex; gap: 4px; flex-wrap: wrap; }
.tools button { padding: 6px 10px; font-size: 15px; background: transparent; border-color: transparent; }
.tools button span { font-size: 12px; color: var(--muted); }
.tools button.active { background: var(--accent-soft); border-color: var(--accent); }
.tools button.active span { color: var(--accent-text); }
.colors { display: flex; gap: 6px; }
.colors button { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.colors button.active { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px var(--accent); }
.size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.size input { accent-color: var(--accent); width: 90px; }
.actions { display: flex; gap: 6px; margin-left: auto; }

.stage {
  position: relative; flex: 1; min-height: 360px;
  background:
    linear-gradient(45deg, #0d0d15 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, #0d0d15 25%, transparent 25%) 0 0 / 24px 24px,
    var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden;
}
.stage.drop { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
/* Холст в натуральном размере карты; масштаб и сдвиг — через transform (зум к курсору, панорама). */
#canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: block; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.stage { touch-action: none; }
.zoom {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; display: flex; gap: 2px; padding: 3px;
  background: rgba(7, 7, 11, .85); border: 1px solid var(--line); border-radius: 8px;
}
.zoom button { min-width: 34px; font-variant-numeric: tabular-nums; }
.iconbar { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.iconbar button { flex-direction: column; gap: 4px; padding: 6px 10px; background: transparent; font-size: 11px; color: var(--muted); }
.iconbar button canvas { width: 28px; height: 28px; }
.iconbar button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.layers { position: relative; }
.layers summary { list-style: none; }
.layers summary::-webkit-details-marker { display: none; }
.layers-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: grid; gap: 8px; padding: 12px; min-width: 200px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.tactics-head { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.tactic-save { display: flex; gap: 6px; }
.tactic-save input { flex: 1; min-width: 0; }
.tactic-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; max-height: 260px; }
.tactic { display: flex; gap: 4px; align-items: stretch; }
.tactic-open { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.tactic-open b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tactic-open span { font-size: 11px; color: var(--muted); }
.tactic.active .tactic-open { border-color: var(--accent); }
.empty { position: absolute; text-align: center; color: var(--muted); pointer-events: none; }
.empty-title { font: 600 20px/1.3 Inter, sans-serif; color: var(--text); }
.text-input {
  position: absolute; z-index: 3; background: rgba(0,0,0,.85); color: #fff;
  border: 1px solid var(--accent); border-radius: 6px; padding: 4px 8px; font: 600 15px Inter, sans-serif; min-width: 160px;
}
.tempbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px;
  background: var(--accent-soft); border: 1px solid rgba(109, 74, 255, .4); border-radius: var(--radius); padding: 8px 10px;
}

/* ---------- колл ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
select, input[type=number], .tempbar input {
  font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; text-transform: none; letter-spacing: 0; outline: none;
}
select:focus, input:focus { border-color: var(--accent); }
.slots-row { display: flex; gap: 10px; align-items: center; }
.slots-row input[type=number] { width: 80px; }
.check { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 13px; }
.check input { accent-color: var(--accent); }
.positions { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.positions-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; }
.positions-head span { color: var(--accent-text); font-weight: 700; }
.positions-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; overflow: auto; align-content: start; }
.positions-grid div {
  aspect-ratio: 1.6; display: grid; place-items: center; border-radius: 6px; font-weight: 700;
  background: var(--blue); color: #fff; font-size: 13px;
}
.positions-grid div.mod { background: #da373c; }
.positions-grid div.extra { background: var(--bg-3); color: var(--muted); }
.send { width: 100%; }
.status { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.status a { color: var(--accent-text); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--accent); padding: 10px 16px; border-radius: 8px; z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.top .top-links { margin-left: auto; }
.tabs:not([hidden]) + .top-links { margin-left: 0; }
.tabs button { background: transparent; border-color: transparent; color: var(--muted); font-weight: 600; }
.tabs button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- статистика ---------- */
.stats { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 14px; max-width: 1400px; width: 100%; margin: 0 auto; }
.stats-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.stats-bar .btn.primary { margin-left: auto; }
.small-text { font-size: 12px; }
.chips { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.chips button { padding: 6px 12px; font-size: 13px; background: transparent; border-color: transparent; }
.chips button.active { background: var(--accent); color: #fff; font-weight: 700; }

.attack-form { border-color: rgba(109, 74, 255, .4); }
.range { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.range input { font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color-scheme: dark; }

/* ---------- график ---------- */
.chart { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font: 10px var(--mono); }
.chart-svg .bar { transition: opacity .15s var(--ease); }
.chart-svg g:hover .bar { opacity: .8; }
.bar.win, .lg.win { fill: var(--ok); background: var(--ok); }
.bar.loss, .lg.loss { fill: var(--danger); background: var(--danger); }
.bar.none, .lg.none { fill: #34344a; background: #34344a; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }

/* ---------- активные сборы ---------- */
.active-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.vzp-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.vzp-card-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.small-link { margin-left: auto; color: var(--accent-text); font-size: 12px; text-decoration: none; }
.roster-label { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.roster-row { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 13px; padding: 2px 0; }
.roster-n { font: 11px var(--mono); color: var(--muted); }
.roster-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier { font: 600 10px/1 var(--mono); text-align: center; padding: 3px 0; border-radius: 3px; background: var(--bg-2); color: var(--muted); }
.tier.t1 { color: #c9bdff; background: rgba(109, 74, 255, .26); }
.tier.t2 { color: #a9c6ff; background: rgba(61, 123, 255, .24); }
.tier.t3 { color: #9fdcef; background: rgba(56, 189, 248, .16); }
.attack-grid { display: grid; grid-template-columns: 2fr 1fr 2fr 2fr; gap: 10px; }
input[type=text] {
  font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; text-transform: none; letter-spacing: 0; outline: none;
}

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi.win .kpi-v { color: var(--ok); }
.kpi.loss .kpi-v { color: var(--danger); }
.kpi-v { font: 700 26px/1.2 Inter, sans-serif; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.stats-grid > * { min-width: 0; }
.stats-grid .side { display: flex; flex-direction: column; gap: 14px; }
.stats-grid .wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap tbody tr:hover td { background: var(--bg-3); }
.table-wrap .empty-row { color: var(--muted); text-align: center; padding: 18px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--bg-3); color: var(--muted); }
.tag.win { background: rgba(47, 211, 107, .15); color: #2fd36b; }
.tag.loss { background: rgba(255, 59, 59, .15); color: #ff6b6b; }

/* ---------- живая лента ---------- */
.live { }
.live .panel-head { flex-wrap: wrap; }
.live-filters { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-right: 8px; animation: pulse 1.4s infinite; vertical-align: 1px; }
.live .panel-head h2::before { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.tag.live-tag { background: var(--accent-soft); color: var(--accent-text); }
.table-wrap tr.our-row td { background: rgba(109, 74, 255, .08); }
.ours { color: var(--accent-text); }

/* ---------- списки: ВЗП, ВЗХ, мероприятия ---------- */
.lists {
  flex: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 14px; padding: 14px;
  max-width: 1500px; width: 100%; margin: 0 auto; align-items: start;
}
.lists:not([hidden]) { animation: panel-in .35s var(--ease); }
.list-index, .list-search { position: sticky; top: 70px; max-height: calc(100vh - 84px); overflow: auto; }
.list-index-items { display: flex; flex-direction: column; gap: 6px; }
.li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; text-align: left; padding: 9px 10px; background: transparent; border-color: var(--line);
}
.li.active { border-color: var(--accent); background: var(--accent-soft); }
.li-main { display: flex; flex-direction: column; min-width: 0; }
.li-main small, .li-count small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-count { display: flex; flex-direction: column; align-items: flex-end; font: 600 12px/1.3 var(--mono); }
.li-count small.ok { color: var(--ok); }
.kind {
  font: 700 10px/1 var(--mono); letter-spacing: .04em; padding: 4px 6px; border-radius: 4px;
  color: var(--accent-text); background: var(--accent-soft); border: 1px solid rgba(109, 74, 255, .35);
}
.kind.k-vzh { color: var(--blue-text); background: rgba(61, 123, 255, .14); border-color: rgba(61, 123, 255, .35); }
.kind.k-event { color: var(--muted); background: var(--bg-3); border-color: var(--line); }
.live-state { display: flex; align-items: center; margin-top: auto; }
.live-state .dot { background: var(--muted); animation: none; }
.live-state.on .dot { background: var(--ok); animation: pulse 1.8s infinite; }

.list-new { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid rgba(109, 74, 255, .4); border-radius: 10px; }
.list-new-row { display: flex; gap: 8px; align-items: flex-end; }
.list-new-row .field { width: 80px; }
.list-new-row .field.grow { flex: 1; width: auto; }
.list-new input { min-width: 0; width: 100%; }

.list-board { min-width: 0; }
.list-empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.list-view { display: flex; flex-direction: column; gap: 12px; }
.list-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.list-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.list-title h1 { margin: 0; font: 700 22px/1.2 Inter, sans-serif; letter-spacing: -0.02em; }
.list-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.list-actions .on-win { border-color: var(--ok); color: var(--ok); }
.list-actions .on-loss { border-color: var(--danger); color: var(--danger); }

.voice-meter {
  display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
.voice-meter b { color: var(--blue-text); font-weight: 600; }
.vm-bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.vm-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); transition: width .4s var(--ease); }
.vm-miss { color: #ffb648; font: 600 12px var(--mono); }
.vm-ok { color: var(--ok); font: 600 12px var(--mono); }

.list-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.list-filter input[type=search], .list-search input[type=search] {
  font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0;
}
.list-filter input[type=search] { width: 220px; }
.list-search input[type=search] { width: 100%; }
input[type=search]:focus { border-color: var(--accent); }

.list-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.zone { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; transition: border-color .15s, box-shadow .15s; }
.zone-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.zone-head b { font-size: 13px; }
.zone-head span { font: 600 12px var(--mono); color: var(--muted); }
.zone-rows { display: flex; flex-direction: column; gap: 4px; }
.zone.drop-ok { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.lrow {
  display: grid; grid-template-columns: 12px 30px 26px minmax(0, 1fr) 30px auto auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 8px; background: var(--bg-3); border: 1px solid transparent; font-size: 13px;
  transition: border-color .15s, background .15s, opacity .15s;
}
.lrow[data-drag] { cursor: grab; }
.lrow .n { font: 11px var(--mono); color: var(--muted); }
.lrow .who { display: flex; flex-direction: column; min-width: 0; }
.lrow .who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .who small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); font: 700 11px var(--mono); }
.grip { width: 12px; height: 18px; opacity: .45; touch-action: none; cursor: grab;
  background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.5px) 0 0 / 6px 6px; }
.lrow:hover .grip { opacity: .9; }
.vs { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.vs i { width: 8px; height: 8px; border-radius: 50%; background: #4a4a60; flex: none; }
.vs-in .vs i { background: var(--ok); box-shadow: 0 0 0 3px rgba(60, 207, 122, .15); }
.vs-in .vs { color: #7fe0a6; }
.vs-other .vs i { background: #ffb648; }
.vs-other .vs { color: #ffcf8a; }
.vs-off .vs i { background: var(--danger); opacity: .8; }
.row-act { display: flex; gap: 2px; opacity: .35; transition: opacity .15s; }
.lrow:hover .row-act, .row-act:focus-within { opacity: 1; }
.row-act button { padding: 3px 7px; font-size: 12px; border-color: transparent; }
.row-act button:hover { border-color: var(--line); }
.row-act button.armed { color: var(--danger); border-color: var(--danger); opacity: 1; }
.lrow.drop-ok { border-color: var(--accent); background: var(--accent-soft); }
.lrow.dragging { opacity: .35; }
.lrow.flash { animation: row-flash 1.2s var(--ease); }
.lrow.enter { animation: panel-rise .35s var(--ease); }
.lslot {
  display: grid; grid-template-columns: 12px 30px 1fr; gap: 8px; align-items: center; padding: 8px;
  border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px;
}
.lslot > span:first-child { grid-column: 2; }
.lslot.drop-ok { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.lslot .n { font: 11px var(--mono); }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }

.ghost-row {
  position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55); border-color: var(--accent); background: var(--bg-3);
  grid-template-columns: 12px 30px 26px minmax(0, 1fr) 30px auto; opacity: .96;
}
.ghost-row .row-act, .ghost-row .cand-act { display: none; }
.ghost-hint {
  position: absolute; left: 8px; top: calc(100% + 6px); white-space: nowrap; font: 600 11px var(--mono);
  color: #fff; background: var(--accent); padding: 4px 8px; border-radius: 6px;
}
.ghost-row.no-drop .ghost-hint { background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }

.ls-results { display: flex; flex-direction: column; gap: 4px; }
.lrow.cand { grid-template-columns: 12px 26px minmax(0, 1fr) 30px; row-gap: 6px; }
.cand-act { grid-column: 2 / -1; display: flex; gap: 6px; }
.cand-act button { padding: 4px 8px; font-size: 11px; }
.ls-help { border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; color: var(--muted); }
.ls-help p { margin: 0 0 6px; }
.ls-help b { color: var(--text); }

@keyframes row-flash { 0% { background: rgba(61, 123, 255, .3); } 100% { background: var(--bg-3); } }

@media (max-width: 1200px) {
  .lists { grid-template-columns: 220px minmax(0, 1fr); }
  .list-search { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 860px) {
  .lists { grid-template-columns: minmax(0, 1fr); padding: 10px 16px; }
  .list-index { position: static; max-height: none; }
  .list-index-items { flex-direction: row; overflow-x: auto; }
  .li { flex: 0 0 210px; }
  .list-cols { grid-template-columns: minmax(0, 1fr); }
  .list-filter input[type=search] { width: 100%; }
  .voice-meter { grid-template-columns: 1fr auto; }
  .voice-meter > span:first-child { grid-column: 1 / -1; }
  .lrow { grid-template-columns: 14px 26px minmax(0, 1fr) 26px 10px auto; gap: 6px; }
  .lrow .n { display: none; }
  .lrow .vs em { display: none; }
  .lrow .row-act { opacity: 1; }
  .grip { width: 14px; height: 22px; }
}

/* ---------- движение ---------- */
@view-transition { navigation: auto; }
/* Разделы панели и карточки плавно проявляются при показе (display: none → видимый перезапускает анимацию). */
.app:not([hidden]), .stats:not([hidden]), .login:not([hidden]) { animation: panel-in .35s var(--ease); }
.stats > .panel, .kpis.play > .kpi { animation: panel-rise .45s var(--ease) both; }
.stats > :nth-child(2) { animation-delay: .03s; } .stats > :nth-child(3) { animation-delay: .06s; }
.stats > :nth-child(4) { animation-delay: .09s; } .stats > :nth-child(5) { animation-delay: .12s; }
.kpis > .kpi:nth-child(2) { animation-delay: .04s; } .kpis > .kpi:nth-child(3) { animation-delay: .08s; }
.kpis > .kpi:nth-child(4) { animation-delay: .12s; } .kpis > .kpi:nth-child(5) { animation-delay: .16s; }
.kpis > .kpi:nth-child(6) { animation-delay: .2s; }
.chart.play .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow .6s var(--ease) both; }
.btn.primary { transition: background .15s, box-shadow .2s, transform .05s; }
.btn.primary:hover { box-shadow: 0 6px 20px rgba(109, 74, 255, .28); }
.map-item { transition: border-color .2s var(--ease), transform .2s var(--ease); }
.map-item:hover { transform: translateY(-1px); }
.toast:not([hidden]) { animation: toast-in .3s var(--ease); }
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  .stats > .panel, .kpis.play > .kpi { animation-name: panel-in; }
  .map-item:hover { transform: none; }
}

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr 280px; }
  .maps { grid-column: 1 / -1; }
  .map-list { flex-direction: row; overflow-x: auto; }
  .map-item { flex: 0 0 200px; }
  .map-item img { height: 110px; }
}
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .top { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .tabs { order: 3; margin: 0; width: 100%; }
  .stats { padding: 10px 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attack-grid select, .attack-grid input { min-width: 0; width: 100%; }
  .top-links { display: none; }
  .range { width: 100%; }
  .app { grid-template-columns: 1fr; padding: 10px 16px; }
  .tools button span { display: none; }
  .actions { margin-left: 0; }
  .stage { min-height: 300px; }
  .app, .panel, .board { min-height: auto; }
  .positions { flex: none; }
}

/* ---------- итог списка: зелёный — победа, красный — поражение ---------- */
.li.res-win { border-color: rgba(60, 207, 122, .65); background: rgba(60, 207, 122, .1); box-shadow: 0 0 0 1px rgba(60, 207, 122, .25), 0 0 18px rgba(60, 207, 122, .22); }
.li.res-loss { border-color: rgba(242, 85, 90, .65); background: rgba(242, 85, 90, .1); box-shadow: 0 0 0 1px rgba(242, 85, 90, .25), 0 0 18px rgba(242, 85, 90, .22); }
.li.res-win.active { background: rgba(60, 207, 122, .18); border-color: var(--ok); }
.li.res-loss.active { background: rgba(242, 85, 90, .18); border-color: var(--danger); }
.li.closed:not(.res-win):not(.res-loss) { opacity: .75; }
.li-res { margin-left: 6px; font: 700 10px/1 var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .04em; padding: 2px 5px; border-radius: 4px; vertical-align: 1px; }
.res-win .li-res { color: var(--ok); background: rgba(60, 207, 122, .15); }
.res-loss .li-res { color: var(--danger); background: rgba(242, 85, 90, .15); }
.list-view.res-win .list-title h1 { color: var(--ok); }
.list-view.res-loss .list-title h1 { color: var(--danger); }

/* ---------- колл по списку ---------- */
.call-link { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid rgba(109, 74, 255, .45); border-radius: 10px; background: var(--accent-soft); }
.call-link-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.call-link-head span { flex: 1; min-width: 0; }
.call-link-head b { color: var(--accent-text); }
.call-link .hint { margin: 0; }
.call-pick { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.call-pick-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pick-person { display: flex; justify-content: space-between; gap: 8px; text-align: left; }
.pick-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-person small { color: var(--muted); white-space: nowrap; }
.pick-person.res span { color: var(--muted); }
.pick-person.on { border-color: var(--ok); color: var(--ok); }
.pick-free { color: var(--danger); }
.positions-grid.linked { grid-template-columns: repeat(3, 1fr); }
.positions-grid button.pos {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; min-width: 0;
  border-radius: 6px; background: var(--blue); border-color: transparent; color: #fff; font-size: 13px;
}
.positions-grid button.pos small { font-size: 10px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.positions-grid button.pos.taken { background: #248046; }
.positions-grid button.pos.sel { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.map-item .tag-builtin { position: absolute; top: 6px; right: 6px; padding: 3px 5px; border-radius: 4px; background: rgba(0,0,0,.7); font: 600 9px/1 var(--mono); color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; }
