
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(
        ellipse at center,
        #293b2a,
        #101a12
    );
    font-family: Georgia, "Times New Roman", serif;
    color: #e6d5b5;
    text-align: center;
}

header {
    background: linear-gradient(#382419, #20150e);
    border-bottom: 2px solid #96713d;
    padding: 15px;
}

.brand {
    color: #d9b575;
    font-size: 24px;
    font-style: italic;
    text-decoration: none;
}

main {
    max-width: 620px;
    margin: auto;
    padding: 20px;
}

h1 {
    margin: 0;
    font-size: 42px;
    font-weight: normal;
    color: #e4c896;
}

.subtitle {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #bca47a;
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    margin: 20px auto 10px;
    max-width: 480px;
}

#status {
    min-height: 24px;
    color: #d9b575;
}

#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
    margin: auto;
    border: 10px solid #50301c;
    outline: 2px solid #ad8550;
    box-shadow: 0 8px 25px #0009;
}

.square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 0;
    min-width: 0;
    cursor: pointer;
}

.light {
    background: #d7bb8b;
}

.dark {
    background: #805335;
}

.piece {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px double #ffffff40;
    box-shadow:
        0 3px 4px #0008,
        inset 0 0 6px #0006;
    pointer-events: none;
}

.red {
    background: radial-gradient(
        circle at 35% 25%,
        #b44d39,
        #561711
    );
}

.black {
    background: radial-gradient(
        circle at 35% 25%,
        #51504a,
        #10100e
    );
}

.king {
    color: #e6c478;
    font-size: clamp(14px, 4vw, 28px);
}

.selected {
    box-shadow: inset 0 0 0 4px #e4c36c;
}

.legal-move::after {
    content: "";
    width: 24%;
    height: 24%;
    border-radius: 50%;
    background: #f1d68b;
    box-shadow: 0 0 8px #e4c36c;
}

.controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 25px 0;
}

.controls button,
#rulebook button {
    padding: 10px 18px;
    background: linear-gradient(#493322, #302015);
    border: 1px solid #a48752;
    border-radius: 3px;
    color: #e4c896;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

.controls button:hover,
#rulebook button:hover {
    background: #60452d;
}

.return-link {
    color: #c9ac78;
    text-decoration: none;
}

.return-link:hover {
    text-decoration: underline;
}

#rulebook {
    background: #e4d4ae;
    color: #36291b;
    border: 4px double #96713d;
    max-width: 450px;
    width: 90%;
    padding: 25px;
    text-align: center;
}

#rulebook::backdrop {
    background: #000a;
}
