/* Neon Grid Background */
body {
  font-family: "Poppins", sans-serif;
  text-align: center;
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
  overflow: hidden;
  color: #fff;
}

body::before,
body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(0deg, #0ff 0px, #0ff 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(90deg, #0ff 0px, #0ff 1px, transparent 1px, transparent 20px);
  opacity: 0.2;
  z-index: -1;
  animation: moveGrid 10s linear infinite;
}

body::after {
  transform: rotate(45deg);
}

@keyframes moveGrid {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 200px 200px, 200px 200px; }
}

/* Container styling */
.container {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 0 30px #0ff;
  z-index: 1;
}

h1 {
  margin-bottom: 15px;
  text-shadow: 0 0 10px #0ff;
}

.controls {
  margin: 15px 0;
}

button, select {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  margin: 5px;
  background: linear-gradient(45deg, #00f2fe, #4facfe);
  color: black;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover, select:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px #0ff;
}

.scoreboard {
  margin: 10px 0;
  font-size: 18px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 8px;
  justify-content: center;
  margin: 20px auto;
}

.cell {
  width: 100px;
  height: 100px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #0ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}

.cell:hover {
  background: rgba(0, 255, 255, 0.3);
  transform: scale(1.05);
}

.cell.placed {
  transform: scale(1.2);
  box-shadow: 0 0 15px #0ff;
}

.cell.winner {
  animation: winFlash 0.8s infinite alternate;
}

@keyframes winFlash {
  0% {background-color: #00ff7f;}
  100% {background-color: #00ffff;}
}

/* Confetti animation */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  opacity: 0.8;
  animation: fall 3s linear forwards;
}

@keyframes fall {
  0% {transform: translateY(0) rotate(0deg);}
  100% {transform: translateY(100vh) rotate(360deg);}
}
