Yes, the game works as intended.
Yes, the code should be refactored. I have ~50 minutes left until I need to submit this, so I will try refactoring to better separate concerns before that time is up.
My components and variables are meaningfully named. I haven't written any comments; I may write comments about why certain parts are used (but not what the code does) before submission.
I would structure it differently such that a noughts and crosses cell was able to hold a grid inside of it. Right now, there's 2 separate ways of making a grid and I feel that this could be made with less repetition using a recursive approach.
I've used cookies in react functions for the first time, and come across some hurdles to do with that and hydration.