Update - final version ->
https://www.youtube.com/shorts/i4V9JtIhAysCoding this is beating my butt, lol. This is my 4th rewrite over the last few days. I'll test for a few days and then if I don't find anything wrong I'll dress it up a bit.
The active game is on the left and the game grid on the right is the state of the game prior to the computer's move (white).
https://youtu.be/P8OI2Bexx9c