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.
When a card ability does not specify a zone, such as "Choose X Pals," "The number of your gears," or "Choose all cards", does it refer to cards in other zones like the hand or deck, in addition to the base?
No, it does not. Unless a specific zone is stated, it refers to cards in the base.