@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #1a0a1e;
  --bg-secondary: #2d1233;
  --pink: #ff6b9d;
  --red: #c0392b;
  --gold: #f39c12;
  --white: #fff;
  --text-light: rgba(255, 255, 255, 0.8);
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), #1a0520);
  min-height: 100vh;
  color: var(--white);
  overflow-x: hidden;
  position: relative;
}

/* ===== Падающие сердечки ===== */
.hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.falling-heart {
  position: absolute;
  top: -50px;
  animation: fall linear infinite;
  opacity: 0.3;
  font-size: 20px;
}

@keyframes fall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ===== Главный контейнер ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Заголовок ===== */
.header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeInDown 0.8s ease;
}

.header-icon {
  font-size: 64px;
  animation: heartbeat 1.5s infinite;
  display: block;
  margin-bottom: 12px;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

.header h1 {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b9d, #ff8a80, #ffab91);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header p {
  color: var(--text-light);
  font-size: 15px;
  margin-top: 8px;
  font-weight: 600;
}

/* ===== Счётчик ===== */
.counter-badge {
  background: rgba(255, 107, 157, 0.15);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: 50px;
  padding: 8px 20px;
  margin-bottom: 30px;
  font-size: 13px;
  color: var(--pink);
  font-weight: 700;
  animation: fadeIn 1s ease 0.3s both;
  backdrop-filter: blur(10px);
}

.counter-badge span {
  color: var(--white);
  font-weight: 900;
}

/* ===== Кнопки выбора ===== */
.buttons-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.gender-btn {
  position: relative;
  width: 100%;
  padding: 22px 24px;
  border: none;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.gender-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.1) 0%, 
    rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.gender-btn:active {
  transform: scale(0.96);
}

.gender-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.btn-him {
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
}

.btn-her {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  box-shadow: 0 8px 30px rgba(240, 147, 251, 0.35);
}

.btn-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.btn-content {
  display: flex;
  flex-direction: column;
}

.btn-title {
  font-size: 18px;
  line-height: 1.2;
}

.btn-subtitle {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 600;
  margin-top: 2px;
}

.gender-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.gender-btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===== Конверт и карточка ===== */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(10px);
}

.envelope-overlay.active {
  display: flex;
}

.envelope-container {
  width: 100%;
  max-width: 380px;
  perspective: 1000px;
}

/* Конверт */
.envelope {
  position: relative;
  width: 100%;
  height: 220px;
  cursor: pointer;
  animation: envelopeDrop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes envelopeDrop {
  0% {
    transform: translateY(-100px) rotate(-10deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
}

.envelope-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 2;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #e84393, #c44569);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  z-index: 3;
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.envelope.opening .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  z-index: 4;
  animation: heartbeat 1s infinite;
}

.envelope-label {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  z-index: 4;
}

/* Карточка поздравления */
.card-container {
  display: none;
  animation: cardReveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-container.active {
  display: block;
}

@keyframes cardReveal {
  0% {
    transform: translateY(50px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.valentine-card {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.card-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.1);
}

.card-emoji {
  font-size: 80px;
  position: relative;
  z-index: 1;
  animation: emojiPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes emojiPop {
  0% { transform: scale(0) rotate(-20deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Декоративные сердечки на карточке */
.card-image .deco-heart {
  position: absolute;
  font-size: 24px;
  opacity: 0.5;
  animation: floatHeart 3s ease-in-out infinite;
}

.deco-heart:nth-child(2) { top: 10%; left: 15%; animation-delay: 0s; }
.deco-heart:nth-child(3) { top: 20%; right: 20%; animation-delay: 0.5s; }
.deco-heart:nth-child(4) { bottom: 15%; left: 10%; animation-delay: 1s; }
.deco-heart:nth-child(5) { bottom: 25%; right: 15%; animation-delay: 1.5s; }
.deco-heart:nth-child(6) { top: 50%; left: 5%; animation-delay: 0.3s; font-size: 16px; }
.deco-heart:nth-child(7) { top: 40%; right: 8%; animation-delay: 0.8s; font-size: 18px; }

@keyframes floatHeart {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(10deg); }
}

.card-body {
  background: rgba(30, 15, 35, 0.95);
  padding: 28px 24px;
  backdrop-filter: blur(20px);
}

.card-text {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
  text-align: center;
  color: var(--white);
  margin-bottom: 20px;
}

.card-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  margin: 0 auto 20px;
  border-radius: 2px;
}

.card-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}
/* ===== Картинка в карточке ===== */
.card-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.card-picture + .card-emoji {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Затемнение поверх картинки для читаемости */
.card-image.has-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.3) 100%
  );
  z-index: 1;
}
/* ===== Бренд на карточке ===== */
.card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  margin-bottom: 8px;
}

.brand-heart {
  font-size: 14px;
  animation: heartbeat 2s infinite;
}

.brand-text {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

.brand-link {
  font-size: 13px;
  color: var(--pink);
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.brand-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--pink);
  transition: width 0.3s ease;
}

.brand-link:hover::after,
.brand-link:active::after {
  width: 100%;
}

/* ===== Футер приложения ===== */
.app-footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  animation: fadeInUp 0.8s ease 0.5s both;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
}

.footer-brand a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-brand a:hover {
  color: #ff8abf;
}

.footer-cta {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

/* ===== Пульсирующая кнопка подписки ===== */
.subscribe-pulse {
  display: inline-block;
  padding: 10px 24px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--pink), #e84393);
  border: none;
  border-radius: 50px;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.subscribe-pulse::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--pink), #e84393);
  z-index: -1;
  opacity: 0.4;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.2; }
  100% { transform: scale(1); opacity: 0.4; }
}

.subscribe-pulse:active {
  transform: scale(0.95);
}

/* ===== Кнопки действий карточки ===== */
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.action-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.action-btn:active {
  transform: scale(0.95);
}

.share-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Таймер перезарядки ===== */
.cooldown-info {
  margin-top: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cooldown-info .timer {
  color: var(--pink);
  font-weight: 800;
  font-size: 14px;
}

/* ===== Пасхалка ===== */
.easter-egg-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #f5af19, #f12711);
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  color: white;
  z-index: 200;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 40px rgba(245, 175, 25, 0.4);
  text-align: center;
  max-width: 340px;
  width: calc(100% - 40px);
}

.easter-egg-notification.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== Конфетти ===== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== Анимации ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Sparkle effect ===== */
.sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkle 0.6s ease forwards;
}

@keyframes sparkle {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(180deg);
    opacity: 0;
  }
}

/* ===== Responsive ===== */
@media (max-height: 640px) {
  .header-icon {
    font-size: 48px;
  }
  
  .header h1 {
    font-size: 22px;
  }
  
  .gender-btn {
    padding: 16px 20px;
  }
  
  .card-image {
    height: 160px;
  }
}
