/* Modern, Responsive Romantic Violet Design System for Kanmaniii */
:root {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #f5f3ff;
  --primary-glow: rgba(139, 92, 246, 0.38);
  
  --secondary-color: #6d28d9;
  --secondary-light: #ede9fe;
  
  --accent-violet: #a78bfa;
  --accent-lavender: #c4b5fd;
  --accent-blossom: #e9d5ff;
  
  --bg-gradient: radial-gradient(circle at 50% 15%, #faf5ff 0%, #f3e8ff 50%, #e9d5ff 100%);
  --bg-romantic: radial-gradient(circle at 50% 30%, #2e1065 0%, #1e0942 60%, #0f0326 100%);
  
  --card-bg: rgba(255, 255, 255, 0.90);
  --card-border: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 20px 45px -10px rgba(124, 58, 237, 0.22), 0 10px 20px -5px rgba(0, 0, 0, 0.04);
  
  --text-main: #241432;
  --text-muted: #6b5b7b;
  
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  min-height: 100dvh;
  width: 100%;
  font-family: var(--font-family);
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background 0.6s ease;
}

body.mode-romantic {
  background: var(--bg-romantic);
  color: #fff;
}

body.mode-romantic .app-card {
  background: rgba(30, 9, 66, 0.85);
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.25);
  color: #fff;
}

body.mode-romantic .text-muted {
  color: #d8b4fe;
}

body.mode-romantic h1, body.mode-romantic h2, body.mode-romantic h3 {
  color: #fff;
}

/* App Container */
.app-wrapper {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: clamp(0.75rem, 3.2vw, 2.2rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.25rem));
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* Background floating violet flower and heart canvas */
#heart-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Glassmorphic Card */
.app-card {
  width: 100%;
  max-width: 490px;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: clamp(1.6rem, 5.2vw, 2.6rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background 0.5s ease;
}

/* Step container animation */
.step-pane {
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-pane.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Media / Illustrations */
.avatar-container {
  position: relative;
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bouquet-container {
  width: min(270px, 72vw);
  height: min(270px, 72vw);
  margin: 0 auto 1.4rem;
}

.realistic-bouquet-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.bouquet-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  border: 3.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 36px -8px rgba(124, 58, 237, 0.35);
  animation: float-bouquet-realistic 4s ease-in-out infinite;
  will-change: transform, box-shadow;
}

@keyframes float-bouquet-realistic {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 16px 36px -8px rgba(124, 58, 237, 0.35);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 48px -6px rgba(124, 58, 237, 0.48);
  }
}

.sparkle-star {
  position: absolute;
  pointer-events: none;
  font-size: 1.3rem;
  z-index: 10;
  animation: sparkle-pulse 2.2s ease-in-out infinite alternate;
}

.sparkle-star.s1 {
  top: -8px;
  right: -8px;
  animation-delay: 0.2s;
}

.sparkle-star.s2 {
  bottom: 8px;
  left: -8px;
  font-size: 1.1rem;
  animation-delay: 0.8s;
}

.sparkle-star.s3 {
  top: 40%;
  right: -12px;
  font-size: 1.2rem;
  animation-delay: 1.4s;
}

@keyframes sparkle-pulse {
  0% { transform: scale(0.8) rotate(-10deg); opacity: 0.7; }
  100% { transform: scale(1.25) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.8)); }
}

.avatar-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  animation: pulse-halo 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-halo {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(109, 40, 217, 0.15));
  transition: transform 0.3s ease;
}

.avatar-container:hover .avatar-img {
  transform: scale(1.04);
}

/* Typography */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  background: var(--primary-light);
  color: var(--secondary-color);
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

body.mode-romantic .card-badge {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.25);
}

h1.card-title, h2.card-title {
  font-size: clamp(1.5rem, 5.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  color: #241432;
}

p.card-desc {
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.8rem;
  max-width: 390px;
}

/* Button & Action Styles */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.btn-romantic {
  appearance: none;
  border: none;
  outline: none;
  min-height: 50px;
  width: 100%;
  padding: 0.8rem 1.3rem;
  font-family: inherit;
  font-size: clamp(0.92rem, 3.2vw, 1.05rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-romantic:active {
  transform: scale(0.95) !important;
}

/* Button Variants with Violet Elegance */
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #fff;
  box-shadow: 0 8px 24px -4px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 12px 28px -4px rgba(109, 40, 217, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(109, 40, 217, 0.07);
  color: var(--text-main);
  border: 1px solid rgba(109, 40, 217, 0.14);
}

body.mode-romantic .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-secondary:hover {
  background: rgba(109, 40, 217, 0.12);
  transform: translateY(-2px);
}

body.mode-romantic .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-sparkle {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #4c1d95 100%);
  color: #fff;
  box-shadow: 0 8px 24px -4px rgba(124, 58, 237, 0.4);
}

.btn-sparkle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px -4px rgba(168, 85, 247, 0.5);
}

/* Compliments Screen Cards */
.compliment-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.compliment-chip {
  padding: 0.95rem 1.3rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  font-size: clamp(0.98rem, 3.4vw, 1.1rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--secondary-color);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.1);
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compliment-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.16);
}

