/* Pointie — Customer web app */
:root, [data-theme="dark"] {
  --bg: #000000; --surface: #161616; --soft: #2A1A10; --ink: #F7F7F7; --muted: #A9A9A9;
  --line: #2A2A2A; --primary: #FF7A2E; --on-primary: #FFFFFF; --accent: #FF9A5C; --track: #333333;
  --gold: #FFC83D; --teal: #3CC7B2; --violet: #A592FF; --green: #4CC38A; --red: #FF6B6B;
  --teal-soft: #14302B; --green-soft: #17301F; --violet-soft: #2A2340; --gold-soft: #3A2F12;
  --red-soft: #2A1212; --lock-bg: #1F1F1F; --lock-fg: #8E8E8E; --disabled: #2A2A2A; --disabled-fg: #8E8E8E;
  --soft-line: #4A2A14; --map-bg: #0B0B0B; --map-road: #1B1B1B; --map-main: #262626; --map-park: #0E1F17; --map-water: #0D1C26;
  --shadow: 0 18px 40px rgba(0,0,0,.6);
  --outer: #0d0d0d;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #FFF8F2; --surface: #FFFFFF; --soft: #FFEBDD; --ink: #2B1A10; --muted: #7A5A47;
  --line: #F1DCCB; --primary: #FF6B1A; --on-primary: #FFFFFF; --accent: #C2410C; --track: #F6D9C4;
  --gold: #E0A800; --teal: #0E7A6C; --violet: #6D4AFF; --green: #1A7F4E; --red: #D93636;
  --teal-soft: #DDF3EF; --green-soft: #E3F4EA; --violet-soft: #ECE7FF; --gold-soft: #FFF3C9;
  --red-soft: #FDE6E6; --lock-bg: #F3ECE6; --lock-fg: #8A7566; --disabled: #EADBCF; --disabled-fg: #9C8577;
  --soft-line: #F6C9A8; --map-bg: #F4EEE6; --map-road: #FFFFFF; --map-main: #E9DCCD; --map-park: #D7EDDC; --map-water: #CFE5F2;
  --shadow: 0 14px 30px rgba(120,60,20,.18);
  --outer: #efe6dc;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--outer); color: var(--ink);
  font: 15px/1.45 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.app {
  position: relative; width: 100%; max-width: 430px; height: 100dvh; margin: 0 auto;
  background: var(--bg); overflow: hidden;
}
/* Desktop: full-height centred column, no phone frame */
@media (min-width: 600px) {
  body { background: var(--bg); }
  .app { max-width: 480px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  gap: 16px; animation: screen-in .25s ease-out;
}
.screen > * { flex-shrink: 0; }
.screen.has-nav { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.screen.flush { padding: 0; gap: 0; }
.screen.no-enter { animation: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.screen::-webkit-scrollbar { width: 0; }
.spacer { margin-top: auto; }

/* ---------- common ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.violet { color: var(--violet); }
.green { color: var(--green); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.semi { font-weight: 600; }
.center { text-align: center; }
.h1 { font-size: 28px; font-weight: 700; line-height: 1.25; }
.h2 { font-size: 18px; font-weight: 700; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; font-size: 14px; }
.link-u { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.card-soft { background: var(--soft); border-radius: 20px; padding: 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.soft { background: var(--soft); color: var(--accent); }
.pill.primary { background: var(--primary); color: var(--on-primary); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.teal { background: var(--teal-soft); color: var(--teal); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.dark { background: var(--surface); color: var(--accent); }
.tag { align-self: flex-start; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }

.btn {
  height: 56px; border: 0; border-radius: 16px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; text-decoration: none; width: 100%;
  transition: transform .12s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 22px rgba(255,122,46,.3); }
.btn-primary:disabled, .btn-primary.disabled { background: var(--disabled); color: var(--disabled-fg); box-shadow: none; pointer-events: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn-text { background: none; color: var(--ink); font-weight: 600; height: 44px; font-size: 15px; }
.btn-lg { height: 60px; font-size: 18px; border-radius: 18px; }
.btn-sm { height: 36px; width: auto; font-size: 14px; border-radius: 12px; padding: 0 14px; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }
.btns > .grow { flex: 1.4; }

.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  position: relative; text-decoration: none;
}
.icon-btn.round { border-radius: 50%; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .6s ease; }

.input-wrap {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.input-wrap input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.topbar h1 { font-size: 20px; font-weight: 700; flex: 1; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.nfc-ok { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--green); }
.nfc-ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.steps { display: flex; gap: 6px; justify-content: center; flex: 1; }
.steps span { width: 14px; height: 6px; border-radius: 999px; background: var(--track); }
.steps span.on { width: 26px; background: var(--primary); }
.steps span.done { background: var(--primary); }
.skip { min-width: 40px; text-align: right; color: var(--ink); font-weight: 600; text-decoration: none; font-size: 15px; background: none; border: 0; }

.section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-h h2 { font-size: 18px; font-weight: 700; }

.hscroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.hscroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.chip .cdot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- bottom nav ---------- */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(84px + env(safe-area-inset-bottom)); padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); align-items: end;
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.nav a.on { color: var(--accent); font-weight: 700; }
.nav a.scan { color: var(--ink); font-weight: 700; }
.nav .scan-btn {
  width: 66px; height: 66px; margin-top: -34px; border-radius: 50%; border: 5px solid var(--bg);
  background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(255,122,46,.45);
}

/* ---------- toast & sheet ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(380px, calc(100% - 32px)); padding: 12px 16px; border-radius: 14px; z-index: 100;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end;
  animation: fade-in .2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  width: 100%; max-height: 92%; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px;
  animation: sheet-up .3s cubic-bezier(.2,1.2,.4,1); will-change: transform;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: var(--track); align-self: center; }
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---------- stamp card (big) ---------- */
.stampcard-wrap { position: relative; flex: none; }
.stampcard-wrap > .peek { position: absolute; right: 6px; top: -22px; height: 70px; z-index: 2; transform: rotate(8deg); }
.stampcard {
  position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); color: #fff;
  min-height: 470px; display: flex; flex-direction: column; padding: 20px 18px 16px;
}
.stampcard .bgfill { position: absolute; inset: 0; }
.bg-photo { background-color: #2E3A33; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 14px, rgba(255,255,255,0) 14px 28px); }
.bg-dots { background-image: radial-gradient(rgba(255,255,255,.13) 2px, rgba(255,255,255,0) 2.6px); background-size: 18px 18px; }
.stampcard .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; background: linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 35%, rgba(0,0,0,.82) 100%); }
.stampcard > *:not(.bgfill):not(.shade):not(.photo-tag) { position: relative; }
.stampcard .en { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.photo-tag { position: absolute; top: 18px; right: 18px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.45); color: #D9D9D9; font-size: 11px; font-weight: 600; }
.letter {
  align-self: center; text-align: center; font-family: 'Kanit', sans-serif; font-style: italic; font-weight: 800;
  line-height: .95; transform: rotate(-5deg); text-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.letter .l2 { margin-left: 60px; display: inline-block; }
.stampcard .letter { margin-top: 56px; font-size: 50px; }
.stamps { margin-top: auto; display: grid; gap: 8px; padding-top: 24px; }
.stamp {
  height: 62px; border-radius: 999px; background: #F6EEDF; display: flex; align-items: center; justify-content: center;
  position: relative; color: #6B2E1F; transition: transform .35s cubic-bezier(.2,1.6,.4,1), box-shadow .3s;
}
.stamp.empty { opacity: .9; }
.stamp.new { box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--primary); transform: rotate(-8deg) scale(1.06); animation: stamp-pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes stamp-pop { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-8deg) scale(1.06); } }
.stamp .today { position: absolute; top: -8px; right: -4px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 10px; font-weight: 700; line-height: 1.6; }
.stampcard .foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; }
.stampcard .foot b { font-size: 16px; }
.stampcard .foot .muted2 { color: #D9D9D9; font-weight: 500; }

/* ---------- mini cards ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.minicard {
  position: relative; aspect-ratio: 5 / 7; padding: 10px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px;
  color: #fff; text-align: left; border: 2px solid transparent; overflow: hidden;
}
.minicard.on { border-color: var(--primary); }
.minicard .letter { align-self: flex-start; font-size: 17px; text-align: left; transform: rotate(-4deg); }
.minicard .minibar { margin-top: auto; display: flex; gap: 3px; }
.minicard .minibar i { flex: 1; height: 5px; border-radius: 999px; background: rgba(255,255,255,.25); }
.minicard .minibar i.f { background: #F6EEDF; }
.minicard .n { font-size: 12px; font-weight: 700; }

/* carousel */
.carousel { margin: 0 -20px; overflow: hidden; padding: 30px 0 10px; touch-action: pan-y; }
.track { display: flex; gap: 14px; transition: transform .35s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.track.dragging { transition: none; }
.bigcard {
  position: relative; flex: none; width: 290px; height: 430px; padding: 0; border: 0; border-radius: 26px; color: #fff;
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; text-align: left;
  will-change: transform, opacity; contain: layout paint;
}
.bigcard.off { transform: scale(.92); opacity: .55; }
.bigcard .inner { position: relative; height: 100%; display: flex; flex-direction: column; padding: 18px 16px 16px; }
.bigcard .letter { margin-top: 40px; font-size: 44px; }
.bigcard .peek { position: absolute; right: -10px; top: -36px; height: 90px; z-index: 3; transform: rotate(8deg); }
.bigcard .full-tag { padding: 2px 8px; border-radius: 999px; background: #fff; color: #000; font-size: 11px; font-weight: 700; }
.bigcard .stamp { height: 58px; }
.bigcard .stamp.sm { height: 54px; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots i { height: 6px; width: 6px; border-radius: 999px; background: var(--track); transition: width .3s; }
.dots i.on { width: 20px; background: var(--primary); }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { background: var(--ink); color: var(--bg); }
.tabs .count { color: var(--accent); }

/* ---------- home ---------- */
.avatar {
  width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; border: 2px solid var(--primary); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.level-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px; background: var(--primary); color: var(--on-primary);
  display: flex; flex-direction: column; gap: 12px; text-decoration: none;
}
.level-card .ring { position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; border: 18px solid rgba(255,255,255,.18); }
.level-card .lv { width: 44px; height: 44px; border-radius: 14px; background: var(--on-primary); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: none; }
.level-card .streak { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.35); font-size: 13px; font-weight: 700; }
.level-card .bar { height: 10px; background: rgba(43,18,5,.18); position: relative; }
.level-card .bar > i { background: var(--on-primary); }
.level-card > * { position: relative; }
.pointie-says { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 20px; background: var(--soft); }
.pointie-says img { height: 78px; flex: none; }
.mission { display: flex; align-items: center; gap: 12px; }
.mission .ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.mission.done .ic { background: var(--green-soft) !important; color: var(--green) !important; }
.shopcard {
  flex: none; width: 210px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  color: var(--ink); text-decoration: none; display: flex; flex-direction: column;
}
.shopcard .ph { position: relative; height: 112px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); font-size: 12px; }
.ph-badge { position: absolute; top: 10px; left: 10px; }
.event { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--ink); text-decoration: none; }
.event .date { width: 56px; height: 60px; flex: none; border-radius: 14px; background: var(--soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.event .date b { font-size: 20px; }
.event .date span { font-size: 12px; font-weight: 600; }
.empty-note { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- store ---------- */
.cover { position: relative; height: 240px; flex: none; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-size: 13px; }
.cover .tb { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; gap: 8px; }
.cover .tb .icon-btn { background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(6px); }
.cover .tb .icon-btn.fav { color: var(--primary); }
.store-body { padding: 0 20px calc(110px + env(safe-area-inset-bottom)); margin-top: -64px; display: flex; flex-direction: column; gap: 20px; position: relative; }
.store-head { padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.initials { width: 52px; height: 52px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; background: var(--soft); color: var(--accent); }
.initials.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.visits-card { border-radius: 22px; padding: 18px; background: var(--primary); color: var(--on-primary); display: flex; flex-direction: column; gap: 10px; }
.visits-card .big { font-size: 34px; font-weight: 700; line-height: 1; }
.segbar { display: flex; gap: 4px; }
.segbar i { flex: 1; height: 10px; border-radius: 999px; background: rgba(43,18,5,.18); }
.segbar i.f { background: var(--on-primary); }
.mapmini { position: relative; height: 130px; border-radius: 16px; overflow: hidden; background: var(--map-bg); }
.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.rating-big { font-size: 40px; font-weight: 700; line-height: 1; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dist-row .bar { flex: 1; height: 6px; }
.dist-row .bar i { background: var(--gold); }
.ai-sum { border-radius: 18px; padding: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 8px; }
.ai-sum img { height: 34px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos div { aspect-ratio: 1; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.review { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars .off { color: var(--track); }
.real { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.sticky-cta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 10px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%);
}
.sticky-cta > * { flex: 1; }
.sticky-cta > .grow { flex: 1.4; }
.star-input { display: flex; gap: 8px; justify-content: center; }
.star-input button { border: 0; background: none; padding: 4px; color: var(--track); }
.star-input button.on { color: var(--gold); }
textarea.ta {
  width: 100%; min-height: 110px; resize: vertical; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; outline: none;
}
textarea.ta:focus, .input-wrap:focus-within { border-color: var(--primary); }

/* ---------- profile ---------- */
.member {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px; background: var(--primary); color: var(--on-primary);
  display: flex; flex-direction: column; gap: 12px;
}
.member.frame-gold { background: linear-gradient(135deg, #FF7A2E 0%, #FFC83D 100%); }
.member .ring { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 22px solid rgba(255,255,255,.16); }
.member > * { position: relative; }
.member .avatar { width: 64px; height: 64px; font-size: 26px; background: var(--on-primary); color: var(--primary); border-color: var(--on-primary); }
.member .lvpill { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--on-primary); color: var(--primary); font-size: 12px; font-weight: 700; }
.member .bar { background: rgba(43,18,5,.18); height: 8px; }
.member .bar i { background: var(--on-primary); }
.pins { display: flex; gap: 6px; }
.pins span { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--on-primary); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { padding: 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 22px; }
.stats span { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 0; background: none; padding: 0; }
.badge .bi { width: 64px; height: 64px; border-radius: 22px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.badge.locked .bi { border: 2px dashed var(--line); box-shadow: none; background: var(--lock-bg); color: var(--lock-fg); }
.badge span { font-size: 12px; line-height: 1.3; font-weight: 600; }
.badge.locked span { font-weight: 500; color: var(--muted); }
.fav-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.fav-row:last-child { border-bottom: 0; }
.statrow { display: grid; grid-template-columns: 64px 1fr 30px; align-items: center; gap: 10px; font-size: 14px; }
.statrow .bar { height: 10px; }
.menu-list { display: flex; flex-direction: column; }
.menu-list > * { display: flex; align-items: center; gap: 12px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; text-align: left; font-size: 15px; font-weight: 500; width: 100%; }
.menu-list > *:last-child { border-bottom: 0; }
.menu-list .chev { margin-left: auto; color: var(--muted); }
.qr { width: 220px; height: 220px; align-self: center; background: #fff; border-radius: 18px; padding: 14px; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--track); position: relative; flex: none; margin-left: auto; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }

/* ---------- map ---------- */
.map { position: absolute; inset: 0; background: var(--map-bg); overflow: hidden; }
.map .m { position: absolute; }
.map .lbl { position: absolute; font-size: 11px; font-weight: 600; }
.pin { position: absolute; padding: 0; border: 0; background: transparent; }
.pin .dotp { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #1B0C03; border: 3px solid var(--bg); transition: transform .2s; }
.pin.sel .dotp { border: 4px solid var(--ink); box-shadow: 0 0 0 8px rgba(255,255,255,.12); }
.pin .pro { position: absolute; top: -10px; right: -14px; padding: 1px 6px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700; line-height: 1.5; }
.pin .nm { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; }
.me { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(76,155,255,.2); display: flex; align-items: center; justify-content: center; }
.me::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #4C9BFF; border: 3px solid #F7F7F7; }
.map-top { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; right: 16px; z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.map-top .hscroll { margin: 0 -16px; padding: 0 16px 2px; }
.map-top .input-wrap { flex: 1; background: var(--surface); }
.map-search-area { align-self: center; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.map-sheet { position: absolute; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 6; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.map-locate { position: absolute; right: 16px; z-index: 6; }

/* ---------- onboarding ---------- */
.splash { align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.splash .glow { position: absolute; left: 50%; top: 32%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,46,.25) 0%, rgba(0,0,0,0) 65%); pointer-events: none; }
.splash .mascot { width: 220px; animation: bob 3s ease-in-out infinite; position: relative; will-change: transform; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.splash .title { font-size: 44px; font-weight: 700; letter-spacing: -.02em; }
.confetti-dot { position: absolute; border-radius: 50%; }
.phone-field { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); }
.phone-field.on { border-color: var(--primary); }
.phone-field .cc { padding-right: 12px; border-right: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.phone-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp .box { height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; background: var(--surface); border: 2px solid var(--line); }
.otp .box.fill { background: var(--soft); border-color: var(--primary); }
.otp .box.cur { border-color: var(--ink); }
.otp .box.err { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.otp.expired .box { opacity: .5; }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; caret-color: transparent; }
.alert { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--red); font-size: 14px; font-weight: 600; }
.alert-box { padding: 14px; border-radius: 16px; background: var(--red-soft); border: 1px solid rgba(255,107,107,.3); text-align: center; display: flex; flex-direction: column; gap: 4px; }
.avatar-big { width: 132px; height: 132px; border-radius: 50%; align-self: center; position: relative; background: var(--soft); border: 3px solid var(--primary); }
.avatar-big img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.avatar-big .cam { position: absolute; right: 2px; bottom: 2px; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); border: 3px solid var(--bg); display: flex; align-items: center; justify-content: center; }
.avatar-pick { display: flex; justify-content: center; gap: 10px; }
.avatar-pick button { width: 56px; height: 56px; padding: 0; border-radius: 50%; overflow: hidden; background: var(--surface); border: 2px solid var(--line); }
.avatar-pick button.on { background: var(--soft); border-color: var(--primary); }
.avatar-pick img { width: 100%; height: 100%; object-fit: contain; }
.pref-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.pref-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.pref {
  min-height: 96px; padding: 12px 10px; border-radius: 18px; text-align: left; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink);
}
.pref.on { background: var(--soft); border-color: var(--primary); }
.pref.dim { opacity: .5; }
.pref .chk { width: 22px; height: 22px; margin-bottom: 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #444; color: var(--on-primary); flex: none; }
.pref.on .chk { background: var(--primary); border-color: var(--primary); }
.pref b { font-size: 15px; }
.pref small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.area-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.area-chips button { height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 600; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.area-chips button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.loc-hero { position: relative; width: 250px; height: 250px; align-self: center; display: flex; align-items: center; justify-content: center; }
.loc-hero::before, .loc-hero::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); }
.loc-hero::after { inset: 30px; background: radial-gradient(circle, rgba(255,122,46,.15), transparent 70%); }
.loc-hero img { width: 170px; position: relative; z-index: 1; }
.feat-li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.feat-li .ic { width: 32px; height: 32px; border-radius: 10px; flex: none; background: var(--soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.invite-stats div { padding: 12px 8px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.invite-stats b { color: var(--ink); font-size: 15px; }
.invite-stats .v { background: var(--violet-soft); border-color: transparent; }
.invite-stats .v b { color: var(--violet); }

/* ---------- celebration ---------- */
.celebrate { align-items: center; text-align: center; overflow: hidden; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.fx span { position: absolute; display: flex; will-change: transform, opacity; }
.lv-num { position: relative; width: 64px; height: 64px; border-radius: 18px; background: var(--primary); color: var(--on-primary); overflow: hidden; }
.unlock { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.unlock div { padding: 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- scan ---------- */
.nfc-stage { position: relative; height: 300px; display: flex; align-items: center; justify-content: center; }
.nfc-stand { width: 150px; height: 110px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); position: absolute; bottom: 30px; right: 40px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 12px; font-size: 12px; color: var(--muted); }
.nfc-phone { will-change: transform; position: absolute; top: 10px; left: 50%; width: 110px; height: 190px; margin-left: -20px; border-radius: 22px; border: 3px solid var(--ink); background: var(--bg); transform: rotate(-14deg); animation: tap 2.2s ease-in-out infinite; }
@keyframes tap { 0%,100% { transform: translate(0,0) rotate(-14deg); } 50% { transform: translate(-8px,34px) rotate(-14deg); } }
.nfc-wave { will-change: transform, opacity; position: absolute; bottom: 80px; right: 75px; width: 90px; height: 30px; border: 2px dashed var(--primary); border-radius: 50%; animation: wave 2.2s ease-in-out infinite; }
@keyframes wave { 0%,100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.nfc-stage .mascot { position: absolute; left: 4px; bottom: 30px; height: 120px; }
.howto { display: flex; flex-direction: column; gap: 12px; }
.howto div { display: flex; gap: 12px; font-size: 14px; }
.howto b.n { color: var(--accent); width: 14px; flex: none; }
.shop-pick { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-align: left; width: 100%; }
.offline-banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 600; }
.halo { width: 190px; height: 190px; border-radius: 50%; border: 2px dashed var(--line); align-self: center; display: flex; align-items: center; justify-content: center; }
.halo img { height: 150px; }
.timer-pill { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.timer-pill b { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* full-card artwork uploaded by the shop */
.bg-art { background-color: #1a1a1a; background-size: cover; background-position: center top; background-repeat: no-repeat; }
.art-space { flex: 1; min-height: 40px; }
.minicard.bg-art .n, .bigcard .bg-art ~ .inner > .between, .stampcard .foot { text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* start-up loader (shown until the first screen renders) */
.boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.boot img { width: 110px; animation: bob 1.6s ease-in-out infinite; }

/* centre scan button with the Pointie coin face */
.nav .scan-btn { position: relative; overflow: hidden; }
.nav .scan-btn .scan-face { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.nav .scan-btn.frame .scan-face { width: 32px; height: 32px; }
.nav .scan-btn .scan-frame { position: absolute; inset: 9px; width: auto; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.nav a.scan:active .scan-btn { transform: scale(.94); }

/* member tiers */
.tier-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.25); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.tier { padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--tc); display: flex; flex-direction: column; gap: 6px; }
.tier.cur { border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc) inset; }
.tier.locked { opacity: .6; }
.tier ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tier li { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.35; }
.tier li svg { flex: none; margin-top: 2px; color: var(--tc); }
.tier-promo { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--tc); background: var(--surface); }
.tier-promo .tp-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #000; background: var(--tc); flex: none; }
