﻿/* ПОДКЛЮЧЕНИЕ ШРИФТОВ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noticia+Text:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Asap:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Saira:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Spartan:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Futura+PT:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Questrial&display=swap');


/* ====== ПОДКЛЮЧЕНИЕ ШРИФТОВ ACTAY ====== */
@font-face {
    font-family: 'Actay Wide';
    src: url('/static/deps/fonts/ActayWide-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Actay';
    src: url('/static/deps/fonts/Actay-Regular.otf') format('opentype');
    font-weight: 500; /* Полужирный для лучшей читаемости */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Actay';
    src: url('/static/deps/fonts/ActayCondensed-Thin.otf') format('opentype');
    font-weight: 400; /* Обычный, но чуть заметнее */
    font-style: normal;
    font-display: swap;
}

/* Actay Wide для заголовков и акцентов */
.team-name,
.game-name,
.modal-section-divider span,
.stat-value,
.main-tab,
.data-table th,
.filter-box label,
.game-meta span,
.team-meta span {
    font-family: 'Actay Wide', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Actay SemiBold для кнопок и интерфейса */
.search-button,
.apply-button,
.reset-button,
.stat-label,
.tournament-name {
    font-family: 'Actay', Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Actay Regular для основного текста - чуть жирнее */
.data-table td,
.filter-box select,
.search-field input,
.period-toggle,
.tournament-stats span,
.history-table td,
.game-info p,
.detailed-results td,
.excel-style-table td {
    font-family: 'Actay', Arial, sans-serif;
    font-weight: 500; /* Чуть жирнее обычного */
    letter-spacing: 0.2px;
}

/* Делаем информацию об игре и данные в таблице более заметными */
.game-info p {
    font-weight: 500; /* Полужирный для информации об игре */
    color: #e6ddff;
    margin-bottom: 8px;
}

.detailed-results td,
.excel-style-table td {
    font-weight: 500; /* Полужирный для данных в таблице */
    color: #ffffff;
}

/* Особо выделяем важные числа и результаты */
.stat-value {
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(124, 77, 255, 0.3);
}

/* Улучшаем читаемость таблиц */
.data-table th {
    background: linear-gradient(135deg, #3d2a5e, #2a1745);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.data-table td {
    color: #f0f0f0;
    border-bottom: 1px solid rgba(124, 77, 255, 0.2);
}

/* Кнопки становятся более выразительными */
.search-button,
.apply-button {
    background: linear-gradient(135deg, #7c4dff, #6a3ddf);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.reset-button {
    background: linear-gradient(135deg, #5a3f8b, #4a336e);
    font-weight: 600;
}


/* Сброс*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    transition: all 0.3s;
}

/* Базовые настройки шрифтов */
body {
    font-size: 62.5%;
    font-family: 'Actay', Arial, sans-serif;
    font-weight: normal;
    color: white;
    padding-top: 1rem;
}

/* Фон и затемнение */
.background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1f1b28; /* фиолетово‑тёмный подтон под логотип */
    background-image:
        url('/static/deps/img/qwiz.jpg'),
        radial-gradient(120% 120% at 20% 20%, rgba(103, 80, 164, 0.35), transparent 55%),
        radial-gradient(120% 120% at 80% 80%, rgba(58, 44, 102, 0.4), transparent 55%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 170%, cover, cover;
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 21, 41, 0.65);
    z-index: -1;
}

/* ====== ЗАГОЛОВОК РЕЙТИНГА И РЕЗУЛЬТАТОВ ====== */
.page-title {
    position: relative;
    max-width: 1200px;
    margin: 0px auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: 'Actay Wide', Arial, sans-serif;
}

.page-heading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 750;
    color: #ffffff;
    letter-spacing: 0.2px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.page-logo {
    height: 84px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}


/* ====== MAIN CONTENT ====== */
/* Основные стили */
.main-content {
    max-width: 1350px;
    margin: 50px auto 20px;
}

/* Вкладки "Команды" "Игры"*/
.main-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.main-tab {
    padding: 18px 40px;
    background: #2a1745;
    color: #b39ddb;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid #3d2a5e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.main-tab.active {
    background: #7c4dff;
    color: white;
    border-color: #9575cd;
    box-shadow: 0 6px 16px rgba(124, 77, 255, 0.4);
    transform: translateY(-3px);
}

.main-tab:hover {
    background: #5e35b1;
    color: white;
}

.main-tab i {
    font-size: 1.2rem;
}

/* Панель управления */
.control-panel {
    background: #1f0f3a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid #3d2a5e;
}

.search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    background: #2a1745;
    border-radius: 8px;
    padding: 0 15px;
    border: 1px solid rgba(124, 77, 255, 0.2);
}

.search-field i {
    color: #7c4dff;
    margin-right: 1rem;
}

.search-field input {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
}

.search-field input::placeholder {
    color: #7a6f8a;
}

.clear-search {
    background: none;
    border: none;
    color: #7a6f8a;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.search-button {
    padding: 0 25px;
    background: #7c4dff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.search-button:hover {
    background: #6a3ddf;
}

.search-button:active{
    background: #5e35b1;
}

.search-field input:focus{
    outline: none;
}

/* фильтры */
.filter-container {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
}

.filter-box {
    flex: 1;
    min-width: 150px;
}

.filter-box label {
    margin-bottom: 8px;
    color: #b39ddb;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-box select {
    width: 100%;
    padding: 12px 15px;              
    background: #2a1745;  
    border: 1px solid rgba(124, 77, 255, 0.2);
    color: white;
    border-radius: 8px;           
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-box select:hover {
    background: #3d2a5e;
    border-color: #7c4dff;
}

/* Состояние фокуса */
.filter-box select:focus {
    border-color: #7c4dff;
    outline: none;
}

/* Опции списка: чуть толще и светлее фон */
.filter-box select option {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}


/* Контейнер для кнопок */
.filter-buttons-container {
    flex: 0 0 auto;
    min-width: 220px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* При ширине до 1000px переносим кнопки на новую строку */
@media (max-width: 1000px) {
    .filter-container {
        flex-wrap: wrap;
    }

    .filter-buttons-container {
        flex: 0 0 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .apply-button,
    .reset-button {
        width: 100%;
    }
}

/* Стили для кнопки Применить */
.apply-button {
    padding: 10px 16px;
    background: #7c4dff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    white-space: nowrap;
    min-width: 100px;
    height: 44px;
}

.apply-button:hover {
    background: #6a3ddf;
    transform: translateY(-1px);
}

.apply-button:active {
    background: #5e35b1;
    transform: translateY(0);
}

/* Стили для кнопки Сбросить */
.reset-button {
    padding: 10px 16px;
    background: #5a3f8b;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    white-space: nowrap;
    min-width: 100px;
    height: 44px;
}

.reset-button:hover {
    background: #4a336e;
    transform: translateY(-1px);
}

.reset-button:active {
    background: #3d2a5e;
    transform: translateY(0);
}


/* по умолчанию скрываем 2 фильтра*/
.team-only,
.game-only {
  display: none; 
}


/* Стили для фильтра периода */
.period-filter {
    position: relative;
}

.period-toggle {
    width: 100%;
    padding: 12px 15px;
    background: #2a1745;
    border: 1px solid rgba(124, 77, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    min-width: 0;
    font-size: 1rem;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.period-toggle:hover {
    background: #3d2a5e;
    border-color: #7c4dff;
}

.period-fields {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #2a1745;
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 5px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.period-fields.show {
    display: block;
}

@media (min-width: 769px) {
    .period-fields {
        min-width: 200px;
    }
}

.date-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px;
}

.date-input-group:last-child {
    margin-bottom: 0;
}

.date-label {
    color: #b39ddb;
    font-weight: 500;
    min-width: 20px;
    font-size: 1rem;
}

.period-fields input[type="date"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    background: #1f0f3a;
    border: 1px solid rgba(124, 77, 255, 0.2);
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    max-width: 100%;
}

.period-fields input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.period-fields input[type="date"]:focus {
    border-color: #7c4dff;
    outline: none;
}

/* Адаптация вкладок и фильтров с поиском */
@media (max-width: 768px) {
    /* Основные настройки */
    body {
        overflow-x: hidden;
    }
    
    .main-content {
        margin: 40px auto 20px;
        max-width: 100%;
    }

    /* Рейтинг и результаты */
    .page-title {
        margin: 8px auto 6px;
        gap: 6px;
    }
    .page-heading {
        font-size: 1.6rem;
        gap: 8px;
    }
    .page-logo {
        height: 64px;
    }

    /* Компактные вкладки команды и игры */
    .main-tabs {
        display: flex;
        flex-direction: column;
        margin-bottom: 10px;
        width: 100%;
        gap: 4px;
    }
    
    .main-tab {
        padding: 12px 10px;
        font-size: 1rem;
        margin: 0;
        width: 100%;
    }
    

    /* Строка поиска и фильтров */
    .control-panel {
        padding: 15px;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .search-container {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .search-field input {
        padding: 10px 12px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .search-button {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: 80px;
    }
    
    /* Компактные фильтры */
    .filter-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
    }
    
    .filter-box {
        margin-bottom: 0;
    }
    
    .filter-box label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .filter-box select {
        padding: 10px 12px;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .period-toggle {
        padding: 10px 12px;
        font-size: 0.85rem;
        width: 100%;
        gap: 6px;
    }

    .period-fields {
        left: 0;
        right: 0;
        width: 100%;
        max-width: calc(100vw - 32px);
        padding: 10px;
        min-width: 0;
    }

    .period-fields input[type="date"] {
        font-size: 0.85rem;
        padding: 8px 10px;
        width: 90%;
    }

    .date-label {
        font-size: 0.85rem;
    }
    
    /* Кнопки Применить/Сбросить */
    .filter-buttons-container {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 10px;
    }
    
    .apply-button, .reset-button {
        height: 38px;
        font-size: 0.85rem;
        padding: 0 12px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .period-toggle {
        font-size: 0.8rem;
        padding: 9px 10px;
    }

    .period-fields {
        max-width: calc(100vw - 20px);
        padding: 8px;
        inset: 100% auto auto 0;
    }

    .period-fields .date-input-group {
        gap: 4px;
    }

    .period-fields input[type="date"] {
        font-size: 0.8rem;
        padding: 7px 9px;
        line-height: 1.2;
    }

    .date-label {
        font-size: 0.8rem;
    }
}


@media (max-width: 480px) {
    /* Вкладки Команды и Игры*/   
    .main-tab {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .main-tab i {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    /* Рейтинг и результаты */
    .page-title {
        margin: 6px auto 4px;
    }
    .page-heading {
        font-size: 1.3rem;
    }
    .page-logo {
        height: 62px;
    }
    
    /* Панель управления Поиск и фильтры */
    .control-panel {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    /* Уменьшаем размер поиска*/
    .search-container {
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .search-field {
        padding: 0 10px;
    }
    
    .search-field input {
        padding: 10px 0;
        font-size: 0.75rem;
    }
    
    .clear-search {
        padding: 4px;
        margin-left: 6px;
        font-size: 0.85rem;
    }
    
    .search-button {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    /* Фильтры */
    
    .filter-box label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .filter-box select {
        font-size: 0.85rem;
        height: 40px;
        text-indent: 8px; /*Отступ текста внутри фильтров*/
    }
    
    .period-toggle {
        padding: 10px 12px;
        font-size: 0.85rem;
        height: 40px;
    }
}



/* ====== ТАБЛИЦЫ ====== */
.table-content {
    background: #1f0f3a;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(124, 77, 255, 0.2);
}

.table-wrapper {
    display: none;
}

.table-wrapper.active {
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    padding: 20px;
}

.data-table th {
    padding: 16px 20px;
    background: #2a1745;
    color: #d1c4e9;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid #3d2a5e;
    font-size: 1rem;
}

.data-table thead {
    position: sticky;
    top: 0px;
    z-index: 50;
    background: #2a1745;
}

.data-table td {
    padding: 14px 20px;
    color: white;
    border-bottom: 1px solid #3d2a5e;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: rgba(124, 77, 255, 0.1);
}


/* Убираю центрирование у команды в таблице*/ 
#teams-table .data-table th:nth-child(2), #teams-table .data-table td:nth-child(2) {
    text-align: left;
}

#games-table .data-table th:nth-child(5), #games-table .data-table td:nth-child(5){
    text-align: left;
}

/* делаем таблицу игр фиксированной и задаем ширину */
#games-table .data-table{
table-layout: fixed;
}

/* Дата */
#games-table .data-table th:nth-child(1),
#games-table .data-table td:nth-child(1) {
    width: 10%;
}

/* Город */
#games-table .data-table th:nth-child(2),
#games-table .data-table td:nth-child(2) {
    width: 15%;
}

/* Турнир */
#games-table .data-table th:nth-child(3),
#games-table .data-table td:nth-child(3) {
    width: 35%;
    text-align: left;
    padding-left: 50px;
}

/* Число команд */
#games-table .data-table th:nth-child(4),
#games-table .data-table td:nth-child(4) {
    width: 15%;
}

/* Победитель */
#games-table .data-table th:nth-child(5),
#games-table .data-table td:nth-child(5) {
    width: 30%;
}

/* Адаптация таблиц */
@media (max-width: 768px) {    
    .data-table {
        table-layout: fixed; /* Фиксированная ширина колонок */
    }
    
    .data-table th {
        padding: 15px 5px;
        font-size: 0.85rem;
    }
    
    .data-table td {
        padding: 15px 5px;
        font-size: 0.85rem;
        word-wrap:normal;
    }

    /* Ширина колонок для таблицы команд */
    /* Место */
    #teams-table .data-table th:nth-child(1),
    #teams-table .data-table td:nth-child(1) {
        width: 13%;
    }
    /* Команда */
    #teams-table .data-table th:nth-child(2),
    #teams-table .data-table td:nth-child(2) {
        width: 25%;
        text-align: left;
    }

    /* Пояс */
    #teams-table .data-table th:nth-child(3),
    #teams-table .data-table td:nth-child(3) {
        width: 20%;
    }

    /* Баллы */
    #teams-table .data-table th:nth-child(4),
    #teams-table .data-table td:nth-child(4) {
        width: 15%;
    }

    /* ср.балл */
    #teams-table .data-table th:nth-child(5),
    #teams-table .data-table td:nth-child(5) {
        display: none;
    }

    /* Игр сыграно */
    #teams-table .data-table th:nth-child(6),
    #teams-table .data-table td:nth-child(6) {
        width: 15%;
    }
    
    /* Побед */
    #teams-table .data-table th:nth-child(7),
    #teams-table .data-table td:nth-child(7) {
        width: 15%;
    }
    
    /* Таблица игр */
    #games-table .data-table th:nth-child(2),
    #games-table .data-table td:nth-child(2){
        display: none;
    }
}

@media (max-width: 480px){

    .data-table{
        padding: 15px;
    }

    #teams-table .data-table th:nth-child(3),
    #teams-table .data-table td:nth-child(3),
    #teams-table .data-table th:nth-child(5),
    #teams-table .data-table td:nth-child(5),
    #teams-table .data-table th:nth-child(6),
    #teams-table .data-table td:nth-child(6),
    #teams-table .data-table th:nth-child(7),
    #teams-table .data-table td:nth-child(7) {
        display: none;
    }

    /* ПЕРЕРАСПРЕДЕЛЯЕМ ШИРИНУ оставшихся колонок */
    #teams-table .data-table th:nth-child(1),
    #teams-table .data-table td:nth-child(1) {
        width: 20%; /* Было 13% */
    }
    
    #teams-table .data-table th:nth-child(2),
    #teams-table .data-table td:nth-child(2) {
        width: 50%; /* Было 30% - увеличиваем */
    }
    
    #teams-table .data-table th:nth-child(4),
    #teams-table .data-table td:nth-child(4) {
        width: 25%; /* Было 15% - увеличиваем */
    }
    
    
    #games-table .data-table th:nth-child(2),
    #games-table .data-table td:nth-child(2),
    #games-table .data-table th:nth-child(4),
    #games-table .data-table td:nth-child(4){
        display: none;
    }

    /* ПЕРЕРАСПРЕДЕЛЯЕМ ШИРИНУ оставшихся колонок */
    #games-table .data-table th:nth-child(1),
    #games-table .data-table td:nth-child(1) {
        width: 15%;
    }
    
    #games-table .data-table th:nth-child(3),
    #games-table .data-table td:nth-child(3) {
        width: 48%;
        padding-left: 30px;
    }
    
    #games-table .data-table th:nth-child(5),
    #games-table .data-table td:nth-child(5) {
        width: 35%;
    }
}


