Dimming the light in your room around your sleep time signals your brain to release melatonin (the sleep hormone). Exposure to blue-light screens (and also daylight) causes your brain to stop producing melatonin, causing you to be wide awake.