Post-Apocalyptic Fantasy Idea

W and I were kicking around ideas revolving around where the races in a fantasy/near-fantasy setting might have come from. I thought it sounded like it might be interesting for a game or story.

Human world. [With magic? Technology? Magitech?]

War or some sort of world-destroying thing coming.

Many humans decide to hole up underground. After a long period of adaptation, they become the dwarves, or something akin to them.

Many decide to take to the stars [or the moon, or other dimension/plane, if magical society], and after adapting to their environment, they have essentially become elves.

The ones left behind, by choice or chance, are changed by exposure to the devastation. The ones in and around cities and areas of heavy population density (which would have the highest potential for destruction from a surprise attack) become the more monstrous races — orcs, goblins, trolls, giants.

The ones living far from developed areas — desert nomads, farmers out in the middle of nowhere, etc. — remain the most human, with occasional mutations (maybe this is where magical ability comes from?) [halflings/gnomes?], and restricted access to old tech or artifacts.