What contributed most strongly led to the decline of Sweden as a major European Power in the early eighteenth century?

Rivalry with Russia coming to a pinnacle in the Great Northern War