Injury, Dehydration, Low blood calcium, magnesium, Vigorous activity,Rest Cramps, Contractures or Dystonic cramps.
Your symptoms seem to best fit rest cramps. They are described as follows:
Rest cramps: Cramps at rest are very common, especially in older adults, but may be experienced at any age, including childhood. Rest cramps often occur during the night.