Rotate object to match phone's orientation

Hi!
I’m trying to rotate an object on its z axis to directly match the phone’s orientation.

private void Update()
{
transform.rotation = Quaternion.Euler(0, 0, -Input.acceleration.x * 90);
}

This code rotates the object 90º on the z axis when I tilt the phone to the left, -90º when I tilt the phone to the right and 0º when the phone is facing upwards, but the problem is that in the way I’ve implemented it will never rotate more than -90º or 90º (because Input.acceleration only gives a value between -1 and 1).

I know a similar effect could be achieved by using a gyroscope but my phone doesn’t have one.

In summary, is there any way I can make an object directly match the phone’s rotation using my phone’s accelerometer?

I found a soultion!
After some time looking at the values of Input.acceleration while I was moving my phone I found out that Input.acceleration.y also changed when I was changing my phone’s orientation.
All I had to do was use those values (Input.acceleration x and y) in conjunction to allow for the 360º rotation.

I guess I didn’t fully understand how the accelerometer works, so I’ll go ahead and learn some more about this component =D.