/* ====== МОДАЛЬНЫЕ ОКНА ОБЩИЕ СТИЛИ ====== */
.team-modal, .game-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    --game-modal-scale: 1;
}

.team-modal.active, .game-modal.active {
    display: block;
}
/* Затемнение фона */
.modal-overlay {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1f0f3a, #241047);
    border-radius: 16px;
    padding: 30px;
    overflow-y: auto;
    border: 1px solid rgba(124, 77, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    color: white;
    animation: modalAppear 0.3s ease-out;
}

.modal-content.game {
    max-width: 1200px;
    border: 0;
    padding: 0;
    background: 0;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Кнопка закрытия */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

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

/* МОДАЛКА КОМАНДЫ */
.team-header {
    margin-bottom: 25px;
    text-align: center;
}

.team-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 0 15px rgba(124, 77, 255, 0.3);
    padding: 0 20px;
}

.team-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.team-meta span {
    font-size: 1.05rem;
    color: #d1c4e9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-meta i {
    color: #7c4dff;
    width: 16px;
}

/* Разделитель секций в модалках */
.modal-section-divider {
    position: relative;
    text-align: center;
    margin: 40px 0px 25px 0px;
    padding: 0 20px;
}

.modal-section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(124, 77, 255, 0.4) 20%, rgba(124, 77, 255, 0.4) 80%, transparent 100%);
    z-index: 1;
}

