@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");
/* variables */
:root {
  /* colors */
  --primary-color: #fdebd3;
  --secondary-color: #e8f2df;
  --text-color: rgb(163, 163, 163);
  --winning-color: #264e70;
  --sign-0-color: #679186;
  --sign-1-color: #f9b4ab;
  /* font weight */
  --thin-weight: 400;
  --normal-weight: 600;
  --bold-weight: 700;
}
/* reset */
html {
  color-scheme: dark;
  font-size: 1rem;
}
body {
  font-family: "Poppins", sans-serif;
  color: var(--text-color);
  background-color: var(--secondary-color);
}
*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font: inherit;
  border: none;
  outline: none;
}
image,
picture,
svg,
video {
  display: block;
  width: 100%;
}

/* general */
.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-height: 100vh;
  margin: auto;
  overflow: hidden;
}
.hidden {
  display: none !important;
}
h1 {
  font-weight: var(--bold-weight);
}
.btn {
  background-color: #fdebd3;
  font-weight: var(--bold-weight);
  border-radius: 0.6rem;
  padding: 1rem 2rem;
  box-shadow: 0 0.2rem 0.1rem 0 #00000062;
  font-size: 2rem;
  color: inherit;
  transition: all 0.1s;
}
.btn:hover {
  cursor: pointer;
  opacity: 0.7;
}
.btn:active {
  box-shadow: 0 0rem 0rem 0 #00000062;
}

/* layout */

/* choose mode component */
.choose-mode-component .container {
  justify-content: center;
}
.choose-mode-component .container > * {
  display: flex;
  width: 20rem;
  font-size: 2rem;
  align-items: center;
  justify-content: center;
}
.choose-mode-component .container .mode-title {
  font-size: 5rem;
}

/* game component */
.game-component .container {
  gap: 4rem;
  padding: clamp(2rem, 3vh, 4rem) 0;
}

/* score board */
.result {
  display: flex;
  align-items: center;
  box-shadow: 0 0.2rem 0.1rem 0 #00000062;
  font-weight: var(--normal-weight);
  font-size: 3rem;
  background-color: #fdebd3;
  width: 100%;
}
.result [class^="player-"],
.result .player,
.result .computer {
  border-bottom: 0.4rem solid rgba(158, 158, 158, 0.525);
  padding: 2rem 0;
  align-items: center;
  display: flex;
  justify-content: space-evenly;
  flex-grow: 1;
  gap: 1rem;
}
.result .player-0 h2,
.result .player h2 {
  color: var(--sign-0-color);
}
.result .player-1 h2,
.result .computer h2 {
  color: var(--sign-1-color);
}
.turn-on {
  border-bottom: 0.4rem solid var(--winning-color) !important;
}
/* score board */

/* board style */
.cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 30rem;
  width: 30rem;
  gap: 1rem;
}
.cells [class^="cell-"] {
  box-shadow: 0 0.2rem 0.1rem 0 #00000062;
  border-radius: 0.6rem;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9rem;
  height: 9rem;
  padding: 0.5rem;
}
.cells [class^="cell-"]:hover {
  cursor: pointer;
}
/* board style */

.bottom-section {
  display: flex;
  width: 100%;
  padding: 0 3rem;
  justify-content: flex-end;
}

.winning-on {
  background-color: var(--winning-color) !important;
}
.beat-animation {
  animation: beat 1.5s infinite;
}
@keyframes beat {
  0% {
    background-color: var(--primary-color);
  }
  50% {
    background-color: var(--winning-color);
  }
  /* 100% {
    background-color: var(--primary-color);
  } */
}

/* 0 (O) sign style */
.sign-0 {
  display: inline-block;
  width: 100%;
  height: 100%;
  border-radius: 100%;
  border: 1.2rem solid #679186;
}
/* 0 (O) sign style */

/* 1 (x) sign style */
.sign-1 {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
}

.sign-1::before,
.sign-1::after {
  content: "";
  position: absolute;
  top: 34%;
  left: -7%;
  width: 113%;
  height: 32%;
  background-color: #f9b4ab;
  border-radius: 0.8rem;
}
.sign-1::before {
  transform: rotate(45deg);
}
.sign-1::after {
  transform: rotate(-45deg);
}
/* 1 (x) sign style */

/*  media queries */
@media screen and (max-width: 40em) {
  .game-component .container {
    gap: 2.5rem;
  }

  .result {
    width: 10rem;
    height: 5rem;
  }
  .result [class^="player-"],
  .result .player,
  .result .computer {
    padding: 0;
  }
  .result h2 {
    display: none;
  }
  .result .player-0 .score-player-0,
  .result .player .score-player {
    color: var(--sign-0-color);
  }
  .result .player-1 .score-player-1,
  .result .computer .score-computer {
    color: var(--sign-1-color);
  }

  .bottom-section {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
  }
}
@media screen and (max-width: 31em) {
  .cells {
    width: 20rem;
    height: 20rem;
    /* gap: 1rem; */
  }
  .cells [class^="cell-"] {
    width: 6rem;
    height: 6rem;
  }
  .bottom-section .btn.reset-board {
    font-size: 1.8rem;
  }
}
