@font-face {
  font-family: Fredoka;
  src: url("fonts/fredoka.woff") format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("fonts/nunito.woff") format("woff");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #3b2152;
  --muted: #7a5b8a;
  --paper: #fff4fa;
  --card: #ffffff;
  --pink: #ff5aa5;
  --pink-soft: #ff7eb3;
  --pink-deep: #e7368a;
  --lilac: #c9a8ff;
  --sky: #7ad3ff;
  --lime: #c8f04a;
  --mint: #7af0dd;
  --shadow: 0 12px 28px rgba(90, 30, 80, 0.14);
  --shadow-soft: 0 6px 16px rgba(90, 30, 80, 0.1);
  --radius: 22px;
  --nav-h: 72px;
  --header-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -80px, #ffe7a8 0%, transparent 55%),
    radial-gradient(900px 500px at 80% -40px, #ffe0f0 0%, transparent 60%),
    linear-gradient(180deg, #fff7e8 0%, var(--paper) 40%, #f3efff 100%);
  background-attachment: fixed;
  min-height: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

/* ----- Header ----- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: linear-gradient(180deg, #ff7eb3 0%, #ff5aa5 70%, #ff4f9a 100%);
}
.top::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -16px;
  height: 16px;
  background-color: #fff4fa;
  background-image:
    radial-gradient(circle at 12% 0, #ff4f9a 11px, transparent 12px),
    radial-gradient(circle at 28% 0, #ff4f9a 8px, transparent 9px),
    radial-gradient(circle at 46% 0, #ff4f9a 13px, transparent 14px),
    radial-gradient(circle at 64% 0, #ff4f9a 7px, transparent 8px),
    radial-gradient(circle at 80% 0, #ff4f9a 11px, transparent 12px),
    radial-gradient(circle at 94% 0, #ff4f9a 8px, transparent 9px);
  pointer-events: none;
}
.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.top-row h1 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  margin: 0;
  flex: 1;
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(180, 20, 90, 0.18);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-bee { width: 22px; height: 22px; flex: 0 0 auto; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
}
.icon-btn svg { width: 22px; height: 22px; }
.cart-btn { position: relative; }
.badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--lime);
  color: var(--ink);
  font-family: Fredoka, sans-serif;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* ----- Home ----- */
.hero {
  margin: 24px 16px 6px;
  background: linear-gradient(160deg, #fff 0%, #fff6fb 60%, #f3e9ff 100%);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 4px 16px 12px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  width: 120px; height: 120px;
  right: -30px; top: -40px;
  background: radial-gradient(circle, rgba(255,122,179,0.25), transparent 70%);
  pointer-events: none;
}
.hero-copy h2 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 6px;
  line-height: 1.15;
}
.hero-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.hero-art { display: grid; place-items: center; }
.hero-art .slime-wrap {
  width: 132px;
  height: 122px;
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-7px) rotate(1.4deg); }
}

.example-banner {
  margin: 12px 16px 4px;
  background: #fff6d8;
  border: 1.5px dashed #f0c44a;
  color: #6a4a12;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

.section-title {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin: 12px 18px 8px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 8px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:active { transform: scale(0.98); }
.card-art {
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 8px;
}
.card-art .slime-wrap { width: 112px; height: 104px; }
.card h3 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 2px 2px;
}
.card .blurb {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  margin: 0 2px 8px;
  flex: 1;
  min-height: 2.6em;
}
.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
}
.price {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}
.price small {
  font-family: Nunito, sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 3px;
}
.chip-look {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--pink-deep);
  background: #ffe3f1;
  border-radius: 99px;
  padding: 3px 8px;
}

/* ----- Product ----- */
.view { padding-top: 20px; }
.back-row { padding: 0 8px; }
.back-row button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pink-deep);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 4px 10px 8px;
  white-space: nowrap;
}
.back-row button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.product-hero {
  margin: 4px 16px 10px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 6px 16px 12px;
  text-align: center;
}
.product-hero .slime-wrap {
  width: 150px;
  height: 136px;
  margin: 0 auto;
}
.product-hero h2 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 4px;
}
.product-hero .lead {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.product-hero .price { font-size: 1.35rem; }

.panel {
  margin: 0 16px 10px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 12px 14px 10px;
}
.panel h3 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 10px;
}
.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.opt {
  border: 2px solid #f0d8ea;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.88rem;
}
.opt.on {
  border-color: var(--pink);
  background: #ffe4f1;
  color: var(--pink-deep);
  box-shadow: 0 2px 0 rgba(255, 90, 165, 0.25);
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #ead4e4;
  padding: 0;
}
.swatch.on { box-shadow: 0 0 0 3px var(--pink); }

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qty button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #ffe4f1;
  color: var(--pink-deep);
  font-family: Fredoka, sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}
