/* =========================================
   Дизайн-система & CSS-переменные
========================================= */
:root {
    /* Светлая тема (Light Mode) */
    --bg-main: #f5f6f8;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f0f2f5;
    --text-primary: #1a1b1d;
    --text-secondary: #6e737c;
    --border-color: #e4e6ea;
    --accent-color: #2e6ff2;
    --accent-hover: #1b5ceb;
    --status-live: #e63946;
    --status-past: #8a92a3;
    --win-color: #28a745;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.theme-dark {
    /* Темная тема (Dark Mode) */
    --bg-main: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-hover: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
}

/* =========================================
   Сброс & Базовые стили
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* =========================================
   Шапка (Header)
========================================= */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 9999;
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
}
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.brand-logo {
    height: 32px;
}
/* Бургер меню - скрыто на десктопе по умолчанию */
.burger-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
}
.mobile-overlay { display: none; }
.mobile-drawer { display: none; }

.brand-logo {
    max-height: 22px; /* Уменьшено для ПК */
    width: auto;
}

@media (max-width: 768px) {
    .brand-logo {
        max-height: 18px; /* Уменьшено для мобил */
    }
}

/* Инвертируем черный логотип в белом для темной темы */
body.theme-dark .brand-logo {
    filter: brightness(0) invert(1);
}

/* Переключатель темы */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface-hover);
    transition: background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--border-color);
}

body.theme-light .light-icon { display: none; }
body.theme-dark .dark-icon { display: none; }

/* =========================================
   Главная сетка: 3 Колонки (Main Layout)
========================================= */
.app-layout {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    display: grid;
    /* Левая: 240px, Центр: гибкий, Правая: 300px */
    grid-template-columns: 240px minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

/* =========================================
   Левая колонка (Навигация)
========================================= */
.sidebar-left {
    position: sticky;
    top: 88px; /* header + gap */
    z-index: 100;
}

.sports-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.nav-item .material-symbols-outlined {
    font-size: 20px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-surface);
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* =========================================
   Центральная колонка (Матчи)
========================================= */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 500px;
    min-width: 0; /* Важно для обрезки скролла в grid */
}

/* Карусель видов спорта */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.carousel-arrow:hover {
    background-color: var(--bg-surface-hover);
    color: var(--accent-color);
}

.carousel-arrow.prev {
    left: -16px;
}

.carousel-arrow.next {
    right: -16px;
}

/* Скрываем стрелки, если они заблокированы (мы сделаем это через JS) */
.carousel-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

.sports-carousel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 0px;
    margin: 0;
}

.carousel-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 8px;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: none;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.carousel-btn:hover {
    background-color: var(--bg-surface-hover);
}

