Cosmological phase transition, baryon asymmetry, and dark matter Q-balls