* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Убираем overflow с body — это ломает position: fixed на iOS */
html {
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(-45deg, #03001e, #9c27b0, #ec38bc);
  background-size: 400% 400%;
  min-height: 100dvh;
  /* НЕ ставим overflow на body */
  animation: gradientShift 15s ease infinite;
  position: relative;
  color: white;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* === ФОНОВЫЕ СЛОИ === */
.bg-elements,
.particles,
.music-notes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* чтобы не мешать кликам */
  z-index: 1;
}

.particles {
  z-index: 2;
}

.music-notes {
  z-index: 3;
}

/* === АНИМАЦИИ ФОНА (ОТДЕЛЬНО!) === */
@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;
  }
}

/* Элементы фона */
.bg-element {
  position: absolute;
  border-radius: 50%;
  animation: float 20s linear infinite;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: particleFloat 20s linear infinite;
}

.note {
  position: absolute;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4);
  animation: noteFloat 15s linear infinite;
}

/* === КОНТЕНТ (ВСЕГДА ВЕРХНИЙ СЛОЙ) === */
.container {
  position: relative;
  z-index: 10;
  padding: 20px;
  min-height: 100dvh; /* безопасная высота для iOS */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* === ЛОГОТИП === */
.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;
}

.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);
  margin-bottom: 10px;
  animation: fadeIn 1.5s ease-out;
}

.slogan {
  color: white;
  font-size: 1.8rem;
  font-weight: 300;
  text-shadow: 0 0 10px rgba(236, 56, 188, 0.6);
  letter-spacing: 1px;
  line-height: 1.4;
  max-width: 800px;
  margin: 0 auto 30px;
  animation: fadeIn 2s ease-out;
}

/* === QR И КНОПКИ === */
.qr-section {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  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;
  margin-bottom: 30px;
}

.qr-link {
  display: inline-block;
  text-decoration: none;
}

.qr-link:hover {
  transform: scale(1.05);
}

.qr-code {
  background: white;
  padding: 15px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 20px;
  animation: subtle-pulse 3s infinite;
}

.qr-code img {
  width: 200px;
  height: 200px;
  border-radius: 5px;
  display: block;
}

.qr-description {
  color: white;
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 15px;
}

/* === TELEGRAM QR С ИКОНКОЙ === */
/* Гарантируем, что Telegram QR не вылезет */
.telegram-qr {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

.telegram-qr .qr-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* или contain — как вам нужно */
  display: block;
}

.telegram-qr::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(
    45deg,
    rgba(0, 136, 204, 0.2),
    rgba(36, 161, 222, 0.2)
  );
  border-radius: 12px;
  z-index: -1;
  animation: qr-border-pulse 3s infinite;
}

/* === КНОПКИ === */
.download-btn,
.telegram-btn {
  display: inline-block;
  color: white;
  text-decoration: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 11;
}

.download-btn {
  background: linear-gradient(45deg, #9c27b0, #ec38bc);
  box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
  animation: subtle-pulse 2s infinite;
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(156, 39, 176, 0.6);
  background: linear-gradient(45deg, #ec38bc, #9c27b0);
}

.telegram-btn {
  background: linear-gradient(45deg, #0088cc, #24a1de);
  box-shadow: 0 5px 15px rgba(0, 136, 204, 0.4);
  animation: subtle-pulse 2s infinite;
}

.telegram-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.6);
  background: linear-gradient(45deg, #24a1de, #0088cc);
}

/* === ФУТЕР === */
.contact {
  text-align: center;
  margin-top: auto;
  padding: 20px 0;
}

.contact-link,
.ads-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 20px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.contact-link {
  color: white;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.contact-link:hover {
  background: rgba(236, 56, 188, 0.2);
  text-shadow: 0 0 20px rgba(236, 56, 188, 1);
  transform: translateY(-2px);
}

.ads-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 15px;
}

.ads-link:hover {
  color: #ec38bc;
  background: rgba(236, 56, 188, 0.1);
  transform: translateY(-1px);
}

/* === АНИМАЦИИ КОНТЕНТА === */
@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);
  }
}

@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);
  }
}

@keyframes qr-border-pulse {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
}

/* === АДАПТИВНОСТЬ === */
@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,
  .telegram-btn {
    padding: 10px 25px;
    font-size: 1rem;
  }
  .contact-link {
    font-size: 1.1rem;
    padding: 6px 16px;
  }
  .ads-link {
    font-size: 0.8rem;
  }
}

@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 img {
    width: 160px;
    height: 160px;
  }
  .qr-logo-overlay {
    width: 35px;
    height: 35px;
  }
  .qr-telegram-icon {
    width: 22px;
    height: 22px;
  }
  .telegram-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
}

@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;
  }
}
