/* ==========================================================================
   tournament_matches.css — Стили страницы матчей турнира (v3)
   Scope: .tournament-matches-v3 (только эта страница)
   Эталон: tournament_players.css / tournament_category.css, прототип
           prototype/v3/tournament_matches_v3.html
   Правки стилей страницы — ТОЛЬКО здесь, в tpl CSS не возвращать.
   ========================================================================== */

.tournament-matches-v3 {
  --mt-teal: var(--teal, #0d9488);
  --mt-teal-dark: var(--teal-dark, #0b7d73);
  --mt-teal-soft: var(--teal-soft, #d9f2ef);
  --mt-teal-glow: var(--teal-glow, rgba(13, 148, 136, 0.12));
  --mt-surface: var(--surface, #ffffff);
  --mt-surface-hover: var(--surface-hover, #f6f8f9);
  --mt-surface-border: var(--surface-border, #e2e8f0);
  --mt-text: var(--text, #0f172a);
  --mt-muted: var(--text-muted, #475569);
  --mt-grad: var(--grad, linear-gradient(135deg, #0d9488, #6366f1));
  --mt-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07);
  --mt-shadow-md: 0 8px 28px rgba(15, 23, 42, 0.10);
  --mt-r-lg: var(--r-lg, 20px);
  --mt-r-md: var(--r-md, 14px);
  --mt-r-sm: var(--r-sm, 10px);
}

/* ── Hero секция ── */
.tournament-matches-v3 .hero {
  background: var(--mt-grad);
  border-radius: var(--mt-r-lg);
  padding: 18px 24px !important;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(13, 148, 136, 0.55);
  margin-bottom: 16px;
}
.tournament-matches-v3 .hero::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.tournament-matches-v3 .hero > * {
  position: relative;
  z-index: 1;
}
.tournament-matches-v3 .hero h1 {
  font-family: var(--pr-font-heading, Manrope, Inter, system-ui, sans-serif);
  font-size: 22px !important;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: #fff;
}
.tournament-matches-v3 .hero .sub {
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.94;
  color: #fff;
}
.tournament-matches-v3 .hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.tournament-matches-v3 .hero .chip {
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--mt-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: none !important;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ── Сводные плитки ── */
.tournament-matches-v3 .stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.tournament-matches-v3 .stat {
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  padding: 12px 16px;
  box-shadow: var(--mt-shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tournament-matches-v3 .stat .num {
  font-family: var(--pr-font-ui, Inter, system-ui, sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--mt-teal-dark);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tournament-matches-v3 .stat .lab {
  font-size: 12.5px;
  color: var(--mt-muted);
  font-weight: 700;
  margin-top: 4px;
}
.tournament-matches-v3 .stat .hint {
  font-size: 11.5px;
  color: var(--mt-muted);
  opacity: 0.85;
  margin-top: 2px;
}

/* ── Панель фильтров (grid: поиск растягивается, селекты фиксированы) ── */
.tournament-matches-v3 .controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px 216px;
  gap: 10px;
  align-items: center;
  margin: 18px 0 10px;
}
.tournament-matches-v3 .search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  padding: 0 14px;
  height: 44px;
  min-width: 0;
  box-shadow: var(--mt-shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}
.tournament-matches-v3 .search:focus-within {
  border-color: var(--mt-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}
.tournament-matches-v3 .search svg {
  flex: 0 0 auto;
  color: var(--mt-muted);
}
.tournament-matches-v3 .search input {
  flex: 1;
  border: none;
  outline: none;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--mt-text);
  min-width: 0;
  height: 100%;
  padding: 0;
}
.tournament-matches-v3 .search input::placeholder {
  color: var(--mt-muted);
  opacity: 0.7;
}

.tournament-matches-v3 .select {
  width: 100% !important;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  background-color: var(--mt-surface);
  color: var(--mt-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 34px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-shadow: var(--mt-shadow-sm);
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tournament-matches-v3 .select:hover {
  border-color: #cbd5e1;
}
.tournament-matches-v3 .select:focus {
  outline: none;
  border-color: var(--mt-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}

/* ── Чипсы-фильтры (горизонтальный скролл без скроллбара) ── */
.tournament-matches-v3 .chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 2px 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-padding-inline: 4px;
}
.tournament-matches-v3 .chips::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.tournament-matches-v3 .chips-cats {
  margin: 0 0 16px;
}
.tournament-matches-v3 .chip-filter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--mt-surface-border);
  background: var(--mt-surface);
  color: var(--mt-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 14px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tournament-matches-v3 .chip-filter .cnt {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.tournament-matches-v3 .chip-filter:hover {
  color: var(--mt-text);
  border-color: var(--mt-muted);
}
.tournament-matches-v3 .chip-filter.on {
  background: var(--mt-teal-soft);
  color: var(--mt-teal-dark);
  border-color: transparent;
  font-weight: 800;
}
.tournament-matches-v3 .chip-filter.on .cnt {
  opacity: 1;
}
.tournament-matches-v3 .chip-filter:focus-visible {
  outline: 2px solid var(--mt-teal);
  outline-offset: 2px;
}

/* ── Заголовок списка + переключатель вида ── */
.tournament-matches-v3 .section-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}
.tournament-matches-v3 .section-h h2 {
  font-family: var(--pr-font-heading, Manrope, Inter, system-ui, sans-serif);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--mt-text);
}
.tournament-matches-v3 .section-h .cnt {
  font-size: 12px;
  font-weight: 800;
  color: var(--mt-muted);
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  padding: 2px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.tournament-matches-v3 .live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: mt-livedot 1.8s infinite;
}
@keyframes mt-livedot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.tournament-matches-v3 .seg {
  display: inline-flex;
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: var(--mt-shadow-sm);
  margin-left: auto;
}
.tournament-matches-v3 .seg-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--mt-muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tournament-matches-v3 .seg-btn:hover {
  color: var(--mt-text);
}
.tournament-matches-v3 .seg-btn.on {
  background: var(--mt-teal);
  color: #fff;
}
.tournament-matches-v3 .seg-btn:focus-visible {
  outline: 2px solid var(--mt-teal);
  outline-offset: 2px;
}

/* ── ПЕРЕКЛЮЧЕНИЕ ВИДОВ: ТАБЛИЦА ПО УМОЛЧАНИЮ ── */
.tournament-matches-v3 .view-list {
  display: block;
}
.tournament-matches-v3 .view-cards {
  display: none;
}
.tournament-matches-v3.show-cards .view-cards {
  display: block;
}
.tournament-matches-v3.show-cards .view-list {
  display: none;
}

/* ── ТАБЛИЦА (ВИД-СПИСОК) ── */
.tournament-matches-v3 .category-scroll-wrapper {
  position: relative;
  width: 100%;
}
.tournament-matches-v3 .table-responsive,
.tournament-matches-v3 #mtTableContainer {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--mt-teal) var(--mt-surface-hover);
  position: relative;
  border-radius: var(--mt-r-md);
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  box-shadow: var(--mt-shadow-sm);
}
.tournament-matches-v3 .table-responsive::-webkit-scrollbar {
  height: 8px;
}
.tournament-matches-v3 .table-responsive::-webkit-scrollbar-track {
  background: var(--mt-surface-hover);
  border-radius: 999px;
}
.tournament-matches-v3 .table-responsive::-webkit-scrollbar-thumb {
  background: var(--mt-teal);
  border-radius: 999px;
}

/* Сброс каталожных стилей premium-table для девятиколоночной таблицы матчей */
.tournament-matches-v3 table#players.mlist,
.tournament-matches-v3 table#players.mlist.premium-table {
  display: table !important;
  width: 100% !important;
  min-width: 1020px !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  font-size: 13.5px;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.tournament-matches-v3 table#players.mlist thead {
  display: table-header-group !important;
}
.tournament-matches-v3 table#players.mlist tbody {
  display: table-row-group !important;
}
.tournament-matches-v3 table#players.mlist thead tr,
.tournament-matches-v3 table#players.mlist tbody tr {
  display: table-row !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.tournament-matches-v3 table#players.mlist tbody tr {
  transition: background 0.12s;
}
.tournament-matches-v3 table#players.mlist tbody tr:hover {
  background: var(--mt-surface-hover) !important;
}
.tournament-matches-v3 table#players.mlist tbody tr[style*="display: none"],
.tournament-matches-v3 table#players.mlist tbody tr.filter-hidden {
  display: none !important;
}
.tournament-matches-v3 table#players.mlist thead th,
.tournament-matches-v3 table#players.mlist tbody td {
  display: table-cell !important;
  box-sizing: border-box;
  padding: 11px 14px;
  vertical-align: middle !important;
  text-align: left;
  border: none !important;
  border-top: 1px solid var(--mt-surface-border) !important;
  white-space: nowrap;
}
.tournament-matches-v3 table#players.mlist thead th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mt-muted);
  background: var(--mt-surface-hover) !important;
  border-top: none !important;
  border-bottom: 1px solid var(--mt-surface-border) !important;
  user-select: none;
  vertical-align: middle;
}
.tournament-matches-v3 table#players.mlist thead th[role="button"] {
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.tournament-matches-v3 table#players.mlist thead th[role="button"]:hover {
  color: var(--mt-text);
  background: #eef2f5 !important;
}
.tournament-matches-v3 table#players.mlist thead th .ar {
  opacity: 0.35;
  font-size: 10px;
  margin-left: 4px;
  display: inline-block;
  transition: opacity 0.15s, color 0.15s;
}
.tournament-matches-v3 table#players.mlist thead th.sorted {
  color: var(--mt-text);
}
.tournament-matches-v3 table#players.mlist thead th.sorted .ar {
  opacity: 1;
  color: var(--mt-teal-dark);
}
.tournament-matches-v3 table#players.mlist thead th:focus-visible {
  outline: 2px solid var(--mt-teal);
  outline-offset: -2px;
  border-radius: 4px;
}
.tournament-matches-v3 table#players.mlist thead th.c-vs {
  text-align: center !important;
  color: var(--mt-muted);
  font-size: 10.5px;
  cursor: default;
}
.tournament-matches-v3 table#players.mlist tbody td::before,
.tournament-matches-v3 table#players.mlist thead th::before {
  content: none !important;
  display: none !important;
}

