The words “Justice Anthony Kennedy announced his retirement from the Supreme Court” were to members of the Senate what the call to the post was to Willie Shoemaker: Time to start jockeying.

Thanks to Senate Majority Leader Mitch McConnell’s (R-Ky.) finagling during the fight to confirm Justice Neil M. Gorsuch, Supreme Court nominees are not subject to the filibuster, meaning that only 51 votes are needed to confirm. Unfortunately for McConnell, though, that’s exactly how many votes he has. If he loses one vote, the Senate is split 50-50, and Vice President Pence can cast the tiebreaker. If he loses two? President Trump’s nominee to replace Kennedy fails to be confirmed. Meaning that if Trump nominates someone who two centrist Republicans find unpalatable — perhaps a fervent opponent of abortion who Sens. Susan Collins (R-Maine) and Lisa Murkowski (R-Alaska) can’t support — McConnell is in trouble.

Yet the tenuousness of that margin is also an advantage to McConnell and Republicans in a midterm election year where energizing Republican voters will be essential. McConnell has already promised to bring Trump’s nominee (whoever it will be) up for a vote in the fall — stretching out the confirmation debate for months and reminding his base of how important Trump and a Republican-controlled Senate are to shaping the court. (It’s a strategy that McConnell used to great — and greatly controversial — effect in 2016.)

It’s worth spending a minute, then, to assess how those Senate races are shaping up. How close are the Republicans to losing their majority?

As mentioned, the GOP currently has a two-vote lead in the Senate, meaning that flipping one seat would split the Senate 50-50.

But the Senate map happens to be exceptionally bad for the Democrats this year. Of the 49 seats they hold, more than half, 26, are up for reelection this year. Among seats held by Republicans, only nine are.

In other words, the Democrats need to win 28 of the 35 seats that are being contested this year to take a majority of the Senate. That’s daunting.

The good news for the party is that most of the seats currently held by Democrats aren’t going to flip. Many are seats like Sen. Dianne Feinstein’s in California, which would stay in Democratic hands even if the general election weren’t between two Democrats anyway.

Cook Political Report estimates that 14 of the 26 Democrat-held seats are safe. Another five are likely going to be held by the Democrats. Two lean to the party. Five are tossups.

On the Republican side, it’s an even split. Three are safe, three will likely be held by the GOP and three are toss-ups.

If the Democrats run the table on their side and pick up two of the Republican toss-ups — the seat left vacant by the retirements of Sens. Jeff Flake (R-Ariz.) or Bob Corker (R-Tenn.), for example — they have a majority.

But that’s easier said than done. Many of the seats currently held by Democrats that are up in November are in states that voted for Trump in 2016. In some cases, those votes were close, like in Michigan. In some cases, like North Dakota, Trump won in a rout. (He headed to the state on Wednesday evening to rally in support of the Republican Senate candidate in the state, Kevin Cramer.)

Only one Republican-held seat is in a state that voted for Hillary Clinton: Sen. Dean Heller’s (R-Nev.).

Again, though, there’s good news for the Democrats. The most recent polling in 13 contests (including polling matching up candidates who are slated to win their primaries) has Democrats up in 10 and Republicans up in three. (By “most recent,” we mean the most recent poll in a race and only looking at polls conducted this month.) Three of those polls, though, are in safe Democratic seats. One (Utah) is in a safe Republican seat.

Those poll results include the Democrats picking up Flake’s seat in Arizona (Rep. Kyrsten Sinema (D-Ariz.) has a healthy lead over possible Republican opponents) — but also the Republicans picking up that seat in North Dakota. (Cramer is up by four points.)

The nine contested seats without recent polling include some tricky ones for the Democrats. Incumbents in Missouri and Indiana, for example, whose states went for Trump overwhelmingly in 2016.

It’s worth reiterating another point we’ve made before, though. The most frequent voters skew older, whiter and wealthier — demographics that overlap with Republican voters. Democrats have, in recent midterm elections, had a tougher time turning people out to vote.

The retirement of Kennedy might, then, serve to inspire Democrats to the polls as much as or more than it inspires Republicans. And since Democrats need more help boosting turnout, that could be significant, especially since Democrats were less likely to prioritize naming justices in the 2016 election.

McConnell’s gambit, in other words, could backfire in an already tricky political environment.