Stories like Clannad or Your Lie in April utilize the school setting to remind us that this time in our lives is temporary. The characters are acutely aware that they are in a "golden time" that will soon end. This creates a bittersweet undercurrent that makes the emotional highs higher and the lows more crushing.
The claustrophobic design of Japanese schools—long uniform hallways, lockers, and multi-story layouts—makes them perfect maps for survival horror. gakko no monogatari - school story