were not landowners. The hierarchy that held this system of government together was reinforced by close ties of loyalty between the daimyō, samurai, and their subordinates. Each shogunate was dynamic, not static. Power was constantly shifting and authority was often ambiguous. The study of the ebbs and flows in this complex history continues to occupy the attention of scholars. Each shogunate encountered competition. Sources of competition included the Emperor and the court aristocracy, the remnants of the imperial governmental systems, the daimyōs, the shōen system, the great temples and shrines, the sōhei, the shugo and jitō, the jizamurai and early modern daimyō. Each shogunate reflected the necessity of new ways of balancing the changing requirements of central and regional authorities. Relationship with the emperor Since Minamoto no Yoritomo turned the figure of the shogun into a permanent and hereditary position and until the Meiji Restoration there were two ruling classes in Japan: The emperor or , who acted as "chief priest" of the official religion of the country, Shinto. The shogun, head of the army who also enjoyed civil, military, diplomatic and judicial authority. Although in theory the shogun was an emperor's servant, it became the true power behind the throne. No shogun tried to usurp the throne, even when they had at their disposal the military power of the territory. There were two reasons primarily: Theoretically the shogun received the power of the emperor, so this was his symbol of authority. There was a sentimentalist tradition created by priests and religious who traced the imperial line from the "age of the gods" into an "eternal line unbroken by the times." According to Japanese mythology, the emperor was a direct descendant of Amaterasu, goddess of the sun. Unable to usurp the throne, the shoguns sought throughout history to keep the emperor away from the country's political activity, relegating them from the sphere of influence. One of the few powers that the imperial house could retain was that of being able to "control time" through the designation of the Japanese Nengō or Eras and the issuance of calendars. Emperors twice tried to recover the power they enjoyed before the establishment of the shogunate. In 1219 the Emperor Go-Toba accused the Hōjō as outlaws. Imperial troops mobilized, leading to the Jōkyū War (1219–1221), which would culminate in the third Battle of Uji (1221). During this, the imperial troops were defeated and the