Lack of minerals
Deficiencies in key minerals, especially magnesium, potassium, and calcium, increase the risk of muscle stiffness. Magnesium plays an important role in muscle relaxation, and low levels can cause muscles to spasm involuntarily.
Inactivity or a sedentary lifestyle
Sitting for long periods of time can cause muscles to shorten and tighten. Over time, lack of exercise can reduce flexibility and increase the likelihood of nighttime cramps. Even regular exercisers can be affected by prolonged sitting at work or at home.
Improper sleeping position
Certain sleeping positions, such as lying with your toes pointing down or with your legs stretched out, can trigger cramps. These positions shorten the calf muscles, restrict blood flow, and cause muscle spasms during sleep.