body {
  font-family: 'Segoe UI', sans-serif;
  background: #e7f0fd;
  margin: 0;
  color: #333;
}

.top-bar {
  background: #f0f4ff;
  padding: 8px 20px;
  text-align: right;
  font-size: 16px;
}

.top-bar a {
  margin-left: 15px;
  text-decoration: none;
  color: #2b5dab;
  font-weight: bold;
}

header {
  background: #4a90e2;
  color: white;
  text-align: center;
  padding: 25px 15px;
  position: relative;
}

header img {
  width: 70px;
  margin-bottom: 10px;
}

nav {
  background: #d0e2ff;
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 12px 0;
  font-weight: bold;
  transition: 0.3s ease;
}

nav a {
  color: #2b5dab;
  text-decoration: none;
  font-size: 18px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 20px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: 0.3s;
}

main {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 15px;
}

h2 {
  color: #2b5dab;
}

ul.rules {
  list-style: none;
  padding: 0;
}

.rules li {
  background: white;
  margin: 10px 0;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.story-box {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.game-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 20px auto;
  text-align: center;
}

.game-frame {
  position: relative;
  width: 100%;
  padding-top: 83%;
  border-radius: 12px;
  overflow: hidden;
}

.game-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.game-note {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

footer {
  background: #4a90e2;
  color: white;
  text-align: center;
  padding: 15px 0;
  margin-top: 40px;
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: center;
    display: none;
  }

  nav.show {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* Кнопка вверх */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #4a90e2, #357ABD);
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(53, 122, 189, 0.5);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transform: translateY(20px);
}

#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  background: linear-gradient(135deg, #357ABD, #2a5c8c);
  box-shadow: 0 8px 16px rgba(42, 92, 140, 0.7);
  transform: translateY(-2px);
}

#scrollTopBtn::before {
  content: '';
  border: solid white;
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 7px;
  transform: rotate(-135deg);
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}
