As commented/answered above, ID will always win but here is a trick to make your classes win.
#box {
width: 100px;
height: 100px;
background-color: blue;
}
.one.two.three.four.five.six.seven.eight.nine.ten.eleven:not(#random_id) {
background-color: red;
}
Why this works when we know that pseudo-classes are less specific than ID?
Simply because The :not() itself doesn't add anything to the specificity number as other pseudo-classes do. However, the selectors within the :not() do.ref
So it's like i added an ID to my class selectors.