:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #131a2a;
    --bg-card: #1a2332;
    --accent-primary: #00f0ff;
    --accent-secondary: #7b42f6;
    --accent-danger: #ff2a6d;
    /* D-14: «Поражение» и категория LOW в блоках события. Было #c2183a («тёмно-красный»),
       но на панели события этот оттенок давал контраст 1.0–1.3:1 — текст был практически
       невидим, а на плашке LOW получалось красное на красном.
       Взят мягкий (пастельный) красный: тот же тон, что у --accent-danger, но светлее.
       На панели события контраст 6.4–7.0:1 (замерено на трёх точках градиента карточки,
       худший случай). Порог WCAG AA для мелкого текста — 4.5:1. */
    --accent-danger-soft: #ff8fa3;
    --accent-success: #00ff9d;
    --accent-warning: #ffd166;
    --text-primary: #ffffff;
    --text-secondary: #8b9bb4;
    --text-muted: #5a6a85;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glow-primary: 0 0 15px rgba(0, 240, 255, 0.7);
    --glow-secondary: 0 0 15px rgba(123, 66, 246, 0.7);
    /* D-5: длительность эффекта процессинга. Клиент переопределяет её из
       EVENT_PROCESSING_MS, здесь — значение по умолчанию для согласованности. */
    --processing-ms: 5000ms;
    /* D-8: единый зазор между частями строки игрока (место · категория · имя · титулы).
       Одна переменная на все зазоры, иначе расстояния выглядят разными: у бейджей титулов
       был собственный margin-left, и имя отстояло от них дальше, чем от категории. */
    --event-row-gap: 8px;
    /* D-10: ширина колонок «место» и «категория» в строке игрока. Считается по максимуму,
       а не по содержимому: место — двузначное число (32), категория — самая длинная (MIDDLE).
       Иначе имя начиналось бы в разных местах у разных игроков и строки выглядели рвано. */
    --event-rank-width: 30px;
    --event-tier-width: 58px;
    /* D-5: высота блоков «Последнее / Текущее / Предстоящее событие».
       Блоки обязаны быть одной высоты, иначе при показе боя секция прыгает:
       у «Текущего события» в шаге процессинга больше строк, чем у таймера.
       Значение подобрано под самый высокий шаг (процессинг) с запасом — см. .info-panel. */
    --info-panel-height: 260px;
    /* D-13: полоса под индикатор процессинга (12 точек + «Поединок идёт…») внизу
       содержимого блока события (.info-panel-content). Полоса зарезервирована во ВСЕХ трёх
       блоках, а сам индикатор вынесен из потока (.processing-view ниже). Поэтому строки
       игроков в «Текущем событии» стоят ровно там же, где в «Последнем» и «Предстоящем»,
       и не сдвигаются ни при появлении индикатора, ни при объявлении результата: панель
       центрирует содержимое по вертикали, и любой элемент в потоке над строками (или под
       ними) тянул бы их за собой. */
    --event-processing-strip: 40px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Exo 2', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(123, 66, 246, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 20%);
}

.cyber-border {
    position: relative;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    overflow: hidden;
}

.cyber-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    margin-bottom: 20px;
}

