The thing that pains Sansa most about marrying Joffrey is not the sure knowledge that he will beat her and abuse her and make her life hell.
The thing that pains Sansa most about marrying Joffrey is that she is sure that Winterfell is lost to her as soon as he clasps the Baratheon cloak around her neck. Sansa knows in that moment that unless King's Landing falls, she will never see her family again.
Her wedding night is as brutal and painful as expected, but it was mercifully brief – Joffrey is stinking drunk only halfways through the feast, and he barely manages to bed her before he collapses into unconsciousness, snoring and belching while she slips out of bed and spends the night sitting on the window seat, wrapped in one of the silk robes Cersei gifted her with a malicious smile and trying not to weep.
He wakes in a rage, and of course takes it out on her.
Much as she hates Joffrey, Sansa cannot hate the child growing within her as her stomach starts to swell. She visits the godswood every day, using prayer as a respite from the sea of Lannisters who are the only companions that she is permitted. She is certain that Joffrey would keep her locked in their chambers, chained to their bed, if Cersei and Tyrion did not point out to him that the people would hate him for keeping their Queen from them.
He tries to keep the reports of the war from her, too, reports of Robb's victories, of the Kingslayer's capture, of Stannis Baratheon's sailing for the capital. She lives for the snippets of news she overhears, that and every sign of the child in her belly.
She thinks that she will go mad when she loses the babe five moons into her pregnancy. Joffrey has Meryn Trant beat her before the whole court, proclaiming it to be her fault, putting the blame firmly on her shoulders.
She is isolated from everyone then, confined to her solar away from the other women until the bruises on her face and neck fade, and it is during that time that her gooduncle begins to visit with her.
Joffrey manages to get another child on her not three months after her miscarriage, and she lives in constant fear of losing this child as well.
He takes the decision out of the gods' hands when Robb scours the Westerlands, making her the target of his frustrations and the Kingsguards' mailed fists. She bleeds before the court, and it is too late when Tyrion and Cersei come to the throne room – everything is lost to her. Her home, her family, her children.
People begin to whisper that it is not the Queen who is at fault but the King when her third child dies, the King's mistresses not least among them.
Tyrion Lannister is Sansa's most unlikely and most steadfast ally at court. Somewhere in the months since her marriage, she has begun to see him as a friend, and often he is the only person willing to brave the King's wrath and keep her company.
Joffrey becomes more and more ill-tempered with every passing day, and Sansa bears the brunt of his rages in split lips and bruises and, worst of all, two cracked ribs that make it hard for her to do anything but lie back in bed or on one of the soft couches in Tyrion's solar.
Joffrey sneers at her becoming close with his uncle, snarling horrible slurs in her ears as he forces her onto her hands and knees at night and fucks her raw. He whispers cruel insults to Tyrion, to her, to her family, and it is almost too much to bear.
She still has no child, and she is sure that Joffrey is to blame.
The Battle of the Blackwater proves one of the most terrifying days of her life. She has given up hope of ever seeing her family again and so can do no more than pray for those who still live and weep for those who are lost, and when Tyrion is said to lead a charge himself she is sure that she will choke on her fear, panic rising at the thought of losing the one person who shows her any kindness.
She plays the part of gentle Queen to perfection, maintaining the peace in the small hall while Cersei gets steadily more drunk and petulant, more like Joffrey than she would care to admit. Sansa soothes and gentles and offers words of encouragement to the more fearful ladies, not feeling her bruises and brokenness for the first time since she was named Queen.
She tends to Tyrion herself, willing her only friend to live. Joffrey and the rest belittle her for her efforts, but even Lord Tywin's icy gaze is not enough to make her abandon Tyrion in his hour of need.
The Tyrells' arrival at court makes Sansa uneasy, because there is something about the way pretty Lady Margaery watches her that she mislikes.
Joffrey still comes to her most nights, and his anger grows worse with every passing day. Sansa sees the way his eyes linger on Margaery Tyrell, the way he invites the Rose of Highgarden to sit by him at every meal and ignores his Queen.
Sansa accepts the insult with quiet grace and turns instead to Tyrion, and between them they find some sort of comfort.
Joffrey splits her cheek open with a vicious backhanded blow and a heavy ruby ring the day the Kingslayer returns to the city less a hand. He laughs and tells her that she matches her pet now, and Sansa feels more anger for the insult to Tyrion than for the ruin of her famed beauty.
She removes herself from court after that, and is surprised when Tyrion brings Jaime with him when he visits. She queries the Lord Commander of the Kingsguard guarding anyone other than the King, but Jaime laughs – she sees something alike in the brothers when they laugh – and assures her that the King wants the Kingslayer as much as he wants his Queen.
She feels safer with the Lannister brothers than she does with anyone else, because they are the only ones who speak out against Joffrey's cruel hands and crueller orders. Jaime forbids the Kingsguard from striking her, saying that he stood by as one mad king beat and raped his queen and he will not do it again. Tyrion reminds Joffrey that Sansa is his queen, that the people will despise him for hurting her, and for a time she has a respite.
Jaime tells her that Robb married a Frey of the Crossing and that he plans on sweeping south as soon as he takes the Westerlands. She says that as a Lannister of Casterly Rock, Jaime should have more faith in his bannermen, and he laughs and tells her that the Northmen are considerably more formidable than any Westerman he's met save his father.
The whole of court sees the way the Kingsguard is split, some in thrall to the Dowager Queen, the Knight of Flowers still loyal first the Highgarden, the Kingslayer at the Queen's shoulder and watching the King with hard eyes, the Hound with the King but staring longingly after the Queen.
Sansa says nothing, merely smiles as best she can with her ruined cheek and lets Jaime and Tyrion escort her to her chambers when dinner is over. Joffrey is too busy staring down Margaery Tyrell's gown to care that she's gone.
When Joffrey begins half-seriously japing about taking a second queen as the Targaryens of old did, Sansa knows that she must produce an heir or her life will be forfeit. Joffrey's seed will not quicken in her womb – in any woman's womb – but she needs to produce a Lannister-looking child as soon as she can, and that means one thing and one thing only.
She must find a willing Lannister who she can trust not to tell the King – or worse, the Dowager Queen – of her plan.
There are only two Lannisters that she trusts, of course. Jaime is the obvious choice, Joffrey's father as he is, tall and handsome as he is, but she cannot bear the thought of lying with him, knowing that he has lain with his twin, that he sired children on his sister.
So Tyrion, then. She broaches the subject over a game of cyvasse one afternoon while carrying a broken wrist, startling Tyrion so much that he chokes on his wine, surprising Jaime so much that he laughs for what seems like hours.
When they realise that she is serious, that she is doing this to try and guarantee her survival, they begin to plan.
It happens while Joffrey is with one of his mistresses. Nobody questions Tyrion's presence in Sansa's rooms, and Jaime promises to keep Cersei distracted to reduce their chances of being caught.
Sansa weeps when they are finished, and he apologises before she can explain that she weeps only because the gentleness he exhibited is something she thought lost to her.
Even Joffrey does not dare strike her as she swells with child this time, but he is furious when the babe is born with a ruddy tinge to his blonde hair and bright blue eyes. His eyes shift to a queer pale golden-green, and Cersei comments that once he grows out of the red in his hair, little Tygett will be the image of his great-grandsire.
Sansa keeps her eyes on her son's face, refusing to meet Tyrion's gaze for fear that one of them will laugh at the secret knowledge that the King on the Iron Throne is once more a cuckold.
Sansa's second lion cub is born by the time the dragons land in Westeros. Stannis Baratheon dies in a hail of fire, and Robb allies himself with the Targaryens. She nurses Lya and watches Tyrion and Jaime play with Tyg, daring to hope for the first time in too long.
If Robb and the Targaryens win, her children will be safe from Joffrey and she will get to go home. She will speak with Robb, will plead for Tyrion's life and Jaime's. They alone have been good to her since her marriage, and she will do everything she can to get them through this alive.
King's Landing burns, but the Red Keep endures. The Kingsguard fall one by one, and soon there is only the royal family and the Kingslayer with his golden hand against the combined forces of direwolves and dragons.
Jaime dies to protect them, and Sansa is sure that she will die with the rest of them when a man with the giant of House Umber on his breastplate raises his sword over her head.
Robb shouts her name then, and she clutches her children to her and sobs as her brother kneels and wraps his arms around her, chanting Sansa Sansa Sansa like a prayer.
Joffrey is executed with only a cursory trial, Cersei and Tywin as well, and Sansa watches from her mother's side through all. It is only when Tyrion is brought forward in shackles that she reacts.
Aegon Targaryen is on the Iron Throne, Daenerys in a newly forged and complimentary throne at his side, Robb on a lower seat as King in the North, and all three are looking down on Tyrion with disgust in their eyes. She knows that they will sentence him to die if nobody challenges them. She waits until Aegon calls for anyone who will speak for Tyrion, stunning everyone when she rises from her seat.
She looks to Tyrion when they will not listen to her, and he nods grimly in assent.
The entire assembly goes silent when she tells them that Tyrion saved her life by fathering her children, and that she will gladly marry him if that is what it takes to save him.
Sansa and Tyrion do marry in the end, but it is in the godswood at Winterfell rather than in the Great Sept of Baelor. Tyrion somehow convinces Robb that he would be an excellent master of the coin – Sansa suspects that shitting gold came into it somewhere – and they remain at Winterfell.
Arya returns to them after little Ned and Cat are born, and she seems hugely amused that Sansa has found happiness with the infamous Imp of Casterly Rock.
Sansa just smiles over Arya's shoulder to Tyrion, and she thinks that perhaps not all heroes are tall and fair of face.