/* Vampire-themed styling */
body {
    background: linear-gradient(180deg, #1a0000, #2c003e); /* Dark red to deep purple */
    color: #ff4d4d; /* Blood red text */
    font-family: 'Nosferatu', sans-serif;
    margin: 0;
    /*display: flex; */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    padding: 20px;
    margin: 5% 10%;
    border: 2px solid #ff4d4d;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.5); /* Blood-red glow */
    text-align: center;
}

.game-title {
    font-size: 3rem;
    text-shadow: 0 0 10px #ff4d4d;
    margin-bottom: 20px;
}

.score-panel {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1); /* Parchment-like */
    padding: 10px;
    border-radius: 5px;
}

.difficulty-selector {
    margin-bottom: 20px;
}

#difficulty, #start-game, #submit-guess {
    font-family: 'Nosferatu', sans-serif;
    background: #4d0000; /* Dark red */
    color: #fff;
    border: 2px solid #ff4d4d;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#difficulty:hover, #start-game:hover, #submit-guess:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #ff4d4d;
}

.timer {
    font-size: 1.5rem;
    color: #ff4d4d;
    text-shadow: 0 0 5px #ff4d4d;
    margin-bottom: 10px;
    display: none;
}

.grid {
    display: grid;
    gap: 5px;
    margin-bottom: 20px;
}

.row {
    display: grid;
    grid-template-columns: repeat(4, 50px); /* Adjusted dynamically in JS */
    gap: 5px;
    margin-bottom: 5px;
}

.slot {
    width: 50px;
    height: 50px;
    background: #333; /* Dark rune-like slot */
    border: 2px solid #ff4d4d;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.peg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: grab;
    transition: transform 0.2s;
}

.peg:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px #ff4d4d;
}

.palette {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.feedback {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.feedback-peg {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

#game-message {
    font-size: 1.5rem;
    text-shadow: 0 0 5px #ff4d4d;
}

/* Color classes for pegs */
.red { background: #ff0000; }
.blue { background: #0000ff; }
.yellow { background: #ffff00; }
.green { background: #008000; }
.purple { background: #800080; }
.white { background: #ffffff; }
.orange { background: #ffa500; }
.black { background: #000000; }
.pink { background: #ff69b4; }


/* === Reset and Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #1a2526; /* Dark midnight blue theme */
}

/* Prevent horizontal scrolling when mobile menu is open */
body.menu-open {
  overflow-x: hidden;
}

/* === Container === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Main Header === */
.main-header {
  background-color: #1a2526; /* Dark midnight blue */
  padding: 15px 0;
  border-bottom: 1px solid #2a3b3c;
  position: sticky;
  top: 0;
  z-index: 1000; /* Ensure header stays above content */
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-header .logo img {
  height: 40px;
}

.main-header .logo a {
  text-decoration: none; /* Remove underline from logo link */
  display: inline-block; /* Wrap tightly around image */
}

/* === Navigation Menu === */
.nav-menu {
  position: relative;
  line-height: .75;
}

.nav-menu .menu {
  list-style: none;
  display: flex;
  gap: 20px; /* Space between menu items */
}

.nav-menu .menu li {
  position: relative;
}

.nav-menu .menu li a {
  text-decoration: none;
  color: #ffffff; /* White text for contrast */
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-menu .menu li a:hover {
  color: #b0c4de; /* Light blue hover effect */
}

.nav-menu .menu li a.active {
  color: #b0c4de;
  border-bottom: 2px solid #b0c4de; /* Highlight active link */
}

/* === Dropdown Menu === */
.dropdown .dropbtn {
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.dropdown .dropbtn:hover {
  color: #b0c4de;
}

.dropdown .dropbtn.active {
  color: #b0c4de; /* Highlight active dropdown button */
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #1a2526;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: #ffffff;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #2a3b3c;
  color: #b0c4de;
}

.dropdown:hover .dropdown-content {
  display: block; /* Show dropdown on hover for desktop */
}

/* === Hamburger Menu === */
.hamburger {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
}

.hamburger span {
  background-color: #b0c4de;
  height: 4px;
  width: 100%;
  transition: all 0.3s ease;
}

/* === Main Footer === */
.main-footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
}
.main-footer .container {
    max-width: 1200px;
    margin: 0 auto;
}
.main-footer ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}
.main-footer ul li {
    display: inline;
    margin: 0 15px;
}
.main-footer ul li a {
    color: #fff;
    text-decoration: none;
}
.main-footer ul li a:hover {
    text-decoration: underline;
}

/* === Responsive Design (Mobile) === */
@media (max-width: 768px) {
  /* Header and Navigation */
  .main-header .container {
    flex-direction: row; /* Keep logo and hamburger side by side */
    justify-content: space-between;
    align-items: center;
  }

  .hamburger {
    display: flex; /* Show hamburger menu on mobile */
  }

  .nav-menu {
    overflow: visible; /* Prevent clipping */
    position: relative; /* Ensure context */
  }

  .nav-menu .menu {
    display: none; /* Hide horizontal menu by default */
    flex-direction: column;
    position: fixed; /* Use fixed to ignore container padding */
    top: 70px; /* Adjust for header height */
    left: 0;
    right: 0;
    width: 100vw; /* Full viewport width */
    max-width: 100%; /* Prevent overflow */
    background-color: #1a2526; /* Dark midnight blue */
    padding: 20px;
    box-shadow: none;
    z-index: 998; /* Below header but above content */
    overflow: visible; /* Ensure dropdowns aren’t clipped */
    height: auto; /* Prevent height constraints */
  }

  .nav-menu .menu.active {
    display: flex; /* Show menu when toggled */
  }

  .nav-menu .menu li {
    margin: 15px 0; /* Vertical spacing */
    overflow: visible; /* Prevent clipping */
    height: auto; /* Ensure space for dropdowns */
  }

  .nav-menu .menu li a {
    font-size: 1.2em;
    white-space: normal;
    overflow-wrap: break-word;
    display: block;
    padding: 5px 0; /* Better touch targets */
    color: #ffffff; /* Ensure visibility */
  }

  /* Dropdown Menu on Mobile */
  .dropdown {
    overflow: visible; /* Prevent clipping */
    height: auto; /* Ensure space for content */
  }

  .dropdown:hover .dropdown-content {
    display: none; /* Disable hover effect on mobile */
  }

  .dropdown .dropbtn::after {
    content: ' ▼'; /* Dropdown indicator */
    font-size: 0.8em;
  }

  .dropdown .dropbtn.active::after {
    content: ' ▲'; /* Up arrow for open dropdown */
  }

  .nav-menu .menu li.dropdown .dropdown-content {
    position: static; /* Stack naturally */
    display: none; /* Hidden by default */
    background-color: #2a3b3c; /* Contrast background */
    padding: 10px 20px 10px 40px; /* Indent submenu */
    box-shadow: none;
    z-index: 999; /* Above other menu items */
    min-height: 30px; /* Ensure visibility */
    overflow: visible; /* Prevent clipping */
    width: 100%; /* Full width */
  }

  .nav-menu .menu li.dropdown .dropdown-content.active {
    display: block; /* Show when active */
    visibility: visible;
    opacity: 1;
  }

  .nav-menu .menu li.dropdown .dropdown-content a {
    font-size: 1.1em; /* Slightly smaller */
    padding: 8px 0; /* Touch targets */
    color: #ffffff; /* White text */
    display: block; /* Full-width */
    background-color: transparent; /* No background */
    text-decoration: none;
    overflow: visible; /* Prevent clipping */
    line-height: 1.5; /* Ensure text spacing */
  }
}