/* ============================================================
   MEDALLERO — estilos específicos
   ============================================================ */

/* ============================================
   MEDALLERO — TABLA PRINCIPAL: columnas
   ============================================ */
#medalleroTabla colgroup col:nth-child(1) { width: 50px; }
#medalleroTabla colgroup col:nth-child(3) { width: 80px; }
#medalleroTabla colgroup col:nth-child(4) { width: 80px; }
#medalleroTabla colgroup col:nth-child(5) { width: 80px; }
#medalleroTabla colgroup col:nth-child(6) { width: 80px; }
#medalleroTabla colgroup col:nth-child(7) { width: 40px; }

#medalleroTabla thead th:nth-child(3),
#medalleroTabla thead th:nth-child(4),
#medalleroTabla thead th:nth-child(5),
#medalleroTabla thead th:nth-child(6) {
    text-align: center !important;
    width: 80px;
}

#medalleroTabla tbody td:nth-child(3),
#medalleroTabla tbody td:nth-child(4),
#medalleroTabla tbody td:nth-child(5) {
    text-align: center;
    width: 80px;
}

#medalleroTabla tbody td:nth-child(6) {
    text-align: right;
    width: 80px;
    font-weight: 700;
    text-align: center;
}

/* ============================================
   MEDALLERO — COLORES DE FILA
   ============================================ */
.medallero-row-oro    { background: rgba(255, 200, 0,   0.07); }
.medallero-row-plata  { background: rgba(180, 180, 200, 0.07); }
.medallero-row-bronce { background: rgba(180, 100, 40,  0.07); }

/* ============================================
   MEDALLERO — FILA PRINCIPAL
   ============================================ */
.medallero-row-main {
    transition: box-shadow 0.15s ease;
    cursor: pointer;
}

.medallero-row-main:hover {
    opacity: 0.88;
}

.medallero-row-main.abierto {
    box-shadow: inset 3px 0 0 #6ed4ff;
    background: rgba(11,12,76,0.03);
}

/* ============================================
   MEDALLERO — EXPAND ICON
   ============================================ */
.medallero-td-expand {
    width: 40px;
    text-align: center;
}

.medallero-expand-icon {
    font-size: 0.75rem;
    color: #0b0c4c;
    transition: transform 0.2s ease;
    display: inline-block;
}

/* ============================================
   MEDALLERO — ICONOS FA-MEDAL
   ============================================ */
.medallero-oro   { color: #d4a017; }
.medallero-plata { color: #9e9e9e; }
.medallero-bronce{ color: #cd7f32; }

/* ============================================
   MEDALLERO — CELDA JUGADOR (por torneo)
   ============================================ */
#medalleroTabla .inscritos-jugador {
    display: flex;
    flex-direction: inherit;
    gap: 0;
}

#medalleroTabla .inscritos-flag{
    margin-right: 5px;
}


#medalleroTabla .inscritos-jugador-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   MEDALLERO — TOGGLE BUTTON BADGES
   ============================================ */
.medallero-toggle-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    color: #8C9BAB;
    font-size: 11px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.medallero-toggle-btn:hover {
    color: var(--color-navy, #0b0c4c);
}

.medallero-toggle-btn i {
    transition: transform 0.25s ease;
    display: block;
}

.medallero-toggle-btn.open i {
    transform: rotate(180deg);
}

/* ============================================
   MEDALLERO — BADGES CATEGORÍA (por torneo)
   ============================================ */
.medallero-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.25s ease;
}

.medallero-cats.open {
    max-height: 200px;
    opacity: 1;
    margin-top: 8px;
    margin-left: 20px;
}

.medallero-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    white-space: nowrap;
}

