* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
  overflow-x: hidden;
}

.container {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 500px;
  width: 90%;
}

h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.1rem;
  margin-bottom: 30px;
  opacity: 0.9;
  font-weight: 300;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-info {
  text-align: center;
}

.player-label {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 5px;
}

.player-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: #4ecdc4;
}

.current-player {
  background: rgba(78, 205, 196, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(78, 205, 196, 0.5);
}

#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #000;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cell:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cell.x {
  color: #ff6b6b;
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cell.o {
  color: #4ecdc4;
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cell.winning {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  border-color: #4ecdc4;
  animation: winnerPulse 1s ease-in-out infinite;
}

@keyframes popIn {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes winnerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

#message {
  margin: 20px 0;
  font-size: 1.3rem;
  font-weight: 600;
  min-height: 2rem;
  padding: 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

button:active {
  transform: translateY(0);
}

.difficulty-btn {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.difficulty-btn:hover {
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
}

.difficulty-btn.active {
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.6);
}

/* Easy button - Green */
.difficulty-btn[onclick*="easy"] {
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.difficulty-btn[onclick*="easy"]:hover {
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

.difficulty-btn[onclick*="easy"].active {
  background: linear-gradient(45deg, #27ae60, #229954);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.6);
}

/* Medium button - Yellow */
.difficulty-btn[onclick*="medium"] {
  background: linear-gradient(45deg, #f39c12, #e67e22);
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.difficulty-btn[onclick*="medium"]:hover {
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

.difficulty-btn[onclick*="medium"].active {
  background: linear-gradient(45deg, #e67e22, #d35400);
  box-shadow: 0 4px 15px rgba(230, 126, 34, 0.6);
}

/* Hard button - Red */
.difficulty-btn[onclick*="hard"] {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.difficulty-btn[onclick*="hard"]:hover {
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.difficulty-btn[onclick*="hard"].active {
  background: linear-gradient(45deg, #c0392b, #a93226);
  box-shadow: 0 4px 15px rgba(192, 57, 43, 0.6);
}

.difficulty-selector {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.difficulty-label {
  margin-bottom: 10px;
  font-weight: 600;
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
    margin: 20px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .cell {
    font-size: 2.5rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
}
