In the past when I have gone into dieting mode, I sometimes had trouble falling asleep. I thought dietary changes might have been the cause, with the primary change being a significant decrease in carbs. That's just a personal observation...I never researched it. I didn't change much else in my diet or training routine (other than normal changes to keep things from stagnating in the gym). When I got used to the diet, I didn't feel like I needed the sleep I was losing by not being able to fall asleep right away. Just curious, do you sleep better on the nights you do pizza?
Working out at night has also been a factor in the past, dieting or not.
Baron's suggestion of ZMA worked well for me (still does). I use the brand he pictured. If you take two or three of those, you might also experience vivid dreams.
Well I do love pizza but I don't think it makes a difference other than obviously too many calories going to bed will make one restless. The only food that is important to me when I'm training is All-Bran as it keeps the whole digestion running smoothly.
Might be your cortisol levels.
Years ago, I belonged to a gym that had a cold plunge...great for legs post run. Yep, stair running is a great workout but running trails is a lot more fun.I bought a basic bath and filled with ice water. After my early morning stairs climb (22 stories up down carrying weights) I jumped in. A little heart stopping before coffee at 5am but my legs feel very good. My left knee has no swelling at all and it was always a little bad.

I used to do 40 flights x 4 (elevator down) and running daily stairs puts you in the best shape of your life.
Dont you dare to go out after taking magnesium.It may surprise you big time.