/* Reset some basic styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden; /* Remove horizontal scrollbar */
  font-family: Arial, sans-serif;
  background-color: #85CE5E;
  color: #fff;
  text-align: center;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav-links {
  position: fixed; /* Ensure nav-links stay at the top */
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 1000; /* Ensure nav-links are on top */
}

/* Общие стили для изображений */
img {
  width: 256px;
  height: 256px;
  cursor: pointer;
  user-select: none; /* Отключаем выделение */
  /* Удалено pointer-events: none; */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Добавляем плавный переход */
  /* Чтобы предотвратить перетаскивание изображений */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  draggable: false;
}

/* Разрешаем pointer-events для изображений внутри ссылок */
.nav-links a img {
  pointer-events: auto; /* Разрешаем взаимодействие */
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
  border-radius: 15px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Наведение на изображения внутри ссылок */
.nav-links a:hover img {
  transform: scale(1.1); /* Увеличение до 1.1 */
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* Наведение на основные GIF изображения */
.hello-gif:hover,
.honka-edge:hover {
  transform: scale(1.1); /* Увеличение до 1.1 */
  cursor: pointer; /* Курсор в виде руки */
}

/* Дополнительные стили остальной части CSS остаются без изменений */

/* Make the main block higher by 70px */
main {
  flex: 1; /* Take up available space */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin-top: -70px; /* Shift main content higher by 70px */
}

.main-container {
  display: flex;
  align-items: center;
  gap: 70px; /* Increased gap to 70px */
}

/* Additional container for text on the right */
.text-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left align the text in the column */
}

.hello-gif {
  width: 256px;
  height: 256px;
  cursor: pointer; /* Indicate that the image is clickable */
  transition: transform 0.3s ease;
}

.main-text {
  font-size: 56px;
  font-weight: bold;
  animation: fadeIn 2s ease;
  margin: 0; /* Remove default h1 margin for cleaner layout */
}

/* Animated Meme Description */
.meme-description {
  font-size: 22px;
  color: #fff;
  margin-top: 10px;
  /* Удалены следующие свойства для разрешения переноса строк */
  /* white-space: nowrap;
  overflow: hidden;
  border-right: .15em solid #fff;
  width: 0; */
  /* Добавлены новые свойства */
  max-width: 400px; /* Максимальная ширина контейнера */
  margin: 0 auto; /* Центрирование текста */
  position: relative;
}

/* Создаём псевдоэлемент для анимации курсора */
.meme-description::after {
  content: '|';
  position: absolute;
  right: 0;
  animation: blink-caret 0.75s step-end infinite;
}

/* Анимация печати с использованием ключевых кадров */
@keyframes typing {
  from { 
    /* Начинаем с полной прозрачности */
    opacity: 0; 
  }
  to { 
    /* Полностью отображаем текст */
    opacity: 1; 
  }
}

/* Анимация мерцания курсора */
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #fff; }
}

/* Применяем анимацию к описанию мемов */
.meme-description {
  opacity: 0;
  animation: typing 4s forwards;
}


.ca-wrapper {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 10px;
  margin-top: 20px;
  animation: fadeInUp 2.5s ease;
}

.ca-text {
  font-size: 20px;
  color: #fff;
  margin-right: 10px;
  word-break: break-all; /* Allow long text to wrap */
}

.copy-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.copy-btn:hover {
  transform: scale(1.2);
}

.sub-text {
  font-size: 26px;
  margin-top: 20px;
  color: #ffcc00;
  animation: fadeInUp 2.5s ease;
}

footer {
  width: 100%;
  padding: 20px 0;
  font-size: 14px;
  color: #ccc;
  background: rgba(0, 0, 0, 0.1);
}

/* Lower the side HONKAs by 70px (from the center) */
.honka-edge {
  position: fixed;
  width: 128px;
  height: 128px;
  top: calc(50% + 70px);
  transform: translateY(-50%);
  z-index: 500; /* Below nav-links */
  transition: transform 0.3s ease; /* Добавьте плавный переход */
}

.honka-edge.left {
  left: 10px;
}

.honka-edge.right {
  right: 10px;
}

.mirrored {
  transform: translateY(-50%) scaleX(-1); /* Mirror the right GIF */
}

/* Наведение на левую хонку */
.honka-edge.left:hover {
  transform: translateY(-50%) scale(1.1); /* Увеличение до 1.1 */
  cursor: pointer;
}

/* Наведение на правую хонку */
.honka-edge.right:hover {
  transform: translateY(-50%) scaleX(-1.1); /* Увеличение до 1.1 по X */
  cursor: pointer;
}


/* Toast Notification Styles */
#toast {
  visibility: hidden; /* Hidden by default */
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 16px;
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.5s ease, top 0.5s ease;
}

#toast.show {
  visibility: visible;
  opacity: 1;
  top: 50px; /* Slightly lower to create a sliding effect */
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
      flex-direction: column;
      gap: 20px;
  }

  .hello-gif {
      width: 150px;
      height: 150px;
  }

  .main-text {
      font-size: 36px;
  }

  .nav-links a img {
      width: 64px;
      height: 64px;
  }

  .meme-description {
      font-size: 18px;
  }

  .text-container {
      align-items: center;
  }

  .honka-edge {
      top: calc(50% + 70px); /* Maintain the downward shift on smaller screens */
  }
}

.falling-gif {
  position: absolute; 
  width: 50px;               /* Размер мини-гифки */
  height: 50px;              /* Размер мини-гифки */
  pointer-events: none;      /* Чтобы не мешала кликам */
  z-index: 9999;             /* Чтобы была поверх всего */

  opacity: 1;
  animation: fallAndFade 1s ease forwards; /* Анимация 1 секунда */
}

/* Ключевые кадры анимации */
@keyframes fallAndFade {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: 
      translate(
        calc(var(--randX, 0px)),  /* Случайное смещение по X */
        calc(var(--randY, 0px))   /* Случайное смещение по Y */
      ) 
      scale(0.5);                  /* Уменьшение размера */
    opacity: 0;
  }
}
