/* ═══════════════════════════════════════════════
   FIXTURE FUTBOL CARD — v1.3
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700;900&display=swap');

/* ── Contenedor raíz ── */
#fixture-container {
    font-family: 'Barlow', sans-serif;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1a1a2e;
}

/* ══════════════════════════════
   TABS DE FECHAS
══════════════════════════════ */
.fx-tabs-wrapper {
    width: 100%;
}

.fx-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    border-bottom: 3px solid #4b0082;
    padding-bottom: 0;
}

.fx-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: color 0.2s, background 0.2s;
}

.fx-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: #4b0082;
    transform: scaleX(0);
    transition: transform 0.2s;
}

.fx-tab-btn.active {
    color: #4b0082;
    background: rgba(75, 0, 130, 0.06);
}

.fx-tab-btn.active::after {
    transform: scaleX(1);
}

.fx-tab-btn:hover:not(.active) {
    color: #4b0082;
    background: rgba(75, 0, 130, 0.04);
}

/* ── Paneles de fechas ── */
.fx-panel {
    display: none;
}
.fx-panel.active {
    display: block;
}

/* ══════════════════════════════
   SUB-TABS DE GRUPOS
══════════════════════════════ */
.fx-sub-tabs-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.fx-sub-tab-btn {
    background: #f0e6ff;
    color: #4b0082;
    border: none;
    padding: 7px 18px;
    border-radius: 20px;
    font-family: 'Barlow', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.fx-sub-tab-btn.active {
    background: #4b0082;
    color: #fff;
}

.fx-sub-tab-btn:hover:not(.active) {
    background: #d8b4fe;
}

/* ── Paneles de grupos ── */
.fx-grupo-panel {
    display: none;
}
.fx-grupo-panel.active {
    display: block;
}

/* ══════════════════════════════
   GRID DE PARTIDOS
══════════════════════════════ */
.fx-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

/* ══════════════════════════════
   TARJETA DE PARTIDO
══════════════════════════════ */
.fx-match-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(75, 0, 130, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(75, 0, 130, 0.08);
}

.fx-match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(75, 0, 130, 0.18);
}

/* ── Cabecera de tarjeta ── */
.fx-card-top {
    background: linear-gradient(135deg, #4b0082, #7b2ff7);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.fx-competition {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* ── Badges de estado ── */
.fx-badge {
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.fx-estado-pendiente,
.fx-estado-programado {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.fx-estado-vivo {
    background: #ff3b3b;
    color: #fff;
    animation: pulse 1.2s infinite;
}

.fx-estado-cerrado {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ── Cuerpo de tarjeta ── */
.fx-card-body {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    align-items: center;
    padding: 20px 12px;
    background: linear-gradient(to bottom, #fafafa, #fff);
    flex: 1;
}

.fx-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fx-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.12));
    transition: transform 0.3s;
}

.fx-match-card:hover .fx-logo {
    transform: scale(1.1);
}

.fx-team-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: #222;
    line-height: 1.2;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Marcador central ── */
.fx-score-block {
    text-align: center;
}

.fx-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 2.2rem;
    font-weight: 900;
    color: #1a1a2e;
    line-height: 1;
}

.fx-score span:not(.fx-score-sep) {
    background: #f1ecfa;
    min-width: 38px;
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
}

.fx-score-sep {
    color: #bbb;
    font-size: 1.6rem;
}

.fx-vs-label {
    font-size: 0.7rem;
    font-weight: 900;
    color: #aaa;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ── Footer de tarjeta ── */
.fx-card-footer {
    background: #f8f4ff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #ede5ff;
}

.fx-info-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b21a8;
    opacity: 0.85;
}

.fx-info-pill svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: #6b21a8;
}

/* ══════════════════════════════
   ESTADOS VACÍOS / ERROR
══════════════════════════════ */
.no-matches,
.error {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1rem;
}

/* ══════════════════════════════
   BOTÓN VER DETALLES  (barra integrada en la base del card)
══════════════════════════════ */
.fx-btn-detalles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: #f0e8ff;
    border: none;
    border-top: 1px solid #ddd0f5;
    color: #6b21a8;
    font-family: 'Barlow', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 0 0 14px 14px;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}

