The Mechanics of Magic System Design