/* Reset CSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styling */
body {
  font-family: 'Oswald', sans-serif;
  background: linear-gradient(180deg, #2f6d9b, #afcffe);
  color: #333;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Centering Containers */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  padding: 20px 0;
}

.logo-container {
  text-align: center;
}

.logo {
  font-size: 36px;
  color: #fff;
  text-decoration: none;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.desktop-nav a {
  font-size: 16px;
  color: #fff;
  text-decoration: none;
}

.desktop-nav a:hover {
  text-decoration: underline;
}

/* Hamburger Menu for Mobile */
.hamburger-menu {
  display: none;
  position: relative;
}

.hamburger-icon {
  font-size: 30px;
  cursor: pointer;
  position: absolute;
  top: 15px;
  left: 15px;
  color: #fff;
}

.hamburger-links {
  display: none;
  flex-direction: column;
  background-color: #003366;
  padding: 10px;
  position: absolute;
  top: 50px;
  left: 0;
  width: 200px;
  z-index: 99;
}

.hamburger-links.active {
  display: flex;
}

.hamburger-links a {
  color: #fff;
  padding: 10px;
  text-decoration: none;
}

.hamburger-links a:hover {
  background-color: #2f6d9b;
}

/* Game Area Box */
.game-area {
  position: relative;
  background-color: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 550px;
  width: 97%;
  margin: 20px auto;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0;
}

.score-box {
  border-radius: 10px;
  padding: 10px 15px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px; /* Added margin to move score boxes up */
}

.score-box.black {
  background-color: #000;
  color: #fff;
}

.score-box.white {
  background-color: #fff;
  color: #000;
  border: 1px solid #000;
}

.score-box h2 {
  margin: 0;
  font-size: 18px;
}

.score-box p {
  font-size: 24px;
  font-weight: bold;
  margin: 5px 0 0;
}

/* Bob and Message Bubble container */
.bob-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.bob-image {
  width: 100px;
  height: 100px;
  margin-right: 15px;
  position: relative;
  bottom: -1px; /* Keeping Bob in the same position */
}

.tooltip {
  color: #000;
  font-size: 18px;
  width: 180px;
  text-align: center;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 10px 15px;
  position: relative;
  bottom: 25px;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 12px 12px 12px 0;
  border-style: solid;
  border-color: transparent #000 transparent transparent;
}

.tooltip::after {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 10px 10px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

/* Game Container */
#game-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  z-index: 1;
}

#board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-gap: 1px;
  background-color: #000;
  border: 1px solid #000;
  aspect-ratio: 1 / 1;
}

.cell {
  background-color: #008000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.black::after, .white::after {
  content: '';
  width: 80%;
  height: 80%;
  border-radius: 50%;
}

.black::after {
  background-color: black;
}

.white::after {
  background-color: white;
}

.valid-move::after {
  content: '';
  width: 60%;
  height: 60%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

/* Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* Game Settings */
.settings-content, .result-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
  background-color: red;
  color: white;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
}

.setting {
  margin-bottom: 20px;
  text-align: left;
}

.setting label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.button-group {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.option-btn {
  flex: 1;
  background-color: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  padding: 10px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: bold;
}

.option-btn:hover {
  background-color: #f0f0f0;
}

.option-btn.active {
  background-color: #4da6ff;
  border-color: #4da6ff;
  color: white;
}

#start-game, #play-again {
  background-color: #4da6ff;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 20px;
  width: 100%;
  font-weight: bold;
}

#start-game:hover, #play-again:hover {
  background-color: #3385d6;
}

/* How to Play Section */
.how-to-play {
  background: linear-gradient(135deg, #d4fc79, #96e6a1);
  color: #333;
  padding: 40px;
  border-radius: 10px;
  max-width: 900px;
  width: 97%;
  margin: 20px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.how-to-play h2 {
  margin-bottom: 20px;
  color: #333;
}

.how-to-play p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Footer */
footer {
  background: black;
  color: white;
  padding: 40px 0 0 0;
  width: 100%;
  margin-top: auto;
}

.footer-content-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.footer-column {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  font-size: 24px;
  color: white;
  text-decoration: none;
}

.footer-column h4 {
  margin-bottom: 10px;
}

.footer-column a {
  color: white;
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-column a:hover {
  text-decoration: underline;
}

/* Copyright Text */
.copyright {
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
  color: #fff;
  background: black;
  margin-top: 20px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .hamburger-menu {
    display: block;
  }
  
  .game-area {
    padding: 20px;
  }

  #board {
    max-width: 100%;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .game-area {
    padding: 10px;
  }

  .settings-content, .result-content {
    padding: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}