The way we usually work around the button selected color is by adding a duplicate button block with the opposite accent colors and then applying opposite visibility settings to each button block.
I hope that makes sense
You can’t use JS in the CSS window