Mathf.Clamp rotation does not work properly

im trying to limit the rotation of the gun on the turret but it just snaps at min and max value. 171956-problem-2-1.gif
Thanks.

`void FixedUpdate()
{
Mouse();
}
void Mouse()
{
Vector3 pos = Camera.main.WorldToScreenPoint(transform.position);
Vector3 dir = Input.mousePosition - pos;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;

    angle = Mathf.Clamp(angle,160,-160);
    Debug.Log(angle);

    transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward); 
    
}`

you first need to clamp the angle from -180 to 180, for example, right know angle could be 270 and 270 should be -90 (they are the same angle) but in your code you would clamp it to 160 instead of -90