  Twisted bilayer graphene (TBG) is a recently discovered two-dimensional
superlattice structure which exhibits strongly-correlated quantum many-body
physics, including strange metallic behavior and unconventional
superconductivity. Most of TBG exotic properties are connected to the emergence
of a pair of isolated and topological flat electronic bands at the so-called
magic angle, $\theta \approx 1.05^{\circ}$, which are nevertheless very
fragile. In this work, we show that, by employing chiral optical cavities, the
topological flat bands can be stabilized away from the magic angle in an
interval of approximately $0.8^{\circ}<\theta<1.3^{\circ}$. As highlighted by a
simplified theoretical model, time reversal symmetry breaking (TRSB), induced
by the chiral nature of the cavity, plays a fundamental role in flattening the
isolated bands and gapping out the rest of the spectrum. Additionally, TRSB
suppresses the Berry curvature and induces a topological phase transition, with
a gap closing at the $\Gamma$ point, towards a band structure with two isolated
flat bands with Chern number equal to $0$. The efficiency of the cavity is
discussed as a function of the twisting angle, the light-matter coupling and
the optical cavity characteristic frequency. Our results demonstrate the
possibility of engineering flat bands in TBG using optical devices, extending
the onset of strongly-correlated topological electronic phases in moir\'e
superlattices to a wider range in the twisting angle.
