9/20 Как лучше упростить код?

<!DOCTYPE html>
<html lang="ru">
    <head>
        <meta charset="utf-8">
        <title>Испытание: первая раскладка</title>
        <link rel="stylesheet" href="/assets/course57/course.css">
    </head>
    <body>
        <div></div>
        <ul class="cards">
            <div></div>
            <li class="six heart"></li>
            <li class="seven spade"></li>
            <li class="eight club"></li>
            <li class="nine diamond"></li>
            <li class="ten spade"></li>
            <li class="jack heart"></li>
            <li class="queen club"></li>
            <li class="king spade"></li>
            <li class="ace diamond"></li>
            <div></div>
        </ul>
        <ul class="cards">
            <div></div>
            <li class="six spade"></li>
            <li class="seven club"></li>
            <li class="eight diamond"></li>
            <li class="nine heart"></li>
            <li class="ten diamond"></li> 
            <li class="jack club"></li>
            <li class="queen spade"></li>
            <li class="king club"></li>
            <li class="ace heart"></li>
            <div></div>
        </ul>
        <ul class="cards">
            <div></div>
            <li class="six diamond"></li>
            <li class="seven heart"></li>
            <li class="eight spade"></li>
            <li class="nine club"></li>
            <li class="ten heart"></li>
            <li class="jack spade"></li>
            <li class="queen diamond"></li>
            <li class="king heart"></li>
            <li class="ace club"></li>
            <div></div>
        </ul>
        <ul class="cards">
            <div></div>
            <li class="six club"></li>
            <li class="seven diamond"></li>
            <li class="eight heart"></li>
            <li class="nine spade"></li>
            <li class="ten club"></li>
            <li class="jack diamond"></li>
            <li class="queen heart"></li>
            <li class="king diamond"></li>
            <li class="ace spade"></li>
            <div></div>
        </ul>
        <div></div>
    </body>
</html>

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Arial", sans-serif;
}

body {
    min-width: 550px;
    min-height: 250px;
    padding: 10px;
}

.cards {
    width: 500px;
}

.cards li::before {
    font-family: "Courier", monospace;
}

.cards li:not(:nth-of-type(4)):not(:first-of-type){
    margin-left: -15px;
}

.cards li:not(:nth-of-type(4)){
    width: 36px;
    height: 54px;
}

.cards li:nth-of-type(4){
    margin-right: 30px;
    margin-left: 15px;
}

ul:first-of-type li:last-of-type{
    background-color: #0099ff;
}
ul:nth-of-type(2) li:nth-of-type(3){ background-color: #0099ff;
}
ul:nth-of-type(2) li:nth-of-type(5){ background-color: #0099ff;
}
ul:nth-of-type(3) li:first-of-type{background-color: #0099ff;}
ul:nth-of-type(3) li:nth-of-type(7){background-color: #0099ff;}
ul:not(:nth-of-type(2)) li:nth-of-type(2){
    background-color: #ff3300;
}

ul:last-of-type li:nth-of-type(3n){
    background-color: #339933;
}

Как сократить количество синих селекторов?)

ul:not(:last-of-type) li:not(:nth-of-type(4)).diamond {
background-color: #0099ff;
}

.diamond:nth-child(even)
Т.К внутри ul стоят пустые div`ы, каждый .diamond получается четным

1 лайк