:root {
  --line-color: #444;
  --tick-color: #999;
  --red: #e74c3c;
  --blue: #3498db;
  --chat: #f1c40f;
  --clip: #FF6FFF;
  --afk: #000;
  --round: #9b59b6;
  --anchor: #2ecc71;
}

body {
  font-family: system-ui, sans-serif;
  background: #1e1e1e;
  color: #eee;
  padding: 0 20px 40px;
  margin: 0;
}

/* ---------- шапка сайта ---------- */
.site-header {
  margin: 0 0 24px;
  padding: 0;
}

.header-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0 0 4px;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.logo-gibus {
  display: block;
  height: 56px;
  width: auto;
  user-select: none;
  pointer-events: none;
  position: relative;
  top: 10px;
  margin: 0;
}

.site-logo {
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', system-ui, sans-serif;
  font-size: 56px;
  line-height: 1;
  margin: 0;
  letter-spacing: .04em;
  color: #cf6a32;
  text-transform: uppercase;
  user-select: none;
  text-shadow:
    1px 1px 0 #a65223,
    2px 2px 0 #95491f,
    3px 3px 0 #84401b,
    4px 4px 0 #733717,
    5px 5px 0 #622e13,
    6px 6px 0 #51250f,
    7px 7px 0 #401c0b,
    8px 8px 12px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(207, 106, 50, 0.45);
}

/* горизонтальное меню */
.site-nav {
  display: flex;
  gap: 28px;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2a;
  font-size: 15px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-block;
  color: #ccc;
  text-decoration: none;
  padding: 8px 4px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.nav-link:hover { color: #eee; }
.nav-link.active {
  color: #2ecc71;
  border-bottom-color: #2ecc71;
}

/* стрелка у пункта с подменю */
.has-dropdown > .nav-link::after {
  content: '▾';
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: #888;
  transition: transform .15s, color .15s;
  vertical-align: middle;
}
.has-dropdown:hover > .nav-link::after,
.has-dropdown:focus-within > .nav-link::after {
  transform: rotate(180deg);
  color: #2ecc71;
}

/* невидимый «мост» между кнопкой и подменю */
.has-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
  background: transparent;
  display: none;
}
.has-dropdown:hover::before,
.has-dropdown:focus-within::before {
  display: block;
}

/* выпадающее подменю */
.has-dropdown .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  padding: 6px 0;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  min-width: 160px;
  display: none;
  z-index: 100;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: block;
}

.has-dropdown .dropdown a {
  display: block;
  padding: 8px 14px;
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.has-dropdown .dropdown a:hover {
  background: #2a2a2a;
  color: #2ecc71;
}
.has-dropdown .dropdown a.active {
  color: #2ecc71;
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-logo { font-size: 36px; }
  .site-nav  { gap: 16px; font-size: 14px; }
  .logo-gibus { height: 36px; top: 6px; }
}

/* ---------- общий контейнер для фильтров + таблицы ---------- */
.page-card {
  margin: 0 24px 24px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}

.year-block {
  border-bottom: 1px solid #2a2a2a;
}
.year-block:last-child {
  border-bottom: none;
}

.maps-filter-block {
  padding: 16px 18px;
  background: #1f1f1f;
}
.maps-filter-title {
  font-size: 24px;
  font-weight: 700;
  color: #eee;
  margin: 0 0 14px;
  letter-spacing: .01em;
}
.maps-filter-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.maps-filter-list label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: #ddd;
  transition: opacity .15s;
}
.maps-filter-list label.off { opacity: .4; }
.maps-filter-list input[type="checkbox"] {
  margin: 0;
  accent-color: #2ecc71;
  cursor: pointer;
}
.maps-filter-modes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #333;
}

