I'm searching for an animated movie that was apparently intended for children (it was used as some sort of moral movie back in the early 90s) but it was clearly a horror movie, and very dark and serious for being aimed at children - and it had a pretty unique style, almost like a calm nightmare.
Anyway, I only remember fragments but one very prominent character was an ugly-looking judge who interrogated a group of children early in the movie, and they were... imprisoned, I think, but I'm not sure... and the judge had a horrific laugh, and everytime he laughed a skull on his table would also start laughing.
I also remember that one of the children (a girl) was blindfolded in a building and forced to find his boyfriend among the other children, and if she failed they would all die, or something like that.
Then the house was set on fire, and the judge died in the flames.

What movie is this?
I have done all kinds of searches on Google on different occasions for literally years and never found anything.