Sri Lanka's 78-run defeat against South Africa leaves them on the brink of being eliminated from the Champions Trophy, but all isn't lost for them yet. Since they have played all three matches in the group, the situation isn't in their hands any more, but if other results pan out well, Sri Lanka might still make it to the semi-finals.
For that to happen, though, Pakistan will need to win both their remaining matches, which will put them on top of the group with six points, leaving New Zealand, South Africa and Sri Lanka with one win each. In such a case, the net run rate will decide which team joins Pakistan in the semi-finals.
Currently, Sri Lanka's NRR of -0.195 is below that of South Africa (-0.090) and New Zealand (0.414). For them to make it, Sri Lanka will have to hope that Pakistan demolish South Africa and New Zealand by big enough margins to make their NRR drop below Sri Lanka's.
In fact, South Africa's NRR is so marginally above Sri Lanka's that even a narrow defeat against Pakistan will be a huge setback - if, for example, Pakistan score 250 and South Africa lose by 30 runs, their NRR will still drop to -0.26.
For Sri Lanka to beat New Zealand's NRR, though, they'll need greater help from Pakistan. If Pakistan manage 250, they will have to restrict New Zealand to less than 189 for Sri Lanka to get through. Considering the way batsmen have struggled in this tournament, such a margin of defeat can hardly be ruled out. It's not the ideal situation for Mahela Jayawardene and his team, but it's hardly time yet to pack their bags and head home.