html, body {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    margin: 0 auto;
    background-color: white;
}

#chequerboard {
    display: grid;
    grid-template-columns: repeat(8, 10vmin);
    grid-template-rows: repeat(8, 10vmin);
    background-color: #bbbbbb;
    width: 80vmin;
    height: 80vmin;
    margin: 5vh auto;
    position: relative;
    z-index: 1;
}
  
.square:nth-child(16n + 1), .square:nth-child(16n + 3), 
.square:nth-child(16n + 5), .square:nth-child(16n + 7),
.square:nth-child(16n + 10), .square:nth-child(16n + 12), 
.square:nth-child(16n + 14), .square:nth-child(16n + 16) {
    background-color: #bbbbbb;
}

.square {
    background-color: #444444;
    width: 10vmin;
    height: 10vmin;
}

.square:hover {
    box-shadow: inset 0 0 0 3px black;
}

.square.selected {
    box-shadow: inset 0 0 0 3px gold !important; /* Use a different color to distinguish selection from hover */
}

.piece {
    position: absolute;
    height: 10vmin;
    width: 10vmin;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    transition-duration: 0.5s;
}

.black {
    filter: invert(1);
}

.pawn {
    background-image: url("images/pawn.svg");
}

.king {
    background-image: url("images/king.svg");
}

.queen {
    background-image: url("images/queen.svg");
}

.rook {
    background-image: url("images/rook.svg");
}

.bishop {
    background-image: url("images/bishop.svg");
}

.knight {
    background-image: url("images/knight.svg");
}

#gameStats {
    position: absolute;
    width: 80vmin;
    height: 5vmin;
    line-height: 5vmin;
    left: 50vw;
    transform: translateX(-50%);
}

#blackStats {
    top: 5vh;
    right: calc(50vw + 50vmin);
    position: absolute;
}

#whiteStats {
    bottom: calc(95vh - 80vmin);
    left: calc(50vw + 50vmin);
    position: absolute;
}

#rotateDevice, #enterFullscreen {
    display: flex;
    text-align: center; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    position: absolute; 
    width: 100vw; 
    height: 100vh; 
    top: 0; 
    background-color: black;
    color: white;
}

#rotate {
    width: 50vmin; 
    height: 50vmin;
}

@media (orientation: landscape) {
    #rotateDevice {
        display: none;
    }
}