/* css/responsive.css */

/* Solo se activa en pantallas menores a 768px (Celulares y Tablets) */
@media (max-width: 768px) {
    
    /* 0. RESET GLOBAL PARA MÓVIL */
    * {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* 1. Sidebar: Oculto con transform para fluidez */
    .sidebar {
        transform: translateX(-100%);
        transition: 0.4s ease-in-out;
        width: 260px;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1500; 
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* 2. Contenido: Full width sin márgenes */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 85px 15px 40px 15px !important; 
        min-height: 100vh;
        transition: 0.3s;
    }

    /* 3. Top Bar y User Tag */
    .top-bar {
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 10;
    }

    .user-tag span {
        display: none; 
    }

    /* 4. AJUSTE DE RANKING (Diseño de Tarjetas Flexibles) */
    .ranking-container h1 {
        font-size: 1.5rem !important;
    }

    .tabla-scroll {
        width: 100% !important;
        overflow-x: hidden !important; 
        display: block;
        padding: 0 !important;
    }

    /* Ocultamos los títulos de las columnas (Pos, Jugador, Victorias) */
    .tabla-ranking thead {
        display: none !important;
    }

    .tabla-ranking {
        display: block !important;
        width: 100% !important;
        border-spacing: 0 !important;
    }

    .tabla-ranking tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Cada fila se convierte en una Card Flex */
    .fila-hover {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: rgba(15, 23, 42, 0.7) !important;
        margin-bottom: 12px !important;
        padding: 12px 15px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(56, 189, 248, 0.1) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .tabla-ranking td {
        display: flex !important;
        align-items: center !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Columna Posición (#1) */
    .col-pos {
        width: 40px !important;
        font-weight: 800 !important;
        color: var(--primary) !important;
        font-size: 1rem !important;
    }

    /* Columna Central: Foto + Nombre */
    .col-jugador {
        flex-grow: 1 !important;
        gap: 12px !important;
        justify-content: flex-start !important;
    }

    .foto-ranking {
        width: 38px !important;
        height: 38px !important;
        margin-right: 0 !important;
    }

    .badge-nombre {
        min-width: auto !important;
        max-width: 140px !important;
        font-size: 0.85rem !important;
        padding: 5px 10px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; 
    }

    /* Columna Victorias/Puntos */
    .col-puntos {
        width: auto !important;
        margin-left: auto !important;
        font-weight: 800 !important;
        color: #38bdf8 !important;
        font-size: 1.1rem !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    /* Etiqueta dinámica de "PTS" */
    .col-puntos::before {
        content: "PTS" !important;
        font-size: 0.6rem !important;
        color: #64748b !important;
        font-weight: 400 !important;
        margin-bottom: -2px !important;
    }

    /* --- 4.1 Ajustes para Torneos --- */
    .tabla-torneos {
        display: block !important;
        width: 100% !important;
    }

    .fila-torneo td {
        white-space: normal !important; 
        word-wrap: break-word;
    }

    /* 5. Tarjeta de perfil */
    .player-card {
        max-width: 100% !important;
        margin-top: 20px;
    }

    .avatar-container {
        width: 90px !important;
        height: 90px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: -45px !important;
    }

    .card-body {
        padding: 60px 15px 25px !important;
    }

    /* 6. Grid de juegos */
    .grid-juegos {
        grid-template-columns: 1fr !important;
    }

    /* 7. El Botón Hamburguesa Flotante */
    .btn-movil {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 25px;
        right: 25px;
        width: 60px;
        height: 60px;
        background: #38bdf8;
        border-radius: 50%;
        border: none;
        color: #020617;
        font-size: 1.8rem;
        z-index: 2000;
        box-shadow: 0 5px 20px rgba(56, 189, 248, 0.5);
    }
}

/* Oculto en PC */
.btn-movil { display: none; }