/* ========================================
   BreatheFirst — Psychological Self-Help Site
   Minimal & Colorful Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Serif+Display&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --lavender: #b8a9e8;
  --lavender-light: #e8e0ff;
  --lavender-deep: #7c6cb0;
  --coral: #f4845f;
  --coral-light: #ffddd2;
  --coral-deep: #d95f3c;
  --mint: #7ecfb3;
  --mint-light: #d4f5e9;
  --mint-deep: #4aa88a;
  --golden: #f2c94c;
  --golden-light: #fff4d4;
  --golden-deep: #d4a82e;
  --sky: #74b9ff;
  --sky-light: #dff0ff;
  --rose: #fd79a8;
  --rose-light: #ffe0ec;

  /* Neutrals */
  --white: #ffffff;
  --bg: #fefcfa;
  --text-primary: #2d2640;
  --text-secondary: #6b6280;
  --text-muted: #9e95b0;
  --border: #ede8f5;

  /* Typography */
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 100px;
  --radius-round: 50%;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(45, 38, 64, 0.06);
  --shadow-md: 0 8px 30px rgba(45, 38, 64, 0.08);
  --shadow-lg: 0 16px 50px rgba(45, 38, 64, 0.12);
  --shadow-color: 0 8px 30px rgba(184, 169, 232, 0.25);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul { list-style: none; }

/* ---------- Utility Classes ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--lavender-deep);
  margin-bottom: var(--space-sm);
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--lavender);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.8;
}

/* ---------- Floating Shapes (Background Decoration) ---------- */
.floating-shapes {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-shapes .shape {
  position: absolute;
  border-radius: var(--radius-round);
  opacity: 0.08;
  animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
  width: 300px; height: 300px;
  background: var(--lavender);
  top: 10%; left: -5%;
  animation-delay: 0s !important;
}

.shape-2 {
  width: 200px; height: 200px;
  background: var(--coral);
  top: 50%; right: -3%;
  animation-delay: -5s !important;
}

.shape-3 {
  width: 250px; height: 250px;
  background: var(--mint);
  bottom: 10%; left: 30%;
  animation-delay: -10s !important;
}

.shape-4 {
  width: 180px; height: 180px;
  background: var(--golden);
  top: 30%; right: 20%;
  animation-delay: -15s !important;
}

@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  padding: var(--space-sm) 0;
  transition: var(--transition-smooth);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(254, 252, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--lavender), var(--coral));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--white);
  box-shadow: 0 4px 15px rgba(184, 169, 232, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--lavender);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: var(--white) !important;
  padding: 10px 24px !important;
  border-radius: var(--radius-pill);
  font-weight: 500 !important;
  box-shadow: 0 4px 15px rgba(184, 169, 232, 0.3);
  transition: var(--transition-spring) !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(184, 169, 232, 0.4) !important;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 var(--space-2xl);
  position: relative;
  z-index: 1;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-content {
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--lavender-light);
  color: var(--lavender-deep);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.hero-badge .pulse {
  width: 8px; height: 8px;
  background: var(--lavender);
  border-radius: var(--radius-round);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.15;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--lavender), var(--coral));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
  max-width: 480px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-color);
  transition: var(--transition-spring);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(184, 169, 232, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--white);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-spring);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  border-color: var(--lavender);
  box-shadow: var(--shadow-md);
}

.hero-image {
  position: relative;
  animation: fadeInRight 1s ease-out 0.3s both;
}

.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-image .float-card {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
  animation: floatCard 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 10px;
}

.float-card-1 {
  top: 15%; left: -30px;
  animation-delay: 0s !important;
}

.float-card-2 {
  bottom: 20%; right: -20px;
  animation-delay: -1.5s !important;
}

.float-card .card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.float-card .card-text {
  font-size: 0.85rem;
}

.float-card .card-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.float-card .card-text span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

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

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Games Hub ---------- */
.games-hub {
  position: relative;
  z-index: 1;
}

.games-selector {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: linear-gradient(180deg, var(--cream) 0%, #e8e0f0 100%);
}

.games-title {
  font-family: var(--heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--dark-plum);
  margin-bottom: 6px;
}

.games-subtitle {
  color: var(--slate);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.games-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 0 auto;
}

.game-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.game-tab:hover {
  background: rgba(255,255,255,0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108,92,231,0.15);
}

.game-tab.active {
  background: var(--lavender);
  color: white;
  border-color: var(--lavender);
  box-shadow: 0 6px 24px rgba(108,92,231,0.3);
  transform: translateY(-2px);
}

.game-tab.active .game-tab-label { color: white; }

.game-tab-icon { font-size: 1.8rem; }

.game-tab-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-plum);
  letter-spacing: 0.02em;
}

/* Game containers */
.game-container {
  display: none;
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 450px;
  overflow: hidden;
}

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

/* --- Game 1: Zen Garden --- */
#game-zen-garden {
  background: linear-gradient(180deg, #1a1528 0%, #2d2640 40%, #3d2f5a 70%, #4a3670 100%);
  cursor: none;
}

#game-zen-garden #zenCanvas {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.zen-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.zen-prompt { text-align: center; animation: zenFadeIn 2s ease-out 1s both; }

.zen-invite {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: rgba(232, 224, 255, 0.85);
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.zen-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(184, 169, 232, 0.5);
  font-weight: 300;
  letter-spacing: 1px;
}

