html, body {
    height: 100%;
    overflow: hidden; /* Prevenir scroll global, forzar scroll en tabs */
}

/* Ajustes generales del fondo */
body {
    /* No sobreescribir background – lo gestiona styles.css */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#app-container {
    height: 100%;
    width: 100%;
}

/* Desktop: No aplicamos height 100% estricto si preferimos el scroll global ahí, pero para SPA es mejor unificado. */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
        padding-top: 0;
    }
}

/* --- MAIN NAVIGATION BAR --- */
.bottom-nav {
    position: fixed;
    /* Mobile: bottom */
    bottom: 0;
    top: auto;
    left: 0;
    width: 100%;
    background: #0d0d0d;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 6px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    border-top: 1px solid rgba(255,255,255,0.05);
    height: 64px;
    box-sizing: border-box;
}

/* Desktop: move to top, below main header */
@media (min-width: 768px) {
    .bottom-nav {
        top: 60px;  /* height of #main-header */
        bottom: auto;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        border-top: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
}

.nav-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 0;
    transition: color 0.2s;
    position: relative;
    min-width: 60px;
    gap: 4px;
}

.nav-item i {
    font-size: 1.35em;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-item span {
    color: white;
    white-space: nowrap;
}

.nav-item.active {
    color: white;
    background: transparent;
}

.nav-item.active i {
    color: #ccff00;
    transform: translateY(-1px);
}

.nav-item.active span {
    color: #ccff00;
}

.nav-item.active::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: #ccff00;
    border-radius: 2px;
}

.nav-item:hover {
    color: white;
}

.nav-item:hover i {
    transform: translateY(-2px);
}

/* --- TABS --- */
.tab-content {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding-top: 85px; /* Aumentado a 85px para asegurar que el header de 60px no corte tÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­tulos grandes */
    padding-bottom: 80px; /* Evita que el bottom-nav tape el contenido final */
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .tab-content {
        padding-top: 134px; /* Header + Nav en desktop */
        padding-bottom: 20px;
    }
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Spinner rotation for avatar upload */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header avatar hover glow */
#header-avatar:hover {
    border-color: #ccff00 !important;
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.5);
}

/* Avatar upload button hover */
#avatar-upload-label:hover {
    background: #2980b9 !important;
}

/* Ranking table: minimal style */
.tabla-ranking thead th {
    background: transparent;
    color: #666;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Ranking row alignment */
.tabla-ranking td {
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    font-size: 0.9em;
}

.fantasy-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 15px 15px; /* Quitado el padding top para que no sea excesivo, ya lo maneja tab-content */
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#view-market {
    padding-bottom: 130px;
}

@media (min-width: 768px) {
    #view-market {
        padding-bottom: 70px;
    }
}

.titulo-seccion {
    text-align: left;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-left: 3px solid #ffffff;
    padding-left: 10px;
}

