I don't know for sure, but I don't like 18. 0-0 -- you're moving your king away from the center into a less active position in the endgame, while your opponent's king is on a more active square. That means you're automagically making yourself slightly worse.
Why not 18. Nd2, you're attacking the knight, forcing it to move, and allowing you to play f3 and e4 to use your pawns to control the center?
Once you've castled black has better development and more active pieces. His position is just easier to play.
Hello
Here is a game I recently played. I lost, but I am not sure where I went wrong.