North Carolina state Sen. Rick Horner is pointing at a colorful computer screen.

A staffer points and clicks, points and clicks, slightly changing the dimensions of the red, yellow and cyan jigsaw puzzle at Horner's request.

It's a map of the voting districts of North Carolina. Horner, a Republican, is shaping democracy — and generally having a ball.

"It's like a video game!" the senator exclaims, as another chunk of voters moves into the swath that he represents, North Carolina's 11th Senate District. He's moving the voters in an effort to make the district as compact as possible.

"It is sort of like a video game," the staffer laughs as he moves the mouse, "but with much larger consequences."

Horner, along with the rest of North Carolina's legislature, has spent the past two weeks in the midst of a massive undertaking: remaking the state's House and Senate districts after a three-judge panel in state court unanimously found that the previous maps were unconstitutional.

The court order said the old maps violated citizens' right to fair elections, because Republicans, who control the state legislature, drew them for explicit partisan gain. In 2018, the maps helped Republicans win 58% of seats in the state Senate and 54% of seats in the House, despite receiving less than half of the overall vote.

The court's ruling was the first such victory in a state court for anti-gerrymandering advocates since the U.S. Supreme Court ruled this year that extreme partisanship in the drawing of districts isn't up to federal courts to police.

The result means lawmakers here, in one of the most polarized state capitals in the U.S., are tasked with redrawing the lines, without basing those lines on whom voters are likely to support. With a Wednesday deadline fast approaching, it's a process that could have massive implications statewide and nationally.

In North Carolina, elections are often decided by razor-thin margins. Last week, a special election for the state's 9th Congressional District was decided by fewer than 5,000 votes.

"Closely divided states are where partisans can gain the most by committing a gerrymander," wrote Sam Wang, the leader of the Princeton Gerrymandering Project, in his analysis of the new House map that North Carolina looks likely to approve.

Nationally, the process could offer a preview of the next round of redistricting across the country, to come after the 2020 elections and census.

Experts say voters understand redistricting in a way they didn't after the 2010 elections, and that may lead to demands for more transparency and less partisanship in a process that takes place once every 10 years. A number of states passed laws in 2018 to amend how the process works going forward.

"Most transparent redistricting process in history"

In their decision this month, three superior court judges in Wake County ruled that all aspects of the mapmaking process need to be public — a clear rebuke of the backroom conversations through which redistricting negotiations traditionally are conducted.

The computers that lawmakers worked on, in both the Senate and House redistricting committee rooms, were livestreamed to YouTube. And negotiations were forbidden outside of public view.

After the Senate committee voted to approve its maps on Friday, the Republican leaders of the committee and Senate Minority Leader Dan Blue, a Democrat, released a statement calling the week the "most transparent redistricting process in history."

The full legislature is slated to vote on the Senate maps on Monday night after a public comment period in the afternoon.

"The maps produced in this room in the last several days are fair and nonpartisan," the lawmakers said.

On the House side, lawmakers ran into more issues. The body voted to pass the maps Friday night, but a number of Democrats cried foul, saying Republicans made unnecessary changes for political gain. The Senate is also slated to vote on the House maps on Monday.

Partisan 'mistrust'

Despite the assertions of Senate leaders, there remains some skepticism about whether the court will agree to enact the maps the legislature approves.

Stanford University professor and election law expert Nathaniel Persily was appointed Friday to help the court review the maps — and help draw new maps if the General Assembly's lines are deemed unlawful.

"I would be surprised if this court accepts the maps that this General Assembly develops," said freshman Democrat Sen. Michael Garrett. "I think the behavior of this body and the nearly decade of gamesmanship that's gone on, there's just too much mistrust."

That mistrust has been amplified in recent months with the unearthing of files from longtime Republican strategist Thomas Hofeller, who died in 2018. Hofeller was thought of as something of a gerrymandering wizard, and the files, which have been reviewed by The New Yorker and The New York Times, added new details about his involvement in helping North Carolina lawmakers draw the maps to such a Republican advantage.

According to The Times, in May 2016, after receiving news that he had cancer, Hofeller wrote an email to a friend that read: "I still have time to bedevil the Democrats with more redistricting plans before I exit. Look my name up on the internet and you can follow the damage."

Last week, Republicans tried to address some of the doubts that they would adhere to the nonpartisan rules set by the court.

Rather than draw new maps from scratch, they picked "base" maps from models created by University of Michigan professor Jowei Chen, who actually testified against them in the court case that invalidated the maps.

A state lottery machine was brought in to randomly select from a subset of those maps.

But an analysis done by Wang of the Princeton Gerrymandering Project found that the House map still contained between "one-half and two-thirds of the partisan advantage that was present in the illegal gerrymander."

"To make an analogy to card games, a stacked deck can't produce a fair deal," Wang wrote. "And I have some questions about the deck."

The whole process took place against a backdrop of extreme divide and tension last week that culminated on Wednesday when Republicans sprang a surprise vote on Democrats that had lawmakers screaming at each other on the House floor.

Later that day, a Democratic senator grabbed a reporter's phone and threw it.

And all week, accusations flew about maps being drawn in secret and violations of the court order.

"It is a very intense, very partisan, very polarized environment that the state has been going through since 2008 really," said J. Michael Bitzer, a political scientist at Catawba College in North Carolina.

Whether voters are happy at the end of this round of redistricting, Bitzer said, probably won't be determined by what the maps look like or how transparent the process is, but by the election results in 2020.

"If your party loses or doesn't have control of one of the two chambers, then you will continue to say this is a rigged system," Bitzer said.

Copyright 2019 NPR. To see more, visit https://www.npr.org.