🔹 Card-mod - Add css styles to any lovelace card

I’m using for the first time this mod, and for me it’s the first time that I’m using the CSS (sorry if this is a trivial question).
I have a picture-entity used to show an image (Octoprint mpeg image).
The problem is that the camera is rotated of 180 degree, for this reason I need to rotate the image in the Home Assistant.
I’m able to apply the rotation directly in the picture-entity in this way:

   aspect_ratio: 50%
   camera_image: camera.octoprint
   #camera_view: live
   image: 'http://octopi.local/webcam/?action=snapshot'
   show_name: false
   show_state: false
   type: picture-entity
   style: |
     ha-card {
       transform: rotate(180deg);
     }

When I try to open the ha-dialog to show the live image (I think it’s a ‘more-info’ panel) the image shown is correctly in live but with the original rotation.

How I can rotate also the image shown in this panel?