[BUG #7058] Added environment detection for devicePixelRatio with media query fallback