/* Candy K-Bar member app — "Candy Swirl" theme (colours sampled from the candykbar.com logo).
   Sticker style: black outlines + hard offset shadows, black text on every pastel. */
:root {
  --sky: #bce6fa;     /* hero / header */
  --aqua: #49c5db;    /* primary buttons */
  --pink: #fac0b8;
  --peach: #fde0d3;
  --bg: #fff6f0;
  --paper: #fffdf9;
  --ink: #0b0d0e;
  --muted: #4f5558;
  --line: #f0e3dc;
  --b: 2.5px solid var(--ink);
  --stripe: repeating-linear-gradient(-50deg, var(--aqua) 0 9px, var(--paper) 9px 12px, var(--pink) 12px 21px,
    var(--paper) 21px 24px, var(--peach) 24px 33px, var(--paper) 33px 36px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Nunito Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, .disp { font-family: Righteous, "Nunito Sans", sans-serif; font-weight: 400; }
a { color: var(--ink); }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid var(--aqua); outline-offset: 2px;
}
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- App bar (the i18n toggle is injected into <header>) ---- */
.appbar { background: var(--sky); padding: 10px 16px; min-height: 56px; display: flex; align-items: center; }
.appbar img { height: 36px; width: auto; display: block; }
.langToggle a { color: var(--ink) !important; border-bottom-color: var(--ink) !important; font-size: 13px; }
.langToggle span { color: rgba(11, 13, 14, .45) !important; }

/* ---- Hero bands ---- */
.hero { background: var(--sky); padding: 4px 20px 40px; border-bottom: 3px solid var(--ink); position: relative; overflow: hidden; }
.hero.tight { padding-bottom: 22px; }
.inner { max-width: 420px; margin: 0 auto; position: relative; }
.pop { position: absolute; right: -54px; top: -30px; width: 130px; height: 130px; pointer-events: none; }
.hero h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.12; position: relative; }
.greet { max-width: 260px; font-size: 30px !important; }
.kicker { font-size: 12px; font-weight: 900; letter-spacing: .14em; line-height: 1.35; }
.big { font-family: Righteous, sans-serif; font-size: 46px; line-height: 1; }
.balLink { position: relative; margin-top: 14px; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.pill { display: inline-block; font-size: 13px; font-weight: 800; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 3px 10px; }
.pillRow { margin-top: 8px; position: relative; }
.row2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* Candy-stick progress bar */
.track { position: relative; height: 20px; margin-top: 18px; border: var(--b); border-radius: 999px; background: var(--paper); overflow: hidden; }
.track > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--stripe); border-right: 2.5px solid var(--ink); }
.ticks { position: relative; height: 18px; margin-top: 5px; font-size: 11px; font-weight: 900; }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.progText { position: relative; font-size: 13px; font-weight: 700; margin-top: 2px; }

/* ---- Cards, tiles, buttons ---- */
.card { background: var(--paper); border: var(--b); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); padding: 18px; margin: 16px; }
.lift { margin-top: -26px; position: relative; }
.wrap { max-width: 460px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: -24px 16px 0; position: relative; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px; border: var(--b); border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 900; position: relative; text-align: center; }
.badge { position: absolute; top: -9px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.btn { display: block; width: 100%; margin-top: 14px; padding: 14px 18px; font: inherit; font-family: Righteous, sans-serif; font-size: 18px;
  color: var(--ink); background: var(--aqua); border: var(--b); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; text-align: center; text-decoration: none; }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.dark { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--aqua); }
.btn.ghost { background: var(--paper); }
.btn.sm { width: auto; display: inline-block; flex: none; margin: 0; padding: 8px 16px; font-family: inherit; font-weight: 900; font-size: 14px; box-shadow: none; }
.btn.sm.on { background: var(--ink); color: var(--paper); }
.link { background: none; border: 0; padding: 10px 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; cursor: pointer; display: inline-block; }
.sec { font-size: 18px; margin: 22px 20px 10px; }
.promo { margin: 20px 16px 0; display: flex; border: var(--b); border-radius: 18px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper); text-decoration: none; color: var(--ink); }
.promo .stripe { width: 22px; flex: none; background: var(--stripe); border-right: 2.5px solid var(--ink); }
.promo div:last-child { padding: 14px 16px; }
.promo .disp { font-size: 18px; line-height: 1.2; }
.promo b { display: inline-block; margin-top: 8px; font-size: 14px; text-decoration: underline; }
.notice { margin: 20px 16px 0; background: var(--peach); }
.notice h2 { margin: 10px 0 6px; font-size: 18px; line-height: 1.25; }
.notice p { margin: 0; font-size: 14px; line-height: 1.5; }
.notice summary { margin-top: 10px; font-weight: 900; text-decoration: underline; cursor: pointer; }
.noticeScroll { overflow-x: auto; margin: 10px 0; }
.noticeTable { width: 100%; border-collapse: collapse; background: var(--paper); border: var(--b); border-radius: 12px; font-size: 13px; }
.noticeTable th, .noticeTable td { padding: 7px 8px; text-align: left; vertical-align: top; border-bottom: 1.5px solid var(--peach); }
.noticeTable tr:last-child > * { border-bottom: 0; }
.noticeTable tbody th { min-width: 4.8em; }
.noticeTable td { white-space: nowrap; }
.noticeTable td span { font-size: 12px; }
.notice .muted { font-size: 12px; }

