/* ─────────────────────────────────────────
   RFS — стили ячеек таблицы групп
───────────────────────────────────────── */
.rfs-cell-bold {
    font-weight: 700;
}

/* Колонка «Клуб»: лого + название в одну строку, gap 15px */
.rfs-cell-club {
    font-weight: 500;
}

.rfs-club {
    display: flex;
    align-items: center;
    gap: calc(15 * 100vw / 1920);
}

.rfs-club img {
    width: calc(40 * 100vw / 1920);
    height: calc(40 * 100vw / 1920);
    object-fit: contain;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .rfs-club {
        gap: 8px;
    }
    .rfs-club img {
        width: 22px;
        height: 22px;
    }
}

/* ─────────────────────────────────────────
   RFS — шапка с кнопками-переключателями
───────────────────────────────────────── */
.rfs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(40 * 100vw / 1920) 0 calc(37 * 100vw / 1920);
    background: #fff;
    position: relative;
    z-index: 2;
    padding-bottom: 0;
}

#rfs-tab-table,
#rfs-tab-playoff,
#regions-tab-rounds,
#regions-tab-playoff {
    background: #fff;
    margin: 0 calc(-40 * 100vw / 1920);
    padding: 0 calc(40 * 100vw / 1920) calc(40 * 100vw / 1920);
}

#rfs-tab-table .rfs-header,
#rfs-tab-playoff .rfs-header,
#regions-tab-rounds .rfs-header,
#regions-tab-playoff .rfs-header {
    margin: 0 calc(-40 * 100vw / 1920);
    padding-left: calc(80 * 100vw / 1920);
    padding-right: calc(80 * 100vw / 1920);
}

.rfs-header .rfs__title {
    margin-bottom: 0;
    padding: 0;
}

.rfs-header__buttons {
    position: static !important;
    top: auto !important;
    margin-right: 0 !important;
    display: flex;
}

.rfs-header__buttons .button {
    border: 2px solid #e80024;
    width: calc(240 * 100vw / 1920);
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfs-header__buttons .button .button__text {
    display: flex;
    align-items: center;
    
}

.rfs-header__buttons .button:first-child {
    margin-right: calc(20 * 100vw / 1920);
}

.rfs-header__buttons .button.is-active {
    color: #fff;
    background-color: #e80024;
}

@media (max-width: 1024px) {
    .rfs-header__buttons .button {
        width: calc(175 * 100vw / 1920);
        height: calc(28 * 100vw / 1920);
    }
    .rfs-header__buttons .button:first-child {
        margin-right: calc(5 * 100vw / 1920);
    }
    .rfs-header__buttons .button:last-child {
        width: calc(173 * 100vw / 1920);
    }
}

/* ─────────────────────────────────────────
   RFS — ближайшие матчи (новый дизайн)
───────────────────────────────────────── */
.rfs-upcoming-section {
    background: #fff;
    padding: 0 calc(80 * 100vw / 1920) calc(60 * 100vw / 1920);
    margin: 0 calc(-40 * 100vw / 1920);
}

.rfs-upcoming__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(30 * 100vw / 1920);
}

.rfs-upcoming__header .rfs__title {
    margin-bottom: 0;
}

.rfs-upcoming__arrows {
    display: flex;
    gap: calc(10 * 100vw / 1920);
}

.rfs-upcoming__arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.rfs-upcoming__arrow-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(65 * 100vw / 1920);
    height: calc(65 * 100vw / 1920);
    border: 2px solid #e80024;
    border-radius: 50%;
    background-color: #ededed;
}