.fx-btn-detalles svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
    flex-shrink: 0;
}

.fx-btn-detalles:hover {
    background: #e0d0ff;
    color: #4b0082;
}

/* ══════════════════════════════
   MODAL DE EVENTOS
══════════════════════════════ */
#fx-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 0, 30, 0.72);
    backdrop-filter: blur(4px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

#fx-modal-overlay.fx-modal-visible {
    display: flex;
    animation: fx-fade-in 0.2s ease;
}

@keyframes fx-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#fx-modal-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(75, 0, 130, 0.35);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fx-slide-up 0.25s ease;
    position: relative;
}

@keyframes fx-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#fx-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

#fx-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Header del modal ── */
#fx-modal-header {
    background: linear-gradient(135deg, #4b0082, #7b2ff7);
    padding: 20px 16px 18px;
}

.fx-modal-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fx-modal-club {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    text-align: center;
}

.fx-modal-club img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.fx-modal-club span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    line-height: 1.2;
    max-width: 90px;
}

.fx-modal-score {
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    flex-shrink: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Body del modal (scroll) ── */
#fx-modal-body {
    overflow-y: auto;
    padding: 16px 18px 20px;
    flex: 1;
}

/* ── Loader ── */
.fx-ev-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 0;
    color: #888;
    font-size: 0.85rem;
    font-family: 'Barlow', sans-serif;
}

.fx-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ede5ff;
    border-top-color: #7b2ff7;
    border-radius: 50%;
    animation: fx-spin 0.7s linear infinite;
}

@keyframes fx-spin {
    to { transform: rotate(360deg); }
}

/* ── Timeline de eventos ── */
.fx-ev-timeline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fx-ev-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    transition: background 0.15s;
}

.fx-ev-row:hover {
    background: #f8f4ff;
}

.fx-ev-min {
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    color: #4b0082;
    min-width: 30px;
    text-align: right;
    padding-top: 1px;
}

.fx-ev-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    line-height: 1;
}

.fx-ev-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.fx-ev-tipo {
    font-family: 'Barlow', sans-serif;
    font-size: 0.63rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b21a8;
}

.fx-ev-nombre {
    font-family: 'Barlow', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-ev-entra {
    font-family: 'Barlow', sans-serif;
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-ev-empty {
    text-align: center;
    color: #aaa;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    padding: 30px 0;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 500px) {
    .fx-match-grid {
        grid-template-columns: 1fr;
    }

    .fx-tab-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .fx-score {
        font-size: 1.8rem;
    }

    .fx-logo {
        width: 48px;
        height: 48px;
    }
}



/* ══════════════════════════════════════════════════
   CARRUSEL DE EQUIPOS  [fixture_equipos]  — marquee
══════════════════════════════════════════════════ */

/* ── Keyframe del scroll continuo ── */
@keyframes fc-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── Contenedor exterior: solo apariencia + mask ── */
#fc-equipos-carousel {
    font-family: 'Barlow', sans-serif;
    width: 100%;
    margin: 0 auto 36px;
    position: relative;
    background: #fff;
    border-top: 1px solid #ede5ff;
    border-bottom: 1px solid #ede5ff;
    padding: 14px 0;
    /* Fade en los bordes (NO poner overflow:hidden aquí) */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 5%,
        #000 95%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 5%,
        #000 95%,
        transparent 100%
    );
}

/* ── Viewport: aquí va el overflow:hidden ── */
.fc-car-viewport {
    overflow: hidden;
    width: 100%;
}

/* ── Track: flex row, no wrap ── */
.fc-car-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    will-change: transform;
    /* La animación solo arranca cuando JS añade la clase */
}

.fc-car-track.is-animating {
    animation: fc-scroll var(--fc-duration, 40s) linear infinite;
}

/* Pausa global al hover */
#fc-equipos-carousel:hover .fc-car-track.is-animating {
    animation-play-state: paused;
}

