Added boundary check to fail detection if the card is not entirely within screen boundaries