In truth the Emperor was a figurehead long before the first Shogunate was established in 1185 due to the fact that starting over 200 years prior, the Fujiwara clan had privatised most government functions and political power in Japan and what functions still existed were more or less the hereditary purview of a few branches of the Fujiwara clan. Only the fact that the Fujiwara themselves became incredibly divided stopped them from being a serious force. At times the Retired Emperors held serious power since their office let them avoid the Fujiwara clan's institutions, but this didn't always occur and eventually they too lost authority.
As noted, the Kenmu Restoration is one exception, but the lesser known exception is Retired Emperor Go-Toba and his Joukyuu War of 1219-21. This was possible because the bulk of the Shogunate's institutions were set up in Eastern Japan (i.e. not near Kyoto) and the leading clans of the Shogunate had been clashing. The Retired Emperor had a private army of several thousand warriors, plus summoned tens of thousands more to his banner (including warrior monks) and posed a serious challenge to Kamakura's authority. Unlike the Kenmu Restoration which wanted a Chinese-style Imperial court (with residual Shogunate institutions and strong Buddhist temples to account for the reality of the situation), Go-Toba seems to have desired more oversight in the Shogunate since it doesn't seem he had a problem with the institution in of itself.
I will note that it is entirely incorrect to say that the Imperial Court held no power in the early Shogunate. They collected vast revenues from public lands in provinces, to whom they named the officials in charge of governing (although many actual governor titles became nothing but sinecures), they provided the heads of Japan's religious institutions which controlled armies of warrior monks and received vast amounts of donations in land and practical goods. The court controlled the guilds who managed practically everything about the economy due to the fact guilds required powerful legal protectors (and also that court nobles and the Imperial Court itself were major clients of said guilds). Courtiers maintained ownership and control of most all land in Japan, since the land stewards (
jito) that the Minamoto appointed were simply overseers. While the latter gradually assumed greater and greater authority over their land, the court still had enough power that they could make favourable arrangements with them or even have them removed via complaints to the Shogunate.
As for how they exercised power, Imperial Regent Kujou Michiie also made an attempt in tandem with the Miura clan of warriors to gain power in the Shogunate by successively naming his relatives to the office of Shogun during the 1240s. This was a period before the Houjou clan really established their grip on the Shogunate, and the arrangement theoretically could keep the leading warrior clans all roughly equal. But the Miura were fearful to go up against the other clans and in the end the Houjou clan mostly destroyed them and their allies in 1247.
I think destroying the Shogunate is a very, very hard challenge since it's simply too useful as a governing body for warriors--both Kujou and Go-Toba recognised this and didn't want to abolish it. The closest thing was the Kenmu Restoration which transferred most functions of the Shogunate to the court's oversight (including bringing in warrior elites like the Nitta and Kusunoki clans ), but they still created two autonomous regional shogunates in the Kanto and Tohoku which maintained most all of Kamakura's offices. The Kenmu Restoration also had a heavy Buddhist component, since Emperor Go-Daigo was quite devout, relied on Buddhist monks as advisors, and correctly recognised that Buddhist institutions could balance the warrior class due to having both their own armies and the fact he placed loyal imperial princes in strategic places in the Buddhist hierarchy.
As
@EasternRomanEmpire mentioned, their role was primarily spiritual and cultural during the Shogunate period.
I think that's only fair to say after 1400 or so when the Ashikaga Shogunate's taxation and land policies were in full swing. Those undermined the economic basis of the court and made them wholly dependent on the warrior class. The Ashikaga Shogunate and their elite also loved taking court offices for themselves like the Shogun becoming Grand Chancellor. Further, they governed Kyoto far more directly than the Kamakura Shogunate ever did so the court lost the one place they more or less directly governed (i.e. before the Ashikaga Shogunate the court had their own paramilitary police force which ran its own court that had national jurisdiction over pretty much everyone besides monks and warrior nobles even if in practice it was limited to Kyoto).
Without income, traditional sources of court power like the temples turned away from them. It didn't help that in this era, traditional sects of Buddhism were not as popular as the sects of Buddhism that arose during the Kamakura period like Nichiren, Jodo Shinshu, etc. and were associated with warriors, merchants, or peasants instead of wealthy courtiers.