How to create a First Person camera controller, similar to one in "Deppart prototype"?

I want to make a first person controller effect like the Deppart prototype where the hand moves according to our cursor and if the hand is in the corner of the camera frame then the camera will automatically rotate.

Here is an example from the game:

I might have succeeded in making it but in my script it is limited to only 20 degrees angle rotation so if I turn my body 180 degrees then my hand will be left behind because of the limited 20 degree angle factor.

Is there anyone here who can help me?

using UnityEngine;

public class Mouselook : MonoBehaviour
{
    public Transform handFPS;

    [Header("Look Sensitivity")]
    [SerializeField] private float mouseSensitivity = 2.0f;
    [SerializeField] private float upDownRange = 80.0f;
    [SerializeField] private float rightLeftRange = 20.0f;

    [Header("Inputs Customization")]
    [SerializeField] private string horizontalMoveInput = "Horizontal";
    [SerializeField] private string verticalMoveInput = "Vertical";
    [SerializeField] private string mouseXInput = "Mouse X";
    [SerializeField] private string mouseYInput = "Mouse Y";

    private float xRotation;
    public Camera mainCamera;
    private Quaternion lastCameraRotation;
    private Quaternion lastHandFPSRotation;
    private Vector3 originalHandPosition; 

    // Start is called before the first frame update
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
        originalHandPosition = handFPS.position;
    }

    // Update is called once per frame
    void Update()
    {
        float mouseXRotation = Input.GetAxis(mouseXInput) * mouseSensitivity;

        xRotation -= Input.GetAxis(mouseXInput) * mouseSensitivity;
        xRotation = Mathf.Clamp(xRotation, -rightLeftRange, rightLeftRange);
        handFPS.transform.localRotation = Quaternion.Euler(0, -xRotation, 0);

        if (Mathf.Approximately(xRotation, rightLeftRange) || Mathf.Approximately(xRotation, -rightLeftRange))
        {
            mainCamera.transform.Rotate(0, mouseXRotation, 0);
        }
    }
}