/* CSS переменные генерируются динамически через css/colors.php */
/* Блок :root удалён, чтобы не переопределять переменные из colors.php */

ul {
  padding: 0;
}

/* Base Styles */
.page {
  font-family: 'Montserrat', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  background-color: var(--light-gray);
}

body {
  background-color: var(--light-gray);
}

/* Dashboard */
.dashboard {

  min-height: 100vh;
}

/* Sidebar */
.dashboard__sidebar {
  box-sizing: border-box;
  width: 212px;
  background: var(--primary-black);
  color: var(--white);
  padding: 2rem 1rem;
  position: fixed;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.team-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.team-logo__image {
  max-height: 150px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.team-logo__name {
  display: block;
  width: 100%;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.player-profile {
  text-align: center;
  margin-bottom: 2rem;
}

.player-profile__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-red);
  margin: 0 auto 1rem;
}

.player-profile__name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.player-profile__position {
  color: var(--primary-red);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav {
  list-style: none;
  padding: 0;
  position: relative;
}

.nav__item {
  margin-bottom: 0.5rem;
}

.nav__link {
  display: flex;
  align-items: center;
  color: var(--white);
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav__link:hover, .nav__link--active {
  background-color: var(--primary-red);
  color: var(--white);
}

.nav__icon {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.sidebar-admin-link {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: left;
  padding-left: 1rem;
}

.sidebar-admin-link__icon {
  display: inline-block;
  font-size: 54px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  opacity: 0.5;
  transition: all 0.3s;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.sidebar-admin-link__icon:hover {
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.8);
}

/* SVG стрелки всегда белого цвета */
svg,
svg path,
svg polygon,
svg polyline,
svg line,
svg circle,
svg rect,
svg ellipse {
  fill: white !important;
  stroke: white !important;
  color: white !important;
}

/* Main Content */
.dashboard__main {
  padding-left: 220px;
  background-color: var(--light-gray);
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-black);
}

.user-actions {
  display: flex;
  gap: 1rem;
}

.user-actions__btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-black);
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.user-actions__btn:hover {
  color: var(--primary-red);
}

/* Dashboard Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-black);
}

.card__link {
  color: var(--primary-red);
  text-decoration: none;
  font-size: 0.9rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stats__item {
  text-align: center;
  padding: 1rem;
  background-color: var(--light-gray);
  border-radius: 6px;
}

.stats__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 0.3rem;
}

.stats__label {
  font-size: 0.9rem;
  color: var(--primary-black);
}

/* Matches */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.matches__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--light-gray);
  border-radius: 6px;
}

.matches__info {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 1rem;
}

.mTitle {
  margin: 10px 0;
  text-align: center;
}

.matches__date {
  min-width: 100px;
  font-weight: 600;

  color: var(--primary-black);
}



.matches__teams {
  display: flex;
  width: 100%;
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
}

.resContainer tr.row-highlight td,
.table-highlight tbody.resContainer td.col-highlight {
  
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.table-highlight tbody.resContainer td.res:hover,
.table-highlight tbody.resContainer td.self:hover {
  
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.table-highlight tbody.resContainer td.loss:hover,
.table-highlight tbody.resContainer td.win:hover {
  
  filter: brightness(95%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.table-highlight tbody.resContainer td.highlight {
  
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.73);
}

/* Убедитесь, что переходы работают */
.resContainer td {
  transition: background-color 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  word-break: normal;

  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.resContainer td:not(.win):not(.loss) {
  color: #555;
}

.resContainer td.self {
  background-color: rgba(230, 230, 230, 0.6);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.resContainer tr>.self {
  background-color: #2c3e50 !important;
  color: white;
}

.matches__vs {
  color: var(--primary-red);
  font-weight: 700;
}

.matches__result {
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
}

.matches__result--win {
  background-color: rgba(0, 200, 0, 0.1);
  color: green;
}

.matches__result--loss {
  background-color: rgba(200, 0, 0, 0.1);
  color: var(--primary-red);
}

/* Progress */
.progress-section {
  margin-top: 2rem;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.progress-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.progress-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.progress-card__bar {
  height: 8px;
  background-color: var(--light-gray);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.progress-card__fill {
  height: 100%;
  background-color: var(--primary-red);
  border-radius: 4px;
}

.progress-card__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--primary-black);
}

.table-container {
  margin-bottom: 20px;

  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background-color: var(--card-bg);
}

.page-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.btn-back {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 1rem;
}

.btn-back svg,
.btn-back svg path,
.btn-back svg polygon,
.btn-back svg polyline,
.btn-back svg line {
  fill: white !important;
  stroke: white !important;
  color: white !important;
}

.btn-back:hover {
  background: var(--dark-red);
}

.player-profile-detailed {
  max-width: 600px;
  margin: 0 auto;
}

.player-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  gap: 2rem;
}

.player-avatar-large {
  position: relative;
  width: 120px;
  height: 120px;
}

.player-photo-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primary-red);
}

.player-number-large {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--primary-red);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.player-name-large {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-black);
}

.player-position-large {
  font-size: 1.2rem;
  color: var(--primary-red);
  font-weight: 500;
}

.player-stats-detailed h3 {
  margin: 2rem 0 1rem 0;
  color: #333;
  border-bottom: 2px solid var(--primary-red);
  padding-bottom: 0.5rem;
}

.stats-grid-detailed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item-detailed {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-red);
}

