Working or playing on your laptop or mobile device right before bed can ruin your sleep in non-obvious ways. Yes, the devices can hinder winding down your mind, but that's not the biggest issue. The main issue is exposure to unnatural light that inhibits the neurochemistry of sleep.

Exposure to blue light increases alertness. This makes sense. During the day we get exposed to the blue light of the sky. Thus, the brain interprets exposure to blue light as a cue that it's time to be awake.