/**
 * АБЛ — Абаканская Баскетбольная Лига
 * Палитра: красный, оранжево-жёлтый, белый (по логотипу)
 */

:root {
    --abl-red:           #c41e3a;
    --abl-red-dark:      #9e1830;
    --abl-orange:        #e85d04;
    --abl-orange-light:  #f48c06;
    --abl-yellow:        #ffba08;
    --abl-gold:          #c9a227;
    --abl-white:         #fff;
    --abl-gray-bg:       #f5f5f5;
    --abl-gray-text:     #333;
    --abl-gray-muted:    #666;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--abl-gray-text);
    background: var(--abl-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ----- Donate / Поддержать ----- */
.donate-section {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 0;
}
.donate-section__title {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    color: var(--abl-gray-text);
}
.donate-section__intro {
    margin: 0 0 1.5rem;
    color: var(--abl-gray-muted);
    line-height: 1.6;
}
.donate-card {
    background: var(--abl-gray-bg);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.donate-card__hint {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--abl-gray-muted);
}
.donate-card__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.donate-card__row:last-of-type {
    margin-bottom: 0;
}
.donate-card__label {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--abl-gray-text);
    min-width: 110px;
}
.donate-card__value {
    flex: 1 1 auto;
    font-family: ui-monospace, monospace;
    font-size: 1rem;
}
.donate-card__value_number {
    letter-spacing: 0.05em;
}
.donate-card__copy {
    flex-shrink: 0;
}
.donate-card__comment {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: var(--abl-gray-muted);
}
.donate-section__note {
    margin: 0;
    color: var(--abl-gray-muted);
}
.donate-section__placeholder {
    padding: 1.5rem;
    background: var(--abl-gray-bg);
    border-radius: 8px;
    color: var(--abl-gray-muted);
}
.donate-card_qr .donate-card__qr-wrap {
    text-align: center;
    margin: 1rem 0;
}
.donate-card__qr {
    display: inline-block;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    background: var(--abl-white);
    padding: 0.5rem;
}
.donate-card__contract {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--abl-gray-text);
    font-weight: 500;
}
.donate-card__qr-instruction {
    margin: 0;
    font-size: 0.9rem;
    color: var(--abl-gray-muted);
}
.donate-card_qr .donate-card__comment {
    margin-top: 1rem;
}

/* ----- Header ----- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--abl-white);
    border-bottom: 3px solid var(--abl-orange);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header__top {
    padding: 0.75rem 0;
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    color: var(--abl-white);
}

.header__container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header__logo {
    display: block;
    flex-shrink: 0;
}

.header__logo img,
.header__logo-img {
    display: block;
    height: 56px;
    width: auto;
}

.header__title {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

.header__auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header__auth-link {
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
}

.header__auth-link:hover {
    text-decoration: underline;
}

.header__auth-link_btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

/* Модальное окно входа */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[aria-hidden="true"],
.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal__box {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 1.5rem;
    background: var(--abl-white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: var(--abl-gray-text);
}

.modal__title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.modal__error {
    margin-bottom: 0.75rem;
}

.modal__form .form-row:last-of-type {
    margin-bottom: 0;
}

.modal__register {
    margin: 1rem 0 0;
    font-size: 0.9rem;
}

.modal__register a {
    color: var(--abl-red);
    text-decoration: none;
}

.modal__register a:hover {
    text-decoration: underline;
}

.modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--abl-gray-muted);
    cursor: pointer;
}

.modal__close:hover {
    color: var(--abl-gray-text);
}

/* Круг с инициалами и выпадающее меню пользователя */
.header__user {
    position: relative;
    flex-shrink: 0;
}

.header__user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.header__user-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.header__user-avatar {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
}

.header__user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    background: var(--abl-white);
    color: var(--abl-gray-text);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 100;
}

.header__user:hover .header__user-dropdown,
.header__user.header__user_open .header__user-dropdown {
    pointer-events: auto;
}

.header__user:hover .header__user-dropdown,
.header__user.header__user_open .header__user-dropdown {
    opacity: 1;
    visibility: visible;
}

.header__user-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.header__user-dropdown a:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Формы входа/регистрации/кабинета */
.auth-form .form-row {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    padding: 0.5rem;
    min-width: 220px;
    font-size: 1.05rem;
}

.form-message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

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

.form-message_success {
    background: #d4edda;
    color: #155724;
}

.verified {
    color: #155724;
}