.rfs-upcoming__arrow-icon {
    width: calc(35 * 100vw / 1920);
    height: calc(22 * 100vw / 1920);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfs-upcoming__arrow-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.rfs-upcoming__arrow-icon--next {
    transform: scaleX(-1);
}

@media (hover: hover) {
    .rfs-upcoming__arrow:hover .rfs-upcoming__arrow-wrapper {
        background-color: #fff;
    }
}

/* Scroll-контейнер */
.rfs-upcoming__scroll {
    display: flex;
    gap: calc(15 * 100vw / 1920);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rfs-upcoming__scroll::-webkit-scrollbar { display: none; }

/* ── Карточка матча — повторяет .table__item + .khl-table__header + .table__container ── */
.rfs-mcard {
    flex: 0 0 calc(280 * 100vw / 1920);
    border: 4px solid #000;
    border-radius: calc(40 * 100vw / 1920);
    overflow: hidden;
    background: #000;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.rfs-mcard__header {
    padding: calc(15 * 100vw / 1920) calc(24 * 100vw / 1920);
    font-weight: 900;
    font-size: calc(20 * 100vw / 1920);
    text-transform: uppercase;
    color: #fff;
    letter-spacing: .02em;
    line-height: 1.2;
}

.rfs-mcard__body {
    background: #fff;
    border-radius: calc(30 * 100vw / 1920) calc(30 * 100vw / 1920) 0 0;
    padding: calc(20 * 100vw / 1920) calc(24 * 100vw / 1920);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(10 * 100vw / 1920);
}

.rfs-mcard__date-row {
    display: flex;
    align-items: baseline;
    gap: calc(8 * 100vw / 1920);
}

.rfs-mcard__date {
    font-size: calc(42 * 100vw / 1920);
    font-weight: 700;
    color: #000;
    line-height: 1;
}

.rfs-mcard__time {
    font-size: calc(16 * 100vw / 1920);
    font-weight: 400;
    color: #000;
}

.rfs-mcard__teams {
    display: flex;
    flex-direction: column;
    gap: calc(6 * 100vw / 1920);
}

.rfs-mcard__team {
    display: flex;
    align-items: center;
    gap: calc(12 * 100vw / 1920);
}

.rfs-mcard__logo {
    width: calc(48 * 100vw / 1920);
    height: calc(48 * 100vw / 1920);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(12 * 100vw / 1920);
    font-weight: 700;
    color: #999;
}

.rfs-mcard__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rfs-mcard__team-info {
    display: flex;
    flex-direction: column;
    gap: calc(2 * 100vw / 1920);
}

.rfs-mcard__team-name {
    font-size: calc(20 * 100vw / 1920);
    font-weight: 500;
    color: #000;
    line-height: 1.2;
}

.rfs-mcard__city {
    font-size: calc(14 * 100vw / 1920);
    font-weight: 400;
    color: #999;
}

.rfs-mcard__sep {
    font-size: calc(18 * 100vw / 1920);
    color: #999;
}

@media (max-width: 1024px) {
    .rfs-header {
        padding: 24px 0 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 0;
    }
    #rfs-tab-table .rfs-header,
    #rfs-tab-playoff .rfs-header,
    #regions-tab-rounds .rfs-header,
    #regions-tab-playoff .rfs-header {
        margin: 0 calc(-10 * 100vw / 1920);
        padding-left: calc(10 * 100vw / 1920);
        padding-right: calc(10 * 100vw / 1920);
    }
    #rfs-tab-table,
    #rfs-tab-playoff,
    #regions-tab-rounds,
    #regions-tab-playoff {
        margin: 0 calc(-10 * 100vw / 1920);
        padding: 0 calc(10 * 100vw / 1920) 24px;
    }
    .rfs-upcoming-section {
        margin: 0 calc(-10 * 100vw / 1920);
        padding: 0 calc(10 * 100vw / 1920) 40px;
    }
    .rfs-upcoming__header { margin-bottom: 16px; }
    .rfs-upcoming__arrow-wrapper { width: 40px; height: 40px; }
    .rfs-upcoming__arrow-icon { width: 22px; height: 14px; }
    .rfs-upcoming__arrows { gap: 8px; }
    .rfs-upcoming__scroll { gap: 12px; }

    .rfs-mcard { flex: 0 0 200px; border-radius: 20px; border-width: 2px; }
    .rfs-mcard__header { font-size: 12px; padding: 10px 14px; }
    .rfs-mcard__body { border-radius: 16px 16px 0 0; padding: 12px 14px; gap: 6px; }
    .rfs-mcard__date { font-size: 28px; }
    .rfs-mcard__time { font-size: 11px; }
    .rfs-mcard__logo { width: 30px; height: 30px; font-size: 8px; }
    .rfs-mcard__team-name { font-size: 13px; }
    .rfs-mcard__city { font-size: 10px; }
    .rfs-mcard__teams { gap: 4px; }
    .rfs-mcard__sep { font-size: 13px;}
    .rfs-mcard__team { gap: 8px; }
}

/* ─────────────────────────────────────────
   RFS — групповые таблицы (KHL-стиль)
───────────────────────────────────────── */
.rfs-groups-section {
    padding-bottom: calc(20 * 100vw / 1920);
    padding-top: 0;
}

.rfs-groups-section .rfs__title {
    position: relative;
    z-index: 2;
    margin-bottom: calc(20 * 100vw / 1920);
}

