/**
 * Единые стили для раздела реальных гонок
 * Используются на всех страницах: /real/, /real/pilot.php, /real/{championship}/
 */

/* ===========================================
   CSS переменные
   =========================================== */

:root {
    --real-primary: #e63946;
    --real-secondary: #1d3557;
    --real-gold: #ffd700;
    --real-silver: #c0c0c0;
    --real-bronze: #cd7f32;
    --champ-primary: var(--real-primary);
    --champ-gradient: linear-gradient(135deg, #1d3557 0%, #2a4a6d 100%);
}

/* Компактные отступы карточек */
.card-header {
    padding: 0.75rem 1.5rem;
}

.card-body {
    padding: 0.75rem 1.5rem;
}

/* ===========================================
   Hero секция главной страницы /real/
   =========================================== */

.real-hero {
    background: linear-gradient(135deg, #1d3557 0%, #2a4a6d 100%);
    color: #fff;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.real-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(230, 57, 70, 0.15));
    pointer-events: none;
}

.real-hero .hero-icon {
    font-size: 4rem;
    opacity: 0.3;
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.real-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.real-hero .lead {
    opacity: 0.9;
    font-size: 1.1rem;
}

.real-hero .hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.real-hero .hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    opacity: 0.85;
}

.real-hero .hero-stat strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--real-gold);
}

/* ===========================================
   Заголовочный инфо-блок страницы /real/
   =========================================== */

.real-page-heading {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    position: relative;
    padding: 0.75rem 10.5rem 0.75rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(29, 53, 87, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 18px rgba(29, 53, 87, 0.06);
}

.real-page-heading-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1d3557;
}

.real-page-heading-note {
    margin: 0;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.76rem;
    line-height: 1.35;
    color: #5f6b7a;
}

.real-page-heading-note i {
    margin-top: 0.05rem;
    font-size: 0.85rem;
    color: var(--real-primary);
}

