/* ===== INTER FONT OVERRIDE ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

h1, h2, h3, h4, h5, h6,
p, a,
input, textarea, select, label,
.card-header, .card-body, .card-footer,
.table,
.navbar-brand {
    font-family: 'Inter', sans-serif !important;
}

/* Кнопки БЕЗ иконок */
button:not([class*="tim-icons"]):not(.navbar-toggler),
.btn:not([class*="tim-icons"]) {
    font-family: 'Inter', sans-serif !important;
}

/* КРИТИЧНО: НЕ трогаем иконки! */
.tim-icons,
i[class*="tim-icons"],
i[class*="icon-"],
.fa, .fas, .far, .fab, .fal {
    font-family: 'nucleo-outline' !important;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.btn, button {
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

/* Моноширинные цифры */
.balance-amount,
.history-table td,
input[type="number"],
input[inputmode="decimal"] {
    font-variant-numeric: tabular-nums;
}

/* ========================================
   PROJECTFADE - ЕДИНАЯ ДИЗАЙН-СИСТЕМА
   ======================================== */

/* ===== МАКСИМАЛЬНО СПЕЦИФИЧНЫЙ СЕЛЕКТОР ДЛЯ КОЛОНОК ===== */
html body .wrapper .main-panel .content .row > div[class*="col"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

html body .wrapper .main-panel .content .row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

/* ===== 1. ОТСТУПЫ И КОНТЕЙНЕРЫ ===== */

/* Самый приоритетный блок для колонок */
.content .row > div[class*="col"],
.row > div[class*="col"],
div[class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

/* Отступы content */
.content {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

@media (min-width: 992px) {
    .content {
        padding-left: 30px !important;
        padding-right: 30px !important;
    }
}

@media (max-width: 991px) {
    .navbar-brand {
        padding-left: 15px !important;
        margin-left: 0 !important;
    }
}

/* ===== ДЕСКТОП - ОТСТУП ДЛЯ БОКОВОГО МЕНЮ ===== */
@media (min-width: 992px) {
    .main-panel {
        width: calc(100% - 260px) !important;
        margin-left: 260px !important;
    }
}

/* ===== 2. КАРТОЧКИ - ЕДИНЫЙ СТИЛЬ ===== */

/* ===== КНОПКИ НА СТРАНИЦЕ ТУРНИРОВ ===== */

/* Кнопка "Подробнее" / "Details" */
a.btn.btn-outline-primary-custom,
a.btn.btn-outline-custom.btn-outline-primary-custom,
.card-footer a.btn-sm:first-child,
a[href*="tournament_details"].btn {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.9), rgba(156, 39, 176, 0.9)) !important;
    border: 1px solid rgba(233, 30, 99, 0.4) !important;
    color: #fff !important;
}

a.btn.btn-outline-primary-custom:hover,
.card-footer a.btn-sm:first-child:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 1), rgba(156, 39, 176, 1)) !important;
    border-color: rgba(233, 30, 99, 0.6) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.4) !important;
}

/* Кнопка "Вступить" / "Join" */
.btn.btn-outline-success-custom,
.card-footer button[value="join"],
form button[name="action"][value="join"] {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.2), rgba(16, 185, 129, 0.2)) !important;
    border: 1px solid rgba(45, 206, 137, 0.4) !important;
    color: #2dce89 !important;
}

.btn.btn-outline-success-custom:hover:not(:disabled),
form button[name="action"][value="join"]:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.3), rgba(16, 185, 129, 0.3)) !important;
    border-color: rgba(45, 206, 137, 0.6) !important;
    box-shadow: 0 5px 15px rgba(45, 206, 137, 0.3) !important;
}

/* Кнопка "Joined" / "Участвую" (disabled) */
.btn.btn-outline-success-custom:disabled {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.2), rgba(16, 185, 129, 0.2)) !important;
    opacity: 0.7 !important;
}

.card {
    border-radius: 15px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.5), rgba(30, 30, 47, 0.5)) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 20px !important;
    box-shadow: 0 1px 20px 0px rgba(0, 0, 0, 0.1) !important;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1) !important;
    /* transform: translateY(-2px) !important; */  /* ОТКЛЮЧЕНО */
}

.card .card-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 15px 15px 0 !important;
    border: 0 !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.card .card-body {
    padding: 15px !important;
}

.card .card-footer {
    background-color: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-bottom: none !important;
    padding: 15px !important;
}

/* ===== 3. КНОПКИ - ЦВЕТОВАЯ СИСТЕМА ===== */

.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    font-family: 'Inter', sans-serif !important;
}

.btn:focus,
.btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* PRIMARY - Розово-фиолетовый градиент */
.btn-primary,
.btn-info,
a[href*="tournament_details"],
a[href*="marathon_details"] {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.9), rgba(156, 39, 176, 0.9)) !important;
    border: 1px solid rgba(233, 30, 99, 0.4) !important;
    color: #fff !important;
}

.btn-primary:hover:not(:disabled),
.btn-info:hover,
a[href*="tournament_details"]:hover,
a[href*="marathon_details"]:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 1), rgba(156, 39, 176, 1)) !important;
    border-color: rgba(233, 30, 99, 0.6) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.4) !important;
    text-decoration: none !important;
}

.btn-primary:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* SUCCESS - Зеленый градиент */
.btn-success,
.btn-outline-success,
button[value="join"] {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.2), rgba(16, 185, 129, 0.2)) !important;
    border: 1px solid rgba(45, 206, 137, 0.4) !important;
    color: #2dce89 !important;
}

.btn-success:hover:not(:disabled),
.btn-outline-success:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.3), rgba(16, 185, 129, 0.3)) !important;
    border-color: rgba(45, 206, 137, 0.6) !important;
    color: #2dce89 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(45, 206, 137, 0.3) !important;
}

