Here is the sentence:
You rule! You recognized that too many words separate the modifier from its target. Hungry for dinner, a phrase, is describing surface when its target should be Gert.
To fix the problem, you should organize the sentence like this: Hungry for dinner, Gert the goldfish waited at the surface in anticipation of food flakes.