.zen-cta {
  margin-top: var(--space-xl);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s ease;
  pointer-events: none;
}

.zen-cta.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.zen-continue-btn {
  padding: 14px 36px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(184, 169, 232, 0.25);
  border-radius: var(--radius-pill);
  color: rgba(232, 224, 255, 0.9);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-spring);
  letter-spacing: 0.5px;
}

.zen-continue-btn:hover {
  background: rgba(184, 169, 232, 0.2);
  border-color: rgba(184, 169, 232, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(184, 169, 232, 0.2);
}

.zen-sound-toggle {
  position: absolute;
  bottom: 20px; right: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(184, 169, 232, 0.15);
  border-radius: var(--radius-round);
  cursor: pointer; z-index: 3; font-size: 1.2rem;
  transition: var(--transition-fast);
  opacity: 0; animation: zenFadeIn 1s ease-out 3s both;
}

.zen-sound-toggle:hover {
  background: rgba(184, 169, 232, 0.15);
  border-color: rgba(184, 169, 232, 0.3);
}

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

#game-zen-garden:hover { cursor: none; }

/* --- Game 2: Urge Surf --- */
#game-urge-surf {
  background: linear-gradient(180deg, #0a1628 0%, #0f2341 40%, #163557 70%, #1a4068 100%);
}

#game-urge-surf #urgeSurfCanvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.urge-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}

.urge-start-screen {
  text-align: center; color: white; max-width: 500px; padding: 40px;
  background: rgba(255,255,255,0.08); border-radius: 24px;
  backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.15);
}

.urge-icon { font-size: 3.5rem; margin-bottom: 12px; }

.urge-start-screen h3 {
  font-family: var(--heading);
  font-size: 2rem; margin-bottom: 12px; color: #7ec8e3;
}

.urge-desc {
  font-size: 1.1rem; color: rgba(255,255,255,0.85);
  line-height: 1.6; margin-bottom: 16px;
}

.urge-science {
  font-size: 0.85rem; color: rgba(255,255,255,0.5);
  line-height: 1.5; margin-bottom: 24px;
  padding: 12px; background: rgba(255,255,255,0.05); border-radius: 12px;
}

.urge-start-btn {
  padding: 14px 40px;
  background: linear-gradient(135deg, #4ecdc4, #44a8b3);
  border: none; color: white;
  font-family: var(--heading); font-size: 1.1rem;
  border-radius: 50px; cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(78,205,196,0.3);
}

.urge-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(78,205,196,0.5);
}

.urge-helpline {
  display: block; margin-top: 20px;
  color: rgba(255,255,255,0.5); font-size: 0.85rem;
  text-decoration: none; transition: color 0.3s;
}

.urge-helpline:hover { color: #7ec8e3; }

.urge-active-screen { text-align: center; color: white; }

.urge-timer {
  font-family: var(--heading); font-size: 3.5rem;
  color: #7ec8e3; margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(126,200,227,0.4);
}

.urge-message {
  font-size: 1.2rem; color: rgba(255,255,255,0.8);
  margin-bottom: 30px; min-height: 30px; transition: opacity 0.5s;
}

.urge-strength {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 30px; font-size: 0.9rem;
  color: rgba(255,255,255,0.6); justify-content: center;
}

.urge-bar-track {
  width: 200px; height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px; overflow: hidden;
}

.urge-bar-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #4ecdc4, #e74c3c);
  border-radius: 4px; transition: width 1s ease;
}

.urge-stop-btn {
  padding: 12px 32px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(78,205,196,0.4);
  color: #4ecdc4; font-family: var(--heading); font-size: 1rem;
  border-radius: 50px; cursor: pointer; transition: all 0.3s;
}

.urge-stop-btn:hover { background: rgba(78,205,196,0.15); }

/* --- Game 3: Color Flow --- */
#game-color-flow { background: #0a0a0f; }

#game-color-flow #colorFlowCanvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; cursor: crosshair;
}

.color-flow-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; z-index: 2; transition: opacity 1s ease;
}

.color-flow-overlay.hidden { opacity: 0; }

.color-flow-prompt {
  font-family: var(--heading);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: rgba(255,255,255,0.6); letter-spacing: 0.1em;
}

.color-flow-sub {
  color: rgba(255,255,255,0.35); font-size: 0.9rem; margin-top: 6px;
}

.color-flow-controls {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; gap: 10px; z-index: 10;
}

.color-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 1.2rem; cursor: pointer; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}

.color-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }

/* --- Game 4: Mindful Match --- */
#game-mindful-match {
  background: linear-gradient(180deg, #1a1528 0%, #231d35 100%);
  height: auto; min-height: 70vh;
}

.match-wrapper {
  max-width: 560px; margin: 0 auto; padding: 24px var(--space-md);
  position: relative;
}

.match-header {
  display: flex; justify-content: center; align-items: center;
  gap: 30px; margin-bottom: 20px;
}

.match-stat { display: flex; flex-direction: column; align-items: center; }

.match-label {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.1em;
}

.match-value { font-family: var(--heading); font-size: 1.4rem; color: white; }

.match-reset-btn {
  padding: 8px 18px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.7);
  border-radius: 20px; cursor: pointer; font-size: 0.85rem; transition: all 0.3s;
}

