There already exists on this site, discussions about gambling in halacha - see here, here and here etc. I would like to focus specifically within the context of Chanukah and an apparent minhag (custom) of those who play games that involve gambling.
It is mentioned in a couple of places that certain acharonim spoke out against the practise of gambling on Chanukah, whether it be through the dreidel or some form of card games. For example the Chasam Sofer here is noted to have been upset at the practise of using the dreidel in this way. Yet, the Chavos Yair 126, as mentioned here writes that the rabbis in his town enacted a policy to ban playing cards, except on Chanukah.
Meanwhile, I saw on Halachapedia (footnote 16) that the Piskei Teshuvos (670:4 n. 25) quotes the Shefa Chaim OC 2:283 who says that there is no issue of gambling because just like a father and son may gamble since they don’t care who wins or loses, on Chanukah everyone is like one family.
Alternatively, Rav Yisrael of Ruzhin is cited as encouraging his followers to play dreidel (in a gambling fashion) on the last day of Chanukah, “for what one gains on Zos Chanukah is not easily lost” (refer to Ner Yisrael 5747, p. 18).
So my question is, if we don't normally encourage gambling, how then did such a custom emerge on Chanukah? And not only that, gain the support of several Rabbonim.