KANSAS CITY, Mo. —Royals designated hitter Brandon Moss knew the ball would clear the right-center field wall at Kauffman Stadium as soon as he brought his bat down.

He’d relentlessly fought for it. Throughout a nine-pitch at-bat, he took pitches in the dirt and fouled off a pair of pitches up and away from him.

Then it came to Moss. A 94 mph fastball, in the center of the zone. And the moment he connected with White Sox starter Dylan Covey’s offering, he knew. Moss whaled on it, burying a 430-foot blast in the Pepsi Porch for the fourth grand slam of his career.

The early strike wound up being the difference-maker in an otherwise quiet afternoon for the Royals’ offense, which mustered only four hits in Tuesday’s 4-3 win.

“(I was looking for) anything to hit a grand slam on, honestly,” Moss said.

In a way, Moss found what he’d been looking for all season. He’d struggled to put good at-bats together for so long, plummeting below the Mendoza Line in a first half that saw him bat .193 with 68 strikeouts.

Moss hit .260 (13 for 50) after the All-Star break, but he fell right back off in August. By the end of the month, he’d only raised his season average eight points to .201. He was still striking out in more than 30 percent of his plate appearances (through August, Moss had struck out 107 times in 319 appearances).

The damage seemed irreversible. Moss started to feel better at the plate, he said, but the results weren’t there.

Until his last three games here in Kansas City, where he hit 6 for 9 with a home run in each of them.

“The past few days, having good results on the swings I’ve taken, that really helps,” Moss said. “Because when you go up to the plate and you feel like you have to hit it over the fence to get a hit is not a very good feeling. But when you hit some balls hard and they’re hits, you feel a lot more confident.”

After a season of mediocre production from his spot in the lineup — Royals designated hitters entered the day with 54 RBIs and a team-worst .205 average — Moss might finally be on the brink of emerging from that black hole.

Which could inject some life into an offense that on Tuesday struggled to solve Covey. While Moss spoiled offspeed pitches and baited the White Sox rookie into throwing him cutters, the rest of the lineup struggled to figure Covey out until Eric Hosmer slid into second base with a double in the sixth inning for the Royals’ second hit of the afternoon.

The Royals never cashed in. Hosmer was caught off the bag when Salvador Perez flew out to the shortstop.

Alcides Escobar led off the seventh with a ground-rule double against Danny Farquhar, but the White Sox reliever retired the next three batters and stranded Escobar.

“Mossie provided all we needed,” manager Ned Yost said.

It almost wasn’t enough. Royals reliever Scott Alexander, who’s been part of Yost’s closer committee, allowed the White Sox to put runners on the corners when the first two batters singled in the ninth inning.

But Alexander struck out Yoan Moncada, induced a pop-up to shallow right field and got a force-out at second base, recording his fourth save of the year.

It was Alexander’s first three-out save. His previous opportunities were clean-up attempts, necessitated by struggles from both Kelvin Herrera and Brandon Maurer, where he only needed to get one out.

“My thought process today was I was going to stay away from Alexander. He’s running on fumes, and we got in that spot that was kind of tailor-made for him,” Yost said. “And you could tell he was really struggling with his command, but he made big pitches when he needed to.”

For a second outing in a row, Sam Gaviglio made a solid start for the Royals. He didn’t make it past the fifth inning — then again, the last Royals starter to log seven or more innings was Danny Duffy, who lasted seven on July 31 — but he did weave himself out of trouble throughout a seven-hit, five-inning performance. The White Sox (57-87) only managed to score two runs and stranded five in the process.

And the Royals (72-72) returned to .500, two days before they would start a 10-game, four-city road trip with an opening stop in Cleveland against the streaking Indians.

They gained a half-game in the American League wild-card race and climbed to 2 1/2 games behind the Minnesota Twins, who were scheduled to play the San Diego Padres later in the evening.

“That’s the world we live in right now,” Yost said. “That’s just the way it is.”