.match-reset-btn:hover { background: rgba(255,255,255,0.2); color: white; }

.match-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}

.match-card {
  aspect-ratio: 1; border-radius: 14px; cursor: pointer;
  position: relative; perspective: 600px; transition: transform 0.15s ease;
}

.match-card:hover { transform: scale(1.03); }

.match-card-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform 0.5s ease; border-radius: 14px;
}

.match-card.flipped .match-card-inner,
.match-card.matched .match-card-inner { transform: rotateY(180deg); }

.match-card.matched { pointer-events: none; }

.match-card-front, .match-card-back {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}

.match-card-front {
  background: linear-gradient(135deg, rgba(108,92,231,0.3), rgba(162,155,254,0.2));
  border: 1px solid rgba(162,155,254,0.3);
  font-size: 1.6rem; color: rgba(255,255,255,0.3);
}

.match-card-back {
  background: linear-gradient(135deg, rgba(78,205,196,0.2), rgba(108,92,231,0.2));
  border: 1px solid rgba(78,205,196,0.3);
  transform: rotateY(180deg); font-size: 2.2rem;
}

.match-card.matched .match-card-back {
  background: linear-gradient(135deg, rgba(78,205,196,0.35), rgba(108,92,231,0.35));
  border-color: rgba(78,205,196,0.5);
  box-shadow: 0 0 20px rgba(78,205,196,0.2);
}

.match-hint { text-align: center; color: rgba(255,255,255,0.35); font-size: 0.85rem; }

.match-win {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,26,0.92); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 10; color: white; animation: fadeIn 0.5s ease; border-radius: 14px;
}

.match-win-icon { font-size: 3.5rem; margin-bottom: 16px; }
.match-win h3 { font-family: var(--heading); font-size: 1.8rem; margin-bottom: 10px; color: #4ecdc4; }
.match-win-msg { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 4px; }

.match-play-again {
  margin-top: 20px; padding: 12px 32px;
  background: linear-gradient(135deg, #4ecdc4, #44a8b3);
  border: none; color: white; font-family: var(--heading); font-size: 1rem;
  border-radius: 50px; cursor: pointer; transition: all 0.3s;
}

.match-play-again:hover { transform: scale(1.05); }

@media (max-width: 600px) {
  .games-tabs { gap: 8px; }
  .game-tab { padding: 10px 14px; min-width: 72px; }
  .game-tab-icon { font-size: 1.4rem; }
  .game-tab-label { font-size: 0.7rem; }
  .game-container { height: 60vh; min-height: 400px; }
  .match-grid { gap: 8px; }
  .match-card-back { font-size: 1.6rem; }
  .urge-start-screen { margin: 16px; padding: 24px; }
}

/* ---------- About / Mission Section ---------- */
.about {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.about .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.about-image .color-bar {
  position: absolute;
  bottom: -20px;
  left: 30px;
  display: flex;
  gap: 6px;
}

.color-bar span {
  width: 50px; height: 6px;
  border-radius: 3px;
}

.color-bar span:nth-child(1) { background: var(--lavender); width: 60px; }
.color-bar span:nth-child(2) { background: var(--coral); width: 40px; }
.color-bar span:nth-child(3) { background: var(--mint); width: 50px; }
.color-bar span:nth-child(4) { background: var(--golden); width: 30px; }

.about-stats {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--lavender-deep);
}

.stat-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Topics / Services Grid ---------- */
.topics {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.topics-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.topics-header .section-desc {
  margin: 0 auto;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.topic-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  transition: var(--transition-spring);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.topic-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.topic-card:hover::before {
  opacity: 1;
}

.topic-card:nth-child(1)::before { background: linear-gradient(90deg, var(--lavender), var(--sky)); }
.topic-card:nth-child(2)::before { background: linear-gradient(90deg, var(--coral), var(--golden)); }
.topic-card:nth-child(3)::before { background: linear-gradient(90deg, var(--mint), var(--sky)); }
.topic-card:nth-child(4)::before { background: linear-gradient(90deg, var(--golden), var(--coral)); }
.topic-card:nth-child(5)::before { background: linear-gradient(90deg, var(--rose), var(--lavender)); }
.topic-card:nth-child(6)::before { background: linear-gradient(90deg, var(--sky), var(--mint)); }

.topic-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.topic-card:nth-child(1) .topic-icon { background: var(--lavender-light); }
.topic-card:nth-child(2) .topic-icon { background: var(--coral-light); }
.topic-card:nth-child(3) .topic-icon { background: var(--mint-light); }
.topic-card:nth-child(4) .topic-icon { background: var(--golden-light); }
.topic-card:nth-child(5) .topic-icon { background: var(--rose-light); }
.topic-card:nth-child(6) .topic-icon { background: var(--sky-light); }

.topic-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.topic-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.topic-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--lavender-deep);
  transition: var(--transition-fast);
}

.topic-card:hover .arrow {
  gap: 12px;
}

/* ---------- Breathing Exercise ---------- */
.breathing {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.breathing-wrapper {
  background: linear-gradient(135deg, #f0ecff 0%, #ffeee8 50%, #e6f9f1 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.breathing-wrapper::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(184, 169, 232, 0.15), transparent);
  border-radius: var(--radius-round);
}

.breathing-circle-container {
  margin: var(--space-lg) auto;
  position: relative;
  width: 220px; height: 220px;
}

.breathing-circle {
  width: 220px; height: 220px;
  border-radius: var(--radius-round);
  background: linear-gradient(135deg, var(--lavender), var(--mint));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 4s ease-in-out;
  box-shadow: 0 0 60px rgba(184, 169, 232, 0.3);
}

.breathing-circle.inhale {
  transform: scale(1.3);
}

.breathing-circle.exhale {
  transform: scale(1);
}

.breathing-circle-inner {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.breathing-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 260px; height: 260px;
  border: 2px dashed rgba(184, 169, 232, 0.3);
  border-radius: var(--radius-round);
  animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.breathing-btn {
  margin-top: var(--space-md);
  padding: 12px 36px;
  background: var(--white);
  border: 2px solid var(--lavender);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--lavender-deep);
  cursor: pointer;
  transition: var(--transition-spring);
}

.breathing-btn:hover {
  background: var(--lavender);
  color: var(--white);
  transform: translateY(-2px);
}

/* ---------- Affirmation Section ---------- */
.affirmation {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.affirmation-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.affirmation-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--lavender), var(--coral), var(--mint), var(--golden));
}

.affirmation-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 700px;
  margin: var(--space-md) auto;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.affirmation-quote .big-quote {
  font-size: 4rem;
  color: var(--lavender-light);
  line-height: 1;
}

.affirmation-btn {
  margin-top: var(--space-md);
  padding: 12px 36px;
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: 0 4px 20px rgba(244, 132, 95, 0.3);
}

.affirmation-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(244, 132, 95, 0.4);
}

/* ---------- Mood Tracker ---------- */
.mood {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.mood-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.mood-header .section-desc {
  margin: 0 auto;
}

.mood-grid {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-spring);
}

.mood-btn .mood-emoji {
  font-size: 2.5rem;
  transition: var(--transition-spring);
}

.mood-btn:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.mood-btn:hover .mood-emoji {
  transform: scale(1.15);
}

.mood-btn.selected {
  border-color: var(--lavender);
  background: var(--lavender-light);
  color: var(--lavender-deep);
}

.mood-response {
  text-align: center;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition-smooth);
}

