/* styles.css - ARCHIVO PRINCIPAL LIMPIO */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@700;800;900&family=Playfair+Display:wght@400;500;600&display=swap');
@import 'variables.css';    /* PRIMERO - variables */
@import 'base.css';         /* SEGUNDO - estilos base */
@import 'components.css';   /* TERCERO - componentes */
@import 'sections.css';     /* CUARTO - secciones (incluye registro) */
@import 'modals.css';       /* QUINTO - modales */
@import 'responsive.css';   /* SEXTO - responsive */

/********** Template CSS **********/
:root {
    --primary: #EB1616;
    --secondary: #191C24;
    --light: #6C7293;
    --dark: #000000;
    --nfl-blue: #00338D;
    --nfl-red: #D50A0A;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}

/*** Spinner Fix ***/
#spinner {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.8);
}

#spinner:not(.show) {
    opacity: 0;
    visibility: hidden;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/*** Button ***/
.btn {
    transition: .5s;
    border: none;
}

.btn-primary {
    background: var(--nfl-blue);
    border-color: var(--nfl-blue);
}

.btn-primary:hover {
    background: #002a6e;
    border-color: #002a6e;
}

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

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #000;
}

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

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: 50px;
}

/*** Layout ***/
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    overflow-y: auto;
    background: var(--secondary);
    transition: 0.5s;
    z-index: 999;
}

.content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--dark);
    transition: 0.5s;
}

@media (min-width: 992px) {
    .sidebar {
        margin-left: 0;
    }

    .sidebar.open {
        margin-left: -250px;
    }

    .content {
        width: calc(100% - 250px);
    }

    .content.open {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -250px;
    }

    .sidebar.open {
        margin-left: 0;
    }

    .content {
        width: 100%;
        margin-left: 0;
    }
}

/*** Navbar ***/
.sidebar .navbar .navbar-nav .nav-link {
    padding: 12px 20px;
    color: var(--light);
    font-weight: 500;
    border-left: 3px solid var(--secondary);
    border-radius: 0 30px 30px 0;
    outline: none;
    margin: 2px 0;
}

.sidebar .navbar .navbar-nav .nav-link:hover,
.sidebar .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
    background: var(--dark);
    border-color: var(--primary);
}

.sidebar .navbar .navbar-nav .nav-link i {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 40px;
}

.sidebar .navbar .navbar-nav .nav-link:hover i,
.sidebar .navbar .navbar-nav .nav-link.active i {
    background: var(--secondary);
}

.sidebar .navbar .dropdown-toggle::after {
    position: absolute;
    top: 15px;
    right: 15px;
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: .5s;
}

.sidebar .navbar .dropdown-toggle[aria-expanded=true]::after {
    transform: rotate(-180deg);
}

.sidebar .navbar .dropdown-item {
    padding-left: 25px;
    border-radius: 0 30px 30px 0;
    color: var(--light);
}

.sidebar .navbar .dropdown-item:hover,
.sidebar .navbar .dropdown-item.active {
    background: var(--dark);
    color: var(--primary);
}

.content .navbar .navbar-nav .nav-link {
    margin-left: 25px;
    padding: 12px 0;
    color: var(--light);
    outline: none;
}

.content .navbar .navbar-nav .nav-link:hover,
.content .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.content .navbar .sidebar-toggler,
.content .navbar .navbar-nav .nav-link i {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 40px;
}

.content .navbar .dropdown-item {
    color: var(--light);
}

.content .navbar .dropdown-item:hover,
.content .navbar .dropdown-item.active {
    background: var(--dark);
    color: var(--primary);
}

.content .navbar .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: middle;
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: .5s;
}

.content .navbar .dropdown-toggle[aria-expanded=true]::after {
    transform: rotate(-180deg);
}

/*** Cards & Tables ***/
.bg-secondary {
    background: var(--secondary) !important;
    border: 1px solid #2a2e3e;
}

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

.table {
    color: var(--light);
    margin-bottom: 0;
}

.table th {
    border-color: #2a2e3e;
    font-weight: 600;
    color: var(--light);
    background: var(--dark);
}

.table td {
    border-color: #2a2e3e;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(235, 22, 22, 0.1);
    color: var(--light);
}

/*** Badges ***/
.badge {
    font-weight: 500;
    padding: 6px 12px;
}

.badge.bg-primary {
    background: var(--nfl-blue) !important;
}

