body {
  font-family: Arial, sans-serif;
  background-color: #f2f2f2;
  color: #444;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
  color: #fff;
  border-radius: 15px;
  width: calc(100% - 40px);
  max-width: 800px;
  margin: 20px auto;
  box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Dark mode adjustments */
.dark-mode header {
  background: linear-gradient(135deg, #2c3e50 0%, #2c3e50 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  header {
    padding: 15px;
    width: calc(100% - 30px);
  }

  header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 400px) {
  header h1 {
    font-size: 1.75rem;
  }
}
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-right: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #333;
}

input:focus + .slider {
  box-shadow: 0 0 1px #1abc9c;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

table {
  margin: 20px auto;
  border-collapse: separate;
  border-spacing: 5px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s;
}

td {
  width: 100px;
  height: 100px;
  text-align: center;
  vertical-align: middle;
  font-size: 60px;
  font-weight: bold;
  cursor: pointer;
  background-color: #f2f2f2;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

td:hover:not(.selected):not([innerHTML]) {
  background-color: #dcdcdc;
  transform: scale(1.05);
}

td.selected {
  background-color: #ccc;
}

td.win {
  background-color: #90EE90;
  animation: pulse 1s infinite;
}

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

#turnDisplay {
  font-size: 24px;
  text-align: center;
  margin: 15px 0;
  font-weight: 600;
  transition: color 0.3s;
}

#gameResult {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
  min-height: 36px;
  transition: color 0.3s;
}

#scoreBoard {
  font-size: 20px;
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: background-color 0.3s;
}

.dark-mode {
  background-color: #222;
  color: #fff;
}

.dark-mode table {
  background-color: #333;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.5);
}

.dark-mode td {
  background-color: #444;
  color: #fff;
}

.dark-mode td:hover:not(.selected):not([innerHTML]) {
  background-color: #555;
}

.dark-mode select {
  background-color: #444;
  color: #fff;
}

.dark-mode select option {
  background-color: #444;
  color: #fff;
}

button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#twoPlayerButton {
  background-color: #4CAF50;
  color: white;
}

#twoPlayerButton:hover {
  background-color: #3e8e41;
  transform: translateY(-2px);
}

#restartButton {
  background-color: #f44336;
  color: white;
}

#restartButton:hover {
  background-color: #d32f2f;
  transform: translateY(-2px);
}

select {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #444;
  background-color: #f0f0f0;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

label[for="difficulty"] {
  font-size: 16px;
  font-weight: 600;
  margin-right: 10px;
}

/* Add disabled state styles */
td[innerHTML]:hover {
  cursor: not-allowed;
  transform: none;
}

/* Animation for winning combination */
@keyframes winHighlight {
  0% {
    background-color: #90EE90;
  }
  50% {
    background-color: #70DA70;
  }
  100% {
    background-color: #90EE90;
  }
}

.win {
  animation: winHighlight 1s infinite;
}

/* Responsive design */
@media (max-width: 600px) {
  td {
    width: 80px;
    height: 80px;
    font-size: 48px;
  }
  
  button {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  select {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  #turnDisplay, #gameResult {
    font-size: 20px;
  }
}

@media (max-width: 400px) {
  td {
    width: 60px;
    height: 60px;
    font-size: 36px;
  }
}