Pipefish, along with their cousins sea horses and sea dragons, defy convention in love and fertility. In a striking role reversal, fathers give birth instead of mothers.

During courtship, females pursue males with flashy ornaments or elaborate dances, and males tend to be choosy about which females’ eggs they’ll accept. Once pregnant, these gender-bending fathers invest heavily in their young, supplying embryos with nutrients and oxygen through a setup similar to the mammalian placenta.

But this investment may also be cruelly conditional, according to a new study in Proceedings of the Royal Society B. Studying pipefish, scientists found evidence that pregnant fathers spontaneously abort or divert fewer resources to their embryos when faced with the prospects of a superior mate — in this case, an exceptionally large female.

The researchers named their finding the “woman in red” effect, after the eponymous 1984 Gene Wilder film about a married man’s obsession with a woman in a red dress that becomes damaging to his family life.