.carousel-btn.active {
    background-color: rgba(46, 111, 242, 0.08); /* Светло-голубой фон */
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

/* Панель выбора дат */
.date-selector {
    display: flex;
    gap: 8px;
    background-color: var(--bg-surface);
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

/* Фикс обрезки правого края (скруглений) на мобильных при скролле */
.date-selector::after {
    content: "";
    width: 1px;
    flex-shrink: 0;
}

.date-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.date-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.date-btn.active {
    background-color: rgba(46, 111, 242, 0.08);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.date-picker-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
    
    /* Обычный текст без фона */
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    
    /* Делаем некликабельным */
    pointer-events: none;
    cursor: default;
}

/* Фильтры статуса */
.status-filters {
    display: flex;
    gap: 8px;
    margin: -8px 0 8px 0;
    overflow-x: auto;
}
.status-filters::-webkit-scrollbar {
    display: none;
}

.status-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    transition: all 0.2s;
}

.status-btn:hover {
    color: var(--text-primary);
}

.status-btn.active {
    background-color: rgba(46, 111, 242, 0.08);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

body.theme-dark .status-btn.active, 
body.theme-dark .date-btn.active, 
body.theme-dark .carousel-btn.active {
    background-color: rgba(46, 111, 242, 0.15);
    border-color: var(--accent-color);
}

/* Блоки с лигами и матчами */
.league-group {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.league-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 15px;
    gap: 8px;
}

/* Карточка матча (Строка) */
.match-row {
    display: grid;
    grid-template-columns: 65px 1fr auto 40px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    cursor: pointer;
}

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

.match-row:hover {
    background-color: var(--bg-surface-hover);
}

.match-time {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

@keyframes pulseLive {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.match-time.status-live {
    color: var(--status-live);
    font-weight: 600;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 15px;
}

.team span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px; /* Adjust maximum width as needed */
}

.team-logo {
    width: 20px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 50%;
}

.team.winner {
    font-weight: 700;
}

.match-score .winner {
    font-weight: 700;
}

.match-time-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 45px;
    max-width: 60px;
    margin-right: 8px; /* Гарантированный отступ до логотипов */
}

.match-live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    color: var(--status-live);
    font-weight: 700;
    font-size: 11px;
    white-space: normal; /* Позволяем переносить длинные статусы, если нужно */
}

.match-live-indicator .live-dot {
    display: none; /* Прячем точку, чтобы сэкономить место */
}

.match-date {
    font-size: 11px;
    color: #8e9297;
    margin-top: 4px;
}

.start-time {
    color: #8e9297;
    font-size: 11px;
    margin-left: 4px;
    font-weight: normal;
}


.match-odds-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.kf-btn {
    background-color: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.kf-btn:hover {
    background-color: var(--border-color);
}

.match-odds-popup {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px;
    gap: 6px;
    z-index: 100;
}

.match-odds-popup.active {
    display: flex;
}

.odd-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 40px;
    font-size: 13px;
    font-weight: 600;
}
.odd-box span {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-score {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-weight: 600;
    font-size: 15px;
    gap: 4px;
    /* Optional: fix width if needed, but flex-shrink: 0 ensures visibility */
    flex-shrink: 0;
}

.score-digit {
    min-width: 20px;
    text-align: center;
}

.score-digit.winner {
    color: var(--text-primary);
}
.score-digit:not(.winner) {
    color: var(--text-secondary);
}


/* =========================================
   Правая колонка (Детали матча)
========================================= */
.sidebar-right {
    position: sticky;
    top: 88px;
}

.match-details-panel {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    min-height: 300px;
}

/* Плейсхолдер, если матч не выбран */
.panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: var(--text-secondary);
    min-height: 250px;
    gap: 12px;
}

.panel-placeholder .large-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Контент деталей матча */
.match-detail-header {
    text-align: center;
    margin-bottom: 24px;
}

.detail-league {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-status {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 10px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
body.theme-dark .detail-status {
    background-color: rgba(255,255,255,0.1);
}

.detail-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.d-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.d-logo {
    width: 48px;
    height: 48px;
    background-color: var(--border-color);
    border-radius: 50%;
}

.d-score {
    font-size: 28px;
    font-weight: 700;
    padding: 0 16px;
    white-space: nowrap;
}

/* Прогнозы экспертов (имитация) */
.detail-predictions h3 {
    font-size: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.prediction-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.p-bar {
    width: 100%;
    height: 32px;
    background-color: var(--bg-surface-hover);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.p-bar .fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.fill.w1 { background-color: var(--accent-color); }
.fill.draw { background-color: #8a92a3; }
.fill.w2 { background-color: #fa5c7c; }

.primary-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: var(--accent-hover);
}


/* =========================================
   Адаптивность (Responsive)
========================================= */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 200px 1fr;
    }
    .sidebar-right {
        display: none; /* Скрываем правую панель на планшетах */
    }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-left {
        display: none; /* Прячем сайдбар на мобилках под гамбургер или скролл */
    }
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--status-live);
    font-weight: 600;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: var(--status-live);
    border-radius: 50%;
    animation: pulseLive 1.5s infinite;
}

.live-text {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* =========================================
   Динамическая карточка матча (SPA)
========================================= */
.match-page-header { background: var(--bg-card); padding: 30px; border-radius: 16px; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 1px solid var(--border); }
.breadcrumbs { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: color 0.2s; font-weight: 500; }
.breadcrumbs:hover { color: var(--accent-color); }

.match-main-info { display: flex; justify-content: space-around; align-items: center; margin-bottom: 24px; width: 100%; }

.tournament-info { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; color: var(--text-secondary); font-size: 14px; font-weight: 500; background: var(--bg-main); padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); }
.tournament-info img { width: 22px; height: 22px; border-radius: 50%; }

.sidebar-odds-container { width: 100%; }
.odds-header { font-size: 14px; font-weight: 600; text-transform: uppercase; margin-bottom: 12px; color: var(--text-secondary); letter-spacing: 0.5px; }
.odds-block { display: flex; flex-direction: column; background: var(--bg-main); border-radius: 12px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border-color); }
.odds-block.horizontal { flex-direction: row; }
.odd-item { flex: 1; padding: 12px; text-align: center; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 4px; }
.odd-item:last-child { border-right: none; }
.odds-block.horizontal .odd-item { border-bottom: none; }
.odd-item span:first-child { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.odd-item span:last-child { font-size: 18px; font-weight: 700; color: var(--accent-color); }

.team-big { display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; max-width: 33%; }
.team-big .team-logo-wrap { width: 90px; height: 90px; display: flex; justify-content: center; align-items: center; background: var(--bg-main); border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); }
.team-big img { max-width: 65px; max-height: 65px; object-fit: contain; }
.team-big strong { font-size: 18px; text-align: center; font-weight: 700; line-height: 1.3; }

.score-big-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1; justify-content: center; min-width: 0; }
.score-big { font-size: 48px; font-weight: 800; font-family: 'Inter', sans-serif; letter-spacing: 2px; color: var(--text-primary); text-shadow: 0 2px 4px rgba(0,0,0,0.3); white-space: nowrap; }

/* Адаптация крупного счета для мобильных устройств */
@media (max-width: 768px) {
    .team-big .team-logo-wrap {
        width: 60px;
        height: 60px;
    }
    .team-big strong {
        font-size: 14px;
        max-width: 90px;
    }
    .score-big {
        font-size: 32px;
        letter-spacing: 0px;
    }
    .match-main-info {
        gap: 8px;
    }
    .team span {
        max-width: 120px;
        font-size: 13px;
    }
    .match-time-container {
        max-width: 50px;
    }
    .match-live-indicator {
        font-size: 10px;
    }
    .match-odds-popup.active {
        display: flex;
        position: absolute;
        bottom: calc(100% + 6px); /* Открывается ровно ВВЕРХ над кнопкой */
        top: auto;
        right: 0;
        left: auto;
        transform: none;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.15); /* Тень падает вверх */
        margin: 0;
        padding: 8px;
        border-radius: 8px;
        z-index: 100;
    }
    .match-odds-popup .odd-box {
        width: 50px;
        height: 44px;
        font-size: 14px;
    }

    /* Бургер-меню и Offcanvas Layout */
    .header-container {
        justify-content: flex-start;
        gap: 16px;
    }
    .header-actions {
        margin-left: auto;
    }
    .burger-btn {
        display: flex;
    }
    .mobile-overlay {
        display: block;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
        z-index: 999;
    }
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    .mobile-drawer {
        display: flex;
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        width: 320px; max-width: 85vw;
        height: 100%;
        background: var(--bg-surface);
        z-index: 1000;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
        flex-direction: column;
    }
    .mobile-drawer.active {
        transform: translateX(0);
    }
    .drawer-header {
        padding: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border-color);
    }
    .drawer-content {
        padding: 16px;
        overflow-y: auto;
        flex: 1;
    }

    /* Компактная карусель видов спорта на телефонах в 2-3 строки */
    .sports-carousel {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding-bottom: 0;
    }
    .sports-carousel::-webkit-scrollbar {
        display: none;
    }
    .carousel-btn {
        padding: 6px 12px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 12px;
        color: var(--text-secondary);
        background-color: var(--bg-surface);
        border: 1px solid var(--border-color);
        box-shadow: none;
    }
    .carousel-btn.active {
        background-color: rgba(46, 111, 242, 0.08);
        color: var(--accent-color);
        border-color: var(--accent-color);
    }
}
.minute-status { color: #fff; background: var(--accent-color); font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 20px; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 0 15px rgba(46, 111, 242, 0.4); text-align: center; max-width: 100%; word-break: break-word; }

/* Рекламные баннеры в ленте (LEON, Fonbet) */
.highlight-block-infeed {
    display: block;
    margin: 16px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-surface-hover), var(--bg-surface));
    border: 1px solid var(--accent-color);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.highlight-block-infeed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 111, 242, 0.15);
}
.highlight-content-wrap {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}
.highlight-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff; /* Всегда белый фон для логотипов БК */
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.highlight-text-box {
    flex: 1;
    min-width: 0;
}
.highlight-header-text {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.highlight-desc-text {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: normal; /* Позволяем тексту переноситься на несколько строк */
    line-height: 1.3;
}
.highlight-action-btn {
    background: var(--accent-color);
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    flex-shrink: 0;
}


/* Десктопный вид коэффициентов: всегда показываем без кнопки */
@media (min-width: 769px) {
    .kf-btn {
        display: none !important;
    }
    .match-odds-popup {
        display: flex !important;
        position: static;
        box-shadow: none;
        padding: 0;
        border: none;
        background: transparent;
        margin-top: 0;
    }
}

.match-tabs { display: flex; gap: 30px; border-bottom: 2px solid var(--border-color); margin-bottom: 24px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.match-tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 0; color: var(--text-secondary); cursor: pointer; font-weight: 600; font-size: 15px; position: relative; transition: color 0.2s; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-color); }
.tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 3px; background: var(--accent-color); border-radius: 3px 3px 0 0; }

