:root {
  --primary-color: #3498db;
  --accent-color: #f39c12;
  --background-color: #f8f9fa;
  --text-color: #2c3e50;
  --grid-color: #34495e;
  --win-highlight: #2ecc71;
  --modal-overlay: rgba(0, 0, 0, 0.7);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Remove flexbox centering from body and create a wrapper for centering */
body {
  display: block;
  padding-top: 2rem;
}

.game-container {
  text-align: center;
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  margin-top: 2rem;
}

h1 {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem;
}

p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--text-color);
}

table {
  border-collapse: collapse;
  margin: 0 auto 20px;
  background-color: var(--grid-color);
  border-radius: 8px;
  overflow: hidden;
}

td {
  border: 5px solid var(--background-color);
  height: 80px;
  width: 80px;
  text-align: center;
  vertical-align: middle;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background-color: white;
  border-radius: 4px;
  transition: all 0.2s ease;
}

td:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.player-x {
  color: var(--primary-color);
}

.player-o {
  color: var(--accent-color);
}

.winning-cell {
  background-color: var(--win-highlight);
  color: white;
}

#resetBtn {
  padding: 12px 24px;
  font-size: 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

#resetBtn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(52, 152, 219, 0.3);
}

#resetBtn:active {
  transform: translateY(0);
}

/* Modal Dialog Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  width: 300px;
  text-align: center;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
  color: var(--text-color);
}

.modal-content button {
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 15px;
  transition: all 0.2s ease;
}

.modal-content button:hover {
  background-color: #2980b9;
}

#dialogMessage {
  font-size: 24px;
  margin: 20px 0;
  font-weight: 600;
}

/* Add scoreboard styles */
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.player-turn {
  margin-bottom: 15px;
  padding: 8px 16px;
  background-color: rgba(52, 152, 219, 0.1);
  border-radius: 50px;
  display: inline-block;
  font-weight: 600;
}

/* Responsive styles */
@media (max-width: 480px) {
  .game-container {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  td {
    height: 70px;
    width: 70px;
    font-size: 36px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .scoreboard {
    gap: 1rem;
    font-size: 1rem;
  }
}
