My Htc One M8 has some issues..

A

AC Question

I went to the seaside 2 days ago and slept with my M8 next to me and the headset on. When i woke up the phone was under me, kind of wet. For 10 minutes, the lock screen button didn't work, nor the low volume one...They fixed up after 10 minutes. Now i come to see that my phone is unlocking by itself, like i have it on my desk and it suddenly unlocks, no notifications or alarms or anything, just like that, and it starts apps for example Camera and Car.... Besides that, the screen rotates on any side anywhere even on the main screen which is not normal, if i rotate my phone in a landscape the phone's screen rotates too, even upside down. Please I desperately need help on how to fix this.. Thank you very much.