.tab-content { background: var(--bg-surface); padding: 32px; border-radius: 16px; font-size: 16px; line-height: 1.6; min-height: 300px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.ai-badge { background: linear-gradient(135deg, #10a37f, #075e47); color: white; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: bold; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 6px; }
.ai-badge img { width: 16px; height: 16px; }

/* =========================================
   BOTTOM NAVIGATION BAR (MOBILE)
   ========================================= */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.theme-dark .mobile-bottom-nav {
    background: rgba(30, 31, 35, 0.85);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
    width: 20%;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bottom-nav-item .nav-icon {
    width: 24px;
    height: 24px;
    background-color: var(--text-secondary);
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    transition: background-color 0.2s ease;
}

.bottom-nav-item.active {
    color: var(--accent-color);
}

.bottom-nav-item.active span {
    color: var(--accent-color);
}

.bottom-nav-item.active .nav-icon {
    background-color: var(--accent-color);
}

@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
}

/* Gift Button Animation */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-gift-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--accent-color), #0052cc);
    border-radius: 20px;
    padding: 0;
    text-decoration: none;
    overflow: hidden;
    height: 36px;
    max-width: 36px;
    transition: max-width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: expandGift 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s forwards;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(46, 111, 242, 0.3);
}

.gift-icon {
    width: 26px;
    height: 26px;
    margin: 5px;
    flex-shrink: 0;
    animation: wiggleGift 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.gift-text {
    color: white;
    font-weight: 700;
    font-size: 13px;
    margin-right: 12px;
    margin-left: 2px;
    opacity: 0;
    animation: fadeInText 0.4s ease forwards 1.4s;
    letter-spacing: 0.2px;
}

@keyframes expandGift {
    0% { max-width: 36px; }
    100% { max-width: 200px; }
}

@keyframes fadeInText {
    to { opacity: 1; }
}

@keyframes wiggleGift {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-10deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(10deg); }
    30% { transform: rotate(0deg); }
}

body.theme-dark .header-gift-btn {
    box-shadow: 0 4px 10px rgba(46, 111, 242, 0.5);
}

.mobile-theme-toggle {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .desktop-theme-toggle {
        display: none !important;
    }
    .mobile-theme-toggle {
        display: flex;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        background-color: var(--bg-surface-hover);
        transition: background-color 0.2s ease;
    }
    .header-gift-btn {
        height: 28px;
        max-width: 28px;
        animation: expandGiftMobile 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s forwards;
    }
    .gift-icon {
        width: 20px;
        height: 20px;
        margin: 4px;
    }
    .gift-text {
        font-size: 11px;
        margin-right: 8px;
    }
}

@keyframes expandGiftMobile {
    0% { max-width: 28px; }
    100% { max-width: 140px; }
}

    
        .bk-header {
            text-align: center;
            padding: 30px 20px 20px;
        }
        .bk-header h1 {
            font-size: 24px;
            font-weight: 800;
            margin-bottom: 8px;
            color: var(--text-primary);
        }
        .bk-header p {
            color: var(--text-secondary);
            font-size: 14px;
            max-width: 400px;
            margin: 0 auto;
        }
        .bk-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
            padding: 0 20px 40px;
            max-width: 600px;
            margin: 0 auto;
        }
        .bk-card {
            display: flex;
            align-items: center;
            background: var(--bg-card, #ffffff);
            border-radius: 20px;
            padding: 16px 20px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.04);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            border: 1px solid var(--border-color, #f0f0f0);
            text-decoration: none;
        }
        .theme-dark .bk-card {
            background: var(--bg-card, #1c1c1e);
            box-shadow: 0 8px 24px rgba(0,0,0,0.2);
            border-color: #2c2d30;
        }
        .bk-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 32px rgba(0,0,0,0.08);
            border-color: #e0e0e0;
        }
        .theme-dark .bk-card:hover {
            box-shadow: 0 12px 32px rgba(0,0,0,0.4);
            border-color: #3a3b3f;
        }
        .bk-logo {
            width: 56px;
            height: 56px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: 900;
            color: #fff;
            flex-shrink: 0;
            margin-right: 16px;
            box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
        }
        .bk-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .bk-name {
            font-size: 18px;
            font-weight: 800;
            color: var(--text-primary);
        }
        .bk-bonus {
            font-size: 14px;
            font-weight: 700;
            color: #3CD070;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .bk-desc {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .bk-btn {
            background: #111;
            color: #fff;
            font-weight: 600;
            font-size: 14px;
            padding: 10px 20px;
            border-radius: 12px;
            text-align: center;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .theme-dark .bk-btn {
            background: #fff;
            color: #000;
        }
        .bk-btn:hover {
            opacity: 0.85;
            transform: scale(0.98);
        }
        
        @media (max-width: 600px) {
            .bk-grid {
                grid-template-columns: 1fr 1fr;
                gap: 12px;
                padding: 0 12px 40px;
            }
            .bk-card {
                flex-direction: column;
                align-items: center;
                text-align: center;
                padding: 16px 12px;
                border-radius: 16px;
            }
            .bk-logo {
                margin-right: 0;
                margin-bottom: 10px;
                width: 48px;
                height: 48px;
            }
            .bk-action {
                width: 100%;
                margin-top: 12px;
            }
            .bk-btn {
                display: block;
                width: 100%;
                padding: 8px 12px;
                font-size: 13px;
            }
            .bk-name {
                font-size: 16px;
            }
            .bk-info {
                align-items: center;
            }
            .bk-bonus {
                font-size: 11.5px;
                justify-content: center;
                white-space: nowrap;
                text-align: center;
            }
            .bk-desc {
                display: none; /* Hide description on mobile to fit the grid cleanly */
            }
        }
    

/* Footer specific overrides */
@media (max-width: 768px) {
    .app-footer {
        padding-bottom: 90px !important; /* Make room for mobile bottom nav */
    }
    
    /* Reorder footer columns on mobile */
    .footer-container {
        display: flex !important;
        flex-direction: column;
    }
    .footer-col:nth-child(1) { order: 4; margin-top: 16px; border-top: 1px solid var(--border-color); padding-top: 32px; }
    .footer-col:nth-child(2) { order: 1; }
    .footer-col:nth-child(3) { order: 2; }
    .footer-col:nth-child(4) { order: 3; }
    
    .header-auth-widget {
        display: none !important;
    }
}
