In the US, it depends first on what the state law is, and second what platform policy is. There is a law, the Revised Fiduciary Access to Digital Assets Act, enacted in most states. Here is a summary of what that law does, and here is the version enacted by Washington. The Washington law makes an important distinction between the person's communications and ...
In the United Kingdom:
A person has no authority to access an online account of a deceased relative, unless this has been agreed with the operator of the website (etc). If a Power of Attorney over the deceased's financial affairs existed, this ceases upon death.
Using a person's login credentials without permission from the owner of the website would be a ...
By your definition, it’s gambling
chance: you said prizes are drawn at random
consideration (paying something to play): eyeballs on a screen is something of value
a prize: advertising is something of value being offered as a prize
Whether it’s illegal gambling depends on local law.