Browser Mod Popup Transition

I’m wondering if any of you legends can point me in the right direction that will make the Browser Mod Popup fade in and out.
The yaml below does achieve the effect, but for devices with slower processing times you see a glimpse of the popup and then see it again fade in. From my very basic knowledge, the popup content is being rendered before the animation is applied. I guess my question is, how could that initial glimpse be prevented?

card_mod:
  style: |
    div.content {
      animation: fadeInPopup 2.5s ease forwards;
    }
    @keyframes fadeInPopup {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
    }

Thankyou in advance,
MC.