body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #161512;
  margin: 0;
}

.chess-container {
  position: relative;
}

.chessboard {
  display: block;
  border: 5px solid black;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  margin-top: 3rem;
  height: var(--board-size);
}

.popup-window {
  position: fixed;
  display: none;
  opacity: 0;
  margin-top: 3rem;
  transition: opacity 0.3s ease;
  background: linear-gradient(to right, var(--foreground), #1e1c1a); /* Fading edges */
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
  font-family: 'Arial', sans-serif;
  color: rgb(198, 188, 188);
}

#cancelButton, #analyseButton {
  padding-block: 0.5rem;
  border-radius: 1rem;
}

#analyseButton {
  background: rgb(155, 149, 216);
  color: #161512;
  transition: background 0.2s;
}

#analyseButton:hover {
  background: rgb(129, 125, 194);
}

#endOfGameButtons{
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Clocks dynamically positioned based on board size */
.chess-clock {
  position: absolute; 
  height: 40px;
/*   min-width: 80px; */
  background: linear-gradient(to right, var(--foreground), #1e1c1a); 
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  font-family: 'Arial', sans-serif;
  display: none; /* flex for making them display */
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  border-radius: 5px;
  right: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Mobile layout (default) clocks above and below the board */
.clock-top {
  top: 0;
  margin-top: 3rem;
  transform: translateY(-100%);
}

.clock-bottom {
  bottom: 0;
  transform: translateY(100%);
}

/* Desktop layout (media query) clocks to the right of the top and bottom right corners */
@media screen and (orientation: landscape) {
  .chess-clock {
    transform: translateX(100%);
  }
}