Milan bow in Barcelona thriller