/* Базовые стили: reset, body, фон, сердечки, типографика, утилиты */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Pacifico&display=swap');

/* ──── Reset ──── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

/* ──── Body + фон-градиент ──── */
body {
  font-family: 'Comfortaa', sans-serif;
  color: var(--text);
  background: var(--bg-grad);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  /* убираем синий flash при тапе на iOS */
  -webkit-tap-highlight-color: transparent;
}

/* ──── Плавающие сердечки на фоне ──── */
.heart-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart-bg span {
  position: absolute;
  bottom: -40px;
  opacity: 0.5;
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}

@keyframes floatUp {
  to {
    transform: translateY(-110vh) rotate(360deg);
    opacity: 0;
  }
}

/* Отключаем сердечки для пользователей с prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .heart-bg span {
    display: none;
  }
}

/* ──── Типографика ──── */
h1, h2 {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
}

h1 {
  font-size: clamp(24px, 6vw, 30px);
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(20px, 5vw, 26px);
  margin-bottom: 6px;
}

p.sub {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 22px;
  color: var(--text-soft);
}

/* ──── Конфетти-слой (портал для конфетти) ──── */
#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

/* ──── Утилиты ──── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Сообщение об ошибке в стиле сайта */
.error-msg {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--pink-300);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--pink-600);
  margin-top: 12px;
  text-align: center;
  animation: pop 0.3s var(--ease-spring) both;
}

/* Индикатор загрузки */
.loading-msg {
  color: var(--text-soft);
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
