Costa Rica pulls out win in thrilling shootout