  We study a Brownian excursion on the time interval $\left|t\right|\leq T$,
conditioned to stay above a moving wall $x_{0}\left(t\right)$ such that
$x_0\left(-T\right)=x_0\left(T\right)=0$, and
$x_{0}\left(\left|t\right|<T\right)>0$. For a whole class of moving walls,
typical fluctuations of the conditioned Brownian excursion are described by the
Ferrari-Spohn (FS) distribution and exhibit the Kardar-Parisi-Zhang (KPZ)
dynamic scaling exponents $1/3$ and $2/3$. Here we use the optimal fluctuation
method (OFM) to study atypical fluctuations, which turn out to be quite
different. The OFM provides their simple description in terms of optimal paths,
or rays, of the Brownian motion. We predict two singularities of the large
deviation function, which can be interpreted as dynamical phase transitions,
and they are typically of third order. Transitions of a fractional order can
also appear depending on the behavior of $x_{0}\left(t\right)$ in a close
vicinity of $t=\pm T$. Although the OFM does not describe typical fluctuations,
it faithfully reproduces the near tail of the FS distribution and therefore
captures the KPZ scaling. If the wall function $x_{0}\left(t\right)$ is not
parabolic near its maximum, typical fluctuations (which we probe in the near
tail) exhibit a more general scaling behavior with a continuous one-parameter
family of scaling exponents.