.mood-response.visible {
  opacity: 1;
  transform: translateY(0);
}

.mood-response h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.mood-response p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------- Tips Carousel ---------- */
.tips {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.tips-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.tips-header .section-desc {
  margin: 0 auto;
}

.tips-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-sm);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tips-track::-webkit-scrollbar { display: none; }

.tip-card {
  flex: 0 0 350px;
  scroll-snap-align: start;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  transition: var(--transition-spring);
}

.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tip-number {
  font-family: var(--font-display);
  font-size: 3rem;
  opacity: 0.1;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.tip-card:nth-child(1) .tip-number { color: var(--lavender); opacity: 0.3; }
.tip-card:nth-child(2) .tip-number { color: var(--coral); opacity: 0.3; }
.tip-card:nth-child(3) .tip-number { color: var(--mint); opacity: 0.3; }
.tip-card:nth-child(4) .tip-number { color: var(--golden); opacity: 0.3; }
.tip-card:nth-child(5) .tip-number { color: var(--rose); opacity: 0.3; }

.tip-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.tip-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tip-source {
  display: block;
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-style: normal;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Crisis Banner ---------- */
.crisis-banner {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1001;
  background: linear-gradient(90deg, #e8e0ff, #dff0ff);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.crisis-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crisis-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.crisis-banner p {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}

.crisis-banner a {
  color: var(--lavender-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.crisis-banner a:hover {
  color: var(--coral-deep);
}

.crisis-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.crisis-close:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
}

/* ---------- References Section ---------- */
.references {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.references-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  text-align: center;
}

.references-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.ref-item {
  display: flex;
  gap: 12px;
  padding: var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.ref-item:hover {
  border-color: var(--lavender);
  box-shadow: var(--shadow-sm);
}

.ref-number {
  width: 28px; height: 28px;
  min-width: 28px;
  background: var(--lavender-light);
  color: var(--lavender-deep);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2px;
}

.ref-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ref-item em {
  color: var(--text-primary);
}

.ref-item a {
  color: var(--lavender-deep);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ref-item a:hover {
  color: var(--coral);
}

/* ---------- Footer Disclaimer ---------- */
.footer-disclaimer {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--lavender-light);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--lavender);
}

.footer-disclaimer p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer-disclaimer strong {
  color: var(--text-primary);
}

.footer-disclaimer a {
  color: var(--lavender-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Newsletter / CTA ---------- */
.newsletter {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.newsletter-card {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.newsletter-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent);
  border-radius: var(--radius-round);
}

.newsletter-card::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(244, 132, 95, 0.15), transparent);
  border-radius: var(--radius-round);
}

.newsletter-card .section-label {
  color: rgba(255,255,255,0.8);
}

.newsletter-card .section-label::before {
  background: rgba(255,255,255,0.5);
}

.newsletter-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

.newsletter-card > p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto var(--space-md);
  position: relative;
  z-index: 1;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 24px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--white);
  outline: none;
  transition: var(--transition-fast);
}

.newsletter-form input::placeholder {
  color: rgba(255,255,255,0.6);
}

.newsletter-form input:focus {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.25);
}

.newsletter-form button {
  padding: 14px 32px;
  background: var(--white);
  color: var(--lavender-deep);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  white-space: nowrap;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-xl) 0 var(--space-md);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand .logo {
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 300px;
  line-height: 1.7;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 4px 0;
  transition: var(--transition-fast);
}

.footer-col a:hover {
  color: var(--lavender-deep);
  transform: translateX(4px);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-bottom .heart {
  color: var(--coral);
  display: inline;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Ad Slots ---------- */
.ad-slot {
  padding: var(--space-md) 0;
  position: relative;
  z-index: 1;
}

.ad-container {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  text-align: center;
  max-width: 728px;
  margin: 0 auto;
  position: relative;
}

.ad-container-wide {
  max-width: 100%;
}

.ad-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.ad-content {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, rgba(184, 169, 232, 0.05), rgba(126, 207, 179, 0.05));
  border-radius: var(--radius-sm);
}

.ad-placeholder-icon {
  font-size: 1.5rem;
  opacity: 0.5;
}

.ad-placeholder-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ad-placeholder-text a {
  color: var(--lavender-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.ad-placeholder-text a:hover {
  color: var(--coral);
}

/* ---------- Premium / Pricing Section ---------- */
.premium {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--bg) 0%, #f3efff 50%, var(--bg) 100%);
}

.premium-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.premium-header .section-desc {
  margin: 0 auto;
}

/* Pricing Toggle */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.toggle-label.active {
  color: var(--text-primary);
  font-weight: 600;
}

.save-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--mint-light);
  color: var(--mint-deep);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-switch {
  width: 52px;
  height: 28px;
  background: var(--border);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  padding: 0;
}

.toggle-switch.yearly {
  background: var(--lavender);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.toggle-switch.yearly .toggle-knob {
  left: 27px;
}

/* Pricing Cards */
.premium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 1000px;
  margin: 0 auto var(--space-xl);
  align-items: start;
}

.premium-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  transition: var(--transition-spring);
  position: relative;
  text-align: center;
}

.premium-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.premium-card.featured {
  border: 2px solid var(--lavender);
  box-shadow: 0 0 40px rgba(184, 169, 232, 0.2);
  transform: scale(1.03);
  z-index: 2;
}

.premium-card.featured:hover {
  transform: scale(1.03) translateY(-6px);
  box-shadow: 0 0 60px rgba(184, 169, 232, 0.3);
}

.popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(184, 169, 232, 0.3);
}

.premium-card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.premium-tier {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

.premium-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--text-primary);
  line-height: 1;
}

