Long story short, Yuyuko was in two previous games, both murder mysteries. Firstly was blankstate, with a Mafia-styled premise based around guilt. Secondly was cravencastle, which was more traditionally-based with conscious killers and tailored executions.
Primarily in Blank State, the killers were possessed by evil entities that fed off their unresolved guilt and committed murders. At first, no one knew why they were there, and their "host" had them solve these murders via a storytelling proxy based on the guilt in their hearts. Fortunately, Yuyuko was never possessed nor murdered by these spirits. Unfortunately, her closest canonmate Youmu Konpaku was mistakenly executed in the second trial, believing herself to be the guilty party for "allowing" Yuyuko to endanger her own life in canon. Although Maya Fey was able to channel Youmu's spirit and reveal that the dead were still sort of around them, talking to Youmu did jack squat to alleviate her feelings of helplessness. The guilt of believing she had let Youmu die by not arguing her case better was a guilt she carried with her for the rest of the game. That, combined with her life as a human were used as character frameworks to pin her as suspects two different cases. Although she had kept it hidden for obvious reasons, her nature as a suspect forced her to reveal her living days and subsequent death to the game as a whole. Naturally, this left her distraught as get-all.
Though they managed to save a good number of the possessed by erasing their guilt, this ended up hurting them in the end, because the cat revealed that they had all been transported into his domain for a chance at saving their lives--three more people needed to die for any of them to be able to go home. Although Yuyuko aimed to stay alive for the sake of having the Saigyou Ayakashi sealed up again, her good will and desire to save Maya's life bit her in the ass, and she ended up getting killed in an overpowered three-way fight to the death with Kouha Ren (who was being channeled by Maya) and Kaoru Nagumo.
Ultimately, though, she and Youmu achieved their somewhat-happy endings. After some bargaining with the cat, the living players banded together to rescue the dead, giving them a small chance at saving themselves once again. Yuyuko, in particular, was rescued by Kaoru from the Saigyou Ayakashi tree, ironic considering he was the most responsible for her earlier death. Despite having a significantly reduced chance at saving their lives, she and Youmu set out for Gensokyo again with hope in their hearts.
....which would be all fine and dandy, if she didn't get kidnapped on the way home and stuck in a televised murder mystery game. All of Yuyuko's memories of Blank State as well as a good deal of her canon ones were temporarily locked away (though she regained them after her death). On the flip side of things, she herself was the victim of the fifth week, having her powers canceled mid-flight and crashing to the ground. In a bout of the most ridiculous irony ever, it was because of her kind nature and desire to save the life of Maya yet again.
Yuyuko has since made her peace with the going-ons at Blank State, though she is still somewhat bitter towards her killer (Phoenix Wright) for murdering her in such an underhanded manner, and outright using Mei as bait. She holds no such hostility towards Kouha and Kaoru, as it was both a combat death fought fairly and things worked out in the end regardless. Despite Maya inadvertently "killing" her in both instances, she still fairly likes her and holds no ill will towards her. Although Maya was able to capitalize off of her second death by retiring from the game, Yuyuko is merely happy that she actually did save her this time, albeit in a roundabout way. She and Austria also mutually apologized, as they came to see each other's point of view on the situation regarding Youmu. As Austria was the true culprit and let Youmu take the fall for her, Yuyuko was understandably angry with her when they met in the graveyard--as even though Yuyuko assisted in taking down her possessed body, she was still responsible for Youmu's death in a way. Nevertheless, they ended things on a peaceful note.
Notably, she was also close with Mei Misaki and (sort of) Kaoru. Mei was her closest friend in the castle, the two having stuck together after a temporary bout of hopelessness on Mei's part. Yuyuko was privy to the details of Mei's history that she otherwise kept locked away, and vice versa. Despite the clashing personalities, she enjoyed the girl's company--though this was used against her in her murder. As Mei had been non-lethally poisoned in order to draw Yuyuko away from the crowd, she directly witnessed Yuyuko's death and felt semi-responsible for it. Unable to do anything from her position in the graveyard, Yuyuko focused most of her frustration on beating up Phoenix. Hooray...? As per Kaoru, they were "closer" in Blank State than in the castle, but she still took amusement out of bothering him. That's really the core of it--he gave her the reactions she liked, and so she kept subtlety prodding him, even after he revealed himself to be a human-hating genocidal maniac. Which, directly speaking, is the type of person Yuyuko is least likely to get along with. Nevertheless, he did save her from the wrath of Murdertree, so she still rather likes him and believes she owes him some sort of favor. Ye Olden Times gotta stick together, or something like that. Surprisingly, her relationship with Youmu didn't change much in-game.
Overall, Yuyuko is extremely homesick and still a bit bitter over her more recent murder. As a note, the game is likely ending some time next month, and I plan on updating her memories for closure's sake.
Yuyuko Saigyouji | Touhou Project | expired reserve