main {
  width: fit-content;
  margin: auto;
}

.board {
  --cell-size: 4em;
  --o-player: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" style="font-size: 20px;"><text y="20">◯</text></svg>'), auto;
  --x-player: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" style="font-size: 20px;"><text y="20">⨯</text></svg>'), auto;
  display: inline-grid;
  grid-template-columns: repeat(3, var(--cell-size));
  grid-template-rows: repeat(3, var(--cell-size));
  justify-content: center;
  padding-top: 2em;
  padding-bottom: 2em;
  cursor: pointer;
}

/* Add border only between cells */
.board div:nth-child(2),
.board div:nth-child(5),
.board div:nth-child(8) {
  border-left: 1px solid grey;
  border-right: 1px solid grey;
}

.board div:nth-child(4),
.board div:nth-child(5),
.board div:nth-child(6) {
  border-top: 1px solid grey;
  border-bottom: 1px solid grey;
}


.board div {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
}

.flex {
  display: flex;
}

.row {
  flex-direction: row;
}

.col {
  flex-direction: column;
}

.button {
  background-color: #4CAF50;
  /* Green */
  border: none;
  color: white;
  padding: 0.5em 1em;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.secondary {
  background-color: grey;
}

input[type=text] {
  width: 7em;
  padding: 0.5em 1em;
  box-sizing: border-box;
  margin-top: 0.5em;
}

#confetti-canvas {
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#game-message {
  z-index: 100;
  pointer-events: none;
  position: relative;
  align-self: center;
  width: fit-content;
  pointer-events: none;
  font-size: 1.5em;
  opacity: 0.5;
  display: none;
}

#game-message.animate {
  animation: drop 1s;
  display: block;
}

/** Dropping message 
  ref. https://www.winterwind.com/tutorials/css/38
*/
@keyframes drop {
  from {
    transform: translateY(-200px) scaleY(0.9);
  }

  5% {
    opacity: 0.1;
  }

  50% {
    transform: translateY(0px) scaleY(1);
    opacity: 0.25;
  }

  65% {
    transform: translateY(-17px) scaleY(0.9);
  }

  75% {
    transform: translateY(-22px) scaleY(0.9);
  }

  to {
    transform: translateY(0px) scaleY(1);
    opacity: 0.5;
  }
}
