@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: #3a2038;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}

.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.turn {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 1.3rem;
    font-size: 2rem;
    color: rgb(153, 153, 153);
}

.turn > div.active-turn {
    color: white;
    transition: color .7s linear;
    
}

.board {
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    grid-template-columns: repeat(8, 1fr);
    width: 90vmin;
    height: 90vmin;
    border: 1rem solid #955520;
}

.square {
    position: relative;
    transition: border .1s linear;
}

.piece::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    cursor: pointer;
}

.piece-black::before {
    background-color: rgb(26, 0, 0);
    border: 4px solid rgb(192, 192, 192);
}

.piece-red::before {
    background-color: rgb(255, 0, 0);
    border: 4px solid rgb(34, 0, 0);
}

.active {
    border: 3px solid rgb(251, 255, 0);
    border-radius: 3px;
}

.red {
    background-color: rgb(138, 0, 0);
}

.black {
    background-color: rgb(36, 36, 36);
}

.is-castled::before {
    border-style: dashed;
}

.game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    padding: 2rem;
    text-align: center;
    font-size: clamp(14px, 4vw, 30px);
    color: white;
    background-color: rgba(0, 0, 0, .6);
    border-radius: 10px;
    z-index: 100;
}

.play-again {
    background-color: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 2rem;
}