/* Base styles */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  margin: 0;
  padding: 2rem;
  text-align: center;
  box-sizing: border-box;
}

/* Name entry form */
#enter-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

#enter-name h3 {
  margin: 0;
}

input {
  margin: 0 0 20px 0;
}

form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
}

.player-input {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
}

/* Submit button */
.player-submit {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.player-submit:hover {
  background-color: #005fa3;
}

/* Game container */
#game-start {
  display: none;
  margin-top: 2rem;
}

/* Scoreboard */
.display-score {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.display-score h3 {
  margin-bottom: 0.3rem;
}

/* Game board */
#tictactoe-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  grid-template-rows: repeat(3, minmax(70px, 1fr));
  gap: 5px;
  justify-content: center;
  margin: 0 auto;
  max-width: 300px;
}

.cell {
  background-color: #fff;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  aspect-ratio: 1;
  transition: background-color 0.2s ease;
}

.cell:hover {
  background-color: #b1c7fa;
}



/* Mobile tweaks */
@media (max-width: 500px) {
  body {
    padding: 1rem;
  }

  .player-input {
    width: 100%;
    font-size: 1rem;
  }

  .player-submit {
    width: 100%;
  }

  .display-score {
    flex-direction: column;
    gap: 1rem;
  }

  #tictactoe-board {
    max-width: 240px;
  }

  .cell {
    font-size: 1.5rem;
  }
}
