/* ============ FRONTEND PÚBLICO ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #c8102e;
    --primary-dark: #9b0c23;
    --secondary: #0033a0;
    --secondary-dark: #002270;
    --accent: #f5a623;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --white: #ffffff;
    --bg: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .25s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ HEADER ============ */
.front-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray-900) 100%);
    color: white;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.front-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 18px;
}

.front-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(200,16,46,.4);
}

.front-logo-text small {
    display: block;
    font-size: 10px;
    color: var(--gray-300);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hamburger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all var(--transition);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.front-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, var(--gray-900) 100%);
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
    z-index: 100;
    padding: 80px 24px 24px;
}

.front-menu.active { right: 0; }

.front-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
}

.front-menu-item:hover {
    background: rgba(255,255,255,.08);
    color: white;
    transform: translateX(4px);
}

.front-menu-item.active {
    background: linear-gradient(90deg, var(--primary), transparent);
    color: white;
    box-shadow: inset 3px 0 0 var(--accent);
}

.front-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.front-overlay.active { display: none !important; }

/* ============ CONTENIDO ============ */
.front-main {
    padding: 24px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.front-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--dark);
    margin-bottom: 8px;
}

.front-subtitle {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

.front-selector {
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.front-selector label {
    font-weight: 700;
    color: var(--gray-700);
    font-size: 14px;
}

.front-selector select {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(200,16,46,.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200,16,46,.4);
}

.front-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.front-cat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.front-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.front-cat-age {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 6px;
}

.front-cat-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.front-cat-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.front-cat-info strong { color: var(--dark); }

/* ============ TABLAS ============ */
.front-table-wrap {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.front-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.front-table th {
    background: var(--gray-900);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
}

.front-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.front-table tr:hover td { background: var(--gray-100); }

.front-equipo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.front-logo-eq {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.front-logo-eq img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.front-logo-eq .inicial {
    font-size: 16px;
    font-weight: 900;
    color: var(--gray-500);
}

.front-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.front-badge-a { background: #fee2e2; color: var(--primary); }
.front-badge-b { background: #dbeafe; color: var(--secondary); }
.front-badge-c { background: #fef3c7; color: #92400e; }
.front-badge-d { background: #d1fae5; color: #065f46; }

/* ============ FASE HEADER ============ */
.front-fase-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray-900) 50%, var(--primary) 100%);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius);
    margin: 20px 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
}

.front-fase-header h2 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.front-fase-badge {
    background: var(--accent);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.front-grupo-sep {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: 12px 20px;
    margin: 16px 0 10px 0;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--accent);
}

.front-grupo-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.front-fecha-grupo { font-size: 13px; }

.front-estadio-grupo {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
}

.front-cant-juegos {
    background: var(--accent);
    color: var(--dark);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 800;
}

/* ============ JUEGO CARD ============ */
.front-juego {
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    align-items: stretch;
    transition: all var(--transition);
}

.front-juego:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.front-juego.finalizado { border-left: 4px solid var(--success); }
.front-juego.programado { border-left: 4px solid var(--secondary); }
.front-juego.suspendido { border-left: 4px solid var(--warning); opacity: 0.7; }

.front-hora {
    background: linear-gradient(180deg, var(--dark) 0%, var(--gray-900) 100%);
    color: white;
    padding: 10px 8px;
    text-align: center;
    min-width: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.front-hora .hora { font-size: 13px; font-weight: 800; }
.front-hora .fecha { font-size: 8px; text-transform: uppercase; opacity: 0.7; }
.front-hora .jid { font-size: 7px; opacity: 0.5; margin-top: 2px; }

.front-eq {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.front-eq.local { background: linear-gradient(90deg, #f8fafc 0%, white 100%); }

.front-eq-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.front-eq-logo img { width: 100%; height: 100%; object-fit: cover; }

.front-eq-logo .inicial {
    font-size: 12px;
    font-weight: 900;
    color: var(--gray-500);
}

.front-eq-info { flex: 1; min-width: 0; }

.front-eq-nombre {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.front-eq-meta {
    font-size: 9px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.front-marcador {
    background: linear-gradient(180deg, var(--gray-900) 0%, #000 100%);
    color: white;
    padding: 8px 10px;
    text-align: center;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.front-marcador .score { font-size: 16px; font-weight: 900; letter-spacing: 1px; }
.front-marcador .score .sep { color: var(--accent); margin: 0 2px; }

.front-marcador .estado {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
}

.front-marcador .estado.finalizado { background: var(--success); }
.front-marcador .estado.programado { background: var(--secondary); }
.front-marcador .estado.suspendido { background: var(--warning); color: var(--dark); }

.front-juego-elim {
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--gray-100);
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
}

.front-juego-elim.cuartos { border-top: 4px solid var(--primary); }
.front-juego-elim.semi { border-top: 4px solid var(--accent); }
.front-juego-elim.final { 
    border-top: 4px solid var(--success); 
    background: linear-gradient(135deg, white 0%, #f0fdf4 100%); 
}

.front-desc-elim {
    grid-column: 1 / -1;
    background: var(--gray-100);
    padding: 6px 16px;
    text-align: center;
    font-weight: 700;
    color: var(--dark);
    font-size: 11px;
    border-top: 1px dashed var(--gray-300);
}

.front-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.front-empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: .4;
}

.front-footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 20px;
    text-align: center;
    font-size: 12px;
    margin-top: 40px;
}

.front-footer strong { color: var(--accent); }

/* ============ MODAL ============ */
.front-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.front-modal-backdrop.active { display: flex; }

.front-modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: frontModalIn .3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes frontModalIn {
    from { opacity: 0; transform: translateY(-20px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.front-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.front-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.front-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray-500);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: all var(--transition);
}

.front-modal-close:hover {
    background: var(--gray-100);
    color: var(--dark);
}

.front-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ============ ✅ BALANCE DETALLE (EXACTO AL EXCEL) ============ */
.balance-detalle-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

.balance-detalle-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.balance-detalle-header h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.5px;
}

.balance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.balance-table th {
    background: var(--gray-900);
    color: white;
    padding: 10px 12px;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    white-space: nowrap;
}

.balance-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.balance-table tr:hover td {
    background: var(--gray-100);
}

.balance-table .text-left { text-align: left; }
.balance-table .text-right { text-align: right; }

.balance-table .highlight {
    background: #fef3c7 !important;
    font-weight: 700;
}

.balance-table .positive {
    color: var(--success);
    font-weight: 700;
}

.balance-table .negative {
    color: var(--danger);
    font-weight: 700;
}

.balance-detalle-total {
    background: var(--gray-100);
    padding: 14px 20px;
    font-weight: 700;
    border-top: 3px solid var(--gray-300);
}

.balance-detalle-total td {
    padding: 12px;
    font-size: 14px;
    border-bottom: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .front-header { padding: 12px 16px; }
    .front-logo { font-size: 15px; }
    .front-logo-icon { width: 34px; height: 34px; font-size: 17px; }
    .front-main { padding: 16px 12px; }
    .front-title { font-size: 22px; }
    .front-menu { width: 85%; max-width: 300px; }
    
    .front-juego, .front-juego-elim { grid-template-columns: 1fr; }
    
    .front-hora {
        flex-direction: row;
        justify-content: space-between;
        padding: 8px 12px;
        min-width: auto;
    }
    
    .front-eq { padding: 10px 12px; }
    
    .front-marcador {
        flex-direction: row;
        justify-content: space-around;
        padding: 8px;
        min-width: auto;
    }
    
    .front-marcador .score { font-size: 14px; }
    
    .front-grupo-sep {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 14px;
    }
    
    .front-grupo-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .front-table-wrap { overflow-x: auto; }
    .front-table { min-width: 500px; }
    
    .front-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .front-selector select { min-width: auto; }
    
    .front-modal-backdrop { padding: 10px; }
    .front-modal-body { padding: 16px; }
    .front-modal-header { padding: 16px 20px; }
    .front-modal-title { font-size: 16px; }
    
    .balance-table { font-size: 11px; }
    .balance-table th, .balance-table td { padding: 6px 4px; }
    .balance-detalle-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .balance-detalle-header h3 { font-size: 15px; }
}

@media (max-width: 480px) {
    .front-title { font-size: 20px; }
    .front-cat-grid { grid-template-columns: 1fr; }
    .front-cat-age { font-size: 24px; }
    .front-cat-name { font-size: 14px; }
}/* ========== DISTRIBUCIÓN DE GRUPOS (tal cual la imagen) ========== */
.grupos-distribucion {
    margin-bottom: 40px;
}

.grupos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.grupos-titulo {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
}

.grupos-total-badge {
    background: #fff3cd;
    color: #856404;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.grupos-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.grupo-card-ref {
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #e63946;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.grupo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.grupo-card-nombre {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
}

.grupo-card-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.grupo-card-badge.badge-activo {
    background: #ffe0e3;
    color: #e63946;
}

.grupo-card-badge.badge-vacio {
    background: #d4edda;
    color: #155724;
}

.grupo-card-body {
    padding: 8px 0;
}

.equipo-ref-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid #e9ecef;
}

.equipo-ref-item:last-child {
    border-bottom: none;
}

.equipo-ref-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.equipo-ref-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e63946;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.equipo-ref-nombre {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.sin-equipos {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 16px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .grupos-cards-grid {
        grid-template-columns: 1fr;
    }
    .grupos-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============ MODELO DE CALENDARIO OFICIAL ============ */
.modelo-programacion { margin-bottom: 18px; }
.modelo-hero {
    background: linear-gradient(135deg, #111827 0%, #172554 70%, #0f766e 100%);
    color: #fff; text-align: center; padding: 22px 16px 20px;
    border-radius: 10px 10px 0 0; border-bottom: 4px solid #0ea5e9;
}
.modelo-hero span { color: #38bdf8; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.modelo-hero h2 { margin: 5px 0 3px; font-size: 21px; letter-spacing: .4px; }
.modelo-hero small { color: #cbd5e1; font-size: 10px; }
.modelo-section-title {
    background: #fff; color: #374151; text-align: center; padding: 9px;
    font-size: 11px; font-weight: 800; letter-spacing: .5px;
}
.modelo-grupos {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; background: #f8fafc; padding: 8px;
}
.modelo-grupo {
    min-height: 66px; padding: 8px 10px; border-left: 3px solid #0ea5e9;
    background: #fff; border-radius: 5px; box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.modelo-grupo strong { display: block; color: #0369a1; font-size: 9px; margin-bottom: 5px; }
.modelo-grupo span { display: block; color: #475569; font-size: 10px; line-height: 1.45; }
.modelo-vacio { color: #94a3b8; text-align: center; }
.modelo-jornada { margin: 12px 0 18px; }
.modelo-jornada-title {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    background: #172033; color: #fff; padding: 9px 12px; font-size: 11px;
    letter-spacing: .3px; border-radius: 5px 5px 0 0;
}
.modelo-jornada-title span {
    background: #0891b2; border-radius: 12px; padding: 4px 9px;
    font-size: 8px; font-weight: 800; letter-spacing: .4px;
}
.modelo-table-wrap { overflow-x: auto; background: #fff; box-shadow: 0 2px 7px rgba(15,23,42,.08); }
.modelo-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 11px; }
.modelo-table th {
    background: #f1f5f9; color: #64748b; padding: 7px 6px; text-align: center;
    font-size: 8px; letter-spacing: .4px; white-space: nowrap;
}
.modelo-table td {
    padding: 8px 6px; border-top: 1px solid #eef2f7; color: #334155;
    text-align: center; white-space: nowrap;
}
.modelo-table tbody tr:hover { background: #f8fafc; }
.modelo-table td:nth-child(5), .modelo-table td:nth-child(7) { text-align: left; font-weight: 600; }
.modelo-table td:first-child { color: #64748b; font-weight: 700; }
.modelo-vs { color: #0f172a !important; font-weight: 900 !important; font-size: 9px; }
@media (max-width: 700px) {
    .modelo-grupos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modelo-hero h2 { font-size: 17px; }
}
@media (max-width: 420px) {
    .modelo-grupos { grid-template-columns: 1fr; }
    .modelo-jornada-title { align-items: flex-start; flex-direction: column; }
}


/* Barra superior del modelo de referencia */
.modelo-topnav {
    display: flex; align-items: center; justify-content: center; gap: 26px;
    min-height: 34px; padding: 0 14px; background: #202020; color: #f8fafc;
    font-size: 9px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase;
}
@media (max-width: 720px) {
    .modelo-topnav { gap: 12px; overflow-x: auto; justify-content: flex-start; white-space: nowrap; font-size: 8px; }
}


/* Diferenciación de rondas del calendario */
.modelo-jornada-title.clasificatoria { background: #172033; color: #ffffff; }
.modelo-jornada-title.clasificatoria span { background: #0891b2; color: #ffffff; }
.modelo-jornada-title.eliminatoria { background: #c62828; color: #ffffff; }
.modelo-jornada-title.eliminatoria span { background: #facc15; color: #7f1d1d; }
.modelo-jornada-title.semifinal { background: #9a3412; color: #ffffff; }
.modelo-jornada-title.semifinal span { background: #fbbf24; color: #7c2d12; }
.modelo-jornada-title.final { background: #166534; color: #ffffff; }
.modelo-jornada-title.final span { background: #fde68a; color: #14532d; }


/* Corrección de vista opaca: el overlay solo debe aparecer al abrir un modal real. */
.front-overlay,
.front-overlay.active {
    display: none !important;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: none;
}
.front-main { background: #f8fafc; }
.modelo-table-wrap, .modelo-grupo { background: #ffffff; }


/* Estado base visible para fixture_front.php y bce.php. */
html, body, .front-main {
    opacity: 1 !important;
    filter: none !important;
}
.front-overlay.active {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.front-modal-backdrop:not(.active) {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Logos de equipos en el modelo del fixture */
.modelo-equipo-grupo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modelo-equipo-juego {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modelo-logo-equipo {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-block;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
}

.modelo-logo-inicial {
    display: inline-grid;
    place-items: center;
    background: #0ea5e9;
    border-color: #0284c7;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 640px) {
    .modelo-logo-equipo {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .modelo-equipo-juego {
        gap: 4px;
    }
}

/* Marcadores dentro de cada enfrentamiento */
.modelo-score {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.1;
    text-align: center;
    margin-left: auto;
}

.modelo-equipo-juego > span:not(.modelo-logo-equipo) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.modelo-posicion {
    min-width: 24px;
    color: #0f4c81;
    font-size: 11px;
    text-align: right;
}

/* Mantener posicion, logo y equipo en una sola fila */
.modelo-grupo .modelo-equipo-grupo {
    display: inline-flex !important;
    align-items: center;
    width: 100%;
    gap: 5px;
    white-space: nowrap;
}

.modelo-grupo .modelo-equipo-grupo > span:not(.modelo-logo-equipo) {
    display: inline !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standings-page {
    background:
        radial-gradient(circle at 10% 0%, rgba(14,165,233,.18), transparent 35%),
        linear-gradient(145deg, #061826 0%, #0b3045 48%, #082235 100%);
    min-height: calc(100vh - 70px);
}

.standings-hero {
    max-width: 980px;
    margin: 0 auto 22px;
    padding: 28px 18px 22px;
    text-align: center;
    color: #fff;
}

.standings-hero span {
    color: #67e8f9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.standings-hero h1 {
    margin: 8px 0 4px;
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: 1px;
    font-weight: 900;
}

.standings-hero p {
    margin: 0;
    color: #c8dce8;
    font-size: 12px;
}

.standings-page .front-selector {
    max-width: 980px;
    margin: 0 auto 18px;
    background: rgba(255,255,255,.96);
}

#standings-cont {
    max-width: 980px;
    margin: 0 auto;
}

.standing-group-card {
    margin-bottom: 22px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(0,0,0,.2);
    clip-path: polygon(0 0, 100% 0, 98.5% 100%, 1.5% 100%);
}

.standing-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 28px;
    background: #071523;
    color: #fff;
    border-left: 5px solid #22d3ee;
}

.standing-group-head strong {
    font-size: 15px;
    letter-spacing: 1px;
}

.standing-group-head span {
    padding: 4px 9px;
    border-radius: 10px;
    background: #facc15;
    color: #172033;
    font-size: 9px;
    font-weight: 900;
}

.standing-table-wrap {
    overflow-x: auto;
}

.standing-table {
    width: 100%;
    border-collapse: collapse;
    color: #182536;
    font-size: 12px;
}

.standing-table th {
    padding: 9px 10px;
    background: #dbe5eb;
    color: #385064;
    font-size: 9px;
    letter-spacing: .7px;
    text-align: center;
}

.standing-table td {
    padding: 10px;
    border-top: 1px solid #dbe3e8;
    text-align: center;
    font-weight: 700;
}

.standing-table th:first-child,
.standing-table td:first-child {
    width: 55px;
}

.standing-team-head,
.standing-team {
    text-align: left !important;
}

.standing-team-inner {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 190px;
    text-align: left;
}

.standing-team-inner .modelo-logo-equipo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.standing-position {
    color: #0b6680;
    font-size: 14px;
}

.standing-row-top td {
    background: linear-gradient(90deg, #fff7d6, #fff);
}

.standing-positive { color: #047857; }
.standing-negative { color: #b91c1c; }

@media (max-width: 640px) {
    .standing-group-head { padding-left: 20px; padding-right: 20px; }
    .standing-table { min-width: 650px; }
}

/* Estilo de posiciones inspirado en la referencia visual */
.standings-page {
    position: relative;
    min-height: 100vh;
    padding: 0 20px 42px;
    background:
        radial-gradient(circle at 50% -8%, rgba(42,116,151,.32), transparent 34%),
        linear-gradient(180deg, #041b29 0%, #063248 52%, #062537 100%);
    color: #fff;
}

.standings-page .front-selector {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin: 0 auto 24px;
    padding: 10px 14px;
    background: rgba(5, 27, 41, .82);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: none;
    color: #d9edf4;
}

.standings-page .front-selector select {
    background: #102f40;
    color: #fff;
    border-color: #4a7182;
}

.standings-hero {
    max-width: 860px;
    padding: 34px 10px 20px;
    margin: 0 auto;
    text-align: center;
}

.standings-hero span {
    color: #f1f5f7;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
}

.standings-hero h1 {
    position: relative;
    margin: 8px 0 5px;
    color: #fff;
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: clamp(52px, 9vw, 92px);
    font-weight: 400;
    letter-spacing: 2px;
    line-height: .9;
    text-shadow: 0 3px 0 rgba(0,0,0,.2);
}

.standings-hero h1::before,
.standings-hero h1::after {
    content: '';
    display: inline-block;
    width: 48px;
    height: 1px;
    margin: 0 14px 20px;
    background: rgba(255,255,255,.8);
}

.standings-hero p {
    color: #b7d4df;
    font-size: 11px;
    letter-spacing: .5px;
}

#standings-cont {
    max-width: 860px;
    margin: 0 auto;
}

.standing-group-card {
    margin: 0 auto 30px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    clip-path: none;
}

.standing-group-head {
    display: flex;
    justify-content: center;
    padding: 8px 14px;
    background: transparent;
    border: 0;
    color: #fff;
}

.standing-group-head strong {
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: 18px;
    letter-spacing: 3px;
}

.standing-group-head span {
    display: none;
}

.standing-table-wrap {
    overflow: visible;
}

.standing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    table-layout: fixed;
    color: #18232b;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: 16px;
}

.standing-table thead th {
    padding: 2px 8px 0;
    background: transparent;
    color: #fff;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    text-align: center;
}

.standing-table thead th:nth-child(1) {
    width: 58px;
    color: transparent;
}

.standing-table thead th:nth-child(2) {
    width: 48%;
    color: transparent;
}

.standing-table tbody tr {
    height: 48px;
}

.standing-table tbody td {
    padding: 7px 10px;
    border: 0;
    background: #eef1f1;
    color: #1e252b;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    transform: skew(-7deg);
}

.standing-table tbody td:first-child {
    border-radius: 0;
    color: #27323a;
}

.standing-table tbody td:last-child {
    border-radius: 0 2px 2px 0;
}

.standing-table tbody td > * {
    display: inline-block;
    transform: skew(7deg);
}

.standing-table tbody tr:hover td {
    background: #fff;
}

.standing-team {
    text-align: left !important;
}

.standing-team-inner {
    display: flex !important;
    align-items: center;
    min-width: 0;
    gap: 10px;
    text-align: left;
    white-space: nowrap;
}

.standing-team-inner > span:last-child {
    overflow: hidden;
    color: #202b31;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.standing-team-inner .modelo-logo-equipo {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    margin-left: -9px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
}

.standing-position {
    min-width: 22px;
    color: #52626b;
    font-size: 15px;
    font-weight: 900;
}

.standing-row-top td {
    background: #eef1f1;
}

.standing-positive,
.standing-negative {
    color: #202b31;
}

@media (max-width: 640px) {
    .standings-page { padding-left: 8px; padding-right: 8px; }
    .standings-hero h1 { font-size: 54px; }
    .standings-hero h1::before,
    .standings-hero h1::after { width: 28px; margin-left: 5px; margin-right: 5px; }
    .standing-table { min-width: 650px; }
    .standing-table-wrap { overflow-x: auto; padding: 0 4px; }
}
