/* Общие токены и компоненты для сайта и админки */
@import url('/vendor/tektur/index.css');
@import url('/vendor/golos/index.css');

:root {
  /* Сланцевый «планшетный» фон вместо чёрного */
  --bg: #1d252b;
  --bg-sunk: #172026;
  --panel: #252f36;
  --panel-hi: #2d3841;
  --line: #36434d;
  --line-soft: #2c373f;
  --text: #e3e8eb;
  --muted: #93a0a9;
  --faint: #66737d;

  /* Цвет = информация: тип гранаты и сторона */
  --smoke: #c7d1d9;
  --molotov: #f0782e;
  --flash: #f1de5b;
  --he: #e4544c;
  --t: #e0a33a;
  --ct: #6d94d8;
  --both: #b3bcc3;

  --ok: #6cc08b;
  --danger: #e4544c;
  --focus: #8fb2ee;

  --font-display: 'Tektur Variable', 'Golos Text Variable', system-ui, sans-serif;
  --font-body: 'Golos Text Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 3px;
  --r-md: 6px;
  --gutter: 24px;
  --maxw: 1360px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

p { margin: 0 0 0.9em; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- иконки типов ---------- */
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.ico-smoke { color: var(--smoke); }
.ico-molotov { color: var(--molotov); }
.ico-flash { color: var(--flash); }
.ico-he { color: var(--he); }

/* ---------- сторона ---------- */
.side {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 20px; padding: 0 6px;
  border-radius: var(--r-sm);
  font: 600 12px/1 var(--font-display);
  color: #1b1f22;
}
.side-t { background: var(--t); }
.side-ct { background: var(--ct); }
.side-both { background: var(--both); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font: 500 14px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-hi); border-color: #46545f; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--text); color: #1b2227; border-color: var(--text); font-weight: 600; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-danger { color: #ff8b84; border-color: #5a3434; background: transparent; }
.btn-danger:hover { background: #3a2526; border-color: #7a4040; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn kbd {
  font: 500 11px/1 var(--font-body); color: var(--faint);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px;
}

/* ---------- сегменты (фильтры) ---------- */
.seg {
  display: inline-flex; flex-wrap: wrap;
  background: var(--bg-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 3px; gap: 2px;
}
.seg button, .seg a {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border: 0; border-radius: 4px;
  background: transparent; color: var(--muted);
  font: 500 14px/1 var(--font-body);
  text-decoration: none; cursor: pointer;
}
.seg button:hover, .seg a:hover { color: var(--text); }
.seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--panel-hi); color: var(--text); }
.seg .count { font: 500 12px/1 var(--font-display); color: var(--faint); }
.seg [aria-pressed="true"] .count { color: var(--muted); }

/* ---------- радар ---------- */
/* Рамка с угловыми засечками — главный визуальный элемент */
.radar {
  position: relative;
  background-color: var(--bg-sunk);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  user-select: none;
  -webkit-user-select: none;
}
.radar-img { width: 100%; height: auto; pointer-events: none; }
.radar-empty {
  aspect-ratio: 1;
  display: grid; place-items: center; text-align: center;
  color: var(--faint); padding: 24px; font-size: 14px;
}
.radar-lines, .radar-pins, .radar-ticks { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar-lines { pointer-events: none; overflow: visible; }
.radar-empty ~ .radar-pins { pointer-events: none; }
.radar-empty a { color: var(--muted); }
.radar-ticks { inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); pointer-events: none; overflow: visible; }
.radar-ticks path { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.radar-line { stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; fill: none; opacity: 0.85; }
.radar-line.is-t { stroke: var(--t); }
.radar-line.is-ct { stroke: var(--ct); }
.radar-line.is-both { stroke: var(--both); }
.radar-line.is-hot { stroke-dasharray: none; stroke-width: 3; opacity: 1; }

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none; cursor: pointer;
}
.pin-land {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(23, 32, 38, 0.82);
  box-shadow: 0 0 0 2px var(--pin-color, var(--smoke)), 0 2px 6px rgba(0,0,0,0.5);
  color: var(--pin-color, var(--smoke));
  transition: transform 120ms ease;
}
.pin-land .ico { width: 16px; height: 16px; }
.pin-land:hover { transform: translate(-50%, -50%) scale(1.12); }
.pin-land.is-active { box-shadow: 0 0 0 3px var(--pin-color), 0 0 0 7px rgba(255,255,255,0.12), 0 2px 8px rgba(0,0,0,0.6); }
.pin-land.is-dim { opacity: 0.35; }
.pin-count {
  position: absolute; top: -7px; right: -9px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--text); color: #1b2227;
  font: 600 11px/17px var(--font-display); text-align: center;
}
.pin-throw {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pin-color, var(--t));
  box-shadow: 0 0 0 2px var(--bg-sunk), 0 1px 4px rgba(0,0,0,0.6);
}
.pin-throw.is-hot { width: 18px; height: 18px; }
.pin-ghost {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); opacity: 0.45; pointer-events: none;
}
.pin-smoke { --pin-color: var(--smoke); }
.pin-molotov { --pin-color: var(--molotov); }
.pin-flash { --pin-color: var(--flash); }
.pin-he { --pin-color: var(--he); }
.pin-t { --pin-color: var(--t); }
.pin-ct { --pin-color: var(--ct); }
.pin-both { --pin-color: var(--both); }

/* ---------- формы ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field small { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font: 400 15px/1.3 var(--font-body);
}
textarea.input { height: auto; min-height: 110px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.input:focus { outline: none; border-color: var(--focus); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--text); }

/* ---------- прочее ---------- */
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast {
  background: var(--text); color: #1b2227;
  padding: 10px 16px; border-radius: var(--r-md);
  font-weight: 500; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  animation: toast-in 160ms ease-out;
}
.toast.is-error { background: #ffb3ae; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

dialog.lightbox {
  padding: 0; border: 0; background: transparent; max-width: min(1400px, 96vw);
}
dialog.lightbox::backdrop { background: rgba(10, 14, 17, 0.88); }
dialog.lightbox img { max-height: 90vh; width: auto; margin: 0 auto; border-radius: var(--r-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
}
