/* Reset global */
* {
  box-sizing: border-box; /* Inclui bordas e padding no cálculo de largura/altura */
  margin: 0; /* Remove margens padrão */
  padding: 0; /* Remove espaçamentos internos padrão */
}

/* Telas principais */
#tela-inicial, #tela-jogo {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to right, #c0e5ff, #69a3ff);
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
}

/* Inputs e botões */
input {
  margin: 10px;
  padding: 8px;
  font-size: 16px;
}

button {
  padding: 10px 20px;
  font-size: 18px;
  cursor: pointer;
}

/* Corpo da página */
body {
  height: 100vh;
  width: 100vw;
  background: linear-gradient(90deg, rgb(14, 22, 80) 0%, rgb(71, 120, 199) 100%);
}

/* Tabuleiro */
.board {
  display: grid;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-content: center;
  align-items: center;
  grid-template-columns: repeat(3, auto);
}

/* Hover visual */
.board.x .cell:not(.x):not(.circle):hover::after,
.board.x .cell:not(.x):not(.circle):hover::before,
.board.circle .cell:not(.x):not(.circle):hover::after,
.board.circle .cell:not(.x):not(.circle):hover::before {
  background: rgba(182, 182, 255, 0.3) !important;
}

/* Células */
.cell {
  width: 100px;
  height: 100px;
  border: 2px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Cursor bloqueado */
.cell.x, .cell.circle {
  cursor: not-allowed;
}

/* Remoção de bordas duplicadas */
.cell:nth-child(1),
.cell:nth-child(2),
.cell:nth-child(3) {
  border-top: none;
}

.cell:nth-child(1),
.cell:nth-child(4),
.cell:nth-child(7) {
  border-left: none;
}

.cell:nth-child(7),
.cell:nth-child(8),
.cell:nth-child(9) {
  border-bottom: none;
}

.cell:nth-child(3),
.cell:nth-child(6),
.cell:nth-child(9) {
  border-right: none;
}

/* Estilo do X */
.cell.x::before,
.cell.x::after,
.board.x .cell:not(.x):not(.circle):hover::after,
.board.x .cell:not(.x):not(.circle):hover::before {
  content: "";
  height: 10px;
  width: 90px;
  background: #0f1a39;
  position: absolute;
}

.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);
}

/* Estilo do O */
.cell.circle::before,
.cell.circle::after,
.board.circle .cell:not(.x):not(.circle):hover::after,
.board.circle .cell:not(.x):not(.circle):hover::before {
  content: "";
  height: 90px;
  width: 90px;
  background: #0f1a39;
  position: absolute;
  border-radius: 50%;
}

/* Mensagem de vitória */
.winning-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: linear-gradient(90deg, rgb(24, 105, 163) 0%, rgb(9, 33, 72) 100%);
}

/* Botão de reinício */
.winning-message button {
  font-size: 2.5rem;
  background-color: #142d74;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  margin-top: 16px;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.winning-message button:hover {
  background-color: #122667;
}

/* Texto da mensagem de vitória */
.winning-message-text {
  color: white;
  font-size: 5rem;
  text-align: center;
}

/* Exibir mensagem */
.show-winning-message {
  display: flex;
}

#vez-jogador {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: #0f1a39;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
  text-align: center;
}

@media (max-width: 600px) {
  #vez-jogador {
    font-size: 1.2rem;
    top: 10px;
    padding: 8px 16px;
  }
}