.rfs-groups-grid {
    grid-template-columns: 1fr 1fr;
}

/* ─────────────────────────────────────────
   RFS — общая секция
───────────────────────────────────────── */
.rfs {
    padding: calc(40 * 100vw / 1920) 0 calc(60 * 100vw / 1920);
}

.rfs__title {
    font-size: calc(50 * 100vw / 1920);
    font-weight: 900;
    color: #e80024;
    text-transform: uppercase;
    margin-bottom: calc(30 * 100vw / 1920);
    line-height: 1.1;
}

.rfs__block {
    margin-bottom: calc(50 * 100vw / 1920);
}

/* ─────────────────────────────────────────
   Сетка групп (2 × 2)
───────────────────────────────────────── */
.rfs-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(20 * 100vw / 1920);
}

/* ─────────────────────────────────────────
   Карточка группы (чёрный блок)
───────────────────────────────────────── */
.rfs-group {
    background: #000;
    border-radius: calc(50 * 100vw / 1920);
    padding: calc(20 * 100vw / 1920);
}

.rfs-group__title {
    color: #fff;
    font-size: calc(24 * 100vw / 1920);
    font-weight: 700;
    text-transform: uppercase;
    padding: calc(6 * 100vw / 1920) calc(16 * 100vw / 1920) calc(14 * 100vw / 1920);
}

/* ─────────────────────────────────────────
   Белая внутренняя область
───────────────────────────────────────── */
.rfs-group__inner {
    background: #fff;
    border-radius: calc(46 * 100vw / 1920);
    overflow: hidden;
}

.rfs-group__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: calc(8 * 100vw / 1920) calc(24 * 100vw / 1920);
    color: #999;
    font-size: calc(14 * 100vw / 1920);
    border-bottom: 1px solid #f0f0f0;
}

.rfs-group__header span:last-child {
    text-align: right;
}

/* ─────────────────────────────────────────
   Строка матча
───────────────────────────────────────── */
.rfs-group__row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: calc(10 * 100vw / 1920) calc(24 * 100vw / 1920);
    border-bottom: 1px solid #f0f0f0;
}

.rfs-group__row:last-child {
    border-bottom: none;
}

.rfs-group__team {
    display: flex;
    align-items: center;
    gap: calc(10 * 100vw / 1920);
}

.rfs-group__team--right {
    justify-content: flex-end;
}

.rfs-group__logo {
    width: calc(32 * 100vw / 1920);
    height: calc(32 * 100vw / 1920);
    object-fit: contain;
    flex-shrink: 0;
}

.rfs-group__team-name {
    font-size: calc(20 * 100vw / 1920);
    font-weight: 700;
    color: #000;
    white-space: nowrap;
}

.rfs-group__score {
    font-size: calc(20 * 100vw / 1920);
    font-weight: 700;
    color: #e80024;
    padding: 0 calc(20 * 100vw / 1920);
    white-space: nowrap;
    text-align: center;
}


