
A scary endgame; what went wrong in the middlegame?

I really don't know much about open Sicilians so I really can't help you there, but it looks like some important tactics were missed later on. No matter whether your opponent promotes the g-pawn or the h-pawn on move 56, you have 57.Qc6# making matters easy.
Also, I believe your opponent had 37...Rb4+ although it's tricky. 38.Kxb4 e1(Q)+ 39.Kc4 (39.Ka2 Qe6+ 40.K(any) Qc6) 39...Qe8 (threat Qc6+ picking up the pawn) 40.Kc5 Qd7 and he stops the pawn.
I really don't know much about open Sicilians so I really can't help you there, but it looks like some important tactics were missed later on. No matter whether your opponent promotes the g-pawn or the h-pawn on move 56, you have 57.Qc6# making matters easy.
Also, I believe your opponent had 37...Rb4+ although it's tricky. 38.Kxb4 e1(Q)+ 39.Kc4 (39.Ka2 Qe6+ 40.K(any) Qc6) 39...Qe8 (threat Qc6+ picking up the pawn) 40.Kc5 Qd7 and he stops the pawn.
Yes, now I feel like a fool for not getting Qc6#. Oh well. How on earth could I have missed that?
Do you mean 32...Rb4+ ? I suppose he could have done that, and probably quite easily have won the game. Thanks for doing some analysis for me. I just can't believe I got out of this game a win with so many blunders.
And something else I noticed, after I got the computer analysis, is that anytime after the 52nd move and before h3, I could have played Ng1, and halted any kind of kingside progress. I didn't realize how many opportunity we both had that we missed 
@Blackadder Thanks! I read all of it. Good advice to know. I didn't really notice Rd4 instead. Rd3 would've also sorted out the pawn structure, though.
Gotta look out for things like Qc6# when the knight is covering the queen's blind spots and the king is covering the queen. Could've costed me half a point if he went into hard-to-mate territory after that.