I have similar moderation concerns in my browser game/engine but I only ban offensive slurs not swears, but I give no visual affordance that the word is not allowed
The only surface where players see the input content is in a share card, and if they finish a game and get to the share card they will find the offensive word has been REDACTED lol
So it’s a long feedback loop just to find out your hijinks lead nowhere