After 18. f3 you're in more trouble, but you're lucky your opponent missed it. Your knight is pinned to your queen, and your opponent should of attacked the pinned piece. Luckily for you, 18. Be3 was about the dumbest move he could make
36. ... Ra4 cost you quite a lot, something like Rdd2 would of at least let you hang on for a while.