Regrettably, it is not possible to directly select a node's parent using CSS selectors alone. To accomplish this, one must utilize either JavaScript or jQuery. Below are two methods demonstrating how you can achieve your desired outcome using both JavaScript and jQuery.
Below is an example using JavaScript:
if (document.getElementById("admin") !== null) {
document.getElementById("maincontent").style.backgroundColor = "#000";
}
And here is the same functionality accomplished with jQuery:
if ($("#admin").length === 1) {
$("#maincontent").css("background-color", "#000");
}