.stat-value-detailed {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.stat-label-detailed {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-bar-detailed {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.stat-progress-detailed {
  height: 100%;
  background: var(--primary-red);
  transition: width 0.3s ease;
}

.personal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.info-label {
  font-weight: 500;
  color: #666;
}

.info-value {
  font-weight: bold;
  color: #333;
}

table {
  width: 100%;
  border-collapse: collapse;

}

th:first-child {
  border-radius: 6px 0px 0px 0px;
  border-left: none;


}

th:last-child {
  border-radius: 0 6px 0px 0;
  border-right: none;
}

th, td {
  padding: 12px 15px;
  text-align: center;

}

th {
  border-bottom: 1px solid var(--cell-collor);
  border-right: 1px solid var(--cell-collor);
  border-left: 1px solid var(--cell-collor);
}

td {
  border: 1px solid var(--cell-collor);
}

.table-teams th:first-child,
.table-teams td:first-child {
  border-left: 1px solid var(--cell-collor);
}

.table-teams th:last-child,
.table-teams td:last-child {
  border-right: 1px solid var(--cell-collor);
}

th {
  background-color: var(--primary-red);
  color: white;
  position: sticky;
  top: 0;
  font-weight: bold;
}

.th-team {
  text-align: left;
}

tr td:first-child {
  width: 20px;
}

/* tr:hover {
  background-color: #e9f7e9;
} */

td {
  cursor: pointer;
  word-break: break-all;
}

.table-teams th,
.table-teams td {
  word-break: normal;
  white-space: normal;
}

.team-cell {
  background-color: #ecf0f1;
  font-weight: 600;
}

.win {
  background-color: #d4edda;
  color: #155724;
  font-weight: 600;
}

.loss {
  background-color: #f8d7da;
  color: #721c24;
}

.empty {
  background-color: #f1f1f1;
}


.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  background: var(--card-bg);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  max-width: 600px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.win-legend {
  background-color: #d4edda;
}

.loss-legend {
  background-color: #f8d7da;
}

.self-legend {
  background-color: #2c3e50;
}

.team-name {
  min-width: max-content;
  text-align: left;
  font-weight: bold;
}

.team-name-teams {
  text-align: left;
  font-weight: bold;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Таблица статистики игроков */
.players-stats-section .table-container {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
}

.players-stats-section .table-container:active {
  cursor: grabbing;
}

.table-players-stats {
  width: max-content;
  border-collapse: collapse;
}

.table-players-stats thead tr:first-child th:first-child,
.table-players-stats tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--card-bg);
  min-width: auto;
  max-width: none;
  box-sizing: border-box;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  border-left: 1px solid var(--cell-collor);
  border-right: 1px solid var(--cell-collor);
}

.table-players-stats thead tr:first-child th:first-child::after,
.table-players-stats tbody td:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  background-color: var(--cell-collor);
  pointer-events: none;
}

.table-players-stats thead tr:first-child th:first-child::before,
.table-players-stats tbody td:first-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1px;
  bottom: 0;
  width: 1px;
  background-color: var(--cell-collor);
  pointer-events: none;
}

