@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --fs-xs: 0.75rem;
    --fs-sm: 0.85rem;
    --fs-base: 0.95rem;
    --fs-lg: 1.1rem;
    --fs-xl: 1.35rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.2rem;
    --color-primary: #ef3124;
    --color-secondary: #2581c4;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --gradient-accent: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-nav: linear-gradient(135deg, #000058, #00002c);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 30px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease-out;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #ef3124; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #d4281e; }
* { scrollbar-width: thin; scrollbar-color: #ef3124 #f5f5f5; }

/* ===== Аутентификация ===== */
.auth-page {
    background: linear-gradient(135deg, #1a1a3e, #2d1040);
    min-height: 100vh;
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

.auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo img {
    filter: drop-shadow(0 2px 8px rgba(255,255,255,0.15));
}

.auth-title {
    text-align: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 28px;
}

.auth-card .form-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.85rem;
}

.auth-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: white !important;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08) !important;
}

.auth-btn {
    border-radius: 12px !important;
    padding: 12px !important;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 8px;
    background: linear-gradient(135deg, #ef3124, #d4281e) !important;
    border: none !important;
    transition: all 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 49, 36, 0.35);
}

.auth-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: white;
}

.auth-card .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.auth-card .form-text {
    color: rgba(255, 255, 255, 0.4) !important;
}

