/*@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  transition: background 0.2s linear;
  background-color: #fafafa;
}

body.dark {
  background: #292c35;
}

h1 {
  font-size: 35px;
  font-weight: bold;
  width: 100%;
  color: rgb(15, 14, 14);
}

h1.dark {
  color: white;
}

.wrapper {
  max-width: 1440px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 40px auto 20px auto;
}

.right {
  min-width: 200px;
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header .player-X {
  flex: 1;
  border-bottom: 5px solid #eee;
  padding-bottom: 8px;
}

.player-X.active {
  color: #4d79ff;
  border-color: #4d79ff;
}

.tile-x {
  color: #4d79ff;
}

.header .player-O {
  flex: 1;
  border-bottom: 5px solid #eee;
  padding-bottom: 8px;
}

.player-O.active {
  color: #ffcc00;
  border-color: #ffcc00;
}

.tile-o {
  color: #ffcc00;
}

.restart {
  width: 175px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50px;
  border: 2px solid #00802b;
  cursor: pointer;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.2s ease;
}

.restart:hover {
  background-color: #009933;
  color: white;
}

.restart.dark {
  border: 2px solid #cc0000;
  color: white;
}

.restart.dark:hover {
  background-color: #e60000;
}

.header {
  display: flex;
  color: #9a9a9a;
  font-size: 24px;
}

.game {
  max-width: 90vw;
  max-height: 90vh;
  width: 500px;
  height: 500px;
  display: flex;
  flex-direction: column;
}

.left {
  margin: 0 30px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-gap: 0px;
  flex-grow: 1;
  padding: 10px;
}

.board-tile {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 80px;
  background-color: transparent;
  cursor: pointer;
}

.board-tile:not(:nth-child(3n)) {
  border-right: 3px solid rgba(137, 163, 189, 0.58);
}

.board-tile:not(:nth-last-child(-n + 3)) {
  border-bottom: 3px solid rgba(137, 163, 189, 0.58);
}

.board-tile:hover {
  background: rgba(137, 137, 137, 0.285);
}

.tile-winner span {
  color: rgb(176, 176, 176);
}

/* result box */
.result-box {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  box-shadow: 0 0 60px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  padding: 25px 20px;
  border-radius: 5px;
  max-width: 400px;
  width: 100%;
  display: none;
  text-align: center;
  background: #fff;
}

.overlay {
  z-index: 50;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.open {
  display: block;
}

.result-box .text {
  font-size: 30px;
  font-weight: 500;
  display: flex;
  justify-content: center;
}

.result-box .text {
  font-weight: 600;
  margin: 0 5px;
}

.result-box .btn {
  width: 100%;
  margin-top: 25px;
  display: flex;
  justify-content: center;
}

.btn button {
  font-size: 18px;
  font-weight: 500;
  padding: 8px 20px;
  border: 2px solid #0033cc;
  border-radius: 50px;
  background-color: #fff;
  color: #000;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn button:hover {
  background-color: #0033cc;
  color: white;
}

.btns {
  display: flex;
  flex-direction: row;
}

/* dark mode */
.checkbox {
  opacity: 0;
}

.mode {
  margin-left: 40px;
  margin-top: 20px;
}

.label {
  background-color: #111;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  position: relative;
  height: 26px;
  width: 50px;
  transform: scale(1.5);
}

.label .ball {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  height: 22px;
  width: 22px;
  transform: translateX(0px);
  transition: transform 0.2s linear;
}

.checkbox:checked + .label .ball {
  transform: translateX(24px);
}

.fa-moon {
  color: #f1c40f;
}

.fa-sun {
  color: #f39c12;
}

@media only screen and (max-width: 900px) {
  .wrapper {
    flex-direction: column;
  }

  .left {
    margin-bottom: 50px;
  }

  .board-tile {
    font-size: 50px;
  }

  .game {
    max-height: 70vh;
  }
}
