ATLANTA — The Phillies came here with slim postseason chances, but this — a line drive that bounced off of Eddie Rosario’s glove in the ninth inning — seemed like the break they needed to begin a week when almost everything has to go their way in order to finally return to the playoffs.

The lineup limped through the first eight innings of a 2-1 loss to the Braves on Tuesday night, but they had runners on second and third after Matt Vierling’s 105.7-mph liner was fumbled in left. Down to their final two outs, the Phillies had life.

Yet the game — and perhaps the season — was soon finished.

Atlanta intentionally walked Andrew McCutchen to face Didi Gregorius, who drove in a run with a sacrifice fly before Freddy Galvis struck out to end it. The run was unearned, representing the lone run the Phillies have scored in their last 21 innings.

“You think you have a shot. You think that you got the break that you needed,” manager Joe Girardi said. “Unfortunately, we weren’t able to finish it.”

The loss, which ruled the Phillies out of the wild-card race, did not eliminate them from the postseason, but it sure made it difficult to see playoff baseball returning to South Philly for the first time in 10 years.

“We have to win out. I think that’s pretty much it,” Brad Miller said. “I think it’s cut-and-dry. We take care of business and win out and kind of see what happens, but that’s really all we can do.”

» READ MORE: Alec Bohm returns to the Phillies as a bench player for the season’s final week

Atlanta’s magic number is down to just three and the Braves will have Max Fried — one of baseball’s premier pitchers in the second half — on the mound Wednesday night against a lineup that struggles against left-handed pitching.

The Phillies trail Atlanta by 3½ games with five remaining as they had to sweep the Braves to control their postseason fate. The Braves can clinch their fourth straight division title by winning the next two nights.

“We almost pulled it out,” Zack Wheeler said. “We had the right situation going, but we just didn’t come through in the clutch right there. We were battling and never stopped. That’s all you can ask.”

If the Phillies win at least one of the next two, their postseason hopes will hinge on the Mets outplaying the Braves this weekend while the Phillies play in Miami. It’s a tough road.

“You just have to keep grinding. That’s all you can do. I know I say it. You have to find a way to win tomorrow. Then we have to go from there,” Girardi said. “Obviously, we need some help now. We have to go out and play a good game. We need a good game out of [Aaron] Nola and we need to score some runs.”

Wheeler’s night

Wheeler allowed just two runs in seven innings, but that was too much for the offense to overcome.

Jorge Soler tagged Wheeler for a two-run double in the third as he lined his inside sinker to left. Travis d’Arnaud started the inning by also doubling on an inside sinker, which was a pitch Wheeler wished he could have back.

“Right when I was going to start my motion, I saw him take a little shuffle backwards like he was expecting that two-seamer in,” Wheeler said. “I should’ve just stepped off like I wanted to, but I didn’t. He was looking for it and he hit it well.”

Wheeler, who threw 93 pitches, leads the majors in innings pitched with 213⅓, so it will be interesting to see if he pitches Sunday’s season finale in Miami if the team is eliminated by then from the postseason.

It could be a way to start Wheeler’s offseason early after a heavy workload, but it would also be his last chance to finalize his Cy Young case. He leads the majors in strikeouts (247) and his ERA (2.78) ranks fifth in the NL.

“I think Zack pitched his butt off, too‚” Miller said after Wheeler’s record dropped to 14-10. “I wish we could have gotten something for him. A guy like that shouldn’t have 10 losses to his name. It’s not on him.”

It’s going to take a lot for the Phillies to remain in contention by Sunday, which could leave them with a decision to make on Wheeler.

“If I’m pitching that meaningful game on Sunday, that means we’re doing something right,” Wheeler said. “We need to get there first and win these next two games and go into Miami strong.”

No extra-base hits

Charlie Morton was tough as he struck out 10 in seven innings, but the Phillies did have their chances. The first two batters — Odubel Herrera and Jean Segura — started the first inning with singles before the rally fizzled.

Bryce Harper, J.T. Realmuto, and Miller went down on nine pitches and the Phillies limped until the ninth inning. They had runners on first and second with two outs in the fourth, but that too fell flat.

“It’s baseball,” Miller said. “I don’t think tonight we did anything egregious as far as having terrible plate appearances. I can think of some balls hit pretty hard at people. It seemed like that happened. But, yeah, offense is going to be more up and down than any other portion of the game. Just looking at tonight, I don’t think there was anything crazy. There were two really good pitchers on the mound.”

The Phillies had just three hits, all of which were singles. Their lineup has just three extra-base hits — two of which are solo homers — in their last three games. Before that, the Phillies had averaged 6.1 runs per game with 71 extra-base hits over a 10-game span that saw them go 8-2.

The offense looked strong against teams like the Cubs and Orioles, but the competition stiffened Tuesday in Atlanta. The Phillies, needing their lineup to stay hot to chase down a playoff berth, seem to be running on fumes.

“I don’t think it’s run out of gas,” Girardi said. “I don’t think you would have seen the at-bats that you saw at the end. I think Charlie Morton was really good. I think Wheeler was really good. I think Charlie’s fastball/sinker combination with his curveball was really tough on our hitters. We had a chance in the first inning and we weren’t able to score. Then we didn’t really do much after that off of him.”