/* ---- Forms & messages ---- */
label { display: block; font-size: 13px; font-weight: 800; margin: 12px 0 5px; }
input:not([type=checkbox]) { width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: var(--b); border-radius: 12px; }
.msg { padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink); font-size: 14px; margin-top: 10px; }
.msg.err { background: #ffe1dc; }
.msg.ok { background: #d6f5e3; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; }

/* ---- Auth ---- */
.authH { font-size: 34px !important; }
.authSub { position: relative; margin: 6px 0 12px; font-weight: 700; max-width: 300px; }

/* ---- Bottom tabs + floating action ---- */
.app { padding-bottom: 170px; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: 3px solid var(--ink);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted);
  font-size: 12px; font-weight: 700; position: relative; min-height: 48px; justify-content: center; }
nav.tabs .ic { padding: 2px 14px; border: 2px solid transparent; border-radius: 999px; display: flex; position: relative; }
nav.tabs a[aria-current=page] { color: var(--ink); font-weight: 900; }
nav.tabs a[aria-current=page] .ic { background: var(--sky); border-color: var(--ink); }
nav.tabs .badge { top: -6px; right: 2px; min-width: 20px; height: 20px; font-size: 11px; }
.fab { position: fixed; right: max(16px, calc(50% - 214px)); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 19;
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--paper); text-decoration: none;
  font-family: Righteous, sans-serif; font-size: 17px; padding: 14px 22px; border-radius: 999px; box-shadow: 3px 3px 0 var(--aqua); }

/* ---- Redeem amount picker ---- */
.amtRow { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.amt { font-family: Righteous, sans-serif; font-size: 58px; min-width: 130px; text-align: center; }
.round { width: 52px; height: 52px; border-radius: 50%; border: var(--b); font: inherit; font-size: 26px; font-weight: 900; cursor: pointer; color: var(--ink); }
.round:disabled { opacity: .35; cursor: not-allowed; }
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.chip { height: 46px; border-radius: 999px; border: var(--b); background: var(--paper); font: inherit; font-weight: 900; cursor: pointer; color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.note { margin: 20px 20px 0; display: flex; gap: 12px; align-items: flex-start; font-size: 13px; }
.note i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 900; }

/* ---- Rewards: tickets + journey ---- */
.ticket { display: flex; background: var(--paper); border: var(--b); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); overflow: hidden; margin: 0 16px 12px; }
.ticket .stub { width: 70px; flex: none; display: flex; align-items: center; justify-content: center; border-right: 2.5px dashed var(--ink);
  font-family: Righteous, sans-serif; font-size: 21px; }