.header__site-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Сокращённое наименование только в мобильной версии */
.header__site-short {
    display: none;
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.header__burger {
    display: none;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.header__burger-bar {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

/* Tournament tabs (активные турниры + Архив) + выпадающий сезон справа */
.header__tournaments {
    padding: 0.5rem 0;
    background: var(--abl-gray-bg);
}

.header__tournaments-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.header__season-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__season-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--abl-gray-text);
}

.header__season-select {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: inherit;
    font-weight: 600;
    color: var(--abl-gray-text);
    background: var(--abl-white);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.header__season-select:hover {
    border-color: var(--abl-orange);
}

.tournament-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tournament-tabs__item {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-weight: 600;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.tournament-tabs__item:hover {
    background: var(--abl-white);
    color: var(--abl-red);
}

.tournament-tabs__item_active {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.tournament-tabs__item_active:hover {
    background: var(--abl-orange-light);
    color: var(--abl-white);
}

.tournament-tabs__archive {
    position: relative;
}

.tournament-tabs__archive-btn {
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: inherit;
    color: var(--abl-gray-text);
    background: var(--abl-white);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.tournament-tabs__archive-btn:hover {
    color: var(--abl-red);
    border-color: var(--abl-orange);
}

.tournament-tabs__archive-list {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0;
    min-width: 220px;
    background: var(--abl-white);
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    z-index: 10;
}

.tournament-tabs__archive-list a {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.tournament-tabs__archive-list a:hover {
    background: var(--abl-gray-bg);
    color: var(--abl-red);
}

/* League tabs (режим без турниров) */
.header__leagues {
    padding: 0.5rem 0;
    background: var(--abl-gray-bg);
}

.league-tabs {
    display: flex;
    gap: 0.5rem;
}

.league-tabs__item {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-weight: 600;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.league-tabs__item:hover {
    background: var(--abl-white);
    color: var(--abl-red);
}

.league-tabs__item_active {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.league-tabs__item_active:hover {
    background: var(--abl-orange-light);
    color: var(--abl-white);
}

/* Main nav */
.header__nav {
    padding: 0.5rem 0;
}

.nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav__link {
    color: var(--abl-gray-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav__link:hover {
    color: var(--abl-red);
    border-bottom-color: var(--abl-orange);
}

.nav__link_active {
    color: var(--abl-red);
    border-bottom-color: var(--abl-red);
    font-weight: 600;
}

/* Сезон в гамбургере — показывать только в drawer на мобильных */
.header__drawer-season {
    display: none;
}

@media (min-width: 768px) {
    .header__bottom {
        display: block;
    }
}

/* Мобильная шапка: турниры всегда на экране, в гамбургере — сезон + меню */
@media (max-width: 767px) {
    .header__burger {
        display: flex;
    }

    .header__site-name {
        display: none;
    }

    .header__site-short {
        display: block;
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
    }

    .header__logo img,
    .header__logo-img {
        height: 44px;
    }

    /* Сезон в ряду турниров на мобильных скрыт — он в гамбургере */
    .header__season-wrap_desktop {
        display: none !important;
    }

    /* В drawer показываем сезон + нав */
    .header__drawer-season {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
        background: var(--abl-gray-bg);
    }

    .header__bottom {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--abl-white);
        border-bottom: 2px solid var(--abl-orange);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
    }

    .header__bottom_open {
        display: block;
    }

    .header__tournaments .container,
    .header__leagues .container {
        padding: 0.5rem 1rem;
    }

    .header__nav .container {
        padding: 0.75rem 1rem;
    }

    .header__nav .nav__list {
        flex-direction: column;
        gap: 0;
    }

    .header__nav .nav__link {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #eee;
    }
}

@media (min-width: 768px) {
    .header__bottom {
        display: block;
    }
}

/* ----- Main ----- */
.main {
    min-height: 50vh;
    padding: 2rem 0;
}

.main .container {
    padding: 0 1rem;
}

.page-title {
    margin: 0 0 1.5rem;
    font-size: 1.75rem;
    color: var(--abl-gray-text);
}

.home-section {
    margin-bottom: 2.5rem;
}

.news__heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--abl-gray-text);
}

.news__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .news__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .news__list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.news__item {
    margin-bottom: 0;
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--abl-gray-bg);
    border-radius: 8px;
    border-left: 4px solid var(--abl-orange);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card_link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.news-card_link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.news-card_link:hover .news-card__title-text {
    color: var(--abl-orange);
}

.news-card__thumb {
    width: 100%;
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
}

.news-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.news-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1rem 1.25rem;
}

.news-card__image {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

.news-card__image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    object-position: left center;
}

.news-card_full {
    padding: 1.25rem 1.5rem;
}

.news-card_full .news-card__image {
    margin: -1.25rem -1.5rem 1rem -1.5rem;
    border-radius: 8px 8px 0 0;
}

.news-card__header {
    margin-bottom: 0.5rem;
}

.news-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--abl-gray-text);
}

.news-card__title-text {
    transition: color 0.2s ease;
}

.news-card__meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--abl-gray-muted);
}

.news-card__views {
    white-space: nowrap;
}

.news-card__preview {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--abl-gray-text);
    margin: 0;
    flex-grow: 1;
}

.news-back {
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.news-back:link,
.news-back:visited {
    color: var(--abl-gray-muted);
}

.news-back:hover {
    color: var(--abl-red);
}

.news-card__body {
    font-size: 0.95rem;
    line-height: 1.6;
}

.news-card__title_full {
    font-size: 1.5rem;
}

.placeholder-block {
    background: var(--abl-gray-bg);
    border: 1px dashed var(--abl-orange);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--abl-gray-muted);
}

.media-section {
    display: grid;
    gap: 1rem;
}

@media (min-width: 1100px) {
    .media-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.media-card {
    background: var(--abl-white);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
}

.media-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.media-card__meta {
    margin: 0 0 1rem;
    color: var(--abl-gray-muted);
    font-size: 0.95rem;
}

.media-card__video {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

.media-card__video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ----- Команды (по образцу РФБ: сетка карточек, название + город) ----- */
.teams-empty {
    color: var(--abl-gray-muted);
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 600px) {
    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .team-card__link {
        padding: 0.75rem 0.5rem;
    }
    .team-card__logo {
        min-height: 48px;
    }
    .team-card__logo img {
        width: 48px;
        height: 48px;
    }
    .team-card__name {
        font-size: 0.9rem;
    }
    .team-card__city {
        font-size: 0.75rem;
    }
}

.team-card__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background: var(--abl-white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--abl-gray-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.team-card__link:hover {
    border-color: var(--abl-orange);
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.15);
}

.team-card__logo {
    display: block;
    margin-bottom: 0.5rem;
    min-height: 64px;
}

.team-card__logo img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.team-card__logo-placeholder {
    opacity: 0.85;
}

.team-card__name {
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
}

.team-card__city {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--abl-gray-muted);
    text-align: center;
}

.team-card_favorite .team-card__link {
    border-color: var(--abl-gold);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.3);
}

/* ----- Страница команды: хлебные крошки, шапка, переключатели, состав ----- */
.breadcrumb {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--abl-gray-muted);
}