/* Loading Meter Screen */
.love-meter-box {
  width: 100%;
  margin: 1.5rem 0;
}

.meter-track {
  width: 100%;
  height: 14px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

body.mode-romantic .meter-track {
  background: rgba(255, 255, 255, 0.15);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c084fc, #7c3aed);
  border-radius: var(--radius-pill);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px var(--primary-glow);
}

.meter-caption {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Flashlight Interactive Mode with Violet Spotlight */
.flashlight-arena {
  width: 100%;
  min-height: 260px;
  background: #140727;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.flashlight-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: rgba(196, 181, 253, 0.7);
  pointer-events: none;
  white-space: nowrap;
}

.flashlight-beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 95px at var(--x, 50%) var(--y, 50%), rgba(216, 180, 254, 0.15) 0%, rgba(20, 7, 39, 0.97) 80%);
  transition: background 0.04s ease;
}

.hidden-surprise {
  padding: 0.8rem 1.35rem;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.8);
  transition: transform 0.2s ease;
}

.hidden-surprise:hover {
  transform: scale(1.08);
}

/* Playful Runaway Button Arena with Zero Overlap & 100% Mobile Responsiveness */
.runaway-zone {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 145px;
  background: rgba(139, 92, 246, 0.05);
  border: 1.5px dashed rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 auto;
  box-sizing: border-box;
}

body.mode-romantic .runaway-zone {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(196, 181, 253, 0.4);
}

.runaway-hint {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(107, 91, 123, 0.7);
  pointer-events: none;
  letter-spacing: 0.2px;
  user-select: none;
  z-index: 1;
}

body.mode-romantic .runaway-hint {
  color: rgba(216, 180, 254, 0.8);
}

#runaway-yes {
  position: absolute;
  width: auto !important;
  max-width: 140px;
  min-width: 110px;
  height: 44px;
  padding: 0 1.2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 246, 0.12);
  color: var(--secondary-color);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
  cursor: pointer;
  z-index: 5;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  transition: left 0.18s cubic-bezier(0.16, 1, 0.3, 1), top 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, transform 0.15s ease;
  will-change: left, top;
}

body.mode-romantic #runaway-yes {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

#runaway-yes:hover,
#runaway-yes:active {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.4);
}

/* Footer / Watermark - Responsive & Non-Overlapping */
.app-watermark {
  width: 100%;
  max-width: min(92vw, 440px);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: clamp(0.75rem, 2.7vw, 0.85rem);
  color: #5b21b6;
  opacity: 0.88;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  text-align: center;
  z-index: 10;
  user-select: none;
}

body.mode-romantic .app-watermark {
  color: rgba(216, 180, 254, 0.85);
}

.watermark-separator {
  opacity: 0.6;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .app-wrapper {
    padding: 0.65rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
    padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.25rem));
  }
  
  .app-card {
    padding: 1.35rem 1rem;
    border-radius: 22px;
  }
  
  .avatar-container {
    width: min(140px, 42vw);
    height: min(140px, 42vw);
    margin-bottom: 0.85rem;
  }

  .bouquet-container {
    width: min(220px, 64vw);
    height: min(220px, 64vw);
    margin-bottom: 0.95rem;
  }

  h1.card-title, h2.card-title {
    font-size: clamp(1.35rem, 4.8vw, 1.75rem);
    margin-bottom: 0.5rem;
  }

  p.card-desc {
    font-size: clamp(0.88rem, 3vw, 0.98rem);
    margin-bottom: 1.25rem;
    line-height: 1.45;
  }

  .compliment-box {
    gap: 0.6rem;
    margin-bottom: 1.15rem;
  }

  .compliment-chip {
    padding: 0.75rem 1rem;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
    line-height: 1.35;
  }

  .flashlight-arena {
    min-height: 220px;
    margin-bottom: 1rem;
  }
  
  .btn-romantic {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    line-height: 1.3;
  }
  
  .btn-group {
    width: 100%;
    gap: 0.7rem;
  }

  .app-watermark {
    margin-top: 1rem;
    font-size: 0.76rem;
    gap: 3px 6px;
    line-height: 1.4;
  }
}