/* --- REJILLA DE JUGADORES --- */
#contenedor-fantasy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- TARJETA DE JUGADOR (Mercado) --- */
.tarjeta-jugador {
    background: #141414;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    box-shadow: none;
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tarjeta-jugador:hover {
    transform: translateY(-2px);
    border-color: #ccff00;
}

/* --- TARJETA PLANTILLA (Estilo OneFootball/Biwenger) --- */
.card-plantilla {
    display: flex;
    background: #0d0d0e;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #1c1c1e;
    padding: 12px 16px;
    gap: 16px;
    color: white;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: visible;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.card-plantilla:hover {
    transform: translateY(-2px);
    border-color: #ffffff;
}

.plantilla-col-foto {
    position: relative;
    width: 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.plantilla-col-foto img.foto-jugador {
    width: 76px;
    height: 76px;
    object-fit: cover;
    object-position: top center;
    border-radius: 10px;
    background: linear-gradient(145deg, #1f1f24 0%, #141416 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.plantilla-estado-indicador {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid #0d0d0e;
    z-index: 3;
}

.plantilla-escudo {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #1c1c1e;
    padding: 2px;
    object-fit: contain;
    z-index: 2;
}

.plantilla-col-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.plantilla-nombre-fila {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.badge-pos {
    font-family: 'Inter', sans-serif;
    font-size: 0.68em;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}
.badge-pos.por { background: rgba(39, 174, 96, 0.15); color: #2ecc71; border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-pos.def { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); }
.badge-pos.med { background: rgba(241, 196, 15, 0.15); color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.3); }
.badge-pos.del { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }

.plantilla-nombre {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    margin: 0;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    color: #ffffff;
}

.plantilla-detalles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
    margin-bottom: 6px;
    font-size: 0.76em;
    color: #8e8e93;
}

.plantilla-alineable {
    color: #8e8e93;
    display: flex;
    align-items: center;
    gap: 4px;
}

.plantilla-valor {
    color: #8e8e93;
    display: flex;
    align-items: center;
    gap: 4px;
}

.plantilla-racha {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.racha-box {
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.72em;
    font-weight: 700;
    color: white;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}
.racha-box.verde {
    background: rgba(39, 174, 96, 0.12);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.25);
}
.racha-box.rojo {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.25);
}
.racha-box.gris {
    background: rgba(255, 255, 255, 0.05);
    color: #8e8e93;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.plantilla-col-stats {
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    text-align: right;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
}

.plantilla-puntos-fila {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #8e8e93;
    font-size: 0.72em;
    font-weight: 700;
}

.plantilla-puntos-grandes {
    color: white;
    font-size: 1.8em;
    font-family: 'Oswald', sans-serif;
    line-height: 1;
    font-weight: 700;
}

.plantilla-media {
    font-size: 0.68em;
    color: #8e8e93;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.plantilla-clausula {
    font-size: 0.75em;
    color: #8e8e93;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-acciones-plantilla {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.82em;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.btn-acciones-plantilla:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.jugador-icono {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.jugador-nombre {
    margin: 10px 0;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: none;
    white-space: normal;
    overflow: visible;
    text-align: center;
}

.jugador-posicion {
    color: #95a5a6;
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: bold;
}

.jugador-precio {
    color: #ccff00;
    font-weight: 800;
    font-size: 1.2em;
    display: block;
    margin: 10px 0;
}

.btn-fichar {
    background: rgba(204, 255, 0, 0.1);
    color: #ccff00;
    border: 1px solid rgba(204, 255, 0, 0.3);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.btn-fichar:hover {
    background: #ccff00;
    color: #0b0b0b;
}

/* --- BOTÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œN LOGIN (En el menÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Âº) --- */
.btn-login {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

/* --- VENTANA MODAL (Pop-up) --- */
.modal-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #141414;
    padding: 30px;
    border-radius: 4px;
    width: 300px;
    position: relative;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cerrar-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.botones-modal {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}


/* EL CAMPO DE FÃƒÅ¡TBOL */
.campo-futbol {
    width: 100%;
    max-width: min(calc(100vw - 30px), calc((100vh - 265px) * 0.6476), 388px);
    height: auto;
    aspect-ratio: 1904 / 2940;
    margin: 0 auto;
    background-color: transparent;
    background-image: url('../images/fantasy/campo.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    border-radius: 0;
    position: relative;
    box-shadow: none;
}

/* LA FORMACIÃƒâ€œN (1-2-3-1 TÃƒÂ­pica de fÃƒÂºtbol 7) */
.formacion-7 {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    /* 4 lÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­neas: Portero, Def, Med, Del */
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    justify-items: center;
    align-items: center;
}

/* LAS "FICHAS" DE LOS JUGADORES */
.ficha-campo {
    width: 70px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    animation: fadeIn 0.3s;
}

.ficha-campo:hover {
    transform: scale(1.1);
}

.ficha-foto {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    background: white;
}

.ficha-nombre {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: -5px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* ESTILO PARA EL BANQUILLO */
.ficha-banquillo {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
}

.ficha-banquillo:hover {
    background: #e8f8f5;
    border-color: #27ae60;
}



.btn-entrar {
    background: #ccff00;
    color: #0b0b0b;
    border: none;
    padding: 12px;
    flex: 1;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-registro {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px;
    flex: 1;
    border-radius: 5px;
    cursor: pointer;
}

#mensaje-error {
    color: red;
    font-size: 0.9em;
    margin-top: 10px;
}

/* --- STRICT IMAGE SIZING (OVERHAUL) --- */
/* Target ALL player images in lists and pitch to force consistency */
/* Exclude badge-escudo images from this rule */
.ficha-campo-new img:not(.badge-escudo-campo),
.avatar-list,
.jugador-lista img,
#lista-seleccion-jugadores img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;   /* cuadrado con esquinas muy suaves */
    object-fit: cover !important;
    border: none !important;
    box-shadow: none !important;
}

.ficha-campo-new .card-img-container {
    width: 48px !important;
    height: 48px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 6px !important;   /* cuadrado suave */
    padding: 0 !important;
    overflow: hidden !important;
}

.card-top {
    width: 52px !important;
    /* Slightly larger than image */
    height: 52px !important;
    background: transparent !important;
    /* Remove background color */
    box-shadow: none !important;
    border: none !important;
}

/* --- FULL PAGE SELECTION VIEW --- */
#pantalla-cambio-jugador {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #121212;
    display: none;
    /* Hidden by default */
    flex-direction: column;
}

.seleccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.seleccion-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-volver-seleccion {
    background: transparent;
    border: none;
    color: #bdc3c7;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-vaciar-seleccion {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-vaciar-seleccion:hover {
    background: #e74c3c;
    color: white;
}

.seleccion-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Re-style Outgoing Card for Full Page */
.outgoing-player-card {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Highlight for Outgoing status */
.outgoing-player-card.active {
    border: 1px solid #e74c3c;
    background: linear-gradient(145deg, #2c3e50, #201010);
}

/* --- SIDEBAR MENU --- */
#sidebar-menu {
    position: fixed;
    top: 0;
    right: -280px;
    /* Hidden off-screen */
    width: 280px;
    height: 100%;
    background: #1a1a1a;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

#sidebar-menu.active {
    right: 0;
}

.sidebar-header {
    background: #2c3e50;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    text-transform: uppercase;
    font-size: 1.1em;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    line-height: 0.5;
}

.sidebar-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-content a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, color 0.2s;
}

.sidebar-content a:hover {
    background: #333;
    color: white;
}

/* --- LEAGUE CARD STYLES MANAGED IN styles.css (Athletic Editorial Dark Pro) --- */

/* ==========================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œÃƒâ€¹Ã¢â‚¬Â  CHART.JS ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â EVOLUCIÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œN DE PUNTOS
   ========================================== */

.ficha-chart-seccion {
    background: #161620;
    border-radius: 14px;
    padding: 20px;
    margin: 0 16px 16px;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.ficha-chart-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
    margin-bottom: 20px;
}

.ficha-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Historia de jornadas debajo del grÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡fico */
.ficha-historial-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.ficha-historial-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1e1e2a;
    border-radius: 10px;
    font-size: 0.9em;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s;
}

.ficha-historial-lista li:hover {
    background: #252535;
}

.ficha-historial-lista .pts-positivo {
    color: #22c55e;
    font-weight: 700;
    font-size: 1.05em;
}

.ficha-historial-lista .pts-negativo {
    color: #ef4444;
    font-weight: 700;
    font-size: 1.05em;
}

.ficha-historial-lista .pts-neutro {
    color: #94a3b8;
    font-weight: 700;
}

/* Scroll custom */
.ficha-historial-lista::-webkit-scrollbar {
    width: 4px;
}
.ficha-historial-lista::-webkit-scrollbar-track {
    background: transparent;
}
.ficha-historial-lista::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒâ€šÃ‚Â EXPLORADOR ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â BACK BAR (Vista completa)
   ============================================ */

/* Back bar at the top of the full-screen explorer view */
.explorador-backbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0 16px;
    flex-shrink: 0;
}

/* The "ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â Ãƒâ€šÃ‚Â Volver" button */
.explorador-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.88em;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.explorador-back-btn:hover {
    background: rgba(108,99,255,0.18);
    border-color: rgba(108,99,255,0.5);
    color: #a29bfe;
}

/* Inline header (icon + title) next to the back button */
.explorador-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œÃƒâ€¦Ã‚Â  CLASIFICACIÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œN ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â MENÃƒÆ’Ã†â€™Ãƒâ€¦Ã‚Â¡ POR FILA (3 puntos)
   ============================================ */

/* Hover effect on the ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â¹Ãƒâ€šÃ‚Â® button */
.btn-menu-fila:hover {
    background: rgba(0,0,0,0.07) !important;
    color: #555 !important;
}

/* Hover effect on dropdown items */
.menu-fila-item:hover {
    background: rgba(231,76,60,0.08);
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒâ€šÃ‚Â EXPLORADOR DE JUGADORES ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â MERCADO HEADER
   ============================================ */

/* Row that holds the "Mercado" title + Explorer button */
.mercado-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* The Explorer button itself */
.btn-explorador {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #1c1c1e;
    border-radius: 6px;
    background: #0d0d0e;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 0.8em;
    cursor: pointer;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-explorador:hover {
    transform: translateY(-1px);
    background: #1c1c1e;
    border-color: #ffffff;
}

.btn-explorador:active {
    transform: scale(0.98);
}

.btn-explorador i {
    font-size: 0.95em;
}

/* Hidden state (for global league) */
.btn-explorador.hidden {
    display: none !important;
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒâ€šÃ‚Â EXPLORADOR ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â FULL-SCREEN OVERLAY MODAL
   ============================================ */

.explorador-overlay {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(5, 7, 20, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: explorador-fadein 0.25s ease;
}

@keyframes explorador-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* The sliding panel */
.explorador-panel {
    width: 100%;
    max-width: 680px;
    height: 92dvh;
    background: linear-gradient(180deg, #12152a 0%, #0c0f1e 100%);
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: explorador-slidein 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
}

@keyframes explorador-slidein {
    from { transform: translateY(60px); opacity: 0.6; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* --- HEADER --- */
.explorador-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.explorador-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.explorador-icon-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6c63ff, #a29bfe);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}

.explorador-title {
    margin: 0;
    font-size: 1.15em;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.1px;
}

.explorador-subtitle {
    margin: 2px 0 0 0;
    font-size: 0.75em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.explorador-close-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    font-size: 1.6em;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.explorador-close-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* --- SEARCH BAR --- */
.explorador-search-bar {
    position: relative;
    padding: 14px 22px 0;
    flex-shrink: 0;
}

.explorador-search-icon {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(calc(-50% + 7px));
    color: rgba(255,255,255,0.3);
    font-size: 0.9em;
    pointer-events: none;
}

.explorador-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px 13px 42px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: white;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.explorador-input:focus {
    border-color: #6c63ff;
    background: rgba(108,99,255,0.08);
}

.explorador-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.explorador-count {
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(calc(-50% + 7px));
    background: rgba(108,99,255,0.25);
    color: #a29bfe;
    font-size: 0.72em;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    pointer-events: none;
}

/* --- POSITION FILTER CHIPS --- */
.explorador-filtros-pos {
    display: flex;
    gap: 6px;
    padding: 12px 22px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.explorador-filtros-pos::-webkit-scrollbar { display: none; }

.filtro-pos-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
}

.filtro-pos-btn:hover {
    border-color: rgba(108,99,255,0.5);
    color: rgba(255,255,255,0.85);
}

.filtro-pos-btn.active {
    background: linear-gradient(135deg, #6c63ff, #a29bfe);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 10px rgba(108,99,255,0.4);
}

/* --- LOADING STATE --- */
.explorador-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    color: rgba(255,255,255,0.4);
    font-size: 0.9em;
}

.explorador-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- PLAYER GRID (Read-only) --- */
.explorador-grid {
    flex: 1;
    overflow-y: auto;
    padding: 4px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.explorador-grid::-webkit-scrollbar { width: 4px; }
.explorador-grid::-webkit-scrollbar-track { background: transparent; }
.explorador-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* Individual read-only player row */
.explorador-jugador-row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
    border-radius: 10px;
}

.explorador-jugador-row:last-child {
    border-bottom: none;
}

.explorador-jugador-row:hover {
    background: rgba(255,255,255,0.04);
}

/* Player photo in explorer ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â cuadrada */
.explorador-jugador-foto {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #1e2035;
    border: none;
    flex-shrink: 0;
}

/* Center info block */
.explorador-jugador-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.explorador-jugador-nombre {
    font-size: 0.95em;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorador-jugador-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72em;
}

.explorador-pos-chip {
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85em;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Position color coding */
.pos-portero   { background: rgba(241,196,15,0.18); color: #f1c40f; }
.pos-defensa   { background: rgba(52,152,219,0.18); color: #5dade2; }
.pos-medio     { background: rgba(46,204,113,0.18); color: #2ecc71; }
.pos-delantero { background: rgba(231,76,60,0.18);  color: #e74c3c; }
.pos-otro      { background: rgba(149,165,166,0.18);color: #95a5a6; }

.explorador-jugador-equipo {
    color: rgba(255,255,255,0.38);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Right-side stats column */
.explorador-jugador-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.explorador-jugador-precio {
    font-size: 0.95em;
    font-weight: 800;
    color: #a29bfe;
    letter-spacing: 0.2px;
}

.explorador-jugador-puntos {
    font-size: 0.7em;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

/* --- EMPTY STATE --- */
.explorador-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 8px;
    padding: 40px 20px;
    color: rgba(255,255,255,0.35);
    font-size: 0.9em;
    text-align: center;
}

/* --- FOOTER DISCLAIMER --- */
.explorador-footer {
    padding: 12px 22px;
    font-size: 0.72em;
    color: rgba(255,255,255,0.28);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒâ€šÃ‚Â EXPLORADOR ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â FILTROS SECUNDARIOS (Equipo + OrdenaciÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³n)
   ============================================ */

.explorador-filtros-secundarios {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Shared select style */
.explorador-select {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.8em;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.explorador-select:focus {
    border-color: #6c63ff;
    background-color: rgba(108,99,255,0.08);
}

.explorador-select option {
    background: #1a1d33;
    color: white;
}

/* Sort group: select + direction toggle button */
.explorador-sort-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Direction toggle button (ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã‹Å“ / ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œ) */
.explorador-sort-dir {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    flex-shrink: 0;
}

.explorador-sort-dir:hover {
    background: rgba(108,99,255,0.2);
    border-color: rgba(108,99,255,0.5);
    color: #a29bfe;
}

/* ============================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒâ€šÃ‚Â EXPLORADOR ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â NOMBRE ROW + OWNER TAG
   ============================================ */

/* Flex wrapper for player name + optional owner badge */
.explorador-jugador-nombre-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Subtle owner badge shown next to player name */
.explorador-owner-tag {
    font-size: 0.68em;
    font-weight: 700;
    color: rgba(162, 155, 254, 0.85);
    background: rgba(108, 99, 255, 0.15);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

/* ==========================================
   ÃƒÆ’Ã‚Â°Ãƒâ€¦Ã‚Â¸ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂºÃƒâ€šÃ‚Â¡ÃƒÆ’Ã‚Â¯Ãƒâ€šÃ‚Â¸Ãƒâ€šÃ‚Â BADGE ESCUDO ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â Estilos globales
   ==========================================
   PosiciÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³n: esquina superior IZQUIERDA de la foto.
   Fondo: transparente (sin recuadro blanco).
   TamaÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â±o: ~30% del ancho de la foto del jugador.
   ========================================== */

/* Tarjeta de Mercado (foto 80px) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ badge ~22px */
.badge-escudo-tarjeta {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    object-fit: contain;
    background: transparent;
    border: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.55));
    pointer-events: none;
}

/* Lista de Plantilla (avatar 48px) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ badge ~15px */
.badge-escudo-lista {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    object-fit: contain;
    background: transparent;
    border: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    pointer-events: none;
}

/* Campo / Pitch (imagen ~48px) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ badge ~15px */
.badge-escudo-campo {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    object-fit: contain;
    background: transparent;
    border: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    pointer-events: none;
    z-index: 2;
}

/* Explorador / Buscador (foto 48px) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ badge ~15px */
.badge-escudo-explorador {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    object-fit: contain;
    background: transparent;
    border: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    pointer-events: none;
}

/* Perfil del Jugador (foto ~85px) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ badge ~26px */
.badge-escudo-perfil {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    object-fit: contain;
    background: transparent;
    border: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
    pointer-events: none;
}

/* Anular la regla de tamaÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â±o estricto para los badges del campo */
.ficha-campo-new img.badge-escudo-campo {
    width: 15px !important;
    height: 15px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* ========================================================================= */
/* SOBREESCRITURA DE ESTILOS GLOBALES DE EQUIPO (Eliminar Slider y EstÃƒÆ’Ã‚Â©tica Vieja) */
/* ========================================================================= */

.team-tabs-container {
    display: flex;
    justify-content: flex-start; /* Evita que se queden en el centro si son muchos, aunque son 3 caben de sobra */
    gap: 20px;
    padding: 0 0 10px 0 !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    overflow-x: visible !important; /* Eliminar el slider horizontal */
    width: 100%;
}

.team-tab-btn {
    background: transparent !important;
    border: none !important;
    color: #7f8c8d !important;
    font-size: 0.85em !important;
    font-weight: 700 !important;
    font-family: 'Inter', sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 0 !important;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
    border-radius: 0 !important; /* Quitar bordes redondeados viejos */
    margin: 0 !important;
}

.team-tab-btn.active {
    color: white !important;
    background: transparent !important; /* Quitar fondo viejo activo */
}

.team-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ccff00;
    border-radius: 2px;
}

@media (min-width: 768px) {
    .campo-futbol {
        max-width: 800px !important;
        height: 700px !important;
        max-height: none !important;
    }
}

/* ========================================================================= */
/* ACTIVIDAD ESTETICA */
/* ========================================================================= */
#muro-actividad {
    background: #141414 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.actividad-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    transition: background 0.2s;
}

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

.actividad-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.actividad-texto {
    font-size: 0.9em;
    color: #ecf0f1;
    line-height: 1.4;
    padding-right: 15px;
}

.actividad-fecha {
    color: #7f8c8d;
    font-size: 0.75em;
    text-align: right;
    flex-shrink: 0;
    font-family: 'Inter', monospace;
}

.actividad-vacia {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 15px;
}

/* ========================================================================= */
/* RANKING ESTETICA */
/* ========================================================================= */

/* Ranking styles moved and consolidated into styles.css (Athletic Editorial Dark Pro) */

/* ========================================================================= */
/* MARKET CARDS (BIWENGER STYLE) */
/* ========================================================================= */
.market-card {
    display: flex;
    background: #1c1c24;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, background 0.2s;
}

.market-card:hover {
    transform: translateY(-2px);
    background: #23232c;
}

.market-card-left {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.market-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.market-badge-escudo {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.market-card-middle {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.market-badge-pos {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}

.market-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #ecf0f1;
}

.market-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 100px;
}

.market-stat-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-bottom: 2px;
}

.market-stat-label {
    font-size: 0.75em;
    color: #bdc3c7;
    font-weight: 600;
}

.market-stat-val {
    font-size: 0.95em;
    color: #ecf0f1;
    font-weight: 700;
}

.market-stat-val.points {
    font-size: 1.4em;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
}

.market-btn-wrapper {
    width: 100%;
    margin-top: 5px;
}

.market-btn-wrapper button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    transition: filter 0.2s;
    background: #ea4335 !important; /* Force red for all market actions */
    color: white !important;
    border: none;
    cursor: pointer;
}

.market-btn-wrapper button:hover {
    filter: brightness(1.2);
}

/* ========================================================================= */
/* AJUSTES ESTETICA */
/* ========================================================================= */
.dato-fila-ajustes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.dato-fila-ajustes .label {
    color: #bdc3c7;
    font-size: 0.9em;
    font-weight: 600;
}

.dato-fila-ajustes .valor {
    color: #ecf0f1;
    font-size: 0.95em;
}

/* ========================================================================= */
/* CROSS-DOCUMENT VIEW TRANSITIONS (MPA)                                     */
/* ========================================================================= */

/* 1. Transición SPA programática (desactivado auto para entrar sin animación de primeras) */
@view-transition {
    navigation: none;
}

/* 2. Fondo oscuro del overlay: elimina flash blanco en escritorio */
::view-transition {
    background-color: #0a0f1a;
}

/* 3. Nav inferior: capturado como elemento propio → permanece estático */
.bottom-nav {
    view-transition-name: main-nav;
}

/* 4. Resetear el blend-mode por defecto (plus-lighter) que convierte el slide
      en un fade visual. Con normal, viejo y nuevo se ven como capas separadas.
      isolation:isolate en el image-pair garantiza que no se mezclen entre sí. */
::view-transition-old(root),
::view-transition-new(root) {
    mix-blend-mode: normal;
    animation-fill-mode: both;
}

::view-transition-image-pair(root) {
    isolation: isolate;
}

/* 5. Animaciones de slide (respeta preferencia de movimiento reducido) */
@media (prefers-reduced-motion: no-preference) {

    /* El grupo permanece vivo durante toda la animación pero sin efecto propio */
    ::view-transition-group(root) {
        animation-name: none;
        animation-duration: 0.38s;
    }

    /* ── Keyframes: slide puro sin fade de opacidad ── */
    @keyframes mpa-slide-out-left {
        from { transform: translateX(0);     }
        to   { transform: translateX(-100%); }
    }
    @keyframes mpa-slide-in-from-right {
        from { transform: translateX(100%);  }
        to   { transform: translateX(0);     }
    }
    @keyframes mpa-slide-out-right {
        from { transform: translateX(0);     }
        to   { transform: translateX(100%);  }
    }
    @keyframes mpa-slide-in-from-left {
        from { transform: translateX(-100%); }
        to   { transform: translateX(0);     }
    }

    html:not([data-nav-dir="backward"])::view-transition-old(root) {
        animation: mpa-slide-out-left      0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
        z-index: 1;
    }
    html:not([data-nav-dir="backward"])::view-transition-new(root) {
        animation: mpa-slide-in-from-right 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
        z-index: 2;
    }
    html[data-nav-dir="backward"]::view-transition-old(root) {
        animation: mpa-slide-out-right     0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
        z-index: 1;
    }
    html[data-nav-dir="backward"]::view-transition-new(root) {
        animation: mpa-slide-in-from-left  0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
        z-index: 2;
    }

    /* ── Keyframes: subida modal / creativa (sin desplazamiento lateral) ── */
    @keyframes mpa-rise-up {
        from { transform: translateY(48px) scale(0.97); opacity: 0; }
        to   { transform: translateY(0) scale(1); opacity: 1; }
    }
    @keyframes mpa-fade-out-scale {
        from { transform: scale(1); opacity: 1; }
        to   { transform: scale(0.98); opacity: 0.2; }
    }
    @keyframes mpa-drop-down {
        from { transform: translateY(0) scale(1); opacity: 1; }
        to   { transform: translateY(48px) scale(0.97); opacity: 0; }
    }
    @keyframes mpa-fade-in-scale {
        from { transform: scale(0.98); opacity: 0.2; }
        to   { transform: scale(1); opacity: 1; }
    }

    html[data-nav-transition="slide-up"]::view-transition-old(root) {
        animation: mpa-fade-out-scale 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        z-index: 1;
    }
    html[data-nav-transition="slide-up"]::view-transition-new(root) {
        animation: mpa-rise-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        z-index: 2;
    }
    html[data-nav-transition="slide-down"]::view-transition-old(root) {
        animation: mpa-drop-down 0.32s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        z-index: 2;
    }
    html[data-nav-transition="slide-down"]::view-transition-new(root) {
        animation: mpa-fade-in-scale 0.32s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        z-index: 1;
    }

    ::view-transition-old(main-nav),
    ::view-transition-new(main-nav) {
        animation: none;
    }
}

/* PAGE LOADER */
#page-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 8000;
}

#page-loader.visible {
    opacity: 1;
    pointer-events: all;
    background: #0a0a0a;
}

.page-loader-ring {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(204, 255, 0, 0.15);
    border-top-color: #ccff00;
    border-radius: 50%;
    animation: loader-spin 0.75s linear infinite;
    filter: drop-shadow(0 0 6px rgba(204, 255, 0, 0.4));
}

.page-loader-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.72em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

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

/* Mobile responsive refinements for player cards */
@media (max-width: 480px) {
    .card-plantilla {
        padding: 10px 12px !important;
        gap: 10px !important;
    }
    .plantilla-col-foto {
        width: 60px !important;
    }
    .plantilla-col-foto img.foto-jugador {
        width: 60px !important;
        height: 60px !important;
        object-position: top center !important;
    }
    .plantilla-nombre {
        font-size: 0.85em !important;
    }
    .plantilla-detalles {
        gap: 6px !important;
        font-size: 0.72em !important;
    }
    .plantilla-col-stats {
        width: 85px !important;
    }
    .plantilla-puntos-grandes {
        font-size: 1.5em !important;
    }
    .btn-acciones-plantilla {
        padding: 6px 10px !important;
        font-size: 0.75em !important;
    }
    .racha-box {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.65em !important;
    }
}


/* =====================================================
   MC-CARD — Tarjeta de Mercado Premium
   Diseño deportivo/tecnológico. Foto PNG sin fondo
   que se funde con el gradiente de la tarjeta.
   ===================================================== */

.mc-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(105deg, #0e1118 0%, #141820 55%, #0e1118 100%);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1),
                border-color 0.22s ease,
                box-shadow 0.22s ease;
    min-height: 100px;
}

.mc-card::before {
    /* Brillo sutil en el borde izquierdo */
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    border-radius: 14px 0 0 14px;
    transition: opacity 0.22s ease;
    opacity: 0;
}

.mc-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.mc-card:hover::before { opacity: 1; }

/* ── Foto ── */
.mc-photo-wrap {
    position: relative;
    width: 100px;
    flex-shrink: 0;
    /* Degradado lateral a la derecha para fusión con fondo */
    -webkit-mask-image: linear-gradient(to right, black 60%, transparent 100%);
    mask-image: linear-gradient(to right, black 60%, transparent 100%);
    overflow: visible;
}

.mc-photo {
    width: 100px;
    height: 100%;
    min-height: 100px;
    object-fit: contain;
    object-position: bottom center;
    display: block;
    /* Sin borde, sin fondo — el PNG transparente se funde */
}

/* ── Centro ── */
.mc-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 8px 12px 4px;
    min-width: 0;
}

.mc-pos-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mc-escudo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.85;
}

.mc-nombre {
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
    white-space: normal;
}

/* Fila propietario */
.mc-owner-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* Círculo con iniciales */
.mc-owner-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.55em;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Versión TL (Torrija League) — dorado */
.mc-owner-badge.mc-owner-tl {
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
    border-color: rgba(255,215,0,0.4);
    color: #1a1000;
    box-shadow: 0 0 8px rgba(255,215,0,0.25);
}

.mc-owner-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.76em;
    font-weight: 500;
    color: #8e8e93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-clausula {
    font-family: 'Inter', sans-serif;
    font-size: 0.7em;
    color: #ff9f0a;
    font-weight: 600;
}

/* Cajas de racha */
.mc-racha {
    display: flex;
    gap: 4px;
}

/* ── Columna derecha ── */
.mc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px 14px;
    flex-shrink: 0;
    min-width: 90px;
    border-left: 1px solid rgba(255,255,255,0.05);
}

.mc-pts-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.mc-pts-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6em;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #636366;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.mc-pts-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.9em;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
}

.mc-precio {
    font-family: 'Inter', sans-serif;
    font-size: 0.92em;
    font-weight: 600;
    color: #ebebf5cc;
    letter-spacing: -0.01em;
}

/* Botón de acción */
.mc-action {
    width: 100%;
}

.mc-action button,
.mc-action .btn-fichar {
    background: #0a84ff;
    color: #ffffff;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.72em;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-align: center;
    display: block;
    width: 100%;
    box-shadow: 0 2px 12px rgba(10,132,255,0.35);
}

.mc-action button:hover,
.mc-action .btn-fichar:hover {
    background: #409cff;
    box-shadow: 0 4px 20px rgba(10,132,255,0.55);
    transform: translateY(-1px);
}

.mc-action .btn-fichar-remove {
    background: rgba(255,69,58,0.12) !important;
    color: #ff453a !important;
    border: 1px solid rgba(255,69,58,0.3) !important;
    box-shadow: none !important;
}

.mc-action .btn-fichar-remove:hover {
    background: #ff453a !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(255,69,58,0.4) !important;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .mc-card { min-height: 90px; border-radius: 12px; }
    .mc-photo-wrap { width: 80px; }
    .mc-photo { width: 80px; }
    .mc-nombre { font-size: 0.88em; }
    .mc-right { padding: 10px 11px; min-width: 80px; }
    .mc-pts-value { font-size: 1.6em; }
    .mc-precio { font-size: 0.82em; }
    .mc-action button,
    .mc-action .btn-fichar { font-size: 0.68em; padding: 6px 10px; }
}
