This is, 凉宫春日の逆转, AKA what would have happened if Ace attorney was made with Haruhi as the greatest lawyer ever.
The short doujin game follows 3 separate events in which Haruhi has to use her detective and reasoning skills to solve a crime. The first event is when Mikuru’s maid outfit was stolen and Kyon was blamed; the second event is when Mikuru loses her memories of an afternoon and everyone tries to find out what happened; and the last event is when Haruhi was seen with cigarettes and the student body president wants to find her guilty for smoking on campus.
Needless to say this is endlessly interesting, with the story progressing as you question witnesses and collect evidence. The game makers even ripped voices from the anime with Haruhi saying “I’ve got it!” and “Objection!”. The music is very well done, some of which are remixes of anime tracks. Now, excuse me as I stop writing this post. I still haven’t found out how Haruhi is going to get out of trouble with the cigarettes!