:root {
  --navy: #1E2A47;
  --navy-soft: #4A5470;
  --pink: #C24E68;
  --pink-dark: #A93E57;
  --pink-light: #E58A9D;
  --blush: #FBEDEF;
  --blush-2: #FDF6F7;
  --yellow: #F6C343;
  --yellow-soft: #FFF5D6;
  --border: #F1DCE0;
  --bg: #FFFFFF;
  --radius: 22px;
  --heading: 'Fredoka', 'Poppins', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --nav-h: 76px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--navy); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--pink); }
h1, h2, h3 { font-family: var(--heading); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
p { margin: 0; }
.muted { color: var(--navy-soft); }
.accent { color: var(--pink); }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 180px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* layout */
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .logo { height: 42px; width: auto; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.page { padding: 18px 16px 0; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.page > *, .page section > * { min-width: 0; }
.page-title { display: grid; gap: 4px; }
.page-title h1 { font-size: 28px; display: flex; gap: 10px; align-items: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--pink); color: #fff; font-family: var(--heading); font-weight: 600; font-size: 17px; padding: 13px 24px; text-decoration: none; box-shadow: 0 6px 18px rgba(194,78,104,.22); transition: transform .12s ease, background .2s; }
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--pink-dark); }
.btn.small { font-size: 15px; padding: 9px 16px; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--pink); border: 2px solid var(--pink); box-shadow: none; }
.btn.soft { background: var(--blush); color: var(--pink); border: 1.5px solid var(--border); box-shadow: none; }
.btn.dark { background: var(--navy); box-shadow: none; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--pink); font-weight: 700; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--pink-light); background: var(--blush-2); color: var(--navy); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 14px; font-family: var(--heading); }
.pill.yellow { border-color: #F2D27A; background: var(--yellow-soft); }

/* avatars */
.avatar { border-radius: 50%; overflow: hidden; flex: none; background: var(--blush); border: 3px solid var(--pink-light); }
.avatar svg { width: 100%; height: 100%; }
.avatar.xs { width: 40px; height: 40px; border-width: 2px; }
.avatar.sm { width: 50px; height: 50px; border-width: 2px; }
.avatar.md { width: 76px; height: 76px; }
.avatar.lg { width: 150px; height: 150px; border-width: 5px; box-shadow: 0 10px 30px rgba(194,78,104,.18); }
.avatar.xl { width: 190px; height: 190px; border-width: 6px; box-shadow: 0 14px 40px rgba(194,78,104,.2); }
.avatar-btn { border: 0; background: none; padding: 0; position: relative; }

/* cards */
.card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card.blush { background: var(--blush-2); }
.card.yellow { background: var(--yellow-soft); border-color: #F5DE96; }
.card.dark { background: var(--navy); color: #fff; border: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }

/* hero card on home */
.hello { padding: 0; overflow: hidden; }
.hello-top { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--blush); }
.hello-top h2 { font-size: 22px; margin-bottom: 6px; }
.hello-body { padding: 16px; display: grid; gap: 16px; }
.meals { display: flex; gap: 14px; align-items: center; position: relative; }
.meals .bowl { width: 92px; flex: none; }
.meals .num { font-family: var(--heading); font-weight: 700; color: var(--pink); font-size: 52px; line-height: 1; }
.meals .num small { font-size: 26px; margin-left: 6px; }
.meals .paw-bg { position: absolute; right: -6px; top: -10px; width: 110px; opacity: .1; pointer-events: none; }
hr.soft { border: 0; border-top: 1.5px solid var(--border); margin: 0; }

/* level track */
.track { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; padding-top: 4px; }
.track::before { content: ''; position: absolute; left: 8%; right: 8%; top: 27px; height: 6px; background: var(--blush); border-radius: 6px; }
.track .fill { position: absolute; left: 8%; top: 27px; height: 6px; background: var(--pink); border-radius: 6px; }
.node { position: relative; display: grid; justify-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.node .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: #fff; border: 2.5px dashed var(--pink-light); }
.node.done .dot { background: var(--pink); border: 0; }
.node.current .dot { width: 54px; height: 54px; margin-top: -4px; background: #fff; border: 4px solid var(--pink); box-shadow: 0 6px 16px rgba(194,78,104,.25); }
.node.current span { color: var(--pink); }
.next-line { font-size: 16px; }
.next-line b { color: var(--pink); }

/* media grid */
.media-head { display: grid; gap: 2px; }
.media-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--blush); border: 0; padding: 0; aspect-ratio: 3/4; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.media-grid .tile { grid-column: span 2; }
.media-grid.featured .tile:nth-child(-n+2) { grid-column: span 3; }
.tile .tag { position: absolute; top: 10px; left: 10px; background: var(--pink); color: #fff; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 3px 10px; font-family: var(--heading); }
.tile .play { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; color: var(--pink); }
.tile .lock { position: absolute; inset: 0; background: rgba(30,42,71,.35); display: grid; place-items: center; color: #fff; font-size: 30px; }
.tile.locked img { filter: blur(3px) saturate(.8); }

/* club card */
.club { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; border: 2px solid var(--pink-light); background: var(--blush-2); }
.club .stack { position: relative; height: 112px; }
.club .stack .c { position: absolute; width: 72px; height: 96px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 6px 14px rgba(30,42,71,.15); overflow: hidden; background: var(--blush); }
.club .stack .c:first-child { left: 0; top: 14px; transform: rotate(-8deg); }
.club .stack .c:last-child { left: 22px; top: 0; transform: rotate(6deg); }
.club .stack .c svg, .club .stack .c img { width: 100%; height: 100%; object-fit: cover; }
.club h3 { margin-bottom: 4px; }
.club p { font-size: 15px; margin-bottom: 10px; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; text-align: center; }
.badge { display: grid; justify-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.badge .ring { position: relative; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; border: 2.5px dashed var(--pink-light); background: #fff; }
.badge.earned .ring { border: 4px solid var(--pink-light); background: var(--blush); }
.badge:not(.earned) .ring > span { opacity: .55; filter: grayscale(.4); }
.badge .ring .lk { position: absolute; right: -4px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1.5px solid var(--border); display: grid; place-items: center; font-size: 12px; }
.badge .share { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--blush); border: 0; color: var(--pink); font-weight: 700; }

/* reward banner */
.reward-banner { display: flex; gap: 12px; align-items: center; background: var(--yellow); border-radius: 18px; padding: 14px; }
.reward-banner .txt { flex: 1; font-size: 16px; }
.reward-banner .ic { font-size: 30px; }

/* collections */
.scroller { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.collection { flex: 0 0 46%; scroll-snap-align: start; border: 1.5px solid var(--border); border-radius: 20px; padding: 12px; display: grid; gap: 10px; align-content: space-between; background: #fff; }
.collection .img { aspect-ratio: 1; border-radius: 14px; background: var(--blush); overflow: hidden; display: grid; place-items: center; font-size: 40px; }
.collection .img img { width: 100%; height: 100%; object-fit: cover; }
.collection h3 { font-size: 17px; }

.footer-cta { display: flex; gap: 12px; align-items: center; }
.footer-cta .txt { flex: 1; font-size: 16px; }

/* lists */
.list { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1.5px solid var(--border); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-family: var(--heading); font-weight: 600; font-size: 18px; }
.row .sub { font-size: 14.5px; color: var(--navy-soft); }
.row .meals-n { text-align: right; font-family: var(--heading); font-weight: 700; color: var(--pink); font-size: 19px; line-height: 1.05; }
.row .meals-n small { display: block; color: var(--navy); font-size: 13px; font-weight: 500; font-family: var(--body); }
.rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--blush); color: var(--pink); flex: none; font-family: var(--heading); }
.rank.gold { background: var(--yellow); color: var(--navy); }
.row.me { background: var(--blush-2); }
.row.me .rank { width: auto; background: none; padding: 0 4px; }
.sep { text-align: center; color: var(--pink-light); letter-spacing: 4px; font-weight: 700; border-top: 1.5px dashed var(--border); padding: 2px 0; }
.time { font-weight: 700; font-size: 14.5px; color: var(--navy); }

/* stats */
.stats-hero { display: grid; gap: 16px; }
.stats-hero .big { display: flex; gap: 14px; align-items: center; }
.stats-hero .big .n { font-family: var(--heading); font-weight: 700; font-size: 44px; color: var(--pink); line-height: 1; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { border-radius: 16px; background: var(--blush-2); padding: 12px; display: flex; gap: 10px; align-items: center; }
.mini.yellow { background: var(--yellow-soft); }
.mini .n { font-family: var(--heading); font-weight: 700; font-size: 24px; line-height: 1; }
.mini .l { font-size: 14px; }
.faces { display: flex; align-items: center; }
.faces .avatar { margin-left: -12px; }
.faces .avatar:first-child { margin-left: 0; }
.faces .more { margin-left: -12px; height: 50px; min-width: 64px; padding: 0 12px; border-radius: 999px; background: var(--yellow); display: grid; place-items: center; font-weight: 700; font-family: var(--heading); }

/* tabs (segmented) */
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--blush-2); border: 1.5px solid var(--border); border-radius: 18px; padding: 5px; }
.segmented button { border: 0; background: none; padding: 11px; border-radius: 14px; font-weight: 700; color: var(--navy-soft); }
.segmented button.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(30,42,71,.08); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.chip.on { border: 2px solid var(--pink); color: var(--pink); }
.report { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.report .thumb { width: 64px; height: 64px; border-radius: 12px; background: var(--blush); overflow: hidden; flex: none; display: grid; place-items: center; font-size: 26px; }
.report .thumb img { width: 100%; height: 100%; object-fit: cover; }
.report .kicker { color: var(--pink); font-weight: 700; font-size: 14px; }
.report .title { font-family: var(--heading); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* levels list */
.level-row .icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; border: 2.5px dashed var(--pink-light); flex: none; }
.level-row.unlocked .icon { border: 3px solid var(--pink-light); background: var(--blush); }
.level-row.current { background: var(--blush-2); }
.status { font-weight: 700; font-size: 14px; border-radius: 999px; padding: 4px 12px; }
.status.ok { background: #E3F4E8; color: #2D7A47; }
.status.you { background: var(--pink); color: #fff; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1.5px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
.nav a { display: grid; justify-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 12.5px; white-space: nowrap; letter-spacing: -0.01em; }
@media (max-width: 360px) { .nav a { font-size: 11px; } }
.nav a .ic { width: 64px; height: 34px; border-radius: 999px; display: grid; place-items: center; }
.nav a .ic svg { width: 24px; height: 24px; }
.nav a.on { color: var(--pink); }
.nav a.on .ic { background: var(--blush); }

/* onboarding */
.flow { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.flow-body { flex: 1; padding: 28px 22px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.flow-body h1 { font-size: 30px; }
.flow-body .text { display: grid; gap: 14px; font-size: 17.5px; max-width: 440px; }
.flow-body .art { width: 100%; max-width: 420px; border-radius: 22px; overflow: hidden; }
.flow-body .art img { width: 100%; height: auto; }
.flow-foot { padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--border); display: grid; gap: 14px; background: #fff; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 9px; height: 9px; border-radius: 9px; background: var(--border); transition: width .2s, background .2s; }
.dots i.on { width: 34px; background: var(--pink); }
.dots i.past { background: var(--pink-light); }
.flow-btns { display: flex; gap: 12px; }
.flow-btns .back { width: 64px; flex: none; padding: 0; }
.flow-btns .next { flex: 1; }
.bignum { font-family: var(--heading); font-weight: 700; color: var(--pink); font-size: 84px; line-height: 1; display: flex; align-items: center; gap: 10px; }
.bignum img { width: 90px; }
.code-box { width: 100%; max-width: 420px; border: 2.5px dashed var(--pink-light); background: var(--blush-2); border-radius: 18px; padding: 18px; font-family: var(--heading); font-weight: 700; font-size: 30px; letter-spacing: 3px; color: var(--pink); }
.badge-hero { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; font-size: 56px; background: var(--blush); border: 5px solid var(--pink-light); box-shadow: 0 10px 30px rgba(194,78,104,.18); }
.ready-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; max-width: 440px; }
.ready-stats > div { display: grid; gap: 2px; padding: 0 6px; border-left: 1.5px solid var(--border); }
.ready-stats > div:first-child { border-left: 0; }
.ready-stats b { font-family: var(--heading); font-size: 30px; color: var(--pink); line-height: 1.1; }
.ready-stats span { font-size: 14px; font-weight: 700; }

/* jumping cat */
.jump { animation: jump 1.6s ease-in-out infinite; position: relative; }
@keyframes jump { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-26px) rotate(-6deg); } 55% { transform: translateY(-30px) rotate(5deg); } 80% { transform: translateY(0) scale(1.04, .96); } }
.sparkles { position: relative; }
.sparkles i { position: absolute; color: var(--yellow); font-style: normal; font-size: 26px; animation: twinkle 1.6s ease-in-out infinite; }
.sparkles i:nth-child(1) { left: -18px; top: 20px; }
.sparkles i:nth-child(2) { right: -14px; top: 0; animation-delay: .4s; }
.sparkles i:nth-child(3) { right: -24px; bottom: 30px; animation-delay: .8s; font-size: 18px; }
.sparkles i:nth-child(4) { left: -4px; bottom: 6px; animation-delay: 1.1s; font-size: 16px; }
@keyframes twinkle { 50% { transform: scale(.4) rotate(40deg); opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .jump, .sparkles i, .flow-body { animation: none; } }

/* login */
.login { max-width: 460px; margin: 0 auto; min-height: 100vh; padding: 40px 22px; display: grid; align-content: center; gap: 22px; text-align: center; justify-items: center; }
.login .logo { width: 200px; }
.notice { background: var(--yellow-soft); border: 1.5px solid #F5DE96; border-radius: 16px; padding: 12px 14px; font-size: 15px; text-align: left; }
.notice.error { background: #FDECEF; border-color: var(--border); }
input, textarea { font: inherit; color: var(--navy); width: 100%; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--pink-light); border-color: var(--pink-light); }
label { font-weight: 700; font-size: 14.5px; display: grid; gap: 6px; text-align: left; }
.form { display: grid; gap: 12px; width: 100%; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--pink); }

/* modal + viewer */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(30,42,71,.55); display: grid; place-items: end center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; background: #fff; border-radius: 26px 26px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; max-height: 92vh; overflow: auto; text-align: center; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(12,16,28,.94); display: grid; place-items: center; padding: 20px; }
.viewer img, .viewer video { max-width: 100%; max-height: 86vh; border-radius: 14px; }
.viewer .close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 70; animation: fade .2s; }
.empty { text-align: center; padding: 24px 10px; color: var(--navy-soft); }
