Coevolutionary dynamics of genetic traits and their long-term extended effects under non-random interactions.