Legal means of or pertaining to the law, and a court is where law is practiced.