* {
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4, #fad0c4);
}

.game-container {
  text-align: center;
  max-width: 400px;
  width: 90%;
  z-index: 1;
}

h1 {
  margin-bottom: 20px;
  font-size: 2rem;
  color: #333;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.cell {
  width: 100%;
  padding-top: 100%;
  position: relative;
  background-color: #fff;
  border: 2px solid #333;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s;
}

.cell::after {
  content: attr(data-value);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.status {
  margin: 15px 0;
  font-size: 1.2rem;
  color: #333;
}

/* Overlay for result */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.overlay-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 10px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.overlay-content h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #222;
}

#newGameBtn {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#newGameBtn:hover {
  background-color: #555;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.5rem;
  }

  .cell {
    font-size: 2rem;
  }

  .overlay-content h2 {
    font-size: 1.5rem;
  }
}