/* Строка матча: устойчивость к глобальным flex-стилям */
.tournament-matches-v3 #players .match-row {
  display: table-row !important;
  border: none !important;
}
.tournament-matches-v3 #players .match-row td {
  vertical-align: middle !important;
}

/* Игроки в таблице */
.tournament-matches-v3 #players td:nth-child(1),
.tournament-matches-v3 #players td:nth-child(3) {
  min-width: 190px;
  white-space: normal !important;
}
.tournament-matches-v3 #players td:nth-child(2) {
  width: 46px;
  min-width: 46px;
  text-align: center !important;
}
.tournament-matches-v3 #players a.player-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  text-decoration: none !important;
  border-bottom: none !important;
  color: var(--mt-text) !important;
  transition: color 0.15s !important;
  width: 100%;
  min-height: 24px;
}
.tournament-matches-v3 #players a.player-link::after {
  display: none !important;
}
.tournament-matches-v3 #players a.player-link:hover {
  text-decoration: none !important;
  color: var(--mt-teal, #0d9488) !important;
}
.tournament-matches-v3 #players .player-name {
  display: block;
  line-height: 1.3;
  min-height: 18px;
  font-weight: 700;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.tournament-matches-v3 #players .vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--mt-surface-hover);
  border: 1px solid var(--mt-surface-border);
  color: var(--mt-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
/* Гендерная подсветка VS-бейджа (цвета — как в базовой теме) */
.tournament-matches-v3 #players .vs-badge.vs-men {
  color: hsl(210, 80%, 45%);
  background: hsla(210, 80%, 50%, 0.12);
  border-color: hsla(210, 80%, 50%, 0.25);
}
.tournament-matches-v3 #players .vs-badge.vs-women {
  color: hsl(340, 75%, 45%);
  background: hsla(340, 80%, 60%, 0.12);
  border-color: hsla(340, 80%, 60%, 0.25);
}

