"in" a building/market/car whatever, means you're inside it. "at" the sames means you're at the periphery, not far from them. As to "at" night, well it's not a place, you cannot be inside it. I'd relate it to the notion of time, you say "at" nine, not "in" nine. Hope I've helped?