/* 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: 1200px;
  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;
}

.page-layout {
    display: flex;
    justify-content: space-between;
    max-width: 1800px;
    margin: 0 auto;
    gap: 20px;
    position: relative;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    min-width: 0;
}

.side-ad {
    width: 300px;
    min-height: 600px;
    position: sticky;
    top: 20px;
    display: none;
}

.left-ad {
    order: 1;
}

.main-content {
    order: 2;
}

.right-ad {
    order: 3;
}

/* Show ads only on larger screens */
@media (min-width: 1400px) {
    .side-ad {
        display: block;
    }
    
    .page-layout {
        padding: 0 20px;
    }
}

/* Adjust main content width on smaller screens */
@media (max-width: 1399px) {
    .main-content {
        margin: 0 auto;
        padding: 0 15px;
    }
}

/* 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: 1200px;
  width: 95%;
  margin: 20px auto;
}

/* Bob and Message Bubble container */
.bob-container {
  display: flex;
  justify-content: center;
  align-items: center;
  /* margin-bottom: 20px; */
}

.bob-image {
  width: 100px;
  height: 100px;
}

.tooltip {
  color: #000;
  font-size: 18px;
  max-width: 28ch;
  text-align: center;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 1em;
  position: relative;
  margin-left: 20px;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 10px 10px 0;
  border-style: solid;
  border-color: transparent #000 transparent transparent;
}

.tooltip::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 8px 8px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

/* Game Container */
.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

/* Start Game Overlay */
.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#start-game {
  background-color: #4da6ff;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#start-game:hover {
  background-color: #3385d6;
}

/* Battleship Game Board */
.boards-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}

.board-wrapper {
  text-align: center;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  background-color: #2f6d9b;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.cell {
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cell:hover {
  background-color: #e6f7ff;
}

.player-ship {
  background: linear-gradient(to bottom right, #87CEFA, #4169E1);
  border: 2px solid #00008B;
}

.hit {
  background-color: #FF6347;
  position: relative;
}

.hit::before, .hit::after {
  content: '';
  position: absolute;
  background-color: white;
  transform: rotate(45deg);
}

.hit::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
}

.hit::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
}

.miss {
  background-color: #4682B4;
  border-radius: 50%;
}

/* Game Status */
#message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #2f6d9b;
}

/* Popup */
.popup {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Game Result */
.popup-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#popup-message {
  font-size: 24px;
  margin-bottom: 20px;
}

#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;
}

#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: 1200px;
  width: 95%;
  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: 10px;
  }

  .boards-container {
    flex-direction: column;
    align-items: center;
  }

  .board-wrapper {
    width: 95%;
    max-width: none;
  }

  .board {
    width: 100%;
    max-width: none;
  }

  .cell {
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .game-area {
    padding: 5px;
  }

  .board-wrapper {
    width: 98%;
  }
}