.real-page-heading-feedback {
    display: inline-flex;
    position: absolute;
    top: 0.72rem;
    right: 0.9rem;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--real-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.real-page-heading-feedback span {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.real-page-heading-feedback i {
    font-size: 0.82rem;
    line-height: 1;
}

.real-page-heading-feedback:hover {
    color: #bd2f3b;
}

.real-page-heading-feedback:focus-visible {
    outline: 2px solid rgba(230, 57, 70, 0.4);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

[data-bs-theme="dark"] .real-page-heading {
    background: linear-gradient(180deg, rgba(45, 54, 72, 0.7) 0%, rgba(30, 37, 50, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

[data-bs-theme="dark"] .real-page-heading-title {
    color: #e9edf5;
}

[data-bs-theme="dark"] .real-page-heading-note {
    color: #b7c1d1;
}

[data-bs-theme="dark"] .real-page-heading-feedback {
    color: #ff7f88;
}

[data-bs-theme="dark"] .real-page-heading-feedback:hover {
    color: #ff9fa6;
}

[data-bs-theme="dark"] .real-page-heading-feedback:focus-visible {
    outline-color: rgba(255, 127, 136, 0.45);
}

@media (max-width: 576px) {
    .real-page-heading {
        display: flex;
        width: 100%;
        padding: 0.7rem 0.8rem;
    }

    .real-page-heading-title {
        font-size: 0.86rem;
    }

    .real-page-heading-note {
        font-size: 0.73rem;
    }

    .real-page-heading-feedback {
        position: static;
        align-self: flex-end;
        font-size: 0.73rem;
    }
}

/* ===========================================
   Социальные сети чемпионата
   =========================================== */

.championship-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.championship-social-links .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: #1d3557;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.championship-social-links .social-link .social-label {
    display: none;
}

.championship-social-links .social-link i {
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.championship-social-links .social-link:hover {
    transform: translateY(-2px);
}

.championship-social-links .social-link:hover i {
    filter: drop-shadow(0 0 6px currentColor);
}

/* Фирменные цвета иконок */
.championship-social-links .social-link[data-network="telegram_chat"] i,
.championship-social-links .social-link[data-network="telegram_channel"] i {
    color: #0088cc;
}

.championship-social-links .social-link[data-network="youtube"] i {
    color: #FF0000;
}

.championship-social-links .social-link[data-network="vk"] i {
    color: #0077FF;
}

/* Цветной фон при hover */
.championship-social-links .social-link[data-network="telegram_chat"]:hover,
.championship-social-links .social-link[data-network="telegram_channel"]:hover {
    background: rgba(0, 136, 204, 0.15);
}

.championship-social-links .social-link[data-network="youtube"]:hover {
    background: rgba(255, 0, 0, 0.15);
}

.championship-social-links .social-link[data-network="vk"]:hover {
    background: rgba(0, 119, 255, 0.15);
}

/* Тёмная тема */
[data-bs-theme="dark"] .championship-social-links .social-link {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .championship-social-links .social-link:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* ===========================================
   Hero секция чемпионата
   =========================================== */

.championship-hero {
    color: #fff;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.championship-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

.championship-hero .hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.championship-hero .hero-icon i {
    font-size: 2.5rem;
    opacity: 0.9;
}

.championship-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.championship-hero .lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

.championship-hero .hero-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

/* Hero Legends - компактный подиум внутри hero */
.hero-legends-wrapper {
    text-align: center;
}

.hero-legends-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.hero-legends {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem;
}

.hero-legends .hero-podium-item {
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    min-width: 130px;
    transition: transform 0.2s ease;
}

.hero-legends .hero-podium-item:hover {
    transform: translateY(-4px);
}

.hero-legends .hero-podium-item.gold {
    background: rgba(255, 215, 0, 0.25);
    border: 2px solid rgba(255, 215, 0, 0.5);
    order: 2;
    padding-bottom: 1.5rem;
}

.hero-legends .hero-podium-item.silver {
    background: rgba(192, 192, 192, 0.2);
    border: 2px solid rgba(192, 192, 192, 0.4);
    order: 1;
    padding-bottom: 1rem;
}

.hero-legends .hero-podium-item.bronze {
    background: rgba(205, 127, 50, 0.25);
    border: 2px solid rgba(205, 127, 50, 0.5);
    order: 3;
    padding-bottom: 0.75rem;
}

.hero-legends .hero-podium-position {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.hero-legends .hero-podium-item.gold .hero-podium-position {
    color: #ffd700;
}

.hero-legends .hero-podium-item.silver .hero-podium-position {
    color: #e0e0e0;
}

.hero-legends .hero-podium-item.bronze .hero-podium-position {
    color: #e6a85c;
}

.hero-legends .hero-podium-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
}

.hero-legends .hero-podium-name a {
    color: inherit;
    text-decoration: none;
}

.hero-legends .hero-podium-name a:hover {
    text-decoration: underline;
}

.hero-legends .hero-podium-points {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Мобильная адаптивность hero legends */
@media (max-width: 991px) {
    .hero-legends {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .hero-legends .hero-podium-item {
        order: unset !important;
        min-width: 100px;
        padding: 0.5rem 0.75rem !important;
    }

    .hero-legends .hero-podium-item.gold {
        order: 0 !important;
    }

    .hero-legends .hero-podium-position {
        font-size: 1.25rem;
    }

    .hero-legends .hero-podium-name {
        font-size: 0.8rem;
    }

    .hero-legends .hero-podium-points {
        font-size: 0.8rem;
    }
}

/* ===========================================
   Hero секция профиля пилота (компактный дизайн)
   =========================================== */

.pilot-hero-compact .card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .pilot-hero-compact .card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Аватар компактный */
.pilot-avatar-compact {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--champ-primary) 0%, rgba(0,0,0,0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Имя компактное */
.pilot-name-compact {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--real-secondary);
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .pilot-name-compact {
    color: #fff;
}

/* Layout: основная инфо слева, метрики справа */
.pilot-hero-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.pilot-main-info {
    flex: 1 1 auto;
    min-width: 0;
}

.pilot-side-column {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.pilot-stats-inline {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.625rem;
    background: rgba(0, 0, 0, 0.03);
    transition: background-color 0.2s;
    min-width: 6.5rem;
}

.stat-chip:hover {
    background: rgba(0, 0, 0, 0.05);
}

.stat-chip i {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* --- Next Event Chip --- */
.stat-chip-event {
    border-left: 3px solid var(--champ-primary);
    cursor: pointer;
    min-width: 11rem;
    position: relative;
    padding-right: 1.5rem;
    margin-right: 0.25rem;
}

.stat-chip-event-info {
    min-width: 0;
}

.stat-chip-event-track {
    font-size: 0.65rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
    line-height: 1.1;
}

[data-bs-theme="dark"] .stat-chip-event-track {
    color: #adb5bd;
}

.stat-chip-event::after {
    content: '';
    position: absolute;
    right: -0.35rem;
    top: 15%;
    height: 70%;
    width: 1px;
    background: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .stat-chip-event::after {
    background: rgba(255, 255, 255, 0.1);
}

.stat-chip-event-actions {
    position: absolute;
    right: 0.15rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-chip-event-menu {
    background: none;
    border: none;
    padding: 0.1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1;
}

.stat-chip-event:hover .stat-chip-event-menu {
    opacity: 0.7;
}

.stat-chip-event-menu:hover {
    opacity: 1 !important;
}

[data-bs-theme="dark"] .stat-chip-event-menu {
    color: #adb5bd;
}

/* Countdown color classes */
.countdown-danger { color: #dc3545; }
.countdown-warning { color: #fd7e14; }
.countdown-info { color: #0d6efd; }
.countdown-muted { color: #6c757d; }

[data-bs-theme="dark"] .countdown-muted { color: #adb5bd; }

.pilot-stats-inline .stat-value-sm {
    font-size: 1.25rem;
}

.pilot-stats-inline .stat-label-sm {
    font-size: 0.72rem;
    margin-top: 0.1rem;
    white-space: nowrap;
}

[data-bs-theme="dark"] .stat-chip {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .stat-chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Отдельный блок чемпионатов пилота */
.pilot-championships-panel {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
}

.pilot-championships-title {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.pilot-side-column .pilot-championships-title {
    width: 100%;
    justify-content: flex-end;
}

.pilot-side-column .pilot-championship-badges {
    justify-content: flex-end;
}

.pilot-championship-badges .badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .pilot-championships-panel {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .pilot-championships-title {
    color: #adb5bd;
}

/* Легенды в правой колонке: выравнивание справа */
.pilot-side-column #legendsContainer .d-flex {
    justify-content: flex-end;
}

@media (max-width: 991.98px) {
    .pilot-side-column #legendsContainer .d-flex {
        justify-content: flex-start;
    }
}

/* Статистика инлайн */
.pilot-stats-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .pilot-stats-row {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.stat-inline {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.stat-inline:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .stat-inline {
    background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .stat-inline:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stat-value-sm {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--real-secondary);
}

[data-bs-theme="dark"] .stat-value-sm {
    color: #fff;
}

.stat-label-sm {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

[data-bs-theme="dark"] .stat-label-sm {
    color: #adb5bd;
}

@media (max-width: 991.98px) {
    .pilot-hero-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .pilot-stats-inline {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .pilot-side-column {
        width: 100%;
        align-items: stretch;
        gap: 0.6rem;
    }

    .pilot-side-column .pilot-championships-title {
        justify-content: flex-start;
    }

    .pilot-side-column .pilot-championship-badges {
        justify-content: flex-start;
    }

    .stat-chip {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.35rem 0.3rem;
        gap: 0.2rem;
        justify-content: center;
    }

    .stat-chip-event {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 1.2rem;
        margin-right: 0.15rem;
    }

    .stat-chip > div {
        min-width: 0;
        text-align: center;
    }

    .stat-chip i {
        font-size: 0.95rem;
    }
}

/* Адаптивность компактного hero */
@media (max-width: 768px) {
    .pilot-avatar-compact {
        width: 50px;
        height: 50px;
    }

    .pilot-name-compact {
        font-size: 1.5rem;
    }

    .stat-value-sm {
        font-size: 1.25rem;
    }

    .stat-label-sm {
        font-size: 0.75rem;
    }

    .stat-inline {
        padding: 0.5rem;
    }

    .pilot-stats-inline .stat-value-sm {
        font-size: 1rem;
    }

    .pilot-stats-inline .stat-label-sm {
        font-size: 0.62rem;
        line-height: 1.05;
        overflow-wrap: anywhere;
    }

    .pilot-championships-title {
        font-size: 0.76rem;
    }
}

@media (max-width: 576px) {
    .pilot-name-compact {
        font-size: 1.25rem;
    }

    .stat-value-sm {
        font-size: 1.1rem;
    }

    .stat-chip {
        padding: 0.3rem 0.2rem;
        gap: 0.15rem;
    }

    .stat-chip i {
        font-size: 0.85rem;
    }

    .stat-chip-event {
        padding-right: 1rem;
        min-width: 0;
    }

    .stat-chip-event-menu {
        font-size: 0.7rem;
    }

    .pilot-stats-inline .stat-value-sm {
        font-size: 0.92rem;
    }

    .pilot-stats-inline .stat-label-sm {
        font-size: 0.56rem;
    }

    .pilot-championships-panel {
        padding-top: 0.6rem;
    }

    .pilot-championship-badges .badge {
        font-size: 0.78rem;
    }
}

/* ===========================================
   Компактные горизонтальные карточки чемпионатов
   =========================================== */

.championship-card-compact {
    position: relative;
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    height: 100%;
}

.championship-card-compact:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Ссылка на сайт чемпионата (правый нижний угол) */
.championship-website-link {
    position: absolute;
    bottom: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.championship-card-compact:hover .championship-website-link {
    opacity: 1;
}

/* Мобильная статистика */
.champ-stats-mobile small {
    font-size: 0.7rem;
}

/* Бейдж типа чемпионата */
.championship-type-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.championship-type-badge.timeattack {
    background-color: #28a745;
    color: #fff;
}

.championship-type-badge.circuit {
    background-color: #e63946;
    color: #fff;
}

.championship-type-badge i {
    font-size: 0.75rem;
}

/* Название и статистика */
.championship-card-compact h6 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.championship-card-compact small {
    font-size: 0.75rem;
}

.championship-card-compact .text-truncate {
    max-width: 200px;
}

/* Ограничение ширины для предотвращения переполнения */
.min-width-0 {
    min-width: 0;
}

/* Темная тема */
[data-bs-theme="dark"] .championship-card-compact {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .championship-card-compact:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .championship-card-compact h6 {
        font-size: 0.9rem;
    }

    .championship-type-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }
}

@media (max-width: 576px) {
    /* Для 2 столбцов на мобильных */
    .championship-card-compact {
        min-height: 60px;
    }

    .championship-card-compact .card-body {
        padding: 0.4rem !important;
        gap: 0.4rem !important;
    }

    .championship-card-compact h6 {
        font-size: 0.75rem;
        line-height: 1.1;
    }

    .championship-card-compact small {
        font-size: 0.65rem;
    }

    .championship-card-compact .text-truncate {
        max-width: 100px;
    }

    .championship-type-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.25rem;
        top: 0.25rem;
        right: 0.25rem;
        gap: 0.15rem;
    }

    .championship-type-badge i {
        font-size: 0.65rem;
    }

    /* Скрываем внешнюю ссылку на мобильных */
    .championship-card-compact .flex-shrink-0.text-end {
        display: none !important;
    }
}

/* ===========================================
   Карточки чемпионатов (DEPRECATED - сохранено для обратной совместимости)
   =========================================== */

.championship-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 2px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.championship-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--champ-color, var(--real-primary));
}

.championship-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--champ-color, var(--real-primary));
}

.championship-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--champ-color, var(--real-primary)) 0%, rgba(0,0,0,0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.championship-logo i {
    font-size: 2rem;
    color: #fff;
}

.championship-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--real-secondary);
    margin-bottom: 0.5rem;
}

.championship-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.championship-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.champ-stat {
    text-align: center;
}

.champ-stat strong {
    display: block;
    font-size: 1.25rem;
    color: var(--champ-color, var(--real-primary));
}

.champ-stat small {
    color: #6c757d;
    font-size: 0.8rem;
}

.championship-badge {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.championship-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    background: var(--champ-color, var(--real-primary));
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.championship-link:hover {
    background: var(--real-secondary);
    color: #fff;
    transform: scale(1.05);
}

[data-bs-theme="dark"] .championship-card {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .championship-name {
    color: #fff;
}

[data-bs-theme="dark"] .championship-title,
[data-bs-theme="dark"] .championship-badge,
[data-bs-theme="dark"] .champ-stat small {
    color: #adb5bd;
}

/* ===========================================
   Карточки статистики
   =========================================== */

.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card i {
    color: var(--champ-primary);
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--real-secondary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

[data-bs-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .stat-value {
    color: #fff;
}

[data-bs-theme="dark"] .stat-label {
    color: #adb5bd;
}

/* ===========================================
   Секция заголовков
   =========================================== */

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--real-secondary);
    display: flex;
    align-items: center;
}

[data-bs-theme="dark"] .section-title {
    color: #e9ecef;
}

/* ===========================================
   Season + Stages Panel (unified card)
   =========================================== */

/* Карточка: dropdown выходит за границы, поверх соседних карточек */
.season-panel-card {
    overflow: visible;
    position: relative;
    z-index: 3;
}

/* Заголовок с inline dropdown */
.stages-panel-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 1rem;
}
.stages-panel-suffix {
    font-weight: 400;
    color: #6c757d;
}

/* Индикатор выбранного этапа */
.stage-indicator {
    font-weight: 400;
    font-size: 0.85rem;
}
.stage-indicator-divider {
    color: #ced4da;
    margin: 0 0.3rem;
}
.stage-indicator-inactive {
    color: #adb5bd;
}
.stage-indicator-active {
    color: var(--champ-primary, #e63946);
    font-weight: 500;
}
.stage-indicator-close {
    background: none;
    border: none;
    color: #e63946;
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.1rem;
    cursor: pointer;
    vertical-align: super;
    transition: opacity 0.15s;
    opacity: 0.7;
}
.stage-indicator-close:hover {
    opacity: 1;
}

/* 3-column grid */
.stages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

/* Compact stage card — border-left accent */
.stage-compact-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.45rem;
    border: none;
    border-left: 3px solid var(--champ-primary);
    border-radius: 0 0.375rem 0.375rem 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.stage-compact-card:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    color: inherit;
}
.stage-compact-card.stage-active {
    background: var(--bs-primary-bg-subtle) !important;
    border-left-color: var(--champ-primary);
}

/* Stage number badge */
.stage-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    background: var(--champ-primary);
    color: #fff;
}

/* Stage info block */
.stage-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.stage-info-top,
.stage-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.stage-compact-track {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    color: var(--real-secondary);
}
.stage-compact-pilots {
    margin-left: auto;
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}
.stage-compact-pilots .ti {
    font-size: 0.65rem;
    margin-right: 2px;
}
.stage-weather-inline {
    font-size: 0.65rem;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
    color: #6c757d;
}
.stage-info-bottom {
    font-size: 0.7rem;
    color: #6c757d;
}
.stage-compact-date {
    white-space: nowrap;
}
.stage-info-top .stage-countdown-badge {
    font-size: 0.6rem;
}

/* Dark theme compact cards */
[data-bs-theme="dark"] .stage-compact-card {
    border-left-color: var(--champ-primary);
}
[data-bs-theme="dark"] .stage-compact-card:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-bs-theme="dark"] .stage-compact-track {
    color: #e0e0e0;
}
[data-bs-theme="dark"] .stage-info-bottom {
    color: #adb5bd;
}

/* Mobile: 2-column grid */
@media (max-width: 991.98px) {
    .stages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stage-compact-card {
        padding: 0.2rem 0.35rem;
        gap: 0.25rem;
    }
    .stage-num {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
    .stage-compact-track {
        font-size: 0.7rem;
    }
    .stage-compact-date {
        font-size: 0.65rem;
    }
    .stage-compact-pilots,
    .stage-weather-inline,
    .stage-countdown-badge {
        display: none;
    }
}

/* Dark theme */
[data-bs-theme="dark"] .stages-panel-suffix,
[data-bs-theme="dark"] .stage-indicator-inactive {
    color: #6c757d;
}
[data-bs-theme="dark"] .stage-indicator-divider {
    color: #495057;
}

/* ===========================================
   Season Dropdown
   =========================================== */

.season-dropdown-btn {
    border-radius: 12px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.4;
    background: var(--champ-primary);
    color: #fff;
    border: 1px solid var(--champ-primary);
    transition: all 0.2s ease;
}
.season-dropdown-btn:hover,
.season-dropdown-btn:focus,
.season-dropdown-btn.show {
    background: var(--champ-primary);
    color: #fff;
    filter: brightness(0.9);
    border-color: var(--champ-primary);
}

.season-dropdown {
    position: relative;
    z-index: 3;
}

.season-dropdown-menu {
    padding: 0.4rem;
    border-radius: 10px;
    min-width: auto;
}

.season-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
}

.season-grid-item {
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.813rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
}
.season-grid-item:hover {
    background: #dee2e6;
    color: var(--champ-primary);
}
.season-grid-item.active {
    background: var(--champ-primary);
    color: #fff;
}

.season-grid-item .badge-new {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.45rem;
    background: #ffc107;
    color: #333;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
    line-height: 1.2;
}

/* "За все время" внутри dropdown */
.season-alltime-item {
    display: block;
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    font-size: 0.813rem;
    line-height: 1.3;
    text-align: left;
    background: linear-gradient(135deg, #ffd70022 0%, #f4a90022 100%);
    color: #856404;
    cursor: pointer;
    transition: all 0.15s ease;
}
.season-alltime-item:hover {
    background: linear-gradient(135deg, #ffd70044 0%, #f4a90044 100%);
}
.season-alltime-item.active {
    background: linear-gradient(135deg, #ffd700 0%, #f4a900 100%);
    color: #1d3557;
}

/* Dark theme */
[data-bs-theme="dark"] .season-dropdown-menu {
    background: var(--bs-body-bg);
    border-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .season-grid-item {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}
[data-bs-theme="dark"] .season-grid-item:hover {
    background: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .season-grid-item.active {
    background: var(--champ-primary);
    color: #fff;
}
[data-bs-theme="dark"] .season-alltime-item {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}
[data-bs-theme="dark"] .season-alltime-item:hover {
    background: rgba(255, 215, 0, 0.2);
}
[data-bs-theme="dark"] .season-alltime-item.active {
    background: linear-gradient(135deg, #ffd700 0%, #f4a900 100%);
    color: #1d3557;
}

/* ===========================================
   Турнирная таблица
   =========================================== */

/* Убираем padding от Vuexy .tab-content внутри card-body p-0 */
.card-body.p-0 .tab-content {
    padding: 0;
}

.standings-table {
    margin-bottom: 0;
    width: 100%;
}

/* Разрешаем dropdown поиска выходить за пределы таблицы */
#standingsContainer .table-responsive {
    overflow: visible;
}

.standings-table th {
    font-weight: 600;
    font-size: 12px;
    color: #6c757d;
    border-bottom: 2px solid var(--champ-primary);
    padding: 0.4rem 0.5rem;
}

.standings-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.standings-table tbody tr {
    transition: background-color 0.15s ease;
}

.standings-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.05);
}

/* Объединённая ячейка: позиция + пилот */
.pilot-cell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Позиции в таблице — квадрат как stage-num */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    background: #e9ecef;
    color: #495057;
}

.position-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #5c4a00;
    box-shadow: 0 1px 4px rgba(255, 215, 0, 0.35);
}

.position-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #4a4a4a;
    box-shadow: 0 1px 4px rgba(192, 192, 192, 0.35);
}

.position-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
    color: #4a2f00;
    box-shadow: 0 1px 4px rgba(205, 127, 50, 0.35);
}

/* Бейдж "участвует в других чемпионатах" — мини-квадрат */
.other-champs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    padding: 1px 3px;
    margin-left: 3px;
    border-radius: 4px;
    background: var(--champ-primary);
    color: #fff;
    cursor: help;
    vertical-align: super;
}

/* Очки */
.points-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    border-left: 1px solid var(--bs-border-color);
    color: var(--champ-primary);
}

[data-bs-theme="dark"] .points-value {
    color: #ff6b7a;
}

/* Время */
.time-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
}

[data-bs-theme="dark"] .time-value {
    color: #e9ecef;
}

/* Лучший круг гонки — фиолетовый */
.fastest-lap {
    color: #7c3aed;
    font-weight: 700;
}
[data-bs-theme="dark"] .fastest-lap {
    color: #a78bfa;
}

/* Ссылки на пилотов */
.pilot-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.pilot-link:hover {
    color: var(--champ-primary);
}

[data-bs-theme="dark"] .pilot-link {
    color: #e9ecef;
}

[data-bs-theme="dark"] .pilot-link:hover {
    color: var(--champ-primary);
}

/* ===========================================
   Табы классов
   =========================================== */

/* Старые .class-tabs удалены — теперь .seg-control в badge-tabs.css */

/* ===========================================
   Карточки этапов
   =========================================== */

.stage-card:not(.stage-compact-card) {
    padding: 0.25rem 0.75rem;
    transition: background-color 0.15s ease;
    cursor: pointer;
    border: none;
    border-radius: 0;
}

.stage-card:not(.stage-compact-card):hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.stage-card:not(.stage-compact-card).active {
    border-left: 3px solid var(--champ-primary);
}

.stage-card:not(.stage-compact-card).stage-active {
    background: var(--bs-primary-bg-subtle) !important;
    border-left: 3px solid var(--champ-primary, var(--bs-primary));
}

.stage-number {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--champ-primary);
    width: 1.5rem;
    text-align: center;
}

.stage-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--real-secondary);
    line-height: 1.3;
}

.stage-meta {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
}

.stage-stats {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.4;
}

[data-bs-theme="dark"] .stage-card:not(.stage-compact-card) {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .stage-card:not(.stage-compact-card):hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .stage-name {
    color: #fff;
}

[data-bs-theme="dark"] .stage-number {
    color: #ff6b7a;
}

[data-bs-theme="dark"] .stage-meta,
[data-bs-theme="dark"] .stage-stats {
    color: #adb5bd;
}

/* ===========================================
   Результаты этапа
   =========================================== */

.results-table {
    margin-bottom: 0;
    width: 100%;
}

.results-table th {
    font-weight: 600;
    font-size: 12px;
    color: #6c757d;
    border-bottom: 2px solid var(--champ-primary);
    padding: 0.4rem 0.5rem;
}

.results-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.results-table tbody tr {
    transition: background-color 0.15s ease;
}

.results-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.05);
}

/* Иконка шин с тултипом */
.tires-icon {
    color: #6c757d;
    cursor: help;
    font-size: 0.85rem;
}
.tires-icon:hover {
    color: var(--champ-primary);
}

/* ===========================================
   Поиск пилотов
   =========================================== */

/* Inline поиск пилотов в заголовке таблицы */
.th-pilot-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pilot-search-inline {
    flex: 1;
    max-width: 180px;
}

.pilot-search-section {
    position: relative;
    z-index: 3;
}

.pilot-search-card {
    overflow: visible;
}

.pilot-search-container {
    position: relative;
}

/* Поиск пилота на главной /real/ */
.pilot-search-container:not(.pilot-search-inline) .pilot-search-input {
    padding-left: 2.2rem;
}

.pilot-search-container:not(.pilot-search-inline) .pilot-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.pilot-search-inline .pilot-search-input {
    width: 100%;
    height: 26px;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem 0.15rem 1.8rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.pilot-search-inline .pilot-search-input:focus {
    border-color: var(--champ-primary);
    background: #fff;
}

.pilot-search-inline .pilot-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #6c757d;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Скрываем иконку при фокусе на input */
.pilot-search-container:focus-within .pilot-search-icon {
    opacity: 0;
}

/* Скрываем иконку когда есть текст */
.pilot-search-input:not(:placeholder-shown) ~ .pilot-search-icon {
    opacity: 0;
}

.pilot-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 250px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.pilot-search-results.show {
    display: block;
}

.pilot-search-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.8rem;
}

.pilot-search-item:hover {
    background: rgba(230, 57, 70, 0.05);
}

.pilot-search-item:last-child {
    border-bottom: none;
}

[data-bs-theme="dark"] .pilot-search-inline .pilot-search-input {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .pilot-search-inline .pilot-search-input:focus {
    background: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .pilot-search-results {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .pilot-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* На мобильных — скрываем inline-поиск */
@media (max-width: 768px) {
    .pilot-search-inline {
        display: none;
    }
}

/* ===========================================
   Последние этапы
   =========================================== */

.recent-race-item {
    border-left: 3px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
}

.recent-race-item:hover {
    border-left-color: var(--champ-primary);
    background-color: rgba(230, 57, 70, 0.03);
}

/* ===========================================
   Бейджи достижений
   =========================================== */

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.achievement-badge i {
    font-size: 1rem;
}

.achievement-badge.gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    color: #5c4a00;
    border: 1px solid #ffd700;
}

.achievement-badge.silver {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #4a4a4a;
    border: 1px solid #c0c0c0;
}

.achievement-badge.bronze {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d4 100%);
    color: #4a2f00;
    border: 1px solid #cd7f32;
}

.achievement-badge.info {
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    color: #1864ab;
    border: 1px solid #74c0fc;
}

[data-bs-theme="dark"] .achievement-badge.gold {
    background: linear-gradient(135deg, #3d3a00 0%, #2d2b00 100%);
    color: #ffd700;
}

[data-bs-theme="dark"] .achievement-badge.silver {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .achievement-badge.bronze {
    background: linear-gradient(135deg, #3d2a00 0%, #2d1f00 100%);
    color: #e6a85c;
}

[data-bs-theme="dark"] .achievement-badge.info {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2840 100%);
    color: #74c0fc;
}

/* ===========================================
   Скелетон загрузки
   =========================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* ===========================================
   Пустые состояния
   =========================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--real-secondary);
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .empty-state {
    color: #adb5bd;
}

[data-bs-theme="dark"] .empty-state h5 {
    color: #e9ecef;
}

/* ===========================================
   Предстоящий этап
   =========================================== */

.upcoming-event-card {
    text-align: center;
}

.upcoming-event-details {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

/* ===========================================
   Анимации
   =========================================== */

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

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ===========================================
   Таблицы темная тема
   =========================================== */

[data-bs-theme="dark"] .standings-table th,
[data-bs-theme="dark"] .results-table th {
    color: #adb5bd;
    border-bottom-color: var(--champ-primary);
}

[data-bs-theme="dark"] .standings-table tbody tr:hover,
[data-bs-theme="dark"] .results-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.1);
}

/* ===========================================
   Accordion истории
   =========================================== */

.accordion-button:not(.collapsed) {
    background-color: rgba(230, 57, 70, 0.05);
    color: inherit;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(230, 57, 70, 0.25);
}

.season-year {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--champ-primary);
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: rgba(230, 57, 70, 0.1);
}

/* ===========================================
   Подиум топ-3 (Легенды)
   =========================================== */

.top-pilots-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem 0;
}

.podium-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
    min-width: 180px;
    border: 2px solid transparent;
}

.podium-item:hover {
    transform: translateY(-8px);
}

.podium-item.gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border-color: #ffd700;
    order: 2;
    padding-bottom: 3rem;
}

.podium-item.silver {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #c0c0c0;
    order: 1;
    padding-bottom: 2rem;
}

.podium-item.bronze {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d4 100%);
    border-color: #cd7f32;
    order: 3;
    padding-bottom: 1.5rem;
}

.podium-position {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.podium-item.gold .podium-position {
    color: #b8860b;
}

.podium-item.silver .podium-position {
    color: #6c757d;
}

.podium-item.bronze .podium-position {
    color: #cd7f32;
}

.podium-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--real-secondary);
    margin-bottom: 0.25rem;
}

.podium-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.podium-name a:hover {
    color: var(--champ-primary);
}

.podium-city {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.podium-stats {
    font-size: 0.85rem;
    color: #6c757d;
}

.podium-points {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--champ-primary);
}

/* Подиум - тёмная тема */
[data-bs-theme="dark"] .podium-item.gold {
    background: linear-gradient(135deg, #3d3a00 0%, #2d2b00 100%);
}

[data-bs-theme="dark"] .podium-item.silver {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
}

[data-bs-theme="dark"] .podium-item.bronze {
    background: linear-gradient(135deg, #3d2a00 0%, #2d1f00 100%);
}

[data-bs-theme="dark"] .podium-name {
    color: #fff;
}

[data-bs-theme="dark"] .podium-name a {
    color: #fff;
}

[data-bs-theme="dark"] .podium-name a:hover {
    color: var(--champ-primary);
}

[data-bs-theme="dark"] .podium-city,
[data-bs-theme="dark"] .podium-stats {
    color: #adb5bd;
}

[data-bs-theme="dark"] .podium-points {
    color: #ff6b7a;
}

/* ===========================================
   Badge стили для чемпионатов
   =========================================== */

/* Уменьшенный размер badge */
.badge-sm {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Улучшенная контрастность для светлых badge */
.badge {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover эффект для кликабельных badge */
a.badge:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Анимация появления */
.badge.fade-in {
    animation: badgeFadeIn 0.3s ease;
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Контейнер для badge на мобильных */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    align-items: center;
}

/* ===========================================
   Адаптивность
   =========================================== */

@media (max-width: 992px) {
    /* Подиум адаптивность */
    .top-pilots-podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-item {
        order: unset !important;
        width: 100%;
        max-width: 300px;
        padding-bottom: 1.5rem !important;
    }

    .podium-item.gold {
        order: 0 !important;
    }
    .real-hero .hero-icon {
        display: none;
    }

    .championship-hero .hero-icon {
        width: 60px;
        height: 60px;
    }

    .championship-hero .hero-icon i {
        font-size: 1.75rem;
    }

    .pilot-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .real-hero {
        padding: 2rem 1rem;
    }

    .real-hero h1 {
        font-size: 1.75rem;
    }

    .real-hero .hero-stats {
        gap: 1rem;
    }

    .championship-hero {
        padding: 1.5rem 1rem;
    }

    .championship-hero h1 {
        font-size: 1.75rem;
    }

    .pilot-hero {
        padding: 1.5rem;
    }

    .pilot-avatar {
        width: 60px;
        height: 60px;
    }

    .pilot-name {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .season-tabs .nav-link {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.3rem 0.4rem;
        font-size: 0.85rem;
    }

    /* Скрываем второстепенные колонки */
    .standings-table .hide-mobile,
    .results-table .hide-mobile {
        display: none;
    }

    .achievement-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 576px) {
    /* Подиум на мобильных */
    .podium-item {
        min-width: unset;
        padding: 1rem;
    }

    .podium-position {
        font-size: 2rem;
    }

    .podium-name {
        font-size: 1rem;
    }

    .podium-points {
        font-size: 1rem;
    }

    .real-hero h1 {
        font-size: 1.5rem;
    }

    .real-hero .hero-stat strong {
        font-size: 1rem;
    }

    .championship-hero {
        padding: 1rem;
    }

    .championship-hero h1 {
        font-size: 1.5rem;
    }

    .championship-hero .hero-icon {
        width: 50px;
        height: 50px;
        margin-right: 1rem !important;
    }

    .championship-hero .hero-icon i {
        font-size: 1.5rem;
    }

    .pilot-hero {
        padding: 1rem;
    }

    .pilot-avatar {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem !important;
    }

    .pilot-name {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .championship-card {
        padding: 1rem;
    }

    .championship-logo {
        width: 50px;
        height: 50px;
    }

    .championship-logo i {
        font-size: 1.5rem;
    }

    .championship-name {
        font-size: 1.25rem;
    }

    .stage-card {
        padding: 0.4rem 0.5rem;
    }

    .season-year {
        font-size: 1rem;
    }

    /* Badge адаптация для мобильных */
    .badge-sm {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    /* Контейнер badge с горизонтальной прокруткой */
    .badge-container {
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Скрыть некоторые badge на мобильных при необходимости */
    .hide-mobile-badge {
        display: none;
    }
}

/* ===========================================
   Цвета чемпионатов
   =========================================== */

[data-championship="rhhcc"] {
    --champ-primary: #2196f3;
    --champ-gradient: linear-gradient(135deg, #1565c0 0%, #2196f3 100%);
}

[data-championship="maxpowercars"] {
    --champ-primary: #9c27b0;
    --champ-gradient: linear-gradient(135deg, #6a1b9a 0%, #9c27b0 100%);
}

[data-championship="ltac"] {
    --champ-primary: #e91e63;
    --champ-gradient: linear-gradient(135deg, #ad1457 0%, #e91e63 100%);
}

[data-championship="trc"] {
    --champ-primary: #6f42c1;
    --champ-gradient: linear-gradient(135deg, #4a2c7a 0%, #6f42c1 100%);
}

[data-championship="raceclub"] {
    --champ-primary: #e63946;
    --champ-gradient: linear-gradient(135deg, #e63946 0%, #1d3557 100%);
}

[data-championship="mpcup"] {
    --champ-primary: #ffd700;
    --champ-gradient: linear-gradient(135deg, #f9a825 0%, #ffd700 100%);
}

[data-championship="ctc"] {
    --champ-primary: #2e7d32;
    --champ-gradient: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
}

/* ===========================================
   Touge Battle секция
   =========================================== */

.touge-battle-section {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.05) 0%, rgba(29, 53, 87, 0.05) 100%);
    border: 2px solid rgba(230, 57, 70, 0.2);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.touge-battle-section h3 {
    color: var(--champ-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.touge-battle-winner {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.touge-battle-winner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.touge-battle-winner .class-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--champ-primary);
    margin-bottom: 0.5rem;
}

.touge-battle-winner .winner-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--real-secondary);
}

.touge-battle-winner .winner-car {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.touge-battle-winner .trophy-icon {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .touge-battle-section {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1) 0%, rgba(29, 53, 87, 0.15) 100%);
    border-color: rgba(230, 57, 70, 0.3);
}

[data-bs-theme="dark"] .touge-battle-winner {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .touge-battle-winner .winner-name {
    color: #fff;
}

[data-bs-theme="dark"] .touge-battle-winner .winner-car {
    color: #adb5bd;
}

/* Бейдж победителя Touge Battle (корона рядом с именем) */
.touge-battle-badge {
    color: var(--real-gold);
    margin-left: 0.35rem;
    font-size: 0.95em;
    vertical-align: middle;
    cursor: help;
    transition: transform 0.2s ease, color 0.2s ease;
}

.touge-battle-badge:hover {
    transform: scale(1.15);
    color: #ffb700;
}

[data-bs-theme="dark"] .touge-battle-badge {
    color: #ffd700;
}

[data-bs-theme="dark"] .touge-battle-badge:hover {
    color: #ffe44d;
}

/* ===========================================
   Страницы автодромов (TRACKS)
   =========================================== */

/* CSS переменные для автодромов */
:root {
    --track-primary: #1d3557;
    --track-gradient: linear-gradient(135deg, #1d3557 0%, #2a4a6d 100%);
}

/* Hero meta для track/config страниц */
.track-page #heroMeta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
}

.track-page #heroMeta span {
    display: inline-flex;
    align-items: center;
}

[data-bs-theme="dark"] .track-page #heroMeta {
    color: #adb5bd;
}

/* --- Карточка трассы (grid) --- */
.track-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.track-card-configs {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.68rem;
    color: #8c96a0;
}

.track-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--track-primary);
}

.track-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--real-secondary, #1d3557);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.track-card-location {
    font-size: 0.72rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.track-card-metrics {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.track-metric {
    flex: 1;
    text-align: center;
}

.track-metric-value {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--real-secondary, #1d3557);
    line-height: 1.2;
}

.track-metric-label {
    display: block;
    font-size: 0.62rem;
    color: #8c96a0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.track-card-champs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.champ-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--seg-color, #6c757d);
    background: var(--seg-bg, #f0f1f3);
    border: 1px solid var(--seg-border, rgba(0, 0, 0, 0.08));
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}

[data-bs-theme="dark"] .track-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .track-card:hover {
    border-color: var(--track-primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .track-card-title {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .track-card-location,
[data-bs-theme="dark"] .track-card-champs {
    color: #9e9e9e;
}

[data-bs-theme="dark"] .track-metric-value {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .track-metric-label {
    color: #8a8a9e;
}

[data-bs-theme="dark"] .track-card-metrics {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* --- Конфигурации: grid + compact cards (как stages-grid) --- */
.configs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.config-compact-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.45rem;
    border: none;
    border-left: 3px solid var(--track-primary, #1d3557);
    border-radius: 0 0.375rem 0.375rem 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.config-compact-card:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.config-compact-card.config-active {
    background: rgba(29, 53, 87, 0.08) !important;
    border-left-width: 4px;
}

/* Config number badge */
.config-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    background: var(--track-primary, #1d3557);
    color: #fff;
}

/* Config info block */
.config-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.config-info-top,
.config-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.config-compact-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    color: var(--real-secondary);
}

.config-compact-stats {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.config-compact-stat {
    font-size: 0.6rem;
    color: #6c757d;
    white-space: nowrap;
}

.config-compact-stat .ti {
    font-size: 0.55rem;
    margin-right: 1px;
    vertical-align: middle;
}

.config-info-bottom {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Dark theme config compact cards */
[data-bs-theme="dark"] .config-compact-card {
    border-left-color: var(--track-primary, #1d3557);
}

[data-bs-theme="dark"] .config-compact-card:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .config-compact-card.config-active {
    background: rgba(29, 53, 87, 0.2) !important;
}

[data-bs-theme="dark"] .config-compact-name {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .config-compact-stat {
    color: #adb5bd;
}

/* Заголовок группы конфигурации в рекордах */
.records-config-header {
    background: rgba(29, 53, 87, 0.06);
    border-left: 3px solid var(--track-primary, #1d3557);
    color: var(--track-primary, #1d3557);
}

.records-config-group:first-child {
    margin-top: 0 !important;
}

[data-bs-theme="dark"] .records-config-header {
    background: rgba(29, 53, 87, 0.2);
    color: #7aafdf;
}

[data-bs-theme="dark"] .config-info-bottom {
    color: #adb5bd;
}

/* Mobile: 2-column grid */
@media (max-width: 991.98px) {
    .configs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .config-compact-card {
        padding: 0.2rem 0.35rem;
        gap: 0.25rem;
    }
    .config-num {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
    .config-compact-name {
        font-size: 0.7rem;
    }
}

/* --- Config indicator (аналог stage-indicator) --- */
.config-indicator {
    font-weight: 400;
    font-size: 0.85rem;
}

.config-indicator-divider {
    color: #ced4da;
    margin: 0 0.3rem;
}

.config-indicator-inactive {
    color: #adb5bd;
}

.config-indicator-active {
    color: var(--track-primary, #1d3557);
    font-weight: 500;
}

.config-indicator-close {
    background: none;
    border: none;
    color: var(--track-primary, #1d3557);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    margin: 0 0.1rem;
    cursor: pointer;
    vertical-align: super;
    transition: opacity 0.15s;
    opacity: 0.7;
}

.config-indicator-close:hover {
    opacity: 1;
}

[data-bs-theme="dark"] .config-indicator-divider {
    color: #6c757d;
}

[data-bs-theme="dark"] .config-indicator-active {
    color: #7aafdf;
}

[data-bs-theme="dark"] .config-indicator-close {
    color: #7aafdf;
}

/* Поиск автодрома */
.track-search-container {
    position: relative;
}

.track-search-input {
    padding-left: 2.5rem;
}

.track-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

/* Адаптивность автодромов */
@media (max-width: 576px) {
    .configs-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   Блок "Лучшие результаты" (Минималистичный)
   =========================================== */

/* Контейнер аккордеона */
#bestResultsAccordion {
    font-size: 0.95rem;
}

/* Заголовки автодромов */
#bestResultsAccordion .accordion-button {
    padding: 0.875rem 1.1875rem;
    font-size: 0.95rem;
}

#bestResultsAccordion .accordion-button i.ti {
    font-size: 1.25rem;
    line-height: 1;
}

/* Бейдж количества конфигураций */
#bestResultsAccordion .accordion-button .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Список конфигураций */
.config-result-item {
    padding: 0.875rem 1.1875rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.config-result-item:hover {
    border-left-color: rgba(230, 57, 70, 0.4);
    background-color: rgba(0, 0, 0, 0.02);
}

/* Бейдж времени */
.config-result-item .time-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* Детали (машина, шины) */
.config-result-item small {
    font-size: 0.8rem;
    color: #6c757d;
}

.config-result-item small i.ti {
    font-size: 1rem;
}

/* ===========================================
   Тёмная тема
   =========================================== */

[data-bs-theme="dark"] .config-result-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(230, 57, 70, 0.6);
}

[data-bs-theme="dark"] .config-result-item small {
    color: #adb5bd;
}

[data-bs-theme="dark"] #bestResultsAccordion .accordion-button {
    color: #e9ecef;
}

[data-bs-theme="dark"] #bestResultsAccordion .accordion-button:not(.collapsed) {
    background-color: rgba(230, 57, 70, 0.08);
    color: #fff;
}

/* ===========================================
   Адаптивность
   =========================================== */

@media (max-width: 768px) {
    .config-result-item {
        padding: 0.75rem 1rem;
    }

    .config-result-item .time-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .config-result-item small {
        font-size: 0.75rem;
    }

    /* На мобильных машина и шины в столбец */
    .config-result-item .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    #bestResultsAccordion .accordion-button {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }

    .config-result-item .fw-medium {
        font-size: 0.9rem;
    }
}

/* ===========================================
   DEPRECATED: Таблица "Лучшие результаты"
   Закомментировано 2026-01-31, заменено на карточный дизайн
   =========================================== */
/*
.best-results-table {
    font-size: 0.9rem;
}

.best-results-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 0.75rem 0.5rem;
}

.best-results-table td {
    padding: 0.625rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.best-results-table .track-divider {
    background-color: rgba(0, 0, 0, 0.02);
}

.best-results-table .track-divider-cell {
    padding: 0.875rem 0.75rem;
    font-size: 0.95rem;
    border-top: 2px solid var(--champ-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.best-results-table .track-divider:first-child .track-divider-cell {
    border-top: none;
}

.best-results-table .config-row {
    transition: background-color 0.15s ease;
}

.best-results-table .config-row:hover {
    background-color: rgba(230, 57, 70, 0.03);
}

.best-results-table .time-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.best-results-table .track-divider-cell .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

[data-bs-theme="dark"] .best-results-table th {
    color: #adb5bd;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .best-results-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .best-results-table .track-divider {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .best-results-table .track-divider-cell {
    border-top-color: var(--champ-primary);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .best-results-table .config-row:hover {
    background-color: rgba(230, 57, 70, 0.08);
}

[data-bs-theme="dark"] .best-results-table .time-value {
    color: #7FDB7F !important;
}

@media (max-width: 768px) {
    .best-results-table {
        font-size: 0.85rem;
    }

    .best-results-table th,
    .best-results-table td {
        padding: 0.5rem 0.375rem;
    }

    .best-results-table .time-value {
        font-size: 0.85rem;
    }

    .best-results-table .track-divider-cell {
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .best-results-table {
        font-size: 0.8rem;
    }

    .best-results-table .time-value {
        font-size: 0.8rem;
    }

    .best-results-table th,
    .best-results-table td {
        padding: 0.375rem 0.25rem;
    }

    .best-results-table td:nth-child(4) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
*/

/* ===========================================
   Компактные карточки "Лучшие результаты" (pilot.php)
   =========================================== */

.best-results-grid {
    column-count: 2;
    column-gap: 0.75rem;
    column-fill: balance;
    font-size: 0;
}

.track-result-card {
    display: inline-block;
    vertical-align: top;
    width: 100%;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    overflow: hidden;
}

.track-result-header {
    padding: 0.55rem 0.7rem;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.track-result-title-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.track-result-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.track-result-link {
    color: var(--real-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-result-link:hover {
    color: var(--real-primary);
}

.best-track-count {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.24rem 0.34rem;
    flex-shrink: 0;
}

.best-results-grid .config-list {
    padding: 0.25rem 0;
}

.best-results-grid .config-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
    min-width: 0;
}

.best-results-grid .config-item:last-child {
    border-bottom: none;
}

.best-results-grid .config-item:hover {
    background-color: rgba(230, 57, 70, 0.03);
}

.best-results-grid .config-name {
    flex: 0 1 32%;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.best-results-grid .config-link:not(.text-muted) {
    color: #495057;
}

.best-results-grid .config-link.text-muted {
    color: #6c757d !important;
}

.best-results-grid .config-link:hover:not(.text-muted) {
    color: var(--real-primary);
}

.best-results-grid .config-car-link,
.best-results-grid .config-car-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.74rem;
    line-height: 1.2;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.best-results-grid .config-car-link:hover {
    color: var(--real-primary);
}

.best-results-grid .config-time {
    flex: 0 0 auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.best-results-grid .best-tires-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    cursor: help;
    line-height: 1;
}

.best-results-grid .best-tires-icon .ti {
    font-size: 0.9rem;
    opacity: 0.7;
}

.best-results-grid .config-champ-tag {
    flex: 0 0 auto;
    font-size: 0.65rem;
    color: #999;
    opacity: 0.7;
    cursor: help;
    white-space: nowrap;
}

/* ===========================================
   Тёмная тема
   =========================================== */

[data-bs-theme="dark"] .track-result-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .track-result-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .track-result-link {
    color: #e9ecef;
}

[data-bs-theme="dark"] .track-result-link:hover {
    color: #fff;
}

[data-bs-theme="dark"] .best-track-count {
    background-color: rgba(255, 255, 255, 0.14) !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .best-results-grid .config-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .best-results-grid .config-item:hover {
    background-color: rgba(230, 57, 70, 0.08);
}

[data-bs-theme="dark"] .best-results-grid .config-link:not(.text-muted) {
    color: #adb5bd;
}

[data-bs-theme="dark"] .best-results-grid .config-link.text-muted {
    color: #868e96 !important;
}

[data-bs-theme="dark"] .best-results-grid .config-link:hover:not(.text-muted) {
    color: #fff;
}

[data-bs-theme="dark"] .best-results-grid .config-time {
    color: #7FDB7F !important;
}

[data-bs-theme="dark"] .best-results-grid .config-car-link {
    color: #adb5bd;
}

[data-bs-theme="dark"] .best-results-grid .config-car-link:hover {
    color: #fff;
}

[data-bs-theme="dark"] .best-results-grid .best-tires-icon {
    color: #868e96;
}

[data-bs-theme="dark"] .best-results-grid .best-tires-icon .ti {
    opacity: 0.6;
}

/* ===========================================
   Адаптивность
   =========================================== */

@media (max-width: 768px) {
    .best-results-grid {
        column-count: 2;
        column-gap: 0.65rem;
    }

    .track-result-header {
        padding: 0.5rem 0.62rem;
    }

    .best-results-grid .config-item {
        gap: 0.35rem;
        padding: 0.4rem 0.62rem;
    }

    .best-results-grid .config-name {
        flex-basis: 28%;
    }

    .track-result-link {
        font-size: 0.88rem;
    }

    .best-results-grid .config-time {
        font-size: 0.86rem;
    }
}

@media (max-width: 576px) {
    .best-results-grid {
        column-count: 1;
        column-gap: 0;
    }

    .track-result-card {
        margin-bottom: 0.6rem;
    }

    .track-result-header {
        padding: 0.48rem 0.58rem;
    }

    .best-results-grid .config-item {
        gap: 0.3rem;
        padding: 0.38rem 0.58rem;
    }

    .best-results-grid .config-name {
        flex-basis: 26%;
        font-size: 0.8rem;
    }

    .track-result-link {
        font-size: 0.84rem;
    }

    .best-track-count {
        font-size: 0.64rem;
        padding: 0.2rem 0.3rem;
    }

    .best-results-grid .config-time {
        font-size: 0.84rem;
    }

    .best-results-grid .config-car-link,
    .best-results-grid .config-car-name {
        font-size: 0.7rem;
    }
}

/* ===========================================
   Стили для топ-5 рекордов (бейджи позиций)
   =========================================== */

/* Бейджи для топ-3 позиций */
.standings-table .badge.bg-warning {
    background-color: #ffc107 !important; /* 🥇 Золото */
}

.standings-table .badge.bg-light {
    background-color: #c0c0c0 !important; /* 🥈 Серебро */
    color: #212529 !important;
}

.standings-table .badge.bg-secondary {
    background-color: #cd7f32 !important; /* 🥉 Бронза */
}

/* Выделение времени */
.time-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* ===========================================
   Позиция в сезоне (история выступлений)
   =========================================== */

/* Основной стиль позиции */
.position-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--champ-primary);
}

[data-bs-theme="dark"] .position-value {
    color: #ff6b7a;
}

/* Несколько классов в сезоне */
.position-value.multi-class {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.position-value .class-position {
    cursor: help;
}

.position-value .class-position.pos-gold {
    color: #b8860b;
    font-weight: 600;
}

.position-value .class-position.pos-silver {
    color: #6c757d;
    font-weight: 600;
}

.position-value .class-position.pos-bronze {
    color: #cd7f32;
    font-weight: 600;
}

[data-bs-theme="dark"] .position-value .class-position.pos-gold {
    color: #ffd700;
}

[data-bs-theme="dark"] .position-value .class-position.pos-silver {
    color: #c0c0c0;
}

[data-bs-theme="dark"] .position-value .class-position.pos-bronze {
    color: #e8a860;
}

.position-value .separator {
    opacity: 0.5;
    margin: 0 0.25rem;
}

/* ===========================================
   Circuit racing (кольцевые гонки)
   =========================================== */

/* Penalty badge */
.penalty-badge {
    font-size: 0.75rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Gap display */
.gap-value {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* ===========================================
   Weather Widget
   =========================================== */

.weather-widget {
    gap: 0.75rem;
}

.weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.15);
    font-size: 0.8125rem;
    color: #333;
    cursor: default;
    white-space: nowrap;
}

.weather-badge .ti {
    font-size: 1rem;
    color: #e63946;
}

.weather-badge .weather-temp {
    font-weight: 600;
}

.weather-badge .weather-conditions {
    color: #666;
    font-weight: 400;
}

.weather-badge-precip {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.weather-badge-precip .ti {
    color: #3b82f6;
}

.weather-badge-dry {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.weather-badge-dry .ti {
    color: #22c55e;
}

[data-bs-theme="dark"] .weather-badge-precip {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-bs-theme="dark"] .weather-badge-dry {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.weather-chart-mini {
    width: 200px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    cursor: crosshair;
}

.weather-chart-sidebar {
    width: 100%;
    height: 120px;
    border-radius: 0.375rem;
    cursor: crosshair;
}

.weather-chart-tooltip {
    display: none;
    position: absolute;
    z-index: 10;
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 5px 9px;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Dark theme */
[data-bs-theme="dark"] .weather-badge {
    background: rgba(230, 57, 70, 0.12);
    border-color: rgba(230, 57, 70, 0.25);
    color: #ccc;
}

[data-bs-theme="dark"] .weather-badge .weather-conditions {
    color: #999;
}

/* ===========================================
   Адаптивность
   =========================================== */

/* Мобильные устройства */
@media (max-width: 768px) {
    .position-value.multi-class {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .position-value .separator {
        display: none;
    }

    .weather-chart-mini {
        width: 150px;
        height: 50px;
    }

    .weather-widget {
        gap: 0.5rem;
    }
}

/* ===========================================
   Погода сезона — бейджи на этапах + график
   =========================================== */

.stage-weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 1px;
}

.stage-weather-badge .ti {
    color: #e6a817;
    font-size: 0.75rem;
}

.stage-weather-badge .ti-cloud-rain {
    color: #3b82f6;
}

.season-weather-chart {
    width: 100%;
    height: 150px;
    display: block;
}

.season-weather-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.4;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

[data-bs-theme="dark"] .stage-weather-badge {
    color: #adb5bd;
}

[data-bs-theme="dark"] .season-weather-tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

@media (max-width: 768px) {
    .season-weather-chart {
        height: 110px;
    }
}

/* ===========================================
   Upcoming Season (предстоящий сезон)
   =========================================== */

.upcoming-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
}

.upcoming-stat {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.upcoming-stat strong {
    font-weight: 700;
    color: var(--real-secondary);
    margin: 0 0.2rem;
}

.upcoming-stat i {
    color: var(--champ-primary);
}

.stage-countdown-badge {
    font-size: 0.65rem;
    font-weight: 600;
}

[data-bs-theme="dark"] .upcoming-stats-bar {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .upcoming-stat {
    color: #adb5bd;
}

[data-bs-theme="dark"] .upcoming-stat strong {
    color: #fff;
}

@media (max-width: 576px) {
    .upcoming-stats-bar {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .upcoming-stat {
        font-size: 0.78rem;
    }
}

/* ===========================================
   Stage columns in standings table
   =========================================== */

.stage-group-header {
    text-align: center;
    font-size: 11px !important;
    font-weight: 500;
    padding: 0.2rem 0 !important;
    border-bottom: 0 !important;
    color: var(--bs-secondary-color);
}

.stage-col-header {
    width: 32px !important;
    min-width: 32px;
    font-size: 10px !important;
    text-align: center;
    padding: 0.3rem 0.15rem !important;
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.stage-col {
    font-size: 11px;
    text-align: center;
    padding: 0.3rem 0.15rem !important;
    color: var(--bs-secondary-color);
}

.stage-col.stage-gold { color: var(--real-gold); font-weight: 600; }
.stage-col.stage-silver { color: var(--real-silver); font-weight: 600; }
.stage-col.stage-bronze { color: var(--real-bronze); font-weight: 600; }

.stage-col-sum {
    font-weight: 600 !important;
    color: var(--bs-body-color) !important;
    border-left: 1px solid var(--bs-border-color) !important;
}

th.stage-col-sum {
    font-size: 11px !important;
    font-weight: 500;
}

/* ===========================================
   Топ пилоты — badge-tabs на странице трассы
   =========================================== */

#topPilotsCard .season-tabs .nav-link.active {
    background: var(--track-primary, #1d3557);
    border-color: var(--track-primary, #1d3557);
    box-shadow: 0 2px 8px rgba(29, 53, 87, 0.3);
}

html[data-bs-theme="dark"] #topPilotsCard .season-tabs .nav-link.active {
    box-shadow: 0 2px 8px rgba(29, 53, 87, 0.5);
}
