The bluish bruise
under the nail bed is caused due to lack of oxygen
in blood. I would like you to sleep in the area where air circulation is good.
In case you have a good ventilation for air to circulate then it might be issue with the blockage of blood vessel by clot/ may be a lung issue. Please have it checked by physician.
Thanks, hope it helps.