 Complete the following phrase:  The origins of the castle lie in the Katzenelnbogen time. In the middle of the 13th century the counts of Katzenelnbogen built a moated castle in Darmstadt. In 1330 Darmstadt received town rights, one year later the castle is mentioned for the first time in a document. From 1386, the moated castle loses importance and becomes a widows residence and secondary residence. In the following two centuries, the counts of Katzenelnbogen extended and rebuilt the castle again and again. Until the middle of the 15th century the castle was transformed into a representative castle and Darmstadt became Katzenelnbogens second residence. What remains of the moated castle are the form of the central church courtyard and the outer walls of the manor house. When the last count von Katzenelnbogen died in 1479, Darmstadt fell to Henry III, Landgrave of Upper Hesse. When Philip I took over the government offices in 1518, the castle was destroyed for the first time in an attack by Franz von Sickingen. The castle was rebuilt in the following years, but with essentially the same defensive structures. During the 