Andrew Fidel Fernando is ESPNcricinfo's Sri Lanka correspondent. He tweets here
Hashim Amla's return to the batting order initially appeared to be the tonic South Africa required to build their first imposing total in the series, but after his departure in the 23rd over, the visitors embarked on a collapse both Amla and AB de Villiers marked as the defining period of the fourth ODI.
Amla's 71-ball 77 had driven a brisk second-wicket stand that had taken South Africa to 110 for 1 after 20 overs, but South Africa succumbed to Sri Lanka's spinners, and managed no more than a mediocre 238. JP Duminy, who partnered Amla during that partnership, made 97, but could not find sustained support from the middle order.
"That period was the most disappointing thing about today," de Villiers said. "Hash (Hashim) set us up really well to go big, but I think the previous wicket played a bit on our minds. The middle order created more turn than there was. I think we were mentally a bit drained and we didn't support JP well enough. It was definitely, at the very least, a 260-score kind of wicket. Maybe 280, with our kind of batting line-up and the foundation we laid."
Amla had progressed with equal ease against Sri Lanka's fast bowlers and spinners, and looked set for a ton before Tillakaratne Dilshan had him lbw with a delivery that turned more than Amla expected. De Villiers departed in Dilshan's next over, and though Duminy managed a 46-run stand with Faf du Plessis, the team lost six wickets for 33 runs, making a competitive score almost impossible. South Africa had also used up their batting Powerplay by the 21st over, hitting the spin of Ajantha Mendis and Rangana Herath for 24 runs in the five overs.
"When Mendis was on in the Powerplay, everything was going quite smoothly," Amla said. "We were knocking the guys for about four or five an over. Unfortunately, I got out, and I think the momentum broke there. We then built up some momentum when we hit 170, but lost our way there as the wicket became a bit harder to bat on in the late afternoon for the new guys coming in."
Sri Lanka's three spinners bowled 29.4 overs in total and took seven wickets and South Africa's progress had slowed significantly against them in the middle overs, which contributed to the string of quick dismissals.
"I've got to take a bit of responsibility because I got out to Dilshan and the guys coming [in] were a bit more aware of him, trying not to lose their wickets," de Villiers said. "I feel that Dilshan's not a bad bowler, but you can dominate him if you get on top of him, and I was trying to get that going. Unfortunately, I got out playing my first attacking shot, and the rest of the guys following up were a bit circumspect about facing the spinners. Just as we'd get a partnership going, we'd lose another wicket."
De Villiers also said South Africa expected the pitch to become harder to bat on than it did, for the second innings. Both the visiting seam bowlers and spinners found the surface to their liking under lights on Friday, as they comfortably defended 223.The fresh pitch on Sunday appeared much more suited to batting however.
"Towards the later afternoon we were hoping for it to start turning and misbehaving a bit. When we bowled it skidded through and we didn't see the bounce that treated us so well in the previous game."
The match also marked a serious dip in South Africa's fielding standard, after the team produced their most polished performance of the series on Friday. Wayward throws and misfields allowed easy runs throughout the innings, but were particularly prevalent towards the end of the match - albeit after Sri Lanka had begun their final march to victory.
"I'm the kind of guy that likes to keep it professional right throughout the hundred overs, so the fielding was disappointing. In saying that, they were batting without any pressure there so they were always going to take the field on a bit more. The boys still tried their best and it's hard to keep your head in the game when they need to knock off 60 odd runs off 80 balls with eight or nine wickets at hand."