.ticket .body { flex: 1; min-width: 0; padding: 13px 14px; }
.tRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tTitle { font-weight: 900; font-size: 16px; }
.tl { list-style: none; margin: 0 20px; padding: 0; }
.tl li { display: flex; gap: 14px; min-height: 56px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .dot { width: 26px; height: 26px; border-radius: 50%; border: var(--b); background: var(--paper); display: flex; align-items: center; justify-content: center; flex: none; }
.tl .dot.done { background: var(--aqua); }
.tl .dot.next { background: var(--pink); }
.tl .dot.locked { border-style: dashed; border-color: #6f7578; }
.tl .line { flex: 1; width: 3px; background: #d8cfca; }
.tl .line.done { background: var(--ink); }
.tl li:last-child .line { display: none; }

/* ---- Songs ---- */
.searchBox { margin-top: 14px; display: flex; align-items: center; gap: 10px; background: var(--paper); border: var(--b); border-radius: 14px; padding: 0 14px; position: relative; }
.searchBox input { border: 0 !important; padding: 12px 0 !important; background: transparent !important; outline: none; }
.segs { display: flex; gap: 6px; margin-top: 10px; position: relative; }
.seg { flex: 1; padding: 7px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font: inherit; font-weight: 900; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg.segOn { background: var(--ink); color: var(--paper); }
.loadCard { margin: 16px 16px 0; background: var(--pink); border: var(--b); border-radius: 18px; box-shadow: 3px 3px 0 var(--ink);
  padding: 14px; display: flex; align-items: center; gap: 12px; }
.loadCard .circ { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--paper); border: var(--b); display: flex; align-items: center; justify-content: center; }
.codeBox { margin: 12px 16px 0; text-align: center; background: var(--peach); border: 2px dashed var(--ink); border-radius: 14px; padding: 14px; }
.codeBox .code { font-family: Righteous, sans-serif; font-size: 40px; letter-spacing: 8px; }
.codeBox ol { text-align: left; font-size: 13px; margin: 10px 0 0; padding-left: 20px; }
.list { margin: 0 16px; background: var(--paper); border: var(--b); border-radius: 16px; overflow: hidden; }
.list:empty { display: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-bottom: 1.5px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .info { flex: 1; min-width: 0; }
.row .t { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .a { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.xbtn { flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.results { margin: 12px 16px 0; }
.results .row { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; margin-bottom: 8px; }
.empty { padding: 14px 16px; }

/* ---- Me: settings groups ---- */
.profile { display: flex; align-items: center; gap: 14px; position: relative; padding-top: 10px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--pink); border: 3px solid var(--ink); flex: none;
  display: flex; align-items: center; justify-content: center; font-family: Righteous, sans-serif; font-size: 26px; }
.group { margin: 0 16px; background: var(--paper); border: var(--b); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1.5px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer; }
.group > :last-child, .group > details:last-child > summary { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .chev { transform: rotate(90deg); }
details[open] > summary { border-bottom: 1.5px solid var(--line); }
.pad { padding: 4px 16px 16px; border-bottom: 1.5px solid var(--line); }
.group > details:last-child .pad { border-bottom: 0; }
.sw { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--paper); border: var(--b);
  position: relative; cursor: pointer; margin: 0; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.sw:checked { background: var(--aqua); }
.sw:checked::after { left: 22px; }

/* ---- History table ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 8px 4px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
td:last-child, th:last-child { text-align: right; white-space: nowrap; }
td:first-child { white-space: nowrap; }

/* ---- T&C consent ---- */
.tncBox { max-height: 260px; overflow-y: auto; border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 13px;
  line-height: 1.55; background: var(--paper); margin-top: 10px; -webkit-overflow-scrolling: touch; }
.tncBox li { margin: 7px 0; }
.tncHint { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin-top: 6px; }
.tncRow { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.tncRow input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }

/* ---- QR overlay (redeem + voucher claim) ---- */
.qm { position: fixed; inset: 0; z-index: 50; background: var(--sky); overflow-y: auto; padding: 14px 16px 30px; }
.qm .inner { text-align: center; }
.qm .pop { top: auto; bottom: -40px; left: -60px; right: auto; width: 150px; height: 150px; }
.qmTop { display: flex; align-items: center; justify-content: space-between; position: relative; }
.iconBtn { width: 44px; height: 44px; border: var(--b); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.qmTitle { font-family: Righteous, sans-serif; font-size: 46px; line-height: 1.1; position: relative; }
.qmTitle.long { font-size: 28px; margin-top: 4px; }
.qmRule { position: relative; font-size: 13px; margin: 6px auto 0; max-width: 320px; }
.qmCard { position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 5px 5px 0 var(--ink);
  padding: 20px 12px 16px; margin: 12px auto 0; max-width: 300px; }
.qmCard img { display: block; margin: 0 auto; }
.qmCode { font-family: ui-monospace, monospace; font-size: 24px; font-weight: 700; letter-spacing: 6px; margin-top: 12px; }
.qmState { font-size: 15px; line-height: 1.5; }
.steps { list-style: none; margin: 24px auto 0; padding: 0; display: flex; justify-content: space-between; max-width: 340px; position: relative; }
.steps li { width: 31%; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.steps b { width: 32px; height: 32px; border-radius: 50%; border: var(--b); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.steps li.on { font-weight: 900; }
.steps li.on b { background: var(--ink); color: var(--paper); }
.qm .btn { max-width: 340px; margin: 26px auto 0; position: relative; }

/* Front desk ask (member-ask.js): a bottom sheet over everything, incl. the QR overlay. */
.askSheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(11, 13, 14, .45); }
.askSheet[hidden] { display: none; }
.askSheet .card { width: 100%; max-width: 480px; margin: 0 0 16px; margin-inline: 16px; }

.askSheet .qmTitle { font-size: 26px; line-height: 1.15; margin: 4px 0 6px; }
