I'd classify it, as far as meaning and possible origin, with other terms with relationships to gambling: to fold, to cash in (too general to source this properly, I bet), a crapshoot, not in the cards (fortunetelling, instead?), an ace, the chips are down, full deck, etc.