In 2017, CSS media query from second answer still doesn't work on Firefox. I found a soluton for that: -moz-touch-enabled
So, here is cross-browser media query:
@media (-moz-touch-enabled: 1), (pointer:coarse) {
.something {
its: working;
}
}