:root {
  --bg-dark: #0d0a1a;
  --bg-gradient: radial-gradient(circle at 50% 20%, #28143f 0%, #120b22 55%, #080511 100%);
  --card-bg: rgba(26, 19, 48, 0.72);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(236, 72, 153, 0.15);
  
  --primary-pink: #ff3b69;
  --primary-pink-hover: #ff1f54;
  --yes-green: #10b981;
  --yes-green-hover: #059669;
  --no-red: #ef4444;
  
  --text-main: #ffffff;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-body);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Three.js Background Canvas */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Top Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(13, 10, 26, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.heart-pulse {
  display: inline-block;
  animation: pulse-heart 1.6s ease-in-out infinite;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.brand-text {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  font-weight: 600;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(1px);
}

.icon-btn {
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
}

.customize-pill {
  padding: 8px 16px;
  font-size: 0.9rem;
  gap: 6px;
}

/* Main Container */
.main-wrapper {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 20px 24px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Glassmorphism Card */
.interactive-card {
  width: 100%;
  max-width: 520px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 38px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

/* Mascot Avatar */
.mascot-wrapper {
  margin-bottom: 18px;
}

.mascot-avatar {
  font-size: 3.5rem;
  line-height: 1;
  display: inline-block;
  animation: float-mascot 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

@keyframes float-mascot {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* Question Typography */
.question-text {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #ffd6e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.question-subtext {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Dodge Badge */
.dodge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #fca5a5;
  margin-bottom: 26px;
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Buttons Area */
.buttons-area {
  position: relative;
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

/* Base Action Button */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
}

/* Yes Button Styling */
.btn-yes {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  z-index: 6;
  position: relative;
}

.btn-yes:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow: 0 14px 36px rgba(16, 185, 129, 0.55), 0 0 30px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px) scale(1.04);
}

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

/* No Button Styling (Runaway Magic) */
.btn-no {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.35);
  z-index: 1000;
  will-change: left, top, transform;
  /* Smooth visible translation animation when fleeing */
  transition: left 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              top 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              background 0.2s ease;
  position: relative;
  touch-action: none;
  cursor: pointer;
}

.btn-no.running-away {
  position: fixed !important;
  margin: 0 !important;
}

/* Dynamic dodge animation trail / glow effect */
.btn-no.is-dodging {
  box-shadow: 0 14px 35px rgba(239, 68, 68, 0.7), 0 0 25px rgba(255, 107, 139, 0.55);
  filter: brightness(1.12);
}

.hint-caption {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 10px;
}

/* Celebration Card */
.celebration-avatar {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounce-celebrate 1s cubic-bezier(0.36, 0, 0.66, -0.56) infinite alternate;
}

@keyframes bounce-celebrate {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-16px) scale(1.1); }
}

.celebration-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 50%, #fed136 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.celebration-message {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.stats-box {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 30px;
}

.stat-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #34d399;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.celebration-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.celebrate-btn {
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-share {
  background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(236, 72, 153, 0.55);
}

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

.btn-restart:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* Customization Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 5, 17, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(26, 19, 48, 0.95);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  padding: 32px 28px;
  animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: #fff;
}

.modal-intro {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Quick Presets Section */
.presets-section {
  margin-bottom: 20px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(255, 59, 105, 0.25);
  border-color: rgba(255, 59, 105, 0.4);
  transform: translateY(-1px);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .half {
  flex: 1;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: rgba(13, 10, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: #ff3b69;
  box-shadow: 0 0 0 3px rgba(255, 59, 105, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: linear-gradient(135deg, #ff3b69 0%, #ff6b8b 100%);
  color: #fff;
  padding: 12px 24px;
}

.btn-primary:hover {
  box-shadow: 0 10px 24px rgba(255, 59, 105, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 24px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.text-link-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  align-self: center;
  padding: 4px;
}

.text-link-btn:hover {
  color: #fff;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 19, 48, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  z-index: 20000;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-slide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-slide {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Breakpoints */
/* Responsive Breakpoints */
@media (max-width: 640px) {
  .top-nav {
    padding: 0 14px;
    height: 52px;
  }

  .brand-text {
    font-size: 0.92rem;
  }

  .customize-pill .btn-label {
    display: none;
  }

  .customize-pill {
    padding: 7px 11px;
  }

  .main-wrapper {
    padding: 58px 12px 14px;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .interactive-card {
    padding: 22px 16px;
    border-radius: var(--radius-md);
    max-height: calc(100dvh - 72px);
  }

  .mascot-avatar {
    font-size: 2.6rem;
  }

  .mascot-wrapper {
    margin-bottom: 8px;
  }

  .question-text {
    font-size: 1.45rem;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .question-subtext {
    font-size: 0.86rem;
    margin-bottom: 12px;
    line-height: 1.35;
  }

  .dodge-badge {
    margin-bottom: 12px;
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  .buttons-area {
    min-height: 54px;
    gap: 14px;
    margin-bottom: 10px;
  }

  .action-btn {
    font-size: 1.02rem;
    padding: 11px 22px;
    gap: 8px;
  }

  .hint-caption {
    font-size: 0.75rem;
    margin-top: 6px;
  }

  /* Celebration Screen adjustments */
  .celebration-avatar {
    font-size: 3rem;
    margin-bottom: 10px;
  }

  .celebration-title {
    font-size: 1.85rem;
    margin-bottom: 8px;
  }

  .celebration-message {
    font-size: 0.95rem;
    margin-bottom: 18px;
    line-height: 1.45;
  }

  .stats-box {
    margin-bottom: 18px;
    gap: 10px;
  }

  .stat-item {
    padding: 10px;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .stat-desc {
    font-size: 0.72rem;
  }

  .celebrate-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Compact screens / short height devices */
@media (max-height: 580px) {
  .top-nav {
    height: 46px;
  }

  .main-wrapper {
    padding: 50px 10px 10px;
  }

  .mascot-avatar {
    font-size: 1.8rem;
  }

  .mascot-wrapper {
    margin-bottom: 4px;
  }

  .interactive-card {
    padding: 14px 12px;
  }

  .question-text {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .question-subtext {
    font-size: 0.78rem;
    margin-bottom: 8px;
  }

  .buttons-area {
    min-height: 46px;
    margin-bottom: 6px;
  }

  .action-btn {
    padding: 8px 18px;
    font-size: 0.92rem;
  }
}