/* пагинатор внизу */
.year-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #1f1f1f;
  border-top: 1px solid #2a2a2a;
  font-size: 13px;
  flex-wrap: wrap;
}
.page-numbers {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.page-btn {
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  min-width: 36px;
  text-align: center;
}
.page-btn:hover:not(:disabled) { background: #444; }
.page-btn:disabled { opacity: .5; cursor: default; }
.page-btn.active {
  background: #2ecc71;
  color: #111;
  border-color: #2ecc71;
  font-weight: 700;
}
.page-dots {
  color: #888;
  padding: 0 4px;
  user-select: none;
}

/* ---------- таблица демок ---------- */
.demo-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
.demo-table thead th {
  text-align: center;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
}
.demo-table colgroup col.col-num      { width: 50px; }
.demo-table colgroup col.col-date     { width: 100px; }
.demo-table colgroup col.col-map      { width: 170px; }
.demo-table colgroup col.col-mode     { width: 70px; }
.demo-table colgroup col.col-result   { width: 130px; }
.demo-table colgroup col.col-download { width: 110px; }
.demo-table colgroup col.col-red      { width: auto; }
.demo-table colgroup col.col-blue     { width: auto; }

.demo-row { border-bottom: 1px solid #222; cursor: pointer; }
.demo-row:last-child { border-bottom: none; }
.demo-row.open { background: #1c1c1c; cursor: default; }
.demo-row.broken { border-left: 2px solid #e74c3c; }

.demo-row > td {
  padding: 10px 14px;
  vertical-align: middle;
  font-size: 13px;
  color: #ddd;
}

/* ячейка «№» — стрелка + номер */
.num-cell {
  text-align: left;
  color: #888;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.num-cell .caret {
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  text-align: center;
  color: #888;
  transition: transform .15s;
  vertical-align: middle;
}
.num-cell .num-text {
  vertical-align: middle;
}
.demo-row.open .num-cell .caret { transform: rotate(90deg); }

/* Дата (2), Режим (4), Кол-во игроков (5) — по центру */
/* сжатые столбцы: Дата (2), Режим (4), Результат (5), Загрузка (6) */
.demo-row > td:nth-child(2),
.demo-row > td:nth-child(4),
.demo-row > td:nth-child(5),
.demo-row > td:nth-child(6) {
  padding: 6px 8px;
  font-size: 12px;
}

* Дата (2), Режим (4) — по центру */
.demo-row > td:nth-child(2),
.demo-row > td:nth-child(4) {
  text-align: center;
}

/* Результат (5) — по левому краю */
.demo-row > td:nth-child(5) {
  text-align: left;
}

/* Красные/синие — обычные отступы */
.players-list {
  white-space: normal;
  max-width: none;
  padding: 6px 8px;
}
.mode-cell {
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
}

.cell-map {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.map-thumb {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 6px;
  background: #222 center/cover no-repeat;
  flex: 0 0 auto;
  border: 1px solid #333;
  cursor: pointer;
}
.map-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 11px;
  text-align: center;
  padding: 4px;
  line-height: 1.2;
  word-break: break-all;
}
.map-name {
  font-weight: 600;
  color: #eee;
  word-break: break-all;
}
.map-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.cell-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.demo-details > td {
  padding: 0;
  background: #141414;
  border-top: 1px solid #222;
}
.demo-details-inner {
  padding: 12px 18px 20px;
}
.demo-row.open + .demo-details { display: table-row; }
.demo-details { display: none; }

.result {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.result .team-red  { color: #e74c3c; font-weight: 700; }
.result .team-blue { color: #3498db; font-weight: 700; }
.result .score     { font-variant-numeric: tabular-nums; }

.players-list {
  font-size: 12px;
  color: #ccc;
  line-height: 1.35;
  max-width: 260px;
  white-space: pre-line;
  word-break: break-word;
}

/* ---------- загрузка ---------- */
.download-cell {
  text-align: center;
  vertical-align: middle;
  line-height: 1.35;
}

.download-btn {
  display: inline-block;
  background: #2ecc71;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #27ae60;
  transition: background .15s, color .15s;
}
.download-btn:hover {
  background: #27ae60;
  color: #fff;
}
.download-btn.downloading {
  background: #666;
  border-color: #555;
  color: #ddd;
  pointer-events: none;
  cursor: default;
}

.download-size,
.download-duration {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}
.download-duration {
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

/* ---------- фильтры внутри спойлера ---------- */
.legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.legend label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: opacity .15s;
}
.legend label.off { opacity: .4; }
.legend input[type="checkbox"] {
  margin: 0;
  accent-color: #2ecc71;
  cursor: pointer;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
}

/* ---------- таймлайн ---------- */
.timeline-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 60px 0;
  scrollbar-color: #666 #222;
  scrollbar-width: thin;
}
.timeline-viewport::-webkit-scrollbar { height: 12px; }
.timeline-viewport::-webkit-scrollbar-track { background: #222; border-radius: 6px; }
.timeline-viewport::-webkit-scrollbar-thumb { background: #555; border-radius: 6px; }
.timeline-viewport::-webkit-scrollbar-thumb:hover { background: #777; }

.timeline-inner {
  position: relative;
  height: 60px;
  min-width: 100%;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line-color);
  transform: translateY(-50%);
  border-radius: 2px;
  z-index: 1;
}

.grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.grid-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--tick-color);
  width: 1px;
  height: 14px;
}
.grid-tick.major { width: 2px; height: 20px; }

.grid-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, 0);
  margin-top: 14px;
  font-size: 10px;
  color: #999;
  white-space: nowrap;
  pointer-events: none;
}
.grid-label.major { color: #ccc; font-weight: 600; }
.grid-label.edge-left  { transform: none; }
.grid-label.edge-right { transform: translateX(-100%); }

.events {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.event {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform .1s;
}
.event:hover {
  transform: translate(-50%, -50%) scale(1.8);
  z-index: 10;
}
.event.death-red   { background: var(--red); }
.event.death-blue  { background: var(--blue); }
.event.chat        { background: var(--chat); width: 6px; height: 6px; }
.event.clip        { background: var(--clip); width: 12px; height: 12px; box-shadow: 0 0 6px rgba(255, 111, 255, .8); }
.event.afk         { background: var(--afk); width: 10px; height: 10px; border: 2px solid #fff; box-shadow: 0 0 4px rgba(0,0,0,.9); }
.event.round       { background: var(--round); width: 14px; height: 14px; border: 2px solid #fff; }
.event.anchor      { background: var(--anchor); z-index: 1; }

.event.selected {
  box-shadow: 0 0 0 3px var(--anchor), 0 0 10px 2px rgba(46, 204, 113, 0.7);
  z-index: 9;
}
.event.selected:hover {
  transform: translate(-50%, -50%) scale(1.8);
  z-index: 10;
}

#tooltip {
  position: fixed;
  pointer-events: none;
  background: #000;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 400px;
  opacity: 0;
  transition: opacity .1s;
  z-index: 1000;
  border: 1px solid #555;
  white-space: pre-line;
}
#tooltip.show { opacity: 1; }

.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.zoom-label {
  font-size: 11px;
  color: #aaa;
  padding: 4px 8px;
  border: 1px dashed #444;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
}
.zoom-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.zoom-controls button {
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  min-width: 40px;
}
.zoom-controls button:hover:not(:disabled) { background: #444; }
.zoom-controls button:disabled { opacity: .5; cursor: default; }

/* ---------- лог событий ---------- */
.event-log {
  margin-top: 12px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #111;
  max-height: calc(18px * 10 + 8px + 8px + 2px);
  overflow-y: auto;
  scrollbar-color: #666 #222;
  scrollbar-width: thin;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.event-log::-webkit-scrollbar { width: 10px; }
.event-log::-webkit-scrollbar-track { background: #222; border-radius: 5px; }
.event-log::-webkit-scrollbar-thumb { background: #555; border-radius: 5px; }
.event-log::-webkit-scrollbar-thumb:hover { background: #777; }

.event-log-inner {
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
  line-height: 18px;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
}
.log-row:hover { background: #222; }
.log-row.selected {
  background: rgba(46, 204, 113, 0.15);
  outline: 1px solid var(--anchor);
}
.log-time {
  color: #999;
  flex: 0 0 auto;
  min-width: 48px;
  font-variant-numeric: tabular-nums;
}
.log-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.log-dot.clip   { box-shadow: 0 0 4px rgba(255,111,255,.8); }
.log-dot.afk    { border: 2px solid #fff; box-sizing: border-box; }
.log-dot.round  { border: 2px solid #fff; box-sizing: border-box; }
.log-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ddd;
}
.log-empty {
  color: #777;
  padding: 4px;
  font-style: italic;
}

/* ---------- ошибки ---------- */
.error {
  color: #e74c3c;
  background: #2a1414;
  border: 1px solid #e74c3c;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

/* ---------- страница «База игроков» ---------- */
.players-page {
  padding: 0 0 40px;
}
.players-card {
  margin: 0 24px 24px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}
.players-title {
  margin: 0;
  padding: 16px 18px;
  font-size: 24px;
  font-weight: 700;
  color: #eee;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
}

/* поиск */
.players-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
}
#players-search-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  background: #0f0f0f;
  color: #f0f0f0;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: border-color .15s, box-shadow .15s;
}
#players-search-input:focus {
  border-color: #2ecc71;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(46, 204, 113, 0.25);
}
#players-search-input::placeholder {
  color: #666;
}
.players-search-count {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

/* таблица игроков */
.players-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
.players-table thead th {
  text-align: center;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}
.players-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #222;
  font-size: 13px;
  color: #ddd;
  vertical-align: middle;
}
.players-table tbody tr:last-child td {
  border-bottom: none;
}
.players-table tbody tr:hover {
  background: #1c1c1c;
}
.players-table .num-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.players-table .time-cell {
  text-align: center;
  color: #aaa;
  white-space: nowrap;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #222;
  flex: 0 0 auto;
  object-fit: cover;
}
.player-avatar.placeholder {
  display: inline-block;
  background: #2a2a2a;
}
.player-nick {
  font-weight: 600;
  color: #eee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.players-loading,
.players-error {
  padding: 20px 18px;
  font-size: 13px;
  color: #888;
}
.players-error {
  color: #e74c3c;
}

/* ширины столбцов таблицы игроков */
.players-table colgroup col.col-rank     { width: 50px; }
.players-table colgroup col.col-player   { width: auto; }
.players-table colgroup col.col-num      { width: 90px; }
.players-table colgroup col.col-playtime { width: 130px; }

/* пагинатор под таблицей игроков */
.players-pager {
  margin-top: 0;
  padding: 12px 18px;
  background: #1f1f1f;
  border-top: 1px solid #2a2a2a;
}

/* кликабельные заголовки таблицы игроков */
.players-table thead th {
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}
.players-table thead th:hover {
  background: #262626;
  color: #eee;
}
.players-table thead th.sorted {
  color: #2ecc71;
}

/* ---------- карточка игрока ---------- */
.player-page {
  padding: 0 0 40px;
}
.player-card {
  margin: 0 24px 24px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}

.player-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
}
.player-big-avatar {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #222 center/cover no-repeat;
  flex: 0 0 auto;
  object-fit: cover;
}
.player-big-avatar.placeholder {
  display: inline-block;
  background: #2a2a2a;
}
.player-head-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.player-nick-big {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: #cf6a32;
  word-break: break-word;
  text-shadow: 1px 1px 0 #7c3f1e;
}
.player-steamid {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}
.player-steamid code {
  color: #aaa;
  background: #121212;
  border: 1px solid #2a2a2a;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.player-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.summary-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.summary-value {
  font-size: 16px;
  font-weight: 700;
  color: #eee;
  font-variant-numeric: tabular-nums;
}

/* табы */
.player-tabs {
  display: flex;
  gap: 2px;
  padding: 0 14px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
}
.player-tab {
  background: transparent;
  color: #aaa;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.player-tab:hover { color: #eee; }
.player-tab.active {
  color: #2ecc71;
  border-bottom-color: #2ecc71;
}

.player-tab-content {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 14px;
}
.stats-label {
  font-size: 12px;
  color: #888;
}
.stats-value {
  font-size: 15px;
  font-weight: 700;
  color: #eee;
  font-variant-numeric: tabular-nums;
}

.player-subtable {
  width: 100%;
  border-collapse: collapse;
}
.player-subtable thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
}
.player-subtable tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #222;
  font-size: 13px;
  color: #ddd;
}
.player-subtable tbody tr:last-child td {
  border-bottom: none;
}
.player-subtable tbody tr:hover {
  background: #1c1c1c;
}
.player-subtable .num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tab-empty {
  color: #777;
  font-style: italic;
  padding: 12px 0;
}

/* ник-ссылка */
.player-nick {
  color: #eee;
  text-decoration: none;
  transition: color .15s;
}
.player-nick:hover {
  color: #2ecc71;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .player-header { flex-direction: column; }
  .player-big-avatar { width: 72px; height: 72px; }
  .player-nick-big { font-size: 22px; }
}

/* ---------- модалка игрока ---------- */
body.modal-open { overflow: hidden; }

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.player-modal[hidden] { display: none; }
.player-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.player-modal-content {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
.player-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.player-modal-close:hover { background: #444; }

.player-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.player-modal-avatar {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #222;
  flex: 0 0 auto;
  object-fit: cover;
}
.player-modal-nick {
  font-size: 22px;
  font-weight: 700;
  color: #eee;
  word-break: break-all;
}
.player-modal-steam {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  font-family: ui-monospace, monospace;
}

.player-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a2a;
}
.pm-tab {
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pm-tab:hover { background: #444; color: #eee; }
.pm-tab.active {
  background: #2ecc71;
  color: #111;
  border-color: #2ecc71;
  font-weight: 700;
}

.player-modal-body {
  min-height: 60px;
}

.pm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.pm-stats-grid > div {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 12px;
}
.pm-stats-grid span {
  display: block;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}
.pm-stats-grid b {
  font-size: 16px;
  color: #eee;
}

.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pm-table thead th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #1f1f1f;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}
.pm-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #222;
  color: #ddd;
}
.pm-table tbody tr:last-child td { border-bottom: none; }
.pm-table tbody tr:hover { background: #1c1c1c; }

/* ссылка «Скачать» в модалке матчей */
.pm-download {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}
.pm-file {
  color: #888;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  margin-left: 6px;
  word-break: break-all;
}


/* ссылка «Скачать» в модалке матчей */
.pm-download {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}
.pm-date {
  white-space: nowrap;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

/* результат матча */
.pm-win {
  color: #2ecc71;
  font-weight: 700;
  white-space: nowrap;
}
.pm-loss {
  color: #e74c3c;
  font-weight: 700;
  white-space: nowrap;
}
.pm-draw {
  color: #aaa;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- чаты в модалке игрока ---------- */
.chats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-spoiler {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.chat-spoiler[open] {
  background: #202020;
}
.chat-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #ddd;
  list-style: none;
}
.chat-summary::-webkit-details-marker { display: none; }
.chat-summary::before {
  content: '▸';
  color: #888;
  display: inline-block;
  transition: transform .15s;
  margin-right: 2px;
}
.chat-spoiler[open] .chat-summary::before {
  transform: rotate(90deg);
}
.chat-summary:hover {
  background: #262626;
}
.chat-date {
  color: #eee;
  font-weight: 600;
  white-space: nowrap;
}
.chat-map {
  color: #aaa;
  white-space: nowrap;
}
.chat-count {
  margin-left: auto;
  color: #2ecc71;
  font-weight: 600;
  white-space: nowrap;
}
.chat-system {
  color: #888;
  font-size: 11px;
  white-space: nowrap;
}

.chat-messages {
  padding: 8px 14px 12px;
  border-top: 1px solid #2a2a2a;
  max-height: 400px;
  overflow-y: auto;
}

.chat-msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chat-msg {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: #ddd;
  border-bottom: 1px solid #222;
}
.chat-msg:last-child { border-bottom: none; }
.chat-msg-time {
  color: #888;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  flex: 0 0 auto;
  min-width: 44px;
  padding-top: 1px;
}
.chat-msg-text {
  flex: 1 1 auto;
  word-break: break-word;
}


/* ---------- чаты в модалке игрока ---------- */
.chats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-spoiler {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.chat-spoiler[open] { background: #202020; }
.chat-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #ddd;
  list-style: none;
}
.chat-summary::-webkit-details-marker { display: none; }
.chat-summary::before {
  content: '▸';
  color: #888;
  display: inline-block;
  transition: transform .15s;
  margin-right: 2px;
}
.chat-spoiler[open] .chat-summary::before { transform: rotate(90deg); }
.chat-summary:hover { background: #262626; }
.chat-date  { color: #eee; font-weight: 600; white-space: nowrap; }
.chat-map   { color: #aaa; white-space: nowrap; }
.chat-count { margin-left: auto; color: #2ecc71; font-weight: 600; white-space: nowrap; }

.chat-messages {
  padding: 8px 14px 12px;
  border-top: 1px solid #2a2a2a;
  max-height: 400px;
  overflow-y: auto;
}
.chat-msg-list { list-style: none; margin: 0; padding: 0; }
.chat-msg {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: #ddd;
  border-bottom: 1px solid #222;
}
.chat-msg:last-child { border-bottom: none; }
.chat-msg-time {
  color: #888;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  flex: 0 0 auto;
  min-width: 44px;
  padding-top: 1px;
}
.chat-msg-text { flex: 1 1 auto; word-break: break-word; }


/* donut «Классы» */
.classes-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.classes-donut-svg { flex: 0 0 auto; }
.classes-donut-svg svg { display: block; }
.classes-donut-legend { flex: 1 1 200px; min-width: 180px; }

.classes-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.classes-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #222;
}
.classes-legend li:last-child { border-bottom: none; }
.classes-legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1px solid #333;
}
.classes-legend-name {
  flex: 1 1 auto;
  color: #ddd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.classes-legend-value {
  color: #2ecc71;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.donut-segment {
  pointer-events: stroke;   /* ловит события только по видимому штриху */
  cursor: pointer;
  transition: opacity .15s;
}
.donut-segment:hover {
  opacity: 0.75;
}

#tooltip {
  position: fixed;
  pointer-events: none;
  background: #000;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 400px;
  opacity: 0;
  transition: opacity .1s;
  z-index: 3000;   /* было 1000 — теперь выше модалки (2000) */
  border: 1px solid #555;
  white-space: pre-line;
}
#tooltip.show { opacity: 1; }


/* ---------- Оружия: две диаграммы ---------- */
.weapons-charts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.weapons-chart-block {
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 14px 16px;
}
.weapons-chart-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #eee;
  letter-spacing: .01em;
}

/* ---------- вкладка «Карты» ---------- */
.maps-tab {
  display: flex;
  flex-direction: column;
  gap: 20px;
}


.pm-steam-link {
  color: #2ecc71;
  text-decoration: none;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.pm-steam-link:hover {
  text-decoration: underline;
  color: #55efc4;
}

/* ---------- мини-таблица игроков ---------- */
.mini-players-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.mini-players-table thead th {
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  background: transparent;
  border-bottom: 1px solid #2a2a2a;
  text-align: center;       /* заголовки — по центру */
  white-space: nowrap;
}
.mini-players-table tbody td {
  padding: 2px 4px;
  border-bottom: 1px solid #1f1f1f;
  vertical-align: middle;
  text-align: center;       /* все ячейки — по центру */
}
.mini-players-table tbody tr:last-child td { border-bottom: none; }

/* исключение: столбец с ником — по левому краю */
.mini-players-table tbody td.mp-nick {
  text-align: left;
}

.mp-num      { color: #666; width: 22px; text-align: center; }
.mp-class    { width: 28px; text-align: center; }
.mp-class-img { display: inline-block; vertical-align: middle; width: 24px; height: 24px; object-fit: contain; }
.mp-nick     { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 180px; text-align: left; }
.mp-nick-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ddd; }
.mp-avatar   {
  width: 20px; height: 20px; border-radius: 3px;
  border: 1px solid #333; background: #222;
  flex: 0 0 auto; object-fit: cover;
}
.mp-avatar.placeholder { display: inline-block; background: #2a2a2a; }
.mp-kills, .mp-deaths, .mp-kd, .mp-assists {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #ccc;
}

/* ---------- вкладка «Матчи»: раскрывающиеся составы ---------- */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-spoiler {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.match-spoiler[open] {
  background: #202020;
}

.match-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #ddd;
  list-style: none;
  flex-wrap: wrap;
}
.match-summary::-webkit-details-marker { display: none; }

.match-caret {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #888;
  position: relative;
}
.match-caret::before {
  content: '▸';
  display: inline-block;
  transition: transform .15s;
}
.match-spoiler[open] .match-caret::before {
  transform: rotate(90deg);
}

.match-summary:hover { background: #262626; }

.match-date     { color: #eee; font-weight: 600; white-space: nowrap; }
.match-map      { color: #aaa; white-space: nowrap; }
.match-duration { color: #888; white-space: nowrap; font-variant-numeric: tabular-nums; }
.match-score    { color: #ddd; font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-result   { color: #ddd; }
.match-actions  { margin-left: auto; }

.match-body {
  border-top: 1px solid #2a2a2a;
  padding: 12px 14px;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .match-teams { grid-template-columns: 1fr; }
}

.match-team { min-width: 0; }

.match-team-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.match-team-title-red  { color: #e74c3c; }
.match-team-title-blue { color: #3498db; }


/* ---------- вкладка «Матчи»: раскрывающиеся составы ---------- */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-spoiler {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.match-spoiler[open] {
  background: #202020;
}

.match-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #ddd;
  list-style: none;
  flex-wrap: wrap;
}
.match-summary::-webkit-details-marker { display: none; }

.match-caret {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #888;
  position: relative;
}
.match-caret::before {
  content: '▸';
  display: inline-block;
  transition: transform .15s;
}
.match-spoiler[open] .match-caret::before {
  transform: rotate(90deg);
}

.match-summary:hover { background: #262626; }

.match-date     { color: #eee; font-weight: 600; white-space: nowrap; }
.match-map      { color: #aaa; white-space: nowrap; }
.match-duration { color: #888; white-space: nowrap; font-variant-numeric: tabular-nums; }
.match-score    { color: #ddd; font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-result   { color: #ddd; }

.match-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}

.match-body {
  border-top: 1px solid #2a2a2a;
  padding: 12px 14px;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .match-teams { grid-template-columns: 1fr; }
}

.match-team { min-width: 0; }

.match-team-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.match-team-title-red  { color: #e74c3c; }
.match-team-title-blue { color: #3498db; }

/* кнопка «Подробнее» рядом с «Скачать» в матчах */
.pm-details {
  display: inline-block;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #2980b9;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.pm-details:hover {
  background: #2980b9;
  color: #fff;
}

/* ---------- поиск в фильтрах демок ---------- */
.maps-filter-search {
  margin: 0 0 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.maps-filter-search-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 480px;
  background: #0f0f0f;
  color: #f0f0f0;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: border-color .15s, box-shadow .15s;
}
.maps-filter-search-input:focus {
  border-color: #2ecc71;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(46, 204, 113, 0.25);
}
.maps-filter-search-input::placeholder {
  color: #666;
}

.maps-filter-years {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #333;
}

.download-btn {
  display: inline-block;
  background: #2ecc71;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #27ae60;
  transition: background .15s, color .15s;

  /* перенос текста на две строки */
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 90px;   /* чтобы «Скачать Демку» точно переносилось */
}

/* ---------- логотип-ссылка ---------- */
a.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.maps-filter-list label.map-all {
  font-weight: 700;
  color: #eee;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid #333;
}

.maps-filter-list label.map-all.off {
  opacity: .4;
}

.maps-filter-list label.year-all {
  font-weight: 700;
  color: #eee;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid #333;
}

.maps-filter-list label.year-all.off {
  opacity: .4;
}

.maps-filter-search-input::placeholder {
  color: #666;
}