You can use this as a reference (for subnet settings)
(for 32768 unique IPs you would need a /17 )
Once you have the router set-up to support that subnet, you would set the parameters in
/etc/dnsmasq.d/02-pihole-dhcp.conf or via the admin interface.
But before you do that, are you sure your hardware will handle all that ?
That’s a hell of a huge load, close to ISP grade and it will require some serious firepower to handle all that, in real time, without any delay (one one branch).