Gutted with that, nice for the Costa Ricans but it probably means Germany will go through ahead of Japan now.
Unless they're absolutely battered by Spain, or Japan get something against Spain, you'd expect them to comfortably win against Costa Rica and overtake Japan on goal difference.