@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to right, #ece9e6, #ffffff);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
}

h2 {
  margin-bottom: 20px;
  font-weight: 600;
}

input {
  padding: 10px 15px;
  margin: 10px;
  width: 200px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 1em;
}

button {
  background: #007bff;
  color: white;
  padding: 10px 20px;
  margin-top: 15px;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #0056b3;
}

#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
  width: 100%;
  max-width: 330px;
}

.cell {
  background: white;
  height: 100px;
  font-size: 2.5em;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.cell:hover {
  background: #f7f7f7;
}

.cell.filled {
  cursor: not-allowed;
}

.cell.invalid {
  animation: shake 0.3s, redFlash 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

@keyframes redFlash {
  0% { background-color: #ffcccc; }
  100% { background-color: white; }
}

#celebration img {
  width: 220px;
  margin: 20px 0;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

#nameInput, #celebration, #gameContainer {
  text-align: center;
  width: 100%;
  max-width: 400px;
  background: #fff;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  margin-top: 30px;
}

#nameInput , #celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#turnDisplay {
  font-size: 1.2em;
  font-weight: 500;
  margin-top: 15px;
}

@media (max-width: 480px) {
  .cell {
    height: 80px;
    font-size: 2em;
  }

  input, button {
    width: 100%;
  }

  #board {
    gap: 8px;
  }
}
