/* ============================================================
   cstv-new.css — подключать ПОСЛЕДНИМ (после mappool-photos.css)
   1) совместимость старых имён цветов
   2) режим без спойлеров
   3) плитки карт в матче
   4) вкладка «Места в топе» в профиле команды
   ============================================================ */

/* ---------- 1. Старые имена цветов -> новые ----------
   --orange / --blue были названиями времён Overwatch: на деле это акцент
   текущей игры (синий в CSTV, красный в D2TV) и акцент второй игры.
   Новые имена: --accent / --accent-2 (+ -rgb, -text).
   Блок ниже нужен, пока в styles.css, ui-update.css и др. остались var(--orange).
   Когда прогонишь sed по всем css/js (см. инструкцию) — блок можно удалить. */
:root, html[data-theme], #tab-overview {
  --orange: var(--accent);
  --orange-rgb: var(--accent-rgb);
  --orange-text: var(--accent-text);
  --blue: var(--accent-2);
  --blue-rgb: var(--accent-2-rgb);
  --blue-text: var(--accent-2-text);
}

/* ---------- 2. Режим без спойлеров ---------- */
.sp-score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 1px 10px; border-radius: 6px;
  border: 1px dashed var(--border); color: var(--muted, #8a97ab);
  font-weight: 700; letter-spacing: .08em; cursor: pointer;
  user-select: none; transition: border-color .15s, color .15s;
}
.sp-score:hover { border-color: var(--accent); color: var(--accent-text, var(--accent)); }
.sp-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin: 14px 0; padding: 14px 16px; border-radius: 10px;
  background: rgba(var(--accent-rgb), .08); border: 1px dashed rgba(var(--accent-rgb), .45);
  text-align: center;
}
.sp-banner b { color: var(--text); }
.sp-toggle.on { border-color: var(--accent); color: var(--accent-text, var(--accent)); }

/* ---------- 3. Плитки карт ---------- */
.map-tiles {
  display: grid; gap: 12px; margin: 10px 0 18px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.mt-tile {
  position: relative; overflow: hidden; border-radius: 12px; min-height: 148px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 12px 14px; color: #fff; isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(to top, rgba(5, 8, 14, .92) 8%, rgba(5, 8, 14, .35) 60%, rgba(5, 8, 14, .15)),
    var(--photo, none) center / cover no-repeat,
    linear-gradient(135deg, var(--mc, #3a4a63), #0b0f16);
  transition: transform .15s, border-color .15s;
}
.mt-tile:hover { transform: translateY(-2px); border-color: var(--mc, var(--accent)); }
.mt-tile::after {            /* цветная полоса карты снизу */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--mc, var(--accent)); z-index: 1;
}
.mt-num {
  position: absolute; top: 10px; left: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 800;
}
.mt-link {
  position: absolute; top: 10px; right: 12px; color: #fff; text-decoration: none;
  font-size: 13px; opacity: .8;
}
.mt-link:hover { opacity: 1; }
.mt-pick {            /* лого команды, пикнувшей карту — в правом верхнем углу */
  position: absolute; top: 8px; right: 10px; width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.mt-pick .team-badge { width: 100% !important; height: 100% !important; border-radius: 0; font-size: 11px !important; }
.mt-pick ~ .mt-link { right: 48px; top: 14px; }
.mt-name {
  font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .06em;
  font-size: 20px; line-height: 1.1; text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.mt-score { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 30px; line-height: 1; }
.mt-score i { font-style: normal; opacity: .5; font-size: 22px; }
.mt-score b { opacity: .6; }
.mt-score b.w { opacity: 1; color: #fff; text-shadow: 0 0 14px var(--mc, var(--accent)); }
.mt-score.mt-tba { opacity: .5; font-size: 24px; }
.mt-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; opacity: .85; }
.mt-foot span { display: inline-flex; align-items: center; gap: 6px; }
.mt-foot span.w { color: #fff; opacity: 1; }
.mt-foot span.l { opacity: .55; }
.mt-win { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.mt-win small { opacity: .6; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mt-tile.tba { filter: saturate(.3); }

/* ---------- 4. Вкладка «Места в топе» (профиль команды) ---------- */
.rh-wrap { display: grid; gap: 18px; }
.rh-controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.rh-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--bg-elev); border: 1px solid var(--border); }
.rh-seg button {
  border: 0; background: transparent; color: var(--muted, #8a97ab); cursor: pointer;
  padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600;
}
.rh-seg button.on { background: var(--accent); color: var(--on-accent, #fff); }
.rh-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #8a97ab); margin-right: 8px; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rh-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border); font-size: 13px; font-weight: 700; cursor: default;
}
.rh-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.rh-chip button { border: 0; background: transparent; color: var(--muted, #8a97ab); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.rh-chip button:hover { color: var(--text); }
.rh-add { padding: 6px 10px; border-radius: 8px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); font: inherit; font-size: 13px; max-width: 220px; }
.rh-quick { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.rh-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 8px; }
.rh-scroll { overflow-x: auto; }
.rh-svg { display: block; width: 100%; min-width: 620px; height: auto; }
.rh-grid line { stroke: var(--border); stroke-width: 1; }
.rh-grid line.top3 { stroke: rgba(var(--accent-rgb), .35); }
.rh-ytxt, .rh-xtxt { fill: var(--muted, #8a97ab); font-size: 12px; font-weight: 600; }
.rh-ytxt { text-anchor: end; }
.rh-xtxt { text-anchor: middle; }
.rh-team path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: opacity .15s, stroke-width .15s; }
.rh-team circle { stroke: var(--bg-elev); stroke-width: 2; transition: opacity .15s; }
.rh-team text { font-size: 12px; font-weight: 800; transition: opacity .15s; }
.rh-svg:hover .rh-team { opacity: .25; }
.rh-svg:hover .rh-team:hover { opacity: 1; }
.rh-team:hover path { stroke-width: 4.5; }
.rh-note { font-size: 12px; color: var(--muted, #8a97ab); padding: 6px 4px 10px; }

.rh-leaders { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.rh-leader { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.rh-leader small { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--muted, #8a97ab); margin-bottom: 6px; }
.rh-leader b { font-size: 18px; }
.rh-leader span { color: var(--muted, #8a97ab); font-size: 13px; }

.rh-table { width: 100%; border-collapse: collapse; }
.rh-table th, .rh-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.rh-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #8a97ab); }
.rh-table td.num, .rh-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rh-table .rh-team-cell { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.rh-table .rh-team-cell i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rh-up { color: #2fb45a; } .rh-down { color: #e8403f; } .rh-same { color: var(--muted, #8a97ab); }

@media (max-width: 640px) {
  .map-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mt-tile { min-height: 124px; padding: 10px; }
  .mt-name { font-size: 16px; }
  .mt-score { font-size: 24px; }
}
