/* خلفية متحركة */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  height: 100%;
  overflow-x: hidden;
}

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, #00bcd4, #ff4081, #4caf50, #ffeb3b);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  text-align: center;
  padding: 20px;
  color: #fff;
}

h1 {
  margin-bottom: 10px;
  font-size: 2.5rem;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 100px));
  gap: 8px;
  justify-content: center;
  margin: 0 auto 20px;
}

.cell {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  color: #333;
  font-size: 2.5rem;
  font-weight: bold;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.cell.X { color: #2196f3; }
.cell.O { color: #e91e63; }

.status {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.restart-btn {
  padding: 10px 25px;
  font-size: 1rem;
  border: none;
  background: #ffffffcc;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s;
}

.restart-btn:hover {
  background: #ffffff;
  transform: scale(1.05);
}

.xo-image {
  width: 194px;
  height: 158px;
  margin: 20px auto;
  display: block;
}

.footer {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #eeeeee;
}

/* Responsive */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, 70px);
  }

  .cell {
    font-size: 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  .restart-btn {
    font-size: 0.9rem;
  }
}
