iMac screen fogging up
Consider the operating temperatures of the iMac and see if you’re not going beyond the limits. Electronics cannot (and shouldn’t) be operated beyond temperature limits. As much as heat is bad, extreme cold is not good either. 

As already suggested, do not expose your iMac to “very cold air at night”.