Hi Mate, glad you liked the game. Here's how I would fix the issue you're having.
Have a controller object in charge of picking up.
When the player clicks it loops through all the cards to check if they're being clicked on.
If a card hasn't been picked up yet then pick it up. If it has then compare the depth of the card already held with the one trying to be picked up and drop the old one if it's lower.
OR you can loop through all the cards from highest card to lowest and stop at the first card which is under the mouse. You'd just have to sort all the cards be their depth for that.
Hope one of those ways works for you!