/* ── BonoClick design tokens ──────────────────────────────────
   pine  #0F5C4A  primary / filled punches
   moss  #7FA893  outlines, empty punches
   mist  #EDF2EE  page background
   ink   #182420  text
   clay  #B85C38  destructive / used-up
   gold  #C9A227  stamp rewards
*/
* { box-sizing: border-box; margin: 0; }
:root {
  --pine: #0F5C4A; --moss: #7FA893; --mist: #EDF2EE;
  --ink: #182420; --clay: #B85C38; --gold: #C9A227; --line: #D8E2DB;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--mist); color: var(--ink); min-height: 100dvh;
}
.wrap { max-width: 460px; margin: 0 auto; padding: 16px 16px 90px; }
h1, h2 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.1rem; }
.muted { color: #5C6B63; font-size: .9rem; }

.card {
  background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(24,36,32,.06), 0 6px 20px rgba(24,36,32,.06);
}
.pad { padding: 20px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 18px; }
.brand { font-weight: 800; color: var(--pine); font-size: 1.15rem; letter-spacing: -0.02em; }
.brand span { color: var(--gold); }
.topbar a { color: var(--pine); text-decoration: none; font-size: .9rem; font-weight: 600; }

.member { text-align: center; padding: 26px 20px 22px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--pine); color: #fff; font-weight: 700; font-size: 1.4rem;
  display: inline-flex; align-items: center; justify-content: center; object-fit: cover;
}
.member .name { font-size: 1.15rem; font-weight: 700; margin-top: 10px; }
.qrbox { background:#fff; display:inline-block; padding:14px; border:1px solid var(--line); border-radius:14px; margin-top:16px; }
.qrbox img, .qrbox canvas { display: block; }
.member .hint { margin-top: 12px; }

/* Shop banner */
.shop { display:flex; gap:12px; align-items:center; padding:16px 20px; }
.shop .dot { width:42px; height:42px; border-radius:12px; background:var(--pine); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; flex:none; }
.shop .info { min-width:0; }
.shop .info strong { display:block; }

/* Cards of all three types */
.bcard { padding: 16px 20px; border-top: 1px solid var(--line); }
.bcard:first-of-type { border-top: 0; }
.bcard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bcard .svc { font-weight: 700; }
.bcard .shopname { font-size:.78rem; color:#5C6B63; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.bcard .count { font-variant-numeric: tabular-nums; color: var(--pine); font-weight: 700; }
.bcard .count.done { color: var(--clay); }
.bcard .count.reward { color: var(--gold); }
.punches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.punch { width:14px; height:14px; border-radius:50%; border:2px solid var(--moss); background:transparent; }
.punch.used { background: var(--pine); border-color: var(--pine); }
.punch.stamp { border-color:#D8C98E; }
.punch.stamp.used { background: var(--gold); border-color: var(--gold); }
.balance { font-size:1.6rem; font-weight:800; color:var(--pine); margin-top:6px; font-variant-numeric:tabular-nums; }
.expiry { margin-top: 8px; }

.btn {
  display:block; width:100%; text-align:center; text-decoration:none;
  background:var(--pine); color:#fff; border:0; cursor:pointer;
  font:inherit; font-weight:700; padding:14px; border-radius:14px; margin-top:14px;
}
.btn:active { transform: scale(.985); }
.btn.ghost { background:transparent; color:var(--pine); border:2px solid var(--pine); }
.btn.small { width:auto; display:inline-block; padding:9px 16px; margin-top:0; font-size:.9rem; }
.btn.warn { background: var(--clay); }
.btn:disabled { opacity:.5; cursor:default; }
input, select {
  width:100%; font:inherit; padding:13px 14px; margin-top:10px;
  border:1.5px solid var(--line); border-radius:12px; background:#fff; color:var(--ink);
}
input:focus, select:focus { outline:2px solid var(--moss); border-color:var(--moss); }
label { display:block; margin-top:12px; font-size:.85rem; font-weight:600; }

#video { width:100%; border-radius:18px; background:#000; aspect-ratio:3/4; object-fit:cover; }
.scanline { position:relative; }
.scanline::after { content:""; position:absolute; inset:12% 8%; border:3px solid rgba(255,255,255,.85); border-radius:16px; pointer-events:none; }

#toast {
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:12px 18px; border-radius:12px;
  font-size:.9rem; opacity:0; transition:.25s; pointer-events:none; max-width:88vw; z-index:50;
}
#toast.show { opacity:1; transform:translateX(-50%); }
#toast.ok { background: var(--pine); }

.item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:16px 20px; border-top:1px solid var(--line); }
.item:first-of-type { border-top:0; }
.item .price { color:var(--pine); font-weight:700; white-space:nowrap; }
.section-title { margin:22px 4px 10px; }
.badge { display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.03em; background:var(--mist); color:var(--pine); border-radius:99px; padding:3px 10px; }
.badge.pending { background:#FBF0E6; color:var(--clay); }
.badge.gold { background:#F7F0D8; color:#8A6E12; }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }

/* ── Card carousel (swipe between cards) ── */
.carousel { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; gap:12px;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.carousel::-webkit-scrollbar { display:none; }
.carousel .slide { flex:0 0 100%; scroll-snap-align:center; }
.carousel .slide .bcard { border-top:0; }
.dots { display:flex; justify-content:center; gap:6px; margin-top:10px; }
.dots i { width:7px; height:7px; border-radius:50%; background:var(--line); transition:.2s; }
.dots i.on { background:var(--pine); width:18px; border-radius:99px; }

/* ── Slide-up drawer ── */
.drawer {
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  max-width:460px; margin:0 auto;
  background:#fff; border-radius:20px 20px 0 0;
  box-shadow:0 -8px 30px rgba(24,36,32,.16);
  transform:translateY(calc(100% - 52px)); transition:transform .3s ease;
}
.drawer.open { transform:translateY(0); }
.drawer .grip {
  height:52px; display:flex; align-items:center; justify-content:center; gap:8px;
  cursor:pointer; font-weight:700; color:var(--pine); user-select:none;
}
.drawer .grip .chev { transition:transform .3s; }
.drawer.open .grip .chev { transform:rotate(180deg); }
.drawer .body { padding:0 20px 24px; max-height:60vh; overflow-y:auto; }
.reflink {
  display:flex; gap:8px; margin-top:10px;
}
.reflink input { margin-top:0; font-size:.82rem; color:#5C6B63; }
.contact { padding:12px 0; border-top:1px solid var(--line); }
.contact:first-of-type { border-top:0; }
.contact a { color:var(--pine); text-decoration:none; font-weight:600; }
.shop + .bcard { border-top: 1px solid var(--line); }
.bcard.suspended { opacity:.55; }
.bcard.suspended .punches { filter:grayscale(1); }
