We investigate the possible formation of a Bose-Einstein condensed phase of pions in the early Universe at nonvanishing values of lepton flavor asymmetries. A hadron resonance gas model with pion interactions, based on first-principle lattice QCD simulations at nonzero isospin density, is used to evaluate cosmic trajectories at various values of electron, muon, and tau lepton asymmetries that satisfy the available constraints on the total lepton asymmetry. The cosmic trajectory can pass through the pion condensed phase if the combined electron and muon asymmetry is sufficiently large: |le + lμ| $\gtrsim 0.1$, with little sensitivity to the difference le − lμ between the individual flavor asymmetries. Future constraints on the values of the individual lepton flavor asymmetries will thus be able to either confirm or rule out the condensation of pions during the cosmic QCD epoch. We demonstrate that the pion condensed phase leaves an imprint both on the spectrum of primordial gravitational waves and on the mass distribution of primordial black holes at the QCD scale, e.g., the black hole binary of recent LIGO event GW190521 can be formed in that phase.