I love how you try to reduce combat to only melee. Sorry, but you can still hit an invisible opponent with spells IN COMBAT.
No, I think that still counts as attacking them. Are you saying that because this rule is found under "Special Types of Attacks" in the section on Melee, that it only applies to melee attacks? I read it as applying universally to all types of attack. It would be odd, for example, if I was unable to target an invisible (and hidden) creature with a sword, but had no problem aiming a bow and arrow at it.
I don't care how quiet and invisible you are. If you are in the area of my fireball, cast in combat, you're a toasty elf.
I think the idea is that they are not in the area of your fireball. You don't know where they are. Elves have a movement rate of 120 feet per one minute round, which is more than enough to make it virtually impossible to know where to place the center of a 20 foot radius area of effect. A fireball cast at a point where you guess invisible and undetected elves are would be a wasted spell, unless we're talking about very large, densely positioned group of elves covering a large area where you're virtually guaranteed to hit some elves no matter where you point, or some other corner-case.
It was the foundation for the rules. It was not the default.
What distinction are you trying to draw here? Chainmail was the primary rules for combat. That's why the d20-based attack and saving throw matrices are presented as an alternative. The one notable modification D&D makes to Chainmail is that hits don't automatically kill but instead do damage.
They can still be affected in combat.
How do you affect elves who are in an unknown and undetected location? Not even
cloudkill covers a wide enough area to trap the elves.
There is also no restriction on vanishing 6 inches in front of an enemy staring you. Twist and spin the wording all you like, you will still never be able to show that restriction to be true.
I haven't tried to show that such a restriction exists. I've merely said that I think it's suggested by the fact that elves can't turn invisible while attacking. Even if they can turn invisible under direct observation, however, they won't be hidden. That's the point. The 5e wood elf, on the other hand, certainly does not have the power to turn invisible without first becoming hidden.
They can be attacked, just not in melee. A fireball attack is effective against invisible enemies for example.
Not if they're hidden. If they're hidden, you don't know where to aim your fireball.