.breadcrumb a {
    color: var(--abl-orange);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb__sep {
    margin: 0 0.35rem;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.team-header__logo img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.team-header__logo-placeholder {
    opacity: 0.85;
}

.team-header__logo_clickable {
    cursor: pointer;
}
.team-header__logo_clickable:hover {
    opacity: 0.9;
}

/* Полноэкранный просмотр логотипа по клику */
.team-logo-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}
.team-logo-overlay_is-open {
    display: flex;
}
.team-logo-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-logo-overlay__close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.team-logo-overlay__img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.team-header__name-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.team-header__name {
    margin: 0;
}

/* Кнопка избранного (звёздочка) */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--abl-gray-muted);
    transition: color 0.2s, transform 0.15s;
}

.favorite-btn:hover {
    color: var(--abl-gold);
}

.favorite-btn:focus {
    outline: 2px solid var(--abl-gold);
    outline-offset: 2px;
}

.favorite-btn_active {
    color: var(--abl-gold);
}

.favorite-btn_active .favorite-btn__icon {
    font-style: normal;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.team-header__city {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: var(--abl-gray-muted);
}

.team-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.team-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-toolbar__label {
    font-weight: 600;
    color: var(--abl-gray-muted);
    font-size: 0.9rem;
}

.team-toolbar__tabs {
    display: flex;
    gap: 0.25rem;
}

.team-toolbar__tab {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-radius: 4px;
    background: var(--abl-gray-bg);
    transition: background 0.2s, color 0.2s;
}

.team-toolbar__tab:hover {
    background: #e8e8e8;
    color: var(--abl-red);
}

.team-toolbar__tab_active {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.team-toolbar__tab_active:hover {
    color: var(--abl-white);
    background: var(--abl-orange-light);
}

.team-roster__title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.team-roster__empty {
    color: var(--abl-gray-muted);
}

/* Таблица состава */
.roster-table-wrap {
    overflow-x: auto;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.roster-table th,
.roster-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.roster-table th {
    font-weight: 600;
    color: var(--abl-gray-muted);
    background: var(--abl-gray-bg);
}

.roster-table__num {
    font-weight: 600;
    width: 2.5rem;
}

.roster-table__photo {
    width: 48px;
    background: #fff;
}

.roster-table__photo img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.roster-table__photo-placeholder {
    opacity: 0.8;
    object-fit: contain;
}

/* Карточки состава */
.roster-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.roster-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--abl-white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.roster-card__photo {
    margin-bottom: 0.5rem;
    background: #fff;
}

.roster-card__photo img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.roster-card__photo-placeholder {
    object-fit: contain;
    opacity: 0.85;
}

.roster-card__num {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--abl-orange);
}

.roster-card__name {
    margin-top: 0.25rem;
    font-weight: 600;
    font-size: 1rem;
}

.roster-card__position {
    margin-top: 0.15rem;
    font-size: 0.85rem;
    color: var(--abl-gray-muted);
}

.roster-card__phys {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--abl-gray-muted);
}

.roster-card_favorite {
    border-color: var(--abl-orange);
    background: rgba(232, 93, 4, 0.06);
}

.roster-card {
    position: relative;
}

.roster-card__fav {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.roster-row_favorite {
    background: rgba(232, 93, 4, 0.06);
}

.roster-row_favorite td {
    border-bottom-color: rgba(232, 93, 4, 0.15);
}

.roster-table__fav-th {
    width: 2.5rem;
    text-align: center;
}

.roster-table__fav {
    text-align: center;
    width: 2.5rem;
}

/* Кнопка открытия фото в карточке игрока */
.roster-card__photo .roster-photo-open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.roster-table__photo-btn {
    display: block;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.roster-table__photo-btn img {
    display: block;
}

/* Лайтбокс фото игрока: затемнённый фон + белая панель под фото */
.player-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
}

.player-photo-lightbox[hidden] {
    display: none;
}

.player-photo-lightbox__panel {
    background: #fff;
    padding: 1rem 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: calc(100vw - 8rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.player-photo-lightbox__panel img {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.player-photo-lightbox__caption {
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.player-photo-lightbox__num {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--abl-orange);
}

.player-photo-lightbox__name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--abl-gray-text);
}

.player-photo-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1.75rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-photo-lightbox__arrow:hover {
    background: #fff;
}

.player-photo-lightbox__arrow_prev {
    left: 1rem;
}

.player-photo-lightbox__arrow_next {
    right: 1rem;
}

.player-photo-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
}

.player-photo-lightbox__close:hover {
    background: #fff;
}

/* ----- Статистика команд (переключатель сезон + показатель, таблица) ----- */
.stat-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.stat-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.stat-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-toolbar__label {
    font-weight: 600;
    color: var(--abl-gray-muted);
    font-size: 0.9rem;
}

.stat-toolbar__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.stat-toolbar__tabs_stats {
    gap: 0.35rem;
}

.stat-toolbar__tab {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-radius: 4px;
    background: var(--abl-gray-bg);
    transition: background 0.2s, color 0.2s;
}

.stat-toolbar__tab:hover {
    background: #e8e8e8;
    color: var(--abl-red);
}

.stat-toolbar__tab_active {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.stat-toolbar__tab_active:hover {
    color: var(--abl-white);
    background: var(--abl-orange-light);
}

.stat-toolbar__select {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
}

.stat-toolbar__select:hover {
    border-color: var(--abl-orange);
}

.stat-toolbar__select:focus {
    outline: none;
    border-color: var(--abl-orange);
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

/* На мобильных панели с вкладками переносятся — увеличиваем вертикальный отступ между рядами */
@media (max-width: 600px) {
    .stat-toolbar,
    .match-toolbar {
        row-gap: 1rem;
    }
    .stat-toolbar__group,
    .match-toolbar .team-toolbar__group {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.stat-empty {
    color: var(--abl-gray-muted);
}

.stat-table-wrap {
    overflow-x: auto;
}

/* Статистика игроков: закреплённый заголовок таблицы */
.stat-table-wrap_sticky {
    overflow: auto;
    max-height: min(70vh, 520px);
}
.stat-table-wrap_sticky .stat-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--abl-gray-bg);
    border-bottom: 2px solid #e0e0e0;
}

.stat-table {
    width: 100%;
    max-width: 720px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.stat-table th,
.stat-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.stat-table th {
    font-weight: 600;
    color: var(--abl-gray-muted);
    background: var(--abl-gray-bg);
}

.stat-table__sort {
    color: var(--abl-gray-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-table__sort:hover {
    color: var(--abl-orange);
}

.stat-table__sort_active {
    color: var(--abl-gray-text);
    font-weight: 700;
}

.stat-table__sort_active::after {
    content: '▼';
    font-size: 0.65em;
}

.stat-table__col_active {
    font-weight: 700;
}

.stat-table__place {
    width: 2.5rem;
    font-weight: 600;
    color: var(--abl-gray-muted);
}

.stat-table__team {
    font-weight: 600;
}

.stat-table__player {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.stat-table__photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--abl-gray-muted, #666);
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.stat-table__photo-btn:hover {
    color: var(--abl-orange, #e85d04);
    background: rgba(0, 0, 0, 0.05);
}

.stat-table__photo-icon {
    display: block;
}

/* Лайтбокс фото на странице статистики игроков */
.player-stats-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
}

.player-stats-photo-lightbox[hidden] {
    display: none;
}

.player-stats-photo-lightbox__panel {
    background: #fff;
    padding: 1rem 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: calc(100vw - 8rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.player-stats-photo-lightbox__panel img {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.player-stats-photo-lightbox__caption {
    margin: 0.75rem 0 0;
    padding: 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--abl-gray-text, #333);
}

.player-stats-photo-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
}

.player-stats-photo-lightbox__close:hover {
    background: #fff;
}

.stat-table__value {
    font-weight: 400;
}

.stat-table__total td {
    font-weight: 600;
    background: var(--abl-gray-bg);
    border-top: 2px solid var(--abl-orange);
}

.stat-table__avg {
    color: var(--abl-gray-muted);
}

/* Таблица игр игрока: закреплённый заголовок и колонка «Матч» */
.player-page__games .stat-table-wrap {
    overflow: auto;
    max-height: min(70vh, 520px);
}
.player-page__games .stat-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--abl-gray-bg);
    border-bottom: 2px solid #e0e0e0;
}
.player-page__games .stat-table th.stat-table__pin,
.player-page__games .stat-table td.stat-table__pin {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 10rem;
    background: var(--abl-white);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}
.player-page__games .stat-table thead th.stat-table__pin {
    z-index: 3;
    background: var(--abl-gray-bg);
}
.player-page__games .stat-table tbody td.stat-table__pin {
    background: var(--abl-white);
}
.player-page__games .stat-table tfoot td.stat-table__pin {
    background: var(--abl-gray-bg);
    border-top: 2px solid var(--abl-orange);
}

/* Колонка Дата — тот же размер шрифта, что у Матч */
.player-page__games .stat-table th.stat-table__date,
.player-page__games .stat-table td.stat-table__date {
    font-size: 0.85rem;
}
@media (max-width: 600px) {
    .player-page__games .stat-table th.stat-table__pin,
    .player-page__games .stat-table td.stat-table__pin {
        min-width: 0;
        font-size: 0.8rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .player-page__games .stat-table th.stat-table__date,
    .player-page__games .stat-table td.stat-table__date {
        font-size: 0.8rem;
    }
}

/* ----- Положение команд (таблица участников) ----- */
.standings-table-wrap {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    max-width: 720px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.standings-table th,
.standings-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.standings-table th {
    font-weight: 600;
    color: var(--abl-gray-muted);
    background: var(--abl-gray-bg);
}

.standings-table__place {
    width: 2.5rem;
    font-weight: 600;
    color: var(--abl-gray-muted);
}

.standings-table__team {
    font-weight: 600;
}

.standings-table__team a {
    color: inherit;
    text-decoration: none;
}

.standings-table__team a:hover {
    text-decoration: underline;
}

/* Колонки № и Название — как в шахматке (0.85rem) */
.standings-table th.standings-table__th-place,
.standings-table th.standings-table__th-team,
.standings-table td.standings-table__td-place,
.standings-table td.standings-table__td-team {
    font-size: 0.85rem;
}

.standings-table__points {
    font-weight: 600;
}

.standings-table__pct {
    color: var(--abl-gray-muted);
    font-weight: 400;
    font-size: 0.9em;
}

.standings-table__zp {
    white-space: nowrap;
}

.standings-table__diff {
    color: var(--abl-gray-muted);
    font-size: 0.9em;
}

.standings-table__avg {
    display: block;
    color: var(--abl-gray-muted);
    font-size: 0.85em;
}

/* Sticky турнирная таблица */
.standings-table-wrap_sticky {
    overflow: auto;
    max-height: 80vh;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.standings-table_sticky {
    border-collapse: separate;
    border-spacing: 0;
}

.standings-table_sticky th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f5f5f5;
}

.standings-table_sticky .standings-table__th-place {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f5f5f5;
}

.standings-table_sticky .standings-table__th-team {
    position: sticky;
    left: 2.5rem;
    z-index: 3;
    background: #f5f5f5;
}

.standings-table_sticky .standings-table__td-place {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f5f5f5;
}

.standings-table_sticky .standings-table__td-team {
    position: sticky;
    left: 2.5rem;
    z-index: 1;
    background: #f5f5f5;
}

/* ----- Игры: список ----- */
.matches-empty {
    color: var(--abl-gray-muted);
}

.match-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.matches-list__title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.matches-list__count {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--abl-gray, #666);
}

.matches-list__show-more {
    margin: 1.25rem 0 0;
}

.match-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.match-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e8e8e8;
    background: var(--abl-white);
}

.match-row:last-child {
    border-bottom: none;
}

@media (min-width: 720px) {
    .match-row {
        grid-template-columns: 140px minmax(0, 1fr) auto;
        gap: 1rem;
    }
}

/* Дата и время всегда в одну строку (один текстовый блок — одинаково во всех браузерах) */
.match-row__datetime {
    font-size: 0.9rem;
}

.match-row__datetime-one {
    white-space: nowrap;
    font-weight: 600;
    color: var(--abl-gray-text);
}

.match-row__datetime-one .match-row__time {
    font-weight: normal;
}

.match-row__time {
    color: var(--abl-gray-muted);
    font-size: 0.85rem;
}

/* Широкий экран: 3 одинаковые ячейки (команда А | счёт | команда Б), всё по центру */
@media (min-width: 720px) {
    .match-row__teams {
        display: table;
        table-layout: fixed;
        width: 360px;
        margin-left: auto;
        margin-right: auto;
    }
    .match-row__team,
    .match-row__score,
    .match-row__vs {
        display: table-cell;
        vertical-align: middle;
        width: 33.33%;
        text-align: center;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    .match-row__team {
        overflow: hidden;
    }
    .match-row__team_away {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    .match-row__score,
    .match-row__vs {
        white-space: nowrap;
    }
    .match-row__team-name {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0.25rem auto 0;
        text-align: center;
    }
    .match-row__logo {
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Мобильная: счёт первым блоком, под логотипом — название по центру */
@media (max-width: 719px) {
    .match-row__teams {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.75rem;
        justify-content: space-between;
    }
    .match-row__score,
    .match-row__vs {
        flex-shrink: 0;
        font-size: 1.1rem;
    }
    .match-row__team {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1 1 0;
        min-width: 0;
    }
    .match-row__team-name {
        display: block;
        text-align: center;
        margin-top: 0.25rem;
        max-width: 100%;
        font-size: 0.85rem;
    }
}

.match-row__team-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-row__team-name:hover {
    text-decoration: underline;
}

.match-row__team_favorite {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--abl-orange);
    background: rgba(232, 93, 4, 0.08);
}

.match-row__logo {
    flex-shrink: 0;
}

.match-row__logo img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.match-row__logo-placeholder {
    opacity: 0.85;
}

.match-row__vs {
    font-weight: 700;
    color: var(--abl-gray-muted);
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

.match-row__score {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--abl-gray-text);
}

.match-row__score-main {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    white-space: nowrap;
}

.match-row__score-sep {
    color: var(--abl-gray-muted);
    font-weight: 600;
}

.match-row__action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.match-row__venue {
    color: var(--abl-gray-text);
    font-size: 0.9rem;
}

@media (max-width: 719px) {
    .match-row__action_venue {
        justify-content: center;
        width: 100%;
    }

    .match-row__venue {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        text-align: center;
    }
}

@media (min-width: 720px) {
    .match-row__venue {
        max-width: 18rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.match-row__action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    color: var(--abl-gray-text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.match-row__action-icon:hover {
    border-color: var(--abl-orange);
    background: #fff5ef;
    box-shadow: 0 0 0 1px rgba(232, 93, 4, 0.18);
}

.match-row__action-icon_disabled {
    opacity: 0.5;
    cursor: default;
}

.match-row__action-icon_disabled .match-row__action-icon-image {
    filter: grayscale(1);
}

.match-row__action-icon_empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

.match-row__action-icon_empty:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.match-row__action-icon-image {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    object-fit: contain;
}

.match-row__video-link {
    text-decoration: none;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn_primary {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.btn_primary:hover {
    background: var(--abl-orange-light);
    color: var(--abl-white);
}

.btn_secondary {
    background: var(--abl-gray-bg);
    color: var(--abl-gray-text);
}

.btn_secondary:hover {
    background: #e8e8e8;
    color: var(--abl-red);
}

.match-row__chronology-link_missing {
    color: #b8b8b8;
    cursor: default;
    pointer-events: none;
}

.match-row__chronology-link_missing:hover {
    color: #b8b8b8;
    background: var(--abl-gray-bg);
}

/* ----- Страница матча (Статистика матча) ----- */
.game-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.game-header__teams {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 1.5rem;
}

.game-header__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
}

.game-header__team-label {
    font-size: 0.8rem;
    color: var(--abl-gray-muted);
    font-weight: 600;
}

.game-header__team-name {
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

.game-header__logo img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.game-header__logo-placeholder {
    opacity: 0.85;
}

.game-header__score {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--abl-gray-text);
}

.game-header__score-sep {
    color: var(--abl-gray-muted);
    font-weight: 700;
}

.game-header__meta {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--abl-gray-muted);
}

.game-media {
    margin: 0 0 1.5rem;
}

.game-media__title {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
}

/* Фото статистики матча (превью + лайтбокс) */
.game-stats-image {
    margin-bottom: 2rem;
}

.game-stats-image__thumb {
    display: block;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--abl-gray-bg);
    max-width: 200px;
}

.game-stats-image__thumb:hover {
    border-color: var(--abl-orange);
    opacity: 0.95;
}

.game-stats-image__thumb img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.game-stats-image__lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
}

.game-stats-image__lightbox[hidden] {
    display: none;
}

.game-stats-image__lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}

.game-stats-image__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
}

.game-stats-image__close:hover {
    background: rgba(255,255,255,0.3);
}

.game-quarters__title,
.game-player-stats__title {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
}

.game-quarters__table-wrap,
.game-player-stats__table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.game-quarters__table {
    width: 100%;
    max-width: 400px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.game-quarters__table th,
.game-quarters__table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
}

.game-quarters__table th {
    font-weight: 600;
    color: var(--abl-gray-muted);
    background: var(--abl-gray-bg);
}

.game-quarters__team {
    text-align: left;
    font-weight: 600;
}

.game-quarters__total {
    font-weight: 700;
}

.game-player-stats__team-name {
    margin: 1rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.game-player-stats__table {
    margin-bottom: 1rem;
}

.game-player-stats__legend {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--abl-gray-muted);
    max-width: 720px;
}

/* ----- Footer ----- */
.footer {
    margin-top: auto;
    padding: 1.5rem 0;
    background: var(--abl-gray-text);
    color: var(--abl-white);
}

.footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
}

.footer__link {
    color: var(--abl-white);
    text-decoration: none;
    opacity: 0.9;
}

.footer__link:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer__link_active {
    opacity: 1;
    font-weight: 600;
    text-decoration: underline;
}

.footer__copy {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.85;
}

.footer__editor {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    opacity: 0.6;
}

.footer__editor-link {
    color: var(--abl-white);
    text-decoration: none;
}

.footer__editor-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.footer__donate {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
}

.footer__donate-link {
    color: var(--abl-white);
    text-decoration: none;
}

.footer__donate-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Кнопки Протокол / Лидеры матча под датой и местом (в одном стиле с team-toolbar / stat-toolbar) */
.game-header__tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 1rem;
}

.game-header__tab {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-radius: 4px;
    background: var(--abl-gray-bg);
    transition: background 0.2s, color 0.2s;
}

.game-header__tab:hover {
    background: #e8e8e8;
    color: var(--abl-red);
}

.game-header__tab_active {
    background: var(--abl-orange);
    color: var(--abl-white);
}

.game-header__tab_active:hover {
    color: var(--abl-white);
    background: var(--abl-orange-light);
}

/* Лидеры матча: вкладки категорий */
.game-leaders {
    margin-top: 1.5rem;
}

.game-leaders__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--abl-gray-border, #e0e0e0);
}

.game-leaders__tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--abl-gray-text);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.game-leaders__tab:hover {
    color: var(--abl-orange);
}

.game-leaders__tab_active {
    color: var(--abl-orange);
    border-bottom-color: var(--abl-orange);
    font-weight: 600;
}

/* Строка сравнения двух игроков */
.game-leaders__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-leaders__duel {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr) 72px;
    grid-template-rows: auto auto;
    gap: 0.4rem 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--abl-gray-border, #e0e0e0);
    border-radius: 10px;
    background: #fff;
}

.game-leaders__photo-slot {
    grid-row: 1 / span 2;
    width: 72px;
    height: 72px;
}

.game-leaders__photo-slot_home {
    grid-column: 1;
}

.game-leaders__photo-slot_away {
    grid-column: 4;
}

.game-leaders__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.game-leaders__meta_home {
    grid-column: 2;
    justify-content: flex-start;
}

.game-leaders__meta_away {
    grid-column: 3;
    justify-content: flex-end;
    text-align: right;
}

.game-leaders__num {
    font-weight: 600;
    color: var(--abl-gray-text);
    min-width: 1.5em;
}

.game-leaders__name {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-leaders__name_empty {
    color: var(--abl-gray-text);
}

.game-leaders__photo {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.game-leaders__photo-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
}

.game-leaders__photo-placeholder-img {
    object-fit: contain;
    opacity: 0.85;
}

.game-leaders__bar-wrap {
    grid-column: 2 / 4;
    grid-row: 2;
}

.game-leaders__bar {
    position: relative;
    display: flex;
    width: 100%;
    height: 1.3rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--abl-gray-bg, #f5f5f5);
}

.game-leaders__bar-seg {
    height: 100%;
    transition: width 0.3s ease;
}

.game-leaders__bar-seg_home {
    background: #243b97;
}

.game-leaders__bar-seg_away {
    background: #ff8a00;
}

.game-leaders__value-box {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    height: 1.1rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
    z-index: 1;
    flex-shrink: 0;
}

.game-leaders__value-box_home {
    left: 0.3rem;
    background: #243b97;
    color: #fff;
}

.game-leaders__value-box_away {
    right: 0.3rem;
    background: #ff8a00;
    color: #fff;
}

.game-leaders__empty {
    margin: 0;
    color: var(--abl-gray-text);
}

@media (max-width: 720px) {
    .game-leaders__duel {
        grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1fr) 50px;
        gap: 0.3rem 0.35rem;
        padding: 0.45rem 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .game-leaders__photo-slot {
        width: 50px;
        height: 50px;
    }

    .game-leaders__meta {
        gap: 0.25rem;
    }

    .game-leaders__name {
        font-size: 0.86rem;
    }
}

@media (max-width: 560px) {
    .game-leaders__duel {
        grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 42px;
        gap: 0.3rem 0.25rem;
        padding: 0.35rem 0;
    }

    .game-leaders__photo-slot {
        width: 42px;
        height: 42px;
    }

    .game-leaders__num {
        min-width: 1.05em;
        font-size: 0.78rem;
    }

    .game-leaders__name {
        font-size: 0.74rem;
    }

    .game-leaders__value-box {
        min-width: 1.8em;
        font-size: 0.72rem;
    }
}

/* ===== Страница игрока ===== */
.player-page {
    max-width: 900px;
}

.player-page__header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.player-page__photo img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-page__photo-placeholder {
    width: 150px;
    height: 150px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player-page__photo-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-page__info {
    flex: 1;
}

.player-page__name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.player-page__name-row .player-page__name {
    margin: 0;
}

.player-page__name {
    font-size: 1.75rem;
    margin: 0 0 0.75rem 0;
    color: var(--abl-gray-text);
}

.player-page__details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.player-page__detail {
    color: var(--abl-gray-muted);
    font-size: 0.95rem;
}

.player-page__tournaments {
    margin-bottom: 1.5rem;
}

.player-page__stats-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-page__stats h2,
.player-page__games h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: var(--abl-gray-text);
}

.player-page__stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.player-page__stat-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1rem 0.75rem;
    text-align: center;
}

.player-page__stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--abl-gray-text);
}

.player-page__stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--abl-gray-muted);
    margin-top: 0.25rem;
}

.player-page__games {
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .player-page__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .player-page__details {
        justify-content: center;
    }
    .player-page__stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Шахматка (Chess Table) ===== */
.standings-toolbar {
    margin-bottom: 1.5rem;
}

.chess-table-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: 80vh;
    border: 1px solid #ddd;
    border-radius: 6px;
    position: relative;
}

.chess-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    font-size: 0.85rem;
}

.chess-table th,
.chess-table td {
    border: 1px solid #ddd;
    padding: 0.4rem 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.chess-table__corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 3;
    background: #f5f5f5;
}

.chess-table__col-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    min-height: 100px;
    vertical-align: middle;
    text-align: center;
}

.chess-table__row-header {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f5f5f5;
    font-weight: 600;
    text-align: left;
    font-size: 0.8rem;
}

.chess-table__cell {
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.chess-table__cell_diagonal {
    background: #e0e0e0;
    cursor: default;
}

.chess-table__cell_empty {
    color: #bbb;
}

.chess-table__cell_highlight {
    background: #fff3cd !important;
}

.chess-table__header_highlight {
    background: #ffc107 !important;
    color: #000;
}

.chess-table__score-link {
    text-decoration: none;
    font-weight: 500;
}

.chess-table__score-link:hover {
    text-decoration: underline;
}

.chess-table__score_win {
    color: #1565c0;
}

.chess-table__score_loss {
    color: #c41e3a;
}

.chess-table__score_sep {
    color: #333;
}

.chess-table__cell_tech {
    background: #ffe0e6 !important;
}
