/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(-45deg, #00c6ff, #0072ff, #00f2ff, #005bbb);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  text-align: center;
}

h1 {
  margin-bottom: 20px;
  color: #fff;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Board */
.board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.cell {
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.3s, background 0.3s, color 0.3s;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cell:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,1);
}

.cell.marked {
  transform: scale(1.2);
  color: #ff5722;
}

/* Winning cells */
.win {
  background: linear-gradient(45deg, #ff5252, #ffeb3b);
  animation: glow 0.6s ease-in-out infinite alternate;
}

@keyframes glow {
  0% { box-shadow: 0 0 5px #ff5252; }
  100% { box-shadow: 0 0 20px #ffeb3b; }
}

/* Info */
.info { margin-top: 10px; }
#message { font-size: 1.5rem; margin-bottom: 15px; transition: color 0.3s; }
#message.x-turn { color: #ff5252; }
#message.o-turn { color: #2196f3; }

/* Button */
button {
  padding: 10px 20px;
  border: none;
  background: #0078ff;
  color: white;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
  transition: background 0.3s;
}
button:hover { background: #005bb5; }

/* Confetti */
.confetti {
  position: fixed;
  top: 0;
  width: 8px;
  height: 8px;
  opacity: 0.8;
  animation: drop 3s linear forwards;
}

@keyframes drop {
  0% { top: 0; transform: rotate(0deg); }
  100% { top: 100vh; transform: rotate(360deg); }
}

/* Responsive */
@media(max-width: 400px) {
  .board {
    grid-template-columns: repeat(3, 70px);
    grid-template-rows: repeat(3, 70px);
  }
  .cell { font-size: 2rem; }
}
