Sahej-sethi/Twixt ? reverse-engineered prompt

Reverse engineered prompt

Build me a terminal based Twixt game in C that feels fully playable in the shell.

I want a colored board, keyboard control with W A S D to move the cursor, Enter or Space to place a peg, and q to quit. The game should enforce the Twixt rules, so each player can only place on legal spots, can not use the other player’s goal lines, and can not place on occupied cells. When a peg is placed, it should automatically connect to matching pegs using the knight move style Twixt links, and it should stop links from crossing. The game also needs to detect a winner by searching the linked path, with Red winning top to bottom and Blue winning left to right. If someone wins, highlight the winning path and play a sound. Please make it work in a Linux terminal with raw input and ANSI colors, and keep the whole thing in a simple C project that I can compile and run from the command line.