.badge.bg-success {
    background: var(--success) !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: #000;
}

/*** Prediction Status ***/
.prediction-local {
    background: rgba(40, 167, 69, 0.2);
    border-left: 4px solid var(--success);
}

.prediction-visita {
    background: rgba(23, 162, 184, 0.2);
    border-left: 4px solid var(--info);
}

.prediction-diferencia {
    background: rgba(255, 193, 7, 0.2);
    border-left: 4px solid var(--warning);
}

.confidence-high {
    color: var(--success);
    font-weight: 600;
}

.confidence-medium {
    color: var(--warning);
    font-weight: 600;
}

.confidence-low {
    color: var(--light);
    font-weight: 600;
}

/*** Quick Action Buttons ***/
.quick-action-btn {
    transition: all 0.3s ease;
    border: none;
    padding: 20px;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.quick-action-btn i {
    transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.1);
}

/*** Responsive ***/
@media (max-width: 575.98px) {
    .content .navbar .navbar-nav .nav-link {
        margin-left: 15px;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .content {
        margin-left: 0;
    }
}

/*** Custom Scrollbar ***/
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--dark);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/*** Loading Animation ***/
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/*** NFL Theme Enhancements ***/
.nfl-gradient {
    background: linear-gradient(135deg, var(--nfl-blue) 0%, var(--nfl-red) 100%);
}

.text-nfl-blue {
    color: var(--nfl-blue) !important;
}

.text-nfl-red {
    color: var(--nfl-red) !important;
}

.bg-nfl-blue {
    background: var(--nfl-blue) !important;
}

.bg-nfl-red {
    background: var(--nfl-red) !important;
}

/* ===== ESTILOS UNIFICADOS PARA QUINIELAS ===== */

/* Contenedor principal centrado */
.centered-table-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

/* Para desktop: 80% del ancho (más espacio para contenido) */
@media (min-width: 992px) {
    .centered-table-container {
        width: 80%;
        max-width: 1200px;
    }
}

/* Para tablets: 90% del ancho */
@media (min-width: 768px) and (max-width: 991px) {
    .centered-table-container {
        width: 90%;
    }
}

/* Para mobile: 100% del ancho */
@media (max-width: 767px) {
    .centered-table-container {
        width: 100%;
    }
}

/* Estilos unificados para ambas tablas */
.prediction-table-container,
.protouch-inicial-container {
    background: var(--secondary);
    border-radius: 10px;
    border: 1px solid #2a2e3e;
    overflow: hidden;
    margin-bottom: 2rem;
    width: 100%; /* Ambas tablas mismo ancho */
}

/* Header de tablas */
.table-header,
.protouch-header {
    background: var(--dark);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid #2a2e3e;
}

/* Grid para quiniela - ADAPTATIVO */
/* --- GENERAL (ESCRITORIO) --- */
.quiniela-grid {
    display: grid !important;
    /* 6 COLUMNAS: Sel(L) | Equipo(L) | Sel(E) | Equipo(V) | Sel(V) | Probabilidades */
    grid-template-columns: 45px 1fr 45px 1fr 45px 1.4fr !important;
    gap: 1px !important;
    width: 100% !important;
    background-color: #2a2e3e; /* Color de bordes */
    border: 1px solid #2a2e3e;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    
    /* Ajuste de texto pedido */
    font-size: 0.85rem !important; 
}

/* Celdas generales */
.quiniela-grid .grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 6px 8px !important; /* Relleno compacto */
    min-height: 45px !important; /* Altura reducida */
    color: white;
}

/* Columnas de Selección (L, E, V) */
.quiniela-grid .seleccion-col {
    background: #191C24; /* Un poco más oscuro */
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem !important;
}

/* Si está seleccionada (clase activa que pongas en tu HTML, ej: .selected) */
.quiniela-grid .seleccion-col.active {
    background: var(--success);
    color: white;
}

/* Columnas de Equipos */
.quiniela-grid .equipo-col {
    justify-content: flex-start !important; /* Alineado a la izquierda */
    padding-left: 12px !important;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos si no cabe */
}

/* Columna de Probabilidades */
.quiniela-grid .probabilidad-col {
    background: var(--bg-secondary);
    padding: 4px 10px !important;
}