.table-players-stats th,
.table-players-stats td {
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.table-players-stats th {
  background-color: var(--primary-red);
  color: white;
  font-weight: bold;
  position: sticky;
  z-index: 10;
}

.table-players-stats th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.table-players-stats th.sortable:hover {
  /* background-color: rgba(255, 255, 255, 0.2); */
}

.table-players-stats thead tr:first-child th:first-child {
  background-color: var(--primary-red);
  color: white;
  z-index: 20;
}

.table-players-stats thead tr:first-child th {
  top: 0;
}

/* Толстая граница под второй строкой заголовков (Эйс, Выбито и т.д.) */
.table-players-stats thead tr:nth-child(2) th {
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

.table-players-stats .th-player-name {
  text-align: left;
}

.table-players-stats td {
  word-break: normal;
  white-space: normal;
}

.table-players-stats .player-name-cell {
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
}

.table-players-stats tbody tr.has-stats:hover {
  background-color: #f8f9fa;
}

.table-players-stats tbody tr.no-stats {
  opacity: 0.6;
  display: none;
}

.table-players-stats tbody tr.no-stats td {
  color: #999;
}

/* Визуальное разделение групп колонок (Подача, Прием, Блок, Атака, Защита, Пас) */
/* Границы секций в первой строке заголовков */
.table-players-stats thead tr:first-child .stats-group-header {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
  border-right: 2px solid rgba(0, 0, 0, 0.35);
}

/* Границы секций для таблицы без колонки "Игры" */
/* Подача - колонка 3 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(1),
.table-players-stats.no-games-column tbody td:nth-child(3) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Прием - колонка 9 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(7),
.table-players-stats.no-games-column tbody td:nth-child(9) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Блок - колонка 14 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(12),
.table-players-stats.no-games-column tbody td:nth-child(14) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Атака - колонка 20 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(18),
.table-players-stats.no-games-column tbody td:nth-child(20) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Защита - колонка 26 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(24),
.table-players-stats.no-games-column tbody td:nth-child(26) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Пас - колонка 31 */
.table-players-stats.no-games-column thead tr:nth-child(2) th:nth-child(29),
.table-players-stats.no-games-column tbody td:nth-child(31) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Границы секций для таблицы с колонкой "Игры" */
/* Подача - колонка 4 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(1),
.table-players-stats.has-games-column tbody td:nth-child(4) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Прием - колонка 10 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(7),
.table-players-stats.has-games-column tbody td:nth-child(10) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Блок - колонка 15 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(12),
.table-players-stats.has-games-column tbody td:nth-child(15) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Атака - колонка 21 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(18),
.table-players-stats.has-games-column tbody td:nth-child(21) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Защита - колонка 27 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(24),
.table-players-stats.has-games-column tbody td:nth-child(27) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Пас - колонка 32 */
.table-players-stats.has-games-column thead tr:nth-child(2) th:nth-child(29),
.table-players-stats.has-games-column tbody td:nth-child(32) {
  border-left: 2px solid rgba(0, 0, 0, 0.35);
}

/* Выделение всех колонок "Полезн." фиолетовым цветом */
/* Используем класс stat-useful вместо nth-child для надежности */
.table-players-stats tbody td.stat-useful,
.table-players-stats tbody td.stat-useful.stat-positive,
.table-players-stats tbody td.stat-useful.stat-neutral {
  background-color: rgba(155, 89, 182, 0.15) !important;
  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Обратная совместимость: старые правила nth-child (на случай, если класс не применился) */
/* Подача - Полезн. (колонка 8 без колонки "Игры", колонка 9 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(8),
.table-players-stats tbody td:nth-child(8).stat-positive,
.table-players-stats tbody td:nth-child(8).stat-neutral,
.table-players-stats tbody td:nth-child(9),
.table-players-stats tbody td:nth-child(9).stat-positive,
.table-players-stats tbody td:nth-child(9).stat-neutral {
 
  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Прием - Полезн. (колонка 13 без колонки "Игры", колонка 14 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(13),
.table-players-stats tbody td:nth-child(13).stat-positive,
.table-players-stats tbody td:nth-child(13).stat-neutral,
.table-players-stats tbody td:nth-child(14),
.table-players-stats tbody td:nth-child(14).stat-positive,
.table-players-stats tbody td:nth-child(14).stat-neutral {
 
  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Блок - Полезн. (колонка 19 без колонки "Игры", колонка 20 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(19),
.table-players-stats tbody td:nth-child(19).stat-positive,
.table-players-stats tbody td:nth-child(19).stat-neutral,
.table-players-stats tbody td:nth-child(20),
.table-players-stats tbody td:nth-child(20).stat-positive,
.table-players-stats tbody td:nth-child(20).stat-neutral {

  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Атака - Полезн. (колонка 25 без колонки "Игры", колонка 26 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(25),
.table-players-stats tbody td:nth-child(25).stat-positive,
.table-players-stats tbody td:nth-child(25).stat-neutral,
.table-players-stats tbody td:nth-child(26),
.table-players-stats tbody td:nth-child(26).stat-positive,
.table-players-stats tbody td:nth-child(26).stat-neutral {

  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Защита - Полезн. (колонка 30 без колонки "Игры", колонка 31 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(30),
.table-players-stats tbody td:nth-child(30).stat-positive,
.table-players-stats tbody td:nth-child(30).stat-neutral,
.table-players-stats tbody td:nth-child(31),
.table-players-stats tbody td:nth-child(31).stat-positive,
.table-players-stats tbody td:nth-child(31).stat-neutral {

  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Пас - Полезн. (колонка 35 без колонки "Игры", колонка 36 с колонкой "Игры") */
.table-players-stats tbody td:nth-child(35),
.table-players-stats tbody td:nth-child(35).stat-positive,
.table-players-stats tbody td:nth-child(35).stat-neutral,
.table-players-stats tbody td:nth-child(36),
.table-players-stats tbody td:nth-child(36).stat-positive,
.table-players-stats tbody td:nth-child(36).stat-neutral {

  font-weight: 600;
  color: rgba(142, 68, 173, 1);
}

/* Таблица статистики игроков */
.players-stats-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-black);
  margin-bottom: 2rem;
  text-align: center;
}

.players-stats-container {
  width: 100%;
}

/* Контейнер для диаграмм */
.charts-container {
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 0;
}

.charts-wrapper {
  width: 100%;
}

.charts-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-black);
  margin-bottom: 0.75rem;
  text-align: center;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-wrapper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-wrapper-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-header {
  width: 100%;
  text-align: center;
  margin-bottom: 0.5rem;
}

