Temp can be a huge factor... you were cold apparently. What was your cadence? I get the impression that you were mashing a bit, "
'pop up over a rise in the big ring'. "
How's your fit? What other aches & pains?
I've done centuries where I spin it the first 50 and am very fresh for the last 50, fresh enough to easily extend another 20+.
Not enough base miles from what you describe. I ride 100-150 per week, which isn't a lot by many measures but, I divide that among 3-4 rides of 30-60 miles in length. My hill repeats ride is in the 50 mile mark for 6k feet.
Generally I can do a century once a week if I feel like it. On another note I understand that easy chairs and the like aren't the best thing for overall posture, that's what my doctor and a few PT types have mentioned.
So a few things... not dressed right, maybe mashing, and not enough consistent base miles. Personally I believe a great many folks overdo it with the electrolyte supplementation. I'm not sure but I understand that overhydration can flush the body of needed electrolytes. I find the key to hydration is always ensuring through the daily norms of life that you are always properly hydrated, without having to piss like a racehorse.
I ride with water and a variety of normal foods, kind bars, I love French apricots, pound cake..

...I do carry endurolyte tabs in the heat, pretty innocuous for me. Other than that nothing fancy.