@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/vendor/fonts/inter-latin-wght-normal.260c81a4759b.woff2") format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/vendor/fonts/inter-cyrillic-wght-normal.de93fdc85e3d.woff2") format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: dark;

  --bg:            #0d0f12;
  --surface:       #141820;
  --surface-2:     #1a2030;
  --surface-hover: #1f2538;
  --line:          #252d40;
  --line-subtle:   rgba(255, 255, 255, 0.06);
  --text:          #e8ecf4;
  --muted:         #7a8499;

  --accent:        #f4a522;
  --accent-muted:  rgba(244, 165, 34, 0.15);
  --accent-glow:   rgba(244, 165, 34, 0.25);

  --blue:          #4aaef5;
  --blue-muted:    rgba(74, 174, 245, 0.12);
  --blue-glow:     rgba(74, 174, 245, 0.25);

  --green:         #3fb950;
  --red:           #e84040;

  --radius:        10px;
  --radius-sm:     6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 'Inter', system-ui, -apple-system, sans-serif;
}

.wrap {
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

h1 { font-size: 1.75rem; margin: 1.5rem 0 .75rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.1rem;  margin: 2rem 0 .6rem;    font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: .95rem;  margin: 0 0 .3rem;        font-weight: 600; }

.muted { color: var(--muted); }
.error { color: var(--red); }

/* ── Шапка ── */
.top {
  border-bottom: 1px solid var(--line-subtle);
  background: var(--bg);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3rem;
}
.top form { margin: 0; }
.brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}
.who { margin-left: auto; color: var(--muted); font-size: .9rem; }
.quiet { color: var(--muted); font-size: .9rem; }
.linkish {
  background: none; border: none; padding: 0;
  font: inherit; font-size: .9rem;
  color: var(--muted); text-decoration: underline; cursor: pointer;
}
.linkish:hover { color: var(--text); }

/* ── Фильтры ── */
.filters {
  display: grid;
  gap: .4rem;
  margin: 0 0 1.5rem;
  padding: .9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
}
.facet { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; align-items: baseline; }
.facet-title { color: var(--muted); font-size: .85rem; }
.facet ul { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.facet a {
  display: inline-block;
  padding: .12rem .5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.facet a:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); border-color: rgba(255,255,255,0.14); }
.facet a.on {
  background: var(--accent-muted);
  border-color: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(244, 165, 34, 0.15);
}
.facet a.on .count { color: rgba(244, 165, 34, 0.6); }
.count { color: var(--muted); }
.reset { font-size: .85rem; justify-self: start; color: var(--muted); }

@media (max-width: 40rem) {
  .facet { grid-template-columns: 1fr; gap: .2rem; }
}

/* ── Список тактик ── */
.found { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }

.tactics { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tactic-row {
  padding: .75rem .9rem;
  border: 1px solid var(--line-subtle);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.tactic-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  /* border-color не меняем: шорткат перебил бы цвет левой полоски T/CT */
}
.tactic-row.side-t  { border-left-color: var(--accent); }
.tactic-row.side-ct { border-left-color: var(--blue); }

.tactic-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.tactic-link { font-size: 1.05rem; font-weight: 600; text-decoration: none; color: var(--text); }
.tactic-link:hover { color: var(--accent); }
.tactic-summary { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }

/* ── Теги ── */
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0 0; }
.tag {
  font-size: .78rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid transparent;
}
.tag.map  { color: var(--text); font-weight: 600; background: rgba(255,255,255,0.08); }
.tag.side-t  { background: var(--accent-muted); color: var(--accent); border-color: var(--accent-glow); font-weight: 600; }
.tag.side-ct { background: var(--blue-muted);   color: var(--blue);   border-color: var(--blue-glow);   font-weight: 600; }