.modal-section-divider span {
    position: relative;
    display: inline-block;
    padding: 0 20px;
    background: linear-gradient(145deg, #1f0f3a, #241047);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

/* Статистика */
.team-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.stat-card {
    padding: 20px 15px;
    background: rgba(42, 23, 69, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(124, 77, 255, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    line-height: 1;
    text-shadow: 0 0 10px rgba(124, 77, 255, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: #b39ddb;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: rgba(124, 77, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.2);
}

/* ===== Контейнер для пояса и радара ===== */
.belt-radar-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 25px;
    align-items: stretch;
}

.belt-radar-container > * {
    min-width: 0;
}
/* Пояс */
.belt-section {
    background: rgba(42, 23, 69, 0.6);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(124, 77, 255, 0.25);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.belt-title {
    color: #e6ddff;
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Основной контейнер пояса с информацией */
.belt-main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}


/* Визуальная часть пояса */
.belt-visual {
    display: flex;
    min-width: 220px;
    margin-bottom: 15px;
}

.clean-belt {
    --belt-light: #f4f4f4;
    --belt-dark: #d9d9d9;
    --stripe-color: #000;

    height: 40px;
    width: 250px;
    max-width: 250px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    transform: skew(-20deg);
    background: linear-gradient(135deg, var(--belt-light) 0%, var(--belt-dark) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
/* Полосы на поясе */
.clean-vertical-lines {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
}

.clean-line {
    width: 18px;
    height: 100%;
    background: var(--stripe-color);
    transform: skew(-10deg);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Управление видимостью полосок */
.clean-belt.s-0 .clean-line { display: none; }
.clean-belt.s-1 .clean-line:nth-child(n+2) { display: none; }
.clean-belt.s-2 .clean-line:nth-child(n+3) { display: none; }
.clean-belt.s-3 .clean-line:nth-child(n+4) { display: none; }
.clean-belt.s-4 .clean-line:nth-child(n+5) { display: none; }

/* Цвета поясов*/
.clean-belt.white { --belt-light: #FFFFFF; --belt-dark: #F0F0F0; --stripe-color: #2D3748; }
.clean-belt.blue { --belt-light: #1E90FF; --belt-dark: #0066CC; --stripe-color: #FFFFFF; }
.clean-belt.purple { --belt-light: #800080; --belt-dark: #600060; --stripe-color: #FFFFFF; }
.clean-belt.brown { --belt-light: #8B4513; --belt-dark: #6B3410; --stripe-color: #FFFFFF; }
.clean-belt.black { --belt-light: #000000; --belt-dark: #000000; --stripe-color: #FFFFFF; }
.clean-belt.red { --belt-light: #FF0000; --belt-dark: #CC0000; --stripe-color: #FFFFFF; }

/* Информация о поясе*/
.belt-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 100%;
}

.belt-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(124, 77, 255, 0.1);
}

.belt-info-item:last-child {
    border-bottom: none;
}

.belt-info-label {
    color: #b39ddb;
    font-size: 0.85rem;
    font-weight: 500;
}

.belt-info-value {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Прогресс-бар уровня */
.belt-progress-section {
    margin-top: 15px;
    background: rgba(124, 77, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.belt-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.belt-progress-label {
    color: #d1c4e9;
    font-size: 0.85rem;
    font-weight: 500;
}

.belt-progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
}

.belt-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.belt-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    width: 0%;
    display: block;
}

/* Мини-пояс для таблицы */
.clean-belt.mini {
    height: 22px;
    width: 90px;
    max-width: 100px;
    border-radius: 4px;
    margin: 0 auto;
}

.clean-belt.mini .clean-line {
    width: 6px;
    height: 100%;
    background: var(--stripe-color);
    transform: skew(-10deg);
    border-radius: 0;
    margin-right: 2px;
}

.clean-belt.mini .clean-vertical-lines {
    right: 6px;
    gap: 3px;
}

/* ===== СТИЛИ ДЛЯ РАДАРА ===== */

.stats-radar {
    background: rgba(42, 23, 69, 0.6);
    border: 1px solid rgba(124, 77, 255, 0.25);
    border-radius: 14px;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.stats-radar h3 {
    font-size: 1.1rem;
    color: #e0d7f5;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.opponent-compare {
    position: relative;
    width: 100%;
    max-width: 240px;
    margin: 0 auto 10px;
}

/* Поиск */
.opponent-compare input[type="text"] {
    background: rgba(48, 31, 83, 0.85);
    border: 1px solid rgba(124, 77, 255, 0.45);
    color: #f2edff;
    padding: 8px 12px;
    padding-right: 42px; /* место под крестик */
    border-radius: 10px;
    min-width: 0;
    width: 100%;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.opponent-compare input[type="text"]::placeholder {
    color: rgba(242, 237, 255, 0.7);
}

.opponent-compare input[type="text"]:focus {
    border-color: #9c86ff;
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.opponent-compare select {
    appearance: none;
    background: linear-gradient(135deg, #2f1c54 0%, #3a245f 100%);
    border: 1px solid rgba(124, 77, 255, 0.5);
    color: #fff;
    padding: 8px 34px 8px 12px;
    border-radius: 10px;
    min-width: 150px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s ease;
    position: relative;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #c6b8ff 50%),
        linear-gradient(135deg, #c6b8ff 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    background-position:
        calc(100% - 16px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px),
        calc(100% - 38px) 50%;
    background-size: 7px 7px, 7px 7px, 1px 60%;
    background-repeat: no-repeat;
}

.opponent-compare select:focus {
    border-color: #7c4dff;
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.28), 0 8px 22px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.opponent-compare select:hover {
    border-color: #9c86ff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.opponent-compare select option {
    background: #2b1b49;
    color: #f2edff;
}

.opponent-hidden-select {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Выход (крестик) */
.opponent-compare button {
    background: none;
    border: none;
    color: #c9b7ff;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    top: 30%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 1;
    padding: 0;
    line-height: 1;
    font-size: 13px;
}

.opponent-compare button:hover {
    color: #ffffff;
}

.opponent-compare button:active {
    transform: translateY(-50%) scale(0.94);
}

.chart-container {
    flex: 1;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Секция достижений */
.tournament-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(42, 23, 69, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.15);
}

.tournament-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0d7f5;
    flex: 1;
}

.tournament-stats {
    display: flex;
    gap: 12px;
}

.tournament-stats span {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

/* Цвета для наград в достижениях */
.achievements-section .cup {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.achievements-section .gold {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.achievements-section .silver {
    color: #C0C0C0;
    background: rgba(192, 192, 192, 0.1);
}

.achievements-section .bronze {
    color: #CD7F32;
    background: rgba(205, 127, 50, 0.1);
}

.tournament-stats span {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* История последних игр */
.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: #2a1745;
    color: #e0d7f5;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    font-size: 0.95rem;
}

.history-table td {
    color: #fff;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(124, 77, 255, 0.2);

}

.history-table th:nth-child(1),
.history-table td:nth-child(1),
.history-table th:nth-child(3),
.history-table td:nth-child(3),
.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    text-align: center;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    text-align: left;
}
/* ===== Модалка команды ===== */
@media (max-width: 768px) {
    /* Методанные команды */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-x: hidden;
    }

    .close-modal {
        position: absolute;
        top: 8px;
        right: 20px;
    }

    .team-header {
        margin-bottom: 0px;
    }

    .team-name {
        font-size: 1.7;
        margin-bottom: 10px;
    }

    .team-met span{
        font-size: 0.9rem ;
    }
    
    /* 4 статистических параметра в одну строку */
    .team-stats-row {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .stat-card {
        padding: 12px 8px;
        min-height: 80px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Пояс и радар на одном уровне */
    .belt-radar-container {
        gap: 15px;
        margin-bottom: 20px;
        max-width: 100%;
    }

    .belt-section {
        padding: 15px;
        min-height: auto;
    }

    /* Пояс */
    .clean-belt {
        height: 35px;
        width: 200px;
        margin: 0 auto;
    }
    
    .clean-vertical-lines{
        right: 15px;
        gap: 8px;
    }

    .clean-line{
        width: 14px;
    }

    /* Мини пояс */
    .clean-belt.mini {
        height: 18px;
        width: 80px;
        margin: 0 auto;
        border: 1px solid rgba(0, 0, 0, 0.3);
    }

    .clean-belt.mini .clean-line {
        width: 6px;
        height: 100%;
        margin-right: 0;
    }

    .clean-belt.mini .clean-vertical-lines {
        right: 7px;
    }


    .stats-radar {
        padding: 15px;
        min-height: 250px;
    }
    
    .chart-container {
        min-height: 200px;
    }
    
    /* Компактные достижения */
    .tournament-row {
        padding: 10px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .tournament-name {
        font-size: 0.85rem;
        flex: 1;
    }
    
    .tournament-stats {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    /* Компактная история игр */
    .history-table {
        font-size: 0.85rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 8px 5px;
    }
}

@media (max-width: 460px) {
    /* ===== ФИКС ЗАГОЛОВКА ===== */
    .modal-header-bar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        padding: 15px 20px 10px;
        margin: 10px -20px 15px -20px;

    }

    .team-name {
        flex: 1;
        font-size: 1.3rem;
        line-height: 1.2;
        margin: 0;
        word-break: break-word;
        padding-right: 25px;
        color: #fff;
        max-height: 2.4rem;
        overflow: hidden;
        -webkit-box-orient: vertical;
    }

    .close-modal {
        font-size: 1.8rem;
        background: none;
        border: none;
        padding: 0;
        margin: 0;
        position: absolute;
        top: 6px;
        right: 10px;
    }

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

    .team-meta {
        margin-top: 15px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
        padding: 0;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }

    .team-meta span {
        font-size: 0.8rem;
    }

    /* ===== РАЗДЕЛИТЕЛИ ===== */
    .modal-section-divider span {
        font-size: 1.1rem;
    }

    /* ===== СТАТИСТИЧЕСКИЕ БЛОКИ ===== */
    .team-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .stat-card {
        padding: 12px 8px;
        min-height: 70px;
        background: rgba(42, 23, 69, 0.4);
        border: 1px solid rgba(124, 77, 255, 0.2);
        border-radius: 8px;
    }
    
    .stat-value {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .stat-label {
        font-size: 0.7rem;
        background: rgba(124, 77, 255, 0.1);
        border: 1px solid rgba(124, 77, 255, 0.15);
        padding: 3px 6px;
    }

    /* ===== ПОЯС И РАДАР ===== */
    .belt-radar-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* Уменьшенный блок прогресса */
    .belt-section {
        padding: 12px; /* Уменьшили padding */
        border-radius: 10px;
        min-height: auto;
    }
    
    .belt-title {
        font-size: 1rem;
        margin-bottom: 8px; /* Уменьшили отступ */
    }
    
    .clean-belt {
        height: 32px;
        max-width: 180px;
        margin: 0 auto 8px auto;
    }
    
    .belt-info {
        gap: 4px; 
    }
    
    .belt-info-item {
        padding: 4px 0;
    }
    
    .belt-info-label { 
        font-size: 0.75rem; 
    }
    
    .belt-info-value { 
        font-size: 0.8rem; 
    }
    
    .belt-progress-section {
        margin-top: 14px; 
        padding: 14px;
    }
    
    .belt-progress-label,
    .belt-progress-percent { 
        font-size: 0.75rem; 
    }
    
    .belt-progress-bar { 
        height: 5px; 
    }

    /* Радар */
    .stats-radar {
        padding: 10px 0 0 0;
        min-height: 260px;
    }
    
    .stats-radar h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .chart-container {
        min-height: 210px;
    }

    /* ===== ДОСТИЖЕНИЯ ===== */
    .achievements-section {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .tournament-row {
        padding: 8px 10px;
        margin-bottom: 0;
        background: rgba(42, 23, 69, 0.3);
        border-radius: 6px;
        border: 1px solid rgba(124, 77, 255, 0.15);
        align-items: center;
    }
    
    .tournament-name {
        font-size: 0.85rem;
        flex: 1;
        color: #e0d7f5;
    }
    
    .tournament-stats {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .tournament-stats span {
        font-size: 0.75rem;
        padding: 2px 6px;
        border-radius: 4px;
    }

    /* ===== ИСТОРИЯ ИГР ===== */
    .history-table table {
        width: 100%;
        font-size: 0.85rem;
    }
    
    .history-table th {
        font-size: 0.85rem;
        padding: 8px 4px;
        background: #2a1745;
        color: #d1c4e9;
        border-bottom: 2px solid #3d2a5e;
        white-space: nowrap;
    }
    
    .history-table td {
        font-size: 0.85rem;
        padding: 6px 4px;
        border-bottom: 1px solid rgba(124, 77, 255, 0.1);
        color: #f0f0f0;
    }
    
    .history-table tr:last-child td {
        border-bottom: none;
    }
    
    .history-table tr:hover {
        background: rgba(124, 77, 255, 0.05);
    }

    /* Ширина колонок */
    .history-table th:nth-child(1),
    .history-table td:nth-child(1) {
        width: 30%;
        text-align: center;
    }
    
    .history-table th:nth-child(2),
    .history-table td:nth-child(2) {
        width: 50%;
        text-align: left;
    }
    
    .history-table th:nth-child(3),
    .history-table td:nth-child(3) {
        width: 15%;
        text-align: center;
    }
    
    .history-table th:nth-child(4),
    .history-table td:nth-child(4) {
        width: 15%;
        text-align: center;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 380px) {
    .close-modal {
        top: 8px;
        right: 12px;
        font-size: 1.6rem;
    }
    
    .team-name {
        font-size: 1.1rem;
        padding-right: 25px;
    }
    
    .belt-section {
        padding: 10px; /* Еще меньше на маленьких экранах */
    }
}


/* ====== МОДАЛКА ИГРЫ ====== */
.gq-board {
    font-family: 'Actay Wide', 'Actay', sans-serif;
    background: linear-gradient(135deg, rgb(1, 1, 3) 0%, rgb(25, 6, 49) 100%);
    color: #f5f7fa;
    padding: 40px 40px 30px 40px;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,.65);
}

.gq-board__header {
    display: flex;
    position: relative;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 26px;
}

.gq-board__title {
    margin: 0;
    line-height: 1.1;
    font-size: var(--title-size);
    font-weight: var(--title-weight);
    color: var(--title-color);
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
}

.gq-board__subtitle {
    margin-left: 12px;
    font-size: var(--subtitle-size);
    font-weight: var(--subtitle-weight);
    color: var(--subtitle-color);
}

.gq-board__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
    margin-bottom: 24px;

}

.gq-board__meta span {
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 1rem;
}

.gq-board__sponsor {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0 40px 40px 0;
}

.gq-board__title_logo img {
    max-width: clamp(200px, 24vw, 320px);
    max-height: clamp(90px, 12vw, 150px);
    width: 100%;
    height: auto;
}

/* Таблица */
.gq-board__grid{
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.gq-board__table table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 0;
    font-size: clamp(11px, 1.35vw, 15px);
    line-height: 1.2;
    color: #f5f7fa;
    border: 1px solid #ffffff;
}

.gq-board__table thead th {
    background: #000000;
    color: #dfe4ea;
    padding: clamp(6px, 1.1vw, 12px) clamp(4px, 0.9vw, 10px);
    border: 0.5px solid #ffffff;
    text-transform: none;
}

.gq-board__table tbody td {
    padding: clamp(6px, 1vw, 10px) clamp(3px, 0.8vw, 9px);
    border: 0.5px solid #ffffff;
}


.gq-board__table thead th,
.gq-board__table tbody td {
    width: 3.5%;                 /* базовый размер для тематик */
    white-space: nowrap;
    word-break: keep-all;
    overflow: visible;
    text-overflow: clip;
}

/* № */
.gq-board__table th.num,
.gq-board__table td.num {
    width: 3%;
}

/* «Команда» */
.gq-board__table thead th:nth-child(2),
.gq-board__table tbody td:nth-child(2) {
    text-align: left;
    width: 16.5%;
}

/* П.Р. (первый .result) */
.gq-board__table thead th.result:first-of-type,
.gq-board__table tbody td.result:first-of-type {
    width: 8%;
    font-size: 1em;          /* размер как у тем */
    letter-spacing: 0;
}

/* «Результат» (чел. до чёрного ящика) */
.gq-board__table thead th:nth-last-child(4),
.gq-board__table tbody td:nth-last-child(4) {
    width: 7%;
}

/* «Чёрный ящик» */
.gq-board__table thead th:nth-last-child(3),
.gq-board__table tbody td:nth-last-child(3) {
    width: 11%;
}

/* «+/-» */
.gq-board__table thead th:nth-last-child(2),
.gq-board__table tbody td:nth-last-child(2) {
    width: 3.5%;
}

/* Итог игры (последний .result) */
.gq-board__table thead th.result:last-of-type,
.gq-board__table tbody td.result:last-of-type {
    width: 6.5%;
}

.gq-board__table tbody tr:nth-child(odd) td:not(.result){ background: #290b47; }
.gq-board__table tbody tr:nth-child(even) td:not(.result){ background: #000000; }


/* Приоритетно красим result, перекрывая зебру */
.gq-board__table thead th.result,
.gq-board__table tbody td.result {
    background: rgb(1, 63, 83);
    color: #cbd5e1;
    font-weight: 700;
    letter-spacing: -0.1px;

}


.gq-board__table .num {
    width: 44px;
    text-align: center;
    color: #cbd5e1;
}

.gq-board__table .center {
    text-align: center;
}

/* Делаем длинные заголовки компактнее по умолчанию (не трогаем П.Р. и +/-) */
.gq-board__table thead th:nth-last-child(4),  /* Результат */
.gq-board__table thead th:nth-last-child(3),  /* Чёрный ящик */
.gq-board__table thead th.result:last-of-type { /* Итог игры */
    font-size: 0.85em;
    padding-inline: 8px;
    letter-spacing: -0.1px;
}

/* Ответ на чёрный ящик */
.gq-board__table tbody td:nth-last-child(3) {
    font-size: 0.9em;
    letter-spacing: -0.2px;
    padding-inline: 8px;
}

.gq-board__legend {
    font-size: clamp(10px, 1.8vw, 16px);
    color: rgba(255,255,255,.8);
    margin-top: 14px;
}

.gq-board__legend b { color: #fff; }

/* Спонсоры */
.gq-board__logos {
    margin-top: 40px;
    display: flex;
    gap: clamp(10px, 1.6vw, 18px);
    justify-content: center;
    align-items: center;
    padding: 20px 0 14px;
}

.gq-board__logos .gq-board__logo {
    flex: 0 1 clamp(90px, 16vw, 160px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.gq-board__logos .gq-board__logo img {
    max-width: 100%;
    max-height: clamp(32px, 6vw, 58px);
    object-fit: contain;
}

/* Адаптация */
@media (max-width: 900px) {
    .gq-board { padding: 24px; }
    .gq-board__title { font-size: 36px; }
    .gq-board__meta{ flex-wrap: nowrap;}
    .gq-board__subtitle { font-size: 28px; }
    .gq-board__table thead th,
    .gq-board__table tbody td { padding: 8px; }

    .gq-board__logos {
        flex-wrap: nowrap;
        gap: clamp(7px, 1.6vw, 12px);
    }
    .gq-board__logos .gq-board__logo {
        flex: 0 1 clamp(80px, 18vw, 130px);
        max-width: clamp(80px, 18vw, 130px);
    }
    .gq-board__logos .gq-board__logo img {
        max-height: clamp(30px, 7vw, 44px);
    }
}

@media (max-width: 768px){
    /* header модалки комады */
    .modal-content.game{
        width: 100%;
        max-height: 100vh;
        overflow-x: hidden;
        padding: 2px;
    }

    .gq-board {
        padding: 20px 0px 10px 0px;
    }

    .gq-board__header {
        gap: 12px;
        margin-bottom: 26px;
        padding-left: 10px;
    }
    
    .gq-board__title { 
        font-size: 28px; 
        gap: 8px;
    }

    .gq-board__subtitle { 
        font-size: 24px; 
        margin-left: 6px;
    }

    .gq-board__meta{
        gap: 8px;
    }

    .gq-board__meta span{
        font-size: 14px;
        padding: 4px 12px;
    }

    .gq-board__sponsor { 
        margin: 0 30px 18px 0;
    }

    .gq-board__title_logo img {
        max-width: clamp(150px, 40vw, 240px);
        max-height: clamp(70px, 18vw, 120px);
        width: 100%;
        height: auto;
    }
    
    .gq-board__legend {
        font-size: clamp(8px, 2.2vw, 11px);
    }

}

@media (max-width: 640px){
    .gq-board__table table{
        font-size: clamp(7px, 2vw, 9.5px);
    }
    .gq-board__table thead th,
    .gq-board__table tbody td {
        padding: clamp(4px, 1.1vw, 6px) clamp(3px, 0.9vw, 5px);
        border-width: 0.5px;
    }
    .gq-board__table thead th:nth-last-child(4),
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table thead th.result:last-of-type {
        font-size: 0.84em;
        padding-inline: 5px;
        letter-spacing: -0.22px;
    }
    /* П.Р. и +/- держим в размере тем */
    .gq-board__table thead th.result:first-of-type,
    .gq-board__table thead th:nth-last-child(2) {
        font-size: 1em;
        letter-spacing: 0;
    }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) {
        font-size: 0.82em;
        letter-spacing: -0.24px;
        padding-inline: 5px;
    }
    /* Чуть уменьшаем текст команды и чёрного ящика, чтобы длинные слова помещались */
    .gq-board__table thead th:nth-child(2),
    .gq-board__table tbody td:nth-child(2) { font-size: 0.95em; }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) { font-size: 0.9em; }
    .gq-board__table th.num,
    .gq-board__table td.num { width: 2.5%; }
    .gq-board__table thead th:nth-child(2),
    .gq-board__table tbody td:nth-child(2) { width: 12%; }
    .gq-board__table thead th.result:first-of-type,
    .gq-board__table tbody td.result:first-of-type { width: 7.5%; }
    .gq-board__table thead th:nth-last-child(4),
    .gq-board__table tbody td:nth-last-child(4) { width: 6.5%; }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) { width: 9%; }
    .gq-board__table thead th:nth-last-child(2),
    .gq-board__table tbody td:nth-last-child(2) { width: 3%; }
    .gq-board__table thead th.result:last-of-type,
    .gq-board__table tbody td.result:last-of-type { width: 7%; }


}

@media (max-width: 540px){
    .gq-board__table table{
        font-size: clamp(6.5px, 1.7vw, 8.5px);
    }
    .gq-board__table thead th,
    .gq-board__table tbody td {
        padding: clamp(3px, 1vw, 5px) clamp(2px, 0.8vw, 4px);
        border-width: 0.4px;
    }
    .gq-board__table thead th.result:first-of-type {
        font-size: 1em; /* П.Р. в один размер с темами */
        letter-spacing: 0;
    }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) {
        font-size: 0.8em;
        letter-spacing: -0.2px;
    }
    /* сжимаем длинные заголовки результатов */
    .gq-board__table thead th:nth-last-child(4),
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table thead th.result:last-of-type {
        font-size: 0.78em;
        letter-spacing: -0.2px;
        padding-inline: 3px;
    }
    /* Чуть уменьшаем текст команды и чёрного ящика на совсем узких экранах */
    .gq-board__table thead th:nth-child(2),
    .gq-board__table tbody td:nth-child(2) { font-size: 0.92em; }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) { font-size: 0.85em; }
    /* П.Р. и +/- в базовом размере тем */
    .gq-board__table thead th.result:first-of-type,
    .gq-board__table thead th:nth-last-child(2) {
        font-size: 1em;
        letter-spacing: 0;
        padding-inline: 4px;
    }
    .gq-board__table th.num,
    .gq-board__table td.num { width: 2.5%; }
    .gq-board__table thead th:nth-child(2),
    .gq-board__table tbody td:nth-child(2) { width: 11.5%; }
    .gq-board__table thead th.result:first-of-type,
    .gq-board__table tbody td.result:first-of-type { width: 7.5%; }
    .gq-board__table thead th:nth-last-child(4),
    .gq-board__table tbody td:nth-last-child(4) { width: 6.2%; }
    .gq-board__table thead th:nth-last-child(3),
    .gq-board__table tbody td:nth-last-child(3) { width: 8%; }
    .gq-board__table thead th:nth-last-child(2),
    .gq-board__table tbody td:nth-last-child(2) { width: 3%; }
    .gq-board__table thead th.result:last-of-type,
    .gq-board__table tbody td.result:last-of-type { width: 6.6%; }

    .gq-board__legend {
        font-size: clamp(6px, 2.4vw, 8px);
    }

    .gq-board__logos {
        gap: clamp(5px, 1.6vw, 10px);
    }
    .gq-board__logos .gq-board__logo {
        flex: 0 1 clamp(70px, 20vw, 120px);
        max-width: clamp(70px, 20vw, 120px);
    }
    .gq-board__logos .gq-board__logo img {
        max-height: clamp(26px, 8vw, 38px);
    }
}

@media (max-width: 480px){
    /* header модалки команды */
    .gq-board__title { 
        font-size: 24px; 
    }

    .gq-board__subtitle { 
        font-size: 20px; 
        margin-left: 4px;
    }

    .gq-board__meta span{
        font-size: 12px;
    }

    .gq-board__sponsor { 
        margin: 0 20px 14px 0;
    }

    .gq-board__logos {
        gap: 0;
        padding: 6px 4px 4px;
    }
    .gq-board__logos .gq-board__logo {
        flex: 0 1 clamp(50px, 18vw, 82px);
        max-width: clamp(50px, 18vw, 82px);
    }
    .gq-board__logos .gq-board__logo img {
        max-height: clamp(18px, 6vw, 30px);
    }
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 15px 0;
    border-top: 1px solid #3d2a5e;
}

.pagination-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2a1745;
    color: #b39ddb;
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.pagination-arrow:hover {
    background: #3d2a5e;
    color: white;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2a1745;
    color: #b39ddb;
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #3d2a5e;
    color: white;
}

.pagination-btn.active {
    background: #7c4dff;
    color: white;
    border-color: #9575cd;
}
/* =========================
   FOOTER
   ========================= */

/* .site-footer {
    margin-top: 40px;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: #b39ddb;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: #e6ddff;
    font-size: 22px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
    transform: scale(1.15);
}

.footer-links a:hover .fa-instagram {
    color: #e1306c;
}

.footer-links a:hover .fa-whatsapp {
    color: #25d366;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 12px;
    }
} */


/* Компактный блок фильтров */
.compact-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 12px 16px;
    background: rgba(42, 23, 69, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.2);
    font-size: 0.9rem;
    font-weight: 700;
}

.filters-label {
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-item {
    color: #d1c4e9;
    padding: 6px 12px;
    background: rgba(124, 77, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(124, 77, 255, 0.15);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .compact-filters {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 10px 12px;
        font-size: 0.85rem;
        overflow: hidden;
    }

    .filters-list {
        width: 100%;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-item {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* Стили для состояния загрузки и ошибок */
.loading {
    text-align: center;
    padding: 8rem 2rem;
    color: #d1c4e9;
    font-size: 2.2rem;
    font-family: 'Actay Wide', Arial, sans-serif;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: rgba(31, 15, 58, 0.8);
    border-radius: 16px;
    border: 2px solid rgba(124, 77, 255, 0.2);
    margin: 20px;
}

.loading::before {
    content: "";
    width: 60px;
    height: 60px;
    border: 3px solid rgba(124, 77, 255, 0.3);
    border-top: 3px solid #7c4dff;
    border-radius: 50%;
    margin-bottom: 25px;
    animation: spin 1s linear infinite;
}

.error {
    text-align: center;
    padding: 6rem 2rem;
    color: #ff8a8a;
    font-size: 1rem;
    font-family: 'Actay Wide', Arial, sans-serif;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background: rgba(31, 15, 58, 0.8);
    border-radius: 16px;
    border: 2px solid rgba(255, 107, 107, 0.3);
    margin: 20px;
}

.error::before {
    content: "✕";
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 20px;
    display: block;
    font-weight: bold;
}

/* Анимация круга */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Простая анимация пульсации текста */
@keyframes pulseText {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.loading {
    animation: pulseText 2s ease-in-out infinite;
}




/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(31, 15, 58, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4a376b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c4dff;
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #4a376b rgba(31, 15, 58, 0.8);
}

/* Стили для скроллбара внутри модальных окон */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(31, 15, 58, 0.6);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #5a3f8b;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #7c4dff;
}

/* Для Firefox модальных окон */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: #5a3f8b rgba(31, 15, 58, 0.6);
}
