Riley hit 15 sixes and 22 boundaries as he amassed a sensational double century, maintaining his wicket until the tea interval.
Birstwith's innings was in the balance when Pete Hardisty joined Riley at the crease at 140/4 but the pair created fireworks together and shared a 254-run partnership.
Riley finished unbeaten on 224, facing just 100 balls, while Hardisty took 88 balls to reach his century milestone, scoring five sixes along the way. after arriving at the crease in the sixth over.
Hampthwaite's Sam Dabin also enjoyed the batting conditions in the second innings with seven maximums in a total of 124.
But he became one of Nick Wain's five victims as Hamps' finished on 278/7.
Birstwith still have hopes of claiming the title but require Ouseburn to slip up. And the leaders showed no sign of doing so as they breezed past Alne to maintain a 12 point cushion.
Chris Morrison (4/28) and Russ Robshaw (3/15) did the damage as Alne were sent packing for 101, a total Sam Parker (81) found no trouble in overturning – as Ouseburn claimed an eight-wicket win.
Darley still have a 14-point gap to Ouseburn after producing a fine run chase to beat Knaresborough Forest.
Forest totalled 281/4 from the initial 45 overs but it was not enough to scare Darley who went past the total with three overs spare.
Angus Shaw's five-wicket haul took West Tanfield up to fourth place with a seven-wicket win over Spofforth.
Spoff' were skittled for 157 and Sam Abel's half century gave Tanfield a comfortable win in 34 overs.
Burton Leonard needed a classy 72 from number seven Pete Townsend to score enough to beat Pateley Bridge by 83 runs.
Tom Fryer had applied the pressure for Bridge with 5/59 as Leonard were ousted for 198. But the result went the visitors way as Birdge were bowled out for 115 in reply, Nicky Smith taking 4/15 in a 12-over spell that included seven maidens.
Tom Messenger's 125 took Helperby to a match-winning 270/4 against Bishop Thronton, securing a 41-run win.
Rob Nelson scored the game's second century in Thornton's reply, while Steve Sowray added 60, but no other batsman found form as the hosts folded for 229.
Masham closed in on the Division Two title after a thrilling top two battle against Goldsborough on Saturday.
Masham were staring down the barrel towards a second defeat of the season with the tail padded up but a heroic effort from Chris Monkhouse and Mark Ellis delivered an unlikely victory.
The pair, batting at number eight and nine, shared a century seventh-wicket partnership to take Masham past Goldsborough's competitive first innings total of 229/5.
The league leaders were in turmoil as they lost their seventh wicket on 112, but Monkhouse sore 63 from 59 deliveries while Ellis chipped in with two sixes in a 63-ball 46.
Monkhouse departed with 16 runs still required but number ten Roger Smart completed the job.
Golds' innings had been propped up by Damon Ive's 80 while Ian Short added 57.
Raskelf can still catch Goldsborough in the promotion race and were in from as they thrashed Dacre Banks by 103 runs.
A combined effort throughout the Raskelf card set them up to make 202/9 and Banks folded for just 99, Rob Sigsworth taking 5-16.
Markington's sizeable 266/8 was too much for Ripley, whose chase came to an end at 231/9.
Graham Bassitt (76) and Peter Thompson (62) both scored half-centuries for Markington, while Luke Spence (78) and Matt Roberts (71) produced top scores for Ripley.
Paul Virr scored a run-a-ball 97 as Newby Hall chased down Thornton-le-Moor's 195 to win by five wickets, while Harrogate 3rds claimed a nailbiting win over Scotton (189/9) with the last pair at the crease.