Why did Germany declare war on the US after Pearl Harbor when they had nothing to do with it?

Germany had a pact with Japan and Italy.