/* BARRAS MÁS CHICAS (Lo que pediste) */
.prob-bar {
    height: 16px !important; /* Barra delgada */
    border-radius: 8px !important;
    font-size: 0.65rem !important; /* Texto pequeño */
    line-height: 16px !important;
    display: flex;
    width: 100%;
    overflow: hidden;
    background: #0f1116;
}

.prob-local, .prob-visita {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: 700;
}

/* Celdas base */
.grid-cell {
    padding: 1rem;
    background: var(--secondary);
    display: flex;
    align-items: center;
    min-height: 70px;
    border: none;
}

/* Columnas específicas */
.seleccion-col {
    justify-content: center;
    background: var(--dark);
    font-weight: bold;
    font-size: 1.1rem;
}

.equipo-col {
    justify-content: flex-start;
    font-weight: 600;
    color: white;
    padding-left: 1.5rem;
}

.probabilidad-col {
    padding: 0.75rem;
    justify-content: center;
}

/* 1. Reducir altura y texto de las barras de probabilidad */
/* Hacemos las barras más delgadas y estéticas */
.prob-bar {
    height: 16px !important; /* Mucho más delgadas */
    border-radius: 8px !important;
    font-size: 10px !important; /* Texto tiny */
    line-height: 16px !important;
    margin: 0 auto !important;
    min-width: 100% !important; /* Que ocupen su celda */
}

/* 2. Ajuste general de celdas */
.quiniela-grid .grid-cell {
    padding: 6px 4px !important; /* Menos padding */
    min-height: 45px !important; /* Filas más bajas */
    font-size: 10px !important;
}

/* 3. Equipos */
.quiniela-grid .equipo-col {
    padding-left: 8px !important;
    line-height: 1.2;
}

.prob-local {
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 4px; /* Menos padding lateral */
    transition: width 0.3s ease;
}

.prob-visita {
    background: var(--info);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: width 0.3s ease;
}

/* Predicción ganadora */
.prediccion-ganadora {
    background: rgba(235, 22, 22, 0.15) !important;
    border-left: 4px solid var(--primary) !important;
}

