Couple of bad assumptions I saw above:
A new building has good wiring... LMFAO - wiring is done by brainless apes. The newer the building, the more brainless the apes, it cuts costs. As a landlord I've pulled **** wiring out of houses that would have had them condemned if the inspectors weren't on the contractors "payroll"!
It's summer (surprise) airconditioning units brownout power because of the big compressor starting load.
A 400w power supply should not be a problem with your system unless it is a total POS (i.e. no name tiawanese clunker). Look for dimming lights, tv picture shrinks a little, funny noise out of the fridge if its running at the same time the system shuts down. If you're in an apartment or dorm who knows what is getting switched on and off the power bus.
One thing I'm not clear on. Has it never shutdown in a game? If not then its probably some idle timer set somewhere.
If has happened when the machine was active (gaming) do not assume a new or bigger supply will help. The fact that your dieing at idle points elsewhere. Like bad power coming in or something set to auto shutdown the system at idle (there are many definitions of idle, you can select no keys, no hd, no lan, timer, etc. Check all the settings in Windows and the bios.)
If it is incoming power quality you can get a battery back up unit or power line filter for the same price range as a name brand bigger power supply. The name brand supply may not be enough of a help if the incoming power is too bad. Look for the other symptoms I described above.
There are power line monitors available for checking power quality in your home but they are not cheap. If it's a house you may be able to get the utility company to check the power. If it's an apartment or dorm the landlord/school will just laugh at you.
All it takes is a loose screw or nicked wire (or undersized circuits) to cause power drop outs.