Calculate heights of cards from variable