.saved-game-section {
  margin-top: 15px;
  padding: 15px;
  border: 1px dashed #999;
  border-radius: 8px;
  background-color: #f5f5f5;
  width: 100%;
}

.saved-game-section button {
  margin-bottom: 10px;
  width: 100%;
}

#restore-game-btn {
  background-color: #2196f3;
}

#restore-game-btn:hover {
  background-color: #0b7dda;
}

#clear-saved-game-btn {
  background-color: #ff9800;
}

#clear-saved-game-btn:hover {
  background-color: #e68a00;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f0f0f0;
  margin: 0;
  padding: 20px;
}

h1 {
  color: #333;
  margin-bottom: 10px;
}

h2 {
  color: #333;
  margin-bottom: 20px;
}

/* Screen system */
.screens {
  width: 100%;
  max-width: 600px;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.screen.active {
  display: flex;
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
}

.menu-options button,
.online-options button {
  padding: 12px 20px;
  font-size: 18px;
  cursor: pointer;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.menu-options button:hover,
.online-options button:hover {
  background-color: #45a049;
}

.menu-nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.back-btn {
  background-color: #f44336 !important;
}

.back-btn:hover {
  background-color: #d32f2f !important;
}

.online-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 400px;
}

.join-game {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-game input {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#waiting-room {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
}

#room-code {
  font-weight: bold;
  font-size: 20px;
  color: #4caf50;
}

.room-info {
  margin-bottom: 10px;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

/* Game Options */
.game-options {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
}

.game-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.ai-difficulty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-difficulty select {
  padding: 5px;
  border-radius: 4px;
}

/* Game Board and Elements */
.info {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  width: 480px;
}

.score {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
}

.black-score::before,
.white-score::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 8px;
}

.black-score::before {
  background-color: black;
}

.white-score::before {
  background-color: white;
  border: 1px solid #333;
}

.current-player {
  font-weight: bold;
  font-size: 18px;
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 60px);
  grid-template-rows: repeat(8, 60px);
  gap: 0;
  border: 2px solid #333;
  background-color: #333;
}

.cell {
  width: 60px;
  height: 60px;
  background-color: green;
  border: 1px solid #333;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.disc {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

.black {
  background-color: black;
}

.white {
  background-color: white;
  border: 1px solid #333;
}

.valid-move {
  position: relative;
}

.valid-move::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.controls {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

button {
  padding: 8px 16px;
  font-size: 16px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#leave-game {
  background-color: #f44336;
}

#leave-game:hover {
  background-color: #d32f2f;
}

.message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* Animations */
.thinking {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .board {
    grid-template-columns: repeat(8, calc(100vw / 8 - 4px));
    grid-template-rows: repeat(8, calc(100vw / 8 - 4px));
  }

  .cell {
    width: calc(100vw / 8 - 4px);
    height: calc(100vw / 8 - 4px);
  }

  .disc {
    width: calc(100vw / 10);
    height: calc(100vw / 10);
  }

  .info {
    width: 100%;
    max-width: 480px;
  }
}
