/* ============================================
   ROSTER DE PARTIDOS - ESTRUCTURA Y MIEMBROS
   ============================================ */

/* Contenedor principal */
.match-rosters {
    display: flex;
    gap: 32px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Contenedor de roster individual */
.roster {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header del roster */
.roster-header {
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.roster-header-content {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.roster-team-badge {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.roster-team-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.roster-header-info {
    flex: 1;
    min-width: 0;
}

.roster-team-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--txt);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roster-team-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.team-count {
    font-weight: 500;
}

.roster-header-decoration {
    height: 3px;
    background: var(--accent);
}

/* Decoración específica por color de equipo */
.roster-blue .roster-header-decoration {
    background: #0089ff;
}

.roster-red .roster-header-decoration {
    background: var(--accent);
}

/* Contenido del roster */
.roster-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: visible;
}

.roster-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: visible;
}

/* Secciones */
.roster-section {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: visible;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--borders);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--txt);
}

.section-icon {
    font-size: 16px;
    color: var(--accent);
}

.section-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel-2);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Grids */
.roster-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.roster-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.roster-substitutes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* Cards */
.staff-card,
.player-card,
.substitute-card {
    background: var(--panel-2);
    border-radius: var(--radius);
    padding: 12px;
    position: relative;
    overflow: visible;
}

/* Miembro individual */
.roster-member {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: visible;
}

.roster-member.empty-slot {
    opacity: 0.5;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
}

.member-card:active {
    transform: translateY(0);
}

.member-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel);
}

.member-avatar.empty-avatar {
    background: var(--panel-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar.empty-avatar i {
    font-size: 20px;
    color: var(--muted);
}

.avatar-role-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--panel);
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.avatar-role-badge.empty {
    background: var(--panel-2);
    opacity: 0.6;
}

.role-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.member-details {
    flex: 1;
    min-width: 0;
}

.member-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.member-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--txt);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-name.empty-text {
    color: var(--muted);
    font-weight: 500;
}

.member-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.member-username {
    color: var(--muted);
    font-weight: 500;
}

.member-username.empty-text {
    font-style: italic;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 1024px) {
    .match-rosters {
        flex-direction: column;
    }

    .roster-players-grid,
    .roster-substitutes-grid,
    .roster-staff-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .match-rosters {
        padding: 16px;
        gap: 24px;
    }

    .roster-header-content {
        padding: 16px;
    }

    .roster-team-badge {
        width: 48px;
        height: 48px;
    }

    .roster-team-name {
        font-size: 18px;
    }

    .roster-section {
        padding: 12px;
    }

    .roster-players-grid,
    .roster-substitutes-grid,
    .roster-staff-grid {
        grid-template-columns: 1fr;
    }

    .member-avatar {
        width: 44px;
        height: 44px;
    }

    .avatar-role-badge {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .roster-team-meta {
        flex-wrap: wrap;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .section-count {
        align-self: flex-start;
    }
}