Weirdest phone freeze ever....

So I was playing a game on my phone during a plane ride and had my phone on airplane mode. All of a sudden I tried to exit the game by hitting the home button and it would not respond. I tired pressing it 30 times. No response. Tired clicking the button on top. Same thing. No respond. Tired holding the lock button down to turn it off no response. No buttons would work. The funny thing is that I could still play the game and the screen worked by selecting options for the game on the screen. Finally the apple sign showed up and the phone restarted. Everything works great now. Any thoughts? Think it was the game causing it or the phone? The game was called road trip with the car that you have to keep moving or it blows up just if you were curious what game it was.
Random act of glitchiness... they happen once in a while... if it happens regularly, it's time to think about restoring your device's iOS.
Just so weird cuz I've never experienced that before on any iPhone I've had. Wonder if it's a hardware problem with the iPhone or the game app just caused it?
Logic would tell us that if the phone has never had an issue until an app was being used, and only did it within that app...that it's probably not a hardware issue.

Original thread: https://forums.imore.com/threads/weirdest-phone-freeze-ever.274930/