/* DANGER - Красный */
.btn-danger {
    background: rgba(253, 93, 147, 0.15) !important;
    border: 1px solid rgba(253, 93, 147, 0.4) !important;
    color: #fd5d93 !important;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(253, 93, 147, 0.25) !important;
    border-color: rgba(253, 93, 147, 0.6) !important;
    color: #fd5d93 !important;
    transform: translateY(-2px) !important;
}

/* SECONDARY - Серый */
.btn-secondary {
    background: rgba(136, 152, 170, 0.15) !important;
    border: 1px solid rgba(136, 152, 170, 0.3) !important;
    color: #8898aa !important;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(136, 152, 170, 0.25) !important;
    border-color: rgba(136, 152, 170, 0.5) !important;
    color: #8898aa !important;
}

/* ===== 4. NAVBAR ===== */

.navbar-toggler {
    display: none !important;
}

.navbar-brand span {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    color: white !important;
}

/* ===== 5. ПРОГРЕСС-БАРЫ ===== */

.progress {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
}

.progress-bar {
    border-radius: 10px !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #2dce89, #11cdef) !important;
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, #5e72e4, #825ee4) !important;
}

/* ===== 6. BADGES ===== */

.badge {
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.badge-pill {
    border-radius: 20px !important;
}

/* ===== 7. ТАБЛИЦЫ ===== */

.table {
    color: rgba(255, 255, 255, 0.8) !important;
}

.table th {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 600 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.5px !important;
}

.table td {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.table tbody tr {
    transition: background 0.2s ease !important;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ===== 8. ФОРМЫ ===== */

.form-control {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(233, 30, 99, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.15) !important;
}

.form-group label {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
}

/* ===== 9. ALERTS ===== */

.alert {
    border-radius: 10px !important;
    border: none !important;
}

/* ===== 10. RESPONSIVE ===== */

@media (max-width: 768px) {
    .btn {
        font-size: 0.875rem !important;
        padding: 8px 16px !important;
    }

    .btn-sm {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }
}

/* ========================================
   КОМПАКТНЫЕ КАРТОЧКИ МАТЧЕЙ (V2)
   ======================================== */

.match-card-compact {
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.5), rgba(30, 30, 47, 0.5)) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.match-card-compact:hover {
    border-color: rgba(233, 30, 99, 0.3) !important;
    transform: translateY(-2px) !important;
}

/* Шапка матча */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 44px;
}

.match-icons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.match-icons .ai-prediction-icon {
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    color: #00f2c3;
}

.match-icons .h2h-stats-trigger {
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    color: #5e72e4;
    text-decoration: none;
}

.match-icons .ai-prediction-icon:hover,
.match-icons .h2h-stats-trigger:hover {
    opacity: 1;
    transform: scale(1.15);
}

.match-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.match-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Live таймер */
.live-timer-compact {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: rgba(255, 0, 0, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.lottie-container {
    width: 20px !important;
    height: 20px !important;
}

.timer-text {
    font-size: 0.85rem;
    color: #ff4444;
    font-weight: 600;
}

/* Кнопки действий */
.btn-icon-compact {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-icon-compact:hover {
    background: rgba(233, 30, 99, 0.15);
    border-color: rgba(233, 30, 99, 0.4);
    color: #e91e63;
}

.btn-save {
    background: rgba(45, 206, 137, 0.15) !important;
    border-color: rgba(45, 206, 137, 0.4) !important;
    color: #2dce89 !important;
}

/* Очки */
.points-badge {
    background: linear-gradient(135deg, rgba(45, 206, 137, 0.25), rgba(16, 185, 129, 0.25));
    border: 1px solid rgba(45, 206, 137, 0.4);
    color: #2dce89;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Тело матча */
.match-body {
    padding: 14px 16px;
}

.team-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.team-row:first-child {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.team-row:last-child {
    padding-top: 12px;
}

/* Информация о команде */
.team-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.team-logo-compact {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name-compact {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

/* Форма команды */
.team-form-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.form-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-dot:hover {
    transform: scale(1.4);
}

.form-W {
    background: #2dce89;
    box-shadow: 0 0 6px rgba(45, 206, 137, 0.5);
}

.form-D {
    background: #8898aa;
    box-shadow: 0 0 6px rgba(136, 152, 170, 0.5);
}

.form-L {
    background: #fd5d93;
    box-shadow: 0 0 6px rgba(253, 93, 147, 0.5);
}

/* Секция счёта */
.score-section {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 80px;
    justify-content: flex-end;
}

/* Live счёт */
.live-score-compact {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
}

.live-score-compact .score-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff4444;
}

/* Финальный счёт */
.final-score-compact {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
}

.final-score-compact .score-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

/* Прогноз */
.prediction-compact {
    min-width: 50px;
}

.pred-display {
    background: rgba(233, 30, 99, 0.15);
    border: 1px solid rgba(233, 30, 99, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #e91e63;
    min-width: 40px;
    text-align: center;
    display: inline-block;
}

.pred-input {
    background: rgba(233, 30, 99, 0.2) !important;
    border: 1px solid rgba(233, 30, 99, 0.4) !important;
    color: #e91e63 !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    width: 50px !important;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
    .match-header {
        padding: 8px 12px;
    }

    .match-time {
        font-size: 0.8rem;
    }

    .match-body {
        padding: 12px;
    }

    .team-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    .team-name-compact {
        max-width: 130px;
        font-size: 0.9rem;
    }

    .team-form-dots {
        order: 3;
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .score-section {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .team-name-compact {
        max-width: 100px;
        font-size: 0.85rem;
    }

    .form-dot {
        width: 6px;
        height: 6px;
    }
}