/* ============================================================
   Ranking multijugador — panel del navbar (modo /multiplayer)
   ============================================================ */

/* x-cloak: los elementos del ranking quedan ocultos hasta que Alpine
   los procese (evita el parpadeo de contenido sin estilar al cargar
   /multiplayer, sobre todo en pages que no definen [x-cloak]). */
[x-cloak] {
    display: none !important;
}

/* Aparición suave de la lista/estado del ranking (evita el salto
   abrupto de "Cargando ranking..." → entradas). */
@keyframes rankingFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ranking-list,
.ranking-empty,
.ranking-reset-msg {
    animation: rankingFadeIn 0.3s ease;
}

.ranking-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ranking-description {
    font-size: 0.68rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.62);
    max-height: 2.5em;
    overflow: hidden;
}

.ranking-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-x;
}

.ranking-tabs::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.ranking-tabs.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.ranking-tab {
    flex: 0 0 auto;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
}

.ranking-tab.is-active {
    border-color: #60a5fa;
    background: rgba(59, 130, 246, 0.34);
    color: #fff;
}

.ranking-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--tw-gradient-to, #fff);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-subtitle {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ranking-reset-msg {
    font-size: 0.62rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.45);
    padding: 0;
    background: none;
    border: none;
}

.ranking-me-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
}

.ranking-me-box--empty {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
}

.ranking-me-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ranking-me-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.1;
}

.ranking-me-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #60a5fa;
}

.ranking-me-wins {
    margin-left: 2px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-entry {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.ranking-entry--me {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.ranking-pos {
    min-width: 24px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.ranking-entry:nth-child(1) .ranking-pos,
.ranking-entry:nth-child(2) .ranking-pos,
.ranking-entry:nth-child(3) .ranking-pos {
    color: #fbbf24;
}

.ranking-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    flex: none;
}

.ranking-name {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-wins {
    font-size: 0.68rem;
    font-weight: 700;
    color: #4ade80;
    white-space: nowrap;
}

.ranking-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    padding: 18px 8px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.ranking-empty small {
    color: rgba(255, 255, 255, 0.35);
}

.ranking-loading {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 16px 8px;
}

/* Anti-flash móvil (modo /multiplayer): el navbar del ranking inicia oculto
   en pantallas pequeñas sin esperar la carga tardía del link CSS (misma regla
   que style_navbarleft.css pero inline en el partial para evitar el parpadeo). */
@media only screen and (max-width: 950px) {
    #navbarContent.page__navbar {
        display: none;
    }
}

/* En tablets landscape se oculta igual que en el casino. */
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: landscape) {
    #navbarContent.page__navbar {
        display: none;
    }
}

/* ============================================================
   SIDEBAR RANKING — opaco, visible y sin parpadeos
   ------------------------------------------------------------
   El nav de ranking controla su visibilidad con TRANSFORM (nunca
   display) y tiene fondo OPAQUE propio: bg-white1 define opacidad 0
   y dark:bg-gray-800 depende de un ancestro .dark que no existe, por
   lo que sin esto el sidebar se veía "traslúcido" sobre el contenido.
   - Escritorio (≥951px): visible por defecto (estático, sin animación
     de carga que producía el parpadeo).
   - Móvil (<951px): oculto (translateX(-100%)) y se desliza al tocar
     el hamburguesa (clase .is-open).
   ============================================================ */

/* Definir las variables de transform que faltaban: los utilities
   -translate-x-full / sm:translate-x-0 usan translate(var(--tw-...))
   y sin estas variables el transform era INVÁLIDO (→ none, sin slide). */
:root {
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
}

/* Fondo OPAQUE siempre (immune a bg-white1 = opacidad 0). Se aplica
   al nav y a su contenedor interior. */
nav.page__navbar.ranking-nav,
nav.page__navbar.ranking-nav > div:first-child {
    background-color: #0d131c !important;
}

/* El nav de ranking SIEMPRE en display:block (immune a los @media
   display:none y al slideToggle inline). La visibilidad la controla
   el transform. */
nav.page__navbar.ranking-nav {
    display: block !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
nav.page__navbar.ranking-nav.is-open {
    transform: translateX(0);
}

/* Escritorio (≥951px): visible por defecto, SIN animación (estático,
   sin parpadeo). */
@media (min-width: 951px) {
    nav.page__navbar.ranking-nav {
        transform: translateX(0);
        transition: none;
    }
}

/* Móvil: mantener el ancho del drawer (256px) en vez del overlay
   full-width que agregaba el slideToggle genérico. */
nav.page__navbar.ranking-nav.full-width {
    width: 20rem;
    max-width: 20rem;
}