.chart-category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-black);
  margin: 0;
  padding: 0;
}

.chart-container {
  background: var(--white);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  min-height: 280px;
  height: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible; /* Позволяет видеть подписи, выходящие за границы */
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
  height: auto !important;
}

.chart-total-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(52, 152, 219, 0.08) 100%);
  border-radius: 8px;
  border: 2px solid rgba(52, 152, 219, 0.25);
  min-width: 100px;
  width: 100%;
  transition: all 0.2s ease;
}

.chart-total-info:hover {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.18) 0%, rgba(52, 152, 219, 0.12) 100%);
  border-color: rgba(52, 152, 219, 0.4);
}

.chart-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(52, 152, 219, 1);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(52, 152, 219, 1);
}

/* Games comparison (team stats) */
.games-comparison {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.games-comparison__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.games-comparison__hint {
  margin: 0;
  color: #5a5a5a;
  font-size: 0.95rem;
}

.games-comparison__checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.games-comparison__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f6f6f6;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.games-comparison__option input {
  accent-color: var(--primary-red);
  width: 14px;
  height: 14px;
}

.games-comparison__option:hover {
  border-color: rgba(0, 0, 0, 0.08);
  background: #fdfdfd;
}

.games-comparison__note,
.games-comparison__warning {
  margin: 0;
  font-size: 0.85rem;
  color: #8a8a8a;
}

.games-comparison__warning {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff4f4;
  border: 1px solid #ffd5d5;
  color: #a10000;
  font-weight: 600;
}

.games-comparison__table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  background: #fafafa;
}

