Improvised weapons are mostly left up to the DM. There is very little we can tell you for sure; most of these questions you will have to ask your DM about.
Improvised weapon as both melee and ranged
A weapon can count as both a melee weapon and a ranged weapon; many throwing weapons do that. An improvised weapon could be likewise—you can slam a brick down on someone’s head, or you can throw a brick at someone, and both would be attacks with an improvised weapon. On the other hand, while—in the appropriate fantasy setting—we can imagine a thrown playing card being able to hurt someone, I’m struggling to imagine how you could hit someone with one in melee that would hurt them. (Just punching them with the card wrapped around your fist probably doesn’t count.) Your DM may or may not allow it, but it will likely come down to whether or not they can imagine it actually hurting someone.
Melee Weapon Mastery and Ranged Weapon Mastery with thrown weapons
Anyway, if allowed, yes, thrown weapons can be both a melee weapon and a ranged weapon, and the wording on Melee Weapon Mastery and Ranged Weapon Mastery is that you get the bonus when you use the correct sort of weapon—regardless of what kind of attack you make. And, officially, they stack. So you could get +4 to attack and damage with a thrown weapon if you took both. You should ask your DM about it, however, since some DMs may find it cheesy to get both like that. Personally, considering that you have burned four feats on this, I do not think this is a very strong choice, even if your DM allows it—Weapon Focus, Weapon Specialization, Melee Weapon Mastery, and Ranged Weapon Mastery are rather weak feats.
Magical Improvised Weapons
In order to become magical, a weapon must first be a masterwork weapon. An improvised weapon is, by definition, something that wasn’t made to be a weapon at all. If you made a card that was designed to be a weapon and made with masterwork quality, it would no longer be improvised—it would be a real weapon. Whether or not that is possible in your game world is up to your DM.
Ask your DM for fancy, maybe exotic, weapons that are actually-weaponized playing cards. Sharpened metal edges, perhaps. Use the stats for a dagger, maybe. Then you can get masterwork versions and put magic on them and there are no questions. Having actually improvised weapons is a bad idea—there really is no advantage to using them at all, I checked.
Also, you probably should not take Weapon Focus unless something really good requires it. You probably shouldn’t take four levels of fighter—a feat per level for the first two levels is OK, a feat every other level is really weak. And even if you do, you almost-certainly shouldn’t take Weapon Specialization. That nixes the Weapon Mastery feats, but they aren’t that good anyway. Instead, I recommend looking into master thrower from Complete Warrior. Bloodstorm blade from Tome of Battle is rather good for throwing, too. If you want to be Strength-based, Brutal Throw from Complete Adventurer is good and ranger can get you dual-wielding or ranged-attack feats without Dexterity. If you want to be Dexterity-based, Dead Eye from Dragon Compendium can get you Dex to damage, and if you do treat the cards as if they were daggers, Shadow Blade from Tome of Battle will as well (they stack). Swordsage is useful for getting Shadow Blade, and may have more useful things you can do as well.