Geometrical optics of constrained Brownian excursion: from the KPZ scaling to dynamical phase transitions. (25th February 2019)