Use Screen.dpi along with the screen resolution, which will enable you to get the physical size of the screen. You can assume anything smaller than 7 inches is a phone.
I’ve been using a 6" threshold for the screen diagonal as a phone/tablet differentiator applied when
SystemInfo.deviceType == DeviceType.Handheld.
You can calculate the length of the screen diagonal in inches by using Screen.width, Screen.height, Screen.dpi and the Pythagorean Theorem.
Now there are these things called “fablets”, so you may want to adjust the threshold depending on whether you want “fablets” to be classified as phones or tablets.