Solar and stellar flares represent a transdisciplinary topic, covering the branches of solar physics, stellar astrophysics, space weather and planetary and exo-planetary research. Moreover, a recent discovery of the so-called superflares by the Kyoto University team had opened new frontiers in this discipline, both from the astrophysical as well as practical points of view. The principal aim of my visit to Kyoto University (Graduate School of Science) was to bring my expertise in the non-LTE (i.e. departures from Local Thermodynamic Equilibrium) radiative-transfer modeling of solar and stellar flares to group of Prof. K. Shibata and conduct, in a close collaboration with his team, a new research on modeling spectra of solar and stellar flares. We focused on three topics: white-light emission of stellar superflares, MgII line asymmetries observed in solar flares by IRIS satellite, and coupled hydrodynamical and radiative-transfer modeling of evolving flare atmospheres. The latter theoretical topic has a close relation to the second one which is more observational. Concerning superflares, we have proposed a new idea how to interpret the white-light emission from superflares observed by Kepler satellite. Our new scenario takes into account the presence of extended flare loops presumably overlying large areas over the stellar disk and substantially contributing to the whitelight emission during superflares. The respective paper is now accepted in The Astrophysical Journal (USA). The idea of big loops may change the current paradigm of understanding the stellar flare, and namely superflare white-light emission and will be extended also to spectral lines.