.price-period {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.premium-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-md);
}

.premium-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.premium-features li:last-child {
  border-bottom: none;
}

.premium-features .check {
  color: var(--mint-deep);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.premium-features .x {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.premium-features .excluded {
  opacity: 0.5;
}

.premium-features .highlight-feature {
  font-weight: 500;
  color: var(--text-primary);
}

.premium-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
}

.free-btn {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: default;
}

.pro-btn {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(184, 169, 232, 0.3);
}

.pro-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(184, 169, 232, 0.4);
}

.premium-tier-btn {
  background: var(--white);
  color: var(--lavender-deep);
  border: 2px solid var(--lavender);
}

.premium-tier-btn:hover {
  background: var(--lavender-light);
  transform: translateY(-2px);
}

.trial-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Locked Content Preview */
.locked-preview {
  margin-top: var(--space-lg);
  text-align: center;
}

.locked-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.locked-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.locked-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  transition: var(--transition-spring);
}

.locked-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(254, 252, 250, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
  color: var(--lavender-deep);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.locked-overlay:hover {
  background: rgba(254, 252, 250, 0.85);
}

.lock-icon {
  font-size: 2rem;
  animation: lockBounce 2s ease-in-out infinite;
}

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

.locked-card-content {
  padding: var(--space-md);
  text-align: left;
}

.locked-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--lavender-light);
  color: var(--lavender-deep);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.locked-card-content h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.locked-card-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

/* Default state for locked launch buttons — shown via JS when Pro */
.locked-launch-btn { display: none; }

/* ---------- Affiliate Disclosure ---------- */
.affiliate-disclosure {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--mint-light);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--mint);
}

.affiliate-disclosure p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.affiliate-disclosure strong {
  color: var(--text-primary);
}

.affiliate-disclosure a {
  color: var(--mint-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.affiliate-disclosure a:hover {
  color: var(--lavender-deep);
}

/* ---------- Newsletter Privacy ---------- */
.newsletter-privacy {
  font-size: 0.8rem !important;
  opacity: 0.7 !important;
  margin-top: var(--space-sm) !important;
  position: relative;
  z-index: 1;
}

/* ---------- SOS Calm Button ---------- */
.sos-calm-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.4);
  transition: var(--transition-spring);
  overflow: hidden;
}

.sos-calm-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 35px rgba(108, 92, 231, 0.5);
}

.sos-icon {
  font-size: 1.2rem;
}

.sos-pulse {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  animation: sosPulse 3s ease-in-out infinite;
}

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

/* ---------- SOS Calm Overlay ---------- */
.sos-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.sos-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#sosCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sos-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-round);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition-fast);
}

.sos-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sos-sound-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-round);
  cursor: pointer;
  z-index: 3;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.sos-sound-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sos-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 540px;
  padding: var(--space-lg);
}

/* Phase styles */
.sos-phase {
  animation: sosFadeIn 0.8s ease-out;
}

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