/* Счёт и доп. информация */
.tournament-matches-v3 #players td.score-cell {
  text-align: center !important;
  line-height: 1.5;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--mt-teal-dark);
  white-space: nowrap !important;
}
.tournament-matches-v3 #players td.score-cell .mscore {
  display: inline-block;
}
/* Компактный счёт в табличном виде (и в плитках, если сервер его использует) */
.tournament-matches-v3 .mscore {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--mt-teal-dark);
  white-space: nowrap;
}
.tournament-matches-v3 .mscore small {
  font-weight: 600;
  color: var(--mt-muted);
  font-size: 11px;
}
.tournament-matches-v3 #players .score-games {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mt-muted);
  white-space: nowrap;
  margin-top: 2px;
}

/* Судья */
.tournament-matches-v3 #players td.judge-cell {
  white-space: normal !important;
}
.tournament-matches-v3 .judge-cell .judge-name {
  display: block;
  font-size: 12px;
  color: var(--mt-muted);
  margin-bottom: 2px;
  line-height: 1.35;
  text-decoration: none;
}
.tournament-matches-v3 #players td.judge-cell a.judge-name {
  color: var(--mt-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.tournament-matches-v3 #players td.judge-cell a.judge-name:hover {
  color: var(--mt-teal);
}

/* Группа: бейдж внутри ячейки */
.tournament-matches-v3 #players tbody td .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Дата матча: чип даты + время в одну строку */
.tournament-matches-v3 #players th.col-date,
.tournament-matches-v3 #players td.date-cell {
  width: 132px;
  min-width: 124px;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}
