* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: #f0f0f0;
  color: #020005;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.dark-mode {
  background: #000601;
  color: #f081fa;
}

.theme-toggle {
  position: absolute;
  top: 15px;
  right: 20px;
}

.theme-toggle button {
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

.mode-selection {
  text-align: center;
  animation: fadeIn 0.6s ease-in-out;
}

.mode-selection button {
  margin: 10px;
  padding: 15px 25px;
  font-size: 18px;
  border: none;
  border-radius: 12px;
  background-color: #4caf50;
  color: rgb(254, 254, 254);
  cursor: pointer;
  transition: background 0.3s;
}

.mode-selection button:hover {
  background-color: #a569ff;
}

.game-container {
  text-align: center;
  animation: slideUp 0.6s ease-in-out;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-gap: 10px;
  margin: 20px auto;
}

.cell {
  width: 100px;
  height: 100px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s;
}

.cell:hover {
  transform: scale(1.05);
}

.result {
  font-size: 24px;
  margin: 20px;
  animation: popIn 0.5s ease;
}

#restartBtn {
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  background: #2196f3;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

#restartBtn:hover {
  background: #1976d2;
}

.hidden {
  display: none;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
