* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(-45deg, #03001e, #9c27b0, #ec38bc);
  background-size: 400% 400%;
  min-height: 100vh;
  overflow: auto;
  animation: gradientShift 15s ease infinite;
  position: relative;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Исправляем контейнер для правильного позиционирования */
.container {
  position: relative;
  z-index: 100; /* Высокий z-index для основного контента */
  padding: 20px;
}

/* Все анимированные элементы фона ДОЛЖНЫ иметь отрицательный z-index */
.bg-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1; /* Самый низкий уровень */
}

.bg-element {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: float 20s linear infinite;
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2; /* Чуть выше bg-elements */
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: particleFloat 20s linear infinite;
}

.music-notes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3; /* Чуть выше particles, но всё равно на фоне */
}

.note {
  position: absolute;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4);
  animation: noteFloat 15s linear infinite;
}

/* Основной контент должен быть выше всего */
.logo-container,
.title,
.slogan,
.qr-section,
.contact {
  position: relative;
  z-index: 10; /* Выше чем фон, но ниже контейнера */
}

/* Логотип */
.logo {
  width: 250px;
  height: 250px;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.7));
  border-radius: 20%;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 15; /* Выше чем заголовок и слоган */
}

.logo-inner {
  width: 100%;
  height: 100%;
  background-image: url("icons/white-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(236, 56, 188, 0.7);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 20px rgba(236, 56, 188, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(236, 56, 188, 0);
  }
}

.title {
  color: white;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(236, 56, 188, 0.8);
  animation: fadeIn 1.5s ease-out;
  margin-bottom: 10px;
  position: relative;
  z-index: 12;
}

.slogan {
  color: white;
  font-size: 1.8rem;
  font-weight: 300;
  text-shadow: 0 0 10px rgba(236, 56, 188, 0.6);
  letter-spacing: 1px;
  animation: fadeIn 2s ease-out;
  line-height: 1.4;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 11;
}

/* Секция с QR-кодом */
.qr-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  max-width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideUp 1s ease-out;
  text-align: center;
  position: relative;
  z-index: 14;
}

/* Стили для кликабельного QR-кода */
.qr-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 16;
}

.qr-link:hover {
  transform: scale(1.05);
}

.qr-link:hover .qr-code {
  box-shadow: 0 10px 30px rgba(156, 39, 176, 0.4);
}

/* Обновленные стили для QR-кода */
.qr-code {
  background: white;
  padding: 15px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  animation: subtle-pulse 3s infinite;
}

.qr-code::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  background: linear-gradient(45deg, rgba(156, 39, 176, 0.1), rgba(236, 56, 188, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qr-link:hover .qr-code::after {
  opacity: 1;
}

.qr-code img {
  width: 200px;
  height: 200px;
  border-radius: 5px;
  display: block;
  position: relative;
  z-index: 1;
}

.qr-description {
  color: white;
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 15px;
  position: relative;
  z-index: 13;
}

/* Анимация пульсации для кнопки и QR-кода */
@keyframes subtle-pulse {
  0% {
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.2);
  }
  50% {
    box-shadow: 0 5px 25px rgba(156, 39, 176, 0.4);
  }
  100% {
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.2);
  }
}

.download-btn {
  animation: subtle-pulse 2s infinite;
  display: inline-block;
  background: linear-gradient(45deg, #9c27b0, #ec38bc);
  color: white;
  text-decoration: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 16;
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(156, 39, 176, 0.6);
  background: linear-gradient(45deg, #ec38bc, #9c27b0);
  color: white;
  text-decoration: none;
}

/* Контакт (Футер) */
.contact {
  padding: 20px 0;
  text-align: center;
  position: relative;
  z-index: 14;
}

.contact-link {
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  padding: 8px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  display: inline-block;
  margin-bottom: 8px;
  position: relative;
  z-index: 15;
}

.contact-link:hover {
  text-shadow: 0 0 20px rgba(236, 56, 188, 1);
  background: rgba(236, 56, 188, 0.2);
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}

/* Стили для ссылки на app-ads.txt */
.ads-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 4px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 15;
}

.ads-link:hover {
  color: rgba(236, 56, 188, 1);
  background: rgba(236, 56, 188, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Анимации фона */
@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(-100px) translateX(calc(100vw * var(--random-x)));
    opacity: 0;
  }
}

@keyframes noteFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Анимации основного контента */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .logo {
    width: 200px;
    height: 200px;
  }

  .title {
    font-size: 3rem;
  }

  .slogan {
    font-size: 1.5rem;
    padding: 0 15px;
  }

  .qr-section {
    padding: 20px;
    max-width: 280px;
  }

  .qr-code img {
    width: 180px;
    height: 180px;
  }

  .download-btn {
    padding: 10px 25px;
    font-size: 1rem;
  }

  .contact-link {
    font-size: 1.1rem;
    padding: 6px 16px;
  }

  .ads-link {
    font-size: 0.8rem;
    padding: 3px 10px;
  }
}

@media (max-width: 576px) {
  .logo {
    width: 180px;
    height: 180px;
  }

  .title {
    font-size: 2.5rem;
  }

  .slogan {
    font-size: 1.2rem;
  }

  .qr-section {
    padding: 15px;
    max-width: 250px;
  }

  .qr-code {
    padding: 10px;
  }

  .qr-code img {
    width: 160px;
    height: 160px;
  }

  .contact-link {
    font-size: 1rem;
    padding: 5px 14px;
  }

  .ads-link {
    font-size: 0.75rem;
  }

  .container {
    padding: 15px;
  }
}

@media (max-width: 400px) {
  .logo {
    width: 160px;
    height: 160px;
  }

  .title {
    font-size: 2.2rem;
  }

  .slogan {
    font-size: 1.1rem;
  }

  .qr-section {
    max-width: 230px;
  }

  .qr-code img {
    width: 140px;
    height: 140px;
  }
}

/* Индикатор кликабельности на мобильных */
@media (max-width: 768px) {
  .qr-link:active .qr-code {
    transform: scale(0.95);
  }
}