/* Customer page. The merchant's color drives --brand / --brand-2 (set from JS);
   everything else comes from the shared tokens in core.css. */
:root {
  --brand: #ff5a1f;
  --brand-2: #e23a3a;
  --on-brand: #ffffff;
  --brand-ink-light: #c2410c;
  --brand-ink-dark: #ff9a6b;
  --brand-text: var(--brand-ink-light);
  --brand-wash: color-mix(in srgb, var(--brand) 9%, var(--surface));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-text: var(--brand-ink-dark); --brand-wash: color-mix(in srgb, var(--brand) 16%, var(--surface)); }
}
:root[data-theme="dark"] { --brand-text: var(--brand-ink-dark); --brand-wash: color-mix(in srgb, var(--brand) 16%, var(--surface)); }

body.cust {
  min-height: 100vh;
  min-height: 100dvh;
}
.c-boot { min-height: 100dvh; display: grid; place-items: center; }

/* Inside a phone mockup the page scrolls like it does on a phone: no scrollbars, nothing sideways. */
html.in-frame, html.in-frame * { scrollbar-width: none; }
html.in-frame::-webkit-scrollbar, html.in-frame *::-webkit-scrollbar { display: none; }
html.in-frame body { overflow-x: clip; }

.c-shell { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.c-main {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  margin-top: -44px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 22px max(16px, env(safe-area-inset-left, 0px));
  position: relative;
  z-index: 2;
}

/* ---- header (three styles the merchant can pick), printed flat in the merchant's color with an ink edge ---- */
.c-head {
  position: relative;
  color: var(--on-brand);
  background: var(--brand) var(--grain);
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 62px max(16px, env(safe-area-inset-left, 0px));
  border-radius: 0 0 30px 30px;
  box-shadow: 0 3px 0 var(--outline);
}
/* a shop awning: flat stripes and a scalloped edge, each scallop outlined */
.c-head.awning {
  border-radius: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 26px, transparent 26px 52px), var(--brand) var(--grain);
  margin-bottom: 16px;
}
.c-head.awning::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -15px;
  height: 16px;
  background: radial-gradient(circle at 13px 0, var(--brand) 11px, var(--outline) 11.5px 13.5px, transparent 14px) 0 0 / 26px 16px repeat-x;
}
/* a wavy edge: the ink wave sits 3px under the colored one so each crest gets an outline */
.c-head.wave { border-radius: 0; margin-bottom: 20px; box-shadow: none; }
.c-head.wave::before, .c-head.wave::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -19px;
  height: 20px;
  background: var(--brand) var(--grain);
  -webkit-mask: radial-gradient(22px 20px at 50% 0, #000 98%, transparent) 0 0 / 44px 20px repeat-x;
  mask: radial-gradient(22px 20px at 50% 0, #000 98%, transparent) 0 0 / 44px 20px repeat-x;
}
.c-head.wave::before { bottom: -22px; background: var(--outline); }
.c-head-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.c-logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  border: 2px solid var(--outline);
  box-shadow: 2px 3px 0 var(--ink-shadow);
  transform: rotate(-3deg);
  overflow: hidden;
}
.c-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.c-place { min-width: 0; flex: 1; }
.c-place b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.c-place small { display: block; font-size: 0.82rem; opacity: 0.92; line-height: 1.4; }
.c-head .c-lang {
  flex: none;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 10px;
  border: 2px solid var(--outline);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink-shadow);
}
.c-head .c-lang:active { transform: translate(2px, 2px); box-shadow: none; }
.c-offline { margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; font-size: 0.8rem; font-weight: 700; background: var(--ink); color: var(--surface); padding: 3px 10px; border-radius: 8px; }

