/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Body and Background */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  align-items:center;
  justify-content:center;
  display:flex;
  min-height:100vh;
  padding:10px;
  color: #333;
}

/* Game Container */
#game-container {
  background: white;
  padding: 40px 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width:400px;
}

/* Scoreboard */
#scoreboard {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #444;
}

#scoreboard p {
  margin: 0 10px;
  user-select: none;
}

/* Title */
#game-container h1 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #333;
  animation: slideDown 1s ease-out;
}

/* Game Board */
#board {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  width:fit-content
  margin: 20px auto;
  padding: 10px;
  background-color: #ecf0f1;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Each Cell */
.cell {
  width: 80px;
  height: 80px;
  background-color: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 12px;
  font-size: 48px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
  touch-action: manipulation;
  animation: pop 0.3s ease-in-out;
}

.cell:hover {
  background-color: #e0e0e0;
  transform: scale(1.05);
}

/* Player Colors */
.cell.X {
  color: #ff6b6b; /* warm red */
}

.cell.O {
  color: #4ecdc4; /* teal */
}

/* Winning Cells */
.winning-cell {
  animation: pulse 1s infinite;
  background-color: #2ecc71 !important; /* green */
  color: white !important;
}

/* Status Message */
#status {
  font-size: 24px;
  margin-top: 20px;
  color: #555;
}

/* Reset Button */
#reset-button {
  padding: 12px 24px;
  font-size: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.6);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

#reset-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.8);
}

/* Touch Enhancements */
.cell:active,
#reset-button:active {
  transform: scale(0.95);
}

/* Footer Text */
.footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #888;
  font-size: 0.9em;
  font-style: italic;
  user-select: none;
  text-align: center;
  text-shadow: 1px 1px 2px #ddd;
}

/* Responsive Design */
@media screen and (max-width: 400px) 
   {
  .cell {
    width: 60px;
    height: 60px;
    font-size: 36px;
    margin:2px;
  }
  #game-container h1 {
    font-size: 32px;
  }
  #status {
    font-size: 18px;
  }
  #reset-button {
    width:100%
    font-size: 16px;
    padding: 10px;
  }
  body{
  padding:10px
  }
}

/* Animations */
@keyframes pop {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); background-color: #27ae60; }
  100% { transform: scale(1); }
}

@keyframes slideDown {
  0%   { transform: translateY(-100px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes wiggle {
0%, 100% { transform: rotate(0deg); }
25% { transform: rotate(-3deg); }
50% { transform: rotate(3deg); }
75% { transform: rotate(-3deg); }
}

/* Responsive adjustments for scoreboard */
@media screen and (max-width: 400px) {
  #scoreboard {
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
  }
}
