I played a card that states Look at the top X cards of your deck, choose up to Y (specific) cards and add them to your hand, and shuffle the rest of the cards with the deck. What happens if there are no such specific cards among the cards I looked at?
Choose 0 cards and resolve the rest of the effect.
I played an ability that states "Look at the top X cards of your deck," but the number of cards in my deck was fewer than X.
In this case, can the effect still be resolved?
Yes, you can.
Look at the remaining cards in the deck as much as possible and resolve the effect. Furthermore, even if the deck temporarily becomes 0 cards during the resolution of the effect, as long as there is 1 or more cards in the deck after the resolution finishes, you do not lose the game.