How to apply transition to an overlay?

I have a container that I’ve set up so there is a small transform and an overlay color that happens when hovering using the hover state. I applied in the css section under the section ‘Transition’ for the container ‘all 0.6s’

The transform responds to the transition time, but the overlay doesn’t. How can I make the Overlay respond too?

I asked ChatGPT which gave me this, but it’s not working:

%root% .overlay{
transition:
background-color: 5s;
}

Any ideas anyone?