body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle, #0a0a1a 0%, #000000 80%);
  font-family: monospace;
  color: white;
  text-align: center;
  overflow-y: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

#loading-screen[style*="display: none"] .loading-gif {
  display: none !important;
}

#main-content {
  flex: 1 0 auto;
  width: 90%;
  max-width: 1200px;
  padding: 20px 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  width: 100%;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-content {
  text-align: center;
  width: 100%;
  max-width: 1200px;
}

.main-logo {
  width: 150px;
  height: auto;
  margin-bottom: 10px;
}

.logo-title {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.social-contract {
  display: flex;
  align-items: center;
  gap: 10px; /* Уменьшенный зазор для мобильных */
  margin-top: 5px;
  justify-content: center;
  flex-wrap: wrap; /* Перенос элементов на мобильных */
}

.social-icons {
  display: flex;
  gap: 5px; /* Уменьшенный зазор между иконками */
}

.social-icons a {
  margin: 0;
}

.social-icons img {
  width: 20px; /* Уменьшен размер иконок для мобильных */
  height: auto;
}

.contract {
  font-size: 0.7rem; /* Уменьшен шрифт для мобильных */
  color: #ccc;
  word-break: break-all; /* Разбиение длинного текста */
  max-width: 100%; /* Ограничение ширины */
}

.description {
  width: 100%;
  max-width: 90%;
  margin: 20px auto;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  line-height: 1.5;
  text-align: justify;
  text-justify: inter-word;
  display: block;
  box-sizing: border-box;
  padding: 0 10px;
}

.description p {
  margin: 0 0 10px;
  text-align: justify;
}

.highlight {
  color: yellow;
  font-weight: bold;
}

.highlight-large {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: #CD7F32;
  margin-top: 10px;
}

.gallery {
  width: 100%;
  max-width: 90%;
  margin: 20px auto;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.gallery-track {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  width: 100%;
  max-width: 90%;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(90px, 12vw, 140px);
  height: clamp(100px, 14vw, 154px);
  border: 2px solid #000000;
  border-radius: 10px;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.image-container {
  width: 100%;
  height: clamp(80px, 11vw, 126px);
  overflow: hidden;
  position: relative;
}

.centered-image {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-image.active {
  opacity: 1;
}

.gallery-text {
  margin-top: 5px;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  color: white;
}

.how-button {
  margin: 20px 0;
  border: 1px solid white;
  background: transparent;
  color: white;
  padding: 5px 15px;
  text-decoration: none;
  display: inline-block;
  font-size: clamp(0.8rem, 2vw, 1rem);
}

.image-container {
  width: 100%;
  height: clamp(400px, 50vh, 1000px);
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  max-width: 90%;
}

@media (max-width: 768px) {
  .main-logo {
    width: 100px;
  }
  .gallery-cell {
    width: 90px;
    height: 100px;
  }
  .image-container {
    height: clamp(250px, 40vh, 500px);
  }
  .description {
    font-size: 0.7rem;
    padding: 0 5px;
  }
  .social-icons img {
    width: 18px; /* Ещё меньше для очень маленьких экранов */
  }
  .contract {
    font-size: 0.6rem; /* Ещё меньше для читаемости */
  }
}

@media (min-aspect-ratio: 16/9) {
  .description {
    max-width: 80%;
  }
  .gallery-track {
    max-width: 85%;
  }
  .image-container {
    height: clamp(500px, 60vh, 1200px);
  }
}

@media (max-aspect-ratio: 4/3) {
  .description {
    max-width: 95%;
  }
  .gallery-track {
    max-width: 95%;
  }
  .image-container {
    height: clamp(400px, 55vh, 900px);
  }
}

.emoji {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

canvas#emoji-background {
  display: none;
}
