Thanks for playing!
The game ends if the deck runs out of cards, so you do not play any more cards after the deck reaches zero and that's considered the win condition.
And yes, that's correct. Vertical pills are made of four cards and the check for whether a pill was made happens left-to-right, top-to-bottom, so the top 4 are cleared in that case and the bottom card remains on the board.