.medallero-cat-oro    { background: rgba(255,200,0,0.15);   color: #b8860b; border: 1px solid rgba(255,200,0,0.3); }
.medallero-cat-plata  { background: rgba(180,180,200,0.15); color: #707090; border: 1px solid rgba(180,180,200,0.3); }
.medallero-cat-bronce { background: rgba(180,100,40,0.15);  color: #8b4513; border: 1px solid rgba(180,100,40,0.3); }

/* ============================================
   MEDALLERO — OVERLAY
   ============================================ */
.medallero-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11,12,76,0.25);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.medallero-drawer-overlay.open {
    display: block;
}

/* ============================================
   MEDALLERO — DRAWER DESKTOP (centrado)
   ============================================ */
.medallero-drawer {
    position: fixed;
    top: 56%;
    right: -540px;
    transform: translateY(-50%);
    width: 500px;
    max-height: 80vh;
    background: #fff;
    z-index: 999;
    box-shadow: 0 20px 60px rgba(11,12,76,0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    border-radius: 20px;
    overflow: hidden;
}

.medallero-drawer.open {
    right: calc(50% - 250px);
}

/* ============================================
   MEDALLERO — DRAWER HEADER
   ============================================ */
.medallero-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #E5E9F0;
    flex-shrink: 0;
}

.medallero-drawer-nombre {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy, #0b0c4c);
    font-family: var(--font-primary, sans-serif);
}

.medallero-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #E5E9F0;
    background: #fff;
    color: #8C9BAB;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.medallero-drawer-close:hover {
    background: var(--color-navy, #0b0c4c);
    border-color: var(--color-navy, #0b0c4c);
    color: #fff;
}

/* ============================================
   MEDALLERO — DRAWER BODY
   ============================================ */
.medallero-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 32px;
}

.medallero-drawer-loader {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    color: #8C9BAB;
    font-size: 22px;
}

.medallero-drawer-vacio {
    text-align: center;
    padding: 40px 0;
    color: #8C9BAB;
    font-size: 14px;
}

/* ============================================
   MEDALLERO — ITEMS DETALLE DRAWER
   ============================================ */
.medallero-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #F0F3F8;
}

.medallero-drawer-item:last-child {
    border-bottom: none;
}

.medallero-drawer-medalla {
    font-size: 26px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.medallero-drawer-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.medallero-drawer-torneo {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-navy, #0b0c4c);
    font-family: var(--font-primary, sans-serif);
}

.medallero-drawer-cat {
    font-size: 12px;
    color: #8C9BAB;
    font-weight: 500;
}

.medallero-drawer-comp {
    font-size: 12px;
    color: #8C9BAB;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   MEDALLERO — MÓVIL: bottom sheet
   ============================================ */
@media (max-width: 768px) {
    .medallero-drawer {
        top: auto;
        right: 0;
        bottom: -100%;
        width: 100%;
        max-height: 75vh;
        transform: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 40px rgba(11,12,76,0.15);
        transition: bottom 0.35s cubic-bezier(0.4,0,0.2,1);
        z-index: 1001;
    }

    .medallero-drawer.open {
        right: 0;
        bottom: 0;
    }

    .medallero-drawer-overlay {
        z-index: 1000;
    }

    .medallero-drawer-header {
        position: relative;
        padding-top: 28px;
    }

    .medallero-drawer-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #E5E9F0;
        border-radius: 2px;
    }

    .medallero-cat-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .medallero-td-expand,
    #medalleroTabla thead th:last-child,
    #medalleroTabla tbody td:last-child {
        display: none;
    }
}
/* ============================================
   MEDALLERO TORNEO — RESPONSIVE MÓVIL
   ============================================ */
@media (max-width: 768px) {

    /*#medalleroTabla thead th:nth-child(6),
    #medalleroTabla tbody td:nth-child(6) {
        display: none !important;
    }*/

    #medalleroTabla thead th {
        padding: 10px 6px !important;
        font-size: 11px !important;
    }

    #medalleroTabla tbody td {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }

    #medalleroTabla .inscritos-td-pos {
        width: 28px !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
    }

    #medalleroTabla thead th:nth-child(3),
    #medalleroTabla thead th:nth-child(4),
    #medalleroTabla thead th:nth-child(5),
    #medalleroTabla thead th:nth-child(6) {
        width: 36px !important;
        padding: 10px 4px !important;
    }

    #medalleroTabla tbody td:nth-child(3),
    #medalleroTabla tbody td:nth-child(4),
    #medalleroTabla tbody td:nth-child(5),
    #medalleroTabla tbody td:nth-child(6) {
        width: 36px !important;
        padding: 8px 4px !important;
        font-size: 16px !important;
        text-align: center !important;
    }

    .inscritos-nombre {
        font-size: 12px !important;
    }

    .inscritos-flag {
        width: 16px !important;
        height: 11px !important;
    }

    .medallero-toggle-btn {
        padding: 2px 4px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 380px) {
    #medalleroTabla tbody td:nth-child(3),
    #medalleroTabla tbody td:nth-child(4),
    #medalleroTabla tbody td:nth-child(5),
    #medalleroTabla tbody td:nth-child(6) {
        font-size: 13px !important;
        width: 30px !important;
        padding: 8px 2px !important;
    }

    .inscritos-nombre {
        font-size: 11px !important;
    }
}

