/* --- ESTILOS NATIVOS RANKING (OPTIMIZADO PARA MÓVIL) --- */

/* Sub-Pestañas principales */
.ranking-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.sub-tab-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    flex: 1; /* Hacemos que ocupen el 50% cada uno en móvil */
    text-align: center;
    transition: all 0.3s ease;
}

.sub-tab-btn:hover { background: #333; }
.sub-tab-btn.active { background: #4CAF50; color: white; border-color: #4CAF50; }

.ranking-section { display: none; animation: fadeIn 0.3s ease-in-out; }
.ranking-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- TABS DE CIRCUITO Y CATEGORÍA (Pills) --- */
.circuito-tabs-container, .category-tabs-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}
.circuito-tabs-container::-webkit-scrollbar, .category-tabs-container::-webkit-scrollbar { 
    display: none; /* Oculta scrollbar Chrome/Safari */
}

.circuito-tab-btn, .cat-tab-btn {
    background: #242424;
    border: 1px solid #444;
    color: #bbb;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}
.circuito-tab-btn.active, .cat-tab-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* --- TABLA DE RANKING --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: #242424;
    border-radius: 8px;
    border: 1px solid #333;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px; /* Ajustado para que entre bien en celulares sin desbordar */
}

th {
    text-align: left;
    padding: 10px 8px;
    background-color: #2a2a2a;
    color: #4CAF50;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid #333;
    font-size: 0.85rem; /* Letra más chica para que entre todo */
}

tr:last-child td { border-bottom: none; }
.ranking-row { cursor: pointer; transition: background-color 0.2s; }
.ranking-row:hover { background-color: #2c2c2c; }

/* Acordeón de detalles */
.details-row td {
    padding: 0;
    border-bottom: 1px solid #333;
    background-color: #1a1a1a;
}
.details-content {
    padding: 10px;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from { opacity:0; transform: translateY(-5px); } to { opacity:1; transform: translateY(0); } }

.details-title {
    display: block;
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: bold;
}

/* --- BUSCADOR --- */
.search-container {
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1e1e1e;
    padding-bottom: 10px;
}

#playerSearch {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: white;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

#playerSearch:focus { border-color: #4CAF50; }

.player-card {
    background: #242424;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
}

.card-header h4 { margin: 0; font-family: 'Montserrat', sans-serif; font-size: 0.95rem; color: #fff; }

.circuito-tag {
    font-size: 0.65rem;
    background: #4CAF50;
    color: #000;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.8rem;
    color: #bbb;
}

.card-stats span { color: #e0e0e0; font-weight: 500; }

.pill-cat {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
}

.cat-cab { background-color: #0056b3 !important; color: white !important; }
.cat-dama { background-color: #d81b60 !important; color: white !important; }