/* Tabla Protouch */
.protouch-grid {
    display: grid !important; /* <--- ESTO FALTABA */
    grid-template-columns: minmax(180px, 1.5fr) repeat(5, 1fr) !important;
    /* Fondo oscuro para las líneas divisorias */
    background-color: #2a2e3e; 
    gap: 1px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.protouch-cell {
    background: var(--bg-secondary);
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
    min-height: 50px;
}

/* Estilo para la columna del Nombre del Equipo (1ra columna) */
.protouch-cell:nth-child(6n+1) {
    justify-content: flex-start;
    padding-left: 15px;
    font-weight: 700;
    color: white;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}

/* Encabezados */
.protouch-header-cell {
    background: var(--nfl-blue) !important;
    color: white !important;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 15px 5px;
}

/* ===== ESTILOS PARA TABLA DE COMPARACIÓN DE MODELOS ===== */

/* CONSOLIDA LA APARIENCIA DE FONDO Y BORDE */
.model-comparison-divs {
    display: table;
    width: 100%;
    border-collapse: separate; /* Permite el border-spacing para simular separación si es necesario */
    border-spacing: 0 1px; /* Espacio mínimo entre filas */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed; 
    background: #1a1e26; /* Un color oscuro que simule los 'gaps' si la fila es más clara */
}

/* Fila base de la tabla */
.table-row {
    display: table-row;
    transition: background-color 0.2s;
    background: #191C24; /* Fondo de cada fila (secondary de tu tema) */
    border-radius: 4px;
}

/* Fila al pasar el cursor (hover) */
.table-row:hover:not(.header-row) {
    background-color: var(--bg-hover) !important;
}

/* Celda base */
.table-cell {
    display: table-cell;
    padding: 14px 12px;
    /* Quitamos el border-bottom de la celda y lo dejamos en el separador */ 
    vertical-align: middle;
    text-align: center;
    font-size: 14px;
    color: #f8f9fa; /* Texto principal CLARO */
    background: #191C24; /* Fondo de cada celda */
    border-bottom: 1px solid #2a2e3e; /* Separador oscuro */
}

/* Header row */
.header-row {
    background: linear-gradient(135deg, var(--nfl-blue), #002a6e) !important;
    color: white !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
}

.header-row .table-cell {
    border-bottom: 2px solid var(--nfl-blue) !important;
    padding: 16px 12px !important;
    background: transparent !important;
    color: white !important;
}

/* Column widths específicos (Mantener los ya ajustados) */
.table-cell.partido-info {
    width: 25%; 
    text-align: left;
    font-weight: 600;
    color: white !important; 
    font-weight: 600;
    padding-left: 20px;
}

.table-cell.partido-info strong {
    font-weight: 700;
}

.table-cell.modelo-cell {
    width: 14.5%;
}

.table-cell.consenso-cell {
    width: 17.5%;
}

/* Contenedor de predicciones */
.modelo-prediccion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 50px;
    justify-content: center;
}

/* ESTILOS INVERTIDOS (RESULTADO ES EL BADGE) */
.score {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 14px;
    min-width: 95px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.method-badge {
    background: none !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 0;
    border-radius: 0;
    min-width: auto;
}


/* Colores de badges */
.epa-badge { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.pbp-v4-badge { 
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.pbp-v5-badge { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3);
}

.poisson-badge { 
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.ensemble-badge { 
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

/* 1. Equipos más claros y legibles */
.model-comparison-divs .table-cell.partido-info {
    color: #ffffff !important;
    font-size: 15px;
}

.model-comparison-divs .table-cell.partido-info strong {
    font-weight: 500;
}

/* 2. Convertir el RESULTADO (Score) en el elemento con color */
.model-comparison-divs .score {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 14px;
    min-width: 95px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 3. Convertir el NOMBRE DEL MODELO en texto simple (sin fondo) */
.model-comparison-divs .method-badge {
    background: none !important;
    box-shadow: none !important;
    color: #adb5bd !important;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 0;
    border-radius: 0;
    min-width: auto;
}

/* 4. Mapear los colores a la clase .score en lugar de al badge */
.score.epa-badge { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.score.pbp-v4-badge { background: linear-gradient(135deg, #3498db, #2980b9); }
.score.pbp-v5-badge { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.score.poisson-badge { background: linear-gradient(135deg, #f39c12, #e67e22); }
.score.ensemble-badge { background: linear-gradient(135deg, #27ae60, #229954); }

/* ===== CORRECCIÓN COMPLETA PARA TABLA DE COMPARACIÓN DE MODELOS - TEMA OSCURO ===== */

/* FORZAR que la tabla de comparación use display: table */
.model-comparison-divs .table-row {
    display: table-row !important;
    grid-template-columns: none !important;
    background: transparent !important;
}

.model-comparison-divs .table-cell {
    display: table-cell !important;
    padding: 14px 12px !important;
    border-bottom: 1px solid var(--border-primary) !important;
    vertical-align: middle !important;
    text-align: center !important;
    font-size: 14px !important;
    background: var(--bg-card) !important;
    min-height: auto !important;
    justify-content: normal !important;
    align-items: normal !important;
    color: var(--text-primary) !important;
}

/* Header específico para tabla de comparación - TEMA OSCURO */
.model-comparison-divs .header-row {
    background: linear-gradient(135deg, var(--nfl-blue), #002a6e) !important;
    color: var(--white) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.model-comparison-divs .header-row .table-cell {
    border-bottom: 2px solid var(--nfl-blue) !important;
    padding: 16px 12px !important;
    background: transparent !important;
    color: var(--white) !important;
}

/* Anchos específicos para columnas */
.model-comparison-divs .table-cell.partido-info {
    width: 25% !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.model-comparison-divs .table-cell.modelo-cell {
    width: 14.5% !important;
}

.model-comparison-divs .table-cell.consenso-cell {
    width: 17.5% !important;
}

/* Texto específico para partido-info */
.model-comparison-divs .table-cell.partido-info strong {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

/* Restaurar contenedor de predicciones */
.model-comparison-divs .modelo-prediccion {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 50px !important;
    justify-content: center !important;
}

/* Restaurar estilos de score y badges - TEMA OSCURO */
.model-comparison-divs .score {
    display: inline-block !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    color: var(--white) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    min-width: 95px !important;
    box-shadow: var(--shadow-sm) !important;
}

.model-comparison-divs .method-badge {
    background: none !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    min-width: auto !important;
}

/* Colores para scores (manteniendo los mismos pero adaptados) */
.model-comparison-divs .score.epa-badge { 
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important; 
}
.model-comparison-divs .score.pbp-v4-badge { 
    background: linear-gradient(135deg, #3498db, #2980b9) !important; 
}
.model-comparison-divs .score.pbp-v5-badge { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important; 
}
.model-comparison-divs .score.poisson-badge { 
    background: linear-gradient(135deg, #f39c12, #e67e22) !important; 
}
.model-comparison-divs .score.ensemble-badge { 
    background: linear-gradient(135deg, #27ae60, #229954) !important; 
}

/* Efecto hover para filas del cuerpo - TEMA OSCURO */
.model-comparison-divs .table-row:not(.header-row):hover .table-cell {
    background-color: var(--bg-hover) !important;
}

/* Borde de la tabla completa - TEMA OSCURO */
.model-comparison-divs {
    border: 1px solid var(--border-primary) !important;
    background: var(--bg-card) !important;
}

/* ===== CORRECCIONES RESPONSIVE ESPECÍFICAS PARA MÓVIL ===== */

/* ====================================================================== */
/* @media (max-width: 768px) - CORRECCIÓN DEFINITIVA DE ANCHOS */
/* ====================================================================== */

@media (max-width: 768px) {

    /* ==========================================
       1. ESTILOS DE QUINIELA Y PROTOUCH (Tus originales)
       ========================================== */
    .protouch-grid {
        display: grid !important;
        /* 3 Columnas: Etiqueta | Local | Visita */
        grid-template-columns: 0.8fr 1fr 1fr !important; 
        gap: 1px !important;
        background-color: #2a2e3e !important; /* Color de líneas */
        border: 1px solid #2a2e3e;
        margin-bottom: 1rem;
    }

    .protouch-cell {
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: auto !important;
        margin: 0 !important;
        border: none !important;
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
        background: var(--bg-secondary) !important;
        min-height: 40px;
    }

    /* --- REORDENAMIENTO DE CELDAS (LO MÁS IMPORTANTE) --- */
    
    /* 1. ENCABEZADOS DE COLUMNA (NOMBRES DE EQUIPOS) */
    /* Movemos el nombre del Local (Celda 7) a la Fila 1, Columna 2 */
    .protouch-cell:nth-child(7) { 
        grid-row: 1; grid-column: 2; 
        background: var(--nfl-blue) !important; 
        color: white; font-weight: bold; font-size: 0.9rem !important;
    }
    /* Movemos el nombre de Visita (Celda 13) a la Fila 1, Columna 3 */
    .protouch-cell:nth-child(13) { 
        grid-row: 1; grid-column: 3; 
        background: var(--nfl-red) !important; 
        color: white; font-weight: bold; font-size: 0.9rem !important;
    }
    
    /* Esquina Superior Izquierda (Título "Cuarto") */
    .protouch-header-cell:nth-child(1) { 
        display: flex !important; grid-row: 1; grid-column: 1; 
        background: #15171d !important; color: #aaa !important; 
        font-weight: bold;
    }
    
    /* 2. FILAS DE DATOS (Comparación por Cuarto) */
    
    /* --- 1er Cuarto --- */
    .protouch-header-cell:nth-child(2) { display: flex !important; grid-row: 2; grid-column: 1; background: #1c1f26 !important; }
    .protouch-cell:nth-child(8)        { grid-row: 2; grid-column: 2; } /* Dato Local */
    .protouch-cell:nth-child(14)       { grid-row: 2; grid-column: 3; } /* Dato Visita */

    /* --- 2do Cuarto --- */
    .protouch-header-cell:nth-child(3) { display: flex !important; grid-row: 3; grid-column: 1; background: #1c1f26 !important; }
    .protouch-cell:nth-child(9)        { grid-row: 3; grid-column: 2; }
    .protouch-cell:nth-child(15)       { grid-row: 3; grid-column: 3; }

    /* --- 3er Cuarto --- */
    .protouch-header-cell:nth-child(4) { display: flex !important; grid-row: 4; grid-column: 1; background: #1c1f26 !important; }
    .protouch-cell:nth-child(10)       { grid-row: 4; grid-column: 2; }
    .protouch-cell:nth-child(16)       { grid-row: 4; grid-column: 3; }

    /* --- 4to Cuarto --- */
    .protouch-header-cell:nth-child(5) { display: flex !important; grid-row: 5; grid-column: 1; background: #1c1f26 !important; }
    .protouch-cell:nth-child(11)       { grid-row: 5; grid-column: 2; }
    .protouch-cell:nth-child(17)       { grid-row: 5; grid-column: 3; }

    /* --- TOTAL --- */
    .protouch-header-cell:nth-child(6) { display: flex !important; grid-row: 6; grid-column: 1; background: #1c1f26 !important; font-weight: bold; color: white; }
    .protouch-cell:nth-child(12)       { grid-row: 6; grid-column: 2; font-weight: bold; color: var(--success); }
    .protouch-cell:nth-child(18)       { grid-row: 6; grid-column: 3; font-weight: bold; color: var(--success); }

    /* LIMPIEZA */
    .protouch-cell::before { content: none !important; } /* Quitamos las etiquetas viejas */
    
    /* Ocultar fila "Sin Touchdown" para ahorrar espacio (opcional, si quieres mostrarla avísame) */
    .protouch-cell:nth-child(n+19) { display: none !important; }

    .prob-local, .prob-visita {
        font-size: 8.5px !important; /* Texto diminuto para celular */
    }

    .quiniela-grid {
        /* Columnas ajustadas al milímetro */
        /* Sel(25px) | Equipo(Auto) | Sel(25px) | Equipo(Auto) | Sel(25px) | Prob(70px) */
        grid-template-columns: 28px 1fr 28px 1fr 28px 75px !important;
        font-size: 0.7rem !important;
    }
    .quiniela-grid .grid-cell {
        padding: 4px 2px !important; /* Mínimo padding */
        min-height: 40px !important;
    }

    .quiniela-grid .equipo-col {
        padding-left: 4px !important;
        font-size: 0.7rem !important;
    }

    .quiniela-grid .seleccion-col {
        font-size: 0.75rem !important;
    }
    .probabilidad-col {
        padding: 2px !important; /* Sin padding para ganar espacio */
    }
    
    .prob-bar {
        height: 16px !important; /* Barra un pelín más fina en celular */
        font-size: 9px !important; /* Texto diminuto pero legible */
        line-height: 16px !important;
    }
    
    /* Cortar nombres largos si es necesario */
    .equipo-col {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .seleccion-col {
        font-size: 0.75rem !important;
        padding: 0 !important;
    }

    .table-actions { flex-direction: column !important; align-items: center !important; gap: 0.75rem !important; text-align: center; }
    .table-actions .btn { width: 200px !important; margin: 0 auto !important; }
    .table-actions .row { justify-content: center !important; text-align: center; }

    /* ==========================================
       2. CORRECCIÓN TABLA ANÁLISIS COMPLETO
       ========================================== */
    
    /* Contenedor principal */
    .model-comparison-divs {
        display: block !important;
        background: transparent !important;
    }
    
    /* TARJETA DEL PARTIDO */
    .model-comparison-divs .table-row {
        display: block !important;
        margin-bottom: 1.5rem !important;
        padding: 0 !important;
        border: 1px solid var(--border-primary) !important;
        border-radius: 12px !important;
        background: var(--bg-secondary) !important;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
    }
    
    /* Ocultar encabezados globales */
    .model-comparison-divs .header-row {
        display: none !important;
    }

    /* CABECERA DE LA TARJETA (Los Equipos) */
    /* IMPORTANTE: width: 100% para sobreescribir el 25% de escritorio */
    .model-comparison-divs .table-cell.partido-info {
        display: block !important;
        width: 100% !important; 
        background: linear-gradient(90deg, var(--nfl-blue), #002a6e) !important;
        color: white !important;
        text-align: center !important;
        padding: 15px 10px !important;
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        border-bottom: 1px solid var(--border-primary) !important;
        margin-bottom: 0 !important;
        white-space: normal !important; /* Permitir salto de línea natural si es muy largo */
    }

    /* FILAS DE MODELOS */
    /* IMPORTANTE: width: 100% para sobreescribir el 14.5% de escritorio */
    .model-comparison-divs .table-cell.modelo-cell,
    .model-comparison-divs .table-cell.consenso-cell {
        display: flex !important; 
        justify-content: space-between !important; 
        align-items: center !important;
        width: 100% !important;
        padding: 12px 15px !important;
        background: var(--bg-card) !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    }
    
    .model-comparison-divs .table-cell:last-child {
        border-bottom: none !important;
    }

    /* ETIQUETA DEL MODELO (Izquierda) */
    .model-comparison-divs .table-cell.modelo-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #adb5bd !important;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex: 1; /* Ocupar espacio disponible */
        text-align: left;
    }
    
    .model-comparison-divs .table-cell.consenso-cell::before {
        content: "ENSEMBLE FINAL";
        font-weight: 700;
        color: var(--success) !important;
        font-size: 0.9rem;
        text-transform: uppercase;
        flex: 1;
        text-align: left;
    }

    /* RESULTADO (Derecha) */
    .model-comparison-divs .modelo-prediccion {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
    }
    
    /* El botón de score */
    .model-comparison-divs .score {
        font-size: 1rem !important;
        padding: 6px 12px !important;
        min-width: 90px !important; /* Un poco más ancho */
        text-align: center !important;
        white-space: nowrap !important; /* ¡IMPORTANTE! Evita que el número se parta */
    }

    /* Ocultar badges pequeños redundantes */
    .model-comparison-divs .method-badge {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* ===== MÓVIL MUY PEQUEÑO ===== */
    .quiniela-grid {
        grid-template-columns: 30px 1fr 30px 1fr 30px 80px !important;
        font-size: 0.7rem;
    }
    
    .prob-bar {
        min-width: 75px !important;
        height: 18px !important;
    }
    
    .grid-cell {
        padding: 0.3rem !important;
        min-height: 40px !important;
    }
    
    /* Tabla análisis completo - más compacta */
    .model-comparison-divs .table-row {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .model-comparison-divs .table-cell {
        padding: 6px !important;
    }
    
    .table-actions .btn {
        width: 100% !important;
        max-width: 280px !important;
    }
    
    /* Protouch table más compacta */
    .protouch-cell {
        padding: 0.25rem !important;
        font-size: 0.7rem !important;
    }
}

/* ========================================================= */
/* ESTILOS PARA EL HERO DE ANÁLISIS (TÍTULO Y MÉTRICAS COMPACTAS) */
/* ========================================================= */

/* Contenedor principal del encabezado */
.analysis-hero {
    background: #191C24; /* Fondo oscuro */
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #2a2e3e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Fila superior: Título y Badges */
.hero-top-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem; /* Separación con las métricas */
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.hero-title h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-subtitle {
    color: #6C7293;
    font-size: 0.9rem;
    margin-top: 4px;
}

.hero-badges {
    display: flex;
    gap: 8px;
}

/* --- AQUÍ ESTÁ LA MAGIA: GRID DE MÉTRICAS COMPACTAS --- */
.stats-grid {
    display: grid;
    gap: 12px;
    /* Por defecto (Móvil): Cuadrícula 2x2 */
    grid-template-columns: repeat(2, 1fr); 
}

/* En Escritorio: Una sola fila de 4 */
@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Diseño de cada "Botón" de Métrica */
.stat-card-compact {
    background: #0f1116; /* Un poco más oscuro que el fondo para contraste */
    border: 1px solid #2a2e3e;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px; /* Altura controlada */
}

.stat-card-compact:hover {
    transform: translateY(-2px);
    border-color: var(--nfl-blue);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    
    /* 1. Definimos el efecto degradado por defecto */
    background: linear-gradient(45deg, #ffffff, #aab7c4);
    
    /* 2. Aplicamos el recorte al texto (con prefijos para compatibilidad) */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* 3. Hacemos el texto transparente para ver el fondo */
    -webkit-text-fill-color: transparent;
    color: transparent; 
}

.stat-label {
    font-size: 0.75rem;
    color: #6C7293;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Colores específicos para los valores */
.stat-value.highlight-blue {
    background: none !important;              /* Quita el fondo degradado */
    -webkit-background-clip: border-box !important; /* Quita el recorte de texto */
    background-clip: border-box !important;
    -webkit-text-fill-color: initial !important;    /* Restaura el relleno de texto */
    color: var(--nfl-blue) !important;        /* Aplica el color azul */
}

.stat-value.highlight-green {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: initial !important;
    color: #28a745 !important;
}

.stat-value.highlight-yellow {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: initial !important;
    color: #ffc107 !important;
}
/* Ajustes para móvil muy pequeño */
@media (max-width: 480px) {
    .analysis-hero { padding: 1rem; }
    .hero-title h2 { font-size: 1.4rem; }
    .hero-badges { width: 100%; justify-content: flex-start; }
    .stat-value { font-size: 1.2rem; }
}