/* ============================================================
   Serene — design system
   Dark, calm, multi-faith spiritual wellness PWA
   ============================================================ */
:root {
  --bg-0: #080a18;
  --bg-1: #0d1230;
  --bg-2: #12152e;
  --surface: #171a33;
  --surface-2: #1e2240;
  --line: #2a2f55;
  --text: #f4f5fb;
  --muted: #9aa1c4;
  --faint: #6b7299;
  --teal: #2dd4bf;
  --teal-dim: #14b8a6;
  --gold: #e0b46a;
  --rose: #f3a5b8;
  --violet: #8b7ff0;
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 72px;
  --maxw: 440px;
  --font-display: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #05060f;
  color: var(--text);
  font-family: var(--font-body);
  overscroll-behavior: none;
}
body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
}

/* ---- Device frame (cosmetic on desktop, full screen on phone) ---- */
#device {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  height: 100dvh;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 45%, #05060f 100%);
  overflow: hidden;
  display: flex; flex-direction: column;
}
@media (min-width: 480px) {
  #device {
    height: min(900px, 94dvh);
    border-radius: 38px;
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 11px #0b0d18, 0 0 0 13px #20243f;
  }
}

#app {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 20px calc(var(--nav-h) + 24px);
  scroll-behavior: smooth;
}
#app::-webkit-scrollbar { width: 0; }

/* ---- Top status row ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 18px;
}
.brandmark { display: flex; align-items: center; gap: 10px; }
.brandmark .logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: radial-gradient(circle at 35% 30%, #2dd4bf, #14b8a6 60%, #0e7d72);
  display: grid; place-items: center; color: #042f2a; font-size: 18px;
  box-shadow: 0 6px 18px rgba(45,212,191,.3);
}
.brandmark .name { font-weight: 600; letter-spacing: .3px; font-size: 16px; }
.topbar .actions { display: flex; gap: 16px; align-items: center; color: var(--muted); }
.topbar .actions .ic { font-size: 19px; cursor: pointer; }

.points-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(45,212,191,.12); color: var(--teal);
  border: 1px solid rgba(45,212,191,.3);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}

/* ---- Headings ---- */
.greeting { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 2px 0 4px; }
.subgreeting { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.section-title { font-family: var(--font-display); font-size: 22px; margin: 26px 0 14px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 14px; }
.row-head h2 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.row-head .see-all { color: var(--teal); font-size: 13px; cursor: pointer; }

.page-title { font-family: var(--font-display); font-size: 30px; margin: 10px 0 16px; }

/* ---- Chips ---- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; }
.chips::-webkit-scrollbar { height: 0; }
.chip {
  flex: 0 0 auto; padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: .15s;
}
.chip.active { background: rgba(45,212,191,.16); border-color: var(--teal); color: var(--teal); }

/* ---- Hero card ---- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 188px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px; cursor: pointer; margin-bottom: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.hero .label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; margin-bottom: 6px; }
.hero h3 { font-family: var(--font-display); font-size: 26px; margin: 0 0 4px; line-height: 1.15; }
.hero p { margin: 0; font-size: 13px; opacity: .9; max-width: 80%; }
.hero .play-fab {
  position: absolute; right: 18px; bottom: 18px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.35);
  display: grid; place-items: center; font-size: 17px; color: #fff;
}

/* ---- Cards / grids ---- */
.h-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; margin: 0 -4px; padding-left: 4px; }
.h-scroll::-webkit-scrollbar { height: 0; }