/* ─────────────────────────────────────────
   Mobile
───────────────────────────────────────── */
@media (max-width: 1024px) {
    .rfs__title {
        font-size: clamp(24px, 6vw, 40px);
        margin-bottom: 16px;
    }

    .rfs__block {
        margin-bottom: 32px;
    }

    .rfs-groups {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rfs-group {
        border-radius: 24px;
        padding: 12px;
    }

    .rfs-group__title {
        font-size: 16px;
        padding: 6px 12px 10px;
    }

    .rfs-group__inner {
        border-radius: 18px;
    }

    .rfs-group__header {
        font-size: 12px;
        padding: 6px 14px;
    }

    .rfs-group__row {
        padding: 8px 14px;
    }

    .rfs-group__team-name {
        font-size: 13px;
    }

    .rfs-group__score {
        font-size: 13px;
        padding: 0 10px;
    }

    .rfs-group__logo {
        width: 20px;
        height: 20px;
    }

    .rfs-group__team {
        gap: 6px;
    }

    .rfs-upcoming__scroll {
        gap: 12px;
    }

    .rfs-bracket {
        gap: 12px;
    }

    .rfs-bracket__match {
        border-radius: 16px;
        padding: 12px 14px;
    }

    .rfs-bracket__logo,
    .rfs-bracket__logo-placeholder {
        width: 36px;
        height: 36px;
        font-size: 9px;
    }

    .rfs-bracket__team-name { font-size: 12px; }

    .rfs-bracket__score { font-size: 24px; }

    .rfs-bracket__date { font-size: 13px; line-height: 13px; }

    .table__wrapper.rfs-groups-grid.is-active {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ─────────────────────────────────────────
   RFS — плей-офф сетка
───────────────────────────────────────── */
.rfs-playoff {
    padding-top: 0;
}

/* 3 колонки: 1/4, 1/2, финал */
.rfs-bracket {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: calc(30 * 100vw / 1920);
    padding: calc(60 * 100vw / 1920) 0;
    align-items: stretch;
}

.rfs-bracket__round {
    display: flex;
    flex-direction: column;
}

.rfs-bracket__round-title {
    font-size: calc(24 * 100vw / 1920);
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    margin-bottom: calc(24 * 100vw / 1920);
    text-align: center;
}

/* Матчи в колонке — растягиваются на всю высоту с выравниванием */
.rfs-bracket__matches {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: calc(16 * 100vw / 1920);
}

/* 1/4 — 4 матча: равномерно по высоте */
.rfs-bracket__round:nth-child(1) .rfs-bracket__matches {
    justify-content: space-between;
}

/* 1/2 — 2 матча: центрированы относительно пар из 1/4 */
.rfs-bracket__round:nth-child(2) .rfs-bracket__matches {
    justify-content: space-around;
}

/* Финал — по центру */
.rfs-bracket__round:nth-child(3) .rfs-bracket__matches {
    justify-content: center;
}

/* ── Карточка матча ─────────────────────── */
.rfs-bracket__match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: calc(16 * 100vw / 1920);
    border: calc(4 * 100vw / 1920) solid #000;
    border-radius: calc(32 * 100vw / 1920);
    padding: calc(20 * 100vw / 1920) calc(24 * 100vw / 1920);
}

.rfs-bracket__match--upcoming {
    border-color: #ccc;
}

.rfs-bracket__match--empty {
    border-color: #e0e0e0;
}

/* ── Команда: лого сверху, название снизу ─ */
.rfs-bracket__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(8 * 100vw / 1920);
}

.rfs-bracket__logo {
    width: calc(65 * 100vw / 1920);
    height: calc(65 * 100vw / 1920);
    object-fit: contain;
}

.rfs-bracket__logo-placeholder {
    width: calc(65 * 100vw / 1920);
    height: calc(65 * 100vw / 1920);
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(14 * 100vw / 1920);
    font-weight: 700;
    color: #666;
}

.rfs-bracket__logo-placeholder--unknown {
    font-size: calc(32 * 100vw / 1920);
    color: rgba(0,0,0,.2);
    background: transparent;
}

.rfs-bracket__team-name {
    font-size: calc(18 * 100vw / 1920);
    font-weight: 500;
    color: #000;
    text-align: center;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    max-width: calc(100 * 100vw / 1920);
}

.rfs-bracket__team-name--unknown {
    color: rgba(0,0,0,.2);
}

/* ── Счёт / Дата по центру ─────────────── */
.rfs-bracket__scores {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: calc(100 * 100vw / 1920);
}

.rfs-bracket__score {
    font-size: calc(42 * 100vw / 1920);
    font-weight: 700;
    color: #000;
    line-height: 1.1;
}

.rfs-bracket__date {
    display: block;
    font-family: "Cera Pro", sans-serif;
    font-size: calc(22 * 100vw / 1920);
    font-weight: 400;
    font-style: normal;
    color: #000;
    text-align: center;
    text-transform: uppercase;
    line-height: calc(22 * 100vw / 1920);
}

/* ── Mobile ─────────────────────────────── */
@media (max-width: 1024px) {
    .rfs-bracket {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px 0 40px;
    }

    .rfs-bracket__round-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .rfs-bracket__matches {
        gap: 10px;
        justify-content: flex-start !important;
    }

    .rfs-bracket__match {
        border-radius: 16px;
        padding: 12px 14px;
        gap: 10px;
        border-width: 2px;
    }

    .rfs-bracket__logo,
    .rfs-bracket__logo-placeholder {
        width: 36px;
        height: 36px;
    }

    .rfs-bracket__logo-placeholder--unknown {
        font-size: 20px;
    }

    .rfs-bracket__team-name { font-size: 11px; max-width: 70px; }
    .rfs-bracket__score { font-size: 26px; }
    .rfs-bracket__date { font-size: 13px; line-height: 13px; }
    .rfs-bracket__scores { min-width: 70px; }
}