/* ── Tarjeta de equipo ── */
.fc-car-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-shrink: 0;
    width: 108px;
    padding: 8px 8px 10px;
    cursor: default;
    transition: transform 0.22s ease;
    border-right: 1px solid rgba(75, 0, 130, 0.07);
}

.fc-car-item:hover {
    transform: translateY(-4px);
}

/* ── Escudo ── */
.fc-car-shield {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-car-shield img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
    transition: transform 0.25s ease, filter 0.25s ease;
    display: block;
}

/* ══════════════════════════════════════════════════
   TABLA DE POSICIONES  [fixture_tablas]
   ══════════════════════════════════════════════════ */

#tablas-container {
    font-family: 'Barlow', sans-serif;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 16px 50px;
}

.fx-tabla-grupo-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(75, 0, 130, 0.05);
    border: 1px solid rgba(75, 0, 130, 0.08);
    overflow: hidden;
}

.fx-tabla-title {
    background: linear-gradient(135deg, #4b0082, #7b2ff7);
    color: #fff;
    margin: 0;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fx-tabla-title::before {
    content: '🏆';
    font-size: 1.2rem;
}

.fx-table-responsive {
    overflow-x: auto;
    width: 100%;
}

.fx-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.fx-standings-table thead th {
    background: #f8f4ff;
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6b21a8;
    border-bottom: 2px solid #ede5ff;
    white-space: nowrap;
}

.fx-standings-table thead th.club {
    text-align: left;
    padding-left: 20px;
}

.fx-standings-table tbody td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.fx-standings-table tbody tr:last-child td {
    border-bottom: none;
}

.fx-standings-table tbody tr:hover td {
    background: rgba(123, 47, 247, 0.03);
}

/* ── Columnas específicas ── */
.fx-standings-table .pos {
    font-weight: 800;
    color: #4b0082;
    width: 50px;
}

.fx-standings-table .club {
    text-align: left;
    padding-left: 20px;
    min-width: 200px;
}

.fx-standings-table .pts {
    background: rgba(123, 47, 247, 0.04);
    color: #4b0082;
    font-weight: 900;
    font-size: 1rem;
}

/* ── Info del Club en la tabla ── */
.fc-table-club-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-table-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.fc-table-name {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #333;
}

/* ── Responsive Mobile ── */
@media (max-width: 768px) {
    .fx-standings-table {
        font-size: 0.8rem;
    }
    
    .fx-standings-table thead th,
    .fx-standings-table tbody td {
        padding: 10px 6px;
    }

    .fc-table-logo {
        width: 24px;
        height: 24px;
    }

    .fc-table-name {
        font-size: 0.75rem;
    }
}

/* ══════════════════════════════════════════════════
   LO MEJOR DEL TORNEO
   ══════════════════════════════════════════════════ */
#lo-mejor-container {
    font-family: 'Barlow', sans-serif;
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 16px;
}

.fx-best-header-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 25px;
}

.fx-best-section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #4b0082; /* Purple consistent with existing theme */
    margin: 0;
    text-transform: none;
}

.fx-best-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.fx-best-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    border: 1px solid #f0f0f0;
}

.fx-best-card-header {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Imagenes (fotos y escudos) ── */
.fx-player-photo-container {
    width: 100px;
    height: 120px;
    margin-bottom: 15px;
    border: 3px solid #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.fx-player-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fx-best-shield-container {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fx-best-shield {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── Textos de la card ── */
.fx-best-label {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4b0082;
    margin: 5px 0 10px;
}

.fx-best-main-info {
    font-size: 1.05rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* ── Filas de Stats abajo ── */
.fx-best-stats-grid,
.fx-best-stat-box {
    display: flex;
    border-top: 1px solid #f5f5f5;
    background: #fcfcfc;
}

.fx-best-mini-stat {
    flex: 1;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f5f5f5;
}

.fx-best-mini-stat:last-child {
    border-right: none;
}

.fx-best-stat-box {
    padding: 15px 10px;
    flex-direction: column;
    width: 100%;
}

.m-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 5px;
    font-weight: 600;
}

.m-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4b0082;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .fx-best-section-title {
        font-size: 1.6rem;
    }
    .fx-best-label {
        font-size: 1.4rem;
    }
}
