/* === Matchcenter (бывш. fixtures slider) === */
.matchcenter {
  background: #f7f3ee;
  padding: 2px;
  margin-bottom: 20px;
  position: relative; /* для точек */
  display: grid;
  grid-template-columns: 1fr; /* по умолчанию без боковых колонок */
  align-items: stretch;
  gap: 2px;

  /* Цвета стрелок через CSS-переменные */
  --mc-arrow-color-enabled: rgb(110, 115, 120);
  --mc-arrow-color-disabled: rgb(190, 195, 200);
}

/* (опционально) Включить боковые стрелки-колонки, если решите вернуть */
.matchcenter--with-arrows {
  grid-template-columns: 3% 1fr 3%;
}
.matchcenter--with-arrows .matchcenter__arrow--prev {
  grid-column: 1;
}
.matchcenter--with-arrows .matchcenter__track {
  grid-column: 2;
}
.matchcenter--with-arrows .matchcenter__arrow--next {
  grid-column: 3;
}

/* Стрелки (общий вид) */
.matchcenter__arrow {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  min-width: 24px;
}
.matchcenter__arrow::before {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-47deg);
  border-top: 2px solid var(--mc-arrow-color-enabled);
  border-left: 2px solid var(--mc-arrow-color-enabled);
}
.matchcenter__arrow--next::before {
  transform: translate(-50%, -50%) rotate(133deg);
}
.matchcenter__arrow[disabled] {
  cursor: default;
  opacity: 0.6;
}
.matchcenter__arrow[disabled]::before {
  border-top-color: var(--mc-arrow-color-disabled);
  border-left-color: var(--mc-arrow-color-disabled);
}

/* Точки-пагинации — БАЗОВЫЕ СТИЛИ (работают и на мобилке, и на 600–1199) */
.matchcenter__dots {
  position: static; /* было absolute */
  display: none; /* включаем в нужных брейкпоинтах */
  justify-content: center;
  gap: 6px;
  margin: 0 0 8px; /* отступ от заголовка вниз */
}
.matchcenter__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bbb;
  border: 0;
  padding: 0;
}
.matchcenter__dot[aria-current='true'] {
  background: #000;
}

/* Трек (в режимах слайдера он flex; на ≥1200 — grid) */
.matchcenter__track {
  display: flex;
  gap: 12px;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-gutter: stable both-edges;
}

/* Карточка */
.matchcenter__card {
  box-sizing: border-box;
  flex: 0 0 calc((100% - 3 * 12px) / 4); /* актуально только вне «слайдов» */
  scroll-snap-align: start;
  padding: 10px;
  background: #fff;
  position: relative;
  box-shadow: -8px 8px 15px rgba(0, 0, 0, 0.1);
}

.live-item {
  color: #e90a0a;
  font-size: 12px;
  position: absolute;
  bottom: 10px;
  right: 15px;
  animation: pulse 1.5s infinite ease-in-out;
  font-weight: 700;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.matchcenter__card--active {
  background-color: #eaf1ff;
}

.matchcenter__link {
  color: inherit;
  text-decoration: none;
  display: block;
}

/* Верхняя строка: Команда1 — Счёт — Команда2 */
.matchcenter__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.matchcenter__team {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.matchcenter__team--home {
  justify-content: flex-start;
}
.matchcenter__team--away {
  justify-content: flex-end;
}

.matchcenter__logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.matchcenter__name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  color: black;
}
.matchcenter__score {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.matchcenter__live {
  color: #c40000;
  font-weight: 700;
  font-size: 11px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Нижняя строка: статус/дата */
.matchcenter__meta {
  display: flex;
  align-items: center;
  justify-content: center;
}
.matchcenter__status {
  font-size: 12px;
  color: #666;
}

/* Вспомогательный класс */
.is-pending-score {
  opacity: 0.5;
}

/* (Опционально) Ссылка на команду */
.team-link {
  text-decoration: none;
  color: black;
}

/* ===================== МОБИЛЬНЫЙ (<600px) — слайдер 2×1 ===================== */
@media (max-width: 599.98px) {
  .matchcenter {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .matchcenter__arrow {
    display: none !important;
  }
  .matchcenter__dots {
    display: flex;
  } /* точки видимы */

  .matchcenter__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .matchcenter__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr)); /* 1 в ширину */
    grid-template-rows: repeat(2, auto); /* 2 ряда */
    grid-auto-flow: row; /* заполняем по строкам */
    gap: 8px;
  }

  .matchcenter__card {
    flex: initial;
    padding: 8px;
    border-radius: 10px;
  }
  .matchcenter__row {
    gap: 8px;
  }
  .matchcenter__logo {
    width: 18px;
    height: 18px;
  }
  .matchcenter__name {
    font-size: 13px;
    max-width: 100%;
  }
  .matchcenter__score {
    font-size: 16px;
  }
  .matchcenter__status {
    font-size: 12px;
  }
}

/* ===================== ПЛАНШЕТНЫЕ СЛАЙДЕРЫ (600–1199) — 2×N ===================== */
@media (min-width: 600px) and (max-width: 1199.98px) {
  .matchcenter__arrow {
    display: none !important;
  } /* свайп/скролл */
  .matchcenter__dots {
    display: flex;
  } /* точки видимы */

  .matchcenter__track {
    display: flex; /* слайдер */
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .matchcenter__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    /* колонки JS установит: repeat(4|3|2, 1fr) или меньше для последнего слайда */
    grid-template-rows: repeat(2, auto); /* 2 ряда */
    grid-auto-flow: row; /* заполняем по строкам: сначала весь верхний ряд, затем нижний */
    gap: 12px;
  }

  .matchcenter__card {
    flex: initial;
  } /* карточка — грид-элемент внутри слайда */
}

/* ===================== ДЕСКТОП (≥1200) — сетка 5×2 ===================== */
@media (min-width: 1200px) {
  .matchcenter__arrow {
    display: none !important;
  }
  .matchcenter__dots {
    display: none !important;
  }

  .matchcenter__track {
    display: grid;
    overflow: visible;
    scroll-snap-type: none;
    gap: 12px;
    grid-auto-rows: 1fr;
    grid-template-columns: repeat(5, 1fr);
  }
  .matchcenter__card {
    flex: initial;
    width: 100%;
    height: 100%;
  }
}

/* Заголовок тура над треком */
.matchcenter__title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  grid-row: 1;
  color: gray;
}

/* Явно фиксируем порядок строк сетки для детей */
.matchcenter__track {
  grid-row: 3;
}
.matchcenter__dots {
  grid-row: 2;
}
