/* =========================================================
   STYLE: CUTE & FUNNY DATE PROPOSAL APP
   ========================================================= */

:root {
  --primary-pink: #ff4d8d;
  --secondary-pink: #ff758c;
  --soft-pink: #fff0f5;
  --accent-purple: #845ec2;
  --bubblegum: #ff6f91;
  --yes-green: #00c853;
  --yes-hover: #00e676;
  --no-red: #ff3b30;
  --text-dark: #2d132c;
  --text-muted: #7b6079;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 20px 45px rgba(255, 77, 141, 0.2), 0 8px 16px rgba(0, 0, 0, 0.05);
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Quicksand', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: linear-gradient(135deg, #ffeef8 0%, #ffdfed 40%, #fbe4ff 75%, #e8dff5 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* =========================================================
   FLOATING HEARTS BACKGROUND
   ========================================================= */
.floating-hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  user-select: none;
  animation: floatUp linear infinite;
  opacity: 0.6;
  filter: drop-shadow(0 2px 5px rgba(255, 77, 141, 0.3));
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.7);
    opacity: 0.1;
  }
  20% {
    opacity: 0.7;
  }
  80% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-110vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

/* =========================================================
   TOP NAV / CONTROLS
   ========================================================= */
.top-nav {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 117, 140, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(255, 77, 141, 0.12);
}

.icon-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: #ffffff;
  border-color: var(--primary-pink);
  box-shadow: 0 6px 18px rgba(255, 77, 141, 0.25);
}

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

.icon-btn.muted {
  background: rgba(245, 245, 245, 0.88);
  border-color: rgba(180, 180, 180, 0.4);
  color: #718096;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.icon-btn.muted:hover {
  border-color: #a0aec0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-btn #soundIcon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.icon-btn:not(.muted) #soundIcon {
  animation: pulseMusic 2.2s infinite ease-in-out;
}

@keyframes pulseMusic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18) rotate(-5deg); }
}

/* =========================================================
   MAIN APP & CARDS
   ========================================================= */
