body {
  background-color: #48a111;
  font-family: "Bungee", cursive;
  color: #f2b50b;
  text-align: center;
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#gameboard {
  width: 90vw;
  height: 90vw;
  max-width: 450px;
  max-height: 450px;
  background-color: #25671e;
  color: #f2b50b;
  border: 5px solid #f2b50b;
  border-radius: 30px;

  /* shape */
  border-radius: 10px;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gamecell {
  border: 7px solid #f2b50b;
  font-size: clamp(40px, 15vw, 100px);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: "Bungee", cursive;
  line-height: 1;
}

.gamecell:not(.winning-game-cell):hover {
  background-color: rgba(242, 181, 11, 0.1);
}

.winning-game-cell {
  background-color: #f7f0f0;
  color: #f2b50b;
}

#gamerestart {
  font-family: "Bungee", cursive;
  height: 50px;
  width: 170px;
  border: 5px solid #f2b50b;
  border-radius: 10px;
  background-color: #25671e;
  color: #f2b50b;
  font-size: 20px;
  margin-top: 20px;
  cursor: pointer;
  transition:
    transform 0.1s,
    background-color 0.2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#gamerestart:hover {
  background-color: #f2b50b;
  color: #25671e;
}

#gamerestart:active {
  transform: scale(0.95);
}

#scoreboard {
  background-color: #25671e;
  border: 5px solid #f2b50b;
  border-radius: 15px;
  padding: 15px;
  min-width: 140px;
  margin: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#scoreX,
#scoreO {
  color: #f7f0f0;
  font-weight: bold;
  font-size: 2.2rem;
}

#gameHistory {
  list-style: none;
  padding: 0;
  margin: 20px;
  width: 90%;
  max-width: 300px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #25671e;
  border: 5px solid #f2b50b;
  border-radius: 15px;
  scroll-behavior: smooth;
  font-family: "VT323", monospace;
}

#refreshPage {
  font-family: "Bungee", cursive;
  height: 40px;
  width: 190px;
  border: 3px solid #f2b50b;
  border-radius: 10px;
  background-color: #25671e;
  color: #f2b50b;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  margin-right: 24px;
  transition: all 0.2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#refreshPage:hover {
  background-color: #f2b50b;
  color: #25671e;
}

#gameHistory li {
  padding: 8px;
  border-bottom: 2px solid #f2b50b;
  color: #f7f0f0;
  font-size: 1.4rem;
  animation: fadeIn 0.4s ease-out;
  display: flex;
  justify-content: center;
}

#gameHistory li:last-child {
  border-bottom: none;
  background-color: #48a111;
}

#gameHistory::-webkit-scrollbar {
  width: 8px;
}

#gameHistory::-webkit-scrollbar-thumb {
  background-color: #f2b50b;
  border-radius: 10px;
}

#gameHistory::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1100px) {
  #scoreboard {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 20px;
  }

  #gameHistory {
    position: absolute;
    right: 40px;
    top: 45%;
    transform: translateY(-50%);
    max-height: 400px;
  }

  #refreshPage {
    position: absolute;
    right: 95px;
    top: calc(45% + 220px);
  }
}

@media (max-width: 450px) {
  .gamecell {
    border-width: 4px;
  }
  #gameboard {
    border-width: 3px;
  }
}