.dark-theme .auth-page {
    background: linear-gradient(135deg, #0a0818, #12102a, #1a1440);
}

/* ===== Базовые ===== */
body {
    background: #f5f5f5;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--fs-base);
    line-height: 1.6;
    color: #1a2634;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: #1a2634;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }

.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4 {
    color: var(--text-primary);
}

.container,
.container-main {
    max-width: 1200px;
    padding: 20px;
    padding-top: 80px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
}

.container-wide {
    max-width: 1400px;
    padding: 20px;
    padding-top: 80px;
}

.container-tight {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
}

@media (max-width: 576px) {
    .container,
    .container-main,
    .container-narrow,
    .container-wide,
    .container-tight {
        padding-top: 60px;
    }
}

/* ===== Кнопка «На главную» ===== */
.back-home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 30px;
    background: #ef3124;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(239, 49, 36, 0.3);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 49, 36, 0.4);
    color: white;
    text-decoration: none;
    background: #2581c4;
}

@media (max-width: 576px) {
    .back-home-btn {
        top: 10px;
        left: 10px;
        padding: 8px 14px;
        font-size: 14px;
        border-radius: 20px;
    }
}

/* ===== Фильтр туров (select) ===== */
.round-select {
    width: auto;
    min-width: 160px;
    border-radius: 30px !important;
    padding: 6px 36px 6px 16px !important;
    font-weight: 600;
    background: white;
    border: 2px solid #ef3124;
    color: #ef3124;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath fill='%23ef3124' d='M7 10L0 0h14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 10px;
}

.round-select:focus {
    border-color: #2581c4;
    box-shadow: 0 0 0 3px rgba(37, 129, 196, 0.2);
    outline: none;
}

@media (max-width: 576px) {
    .round-select {
        min-width: 100px;
        padding: 4px 28px 4px 10px !important;
        font-size: 0.8rem;
        background-size: 10px 7px;
        background-position: right 10px center;
    }
}

.dark-theme .round-select {
    background: var(--bg-card);
    border-color: #c62828;
    color: #ff6b6b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath fill='%23ff6b6b' d='M7 10L0 0h14z'/%3E%3C/svg%3E");
}

.dark-theme .round-select {
    border-color: #c62828;
}

.dark-theme .round-select option {
    background: #2d2d44;
    color: #e8e8f0;
}

/* ===== Верхние кнопки ===== */
.top-actions .btn {
    border-radius: 30px;
    padding: 6px 18px;
    font-weight: 500;
    transition: all 0.2s;
}

.top-actions .btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== Заголовки разделов ===== */
.section-title {
    background: var(--gradient-accent);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    text-align: center;
    margin: 28px 0 18px;
    font-weight: 700;
    font-size: var(--fs-lg);
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

/* ===== Таблицы ===== */
.table-container {
    overflow-x: auto;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: white;
    padding: 0;
    border: 1px solid #dee2e6;
}

.table-container-scroll {
    overflow-x: auto;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: white;
    padding: 0;
    border: 1px solid #dee2e6;
    max-height: 80vh;
    overflow-y: auto;
}

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

.table th,
.table td {
    vertical-align: middle;
    text-align: center;
    padding: 10px 8px;
}

.table th {
    white-space: normal;
    max-width: 100px;
    background: linear-gradient(135deg, #ef3124, #2581c4);
    color: white;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}



.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(239, 49, 36, 0.05);
}

.table-container .table th,
.table-container-scroll .table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.table-container .table thead tr:first-child th,
.table-container-scroll .table thead tr:first-child th {
    border-bottom: none !important;
}

.table-container .table thead tr:last-child th,
.table-container-scroll .table thead tr:last-child th {
    top: 35px;
}

.table .match-info {
    text-align: left;
    min-width: 180px;
}

.table .match-info .teams {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.table .match-info .teams span {
    font-weight: 500;
}

.table .match-info .date {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ===== Карточки матча ===== */
.card-match {
    border: none;
    border-left: 4px solid #3498db;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
    margin-bottom: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--team-clr, #3498db) 6%, white), white 80%);
    overflow: hidden;
}

@supports not (color: color-mix(in srgb, red, white)) {
    .card-match { background: white; }
}

.card-match.has-result,
.card-match.match-finished {
    border-left-color: #2ecc71;
}

.card-match.live {
    border-left-color: #f39c12;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.card-match.has-result .match-header,
.card-match.match-finished .match-header {
    color: #27ae60;
}

.card-match:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-match-body {
    padding: 18px 20px;
}

.card-match.live {
    border: none;
    border-left: 4px solid #f39c12;
    background: #fff8e1;
    animation: pulse-left-border 1.5s infinite;
}

@keyframes pulse-left-border {
    0% { border-left-color: #f39c12; }
    50% { border-left-color: #ff6b35; }
    100% { border-left-color: #f39c12; }
}

.match-header {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a2634;
}

.match-finished {
    background: #e8f5e9;
}

@media (max-width: 576px) {
    .card-match-body {
        padding: 14px;
    }
    .match-header {
        font-size: 0.95rem;
    }
}

/* ===== Таймер ===== */
.timer {
    color: #0d6efd;
    font-weight: 600;
    margin-top: 6px;
    font-size: 0.9rem;
}

/* ===== LIVE бейдж ===== */
.live-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== Таблицы прогнозов ===== */
.forecast-cell {
    font-weight: 600;
    font-size: 0.9rem;
}

.forecast-cell .hidden {
    color: #adb5bd;
    font-weight: 400;
    letter-spacing: 1px;
}

.points-cell {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2581c4;
}

.table tr.live-match {
    background-color: #fff8e1 !important;
    border-left: 4px solid #ffc107;
}

.table tr.live-match td {
    background-color: #fff8e1 !important;
}

/* ===== Вкладки ===== */
.nav-tabs {
    border-bottom: none;
}

.nav-tabs .nav-link {
    border-radius: 30px;
    padding: 8px 20px;
    font-weight: 500;
    color: #6c757d;
    border: 1px solid transparent;
    margin-right: 5px;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #ef3124, #2581c4);
    color: white;
    border-color: #ef3124;
}

.tab-content {
    padding: 15px 0;
}

/* ===== Letter-аватарки игроков ===== */
.player-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
}

.player-avatar-sm {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
}

.player-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

/* ===== Значки мест ===== */
.rank-badge {
    display: inline-block;
    background: #ef3124;
    color: white;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-badge.gold {
    background: #ffd700;
    color: #333;
}

.rank-badge.silver {
    background: #c0c0c0;
    color: #333;
}

.rank-badge.bronze {
    background: #cd7f32;
    color: white;
}

.rank-badge-sm {
    display: inline-block;
    background: #ef3124;
    color: white;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.rank-badge-sm.gold {
    background: #ffd700;
    color: #333;
}

.rank-badge-sm.silver {
    background: #c0c0c0;
    color: #333;
}

.rank-badge-sm.bronze {
    background: #cd7f32;
    color: white;
}

/* ===== Статистика ===== */
.stat-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ef3124;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

/* ===== Прогресс-бары ===== */
.progress {
    height: 24px;
    border-radius: 30px;
    background: #e9ecef;
    margin: 2px 0;
}

.progress-bar {
    border-radius: 30px;
}

/* ===== Бейджи достижений ===== */
.badge-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 8px 15px;
    margin: 3px;
    display: inline-block;
}

/* ===== Заголовки туров (более лёгкие) ===== */
.round-title {
    color: var(--color-primary);
    font-size: var(--fs-xl);
    font-weight: 700;
    text-align: center;
    margin: 28px auto 16px;
    padding: 6px 0 10px;
    border-bottom: 2px solid rgba(239, 49, 36, 0.2);
    max-width: 600px;
    letter-spacing: 0.5px;
}

/* ===== Общие очки ===== */
.total-points {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2581c4;
}

/* ===== Toggle Switch ===== */
.toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.toggle-wrap:hover {
    background: #fafafa;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-label {
    font-weight: 500;
    font-size: var(--fs-sm);
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.dark-theme .toggle-wrap {
    background: var(--bg-card);
}

.dark-theme .toggle-wrap:hover {
    background: var(--bg-card-hover);
}

.dark-theme .toggle-label {
    color: var(--text-primary);
}

/* ===== Адаптив: мобильные карточки прогнозов ===== */
.mobile-cards {
    display: none;
}

@media (max-width: 768px) {
    .mobile-cards .card {
        border: none;
        border-radius: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        margin-bottom: 15px;
        background: white;
    }

    .mobile-cards .card-body {
        padding: 15px;
    }

    .mobile-cards .match-number {
        color: #ef3124;
        font-weight: 700;
        font-size: 0.9rem;
    }

    .mobile-cards .match-teams {
        font-weight: 600;
        font-size: 1rem;
        margin: 5px 0;
    }

    .mobile-cards .match-date {
        font-size: 0.75rem;
        color: #6c757d;
    }

    .mobile-cards .player-row {
        display: flex;
        justify-content: space-between;
        padding: 3px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.8rem;
    }

    .mobile-cards .player-row:last-child {
        border-bottom: none;
    }

    .mobile-cards .forecast {
        font-weight: 600;
    }

    .mobile-cards .points {
        font-size: 0.7rem;
    }

    .mobile-cards .points.positive {
        color: #2581c4;
    }

    .mobile-cards .points.zero {
        color: #adb5bd;
    }

    .mobile-cards .hidden {
        color: #adb5bd;
    }
}

@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }

    .rank-badge {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 0.8rem;
    }

    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 4px 12px;
    }

    /* Отключаем анимации на мобильных */
    .card-match,
    .stat-card,
    .admin-card-match {
        animation: none !important;
    }
}

/* ===== Формы (регистрация, логин) ===== */
.form-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-card .card-body {
    padding: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #ef3124, #d4281e);
    border: none;
    color: white;
    border-radius: 30px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d4281e, #b82218);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 49, 36, 0.3);
    color: white;
}

.form-card .btn-primary {
    border-radius: 30px;
    padding: 10px 30px;
    font-weight: 500;
    background: #ef3124;
    border: none;
    transition: all 0.2s;
}

.form-card .btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(239, 49, 36, 0.3);
    background: #2581c4;
}

/* ===== Календарь ===== */
.finished {
    background: #e8f5e9;
}

.live {
    background: #fff8e1 !important;
}

/* ===== Админка ===== */
.admin-section-title {
    background: var(--gradient-accent);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    text-align: center;
    margin: 28px 0 18px;
    font-weight: 700;
    font-size: var(--fs-lg);
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

/* ===== Редактирование результата ===== */
.match-header-gradient {
    background: linear-gradient(135deg, #ef3124, #2581c4);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
}

.current-result {
    background: #e9ecef;
    padding: 10px 15px;
    border-radius: 30px;
    display: inline-block;
}

.form-control-sm-edit {
    border-radius: 30px;
    border: 1px solid #d1d9e6;
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.form-control-sm-edit:focus {
    border-color: #ef3124;
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 49, 36, 0.15);
}

.teams-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(135deg, #000058, #00002c);
    box-shadow: 0 4px 20px rgba(0, 0, 88, 0.3);
    padding: 8px 0;
    min-height: 56px;
}

.navbar .navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
}

.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 30px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar .navbar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar .navbar-nav .nav-link.active {
    background: linear-gradient(135deg, #ef3124, #d4281e);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 49, 36, 0.3);
}

.navbar .navbar-nav .nav-link.text-danger {
    color: rgba(255, 200, 200, 0.9) !important;
}

.navbar .navbar-nav .nav-link.text-danger:hover {
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.1);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 576px) {
    .navbar .container-fluid {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 2px;
    }
    .navbar .navbar-brand {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
        font-size: 1.0rem !important;
    }
    .navbar .navbar-brand img {
        height: 18px !important;
    }
    .navbar .d-flex.ms-auto {
        margin-left: 0 !important;
        flex-shrink: 0;
    }
}

@media (max-width: 991px) {
    .navbar .container-fluid {
        position: relative;
    }
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        z-index: 9999;
        background: rgba(0, 0, 44, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 16px;
        padding: 12px 8px;
        margin-top: 4px;
        box-shadow: 0 16px 48px rgba(0,0,0,0.4);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .navbar .navbar-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }
    .navbar .navbar-nav .nav-link {
        font-size: 1rem;
        padding: 12px 8px;
        border-radius: 12px;
        text-align: center;
        white-space: nowrap;
    }
    .navbar .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    .navbar .navbar-nav:last-child {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, #000058, #00002c);
    color: rgba(255, 255, 255, 0.8);
    padding: 24px 0 16px;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ===== SVG иконки ===== */
.navbar-nav .nav-link svg,
.heading-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== Toast-уведомления ===== */
.toast-container {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    width: calc(100% - 32px);
    pointer-events: none;
}

@media (max-width: 576px) {
    .toast-container {
        top: 60px;
        right: 8px;
        left: 8px;
        max-width: none;
        width: auto;
    }
}

.toast-message {
    background: white;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-left: 4px solid #2581c4;
    font-weight: 500;
    font-size: 0.9rem;
    animation: toastIn 0.3s ease-out both;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-message.toast-success { border-left-color: #2ecc71; }
.toast-message.toast-danger { border-left-color: #e74c3c; }
.toast-message.toast-warning { border-left-color: #f39c12; }
.toast-message.toast-info { border-left-color: #3498db; }

.toast-message .toast-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
}

.toast-message .toast-close:hover { color: #333; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.dark-theme .toast-message {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.dark-theme .toast-message .toast-close { color: var(--text-muted); }
.dark-theme .toast-message .toast-close:hover { color: var(--text-primary); }

/* ===== Анимации ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Анимация кнопки темы */
.theme-toggle-btn {
    transition: transform var(--transition-base), color var(--transition-fast);
}

.theme-toggle-btn:active {
    transform: scale(0.85);
}

.theme-toggle-btn.rotating {
    animation: themeSpin 0.4s ease-out;
}

@keyframes themeSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Skeleton loading */
@keyframes skeletonPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

.skeleton-text {
    display: inline-block;
    height: 1em;
    width: 80px;
}

.skeleton-circle {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.dark-theme .skeleton {
    background: linear-gradient(90deg, #2d2d44 25%, #3d3d55 50%, #2d2d44 75%);
    background-size: 200% 100%;
}

/* Плавное появление туров */
.round-fade-enter {
    opacity: 0;
    transform: translateY(16px);
}

.round-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.card-match,
.stat-card,
.admin-card-match {
    animation: fadeInUp 0.4s ease-out both;
}

.card-match:nth-child(2) { animation-delay: 0.04s; }
.card-match:nth-child(3) { animation-delay: 0.08s; }
.card-match:nth-child(4) { animation-delay: 0.12s; }
.card-match:nth-child(5) { animation-delay: 0.16s; }
.card-match:nth-child(6) { animation-delay: 0.20s; }
.card-match:nth-child(7) { animation-delay: 0.24s; }
.card-match:nth-child(8) { animation-delay: 0.28s; }
.card-match:nth-child(9) { animation-delay: 0.32s; }
.card-match:nth-child(10) { animation-delay: 0.36s; }
.card-match:nth-child(11) { animation-delay: 0.40s; }
.card-match:nth-child(12) { animation-delay: 0.44s; }
.card-match:nth-child(13) { animation-delay: 0.48s; }
.card-match:nth-child(14) { animation-delay: 0.52s; }
.card-match:nth-child(15) { animation-delay: 0.56s; }
.card-match:nth-child(16) { animation-delay: 0.60s; }

.round-title {
    animation: fadeInUp 0.5s ease-out both;
}

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

.card-match:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.rank-badge,
.rank-badge-sm {
    transition: transform 0.3s ease;
}

.rank-badge:hover,
.rank-badge-sm:hover {
    transform: scale(1.15);
}

/* Плавное появление страницы */
body {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Форма (индикаторы последних матчей) ===== */
.form-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

.dark-theme .form-dot {
    border-color: rgba(255,255,255,0.15);
}

/* Спарклайн SVG */
.table td svg {
    vertical-align: middle;
    color: #2581c4;
}

.dark-theme .table td svg {
    color: #5a9eff;
}

/* ===== Тёмная тема ===== */
.dark-theme {
    --bg-primary: #1a1a2e;
    --bg-card: #2d2d44;
    --bg-card-hover: #383852;
    --bg-input: #3d3d55;
    --text-primary: #f0f0f8;
    --text-secondary: #b0b0c8;
    --text-muted: #9090a8;
    --border-color: #4a4a60;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.dark-theme body,
.dark-theme {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.dark-theme .card-match {
    box-shadow: var(--shadow);
    background: var(--bg-card);
}

.dark-theme .card,
.dark-theme .form-card,
.dark-theme .table-container,
.dark-theme .table-container-scroll,
.dark-theme .stat-card,
.dark-theme .my-forecasts-toggle,
.dark-theme .badge-item {
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.dark-theme .card-match:hover {
    background: var(--bg-card-hover);
}

.dark-theme .match-header {
    color: var(--text-primary);
}

.dark-theme .match-input {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .stepper-wrap .match-input {
    background: transparent;
    color: var(--text-primary);
}

.dark-theme .match-input:focus {
    border-color: #2581c4;
    box-shadow: 0 0 0 3px rgba(37,129,196,0.2);
}

.dark-theme .match-input.changed {
    background: #3d3520;
    border-color: #b8860b;
}

.dark-theme .btn-stepper {
    color: var(--text-primary);
}

.dark-theme .btn-stepper:hover {
    background: rgba(255,255,255,0.1);
}

.dark-theme .btn-stepper:active {
    background: rgba(255,255,255,0.15);
}

@media (max-width: 576px) {
    .dark-theme .stepper-wrap {
        background: var(--bg-input);
        border-color: var(--border-color);
    }
    .dark-theme .stepper-wrap .match-input {
        background: transparent;
    }
}

.dark-theme .table,
.dark-theme .table td,
.dark-theme .table-striped tbody tr:nth-of-type(odd) {
    background: var(--bg-card);
    color: var(--text-primary);
}

.dark-theme .table-striped tbody tr:nth-of-type(odd) td {
    background: rgba(255,255,255,0.03);
}

.dark-theme .table-hover tbody tr:hover,
.dark-theme .table-hover tbody tr:hover td {
    background: rgba(37,129,196,0.1);
}

.dark-theme .table-container,
.dark-theme .table-container-scroll {
    border-color: var(--border-color);
}

.dark-theme .match-finished {
    background: #1a2e1a;
}

.dark-theme .card-match.live {
    background: #2a2a10;
    border-left-color: #b8860b;
}

.dark-theme .card-match { border-left-color: #4a6fa5; }
.dark-theme .card-match.has-result,
.dark-theme .card-match.match-finished { border-left-color: #2e7d32; }
.dark-theme .card-match.live { border-left-color: #b8860b; }

.dark-theme .btn-outline-primary {
    color: #2581c4;
    border-color: #2581c4;
}

.dark-theme .btn-outline-primary:hover {
    color: white;
    background: #2581c4;
}

.dark-theme .form-control,
.dark-theme .form-select {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus {
    border-color: #2581c4;
    box-shadow: 0 0 0 3px rgba(37,129,196,0.2);
}

.dark-theme .text-muted {
    color: var(--text-muted) !important;
}

.dark-theme .stat-card .stat-value {
    color: #ef3124;
}

.dark-theme .timer {
    color: #5a9eff;
}

.dark-theme .forecast-result {
    color: var(--text-secondary);
}

.dark-theme ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: #ef3124;
}

.dark-theme * {
    scrollbar-color: #ef3124 var(--bg-primary);
}

.dark-theme .alert {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-theme .alert-success { border-color: #2e7d32; }
.dark-theme .alert-danger { border-color: #c62828; }
.dark-theme .alert-warning { border-color: #b8860b; }
.dark-theme .alert-info { border-color: #1565c0; }

.dark-theme .rank-badge {
    background: var(--text-muted);
}

.dark-theme .round-title {
    color: #ff6b6b;
    border-bottom-color: rgba(255, 107, 107, 0.25);
}

.dark-theme .section-title,
.dark-theme .admin-section-title {
    background: linear-gradient(135deg, #c62828, #1565c0);
}

.dark-theme .nav-tabs .nav-link {
    color: var(--text-secondary);
}

.dark-theme .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #c62828, #1565c0);
}

.dark-theme .table th {
    background: linear-gradient(135deg, #c62828, #1565c0);
}

.dark-theme a:not(.btn):not(.nav-link) {
    color: #5a9eff;
}

.dark-theme .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .text-dark {
    color: var(--text-primary) !important;
}

.dark-theme .text-danger {
    color: #ff6b6b !important;
}

.dark-theme .card-header {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.dark-theme .card-body {
    color: var(--text-primary);
}

.dark-theme .list-group-item {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* ===== Admin dark theme ===== */
.dark-theme .card-header.bg-success { background: #1b5e20 !important; }
.dark-theme .card-header.bg-warning { background: #7c5e10 !important; }
.dark-theme .card-header.text-white h5 { color: white; }

.dark-theme .table th {
    background: linear-gradient(135deg, #c62828, #1565c0);
}

.dark-theme .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .page-link:hover {
    background: var(--bg-card-hover);
    color: white;
}

.dark-theme .table-light,
.dark-theme .table-light td,
.dark-theme .table-light th {
    background: var(--bg-card);
    color: var(--text-primary);
}


