A campaign marked by distractions and disgruntled voters has left Trump facing a potentially damaging electoral reckoning.