WIMBLEDON, England — When Coco Gauff’s final forehand sailed wide, sealing her fourth-round loss to former world No. 1 Simona Halep on Monday at the All England Club, it was tempting to declare the 15-year-old’s fairy tale had come to an end.

Still in high school and not yet old enough to drive, Gauff had enchanted fans and won legions of admirers in her storybook Wimbledon debut, vanquishing her heroine, Venus Williams, in the first round and weathering two match points against another tour veteran to reach the final 16 of the world’s most prestigious tennis tournament.

But as Gauff bowed out Monday, falling, 6-3, 6-3, it was clear that her overnight emergence as the sport’s brightest young star wasn’t the result of magic. Gauff’s achievements at Wimbledon — winning three qualifying matches followed by three matches in the 128-player main draw — were the result of years of hard work, a fighting spirit that can’t be coached and an inner drive to learn from her losses and dwell only lightly on success.

All that — combined with Gauff’s dynamism, big strokes and serve (which will only get bigger as she grows) and poise beyond her years — turned the world’s 313th-ranked player into a sensation at Wimbledon.

On Friday, fans with grounds passes jammed onto what’s known as Henman Hill to watch her three-set, come-from-behind, third-round victory on the giant outdoor screen, prompting one British tabloid to declare “Coco-mania” had taken over the All England Club.

In one week, Gauff’s Instagram followers rocketed from 20,000 to 352,000, and shout-outs from celebrities poured in — including two from former first lady Michelle Obama, the teen’s longtime role model.

Coco-mania was rampant Monday as well, with crowds returning to the grassy hill to watch her take on Halep, her first seeded opponent. Even Judy Murray, mother of tennis-playing professionals Andy and Jamie, posted a photo of her niece beaming alongside Gauff. Wrote Murray: “When you bring your teen niece to Wimbledon to watch her cousins, and all she wants to do is meet @Cocogauff #Rolemodel.”

Halep, a tenacious defender with a strong return-of-serve, represented a challenge of a higher order. For stretches, Gauff had the 2018 French Open champion on the run. And she didn’t shrink from the fight, breaking back immediately after losing her serve early in both sets.

She never telegraphed fear or panic, and most of her 29 unforced errors (to Halep’s 14) were the result of over-hitting rather than seizing up with nerves.

Asked after the loss what she hoped her new fans had learned about her at Wimbledon, Gauff said: “That I’m a fighter. I’ll never give up. And I hope they learned from me that anything is possible if you work hard. Just continue to dream big.”

Tennis has seen plenty of teen phenoms shine brightly over recent decades only to burn out quickly. The relatively brief career of the previous 15-year-old to reach Wimbledon’s fourth round, Jennifer Capriati in 1991, is among the cautionary tales.

Gauff, however, shows signs of a lengthy career.

She understands the peril of getting “a big head,” she explained last week, and she’s being careful not to let that happen. While she hates to lose, she looks for lessons in each loss, noting, “You have to experience down moments to experience a high.”

In addition to the skill and maturity she already has, working in her favor are other factors, starting with parents who, by all accounts, have given her a solid foundation and guided her progression with care.

Gauff acknowledged that it was difficult to reset after beating Williams in her opening match, confessing she was “kind of star-struck” by the celebrity attention. But her time in the clouds was brief. Keep yourself grounded, her parents advised.

After each round, she and her coach identified aspects of her game that needed improving. She drilled slice backhands, worked on her return game to counter big servers and thought a lot about maintaining calm and professionalism on court.

Gauff is managed by respected agent Tony Godsick, who represented Monica Seles, Lindsay Davenport and Anna Kournikova when they emerged as promising youngsters decades ago. Today, Godsick’s primary client and business partner is Roger Federer. His wife is ESPN analyst and Fed Cup captain Mary Joe Fernandez, who was a teenage phenom in the 1980s, reaching the quarterfinals of the French Open at 14.

Last week, Gauff credited Fernandez with helping her negotiate the pressure and demands that are coming at her fast.

Fernandez was 14 when she played her idol, Chris Evert, for the first time at Wimbledon. So she understood why Gauff was “over the moon” to face Williams, and they talked it over in advance.

“She was so excited to play Venus, but she knew she could win,” Fernandez said. “That’s something that’s impressive at that age — to play your idol and hold your nerve the way she did at the end of the match.”

Tracy Austin, another former tennis prodigy, voiced a similar view about Gauff’s potential while commentating the Gauff-Halep match for the BBC.

“It’s just beginning for Coco,” Austin said. “Coco has all the ingredients to be a future Grand Slam champion.”

Read more from The Post:

The U.S. women didn’t wait for their moment. They demanded it, and that’s what real power is.

After a World Cup victory like no other, one chant stands out for the U.S. women: ‘Equal pay!’

U.S. wins World Cup with a final four-star performance

Rapinoe caps spectacular World Cup with game-winning goal, claims Golden Boot