/* Типы раскидок */
.tag.kind-smoke   { background: rgba(154,161,173,0.15); color: #9aa1ad; }
.tag.kind-flash   { background: rgba(232,212,79,0.15);  color: #e8d44f; border-color: rgba(232,212,79,0.25); }
.tag.kind-molotov { background: rgba(217,99,59,0.15);   color: #d9633b; }
.tag.kind-he      { background: rgba(63,185,80,0.15);   color: var(--green); }

.badge {
  font-size: .75rem;
  padding: .08rem .45rem;
  border-radius: 999px;
  background: rgba(217,99,59,0.15);
  color: #d9633b;
  border: 1px solid rgba(217,99,59,0.25);
  white-space: nowrap;
}

.more {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: .9rem;
}
.more:hover { text-decoration: underline; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
}
.empty-title { font-weight: 600; margin-top: 0; }

/* ── Анимации ── */

/* Появление строки тактики */
@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tactic-row { animation: row-in 180ms ease both; }

/* Skeleton-лоадер */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton {
  height: 4rem;
  margin-bottom: .6rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200%;
  animation: shimmer 1.4s ease infinite;
}

/* Micro-interaction: фазовая кнопка при клике */
#scene-phase-buttons button:active { transform: scale(0.95); }

/* View Transitions (Chrome/Edge 111+; в остальных — мгновенный переход) */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
::view-transition-new(root) { animation: fade-in 120ms ease; }
::view-transition-old(root) { animation: fade-in 120ms ease reverse; }

/* ── Страница тактики ── */
.crumbs { margin: 1rem 0 0; font-size: .9rem; }
.warn-block {
  margin: 0 0 1rem;
  padding: .6rem .8rem;
  background: rgba(217,99,59,0.12);
  color: #e8a07a;
  border: 1px solid rgba(217,99,59,0.3);
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.summary { margin: 1rem 0; }

.needs { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.needs li {
  padding: .2rem .55rem;
  background: var(--surface);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  font-size: .88rem;
}

/* ── Шаги ── */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; counter-reset: step; }
.steps > li {
  position: relative;
  padding: .8rem 1rem .8rem 2.6rem;
  border: 1px solid var(--line-subtle);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  counter-increment: step;
  transition: background 200ms ease, border-left-color 200ms ease;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: .75rem;
  top: .85rem;
  width: 1.4rem; height: 1.4rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(244, 165, 34, 0.15);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(244, 165, 34, 0.25);
  font-size: .8rem; font-weight: 700;
}
.steps > li.step-active {
  background: rgba(244, 165, 34, 0.07);
  border-left-color: var(--accent);
}
.step-time {
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  padding: .05rem .4rem;
  border-radius: 4px;
}

/* ── Схема ── */
.scene { margin-top: 1.5rem; }
.scene-viewer {
  width: 100%;
  max-width: 34rem;
  aspect-ratio: 1 / 1;
  background: #0c0e12;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
}
.scene-canvas { width: 100%; height: 100%; }
.scene-legend {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin: .5rem 0 0;
  font-size: .8rem; color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: .3rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.dot.side-t  { background: #d9a441; }
.dot.side-ct { background: #5b8def; }
.dot.nade { border: 1px dashed #12141a; }
.dot.nade.smoke   { background: #9aa1ad; }
.dot.nade.flash   { background: #e8d44f; }
.dot.nade.molotov { background: #d9633b; }

/* ── Таймлайн ── */
#scene-timeline { margin-top: .75rem; }
#scene-phase-buttons { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }

#scene-phase-buttons button {
  font: inherit; font-size: .82rem;
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}
#scene-phase-buttons button:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
#scene-phase-buttons button.active {
  border-color: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(244,165,34,0.2);
}

.scene-slider-row { display: flex; align-items: center; gap: .6rem; }
#scene-slider { flex: 1; accent-color: var(--accent); }
#scene-time-label {
  font-size: .8rem; color: var(--muted);
  font-variant-numeric: tabular-nums; min-width: 3rem;
}
#scene-show-all {
  font: inherit; font-size: .8rem;
  padding: .2rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 120ms ease;
}
#scene-show-all:hover { border-color: var(--accent-glow); }

/* ── Редактор схемы ── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.25rem; align-items: start; }
@media (max-width: 52rem) { .editor { grid-template-columns: 1fr; } }

.toolbar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.toolbar button,
.editor-actions button,
.panel-delete,
.position-item {
  font: inherit; font-size: .85rem;
  padding: .3rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}
.toolbar button:hover, .editor-actions button:hover, .position-item:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.14);
}
.toolbar button.on {
  background: var(--accent-muted);
  border-color: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
.editor-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

.editor-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.editor-hints { font-size: .85rem; margin-top: .5rem; color: var(--muted); }

.scene-status { font-size: .82rem; color: var(--muted); }
.scene-status.ok  { color: var(--green); }
.scene-status.bad { color: var(--red); }

.panel {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  padding: .8rem;
  background: var(--surface-2);
}
.panel-title { margin: 0 0 .6rem; font-weight: 700; font-size: .95rem; }
.panel-hint { font-size: .8rem; color: var(--muted); margin: .5rem 0; }
.panel-field { display: grid; gap: .2rem; margin-bottom: .5rem; font-size: .8rem; color: var(--muted); }
.panel-field input, .panel-field select {
  font: inherit; font-size: .88rem;
  padding: .25rem .4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
.panel-delete { width: 100%; margin-top: .5rem; color: var(--red); }

/* ── Калибровка позиций ── */
.calibrate-map {
  position: relative; display: block; max-width: 34rem;
  cursor: crosshair;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.calibrate-map img { display: block; width: 100%; height: auto; }
.calibrate-dots { position: absolute; inset: 0; pointer-events: none; }
.calibrate-dot {
  position: absolute; width: 10px; height: 10px;
  margin: -5px 0 0 -5px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 0 2px rgba(0,0,0,.55);
}
.calibrate-dot.on { background: #f87171; }
.calibrate-dot i {
  position: absolute; left: 12px; top: -4px;
  font-style: normal; font-size: .7rem; white-space: nowrap;
  color: #fff; text-shadow: 0 0 3px #000;
}

.position-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 32rem; overflow: auto; }
.position-item { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: .5rem; }
.position-item.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.position-mark { font-size: .72rem; color: var(--muted); }
.position-item.uncalibrated .position-mark { color: var(--red); }

/* ── Раскидки и роли ── */
.roles { border-collapse: collapse; margin: .6rem 0 0; width: 100%; }
.roles caption { text-align: left; font-size: .82rem; color: var(--muted); padding-bottom: .2rem; }
.roles th, .roles td { text-align: left; vertical-align: top; padding: .2rem .7rem .2rem 0; font-weight: 400; font-size: .9rem; }
.roles th { white-space: nowrap; color: var(--muted); width: 1%; }

.lineups { margin-top: .7rem; font-size: .9rem; }
.lineups ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .4rem; }
.lineups li { padding: .4rem .6rem; background: var(--bg); border: 1px solid var(--line-subtle); border-radius: 4px; }
.lineup-name { font-weight: 600; }

figure { margin: .7rem 0 0; }
figure img {
  max-width: 100%; height: auto;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
figcaption { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

/* ── Вход ── */
.login { display: grid; gap: .7rem; max-width: 18rem; margin-top: 1rem; }
.login label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
.login input {
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.login button {
  padding: .45rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #000;
  font: inherit; font-weight: 700;
  cursor: pointer;
}