.card {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.3);
}
.card .art { aspect-ratio: 1 / 1; display: flex; align-items: flex-end; padding: 14px; }
.card .art h4 { font-family: var(--font-display); font-size: 19px; margin: 0; line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.card .meta { font-size: 12px; color: var(--muted); padding: 9px 4px 2px; }
.card .badge {
  position: absolute; top: 10px; right: 10px; font-size: 10px; letter-spacing: 1px;
  background: rgba(0,0,0,.45); padding: 4px 8px; border-radius: 999px; text-transform: uppercase;
}
.card .lock { position: absolute; top: 10px; left: 10px; font-size: 13px; background: rgba(0,0,0,.5); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }

.h-scroll .card { flex: 0 0 64%; max-width: 250px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- Journey / next-step card ---- */
.journey {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(120deg, #2a2410, #1a1a2e);
  border: 1px solid #3a3320; border-radius: var(--radius); padding: 16px; margin-top: 8px; cursor: pointer;
}
.journey .thumb { width: 70px; height: 56px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--gold), #b8863f); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 11px; color: #3a2a10; text-align: center; font-weight: 700; padding: 4px; }
.journey .j-body { flex: 1; }
.journey .j-step { font-size: 11px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; }
.journey h4 { margin: 4px 0 3px; font-size: 16px; }
.journey p { margin: 0; font-size: 12px; color: var(--muted); }
.journey .bar { height: 5px; background: rgba(255,255,255,.1); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.journey .bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* ---- List rows (sounds, prayers) ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.lrow {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 14px;
}
.lrow .lic { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; font-size: 20px; }
.lrow .lbody { flex: 1; min-width: 0; }
.lrow .lbody h4 { margin: 0 0 2px; font-size: 15px; }
.lrow .lbody p { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lgo { color: var(--faint); font-size: 16px; }

/* ---- Quote block ---- */
.quote-card {
  border-radius: var(--radius); padding: 24px 20px; margin-top: 12px;
  background: linear-gradient(135deg, rgba(139,127,240,.18), rgba(45,212,191,.10));
  border: 1px solid rgba(139,127,240,.3); text-align: center;
}
.quote-card .qmark { font-family: var(--font-display); font-size: 40px; color: var(--violet); line-height: .4; }
.quote-card blockquote { font-family: var(--font-display); font-size: 18px; line-height: 1.5; margin: 8px 0 10px; font-style: italic; }
.quote-card cite { font-size: 12px; color: var(--muted); font-style: normal; letter-spacing: 1px; }

/* ---- Generic gradient art helper classes set inline via JS ---- */

/* ---- Bottom tab bar ---- */
#tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch;
  background: rgba(8,10,24,.86); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); font-size: 10px; cursor: pointer; transition: color .15s; padding-top: 4px; }
.tab .tic { font-size: 20px; }
.tab.active { color: var(--teal); }

/* ---- Overlay (full screen sessions) ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg-0);
  display: flex; align-items: stretch; justify-content: center;
}
.overlay.hidden { display: none; }
.overlay .sheet {
  width: 100%; max-width: var(--maxw); position: relative;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top,0px) + 18px) 24px calc(env(safe-area-inset-bottom,0px) + 28px);
  overflow-y: auto;
}
.ov-close { position: absolute; top: calc(env(safe-area-inset-top,0px) + 16px); right: 20px;
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 18px; cursor: pointer; z-index: 2; }
.ov-back { position: absolute; top: calc(env(safe-area-inset-top,0px) + 16px); left: 20px;
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 18px; cursor: pointer; z-index: 2; }

/* Player */
.player { text-align: center; display: flex; flex-direction: column; height: 100%; }
.player .cover { position: relative; overflow: hidden; width: min(74%, 280px); aspect-ratio: 1; margin: 30px auto 26px; border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5); display: grid; place-items: center; }
.player .cover.live { animation: kenburns 16s ease-in-out infinite alternate; }
@keyframes kenburns { from { background-size: 108%; } to { background-size: 124%; background-position: 60% 40%; } }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: inherit; z-index: 1; }
.player .cover span { position: relative; z-index: 2; }
.player .cover span { font-family: var(--font-display); font-size: 30px; padding: 18px; text-align: center; text-shadow: 0 3px 14px rgba(0,0,0,.5); }
.player h2 { font-family: var(--font-display); font-size: 24px; margin: 4px 0; }
.player .psub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.progress { width: 100%; height: 5px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 999px; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 26px 0; }
.controls .pbtn { font-size: 26px; color: var(--muted); cursor: pointer; background: none; border: none; }
.controls .play {
  width: 76px; height: 76px; border-radius: 50%; background: var(--teal); color: #042f2a;
  display: grid; place-items: center; font-size: 28px; cursor: pointer; border: none;
  box-shadow: 0 12px 30px rgba(45,212,191,.45);
}
.sound-toggle { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Breathing */
.breath { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; gap: 8px; }
.breath h2 { font-family: var(--font-display); margin: 0; font-size: 24px; }
.breath .b-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.orb-wrap { position: relative; width: 280px; height: 280px; display: grid; place-items: center; margin: 18px 0; }
.orb {
  width: 168px; height: 168px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(94,234,212,.35), rgba(45,212,191,.10) 55%, transparent 72%);
  box-shadow: 0 0 70px rgba(45,212,191,.45);
  display: grid; place-items: center; will-change: transform;
  transition: transform var(--bt, 4s) cubic-bezier(.4,0,.2,1);
}
.orb .luna { width: 112px; height: 112px; }
.phase-label { font-size: 18px; font-weight: 600; color: var(--teal); margin-top: 4px; min-height: 24px; }
.orb-ring { position: absolute; width: 250px; height: 250px; border-radius: 50%; border: 1px solid rgba(45,212,191,.25); }
.breath .b-count { color: var(--muted); font-size: 13px; margin-top: 12px; }
.breath .b-start {
  margin-top: 18px; padding: 14px 40px; border-radius: 999px; border: none;
  background: var(--teal); color: #042f2a; font-weight: 700; font-size: 15px; cursor: pointer;
}

/* Detox timer */
.detox-run { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }
.ring-wrap { position: relative; width: 250px; height: 250px; margin: 10px 0 24px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap .rtime { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 44px; }
.detox-run .d-quote { font-family: var(--font-display); font-style: italic; color: var(--muted); max-width: 80%; margin: 8px auto 22px; font-size: 15px; line-height: 1.5; }

/* Reward */
.reward { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 0 8px; }
.reward .burst { font-size: 56px; margin-bottom: 6px; animation: pop .6s ease; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.reward h2 { font-family: var(--font-display); font-size: 26px; margin: 4px 0; }
.reward .r-points { color: var(--teal); font-weight: 700; font-size: 17px; margin: 4px 0 22px; }
.reward .r-quote { background: rgba(139,127,240,.14); border: 1px solid rgba(139,127,240,.3);
  border-radius: var(--radius); padding: 22px; max-width: 340px; }
.reward .r-quote blockquote { font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 1.5; margin: 0 0 10px; }
.reward .r-quote cite { font-size: 12px; color: var(--muted); font-style: normal; }
.reward .r-done { margin-top: 26px; padding: 14px 46px; border-radius: 999px; border: none;
  background: var(--teal); color: #042f2a; font-weight: 700; font-size: 15px; cursor: pointer; }
.reward .r-collect { margin-top: 12px; color: var(--muted); font-size: 13px; cursor: pointer; background: none; border: none; }

/* ---- More / profile ---- */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 14px 0 22px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--teal)); display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; }
.profile-head h2 { margin: 0; font-size: 20px; }
.profile-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.stat .big { font-family: var(--font-display); font-size: 28px; color: var(--teal); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.menu { display: flex; flex-direction: column; }
.menu .mrow { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.menu .mrow .mic { font-size: 18px; width: 24px; text-align: center; }
.menu .mrow .mt { flex: 1; font-size: 15px; }
.menu .mrow .mg { color: var(--faint); }
.menu .mrow .tagnew { font-size: 10px; background: var(--teal); color: #042f2a; padding: 3px 8px; border-radius: 999px; font-weight: 700; }

/* Luna hat picker */
.hat-picker { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 20px; }
.hat-picker::-webkit-scrollbar { height: 0; }
.hat-opt { flex: 0 0 auto; width: 86px; text-align: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px 8px; transition: .15s; }
.hat-opt.on { border-color: var(--teal); background: rgba(45,212,191,.12); }
.hat-opt .hat-prev { display: grid; place-items: center; height: 64px; }
.hat-opt span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.hat-opt.on span { color: var(--teal); font-weight: 600; }

/* premium banner */
.premium {
  border-radius: var(--radius); padding: 20px; margin: 6px 0 20px;
  background: linear-gradient(135deg, #2a2140, #14213a);
  border: 1px solid rgba(224,180,106,.35);
}
.premium h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 19px; color: var(--gold); }
.premium p { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.premium button { background: var(--gold); color: #3a2a10; border: none; padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* quotes collection */
.qcollect { display: flex; flex-direction: column; gap: 12px; }
.qitem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.qitem blockquote { font-family: var(--font-display); font-style: italic; margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.qitem cite { font-size: 11px; color: var(--muted); font-style: normal; letter-spacing: 1px; }
.qlocked { opacity: .4; }
.share-btn { margin-top: 10px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--muted); font-size: 12px; cursor: pointer; display: block; }
.share-btn:active { background: rgba(255,255,255,.16); }

/* misc */
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 18px); z-index: 80;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 14px; font-size: 13px; max-width: 340px; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.note { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.seg { display: flex; gap: 10px; margin: 4px 0 18px; }
.seg button { flex: 1; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; }
.seg button.on { background: rgba(45,212,191,.16); border-color: var(--teal); color: var(--teal); font-weight: 600; }

/* ---- Luna mascot ---- */
.luna { display: block; overflow: visible; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.luna-bob { animation: lunaBob 4.5s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes lunaBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.luna-halo { animation: lunaHalo 4.5s ease-in-out infinite; transform-origin: 78px 118px; }
@keyframes lunaHalo { 0%,100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.luna-eyes { animation: lunaBlink 5.5s infinite; transform-origin: center; }
@keyframes lunaBlink { 0%,94%,100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.luna-twinkle path { animation: lunaTwinkle 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.luna-twinkle path:nth-child(2) { animation-delay: 1.1s; }
@keyframes lunaTwinkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.luna-zzz text { animation: lunaZzz 3s ease-in-out infinite; opacity: 0; }
.luna-zzz text:nth-child(2) { animation-delay: .6s; }
.luna-zzz text:nth-child(3) { animation-delay: 1.2s; }
@keyframes lunaZzz { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

/* placements */
.greet-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.greet-wrap .greet-text { flex: 1; min-width: 0; }
.greet-wrap .greet-text .greeting { margin: 0 0 4px; line-height: 1.12; }
.greet-wrap .greet-text .subgreeting { margin: 0; }
.greet-wrap .luna { flex: 0 0 auto; }

/* page header with a small Luna companion */
.page-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.page-head .luna { flex: 0 0 auto; }
.page-head .ph-text { flex: 1; min-width: 0; }
.page-head .page-title { font-size: 27px; }
.brandmark .luna { width: 36px; height: 36px; }

/* click reaction: blush pop + floating hearts */
.luna.is-happy { animation: lunaWiggle .6s ease; }
@keyframes lunaWiggle {
  0%,100% { transform: translateY(0) rotate(0); }
  25% { transform: rotate(-10deg) scale(1.06); }
  60% { transform: rotate(8deg) scale(1.09); }
}
.luna-cheeks { transform-box: fill-box; transform-origin: center; }
.luna.is-happy .luna-cheeks { animation: cheekPop .6s ease; }
@keyframes cheekPop {
  0% { opacity: .7; transform: scale(1); }
  45% { opacity: 1; transform: scale(1.35); }
  100% { opacity: .7; transform: scale(1); }
}
/* Luna speech bubbles */
.luna-bubble {
  position: relative; display: inline-block;
  background: rgba(45,212,191,.12); border: 1px solid rgba(45,212,191,.32);
  color: var(--text); font-size: 13px; line-height: 1.45;
  padding: 9px 13px; border-radius: 14px; max-width: 250px;
  animation: bubblePop .35s ease both;
}
@keyframes bubblePop { from { opacity: 0; transform: scale(.9) translateY(4px); } to { opacity: 1; transform: none; } }
/* default: tail points left (toward a Luna on the left) */
.luna-bubble::after {
  content: ""; position: absolute; width: 11px; height: 11px;
  background: rgba(45,212,191,.12);
  border-left: 1px solid rgba(45,212,191,.32); border-bottom: 1px solid rgba(45,212,191,.32);
  left: -6px; top: 15px; transform: rotate(45deg);
}
/* up variant: centered, tail points up (toward a Luna above) */
.luna-bubble.up { display: block; margin: 12px auto 0; text-align: center; }
.luna-bubble.up::after { left: 50%; top: -6px; margin-left: -5px; transform: rotate(135deg); }

.luna-heart {
  position: fixed; z-index: 200; pointer-events: none; color: #ff8fb0;
  text-shadow: 0 2px 6px rgba(0,0,0,.35); will-change: transform, opacity;
  animation: heartUp 1.2s ease-out forwards;
}
@keyframes heartUp {
  0% { opacity: 0; transform: translate(0,0) scale(.3) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx,0), -78px) scale(1.15) rotate(var(--dr,0)); }
}
.avatar-luna { width: 64px; height: 64px; flex: 0 0 auto; }
.breath .orb .luna { filter: drop-shadow(0 6px 16px rgba(0,0,0,.3)); }
.reward .burst .luna { margin: 0 auto; }
@media (prefers-reduced-motion: reduce) {
  .luna-bob, .luna-halo, .luna-eyes, .luna-twinkle path, .luna-zzz text { animation: none; }
}

/* ============================================================
   Onboarding — first-launch welcome
   ============================================================ */
body.onboarding #tabbar { display: none; }
.onboard {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 28px 26px calc(36px + env(safe-area-inset-bottom));
}
.onb-luna { margin: 12px 0 6px; }
.onb-title {
  font-family: var(--font-display); font-size: 30px; font-weight: 600;
  margin: 6px 0 8px; letter-spacing: .2px;
}
.onb-sub { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 320px; margin: 0 0 30px; }
.onb-label {
  display: block; width: 100%; text-align: left;
  color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 10px;
}
.onb-opt { color: var(--faint); font-weight: 400; font-size: 13px; }
.onb-input {
  width: 100%; padding: 15px 18px; font-size: 17px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.onb-input::placeholder { color: var(--faint); }
.onb-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.15); }
.onb-focus { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-bottom: 32px; }
.onb-chip {
  flex: 1 1 calc(50% - 5px);
  display: flex; align-items: center; gap: 9px;
  padding: 13px 14px; font-size: 14.5px; text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-body);
  transition: background .18s, border-color .18s, transform .12s;
}
.onb-chip .ofi { font-size: 18px; line-height: 1; }
.onb-chip:active { transform: scale(.97); }
.onb-chip.on { background: rgba(45,212,191,.16); border-color: var(--teal); color: var(--teal); }
.onb-go {
  width: 100%; margin-top: auto; padding: 16px; border: none;
  border-radius: 999px; font-size: 16px; font-weight: 600; cursor: pointer;
  color: #06201c; background: var(--teal); font-family: var(--font-body);
  transition: opacity .2s, transform .12s;
}
.onb-go:active { transform: scale(.98); }
.onb-go:disabled { opacity: .4; cursor: default; }
.onb-skip {
  margin-top: 14px; padding: 6px; border: none; background: none;
  color: var(--muted); font-size: 14px; cursor: pointer; font-family: var(--font-body);
}
