If the bolded words are inside its skeleton, then this is an adverb phrase, because it explains where the crab was safe, it gives us a location, which is a quality of adverbs.
There are no infinitives or gerunds here, and it's not an adjective phrase either.