.tournament-matches-v3 #players td.date-cell .table-dates-chips {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  vertical-align: middle;
}
.tournament-matches-v3 #players .table-date-chip.tdc-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  opacity: 1;
  filter: none;
  margin: 0;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mt-muted);
  line-height: 1.15;
  white-space: nowrap;
}
.tournament-matches-v3 #players .table-date-chip.tdc-display .tdc-weekday,
.tournament-matches-v3 #players .table-date-chip.tdc-display .tdc-month {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--mt-muted);
  text-transform: lowercase;
  line-height: 1.1;
}
.tournament-matches-v3 #players .table-date-chip.tdc-display .tdc-day {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--pr-font-ui, Inter, system-ui, sans-serif);
  color: var(--mt-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tournament-matches-v3 .tdc-time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 7px;
  border: 1px solid var(--mt-teal, #0d9488);
  border-radius: var(--mt-r-sm, 8px);
  background-color: var(--mt-teal-glow);
  color: var(--mt-teal, #0d9488);
  font-family: var(--pr-font-ui, Inter, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.tournament-matches-v3 #players .date-cell-raw {
  color: var(--mt-muted);
  font-size: 12px;
}

/* ── Подсказки горизонтальной прокрутки таблицы ── */
.tournament-matches-v3 .category-scroll-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mt-text);
  cursor: pointer;
  z-index: 5;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.15s, color 0.15s;
}
.tournament-matches-v3 .category-scroll-hint:hover {
  background: var(--mt-teal-soft);
  color: var(--mt-teal-dark);
}
.tournament-matches-v3 .category-scroll-hint:focus-visible {
  outline: 2px solid var(--mt-teal);
  outline-offset: 2px;
}
.tournament-matches-v3 .category-scroll-hint.hint-left { left: 8px; }
.tournament-matches-v3 .category-scroll-hint.hint-right { right: 8px; }
.tournament-matches-v3 .category-scroll-wrapper.has-overflow-left .category-scroll-hint.hint-left {
  opacity: 1;
  pointer-events: auto;
}
.tournament-matches-v3 .category-scroll-wrapper.has-overflow-right .category-scroll-hint.hint-right {
  opacity: 1;
  pointer-events: auto;
}

/* ── КАРТОЧКИ МАТЧЕЙ (ВИД-ПЛИТКИ) ── */
.tournament-matches-v3 .mt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
  align-items: start;
}

