If there is a game that is free to play but at the end if you win, you win money, is this considered haraam (gambling)? There is zero initial cost, the only thing is the chance you may win money, if you don't win, you lose nothing.
This question was asked almost precisely like this on islamqa; the ruling is that this is halal to engage in for all parties involved.
The prohibition on gambling applies when there is a person that is uncertain whether he will win something or lose something based on the outcome of one uncertain event. The following are halal for that reason:
- you promise your friend a million dollars if it rains tomorrow (only losing possible for him, only winning possible for you)
- you promise your brother two thousand dollars if it rains tomorrow, and he promises you a thousand dollars if the item he bought on Amazon recently arrives tomorrow (both could lose or win, but based on independent events)
Now here is a matter that would be slightly related, and is the issue of some controversy: a supermarket holds a raffle that everyone who buys a bottle of Coca Cola enters into. You can find a summary of some of the views in that regard here - note that all the shuyukh quoted there seem to be salafis, you might get different rulings from more traditional scholars. There seem to be two opinions:
- this is always considered gambling and thus if you win in such a raffle, you have to reject the prize
- the question whether this is halal or not depends on two things:
- was the price of the Coca Cola increased for the purposes of the raffle?
- is your intention to enter the raffle, or solely to get a Coca Cola
The second opinion would allow you to enter the raffle by buying a Coca Cola if the price of it was not increased, and if you would have bought the Coca Cola anyway.