:root {
  --cell-size: 100px;
  --mark-size: calc(var(--cell-size) * 0.9);
  --dark: #141414;
  --white: #f5f5f5;
  --main: #f7720f;
}

body {
  width: 100vw;
  max-width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  background-color: var(--dark);
}

.title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  font-weight: bold;
  color: var(--white);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: center;
  justify-items: center;
  justify-content: center;
  align-content: center;
  position: relative;
  box-shadow: 0 0 40px 10px var(--main);
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--main);
  cursor: pointer;
}

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

.cell:first-child,
.cell:nth-child(4),
.cell:nth-child(7) {
  border-left: 0;
}
.cell:last-child,
.cell:nth-child(3),
.cell:nth-child(6) {
  border-right: 0;
}
.cell:last-child,
.cell:nth-child(7),
.cell:nth-child(8) {
  border-bottom: 0;
}

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

.cell.x::before,
.cell.x::after,
.cell.o::before,
.cell.o::after {
  content: "";
  position: absolute;
  background-color: var(--white);
}

.board.x .cell:not(.x):not(.o):hover::before,
.board.x .cell:not(.x):not(.o):hover::after,
.board.o .cell:not(.x):not(.o):hover::before {
  content: "";
  position: absolute;
  background-color: var(--white);
}

.cell.x::before,
.cell.x::after,
.board.x .cell:not(.x):not(.o):hover::before,
.board.x .cell:not(.x):not(.o):hover::after {
  width: calc(var(--mark-size) * 0.15);
  height: var(--mark-size);
}

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

.cell.x::after,
.board.x .cell:not(.x):not(.o):hover::after {
  transform: rotate(-45deg);
}
.cell.o::before,
.cell.o::after,
.board.o .cell:not(.x):not(.o):hover::before,
.board.o .cell:not(.x):not(.o):hover::after {
  border-radius: 50%;
}
.cell.o::before,
.board.o .cell:not(.x):not(.o):hover::before {
  width: var(--mark-size);
  height: var(--mark-size);
}
.cell.o::after,
.board.o .cell:not(.x):not(.o):hover::after {
  width: calc(var(--mark-size) * 0.75);
  height: calc(var(--mark-size) * 0.75);
  background-color: var(--dark);
}

.recap {
  display: none;
}

.recap.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
}

.message {
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 56px;
}

.restart {
  font-size: 20px;
  width: 150px;
  height: 60px;
  border: 2px solid var(--white);
  background: var(--dark);
  color: var(--white);
  margin-top: 20px;
  cursor: pointer;
}

.restart:hover {
  border: 2px solid var(--dark);
  background: var(--white);
  color: var(--dark);
}

@media (min-width: 750px) {
  .cell {
    width: calc(var(--cell-size) * 1.5);
    height: calc(var(--cell-size) * 1.5);
  }
}
