@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');

*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  --cell-size: 100px;
  --mark-size: calc(var(--cell-size) * .9);
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background: black;
}

/* DARK MODE */
.darkMode {
  background: white;
}

.darkMode .cell {
  background-color: white;
  border: 1px solid black;
}

.darkMode .cell.x::before,
.darkMode .cell.x::after {
  background-color: black;
}

.darkMode .cell.circle::before {
  background-color: black;
}

.darkMode .cell.circle::after {
  background-color: white;
}


.darkMode .board.circle .cell:not(.x):not(.circle):hover::after {
  background-color: white
}

/* END DARK MODE */

.settings {
  position: fixed;
  top: 0;
  right: 0;
  font-size: 30px;
  color: gray;
  margin-top: 5px;
  margin-right: 5px;
  border-radius: 10px;
  cursor: pointer;
}

.board {
  width: 100vw;
  height: 100vh;
  display: grid;
  justify-content: center;
  align-content: center;
  justify-items: center;
  align-items: center;
  grid-template-columns: repeat(3, auto);
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background-color: black;
  border: 1px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.cell:first-child,
.cell:nth-child(2),
.cell:nth-child(3) {
  border-top: none;
}

.cell:last-child,
.cell:nth-child(7),
.cell:nth-child(8) {
  border-bottom: none;
}

.cell:nth-child(3n+1) {
  border-left: none;
}

.cell:nth-child(3n+3) {
  border-right: none;
}

.cell.x,
.cell.circle {
  cursor: not-allowed;
}

.board.x .cell:not(.x):not(.circle):hover::before,
.board.x .cell:not(.x):not(.circle):hover::after,
.board.circle .cell:not(.x):not(.circle):hover::before {
  background-color: red !important
}

.cell.x::before,
.cell.x::after,
.board.x .cell:not(.x):not(.circle):hover::before,
.board.x .cell:not(.x):not(.circle):hover::after {
  content: "";
  position: absolute;
  width: calc(var(--mark-size) * .15);
  height: var(--mark-size);
  background-color: white;
}

.cell.x::before,
.board.x .cell:not(.x):not(.circle):hover::before {
  transform: rotate(45deg);
}

.cell.x::after,
.board.x .cell:not(.x):not(.circle):hover::after {
  transform: rotate(-45deg);
}

.cell.circle::before,
.cell.circle::after,
.board.circle .cell:not(.x):not(.circle):hover::before,
.board.circle .cell:not(.x):not(.circle):hover::after {
  content: "";
  position: absolute;
  /* width:  var(--mark-size);
  height: var(--mark-size); */
  background-color: white;
  border-radius: 50%;
}

.cell.circle::before,
.board.circle .cell:not(.x):not(.circle):hover::before {
  border-radius: 50%;
  width: var(--mark-size);
  height: var(--mark-size);
  background-color: white;
}

.cell.circle::after,
.board.circle .cell:not(.x):not(.circle):hover::after {
  width: calc(var(--mark-size) * .7);
  height: calc(var(--mark-size) * .7);
  background-color: black;
}


.win-message {
  display: none;
  font-family: 'Montserrat', sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, .9);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: green;
  font-size: 7rem;
  text-align: center;
}

.win-message button {
  margin-top: 90px;
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  color: white;
  background-color: red;
  border: 1px solid black;
  border-radius: 50px;
  padding: .25em .5em;
  cursor: pointer;
  outline: 0;
}

.win-message button:hover {
  /* background-color: green; */
  background-color: white;
  border-color: red;
  color: red
}

.win-message.show {
  display: flex;
}