/* Заголовок-разделитель по дате (если сервер его отдаёт) */
.tournament-matches-v3 .day {
  grid-column: 1 / -1;
  font-family: var(--pr-font-ui, Inter, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 800;
  color: var(--mt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 0 4px;
  margin: 0;
  border-bottom: 1px solid var(--mt-surface-border);
}
.tournament-matches-v3 .mt-grid > .day:first-child {
  padding-top: 0;
}

.tournament-matches-v3 .mcard {
  background: var(--mt-surface);
  border: 1px solid var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  padding: 12px 14px;
  box-shadow: var(--mt-shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-width: 0;
}
.tournament-matches-v3 .mcard:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.tournament-matches-v3 .mcard.me {
  border-color: var(--mt-teal);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.12);
}
.tournament-matches-v3 .mcard.is-hidden,
.tournament-matches-v3 .mcard[style*="display: none"] {
  display: none !important;
}

.tournament-matches-v3 .mcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.tournament-matches-v3 .mcard__place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.tournament-matches-v3 .mcard__place .court,
.tournament-matches-v3 .mcard .court {
  color: var(--mt-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Чип категории */
.tournament-matches-v3 .chip-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--mt-muted);
  background: var(--mt-surface-hover);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-matches-v3 .chip-cat::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.tournament-matches-v3 .chip-cat.is-m { color: #4f46e5; background: #eef2ff; }
.tournament-matches-v3 .chip-cat.is-w { color: #db2777; background: #fdf2f8; }
.tournament-matches-v3 .chip-cat.is-j { color: #b45309; background: #fffbeb; }

/* Строка игроков: ник — счёт — ник */
.tournament-matches-v3 .mcard__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.tournament-matches-v3 .mcard .pl {
  min-width: 0;
}
.tournament-matches-v3 .mcard .pl:last-child {
  text-align: right;
}
.tournament-matches-v3 .mcard .pl a {
  display: block;
  color: var(--mt-text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tournament-matches-v3 .mcard .pl a:hover {
  color: var(--mt-teal);
}
.tournament-matches-v3 .mcard .pl.win a {
  color: var(--mt-teal-dark);
  font-weight: 800;
}

.tournament-matches-v3 .score {
  text-align: center;
  min-width: 78px;
}
.tournament-matches-v3 .score b {
  display: block;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--mt-text);
  line-height: 1;
  white-space: nowrap;
}
.tournament-matches-v3 .score.pending b,
.tournament-matches-v3 .score.none b {
  color: var(--mt-muted);
  font-weight: 600;
}
.tournament-matches-v3 .sets {
  display: block;
  font-size: 11px;
  color: var(--mt-muted);
  margin-top: 3px;
  white-space: nowrap;
}
.tournament-matches-v3 .sets .dur {
  color: var(--mt-teal-dark);
  font-weight: 700;
}

/* Футер карточки: статус, группа, судья */
.tournament-matches-v3 .mcard__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.tournament-matches-v3 .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.tournament-matches-v3 .badge.gray {
  background: var(--mt-surface-hover);
  border: 1px solid var(--mt-surface-border);
  color: var(--mt-muted);
}
.tournament-matches-v3 .badge.done {
  background: #d1fae5;
  color: #047857;
}
.tournament-matches-v3 .badge.pend,
.tournament-matches-v3 .badge.pending {
  background: #fef3c7;
  color: #92400e;
}
.tournament-matches-v3 .badge.live {
  background: var(--mt-teal-soft);
  color: var(--mt-teal-dark);
}
.tournament-matches-v3 .badge.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mt-teal);
  animation: mt-pulse 1.2s infinite;
}
@keyframes mt-pulse {
  50% { opacity: 0.35; }
}
.tournament-matches-v3 .mcard__foot .judge {
  margin-left: auto;
  font-size: 11px;
  color: var(--mt-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Алиасы карточной разметки (если сервер отдаст вариант без BEM-разделителя) ── */
.tournament-matches-v3 .mcard-top,
.tournament-matches-v3 .mcard .mcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.tournament-matches-v3 .mcard-place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.tournament-matches-v3 .mcard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.tournament-matches-v3 .mcard-row .pl:last-child {
  text-align: right;
}
.tournament-matches-v3 .mcard-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── Пустой результат фильтра ── */
.tournament-matches-v3 .empty-state-notice {
  text-align: center;
  color: var(--mt-muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 34px 20px;
  background: var(--mt-surface);
  border: 1px dashed var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  margin-top: 14px;
}

/* ── Подсказка внизу страницы ── */
.tournament-matches-v3 .mt-hint-box {
  margin-top: 16px;
  background: var(--mt-surface);
  border: 1px dashed var(--mt-surface-border);
  border-radius: var(--mt-r-md);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--mt-muted);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tournament-matches-v3 .mt-hint-icon {
  font-size: 16px;
  line-height: 1;
  flex: none;
}
.tournament-matches-v3 .mt-hint-text {
  line-height: 1.45;
}
.tournament-matches-v3 .mt-hint-text strong,
.tournament-matches-v3 .mt-hint-text b {
  color: var(--mt-text);
}

/* ── Страница закрыта настройками публикации ── */
.tournament-matches-v3[data-published="0"] .controls,
.tournament-matches-v3[data-published="0"] .chips,
.tournament-matches-v3[data-published="0"] .stat-row,
.tournament-matches-v3[data-published="0"] .section-h,
.tournament-matches-v3[data-published="0"] .view-cards {
  display: none !important;
}

/* ── Доступность: видимый фокус ── */
.tournament-matches-v3 .select:focus-visible,
.tournament-matches-v3 a:focus-visible,
.tournament-matches-v3 button:focus-visible {
  outline: 2px solid var(--mt-teal);
  outline-offset: 2px;
}

/* ── Адаптивность: планшеты ── */
@media (max-width: 960px) {
  .tournament-matches-v3 .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .tournament-matches-v3 .controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tournament-matches-v3 .controls .select {
    width: 100% !important;
  }
  .tournament-matches-v3 .section-h .seg {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .tournament-matches-v3 .seg-btn {
    flex: 1;
    justify-content: center;
  }
  .tournament-matches-v3 .mt-grid {
    grid-template-columns: 1fr;
  }
  /* На тач-устройствах стрелки прокрутки не нужны — свайп работает нативно */
  .tournament-matches-v3 .category-scroll-hint {
    display: none;
  }
}

/* ── Адаптивность: телефоны ── */
@media (max-width: 600px) {
  .tournament-matches-v3 .hero {
    padding: 14px 16px !important;
    margin-bottom: 12px;
  }
  .tournament-matches-v3 .hero h1 {
    font-size: 20px !important;
  }
  .tournament-matches-v3 .hero .sub {
    font-size: 12.5px;
  }
  .tournament-matches-v3 .hero .chip {
    font-size: 11.5px;
    padding: 4px 10px;
  }
  .tournament-matches-v3 .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
  }
  .tournament-matches-v3 .stat {
    padding: 10px 12px;
  }
  .tournament-matches-v3 .stat .num {
    font-size: 19px;
  }
  .tournament-matches-v3 .stat .lab {
    font-size: 11.5px;
  }
  .tournament-matches-v3 .stat .hint {
    font-size: 10.5px;
  }
  .tournament-matches-v3 .controls {
    margin: 14px 0 8px;
  }
  .tournament-matches-v3 .search,
  .tournament-matches-v3 .select {
    height: 42px;
    font-size: 13px;
  }
  .tournament-matches-v3 .chips {
    gap: 6px;
    margin-bottom: 8px;
  }
  .tournament-matches-v3 .chip-filter {
    font-size: 12px;
    padding: 7px 12px;
    min-height: 32px;
  }
  .tournament-matches-v3 .chips-cats {
    margin-bottom: 12px;
  }
  .tournament-matches-v3 .section-h {
    margin: 16px 0 10px;
    gap: 8px;
  }
  .tournament-matches-v3 .section-h h2 {
    font-size: 16.5px;
  }
  .tournament-matches-v3 table#players.mlist {
    min-width: 940px !important;
    font-size: 12.5px;
  }
  .tournament-matches-v3 table#players.mlist thead th,
  .tournament-matches-v3 table#players.mlist tbody td {
    padding: 9px 10px;
  }
  .tournament-matches-v3 .mcard {
    padding: 10px 12px;
  }
  .tournament-matches-v3 .mcard .pl a {
    font-size: 13.5px;
  }
  .tournament-matches-v3 .score b {
    font-size: 19px;
  }
  .tournament-matches-v3 .mcard__foot .judge {
    margin-left: 0;
    width: 100%;
  }
  .tournament-matches-v3 .mt-hint-box {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ── Уважаем настройки анимаций ── */
@media (prefers-reduced-motion: reduce) {
  .tournament-matches-v3 .live-dot,
  .tournament-matches-v3 .badge.live::before {
    animation: none !important;
  }
  .tournament-matches-v3 .mcard,
  .tournament-matches-v3 .chip-filter,
  .tournament-matches-v3 .seg-btn {
    transition: none !important;
  }
  .tournament-matches-v3 .mcard:hover {
    transform: none;
  }
}

/* Mobile/tablet audit 2026-11-27: cards first, compact optional table. */
@media(max-width:900px) {
  .tournament-matches-v3 .stat .hint { font-size: 12px; line-height: 1.3; }
  .tournament-matches-v3 table#players.mlist { min-width: 820px !important; }
  .tournament-matches-v3 table#players.mlist :is(th,td) { padding: 7px 8px !important; }
  .tournament-matches-v3 .mcard .pl { min-width:0; }
  .tournament-matches-v3 .mcard .pl a { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
  .tournament-matches-v3 .mcard__foot, .tournament-matches-v3 .mcard-foot { flex-wrap:wrap; }
}
