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

/* Define variables */
:root{
    --colorprimary: #b58863;
    --colorsecondary: #f0d9b5;
    --coloraccent: #BABABA;
    --colorbackground: #604020;
}

/* Create and style page header */
header {
    display: flex;
    align-items: center;
    height: min(12vw, 60px);
    background-color: var(--colorsecondary);
    width: 100%;
}

/* Place logo */
#site-logo img{
    width: min(30vw, 150px);
    float: left;
    padding: none;
    margin: auto;
}

/* Style navigation menu */
#menu{
    margin-left: 10px;
    padding: none;
    display: inline-block;
    align-items: center;
    line-height: normal;
}

/* Create Page Body */
body {
    margin: 0px;
    padding: 0px;
    background-color: var(--colorbackground); 
    color: white;
    font-family: 'Roboto', sans-serif;
}

/* Style moves table */
.table-scrollable{
    position: relative;
    overflow-y: auto;
    height: 500px;
}   

#moves-table {
    background-color: var(--colorsecondary);
    width: 250px;
    color: black;
    border-collapse: collapse;
    table-layout: fixed;
}

th, td {
    border: 1pt solid black;
    padding: 5px;
    text-align: center;
}


/* Style buttons */
.button {
    /* width: max(8vw, 60px); */
    width: max(6vw, 90px);
    aspect-ratio: 3/1;
    border: none;
    background: var(--colorprimary);
    color: white;
    border-radius: 6px;
    font-size: min(3vw, 11pt);
    font-weight: 40;
    cursor: pointer;
    text-align: center;
}

.button:hover {
    background: black;
}


.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5vw;
    width: 100%;
}

/* Define the board and the squares */
.chess-board {
    aspect-ratio: 1/1;
    border: 0.1vw solid black;
    border-top: 0.05vw solid black;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    max-width: 500px;
    position: relative;
    width: 90vw;
}


.playerbox{
    align-items: center;
    box-sizing: border-box;
    border: 0.1vw solid black;
    border-bottom: 0.05vw solid black;
    color: black;
    display: flex;
    justify-content: center;
    margin: auto;
    position: relative;
    text-align: center;
    width: 90vw;
    height: max(2vw, 22.5px);
    max-width: 500px;
    font-size: min(3.5vw, 14pt);
}

.playerbox-black{
    background-color: var(--colorprimary);
    justify-content: right;
    padding-right: 20px;
}

.playerbox-white{
    background-color: var(--colorsecondary); 
    justify-content: left;
    padding-left: 20px;
}

.square{
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    position: relative;
    width: 100%;
}

.light-square{
    background-color: var(--colorprimary);
}
.dark-square{
    background-color: var(--colorsecondary);
}

.selected-square{
    background-color: var(--coloraccent);
}

.dest-square{
    display: flex;
}

.dest-square:hover {
    background-color: var(--colorbackground);
}

.check-square{
    background: radial-gradient(#e66465, #9198e5);
}

.active-player-dot {
    aspect-ratio: 1/1;
    position: relative;
    left: 7.5px;
    width: 2%;
    background-color: green;
    border-radius: 50%;
}

.active-player-dot {
    animation: pulseGlow 1.5s infinite ease-in-out;
  }
  @keyframes pulseGlow {
    0%, 100% {
      box-shadow: 0 0 5px black, 0 0 10px black;
    }
    50% {
      box-shadow: 0 0 15px black, 0 0 30px black;
    }
  }

.allowedMovesDot {
    aspect-ratio: 1/1;
    position: relative;
    width: 25%;
    background-color: teal;
    border-radius: 50%;
}

.attackDot {
    aspect-ratio: 1/1;
    width: 100%;
    background-color: red;
    opacity: 0.35;
}

/* Promotion square design */

/* .promotion-square{
    position: absolute;
    height: 62.5px;
    width: 250px;
    top: -10px;
    left: 593.75px;
    background-color: #f0d9b5;
} */

/* .promotion-file{
    position: absolute;
    height: 62.5px;
    width: 250px;
    top: -10px;
    left: 593.75px;
    background-color: #604020;
    z-index: 0;
} */


/* Display game result */
.resultOverlay {
    align-items: center;
    background-color: rgba(96, 64, 32, 0.5);
    bottom: 0px;
    color: #000000;
    display: flex;
    font-size: min(2.75vw, 20px);
    font-weight: bold;
    justify-content: center;
    left: 0px;
    position: absolute;
    right: 0px;
    text-align: center;
    top: 0px;
    z-index: 10;
}

.overlayNewGameButton {
    background-color: #000000;
    border: none;
    border-radius: 5px;
    color: #ffffff;
    height: 10%;
    position: absolute;
    top: 57.5%;
    width: 25%;
    max-width: 90px;
    max-height: 25px;
    font-size: min(2vw, 15px);
    /* min-width: 60px; */
}

.overlayNewGameButton:hover{
    opacity: 0.75;
}


/* .buttonUndo {
    border: none;
    width: 90px;
    height: 25px;
    background-color: #b58863;
    color: #f0d9b5;
    position: relative;
    left: 225px;
    top: 25px;
    border-radius: 7.5%;
} */


/* Define Pieces */
.piece {
    width: 100%;
    height: 100%;
    background-size: contain;
    position: absolute;
    top: 0;
    left: 0;
    --moves: [];
}

.white-piece{
    --type: "white";
}

.black-piece{
    --type: "black";
}

.white-rook {
    background-image: url("../pieces/wr.png");
    --type: "white";
}

.white-pawn {
    background-image: url("../pieces/wp.png");
    --type: "white";
}

.white-knight {
    background-image: url("../pieces/wn.png");
    --type: "white";
}

.white-bishop {
    background-image: url("../pieces/wb.png");
    --type: "white";
}

.white-queen {
    background-image: url("../pieces/wq.png");
    --type: "white";
}

.white-king {
    background-image: url("../pieces/wk.png");
    --type: "white";
}

.black-rook {
    background-image: url("../pieces/br.png");
    --type: "black";
}

.black-pawn {
    background-image: url("../pieces/bp.png");
    --type: "black";
}

.black-knight {
    background-image: url("../pieces/bn.png");
    --type: "black";
}

.black-bishop {
    background-image: url("../pieces/bb.png");
    --type: "black";
}

.black-queen {
    background-image: url("../pieces/bq.png");
    --type: "black";
}

.black-king {
    background-image: url("../pieces/bk.png");
    --type: "black";
}

/* Footer */
.footer {
    /* background: var(--colorsecondary); */
    position: absolute;
    color: white;
    text-align: right;
    vertical-align: middle;
    left: 0;
    bottom: 0;
    
    width: 98%;
}