.app-container {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px 40px;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  border-radius: 32px;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 34px 28px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff0f6;
  border: 1px solid #ffc2d8;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-pink);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(255, 77, 141, 0.1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-pink);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 8px var(--primary-pink); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Mascot Image Wrapper */
.mascot-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 4px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-glow {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 117, 140, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mascot-fallback {
  display: none;
  font-size: 5rem;
  z-index: 2;
}

/* Text Content */
.text-group {
  margin-bottom: 20px;
  max-width: 100%;
}

.headline {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.crush-name-highlight {
  color: var(--primary-pink);
  position: relative;
  display: inline-block;
  background: linear-gradient(120deg, #ff4d8d, #845ec2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.question {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #c82361;
  letter-spacing: -0.3px;
  margin-top: 4px;
}

/* Tease Bubble */
.tease-bubble {
  background: #fff8e7;
  border: 1.5px solid #ffcc00;
  color: #945700;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(255, 204, 0, 0.25);
  max-width: 90%;
}

@keyframes popIn {
  0% { transform: scale(0.6) translateY(-8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* =========================================================
   BUTTON PLAYGROUND & EVASIVE "NO" BUTTON
   ========================================================= */
.btn-playground {
  position: relative;
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  user-select: none;
  white-space: nowrap;
}

/* YES BUTTON */
.btn-yes {
  background: linear-gradient(135deg, #00d26a 0%, #00a844 100%);
  color: #ffffff;
  border: 2px solid #52e396;
  box-shadow: 0 8px 24px rgba(0, 200, 83, 0.35);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
  z-index: 8;
  animation: subtleBounce 2.5s infinite ease-in-out;
}

.btn-yes:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 200, 83, 0.5);
}

.btn-yes:active {
  transform: scale(0.98);
}

@keyframes subtleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* NO BUTTON (RUNAWAY) */
.btn-no {
  background: linear-gradient(135deg, #ff5e62 0%, #ff3b30 100%);
  color: #ffffff;
  border: 2px solid #ffa3a3;
  box-shadow: 0 8px 20px rgba(255, 59, 48, 0.3);
  z-index: 15;
  touch-action: manipulation;
  /* When transitioning normally, smooth; when fleeing we use JS transition control */
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-no.running {
  position: fixed !important;
  transition: left 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  box-shadow: 0 14px 30px rgba(255, 59, 48, 0.45);
}

/* Shake animation when hovered or tapped */
@keyframes dodgeShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-4px, 2px) rotate(-6deg); }
  50% { transform: translate(4px, -2px) rotate(6deg); }
  75% { transform: translate(-3px, -1px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shake {
  animation: dodgeShake 0.2s ease-in-out;
}

/* Attempts counter hint */
.attempts-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  animation: fadeIn 0.4s ease;
}

/* =========================================================
   SUCCESS / CELEBRATION SCREEN
   ========================================================= */
.success-card {
  max-width: 520px;
  animation: popInSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInSuccess {
  0% { transform: scale(0.7) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.party-popper {
  font-size: 3.2rem;
  margin-bottom: 6px;
  animation: spinTumble 1.2s ease infinite alternate;
}

@keyframes spinTumble {
  0% { transform: scale(1) rotate(-10deg); }
  100% { transform: scale(1.18) rotate(15deg); }
}

.success-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--primary-pink);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.success-mascot-wrapper {
  width: 200px;
  height: 180px;
  margin: 0 auto 20px;
}

.celebration-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Date Ticket */
.date-ticket {
  width: 100%;
  background: linear-gradient(135deg, #fffcf5 0%, #fff7e6 100%);
  border: 2px dashed #f59e0b;
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 24px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
  position: relative;
  overflow: hidden;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #f59e0b;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.ticket-badge {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #b45309;
  font-size: 0.95rem;
}

.ticket-code {
  font-family: monospace;
  font-size: 0.75rem;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 6px;
}

.ticket-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-row {
  display: flex;
  font-size: 0.88rem;
  gap: 8px;
}

.ticket-row .label {
  font-weight: 700;
  color: #78350f;
  min-width: 105px;
}

.ticket-row .val {
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

/* Action buttons */
.success-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
}

.encryption-note {
  font-size: 0.88rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1.5px dashed #34d399;
  padding: 10px 14px;
  border-radius: 14px;
  margin: 2px 0 6px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  border: 1.5px solid #e2e8f0;
  box-shadow: none;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* =========================================================
   CUSTOMIZATION MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 19, 44, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  background: #ffffff;
  border-radius: 24px;
  animation: popIn 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text-dark);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 6px;
}

.close-btn:hover {
  color: var(--text-dark);
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.input-group {
  margin-bottom: 14px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.15);
}

.input-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff4d8d 0%, #ff758c 100%);
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  opacity: 0.95;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 110;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastFade 2.5s forwards ease;
}

@keyframes toastFade {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  15% { transform: translate(-50%, 0); opacity: 1; }
  80% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -20px); opacity: 0; }
}

/* =========================================================
   CONFETTI CANVAS
   ========================================================= */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}

/* Helper hidden class */
.hidden {
  display: none !important;
}

/* =========================================================
   RESPONSIVE DESIGN (MOBILE FIRST POLISH)
   ========================================================= */
@media (max-width: 480px) {
  .card {
    padding: 26px 20px;
    border-radius: 26px;
  }
  .headline {
    font-size: 1.6rem;
  }
  .question {
    font-size: 1.25rem;
  }
  .mascot-wrapper {
    width: 150px;
    height: 150px;
  }
  .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
  .btn-playground {
    gap: 12px;
  }
  .success-title {
    font-size: 1.65rem;
  }
  .date-ticket {
    padding: 14px 16px;
  }
  .modal-buttons {
    flex-direction: column;
  }
}