@media (max-width: 768px) {

    /* Evitar scroll horizontal — forzar tabla a caber */
    .inscritos-table-wrap {
        overflow-x: hidden !important;
    }

    #medalleroTabla {
        table-layout: fixed !important;
        width: 100% !important;
    }

    /* Anchos fijos para cada columna */
    #medalleroTabla thead th:nth-child(1),
    #medalleroTabla tbody td:nth-child(1) {
        width: 28px !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
    }

    /* Columna nombre: lo que sobre */
    #medalleroTabla thead th:nth-child(2),
    #medalleroTabla tbody td:nth-child(2) {
        width: auto !important;
        padding: 8px 6px !important;
    }

    /* Columnas medalla */
    #medalleroTabla thead th:nth-child(3),
    #medalleroTabla thead th:nth-child(4),
    #medalleroTabla thead th:nth-child(5),
    #medalleroTabla thead th:nth-child(6),
    #medalleroTabla tbody td:nth-child(3),
    #medalleroTabla tbody td:nth-child(4),
    #medalleroTabla tbody td:nth-child(5),
    #medalleroTabla tbody td:nth-child(6), {
        width: 32px !important;
        padding: 8px 2px !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    /* Ocultar columna Total 
    #medalleroTabla thead th:nth-child(6),
    #medalleroTabla tbody td:nth-child(6) {
        display: none !important;
    }*/
    
    #medalleroTabla thead th:nth-child(7),
    #medalleroTabla tbody td:nth-child(7) {
        display: none !important;
    }

    #medalleroTabla thead th {
        font-size: 10px !important;
        padding: 10px 4px !important;
    }

    #medalleroTabla tbody td {
        font-size: 12px !important;
    }

    .inscritos-nombre {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    .inscritos-flag {
        width: 16px !important;
        height: 11px !important;
        flex-shrink: 0 !important;
    }

    /* Toggle btn compacto */
    .medallero-toggle-btn {
        padding: 2px 4px !important;
        font-size: 10px !important;
        flex-shrink: 0 !important;
    }

    /* Badges expandibles — asegurar que se ven bien al abrir */
    .medallero-cats.open {
        max-height: 300px !important;
        margin-top: 6px !important;
    }

    .medallero-cat-badge {
        font-size: 9px !important;
        padding: 2px 5px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    /* Jugador top: nombre + btn en misma línea */
    #medalleroTabla .inscritos-jugador-top {
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 4px !important;
    }

    #medalleroTabla .inscritos-nombre a {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 140px !important;
    }
}

@media (max-width: 380px) {
    #medalleroTabla .inscritos-nombre a {
        max-width: 110px !important;
    }

    #medalleroTabla thead th:nth-child(3),
    #medalleroTabla thead th:nth-child(4),
    #medalleroTabla thead th:nth-child(5),
    #medalleroTabla tbody td:nth-child(3),
    #medalleroTabla tbody td:nth-child(4),
    #medalleroTabla tbody td:nth-child(5) {
        width: 28px !important;
        font-size: 13px !important;
    }
}