body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background: #000;
  color: white;
  padding: 0px;
  position: relative;
  width: 100%;
}

.header-container {
  display: flex;
  flex-direction: column;
  max-width: 1200px; /* Ограничение ширины для крупных экранов */
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: center; /* Логотип и меню в центре */
  gap: 20px; /* Расстояние между логотипом и меню */
  width: 100%;
  flex-wrap: nowrap;
}

.logo {
  width: 100px;
  height: auto;
  padding: 10px 10px 0px 10px;
}

.logo_on_home {
  height: auto;
  padding: 10px 10px 0px 10px;
}

#gameContainer
{
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
}

#main-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content; /* Ширина меню по содержимому */
  position: relative;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 8px;
  position: relative;
  transition: background 0.3s;
}

nav a:hover::after,
nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: white;
  transition: all 0.3s ease;
  color: white;
}

nav a:hover,
nav a:focus,
nav a.active {
  background: none;
  color: white;
  outline: none; /* убрать голубую рамку в некоторых браузерах */
  text-decoration: none; /* страхуемся при наведении и фокусе */
}

.highlight-bar {
  position: absolute;
  height: 4px;
  background: white;
  bottom: -1px;
  left: 0;
  width: 0;
  transition: all 0.3s ease;
}

.social {
  display: flex;
  gap: 10px;
  margin-top: 10px; /* Отступ сверху для соцсетей */
}

.social a {
  color: white;
  text-decoration: none;
  font-size: 20px;
}

.hamburger {
  display: none; /* Скрыт на десктопе */
  cursor: pointer;
  font-size: 24px;
  color: white;
}

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding: 20px;
}

footer {
  text-align: center;
  padding: 10px;
  background: #eee;
  font-size: 14px;
  color: #444;
}

.nav-icon {
  transition: transform 0.2s ease;
}

.nav-icon:hover {
  transform: scale(1.2) rotate(20deg);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

@media (max-width: 768px) {
  .top-row {
    justify-content: space-between; /* Логотип слева, бургер справа */
    width: 100%;
  }
  
  .logo_on_home {
	width: 100px;
	height: auto;
	padding: 10px 10px 0px 10px;
  }

  #main-menu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    flex-direction: column;
    width: 100%;
    background: #333;
    padding: 0 10px;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    opacity: 1;
    pointer-events: auto; /* <- разрешаем клики */
    z-index: 1000;         /* <- поверх всего */	
  }

  #main-menu.active {
    max-height: 1000px;
    padding: 10px;
  }
  
  .highlight-bar {
   position: absolute;
   height: 2px;
   background: white;
   bottom: 2px;
   left: 0;
   width: 0;
   transition: all 0.3s ease;
  }  

  .hamburger {
    display: block;
    align-self: center;
    margin-left: auto;
  }

  .social {
    display: none; /* Скрываем десктопные соцсети */
  }

  .mobile-social-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
  }

  nav a,
  .mobile-social-wrapper a {
    width: 100%;
    padding: 12px;
    border-bottom: 1px solid #333;
    text-align: left;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }

  .mobile-social-wrapper {
    display: none;
  }

  .social {
    display: flex;
    gap: 10px;
  }
}