sentence: For almost 50 years , Sophocles was the most celebrated playwright in the dramatic competitions of the city-state of Athens that took place during the religious festivals of the Lenaea and the Dionysia .