Селекторы. Часть 2 [20/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">
            <li class="two heart"></li>
            <li class="five diamond"></li>
            <li class="ten heart"></li>
            <li class="jack club"></li>
            <li class="queen spade"></li>
            <li class="king diamond"></li>
            <li class="ace heart"></li>
            <li class="six heart"></li>
            <li class="seven diamond"></li>
            <li class="eight spade"></li>
            <li class="nine club"></li>
            <li class="three club"></li>
            <li class="four heart"></li>
        </ul>
        <ul class="cards">
            <li class="five spade"></li>
            <li class="six diamond"></li>
            <li class="seven spade"></li>
            <li class="eight club"></li>
            <li class="two diamond"></li>
            <li class="three heart"></li>
            <li class="four club"></li>
            <li class="queen club"></li>
            <li class="king spade"></li>
            <li class="seven diamond"></li>
            <li class="nine heart"></li>
            <li class="ten diamond"></li>
            <li class="jack heart"></li>
        </ul>
        <ul class="cards">
            <li class="two spade"></li>
            <li class="ten heart"></li>
            <li class="ace club"></li>
            <li class="five heart"></li>
            <li class="nine diamond"></li>
            <li class="king diamond"></li>
            <li class="ace spade"></li>
            <li class="six heart"></li>
            <li class="eight diamond"></li>
            <li class="ace spade"></li>
            <li class="queen heart"></li>
            <li class="three diamond"></li>
            <li class="four spade"></li>
        </ul>
        <ul class="cards">
            <li class="king heart"></li>
            <li class="jack club"></li>
            <li class="two club"></li>
            <li class="three spade"></li>
            <li class="four diamond"></li>
            <li class="ten club"></li>
            <li class="jack spade"></li>
            <li class="eight diamond"></li>
            <li class="nine spade"></li>
            <li class="queen diamond"></li>
            <li class="five club"></li>
            <li class="six club"></li>
            <li class="seven heart"></li>
        </ul>
        <div></div>
    </body>
</html>

css:

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

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

.cards {
    position: relative;
    width: 380px;
    text-align: left;
}

.cards li {
    width: 37px;
    height: 55px;
}

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

.cards li:not(:first-child) {
    margin-left: -20px;
}

ul::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    display: block;
    width: 37px;
    height: 55px;
    border: 1px dashed #33bb33;
    border-radius: 5px;
}

li:nth-child(4n-3) {
    background-color: #ffcc33;
}

ul:not(:first-of-type) li:nth-child(4n-2) {
    background-color: #0099ff;
}

ul:nth-of-type(even) li:nth-child(4n) {
    background-color: #ff3300;
}

.ace.spade ~ li:nth-of-type(3n-1) {
    background-color: #339933;
}

ul:first-of-type li:nth-child(even) {
    background-color: #996666;
}
1 лайк

li:nth-child(4n-3) у меня реализовано как li:nth-child(4n+1).
Получается, что 4n-3 и 4n+1 это одно и тоже! Вот такая вот странная арифметика.