header {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    color: white;
    padding: 25px 0;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--glow-secondary);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 66, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: gridMove 20s linear infinite;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg, 
        rgba(123, 66, 246, 0.3) 0%, 
        rgba(0, 240, 255, 0.3) 25%, 
        rgba(123, 66, 246, 0.3) 50%, 
        rgba(0, 240, 255, 0.3) 75%, 
        rgba(123, 66, 246, 0.3) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.desktop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    height: fit-content;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.card h2 {
    color: var(--accent-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    font-size: 1.3rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 i {
    font-size: 1.2rem;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cyber-button {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.cyber-button:hover:enabled {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.cyber-button:hover:enabled::before {
    left: 100%;
}

.cyber-button.secondary {
    background: linear-gradient(135deg, #5a6a85 0%, #8b9bb4 100%);
}

.cyber-button.danger {
    background: linear-gradient(135deg, var(--accent-danger) 0%, #ff6b9d 100%);
}

.cyber-button.warning {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #ff9d00 100%);
}

.cyber-button.success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #00cc7a 100%);
}

.cyber-button:disabled {
    background: #2d3746;
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cyber-button:disabled::before {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    vertical-align: middle;
}

th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
}

tr {
    transition: var(--transition);
}

tr:hover {
    background-color: rgba(0, 240, 255, 0.05);
}

.participant-list {
    border-radius: 8px;
}

.participant-list::-webkit-scrollbar {
    width: 8px;
}

.participant-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.participant-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.match-list {
    max-height: 500px;
    overflow-y: auto;
}

.tournament-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.78rem;
    margin-right: 5px;
}

.title-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    margin-right: 6px;
    font-weight: 600;
}

.title-badge .icon {
    font-size: 0.95rem;
    line-height: 1;
}

.title-badge.grey {
    background: rgba(139, 155, 180, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(139, 155, 180, 0.3);
}

.title-badge.active {
    background: linear-gradient(90deg, var(--accent-warning), #ff9d00);
    color: #5a3b00;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

.champion-icon {
    margin-left: 6px;
    font-weight: bold;
    font-size: 1rem;
    vertical-align: middle;
    opacity: 0.95;
}

.active {
    background-color: rgba(0, 240, 255, 0.1);
}

.match-item {
    /* D-9: запись повторяет блок события — заголовок (номер события, тип и раунд)
       и две строки игроков. Отступы плотнее прежних: строк стало меньше, но они информативнее. */
    padding: 10px 12px;
    border-left: 4px solid var(--accent-primary);
    margin-bottom: 10px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.match-item:hover {
    transform: translateX(5px);
    background: rgba(0, 240, 255, 0.1);
}

.match-item.completed {
    background: rgba(0, 255, 157, 0.05);
    border-left-color: var(--accent-success);
}

/* D-9: заголовок записи выровнен как в блоках события (там центрирует .info-panel). */
.match-item .match-tournament {
    text-align: center;
    margin-bottom: 6px;
}

.winner {
    font-weight: bold;
    color: var(--accent-success);
}

.loser {
    color: var(--text-muted);
    opacity: 0.7;
}

.points {
    display: inline-block;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 5px;
    font-weight: bold;
}

.season-match {
    border-left-color: var(--accent-success);
}

.non-tournament-match {
    border-left-color: var(--text-muted);
}

.tournament-32 { border-left-color: var(--accent-danger); }
.tournament-16 { border-left-color: #fd7e14; }
.tournament-8 { border-left-color: var(--accent-warning); }
.tournament-elite { border-left-color: #9c27b0; }
.tournament-high { border-left-color: #2196f3; }
.tournament-middle { border-left-color: #4caf50; }
.tournament-low { border-left-color: #ff9800; }

.tournament-info {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

.tournament-info h3 {
    margin-bottom: 5px;
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
}

.next-match {
    background: rgba(0, 240, 255, 0.1);
    border-left: 4px solid var(--accent-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.match-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 5px;
}

.status-active {
    background: var(--accent-success);
    color: var(--bg-primary);
}

.status-completed {
    background: var(--text-muted);
    color: var(--bg-primary);
}

.show-info {
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    color: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    box-shadow: var(--glow-primary);
    position: relative;
    overflow: hidden;
}

.show-info-main {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.show-info-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.info-panel {
    /* D-14: панель события — тёмное «смокед-стекло», а не 30% чёрного поверх градиента.
       Карточка «Трансляция» залита ярким градиентом (фиолетовый → циан), и сквозь
       полупрозрачную панель фон получался средним по яркости: на нём не читались не только
       красные, но и остальные акценты (контраст 3.2–3.7:1 при норме AA 4.5:1), а
       «тёмно-красный» текст сливался с фоном полностью (1.0:1). Тёмная подложка вернула
       читаемость всем цветам сразу (замеры — analysis/scratch/d14-contrast2.js). */
    background: rgba(9, 13, 22, 0.78);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    /* D-5: фиксированная высота — иначе показ боя (в «Текущем событии» больше строк,
       чем у таймера) растягивал строку и вся секция дёргалась по высоте. */
    height: var(--info-panel-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-panel h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
    /* D-14: подпись блока — светлая. Прежний цвет (--bg-primary, почти чёрный) был рассчитан
       на яркую полупрозрачную панель; на тёмной подложке он не виден вовсе. */
    color: var(--text-secondary);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.info-panel-content {
    font-size: 0.9rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    /* Высота блока зафиксирована — длинное содержимое не должно растаскивать панель. */
    overflow: hidden;
    /* D-13: внизу содержимого каждого блока зарезервирована полоса под индикатор
       процессинга (--event-processing-strip в :root). Полоса есть во всех трёх блоках
       и во всех состояниях, поэтому строки игроков в «Текущем событии» центрируются
       ровно так же, как в «Последнем» и «Предстоящем», а индикатор рисуется в этой полосе
       и ничего не сдвигает. Индикатор спозиционирован от этого блока (position: relative). */
    padding-bottom: var(--event-processing-strip);
    position: relative;
}

/* D-5: на узком экране три колонки сжимаются, имена игроков переносятся на вторую строку,
   и содержимого становится больше. Высота блоков поднимается, чтобы ничего не обрезалось;
   она остаётся ОДНОЙ на все три блока, поэтому секция по-прежнему не дёргается.
   Значения замерены по самому высокому состоянию (показ боя) для каждой полосы ширины. */
@media (max-width: 1199px) {
    :root {
        --info-panel-height: 276px;
    }
}

@media (max-width: 1023px) {
    :root {
        --info-panel-height: 320px;
    }
}

/* Ниже 768px три колонки складываются в один столбец (как на телефоне):
   места хватает, и блоки возвращаются к обычной высоте. */
@media (max-width: 768px) {
    :root {
        --info-panel-height: 258px;
    }
}

.timer-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: var(--accent-warning);
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
    transition: all 0.3s ease;
    font-weight: 700;
}

.timer-update {
    animation: timerPulse 0.5s ease;
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.last-match-result, .next-match-preview {
    font-size: 0.85rem;
    line-height: 1.4;
    width: 100%;
}

.match-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.78rem;
    margin-right: 5px;
    font-weight: 600;
}

.match-type-badge.season-match {
    background: var(--accent-success);
    color: white;
}

.match-participants {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.match-participant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

.match-participant.winner {
    background: rgba(0, 255, 157, 0.2);
    color: var(--accent-success);
    font-weight: bold;
}

.match-participant.loser {
    /* D-14: подложка чуть заметнее (было 0.1): на фоне карточки «Трансляция» проигравший
       отличался от победителя почти незаметно. */
    background: rgba(255, 42, 109, 0.14);
    color: var(--text-secondary);
}

.participant-name {
    flex: 1;
    text-align: left;
}

.participant-rank {
    display: inline-block;
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent-primary);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.65rem;
    margin-left: 4px;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
}

/* D-7: строка игрока в блоках «Последнее / Текущее / Предстоящее событие».
   Слева по порядку: место, категория (ELITE/HIGH/MIDDLE/LOW), полное имя, бейджи титулов.
   Справа по порядку: очки за событие, статус «Победа» / «Поражение».
   Очки больше не стоят по центру — центр строки освобождён под имя.
   Строка переносится: в узкой панели правая часть уезжает на вторую строку и прижимается
   вправо, а имя получает всю ширину. Без переноса имя сжималось до одной буквы и блок
   вырастал втрое — панель с фиксированной высотой обрезала содержимое. */
.match-participant.event-player-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px var(--event-row-gap);
}

.event-player-id {
    /* D-10: не flex по содержимому, а grid с фиксированными колонками.
       Место и категория занимают ровно свою ширину (по максимуму), поэтому имя
       у всех игроков начинается в одной и той же точке. */
    display: grid;
    grid-template-columns: var(--event-rank-width) var(--event-tier-width) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--event-row-gap);
    flex: 1 1 auto;
    min-width: 0;
}

/* Имя и бейджи титулов — один блок: бейджи не отбирают ширину у имени отдельной
   колонкой, а идут сразу за ним и подрезаются, если места не хватает. */
.event-player-main {
    display: flex;
    align-items: center;
    gap: var(--event-row-gap);
    min-width: 0;
}

/* Плашка места заполняет свою колонку: «1» и «32» занимают одинаковое место. */
.event-player-id .participant-rank {
    margin-left: 0;
    width: 100%;
    text-align: center;
}

/* Плашка категории — тоже на всю колонку: LOW и MIDDLE одной ширины, имя не сдвигается. */
.event-player-id .participant-tier {
    width: 100%;
    text-align: center;
}

.event-player-id .participant-name {
    /* D-10: имя занимает остаток колонки; переносится по словам, а не режется. */
    min-width: 0;
    overflow-wrap: break-word;
    flex: 1 1 auto;
}

.participant-tier {
    flex: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.58rem;
    font-weight: bold;
    letter-spacing: 0.4px;
    padding: 1px 5px;
    border-radius: 8px;
}

/* Цвета категорий — те же, что у групп в таблице рейтинга (.group-*). */
.participant-tier.tier-elite {
    background: rgba(255, 209, 102, 0.28);
    color: var(--accent-warning);
}

.participant-tier.tier-high {
    background: rgba(0, 240, 255, 0.24);
    color: var(--accent-primary);
}

.participant-tier.tier-middle {
    background: rgba(0, 255, 157, 0.24);
    color: var(--accent-success);
}

.participant-tier.tier-low {
    /* D-14: тон плашки — как у остальных категорий (тот же оттенок, полупрозрачный),
       а текст — читаемый светлый красный. Было «тёмно-красный на тёмно-красном»: 1.3:1. */
    background: rgba(255, 42, 109, 0.22);
    color: var(--accent-danger-soft);
}

.participant-badges {
    /* Титулов может быть много (7 турниров + сезонные), и они не должны раздувать строку:
       панель фиксированной высоты, поэтому лишние бейджи подрезаются, а не переносят строку. */
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    justify-self: start;
}

/* D-8: у самих бейджей есть margin-left для строчного текста (таблицы, «Победитель»).
   Внутри строки события отступ задаёт gap родителя, иначе зазор после имени
   получался больше остальных. */
.event-player-id .champion-badge,
.event-player-id .season-champion-badge {
    margin-left: 0;
}

.event-player-outcome {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}

.event-status {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: bold;
    letter-spacing: 0.3px;
    /* Место под «Поражение» держим всегда: иначе при объявлении результата
       очки сдвинулись бы влево. */
    min-width: 5.6em;
    text-align: right;
}

.event-status.win {
    color: var(--accent-success);
}

.event-status.loss {
    /* D-14: светлый красный вместо тёмного — тёмный на панели события не читался (1.04:1). */
    color: var(--accent-danger-soft);
}

.event-status.pending {
    min-height: 1em;
}

/* D-9: у ещё не сыгранного боя очков нет, но правый столбец держим занятым. */
.event-status.awaiting {
    /* D-14: «Ожидает» — приглушённый серый, но не настолько, чтобы пропасть на тёмной
       панели: --text-muted на ней даёт 2.6:1, --text-secondary — 5:1. */
    color: var(--text-secondary);
    font-weight: normal;
    letter-spacing: 0;
}

.event-points {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.event-points.positive {
    background: rgba(0, 255, 157, 0.22);
    color: var(--accent-success);
}

.event-points.zero {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

.event-points.negative {
    background: rgba(255, 42, 109, 0.2);
    /* D-14: тот же читаемый красный, что у «Поражение» и LOW. */
    color: var(--accent-danger-soft);
}

/* D-5: показ боя в центральном блоке «Текущее событие».
   Шаг 1 — процессинг (точки + «Поединок идёт…»), шаг 2 — результат, затем блок снова таймер.
   Панели лежат на ярком градиенте .show-info, поэтому неактивные точки — тёмные полупрозрачные,
   активные — белые со свечением: светлое на светлом не читается.
   Длительность берётся из --processing-ms (значение по умолчанию — в :root, клиент ставит
   его из EVENT_PROCESSING_MS), чтобы точки заполнялись ровно к объявлению результата. */
.current-event-display {
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* D-13: индикатор процессинга стоит ПОД строками игроков — в полосе, зарезервированной
   внизу содержимого каждого блока (.info-panel-content, padding-bottom). Из потока он
   вынесен намеренно: в потоке он менял бы высоту содержимого между шагами «процессинг»
   и «результат», а панель центрирует содержимое по вертикали — имена игроков прыгали бы
   вверх-вниз и не совпадали по горизонтали с именами в «Последнем» и «Предстоящем» событии. */
.processing-view {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0;
}

.processing-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    height: 12px;
}

/* Точка загорается по очереди (задержка по --i) и остаётся гореть: к концу шага все точки
   светятся. Короткая вспышка в момент включения даёт «бегущий» фронт. */
.processing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(10, 14, 23, 0.3);
    box-shadow: inset 0 0 0 1px rgba(10, 14, 23, 0.2);
    animation: processing-dot-on calc(var(--processing-ms, 5000ms) / var(--processing-dots, 12)) ease-out forwards;
    animation-delay: calc(var(--processing-ms, 5000ms) / var(--processing-dots, 12) * var(--i, 0));
}

@keyframes processing-dot-on {
    0% {
        background: rgba(10, 14, 23, 0.3);
        transform: scale(1);
        box-shadow: inset 0 0 0 1px rgba(10, 14, 23, 0.2);
    }
    45% {
        background: #ffffff;
        transform: scale(1.55);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
    }
    100% {
        background: #ffffff;
        transform: scale(1);
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    }
}

.processing-text {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    /* D-14: подпись индикатора — циан, как и точки. Прежний почти чёрный текст с белой тенью
       был рассчитан на яркую панель; на тёмной подложке он сливался с фоном. */
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.45);
    animation: processing-blink 0.9s ease-in-out infinite;
}

@keyframes processing-blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* D-5: заглушка очков на время процессинга. Стоит на месте будущих очков в правой части
   строки, поэтому при объявлении результата имя и место не прыгают. */
.event-points.pending {
    background: rgba(10, 14, 23, 0.22);
    color: rgba(10, 14, 23, 0.65);
    letter-spacing: 2px;
    animation: processing-blink 0.9s ease-in-out infinite;
}

.event-points {
    flex: none;
}

/* D-5: объявление результата — короткая вспышка, чтобы смена шага читалась как событие. */
.current-event-display.event-revealed {
    animation: event-announced 0.45s ease-out;
}

@keyframes event-announced {
    0% { opacity: 0.35; transform: scale(0.985); }
    100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .processing-text,
    .event-points.pending,
    .current-event-display.event-revealed {
        animation: none;
    }
    /* Без анимации точки сразу светятся: смысл «идёт процесс» передаёт подпись. */
    .processing-dot {
        animation: none;
        background: #ffffff;
    }
}

.champion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-warning);
    color: #5a3b00;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 0.55rem;
    font-weight: bold;
    margin-left: 4px;
    line-height: 1;
}

.season-champion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-warning) 0%, #ff9d00 100%);
    color: #5a3b00;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    font-weight: bold;
    margin-left: 4px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 5px rgba(255, 209, 102, 0.5);
}

.event-show, .event-season {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
}

.event-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--bg-primary);
    text-align: center;
}

.event-details {
    font-size: 0.8rem;
    color: rgba(10, 14, 23, 0.8);
    text-align: center;
}

/* D-2: номер события шоу в «Последнее событие» / «Предстоящее событие» */
.event-number {
    display: block;
    width: fit-content;
    margin: 0 auto 4px;
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.info-panel-updating {
    animation: panelUpdate 0.5s ease;
}

@keyframes panelUpdate {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.timer-label {
    font-size: 0.8rem;
    color: var(--bg-primary);
    margin-bottom: 5px;
    min-height: 20px;
    opacity: 0.9;
}

.season-completed {
    background: linear-gradient(90deg, var(--accent-warning), #ff9d00);
    color: #5a3b00;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #ffa500;
    box-shadow: 0 0 15px rgba(255, 209, 102, 0.5);
    animation: pulse 2s infinite;
}

.tab-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tab.active {
    border-bottom-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 700;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--accent-primary);
    transition: var(--transition);
    z-index: -1;
}

.tab:hover::after {
    height: 100%;
    opacity: 0.1;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

.final-badge {
    background: var(--accent-warning);
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
}

.loser-points {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.small-muted {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.season-matrix-container {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 8px;
    background: var(--bg-card);
    padding: 10px;
}

.season-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.season-matrix th, .season-matrix td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.season-matrix th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--accent-primary);
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
}

.season-matrix .header-cell {
    background-color: var(--bg-secondary);
    font-weight: 700;
    min-width: 80px;
    color: var(--accent-primary);
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
}

.season-matrix .player-cell {
    background-color: rgba(26, 35, 50, 0.8);
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 150px;
    color: var(--text-primary);
}

.season-matrix .result-cell {
    min-width: 40px;
    height: 40px;
    transition: var(--transition);
}

.season-matrix .result-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    z-index: 2;
    position: relative;
}

.season-matrix .win {
    background-color: rgba(0, 255, 157, 0.2);
    color: var(--accent-success);
    font-weight: bold;
}

.season-matrix .loss {
    background-color: rgba(255, 42, 109, 0.2);
    color: var(--accent-danger);
    font-weight: bold;
}

.season-matrix .empty {
    background-color: rgba(139, 155, 180, 0.1);
}

.season-matrix .self {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: bold;
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.player-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-stats span {
    margin-right: 8px;
}

.titles-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.title-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    line-height: 1.2;
}

.title-name {
    min-width: 30px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.title-stars {
    display: flex;
    gap: 1px;
}

.title-star {
    color: var(--accent-warning);
    font-weight: bold;
}

.title-name.active {
    background: linear-gradient(90deg, var(--accent-warning), #ff9d00);
    color: #5a3b00;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 4px;
    padding: 2px 6px;
    margin: 1px 0;
    width: auto;
    max-width: 36px;
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
}

.matches-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-controls-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.match-controls-column .cyber-button {
    width: 100%;
}

.champions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.champion-card {
    padding: 15px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.05);
    border-left: 4px solid var(--accent-primary);
    transition: var(--transition);
}

.champion-card:hover {
    transform: translateX(5px);
    background: rgba(0, 240, 255, 0.1);
}

.champion-card h3 {
    margin-bottom: 8px;
    color: var(--accent-primary);
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
}

.champion-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.champion-name {
    font-weight: 600;
    color: var(--accent-primary);
}

.champion-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(139, 155, 180, 0.2);
    color: var(--text-secondary);
}

.champion-status.active {
    background: var(--accent-success);
    color: var(--bg-primary);
}

.season-rating-table {
    margin-top: 15px;
}

.season-rating-table th, .season-rating-table td {
    padding: 10px 12px;
}

.season-points {
    font-weight: 600;
    color: var(--accent-primary);
}

.group-separator {
    background-color: rgba(139, 155, 180, 0.15);
    font-weight: bold;
    color: var(--text-secondary);
    border-top: 1px solid rgba(0, 240, 255, 0.3);
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    font-family: 'Orbitron', sans-serif;
}

.group-separator td {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.group-elite {
    background-color: rgba(255, 209, 102, 0.25);
    color: var(--accent-warning);
}

.group-high {
    background-color: rgba(0, 240, 255, 0.25);
    color: var(--accent-primary);
}

.group-middle {
    background-color: rgba(0, 255, 157, 0.25);
    color: var(--accent-success);
}

.group-low {
    background-color: rgba(255, 42, 109, 0.25);
    color: var(--accent-danger);
}

.current-tournament {
    display: inline-block;
    background: var(--accent-secondary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
    font-weight: bold;
}

.title-history {
    display: inline-block;
    background: rgba(139, 155, 180, 0.2);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
    font-weight: bold;
}

.champions-tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
    margin-bottom: 15px;
}

.champion-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-size: 0.9rem;
    font-family: 'Orbitron', sans-serif;
}

.champion-tab.active {
    border-bottom-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 700;
}

.champions-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.champions-content.active {
    display: block;
}

.hall-of-fame-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.hall-of-fame-table th, .hall-of-fame-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.hall-of-fame-table th {
    background-color: var(--bg-secondary);
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
}

.hall-of-fame-table tr:hover {
    background-color: rgba(0, 240, 255, 0.05);
}

.titles-count {
    display: inline-block;
    background: var(--accent-secondary);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 5px;
    font-weight: bold;
}

.total-titles {
    font-weight: bold;
    color: var(--accent-primary);
}

.animated-number {
    display: inline-block;
    transition: all 0.5s ease;
}

.number-update {
    animation: numberPulse 0.5s ease;
}

@keyframes numberPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.neon-text {
    text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
}

.cyber-glitch {
    position: relative;
}

.cyber-glitch::before,
.cyber-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cyber-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.cyber-glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    5% { clip: rect(12px, 9999px, 59px, 0); }
    10% { clip: rect(48px, 9999px, 29px, 0); }
    15% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(63px, 9999px, 27px, 0); }
    25% { clip: rect(34px, 9999px, 55px, 0); }
    30% { clip: rect(86px, 9999px, 73px, 0); }
    35% { clip: rect(20px, 9999px, 20px, 0); }
    40% { clip: rect(26px, 9999px, 60px, 0); }
    45% { clip: rect(25px, 9999px, 66px, 0); }
    50% { clip: rect(57px, 9999px, 98px, 0); }
    55% { clip: rect(5px, 9999px, 46px, 0); }
    60% { clip: rect(82px, 9999px, 31px, 0); }
    65% { clip: rect(54px, 9999px, 27px, 0); }
    70% { clip: rect(28px, 9999px, 99px, 0); }
    75% { clip: rect(45px, 9999px, 69px, 0); }
    80% { clip: rect(23px, 9999px, 85px, 0); }
    85% { clip: rect(54px, 9999px, 84px, 0); }
    90% { clip: rect(45px, 9999px, 47px, 0); }
    95% { clip: rect(37px, 9999px, 20px, 0); }
    100% { clip: rect(4px, 9999px, 91px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

.rating-tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 240, 255, 0.3);
    margin-bottom: 15px;
}

.rating-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-size: 0.9rem;
    font-family: 'Orbitron', sans-serif;
}

.rating-tab.active {
    border-bottom-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 700;
}

.rating-content {
    display: none;
}

.rating-content.active {
    display: block;
}

.rating-row-elite {
    background-color: rgba(255, 209, 102, 0.2);
    color: var(--accent-warning);
}

.rating-row-high {
    background-color: rgba(0, 240, 255, 0.2);
    color: var(--accent-primary);
}

.rating-row-middle {
    background-color: rgba(0, 255, 157, 0.2);
    color: var(--accent-success);
}

.rating-row-low {
    background-color: rgba(255, 42, 109, 0.2);
    color: var(--accent-danger);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--glow-primary);
    border: 1px solid var(--accent-primary);
}

.modal-title {
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    transition: var(--transition);
}

.modal-input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--accent-primary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.names-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

.name-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.name-input-label {
    min-width: 30px;
    color: var(--text-primary);
    font-weight: 500;
}

.name-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--text-primary);
    transition: var(--transition);
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 8px var(--accent-primary);
}

.info-panel-updating {
    animation: panelUpdate 0.5s ease;
}

@keyframes panelUpdate {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    min-height: 20px;
}

.short-tournament-name {
    display: inline-block;
    background: var(--accent-secondary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 5px;
    font-weight: bold;
}

.participant-rank {
    display: inline-block;
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent-primary);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 4px;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
}

.champion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-warning);
    color: #5a3b00;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    font-weight: bold;
    margin-left: 4px;
    line-height: 1;
}

.season-champion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-warning) 0%, #ff9d00 100%);
    color: #5a3b00;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 4px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 5px rgba(255, 209, 102, 0.5);
}

.champion-card {
    padding: 12px 15px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.05);
    border-left: 4px solid var(--accent-primary);
    transition: var(--transition);
    margin-bottom: 10px;
}

.champion-card:hover {
    transform: translateX(3px);
    background: rgba(0, 240, 255, 0.1);
}

.champion-card h3 {
    margin-bottom: 8px;
    color: var(--accent-primary);
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 5px;
}

.tournament-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--accent-primary);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 8px;
}