/* Phase 0: Welcome */
.sos-reassure {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.sos-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.sos-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.sos-sub strong {
  color: rgba(255, 255, 255, 0.95);
}

.sos-start-btn {
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  letter-spacing: 0.5px;
}

.sos-start-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.sos-note {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Phase 1: Breathing */
.sos-phase-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-lg);
  font-weight: 500;
}

.sos-breath-ring {
  width: 240px;
  height: 240px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-round);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  /* static ring — no spin to keep text readable */
}

.sos-breath-circle {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-round);
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.6), rgba(162, 155, 254, 0.6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(108, 92, 231, 0.3);
  transition: transform 0.3s ease;
}

.sos-breath-circle.inhale {
  animation: sosInhale 4s ease-in-out forwards;
}

.sos-breath-circle.hold {
  animation: none;
}

.sos-breath-circle.exhale {
  animation: sosExhale 8s ease-in-out forwards;
}

@keyframes sosInhale {
  from { transform: scale(1); box-shadow: 0 0 60px rgba(108, 92, 231, 0.3); }
  to { transform: scale(1.4); box-shadow: 0 0 100px rgba(108, 92, 231, 0.5); }
}

@keyframes sosExhale {
  from { transform: scale(1.4); box-shadow: 0 0 100px rgba(108, 92, 231, 0.5); }
  to { transform: scale(1); box-shadow: 0 0 60px rgba(108, 92, 231, 0.3); }
}

.sos-breath-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
}

.sos-breath-count {
  font-size: 2.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  min-height: 50px;
  display: flex;
  align-items: center;
}

.sos-instruction {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.sos-cycle-count {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Phase 2: Grounding */
.sos-ground-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  animation: sosFadeIn 0.5s ease;
}

.sos-ground-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #fff;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.sos-ground-hint {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.sos-ground-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.ground-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

.ground-dot.filled {
  background: rgba(126, 207, 179, 0.7);
  border-color: rgba(126, 207, 179, 0.9);
  box-shadow: 0 0 12px rgba(126, 207, 179, 0.4);
}

.sos-next-btn {
  padding: 14px 32px;
  background: rgba(126, 207, 179, 0.15);
  border: 1px solid rgba(126, 207, 179, 0.3);
  border-radius: var(--radius-pill);
  color: rgba(126, 207, 179, 0.9);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
}

.sos-next-btn:hover {
  background: rgba(126, 207, 179, 0.25);
  transform: translateY(-2px);
}

/* Phase 3: Affirmation */
.sos-affirm-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.sos-affirm-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  color: #fff;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
  animation: sosFadeIn 1s ease;
}

.sos-affirm-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.sos-affirm-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.affirm-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.15);
  transition: var(--transition-smooth);
}

.affirm-dot.active {
  background: rgba(242, 201, 76, 0.8);
  box-shadow: 0 0 8px rgba(242, 201, 76, 0.4);
}

/* Phase 4: Complete */
.sos-complete-icon {
  font-size: 4rem;
  margin-bottom: var(--space-sm);
  animation: completeBounce 1s ease;
}

@keyframes completeBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.sos-complete-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff;
  margin-bottom: var(--space-sm);
}

.sos-complete-text {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.sos-complete-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.sos-restart-btn {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-spring);
}

.sos-restart-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sos-done-btn {
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(126, 207, 179, 0.3), rgba(126, 207, 179, 0.15));
  border: 1px solid rgba(126, 207, 179, 0.4);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
}

.sos-done-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(126, 207, 179, 0.2);
}

.sos-crisis-note {
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

.sos-crisis-note a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sos-crisis-note a:hover {
  color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
  .references-grid {
    grid-template-columns: 1fr;
  }
  .premium-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .premium-card.featured {
    transform: none;
    order: -1;
  }
  .premium-card.featured:hover {
    transform: translateY(-6px);
  }
  .locked-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text { margin: 0 auto var(--space-lg); }
  .hero-actions { justify-content: center; }

  .hero-image {
    max-width: 400px;
    margin: 0 auto;
  }

  .about .container {
    grid-template-columns: 1fr;
  }

  .about-image {
    max-width: 400px;
    margin: 0 auto;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .newsletter-form {
    flex-direction: column;
  }

  .tip-card {
    flex: 0 0 280px;
  }

  .crisis-banner p {
    font-size: 0.75rem;
  }

  .references-grid {
    grid-template-columns: 1fr;
  }

  .premium-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
  }

  .locked-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin: 0 auto;
  }

  .ad-container {
    max-width: 100%;
  }

  .sos-calm-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .sos-breath-ring {
    width: 200px;
    height: 200px;
  }

  .sos-breath-circle {
    width: 150px;
    height: 150px;
  }
}

/* ========================================
   BREATHING PATTERNS
   ======================================== */
.breathing-patterns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: var(--space-md) 0 var(--space-sm);
}

.pattern-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-body);
}

.pattern-btn:hover {
  border-color: var(--lavender);
  background: var(--lavender-light);
}

.pattern-btn.active {
  border-color: var(--lavender-deep);
  background: var(--lavender-light);
  color: var(--lavender-deep);
}

.pattern-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.pattern-rhythm {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pattern-btn.active .pattern-rhythm {
  color: var(--lavender-deep);
}

.pattern-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-md);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ========================================
   MOOD HISTORY
   ======================================== */
