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

:root {
    --abl-red:           #c41e3a;
    --abl-red-dark:      #9e1830;
    --abl-orange:        #e85d04;
    --abl-orange-light:  #f48c06;
    --abl-yellow:        #ffba08;
    --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;
}

/* ----- 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, var(--abl-red) 0%, var(--abl-red-dark) 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;
}

.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;
}

.news__item {
    margin-bottom: 1.5rem;
}

.news__item:last-child {
    margin-bottom: 0;
}

.news-card {
    background: var(--abl-gray-bg);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--abl-orange);
}

.news-card__image {
    margin: -1.25rem -1.5rem 1rem -1.5rem;
    border-radius: 8px 8px 0 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__header {
    margin-bottom: 0.75rem;
}

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

.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 0 0.5rem;
}

.news-card__read-more {
    margin: 0;
}

.news-card__read-link {
    font-size: 0.95rem;
    color: var(--abl-red);
    text-decoration: none;
}

.news-card__read-link:hover {
    text-decoration: underline;
}

.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;
}

.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);
}

/* ----- Команды (по образцу РФБ: сетка карточек, название + город) ----- */
.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;
}

.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;
}

/* ----- Страница команды: хлебные крошки, шапка, переключатели, состав ----- */
.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__name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.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__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-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1.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-empty {
    color: var(--abl-gray-muted);
}

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

.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__place {
    width: 2.5rem;
    font-weight: 600;
    color: var(--abl-gray-muted);
}

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

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

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

.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);
}

/* ----- Положение команд (таблица участников) ----- */
.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;
}

.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;
}

/* ----- Игры: список ----- */
.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: 640px) {
    .match-row {
        grid-template-columns: 140px 1fr auto;
        gap: 1rem;
    }
}

.match-row__datetime {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.9rem;
}

.match-row__date {
    font-weight: 600;
    color: var(--abl-gray-text);
}

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

.match-row__teams {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.match-row__team {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.match-row__team-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: inherit;
    text-decoration: none;
}
.match-row__team-name:hover {
    text-decoration: underline;
}

.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 {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0.5rem;
    color: var(--abl-gray-text);
}

.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__stats-thumb {
    display: block;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: var(--abl-gray-bg);
    flex-shrink: 0;
}

.match-row__stats-thumb:hover {
    border-color: var(--abl-orange);
    opacity: 0.95;
}

.match-row__stats-thumb img {
    display: block;
    width: 80px;
    height: 50px;
    object-fit: cover;
}

/* Кнопки */
.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);
}

/* ----- Страница матча (Статистика матча) ----- */
.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-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;
}
