:root {
  --bg-page: #1c1917;
  --card: #34302e;
  --border-card: #44403c;
  --border-board: #4a2b23;

  --square-light: #f0d9b5;
  --square-dark: #b58863;

  --piece-light: #ffffff;
  --piece-dark: #262320;

  --highlight-select: rgba(56, 189, 248, 0.4);

  --text-main: #f3f4f6;
}

body {
  background-color: var(--bg-page);
}

#mainDiv {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#rightPanel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  width: 20vw;
  height: 70vh;
  background-color: var(--card);
  border: 6px solid var(--border-card);
}

#rightPanel button {
  background-color: var(--square-dark);
  border: 4px solid var(--piece-dark);
  border-radius: 4px;
  color: var(--text-main);
  width: 110px;
  height: 50px;
  font-size: 1rem;
  cursor: pointer;
}

.horizontal-align {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2vw;
}

h1 {
  color: var(--text-main);
}

#chessboard {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(90vw, 600px);
  max-width: 600px;
  aspect-ratio: 1 / 1;
  border: 6px solid var(--border-board);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.square {
  display: flex;
  width: 100%;
  height: 100%;

  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: calc(min(90vw, 600px) / 9 * 0.9);

  pointer-events: auto;
  cursor: pointer;
}

.light-square {
  background: var(--square-light);
}

.dark-square {
  background: var(--square-dark);
}

.piece {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: sans-serif;
  paint-order: stroke fill;
  line-height: 1;
  user-select: none;

  pointer-events: auto;
  cursor: pointer;
}

.piece.selected {
  outline: 3px solid var(--highlight-select);
  background-color: #93c5fd;
}

.light-piece {
  color: var(--piece-light);
  -webkit-text-stroke: 2px #1a1a1a;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.dark-piece {
  color: var(--piece-dark);
  -webkit-text-stroke: 0.5px rgba(240, 217, 181, 0.4);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