.mood-history {
  margin-top: var(--space-lg);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.mood-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.mood-history-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mood-history-clear {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.mood-history-clear:hover {
  background: var(--border);
  color: var(--text-secondary);
}

.mood-chart-wrap {
  width: 100%;
  margin-bottom: var(--space-sm);
}

.mood-chart-wrap canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.mood-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.mood-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg);
}

.mood-history-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.mood-history-label {
  font-weight: 500;
  color: var(--text-primary);
  min-width: 72px;
}

.mood-history-time {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: auto;
}

/* ========================================
   AI CHAT COMPANION
   ======================================== */
.ai-chat-btn {
  position: fixed;
  bottom: 90px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--lavender-deep), #9b59b6);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 108, 176, 0.4);
  transition: var(--transition-spring);
  z-index: 9001;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.ai-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 108, 176, 0.5);
}

.ai-chat-btn.open {
  background: linear-gradient(135deg, #6c5ce7, var(--lavender-deep));
}

.ai-chat-btn-icon {
  font-size: 1.1rem;
}

.ai-chat-panel {
  position: fixed;
  bottom: 160px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 520px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(45, 38, 64, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9002;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-spring);
}

.ai-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--lavender-deep), #9b59b6);
  color: #fff;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.ai-chat-title strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.ai-chat-status {
  font-size: 0.72rem;
  opacity: 0.85;
}

.ai-chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-fast);
  font-family: var(--font-body);
}

.ai-chat-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
}

.ai-chat-msg {
  max-width: 85%;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.ai-chat-msg p {
  margin: 0;
}

.ai-msg {
  align-self: flex-start;
  background: var(--lavender-light);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.user-msg {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--lavender-deep), #9b59b6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-chat-disclaimer {
  padding: 6px 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.ai-chat-disclaimer a {
  color: var(--lavender-deep);
  text-decoration: none;
}

.ai-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.ai-chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: var(--transition-fast);
}

.ai-chat-input:focus {
  border-color: var(--lavender);
}

.ai-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender-deep), #9b59b6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.ai-chat-send:hover:not(:disabled) {
  transform: scale(1.08);
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .ai-chat-btn {
    bottom: 80px;
    right: 16px;
    padding: 10px 16px;
    font-size: 0.82rem;
  }

  .ai-chat-panel {
    bottom: 140px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 460px;
  }
}

/* ---------- Extracted Inline Styles ---------- */
.card-icon-mint { background: var(--mint-light); }
.card-icon-coral { background: var(--coral-light); }
.text-center { margin: 0 auto; }
.text-center-spaced { margin: 0 auto var(--space-md); }
.footer-link-sub { color: inherit; opacity: 0.7; }

/* Initial Hidden States */
#urgeActiveScreen, #matchWin, #moodHistory,
#sosPhase1, #sosPhase2, #sosPhase3, #sosPhase4 {
  display: none;
}

/* ===== iOS Native App Overrides ===== */
/* When running inside the iOS Capacitor app, hide web-only sections
   that either don't apply on native or use unfinished integrations */
body.is-ios #newsletter {
  /* The newsletter form uses a Formspree placeholder ID and is a web-only
     feature — hide it in the native iOS app to avoid reviewer confusion */
  display: none !important;
}

body.is-ios .affiliate-disclosure {
  /* Affiliate links aren't actionable inside the native app */
  display: none !important;
}

/* Apple Health badge — hidden on web, shown in iOS app.
   Triggered by body.is-ios (set by Capacitor bridge in app.js)
   OR html.ios-ua (set by early inline UA detection in <head>). */
.apple-health-badge {
  display: none;
}

body.is-ios .apple-health-badge,
html.ios-ua .apple-health-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  margin-left: auto;
  margin-right: auto;
  padding: 7px 16px;
  background: rgba(252, 49, 88, 0.15);
  border: 1px solid rgba(252, 49, 88, 0.4);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: 260px;
}

/* Inline AI companion CTA — hidden on web, shown in iOS app */
.inline-ai-cta {
  display: none;
}

body.is-ios .inline-ai-cta,
html.ios-ua .inline-ai-cta {
  display: block;
  margin-top: 20px;
  text-align: center;
}

body.is-ios .inline-ai-cta button,
html.ios-ua .inline-ai-cta button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #7c6cb0, #9b59b6);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(124, 108, 176, 0.4);
  width: 100%;
  max-width: 340px;
  justify-content: center;
}

body.is-ios .inline-ai-cta p,
html.ios-ua .inline-ai-cta p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}
/* Vertex AI Search Modal Styles */
.search-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}
.search-modal.active {
  display: flex;
}
.search-modal-content {
  width: 90%;
  max-width: 800px;
  height: 80vh;
  background: #1a1a2e;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-modal-close {
  position: absolute;
  top: 15px; right: 20px;
  background: none; border: none;
  color: white; font-size: 24px;
  cursor: pointer; z-index: 10;
}
/* Override widget styling for dark mode if needed */
gen-search-widget {
  flex: 1;
  width: 100%;
  height: 100%;
}

/* ============================================================
   iPAD SPLIT-PANE SIDEBAR
   Applied when body has both .is-ios and .is-ipad classes.
   The sidebar is hidden on iPhone and on the web.
   ============================================================ */