.tournament-info-line {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-label {
    color: var(--accent-primary);
    font-weight: 600;
    display: inline-block;
    min-width: 100px;
}

.champion-card.inactive {
    padding: 10px 15px;
    min-height: auto;
    opacity: 0.8;
}

.champion-card.inactive .tournament-card-title {
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.champion-card.inactive .tournament-info-line {
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.season-card {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.season-card.completed {
    background: rgba(0, 255, 157, 0.05);
    border-left: 4px solid var(--accent-success);
}

.season-card.current {
    background: rgba(0, 240, 255, 0.05);
    border-left: 4px solid var(--accent-primary);
    animation: pulse 2s infinite;
}

.season-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.season-info {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.season-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-block;
}

.season-status.completed {
    background: var(--accent-success);
    color: var(--bg-primary);
}

.season-status.current {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

@media (max-width: 1200px) {
    .desktop-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .desktop-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .cyber-button {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }

    th, td {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .season-matrix {
        font-size: 0.7rem;
    }
    
    .season-matrix .player-cell {
        min-width: 120px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .modal-content {
        padding: 20px;
    }

    .names-input-grid {
        grid-template-columns: 1fr;
    }

    .show-info-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* D-5: высота блоков задаётся переменной --info-panel-height (см. .info-panel),
       здесь только выравнивание внутри одного столбца. */
    
    .match-participant {
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }

    /* D-7/D-10: строку игрока на узком экране оставляем СТРОКОЙ, а не колонкой.
       Общее правило .match-participant выше складывает содержимое в столбик; для строки
       игрока это ломало фиксированные колонки — блок «место · категория · имя» сжимался
       по содержимому, и имена начинались в разных местах. */
    .match-participant.event-player-line {
        flex-direction: row;
        align-items: center;
        gap: 2px var(--event-row-gap);
        text-align: left;
    }

    .match-participant.event-player-line .event-player-id {
        width: 100%;
    }

    .match-participant.event-player-line .event-points {
        font-size: 0.65rem;
        padding: 1px 6px;
    }

    .participant-tier {
        font-size: 0.54rem;
        padding: 1px 4px;
    }

    /* D-10: на узком экране шрифты мельче — колонки тоже уже, но по тому же принципу
       «по максимуму»: двузначное место и MIDDLE. */
    :root {
        --event-rank-width: 26px;
        --event-tier-width: 50px;
    }

    .event-status {
        font-size: 0.6rem;
        min-width: 4.6em;
    }
    
    .participant-name {
        text-align: center;
    }

    /* D-14: имя в строке игрока прижимается к «место · категория», как на компьютере.
       Правило выше центрирует имя — это осталось от прежней раскладки, где строка
       складывалась в столбик. С тех пор (D-7/D-10) строка стала grid с фиксированными
       колонками, и центрирование отрывало имя от плашек: между категорией и именем
       появлялся провал шириной в половину панели. */
    .match-participant.event-player-line .participant-name {
        text-align: left;
    }

    .info-label {
        min-width: 80px;
        font-size: 0.85rem;
    }
    
    .tournament-info-line {
        font-size: 0.85rem;
    }
    
    .season-card {
        padding: 12px;
    }
    
    .champion-card.inactive {
        padding: 8px 12px;
    }
}