Good point roman.
Lungs HAD to have originated not only in fresh water, but in creeks that would dry up into tepid pools. They make sense no other way.
Something needed to cause the transition from gills to a lung, and it was obviously the water losing oxygen, forcing the organism to gulp air from the surface.
Nothing in the sea becomes stagnant.
Also, the "arms" of salamanders which went on to become the arms and legs of all land animals evolved for pawing through thick reeds like one finds in freshwater creeks.
Again it was probably the drying out of waterholes which forced these early salamanders to crawl out onto land and try to find another waterhole.
Over time those that became better at negotiating dry land were favoured.
Once they were somewhat profficient at it, they would have exploited the fact that they were safe from predators on land and that there was no competition for the food sources on land.
Plankton and everything like that originated in the sea, but I definately think it was a freshwater strain of organism which lead to amphibians, and the famous "moment" an amphibian crawled onto land would have been deep in the heart of the dry supercontinent and out of a freshwater billabong which was turning into a muddy pit.
It also probably died, which is sad. But another one later made it to another waterhole thanks to his strong arms and good air breathing ability, where he got it on with some females.