.ipad-sidebar { display: none; }

body.is-ipad .ipad-sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: 200px;
  height: 100vh;
  background: linear-gradient(180deg, #0e1a2e 0%, #0a1628 100%);
  border-right: 1px solid rgba(126,207,179,0.15);
  z-index: 9999;
  padding: 0;
  overflow: hidden;
}

body.is-ipad .ipad-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 52px 20px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #7ecfb3;
  border-bottom: 1px solid rgba(126,207,179,0.1);
}
body.is-ipad .ipad-sidebar-logo span:first-child { font-size: 1.5rem; }

body.is-ipad .ipad-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  overflow-y: auto;
}

body.is-ipad .ipad-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
body.is-ipad .ipad-nav-item:hover {
  background: rgba(126,207,179,0.08);
  color: rgba(255,255,255,0.9);
}
body.is-ipad .ipad-nav-item.active {
  background: rgba(126,207,179,0.15);
  color: #7ecfb3;
  border-left: 3px solid #7ecfb3;
}
body.is-ipad .ipad-nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }

body.is-ipad .ipad-sidebar-health {
  padding: 16px 20px;
  border-top: 1px solid rgba(126,207,179,0.1);
  background: rgba(126,207,179,0.04);
}
body.is-ipad .ipad-sidebar-health-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fc3158;
  text-transform: uppercase;
  margin-bottom: 12px;
}
body.is-ipad .ipad-sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
body.is-ipad .ipad-sidebar-stat span {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
body.is-ipad .ipad-sidebar-stat small {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  text-align: right;
  max-width: 120px;
}
body.is-ipad .ipad-sidebar-footer {
  padding: 6px 16px 12px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
  letter-spacing: 0.03em;
}

/* Sign In button inside sidebar */
body.is-ipad .ipad-sidebar-signin {
  margin: 0 16px 16px;
  padding: 10px 16px;
  background: rgba(126,207,179,0.15);
  border: 1px solid rgba(126,207,179,0.3);
  border-radius: 12px;
  color: #7ecfb3;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: calc(100% - 32px);
  text-align: center;
  transition: background 0.15s;
}
body.is-ipad .ipad-sidebar-signin:hover {
  background: rgba(126,207,179,0.25);
}

/* Push main content right on iPad — matches reduced sidebar width */
body.is-ipad .navbar,
body.is-ipad > *:not(.ipad-sidebar) {
  margin-left: 200px;
}
body.is-ipad .navbar { padding-left: 20px; }

/* Hide hamburger menu on iPad (sidebar replaces it) */
body.is-ipad .menu-toggle { display: none !important; }
body.is-ipad .navbar .nav-links { display: none !important; }

/* ── iPad content layout fixes ─────────────────────────────────
   Available content width on iPad Air 11-inch (834px) with
   200px sidebar = 634px. Ensure nothing overflows or crowds.
   ─────────────────────────────────────────────────────────── */

/* Keep native hub single-column so cards aren't squeezed */
body.is-ipad .native-hub-grid {
  grid-template-columns: 1fr !important;
  max-width: 560px;
}

/* Tighten section padding so content breathes */
body.is-ipad section,
body.is-ipad .section {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Ensure containers don't overflow */
body.is-ipad .container {
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Breathing circle: keep it from being cut off */
body.is-ipad .breathing-circle-container {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* Mood tracker: single column on iPad */
body.is-ipad .mood-grid,
body.is-ipad .mood-options {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Cards: ensure readable tap targets */
body.is-ipad .card,
body.is-ipad .native-card {
  min-height: 56px;
}

/* Hero: reduce font size slightly so headline wraps cleanly */
body.is-ipad .hero-title,
body.is-ipad h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

/* Prevent any fixed-width element from overflowing */
body.is-ipad * {
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   NATIVE HUB SECTION
   ============================================================ */
.native-hub-section { display: none; }

body.is-ios .native-hub-section {
  display: block;
  padding: 60px 20px 80px;
  background: linear-gradient(180deg, #0a1628 0%, #0e1a2e 100%);
}

.native-hub-header {
  text-align: center;
  margin-bottom: 36px;
}
.native-hub-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.native-hub-header p {
  color: rgba(255,255,255,0.55);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
}

.native-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .native-hub-grid { grid-template-columns: 1fr 1fr; }
}

.native-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.native-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  width: 100%;
}
.native-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.native-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.native-card-body p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin: 0;
}
.native-card-tag {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Health stats row inside native card */
.native-stats-row {
  display: flex;
  gap: 10px;
}
.native-stat {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.native-stat span {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}
.native-stat small {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}

/* Widget preview inside native card */
.widget-preview-box {
  background: linear-gradient(135deg, #1c1c3a, #0e1a2e);
  border: 1px solid rgba(126,207,179,0.2);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.widget-streak {
  font-size: 2.2rem;
  font-weight: 800;
  color: #7ecfb3;
  line-height: 1;
}
.widget-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin: 4px 0;
}
.widget-sessions {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}

/* Live Activity note */
.live-activity-note {
  background: rgba(255,149,0,0.1);
  border: 1px solid rgba(255,149,0,0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: rgba(255,200,100,0.9);
  line-height: 1.4;
}

/* Demo button */
.native-demo-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  align-self: flex-start;
}
.native-demo-btn:active { background: rgba(255,255,255,0.15); }