.games-comparison__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.games-comparison__table th,
.games-comparison__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 0.95rem;
}

.games-comparison__table th {
  background: #f2f2f2;
  font-weight: 700;
}

.games-comparison__table tr:nth-child(odd) td {
  background: var(--card-bg);
}

.games-comparison__table tr:nth-child(even) td {
  background: #fafafa;
}

.games-comparison__table td:first-child {
  font-weight: 600;
  color: #333;
}

.games-comparison__table td {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .games-comparison__checkboxes {
    flex-direction: column;
  }

  .games-comparison__option {
    width: 100%;
    justify-content: flex-start;
  }

  .games-comparison__table {
    min-width: 420px;
  }
}

.games-comparison__charts-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.games-comparison__card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.games-comparison__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.games-comparison__card-title {
  font-weight: 700;
  color: #1f1f1f;
  font-size: 1rem;
}

.games-comparison__badge {
  background: rgba(52, 152, 219, 0.12);
  color: rgba(52, 152, 219, 1);
  border: 1px solid rgba(52, 152, 219, 0.25);
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.games-comparison__chart {
  width: 100%;
  height: 240px;
}

.games-comparison__subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.games-comparison__subgrid--by-game {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.games-comparison__subcard {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-width: 180px;
  flex: 0 0 auto;
}

.games-comparison__subcard-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #2d2d2d;
}

.games-comparison__chart--small {
  height: 160px;
  min-width: 180px;
}

.games-comparison__chart canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 768px) {
  .games-comparison__charts-grid {
    gap: 12px;
  }

  .games-comparison__card {
    padding: 12px;
  }

  .games-comparison__subgrid--by-game {
    gap: 10px;
    padding-bottom: 4px;
  }

  .games-comparison__subcard {
    min-width: 180px;
  }

  .games-comparison__chart--small {
    height: 160px;
    min-width: 180px;
  }

  .games-comparison__option {
    width: 100%;
  }
  .games-comparison__subgrid--by-game {
   display: grid;
   
}
}

@media (max-width: 520px) {
  .games-comparison__subcard {
    min-width: 150px;
  }

  .games-comparison__chart--small {
    height: 140px;
    min-width: 150px;
  }

  .games-comparison__badge {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .games-comparison__card-title {
    font-size: 0.95rem;
  }
}

.players-stats-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
  min-height: 220px;
  color: var(--primary-black);
}

.players-stats-loading__spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--primary-red);
  animation: playersStatsSpin 0.8s linear infinite;
}

.players-stats-loading__texts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}

.players-stats-loading__text {
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.8;
}

.players-stats-loading__text--primary {
  font-size: 1rem;
}

.players-stats-loading__text--secondary {
  font-weight: 500;
  opacity: 0.6;
}

@keyframes playersStatsSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.stats-tabs-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.stats-tab-btn {
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  border: 2px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.stats-tab-btn:hover {
  background: #f8f9fa;
  border-color: var(--primary-red);
  color: var(--primary-black);
}

.stats-tab-btn.active {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}



.players-loading-state,
.players-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--primary-black);
  text-align: center;
}

.players-error-state {
  color: #c0392b;
}

.team-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--primary-black);
  text-align: center;
  min-height: 200px;
}

.team-loading p {
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.8;
  margin: 0;
}

.loading-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--primary-red);
  animation: playersSpinner 0.8s linear infinite;
}

@keyframes playersSpinner {
  to {
    transform: rotate(360deg);
  }
}

.table-players-stats tbody tr:hover {
  background-color: #f8f9fa;
}

.table-players-stats td.stat-positive {
  color: #0c7a29;
  font-weight: 600;
  background-color: rgba(46, 204, 113, 0.12);
}

.table-players-stats td.stat-neutral {
  color: #b8860b;
  font-weight: 600;
  background-color: rgba(255, 193, 7, 0.12);
}

.table-players-stats td.stat-negative {
  color: #c0392b;
  font-weight: 600;
  background-color: rgba(231, 76, 60, 0.12);
}

.table-players-stats td.stat-total {
  color: #2c3e50 !important;
  font-weight: 700 !important;
  background-color: rgba(52, 152, 219, 0.15) !important;
  border-left: 2px solid rgba(52, 152, 219, 0.3) !important;
  border-right: 2px solid rgba(52, 152, 219, 0.3) !important;
}

