Like anything else legal is probably boils down to intent. If your intent is to run an invisible but listenable youtube audio only for background to your game to bypass having the music content locally, yeah, that’s pretty devious but also something YouTube would have issue with.
If you gave access to YouTube as a web page and didn’t block their ads, etc, I wouldn’t think they’d have any issue just like any other browser.
I say all of this with probably because 1) I am not a lawyer 2) I once heard a lawyer say to me that one great thing about the law is that just about any law can be interpreted in a different spirit. 3) Anyone in the US can be sued for anything.