Are you taking any medication? If magnesium is helping, that means you are not taking in enough electrolytes, or, taking in too much calcium. If you eat too much dairy, which is very high in calcium but deficient in magnesium, that can be a problem, as electrolytes are in balance with one another. Green leafy vegetable are great sources of balanced calcium and magnesium. It could also be a potassium problem. It could also be a problem with being too sedentary -- sitting for long periods of time is very hard on the back and other parts of the body and can cause pinching of nerves. Humans are animals and animals gotta move or everything becomes stagnant. Do you exercise regularly? Do you move around, or just sit around and play video games? Do you stretch at all? Also, tightness can be caused by stress and anxiety, and if you're really into winning when you play video games you might be tensing your leg muscles the whole time. Some people get headaches from deep concentration, some get leg pain -- stretching and learning progressive relaxation might help. Can't tell you what it is, but there are a lot of possible reasons.