.table-players-stats tr.totals-row {
  background-color: rgba(44, 62, 80, 0.08);
}

.table-players-stats tr.totals-row td {
  font-weight: 700;
  border-top: 2px solid var(--primary-red);
}

.table-players-stats tr.player-row {
  transition: background-color 0.2s ease;
}

.table-players-stats tr.player-row:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

.table-players-stats tr.player-row.selected {
  background-color: rgba(0, 123, 255, 0.15);
  box-shadow: inset 3px 0 0 #007bff;
}

.player-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 2fr));
  gap: 30px;
  justify-items: center;
}

.player-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  max-width: 380px;
  width: 100%;
  position: relative;
  backdrop-filter: blur(10px);
  cursor: pointer
}

.player-card > * {
  width: 100%;
  box-sizing: border-box;
}

.player-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.player-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.overview-item {
  background-color: rgba(0, 0, 0, 0.04);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-align: center;
}

.overview-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary-black);
  margin-bottom: 0.3rem;
}

.overview-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-black);
}

.video-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-section__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.video-section__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-black);
}

.video-section__subtitle {
  margin: 0;
  color: var(--secondary-black);
  font-size: 1rem;
}

.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, 350px);
  gap: 24px;
  justify-content: start;
}

.video-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 350px;
  max-width: 100%;
}

.video-card__media {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.video-card__media iframe,
.video-card__media video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  z-index: 1;
}

/* Скрываем background когда видео воспроизводится */
.video-card__media video:not([paused]) ~ *,
.video-card__media:has(video:not([paused])) {
  background-image: none !important;
}



/* Кастомный видео-плеер */
.video-card__media {
  cursor: pointer;
}

/* Для карточек внешних ссылок убираем 16:9 через padding-top */
.external-video-link-card .video-card__media {
  padding-top: 0;
}

.external-video-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.external-video-link-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.external-video-link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.external-video-link-card .video-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.22), transparent 38%),
    radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.14), transparent 35%),
    linear-gradient(135deg, var(--dark-red) 0%, var(--primary-black) 100%);
}

.external-video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--dark-red);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.external-video-inner {
  text-align: center;
  color: var(--white);
  padding: 10px 14px 8px;
}

.external-video-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), 0 10px 22px rgba(0, 0, 0, 0.22);
}

.external-video-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.external-video-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 8px;
}

.external-video-card-body {
  padding: 16px 18px 18px;
}

.external-video-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-red);
  font-size: 13px;
  font-weight: 600;
}

.video-player__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
  transition: opacity 0.3s ease, background 0.3s ease;
  pointer-events: none;
}

.video-player__loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 3;
}

.video-player__loader.active {
  opacity: 1;
}

.video-player__loader-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary-red);
  border-radius: 50%;
  animation: videoLoaderSpin 0.8s linear infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@keyframes videoLoaderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.video-player__overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-player__play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(209, 0, 0, 0.9);
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: all;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-player__play-btn:hover {
  background: var(--primary-red);
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(209, 0, 0, 0.5);
}

.video-player__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
  padding: 0.50rem 0.60rem;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-player__controls.active {
  opacity: 1;
  pointer-events: all;
}

.video-player__progress-container {
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.video-player__progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2.5px;
  position: relative;
  cursor: pointer;
}

.video-player__progress-filled {
  height: 100%;
  background: var(--primary-red);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
}

.video-player__progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--primary-red);
  border-radius: 50%;
  border: 2px solid white;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.video-player__progress-container:hover .video-player__progress-handle {
  opacity: 1;
}

.video-player__progress-handle:active {
  cursor: grabbing;
}

.video-player__controls-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.video-player__controls-left,
.video-player__controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.video-player__btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
  min-width: 32px;
  height: 32px;
}

.video-player__btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.video-player__volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.video-player__volume-slider {
  display: none;
  width: 72px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.video-player__volume-container:hover .video-player__volume-slider {
  display: block;
}

.video-player__volume-range {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
}

.video-player__volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--primary-red);
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-player__volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--primary-red);
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-player__time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.video-player__time-separator {
  opacity: 0.7;
}

