First principles of card play