/* ---- generic blocks: paper cards with an ink outline and a hard shadow ---- */
.c-card { position: relative; background: var(--surface) var(--grain); border: 2px solid var(--outline); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: 16px; display: grid; gap: 12px; }
.c-card > h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.c-card > h3 .ic { font-size: 1.35rem; filter: var(--sticker); }
.c-card .sub { color: var(--muted); font-size: 0.86rem; margin-top: -6px; }
.c-raised { box-shadow: var(--shadow-3); }
.btn-brand {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 3px 3px 0 var(--ink-shadow);
}
.btn-brand:hover { background: var(--brand); filter: brightness(1.05); }
.c-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-weight: 500; font-size: 0.92rem; background: var(--surface-2); border: 1.5px solid var(--outline); box-shadow: var(--shadow-1); }
.c-note .ic { font-size: 1.2rem; line-height: 1.3; }
.c-note.warn { background: var(--warn-soft); color: var(--warn-ink); }
.c-note.good { background: var(--good-soft); color: var(--good-ink); }
.c-note.brand { background: var(--brand-wash); color: var(--ink); }
.c-note.pop { animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3); }

/* ---- enter number ---- */
.c-enter { text-align: center; gap: 16px; padding-top: 0; }
.c-shell.is-tall .c-head { padding-bottom: 96px; }
.c-art {
  width: 104px;
  height: 104px;
  margin: -46px auto 0;
  border-radius: 32px;
  background: var(--surface) var(--grain);
  border: 2px solid var(--outline);
  box-shadow: var(--shadow-2);
  display: grid;
  place-items: center;
  font-size: 56px;
  overflow: hidden;
  animation: floaty 3.2s ease-in-out infinite;
}
.c-art img { width: 80%; height: 80%; object-fit: contain; }
.c-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1.15; }
.c-sub { color: var(--ink-2); }
.c-num-input {
  width: 100%;
  height: 84px;
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.06em;
  direction: ltr;
  border: 2px solid var(--outline);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 12px;
}
.c-num-input::placeholder { color: var(--muted); font-size: 1.6rem; letter-spacing: 0; font-weight: 600; }
.c-num-input:focus { outline: none; box-shadow: 4px 4px 0 var(--brand); }
.c-err { color: var(--bad-ink); font-weight: 600; font-size: 0.9rem; min-height: 1.4em; }
.c-claim { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.c-claim.one { grid-template-columns: minmax(0, 1fr); }
.c-claim-num {
  min-height: 84px;
  border-radius: 18px;
  border: 2px solid var(--outline);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  direction: ltr;
  box-shadow: var(--shadow-1);
  transition: transform 0.12s;
}
.c-claim-num:active { transform: translate(2px, 2px); box-shadow: none; }
.c-claim.one .c-claim-num { min-height: 132px; font-size: 4.6rem; background: var(--brand-wash); color: var(--brand-text); box-shadow: 4px 4px 0 var(--brand); }
.c-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.c-perk { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; border: 1.5px dashed var(--line-strong); font-size: 0.78rem; color: var(--ink-2); line-height: 1.35; }
.c-perk span { font-size: 1.4rem; filter: var(--sticker); }

/* ---- the ticket (waiting screen hero) ---- */
.c-ticket { position: relative; background: var(--surface) var(--grain); border: 2px solid var(--outline); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: 16px 18px 20px; display: grid; justify-items: center; gap: 10px; }
.c-stub { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.c-stub .lbl { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.c-number { font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 0.95; color: var(--brand-text); direction: ltr; letter-spacing: 0.02em; }
.c-status { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 10px; border: 1.5px solid var(--outline); background: var(--brand-wash); font-weight: 700; font-size: 0.88rem; transform: rotate(-1.5deg); }
.c-dots { display: inline-flex; gap: 3px; }
.c-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: bounce 1s infinite; }
.c-dots i:nth-child(2) { animation-delay: 0.15s; }
.c-dots i:nth-child(3) { animation-delay: 0.3s; }
.c-perf { position: relative; width: calc(100% + 36px); height: 2px; margin-inline: -18px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 7px, transparent 7px 13px); }
/* the punched notches, cut through the ticket's ink edge */
.c-perf::before, .c-perf::after { content: ""; position: absolute; top: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--plane); border: 2px solid var(--outline); }
.c-perf::before { left: -15px; }
.c-perf::after { right: -15px; }