.video-player__speed-container {
  position: relative;
}

.video-player__speed-btn {
  font-size: 0.9rem;
  font-weight: 600;
}

.video-player__speed-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 6px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 80px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.video-player__speed-menu.active {
  display: flex;
}

.video-player__speed-option {
  background: transparent;
  border: none;
  color: white;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.video-player__speed-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.video-player__speed-option.active {
  background: var(--primary-red);
  color: white;
}

/* Полноэкранный режим */
.video-card__media:fullscreen {
  background: #000;
  padding-top: 0;
}

.video-card__media:fullscreen video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-card__media:fullscreen .video-player__controls {
  position: fixed;
  bottom: 0;
}

.video-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-card__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-black);
}

.video-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-black);
}

.video-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.video-card__description {
  margin: 0;
  color: var(--secondary-black);
  line-height: 1.5;
}

.video-card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-red);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.video-card__link:hover {
  color: var(--dark-red);
}

.card-header {
  position: relative;
  background: linear-gradient(135deg, var(--primary-black), var(--primary-red));
  padding: 30px;
}

.card-header {
  position: relative;
  background: linear-gradient(135deg, var(--primary-black), var(--primary-red));
  padding: 40px 30px 30px 30px;
}

.games-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 153, 0, 0.85));
  color: var(--primary-black);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.05em;
  width: max-content;
}

.photo-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  border-radius: 50%;
  border: 5px solid white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.player-card:hover .photo-container {
  transform: scale(1.1);
}

.player-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: linear-gradient(45deg, rgba(255, 107, 107, 0.3), rgba(238, 90, 36, 0.3)); */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.player-card:hover .photo-overlay {
  opacity: 1;
}

.player-number {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.card-content {
  padding: 15px;

  text-align: center;
}

.player-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 8px;
  line-height: 1.3;
}

.player-position {
  color: #636e72;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  transition: background-color 0.3s ease;
}

.stat-item:hover {
  background: #e9ecef;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2d3436;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: #636e72;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.stat-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-red), var(--dark-red));
  border-radius: 3px;
  transition: width 1s ease-in-out;
}

.card-footer {
  padding: 0 30px 30px;
}

.btn-details {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-black));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-details:hover {
  background: linear-gradient(135deg, var(--dark-red), var(--primary-black));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(224, 102, 42, 0.4);
}

.matches-table {
  width: 100%;

  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.matches-table thead {
  background: linear-gradient(135deg, var(--primary-black), var(--secondary-black));
}

.matches-table th {
  padding: 16px 20px;
  text-align: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.matches-table tbody tr {
  border-bottom: 1px solid #ecf0f1;
  transition: all 0.3s ease;

}

.matches-table tbody tr:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.matches-table tbody tr:last-child {
  border-bottom: none;
}

.matches-table td {
  padding: 14px 20px;
  color: #2c3e50;
  font-size: 14px;
  border: none;
  word-break: normal;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.matches-table td:first-child {
  font-weight: 500;
  width: max-content;
  color: #e74c3c;
}

.matches-table td:nth-child(2) {
  font-weight: 600;
  color: #2c3e50;
}

.matches-table td:nth-child(3) {
  font-weight: 600;

}

.matches-table td:last-child {
  color: #7f8c8d;
  font-size: 13px;
}

.rasp-link {
  color: #2c3e50;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.rasp-link:hover {
  text-decoration: underline;
  color: #e74c3c;
}

.rasp-link:visited {
  color: #2c3e50;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* Центрирование содержимого */

  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  position: relative;
  /* Убираем margin: auto, так как теперь центрируем через flex */
  margin: 0;
}

.modal-content--charts {
  max-width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color, #ddd);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: var(--card-bg);
  z-index: 10;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text-color, #333);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #aaa;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

.modal-charts-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

#map {
  width: 100%;
  height: 400px;
  margin-top: 15px;
}

/* Анимация появления карточек */
@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.player-card {
  animation: cardAppear 0.6s ease forwards;
}



caption {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 15px;
  padding: 10px;
  color: #333;
  caption-side: top;
  text-align: center;
}

