Dinosaurs evolved fancy head gear to woo mates, but it had an unintended consequence