/* LED pager display: always a dark device screen, in both themes, framed like the rest of the page. */
.led-panel { width: 100%; padding: 12px 12px 8px; border-radius: 18px; background: #1a1714; border: 2px solid #000; box-shadow: inset 0 0 0 3px #2c2620, 3px 3px 0 var(--ink-shadow); }
.led { display: block; width: 100%; height: auto; direction: ltr; }
.led .off, .led .run { fill: rgba(255, 255, 255, 0.075); }
.led .on { fill: #ffffff; filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7)); }
.led .run { animation: ledRun 1.8s linear infinite; }
.led.reveal .on { animation: ledIn 0.45s ease-out backwards; }
@keyframes ledRun { 0% { fill: #ffffff; } 22%, 100% { fill: rgba(255, 255, 255, 0.075); } }
@keyframes ledIn { from { fill: rgba(255, 255, 255, 0.1); filter: none; } }
.c-ready-led { width: min(76vw, 330px); margin: 4px 0 6px; }
.c-ready-led .led .off { fill: rgba(255, 255, 255, 0.1); }

.c-ring { position: relative; width: min(62vw, 244px); aspect-ratio: 1; margin-top: 4px; }
.c-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.c-ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.c-ring .bar { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.c-ring .knob { fill: var(--surface); stroke: var(--outline); stroke-width: 3; transition: transform 0.9s linear; transform-origin: 60px 60px; }
.c-ring .art {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(54px, 17vw, 82px);
  background: var(--brand-wash) var(--grain);
  border: 2px solid var(--outline);
  overflow: hidden;
}
.c-ring .art > * { animation: floaty 3s ease-in-out infinite; }
.c-ring .art > span { filter: var(--sticker); }
.c-ring .art img { width: 72%; height: 72%; object-fit: contain; }
.c-sparks { position: absolute; inset: 0; pointer-events: none; }
.c-sparks i { position: absolute; bottom: 24%; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: 0; animation: rise 3.4s ease-in infinite; }
.c-sparks i:nth-child(3n) { background: var(--mustard); width: 5px; height: 5px; }
.c-sparks i:nth-child(3n + 1) { background: var(--brand-2); }
.c-remaining { display: grid; justify-items: center; gap: 0; text-align: center; }
.c-remaining small { color: var(--muted); font-weight: 600; }
.c-remaining b { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1.15; }
.c-remaining .late { color: var(--warn-ink); }
.c-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.c-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 10px; border: 1.5px solid var(--outline); background: var(--surface-2); font-weight: 700; font-size: 0.88rem; }
.c-chip.hot { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-1); }

.c-steps { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; margin-top: 6px; }
.c-steps::before { content: ""; position: absolute; top: 13px; inset-inline: 16.6%; height: 3px; border-radius: 3px; background: var(--surface-3); }
.c-steps .fill { position: absolute; top: 13px; inset-inline-start: 16.6%; height: 3px; border-radius: 3px; background: var(--outline); transition: width 0.6s; }
.c-step { position: relative; display: grid; justify-items: center; gap: 4px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.c-step i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.8rem; font-weight: 800; background: var(--surface-2); color: var(--muted); border: 2px solid var(--line-strong); }
.c-step.on { color: var(--ink); font-weight: 700; }
.c-step.on i { background: var(--brand); color: var(--on-brand); border-color: var(--outline); box-shadow: 2px 2px 0 var(--ink-shadow); }
.c-step.done i { background: var(--good); color: #fff; border-color: var(--outline); }

/* ---- alerts card ---- */
.c-alert-row { display: flex; align-items: center; gap: 12px; }
.c-bell { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--brand-wash); border: 1.5px solid var(--outline); transform: rotate(-4deg); }
.c-alert-text { flex: 1; min-width: 0; line-height: 1.4; }
.c-alert-text b { display: block; }
.c-alert-text small { color: var(--muted); }
.c-near { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; font-weight: 600; }
.c-steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.88rem; }
.c-steps-list li { display: flex; gap: 10px; align-items: flex-start; }
.c-steps-list b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; background: var(--surface-2); border: 1.5px solid var(--outline); }

/* ---- games: a sheet of paper with sticker cards on it ---- */
.c-paper { background: var(--paper) var(--grain); color: var(--paper-ink); border: 2px solid var(--paper-ink); box-shadow: 3px 4px 0 var(--paper-shadow); }
.c-paper .sub { color: var(--paper-muted); }
.c-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; padding: 10px 2px 4px; }
.c-game {
  --tilt: -1.2deg;
  position: relative;
  min-height: 124px;
  border: 2px solid var(--paper-ink);
  border-radius: 16px;
  padding: 14px 14px 12px;
  color: var(--paper-ink);
  text-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--paper) var(--grain);
  box-shadow: 3px 4px 0 var(--paper-shadow);
  transform: rotate(var(--tilt));
  transition: transform 0.15s, box-shadow 0.15s;
}
.c-game:nth-child(even) { --tilt: 1.1deg; }
.c-game:nth-child(3n) { --tilt: -0.4deg; }
/* An odd number of games: the first one (the newest) takes the whole row, so none is left alone. */
.c-game:first-child:nth-last-child(odd) { grid-column: 1 / -1; min-height: 110px; --tilt: -0.6deg; }
.c-game:active { transform: translate(2px, 3px) rotate(var(--tilt)); box-shadow: 1px 1px 0 var(--paper-shadow); }
/* a strip of tape holding the card */
.c-game::before { content: ""; position: absolute; top: -11px; left: 50%; width: 56px; height: 20px; margin-left: -28px; background: var(--tape); transform: rotate(-4deg); }
.c-game:nth-child(even)::before { transform: rotate(3deg); }
.c-game .gi { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 42px; line-height: 1; filter: var(--sticker); transform: rotate(9deg); }
.c-game:nth-child(even) .gi { transform: rotate(-7deg); }
.c-game b { display: inline; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; line-height: 1.05; padding-inline: 3px; background: linear-gradient(transparent 56%, color-mix(in srgb, var(--brand) 42%, transparent) 56% 90%, transparent 90%); }
.c-game small { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--paper-muted); }
.c-game .new { position: absolute; top: 12px; inset-inline-start: 10px; padding: 1px 8px; border: 2px solid currentColor; border-radius: 6px; color: #d23c3c; font-family: var(--font-display); font-size: 0.8rem; font-weight: 800; transform: rotate(-8deg); }
.c-prize { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 4px; background: #fff1a8; color: #3d3000; font-weight: 600; font-size: 0.88rem; border: 1.5px solid var(--paper-ink); box-shadow: 2px 3px 0 var(--paper-shadow); transform: rotate(-0.6deg); }
.c-prize > span:first-child { font-size: 1.25rem; filter: var(--sticker); }
.c-leaders { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.c-leaders li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper-2); border: 1.5px solid var(--paper-ink); font-size: 0.9rem; }
.c-leaders li span:first-child { width: 26px; text-align: center; font-size: 1.15rem; filter: var(--sticker); }
.c-leaders li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-leaders li em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

.c-wheel-card { position: relative; overflow: hidden; background: var(--brand) var(--grain); color: var(--on-brand); border: 2px solid var(--paper-ink); box-shadow: 3px 4px 0 var(--paper-shadow); }
.c-wheel-card .sub { color: color-mix(in srgb, var(--on-brand) 84%, transparent); }
.c-wheel-card::after { content: "🎡"; position: absolute; inset-inline-end: -4px; bottom: -12px; font-size: 86px; filter: var(--sticker); transform: rotate(-12deg); }
.btn-gold { position: relative; z-index: 1; background: #ffd34d; color: #2a1c00; border: 2px solid var(--paper-ink); box-shadow: 3px 3px 0 var(--paper-shadow); }
.btn-gold:hover { background: #ffd34d; filter: brightness(1.03); }
.btn-gold:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--paper-shadow); }

/* ---- dhikr corner: same paper, a calm green bead ---- */
.c-dhikr { --dh: #1f7a5a; justify-items: center; text-align: center; }
.c-dhikr > h3 { justify-self: stretch; }
.dh-verse { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.7; color: var(--dh); }
.dh-verse small { display: block; font-family: var(--font-ui); font-size: 0.72rem; color: var(--paper-muted); line-height: 1.2; }
.dh-phrases { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.dh-phrases button { padding: 5px 12px; border: 1.5px solid var(--paper-ink); border-radius: 99px; background: var(--paper-2); color: var(--paper-ink); font-size: 0.84rem; font-weight: 600; }
.dh-phrases button[aria-pressed="true"] { background: var(--dh); color: #fff; box-shadow: 2px 2px 0 var(--paper-shadow); }
/* the bead: tap it to count; the ring around it fills toward one round (33 or 100) */
.dh-ring { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.dh-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.dh-ring .trk { fill: none; stroke: color-mix(in srgb, var(--paper-ink) 12%, transparent); stroke-width: 7; }
.dh-ring .bar { fill: none; stroke: var(--mustard); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.25s; }
.dh-bead { position: relative; width: 164px; height: 164px; border: 2px solid var(--paper-ink); border-radius: 50%; background: radial-gradient(ellipse 20% 12% at 34% 26%, rgba(255, 255, 255, 0.55) 96%, transparent 100%), var(--dh); color: #fff; box-shadow: 4px 5px 0 var(--paper-shadow); display: grid; place-items: center; align-content: center; gap: 2px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; transition: transform 0.08s; }
.dh-bead:active { transform: translate(2px, 3px) scale(0.985); box-shadow: 1px 2px 0 var(--paper-shadow); }
.dh-bead.done { animation: beadDone 0.6s; }
.dh-count { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.dh-goal { font-size: 0.78rem; font-weight: 600; opacity: 0.92; }
.dh-text { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.7; }
.dh-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; font-size: 0.82rem; color: var(--paper-muted); }
.dh-row button { border: 0; padding: 4px; background: none; color: var(--paper-muted); font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; }
.dh-card { width: 100%; margin: 4px 0 0; padding: 12px 14px; display: grid; gap: 6px; border: 1.5px dashed color-mix(in srgb, var(--paper-ink) 45%, transparent); border-radius: 12px; background: var(--paper-2); text-align: start; }
.dh-card b { font-family: var(--font-display); color: var(--dh); }
.dh-card blockquote { margin: 0; font-size: 1rem; line-height: 1.95; }
.dh-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--paper-muted); }
.dh-card figcaption button { padding: 3px 12px; border: 1.5px solid var(--paper-ink); border-radius: 99px; background: var(--paper); color: var(--paper-ink); font-size: 0.78rem; font-weight: 600; }
@keyframes beadDone { 35% { transform: scale(1.07); box-shadow: 0 0 0 12px color-mix(in srgb, var(--mustard) 40%, transparent), 4px 5px 0 var(--paper-shadow); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-dhikr { --dh: #2f9b74; } }
:root[data-theme="dark"] .c-dhikr { --dh: #2f9b74; }

.c-cheers { display: flex; flex-wrap: wrap; gap: 8px; }
.c-cheer { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--outline); background: var(--surface-2); font-size: 1.5rem; box-shadow: var(--shadow-1); transition: transform 0.12s; }
.c-cheer:active { transform: translate(2px, 2px) scale(0.92); box-shadow: none; }
.c-cheer[disabled] { opacity: 0.4; }
.c-fly { position: fixed; z-index: 95; font-size: 2rem; pointer-events: none; animation: fly 1.2s ease-out forwards; }

/* offers scroll sideways; the padding keeps their hard shadows from being clipped */
.c-offers { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 6px; margin: -2px; scrollbar-width: none; }
.c-offers::-webkit-scrollbar { display: none; }
.c-offer { scroll-snap-align: start; border-radius: 16px; padding: 14px; background: var(--brand-wash) var(--grain); border: 2px solid var(--outline); box-shadow: 3px 3px 0 var(--ink-shadow); display: grid; gap: 4px; align-content: start; color: var(--ink); text-decoration: none; min-width: 0; }
.c-offer .em { font-size: 1.8rem; filter: var(--sticker); }
.c-offer b { font-size: 1rem; }
.c-offer p { font-size: 0.86rem; color: var(--ink-2); }
.c-offer img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--outline); }

/* loyalty card: empty circles are dashed, earned ones are rubber stamps */
.c-stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; }
.c-stamp { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; border: 2px dashed var(--line-strong); color: var(--muted); }
.c-stamp.on { border: 2px solid var(--outline); background: var(--brand); color: var(--on-brand); box-shadow: 2px 2px 0 var(--ink-shadow); transform: rotate(-8deg); }
.c-stamp.on:nth-child(even) { transform: rotate(6deg); }
.c-stamp.new { animation: stampIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.4); }

.c-coupon { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 2px dashed var(--outline); }
.c-coupon b { font-size: 1.05rem; }
.c-coupon .code { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.18em; color: var(--brand-text); direction: ltr; text-align: center; }
.c-coupon small { color: var(--muted); text-align: center; }

.c-social { display: flex; flex-wrap: wrap; gap: 8px; }
.c-foot { display: grid; justify-items: center; gap: 8px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.8rem; }
.c-foot a { color: inherit; }

/* ---- sticky mini status ---- */
.c-mini {
  position: fixed;
  z-index: 40;
  top: 0;
  inset-inline: 0;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  justify-content: center;
  transform: translateY(-110%);
  transition: transform 0.25s ease;
  pointer-events: none;
}
.c-mini.show { transform: none; }
.c-mini > div { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; width: 100%; padding: 8px 14px; border-radius: 14px; background: var(--surface) var(--grain); border: 2px solid var(--outline); box-shadow: var(--shadow-2); font-weight: 600; font-size: 0.9rem; }
.c-mini .n { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--brand-text); direction: ltr; }
.c-mini .sp { flex: 1; }

/* ---- rating ---- */
.c-stars { display: flex; justify-content: center; gap: 4px; direction: ltr; }
.c-star { width: 54px; height: 54px; border: 0; background: none; font-size: 2.5rem; line-height: 1; color: var(--surface-3); -webkit-text-stroke: 1.5px var(--outline); transition: transform 0.15s, color 0.15s; padding: 0; }
.c-star.on { color: var(--mustard); text-shadow: 2px 2px 0 var(--ink-shadow); transform: scale(1.06) rotate(-6deg); }
.c-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.c-tag { border: 1.5px solid var(--outline); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 14px; font-size: 0.86rem; font-weight: 600; }
.c-tag[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-1); }
.btn-google { background: #fff; color: #1f1f1f; }
.btn-google:hover { background: #fff; filter: brightness(0.97); }

.c-big-check { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 46px; background: var(--good-soft); border: 2px solid var(--outline); box-shadow: var(--shadow-2); }
.c-center { text-align: center; justify-items: center; }

/* ---- ready (full screen) ---- */
.c-ready {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  color: var(--on-brand);
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  /* the merchant's color, printed with a halftone dot screen */
  background: radial-gradient(circle, rgba(32, 28, 23, 0.14) 1.7px, transparent 2.2px) 0 0 / 14px 14px, var(--brand) var(--grain);
  animation: readyGlow 1.1s ease-in-out infinite alternate;
}
.c-ready canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.c-ready .rings { position: absolute; left: 50%; top: 30%; width: 0; height: 0; }
.c-ready .rings i { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.7); animation: ripple 2.6s ease-out infinite; }
.c-ready .rings i:nth-child(2) { animation-delay: 0.85s; }
.c-ready .rings i:nth-child(3) { animation-delay: 1.7s; }
.c-ready-inner { position: relative; display: grid; justify-items: center; gap: 10px; max-width: 420px; }
.c-ready .bell { font-size: 76px; line-height: 1; animation: ringbell 0.45s ease-in-out infinite alternate; transform-origin: 50% 10%; }
.c-ready .bell { filter: var(--sticker); }
.c-ready .num { font-family: var(--font-display); font-weight: 800; font-size: clamp(96px, 32vw, 160px); line-height: 0.95; direction: ltr; text-shadow: 5px 6px 0 #201c17; }
.c-ready h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 8vw, 2.4rem); font-weight: 800; }
.c-ready p { font-size: 1.05rem; opacity: 0.95; }
.c-ready .recall { background: #201c17; color: #fbf5e9; padding: 5px 14px; border-radius: 10px; font-weight: 700; transform: rotate(-2deg); }
.c-ready .go { margin-top: 8px; min-height: 62px; padding: 14px 30px; border: 2px solid #201c17; border-radius: 18px; background: #fbf5e9; color: #201c17; font-size: 1.15rem; font-weight: 800; box-shadow: 5px 6px 0 #201c17; animation: nudge 1.6s ease-in-out infinite; }
.c-ready .go:active { transform: translate(3px, 3px); box-shadow: 2px 3px 0 #201c17; }
.c-ready .hint { font-size: 0.85rem; opacity: 0.85; }

/* ---- game & wheel overlays: the game sits on a sheet of paper too ---- */
.g-wrap { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--paper) var(--grain); color: var(--paper-ink); }
.g-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); }
.g-top .t { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.g-top button { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--paper-ink); background: var(--paper); color: var(--paper-ink); font-size: 1.05rem; box-shadow: 2px 2px 0 var(--paper-shadow); }
.g-top button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--paper-shadow); }
.g-score { display: grid; text-align: center; line-height: 1.05; min-width: 56px; padding: 3px 8px 4px; border: 2px solid var(--paper-ink); border-radius: 12px; background: var(--paper); }
.g-score small { font-size: 0.66rem; font-weight: 600; color: var(--paper-muted); }
.g-score b { font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.g-status { margin: 0 max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); padding: 7px 12px; border-radius: 10px; background: var(--brand); color: var(--on-brand); border: 2px solid var(--paper-ink); box-shadow: 2px 3px 0 var(--paper-shadow); font-size: 0.86rem; font-weight: 700; display: flex; gap: 8px; align-items: center; }
/* the play area: a dotted notebook page */
.g-stage { position: relative; flex: 1; min-height: 0; margin: 0 max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); border-radius: 18px; overflow: hidden; border: 2px solid var(--paper-ink); background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--paper-ink) 16%, transparent) 1.2px, transparent 1.6px) 0 0 / 18px 18px, var(--paper-2); touch-action: none; user-select: none; -webkit-user-select: none; }
.g-stage canvas { display: block; width: 100%; height: 100%; }
.g-panel { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px 18px; overflow-y: auto; text-align: center; background: color-mix(in srgb, var(--paper-2) 70%, transparent); z-index: 5; }
.g-panel > div { position: relative; display: grid; gap: 12px; justify-items: center; width: min(340px, 100%); padding: 26px 18px 20px; border: 2px solid var(--paper-ink); border-radius: 18px; background: var(--paper) var(--grain); box-shadow: 5px 6px 0 var(--paper-shadow); transform: rotate(-0.8deg); animation: dropIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.g-panel > div::before { content: ""; position: absolute; top: -12px; left: 50%; width: 86px; height: 22px; margin-left: -43px; background: var(--tape); transform: rotate(2deg); }
.g-panel .big { font-size: 66px; line-height: 1; filter: var(--sticker); transform: rotate(-6deg); }
.g-panel h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; }
.g-panel p { color: var(--paper-muted); }
.g-panel .prize { color: var(--paper-ink); font-weight: 600; }
.g-panel .final { font-family: var(--font-display); font-size: 3.6rem; font-weight: 800; line-height: 1; color: var(--brand-text); }
.g-panel .btn { min-width: 190px; }
.g-panel .btn-primary { background: var(--brand); color: var(--on-brand); border: 2px solid var(--paper-ink); box-shadow: 3px 3px 0 var(--paper-shadow); }
.g-panel .btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--paper-shadow); }
.g-panel .btn-ghost { background: var(--paper); color: var(--paper-ink); border: 2px solid var(--paper-ink); }
.g-panel input { text-align: center; background: var(--paper-2); border: 2px solid var(--paper-ink); color: var(--paper-ink); }
.g-top5 { width: 100%; display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 0.88rem; }
.g-top5 li { display: flex; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--paper-2); border: 1.5px solid var(--paper-ink); }
.g-top5 li.me { background: #fff1a8; color: #2a2000; }
.g-top5 li b { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* points pop up like a rubber stamp */
.g-float { position: absolute; pointer-events: none; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--paper-ink); text-shadow: 2px 0 0 var(--paper), -2px 0 0 var(--paper), 0 2px 0 var(--paper), 0 -2px 0 var(--paper); animation: stampUp 0.85s ease-out forwards; z-index: 4; white-space: nowrap; }
.g-float.gold { color: #b87900; }
.g-float.bad { color: #d23c3c; }
.g-float.good { color: #1f8a5b; }
.g-target { position: absolute; display: grid; place-items: center; border: 0; padding: 0; background: none; font-size: 34px; line-height: 1; filter: var(--sticker); transform: rotate(var(--r, 0deg)); transition: transform 0.12s; animation: stickOn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
.g-target.gold { animation: stickOn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.5), wiggle 0.5s 0.24s ease-in-out infinite alternate; }
.g-target.hit { transform: scale(0) rotate(40deg); }
.g-timer { position: absolute; top: 10px; inset-inline: 14px; height: 14px; border: 2px solid var(--paper-ink); border-radius: 8px; background: var(--paper); overflow: hidden; z-index: 3; }
.g-timer i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--brand) 0 8px, color-mix(in srgb, var(--brand) 70%, #fff) 8px 16px); transition: width 0.2s linear; }
.g-grid { position: absolute; inset: 14px; display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); align-content: center; }
.g-card { aspect-ratio: 3 / 4; border: 0; padding: 0; perspective: 600px; background: none; }
.g-card > span { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.35s; }
.g-card.flip > span, .g-card.done > span { transform: rotateY(180deg); }
.g-card .f, .g-card .b { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; border: 2px solid var(--paper-ink); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.g-card i { font-style: normal; line-height: 1; filter: var(--sticker); }
/* the back of each card: the place's color in stripes, with its icon stuck on */
.g-card .f { background: repeating-linear-gradient(45deg, var(--brand) 0 7px, color-mix(in srgb, var(--brand) 80%, #000) 7px 14px); box-shadow: 2px 3px 0 var(--paper-shadow); font-size: clamp(20px, 6.5vw, 28px); }
.g-card .b { background: var(--paper) var(--grain); transform: rotateY(180deg); font-size: clamp(26px, 9vw, 40px); box-shadow: 2px 3px 0 var(--paper-shadow); }
.g-card.done .b { background: color-mix(in srgb, #3fb68b 24%, var(--paper)); animation: matched 0.45s; }

/* the prize wheel: a printed disc with an ink rim and a mustard band, on a dark kraft backdrop */
.w-wrap { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 20px; background: rgba(27, 24, 20, 0.92) var(--grain); color: #fbf5e9; text-align: center; }
.w-box { display: grid; gap: 16px; justify-items: center; width: min(380px, 100%); }
.w-box h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; }
.w-disc { position: relative; width: min(82vw, 330px); aspect-ratio: 1; }
.w-disc canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 3px #201c17, 0 0 0 10px var(--mustard), 0 0 0 12px #201c17, 7px 9px 0 12px #000; }
.w-pin { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #fbf5e9; filter: drop-shadow(2px 0 0 #201c17) drop-shadow(-2px 0 0 #201c17) drop-shadow(0 2px 0 #201c17) drop-shadow(2px 3px 0 #000); z-index: 2; }
.w-hub { position: absolute; inset: 41%; border-radius: 50%; background: #fbf5e9; border: 2px solid #201c17; box-shadow: 2px 3px 0 #000; display: grid; place-items: center; font-size: 1.4rem; }

@keyframes floaty { 50% { transform: translateY(-7px) rotate(4deg); } }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: 0.5; } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 15% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-150px) scale(1.1); } }
@keyframes ripple { from { transform: scale(0.5); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
@keyframes ringbell { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes readyGlow { to { filter: brightness(1.12) saturate(1.1); } }
@keyframes nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.06); } 90% { transform: scale(0.98); } }
@keyframes fly { to { transform: translateY(-160px) scale(1.6); opacity: 0; } }
@keyframes floatUp { to { transform: translateY(-50px); opacity: 0; } }
@keyframes popIn { from { transform: scale(0.3); } }
@keyframes stampUp { 0% { transform: scale(1.7) rotate(-10deg); opacity: 0; } 14% { transform: scale(1) rotate(-4deg); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-44px) rotate(-4deg); opacity: 0; } }
@keyframes stickOn { from { transform: scale(0.2) rotate(-30deg); } }
@keyframes wiggle { to { transform: rotate(calc(var(--r, 0deg) + 10deg)) scale(1.06); } }
@keyframes dropIn { from { transform: translateY(-24px) rotate(-5deg); opacity: 0; } }
@keyframes matched { 50% { transform: rotateY(180deg) scale(1.1); } }
@keyframes stampIn { from { transform: scale(2.2) rotate(-25deg); opacity: 0; } }