.qty span {
  min-width: 28px;
  text-align: center;
  font-family: Fredoka, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.cta {
  display: block;
  width: calc(100% - 32px);
  margin: 4px 16px 16px;
  background: linear-gradient(180deg, #ff7eb3, #ff4f9a);
  color: #fff;
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 8px 0 #d42d7a, 0 12px 20px rgba(255, 80, 150, 0.28);
  text-align: center;
}
.cta:active { transform: translateY(2px); box-shadow: 0 6px 0 #d42d7a, 0 8px 14px rgba(255, 80, 150, 0.25); }
.cta.ghost {
  background: #fff;
  color: var(--pink-deep);
  box-shadow: 0 4px 0 #f0cfe0;
  border: 2px solid #ffc2de;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 40;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----- Cart / checkout ----- */
.empty {
  margin: 28px 16px;
  text-align: center;
  background: var(--card);
  border-radius: 24px;
  padding: 28px 18px;
  box-shadow: var(--shadow-soft);
}
.empty .slime-wrap { width: 140px; height: 128px; margin: 0 auto 8px; }
.empty h2 { font-family: Fredoka, sans-serif; margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 0 14px; }

.cart-item {
  margin: 0 16px 10px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 10px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: center;
}
.cart-item .mini { width: 86px; height: 80px; }
.cart-item h3 { font-family: Fredoka, sans-serif; font-size: 1.02rem; margin: 0 0 2px; }
.cart-item .meta { color: var(--muted); font-size: 0.78rem; margin: 0 0 8px; line-height: 1.3; }
.cart-item .row { display: flex; align-items: center; justify-content: space-between; }
.remove {
  color: #c44a7a;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 0;
}

.totals {
  margin: 8px 16px 12px;
  background: var(--card);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.totals .line {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  color: var(--muted);
}
.totals .grand {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px dashed #f0d8ea;
  font-family: Fredoka, sans-serif;
  font-size: 1.15rem;
}

.note {
  margin: 0 16px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.35;
}

form.order {
  margin: 0 16px 12px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: grid;
  gap: 12px;
}
label { display: grid; gap: 6px; font-weight: 800; font-size: 0.88rem; }
input, textarea {
  border: 2px solid #f0d8ea;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus { border-color: var(--pink); }
textarea { min-height: 80px; resize: vertical; }
.hint { font-weight: 600; color: var(--muted); font-size: 0.75rem; }

.thanks {
  margin: 20px 16px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px 18px 22px;
  text-align: center;
}
.thanks .slime-wrap { width: 170px; height: 156px; margin: 0 auto 6px; animation: bob 3s ease-in-out infinite; }
.thanks h2 { font-family: Fredoka, sans-serif; font-size: 1.6rem; margin: 0 0 8px; }
.thanks p { color: var(--muted); margin: 0 0 10px; line-height: 1.4; }

/* ----- Bottom nav ----- */
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -8px 24px rgba(80, 20, 80, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  z-index: 30;
}
.nav a, .nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  font-size: 0.72rem;
  color: #b089b4;
  text-decoration: none;
  padding: 6px 0;
}
.nav a.on, .nav button.on { color: var(--pink-deep); }
.nav svg { width: 24px; height: 24px; }

.install-tip {
  margin: 8px 16px 0;
  background: #efe6ff;
  color: #4e2d86;
  border-radius: 14px;
  padding: 10px 12px 10px 14px;
  font-size: 0.8rem;
  line-height: 1.35;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.install-tip button {
  margin-left: auto;
  color: #4e2d86;
  font-weight: 800;
  padding: 2px 4px;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


/* ----- Welcome ----- */
body.welcome-open #app { padding-bottom: 0; min-height: 100%; }
body.welcome-open { overflow: hidden; }

.welcome {
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(72px + env(safe-area-inset-top, 0px)) 10px calc(28px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 220, 80, 0.5), transparent 42%),
    radial-gradient(circle at 92% 24%, rgba(255, 150, 190, 0.28), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 200, 70, 0.07) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, #fff3b8 0%, #ffe9f2 48%, #fff5fb 100%);
  position: relative;
  overflow: hidden;
}
.welcome-kicker {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: 0.01em;
}
.welcome .bee-title {
  display: block;
  width: 100%;
  max-width: 390px;
  height: auto;
  overflow: visible;
}
.welcome-cta { margin-top: 28px; width: min(260px, calc(100% - 48px)); }
.bee-buzz {
  animation: bee-buzz 1.45s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes bee-buzz {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  50% { transform: translate(0.6px, -3.2px) rotate(5deg); }
}
.wing {
  transform-box: fill-box;
  transform-origin: 50% 85%;
  animation: wing-flap 0.15s ease-in-out infinite;
}
.wing-r { animation-delay: 0.07s; }
@keyframes wing-flap {
  0%, 100% { transform: rotate(-10deg) scaleY(1); }
  50% { transform: rotate(12deg) scaleY(0.78); }
}
@media (prefers-reduced-motion: reduce) {
  .bee-buzz, .wing { animation: none; }
}
