It's listed plainly in the terms of service you agreed to abide by when you signed up - that Square Enix reserves the right to take the game offline at any time for maintenance without any compensation to you. If it's emergency maintenance, then it literally can happen at any time - that's why it's 'emergency maintenance.'

And no matter what time they do the maintenance, someone is going to be inconvenienced - and sadly you got the short end of the stick this time.