/* VZY Dugout web view, on the VZY Design Style Guide (dark theme), matching vzy-wireframe:
   primary VZY Yellow #FEC00F (golden #EFA608), dark grounds #141414 / #1C1C1C / #1E1E1E / #2D2B2B,
   text #FFFFFF / #EFEFEF, state green #208E61 with the mint pastel, Roboto throughout.
   Yellow is the one accent: the points card, primary buttons and every "+points" figure. */

:root {
  --bg: #141414;
  --surface: #1c1c1c;
  --surface-2: #2d2b2b;
  --line: rgba(255, 255, 255, .11);
  --ink: #ffffff;
  --text: #efefef;
  --muted: rgba(239, 239, 239, .58);
  --faint: rgba(239, 239, 239, .38);

  --yellow: #fec00f;
  --golden: #efa608;
  --on-yellow: #141414;
  --ok: #208e61;
  --mint: #c9ffe9;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  --gutter: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  /* the wireframe's panel material: a faint inner top light and hairline edge */
  --panel-light: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(255, 255, 255, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ol, ul { margin: 0; }
h1, h2, h3 { color: var(--ink); }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
/* No double-tap-zoom delay on anything tappable; no long-press callout on buttons. */
button, a, summary { touch-action: manipulation; }
button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--yellow); color: var(--on-yellow); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-xs { width: 13px; height: 13px; }
.ic-sm { width: 16px; height: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px var(--gutter); text-align: center; color: var(--muted); }

/* ---------- App bar: VZY logo + Dugout ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(6px + var(--safe-top)) max(6px, calc((100% - 520px) / 2 + 6px)) 6px;
  background: var(--bg); /* solid: no live blur while scrolling */
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.appbar.is-scrolled { border-bottom-color: var(--line); }
.appbar[hidden] { display: none; }
.brand { display: flex; align-items: center; justify-content: center; gap: 9px; }
.brand-logo { width: 42px; height: 22px; color: var(--yellow); }
.brand-name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; padding-left: 9px; border-left: 1px solid var(--line); line-height: 1.2; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; flex: none; color: var(--ink); }
#btn-back { justify-self: start; }
.is-hidden { visibility: hidden; }
/* Balance pill: appears once the points card has scrolled away; tap to jump back up. */
.points-pill {
  justify-self: end; margin-right: 10px; height: 30px; padding: 0 11px; border-radius: 8px;
  background: rgba(254, 192, 15, .14); color: var(--yellow); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease-out);
}
.points-pill.show { opacity: 1; transform: none; pointer-events: auto; }
/* keeps its 44px tap height without growing the header */
.points-pill::after { content: ""; position: absolute; inset: -7px 0; }
.points-pill { position: relative; }
.icon-btn:active { background: var(--surface-2); }

/* ---------- Layout ---------- */
.app {
  max-width: 520px; margin: 0 auto;
  padding: 12px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(48px + var(--safe-bottom)) max(var(--gutter), env(safe-area-inset-left, 0px));
}
.page { display: flex; flex-direction: column; gap: 24px; }
.live-points { font-size: 36px; }
.live-form, .live-form label { display: flex; flex-direction: column; gap: 10px; }
.live-form input:not([type="checkbox"]) { padding: 12px; border-radius: 8px; border: 1px solid #777; background: var(--surface); color: var(--ink); }
.sec { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.sec-aside { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sec, .card, #help { scroll-margin-top: calc(64px + var(--safe-top)); }
/* The help list sits far below the fold: skip its layout and paint until it's near. */
#help { content-visibility: auto; contain-intrinsic-size: auto 480px; }
.sec:focus { outline: none; }

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; isolation: isolate; }
/* the brand yellow throws a little light behind the headline, as on the wireframe's hero */
.hero::before {
  content: ""; position: absolute; z-index: -1; left: -30%; top: -40%; width: 110%; height: 150%; pointer-events: none;
  background: radial-gradient(46% 42% at 40% 45%, rgba(254, 192, 15, .12), transparent 72%);
}
/* Two-tone headline: white lead line, then the payoff in VZY Yellow with a seam-stitch underline. */
.title { position: relative; z-index: 1; font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.title-lead { display: block; color: var(--ink); }
.title-hl {
  color: var(--yellow);
  text-decoration: underline dashed rgba(254, 192, 15, .55); text-decoration-thickness: 2px; text-underline-offset: 7px;
  text-decoration-skip-ink: none;
}
/* Ball in flight, top right, clear of the headline's first line. Floats gently; sparkles twinkle. */
.hero-ball {
  position: absolute; top: -10px; right: -10px; width: 112px; height: 96px;
  pointer-events: none;
  animation: float 3.6s ease-in-out infinite alternate;
}
@keyframes float { from { transform: translateY(2px); } to { transform: translateY(-5px); } }
.hb-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.hb-spark-1 { animation-delay: .8s; }
.hb-spark-2 { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
.lede { color: var(--muted); font-size: 13.5px; line-height: 1.5; max-width: 36ch; margin-top: 2px; text-wrap: pretty; }
.prize { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--panel-light); text-align: left; transition: transform .12s var(--ease-out), background-color .15s; }
.prize:active { transform: scale(.985); background: var(--surface-2); }
.prize-text { display: flex; flex-direction: column; min-width: 0; }
.prize-go { color: var(--faint); margin-left: 2px; }
.prize-art { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.prize-art svg, .prize-art img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); }
.prize-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-top: 2px; text-wrap: balance; }
.prize-days { margin-left: auto; padding-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Points + levels: a VZY Yellow card with dark ink ---------- */
.score {
  position: relative; overflow: hidden; padding: 20px; border-radius: 18px;
  background: linear-gradient(150deg, #ffd24d 0%, var(--yellow) 45%, var(--golden) 100%);
  color: var(--on-yellow);
  box-shadow: 0 10px 30px rgba(254, 192, 15, .18);
}
.score::after { /* the wireframe's lit edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(158deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 42%);
}
.score > * { position: relative; z-index: 1; }
.score-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-label { font-size: 13px; font-weight: 600; opacity: .75; }
.level-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 7px; background: rgba(20, 20, 20, .12); font-size: 12.5px; font-weight: 700; }
.score-value { font-size: 48px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 12px 0 18px; color: var(--on-yellow); }
.levels { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 4px; }
.lv { display: flex; flex-direction: column; gap: 7px; }
.lv-bar { position: relative; height: 6px; border-radius: 6px; background: rgba(20, 20, 20, .16); overflow: hidden; }
.lv-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--on-yellow); transition: width 1s var(--ease-out); }
.lv-name { font-size: 11.5px; font-weight: 500; opacity: .55; }
.lv.is-done .lv-name { opacity: .75; }
.lv.is-current .lv-name { opacity: 1; font-weight: 700; }
.score-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; }
.score-foot p { opacity: .85; }
.score-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -12px -4px -12px 0; padding: 0 4px; font-size: 13px; font-weight: 700; color: var(--on-yellow); white-space: nowrap; }
.score-foot b { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-light); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.pts { font-size: 13.5px; font-weight: 700; color: var(--yellow); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; }
.status { font-size: 13px; color: var(--muted); }
.status.is-win { color: var(--mint); font-weight: 600; }
.fine-note { font-size: 11.5px; color: var(--faint); margin-top: -6px; }

/* ---------- Buttons (wireframe .btn-y / .btn-p) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 0 18px; border-radius: 10px;
  font-weight: 700; font-size: 15px;
  transition: transform .12s var(--ease-out), opacity .2s, background-color .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { cursor: default; }
.btn[hidden] { display: none; }
.btn-primary { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 8px 24px rgba(254, 192, 15, .2); }
.btn-primary:active:not(:disabled) { background: #ffd245; }
.btn-primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.btn-quiet { background: rgba(255, 255, 255, .1); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.btn-quiet:active:not(:disabled) { background: rgba(255, 255, 255, .2); }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: 13.5px; }
.btn-sm .ic { width: 13px; height: 13px; }
.state .btn { width: auto; }
.link-btn { display: inline-flex; align-items: center; min-height: 44px; color: var(--yellow); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Streak ---------- */
.days { display: grid; grid-template-columns: repeat(5, 1fr); }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-dot { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .16); display: grid; place-items: center; }
.day-ball { width: 30px; height: 30px; }
.day.is-done .day-dot { border: 0; }
.day.is-missed .day-dot { border: 0; background: var(--surface-2); }
.day.is-today .day-dot { border: 2px solid var(--yellow); }
.day-name { font-size: 12px; color: var(--muted); }
.day.is-today .day-name { color: var(--yellow); font-weight: 700; }

/* ---------- Spin: only .wheel-rotor moves (GPU-composited transform) ---------- */
.wheel { position: relative; width: min(236px, 68vw); aspect-ratio: 1; margin: 0 auto; }
.wheel-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wheel-rotor { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; backface-visibility: hidden; }
.wheel-layer text { font-family: var(--font); font-weight: 800; font-size: 14px; fill: var(--ink); }
.wheel-layer .is-top { fill: var(--on-yellow); }
.wheel-layer .is-zero { font-size: 10px; font-weight: 700; letter-spacing: .06em; fill: var(--muted); text-transform: uppercase; }

/* ---------- Referral ---------- */
.code { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 2px 16px; border-radius: 10px; border: 1px dashed rgba(254, 192, 15, .45); background: rgba(254, 192, 15, .06); }
.code-text { font-size: 18px; font-weight: 700; letter-spacing: .12em; color: var(--ink); word-break: break-all; }
.code .icon-btn { color: var(--yellow); }
.code + .btn { margin-top: -6px; }

.all-done { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mint); }

/* ---------- Scroll reveal ---------- */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
.rv.in { opacity: 1; transform: none; }

/* ---------- Rewards store: 2-column grid ---------- */
.store { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-light); }
.item-art { aspect-ratio: 16 / 10; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; color: var(--on-yellow); overflow: hidden; }
.item-art .ic { width: 30px; height: 30px; }
.item-art img { width: 100%; height: 100%; object-fit: cover; }
.item-logo { width: 54px; height: 29px; color: var(--on-yellow); }
/* the brand's tertiary pastels (and VZY Yellow) as artwork grounds, as on the wireframe */
.tone-yellow { background: var(--yellow); }
.tone-rose { background: #ffd6d6; }
.tone-mint { background: #c9ffe9; }
.tone-blue { background: #aed3ff; }
.tone-cream { background: #ffedd3; }
.item-title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; min-height: 2.6em; padding: 0 2px; }
.item-cost { font-size: 13px; font-weight: 700; color: var(--yellow); padding: 0 2px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.item .btn { margin-top: auto; }
.item.is-muted .item-art { opacity: .55; }
.item.is-muted .item-cost { color: var(--muted); }

/* ---------- Lists: missions, rewards, help ---------- */
.list { border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-light); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }

.mission, .reward {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px;
  padding: 12px 18px; text-align: left;
}
button.mission:active { background: var(--surface-2); }
.row-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.row-ic .ic { width: 18px; height: 18px; }
.row-art { width: 24px; height: 24px; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.row-pts { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--faint); }
.row-note { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mission.is-done .row-ic { background: rgba(32, 142, 97, .22); color: var(--mint); }
.mission.is-done .row-title { color: var(--muted); }
.mission.is-done .row-note { color: var(--mint); }
/* reached levels use the wireframe's yellow badge tint */
.reward.is-done .row-ic, .reward.is-current .row-ic { background: rgba(254, 192, 15, .16); color: var(--yellow); }
.reward.is-current .row-ic { box-shadow: inset 0 0 0 1.5px var(--yellow); }
.reward.is-current .row-note { color: var(--yellow); }
.reward.is-done .row-note { color: var(--mint); }
.reward.is-locked .row-ic { color: var(--faint); }
.reward.is-locked .row-title { color: var(--muted); }

.row summary, .row-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 14px 18px; text-align: left;
  font-size: 14.5px; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none;
}
.row summary::-webkit-details-marker { display: none; }
.row summary .ic, .row-btn .ic { color: var(--faint); transition: transform .2s; }
.row[open] summary .ic { transform: rotate(180deg); color: var(--yellow); }
.row-body { padding: 0 18px 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.row-btn:active { background: var(--surface-2); }
.row-btn .row-title, .row-btn .row-sub { display: block; }
.row-sub { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.help-intro { display: none; } /* desktop only */
/* On phones the FAQ list and the fine print / care list read as one list. */
.help-faq { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.help-more:not(.is-alone) { margin-top: -12px; border-top-left-radius: 0; border-top-right-radius: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.terms { list-style: disc; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }

/* ---------- States ---------- */
.state { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px 8px; }
.state-art { width: 64px; height: 64px; margin-bottom: 8px; }
.state h1 { font-size: 22px; font-weight: 700; }
.state p { color: var(--muted); max-width: 28ch; margin-bottom: 10px; }

/* Opacity pulse: runs on the compositor, so it doesn't compete with script parsing. */
.skeleton { gap: 12px; }
.sk { border-radius: 12px; background: var(--surface); animation: pulse 1s ease-in-out infinite alternate; }
.sk-line { height: 14px; }
.sk-title { height: 66px; }
.sk-card { border-radius: var(--radius); margin-top: 8px; }
.sk-grad { background: rgba(254, 192, 15, .22); }
.w80 { width: 80%; }
.h60 { height: 60px; } .h180 { height: 180px; } .h220 { height: 220px; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }

/* ---------- Dialog ---------- */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: rgba(10, 10, 10, .8); /* no backdrop blur: too costly on low-end GPUs */
  touch-action: none;               /* dragging on the backdrop must not scroll the page behind */
  overscroll-behavior: contain;
  animation: fade .2s ease-out;
}
.dlg {
  width: 100%; max-width: 420px; text-align: center;
  max-height: calc(100vh - 32px - var(--safe-bottom)); overflow-y: auto; touch-action: pan-y;
  padding: 28px 22px 20px; border-radius: 20px; background: var(--surface); box-shadow: var(--panel-light);
  animation: rise .35s var(--ease-out);
}
.dlg-art { width: 60px; height: 60px; margin: 0 auto 14px; }
.dlg-title { font-size: clamp(28px, 9vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.dlg-title.is-accent { color: var(--yellow); }
.dlg-title.is-small { font-size: 22px; letter-spacing: -.01em; }
.dlg-item { width: 120px; aspect-ratio: 16 / 10; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--on-yellow); }
.dlg-item .ic { width: 34px; height: 34px; }
.dlg-code { margin: -6px 0 18px; text-align: left; }
.dlg-actions { display: flex; flex-direction: column; gap: 8px; }
.dlg-body { color: var(--muted); font-size: 15px; margin-bottom: 22px; text-wrap: balance; }
.dlg-body b { color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(32px); } }
.sheet { animation: slide .38s var(--ease-out); }
@keyframes slide { from { transform: translateY(100%); } }

/* ---------- Sheets: history and grand prize ---------- */
.dlg-backdrop.is-sheet { padding: 0; padding-top: calc(40px + var(--safe-top)); }
.sheet {
  max-width: 520px; max-height: 88vh; text-align: left; padding: 0; display: flex; flex-direction: column;
  border-radius: 22px 22px 0 0; overflow: hidden;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 6px 20px; }
.sheet-title { font-size: 19px; font-weight: 700; }
.sheet-x { color: var(--muted); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet-sub { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.sheet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-stats > div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.sheet-stats b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sheet-stats > div:first-child b { color: var(--yellow); }
.sheet-stats span { font-size: 12px; color: var(--muted); }
.sheet-list { display: flex; flex-direction: column; }
.sheet-list > li + li { border-top: 1px solid var(--line); }
.mine, .act { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.mine { align-items: flex-start; }
.mine-art { width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--on-yellow); }
.mine-art .ic { width: 20px; height: 20px; }
.mine-art .item-logo { width: 32px; height: 17px; }
.mine .row-note { padding-top: 2px; }
.mine-code { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; padding-left: 10px; border-radius: 8px; border: 1px dashed rgba(254, 192, 15, .45); background: rgba(254, 192, 15, .06); color: var(--ink); font-size: 13.5px; font-weight: 700; letter-spacing: .08em; align-self: flex-start; }
.mine-code .icon-btn { color: var(--yellow); }
.st-active { color: var(--mint); }
.st-processing { color: var(--yellow); }
.st-used, .st-expired { color: var(--faint); }
.act-pts { font-size: 14px; font-weight: 700; color: var(--yellow); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-pts.is-spent { color: var(--muted); }
.empty { font-size: 13.5px; color: var(--muted); padding: 6px 0; }

.pp-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 4px; position: relative; isolation: isolate; }
.pp-hero::before { content: ""; position: absolute; z-index: -1; inset: -10% 10%; background: radial-gradient(closest-side, rgba(254, 192, 15, .2), transparent); }
.pp-art { width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 4px; }
.pp-art svg, .pp-art img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(254, 192, 15, .35)); }
.pp-title { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.pp-detail { font-size: 14px; color: var(--muted); max-width: 32ch; }
.pp-dates { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.pp-dates b { color: var(--ink); font-weight: 600; }
.pp-status { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.pp-status b { color: var(--ink); }
.pp-status.is-in { background: rgba(32, 142, 97, .2); }
.pp-status.is-in b { color: var(--mint); }
.pp-bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.pp-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--yellow); transition: width 1s var(--ease-out); }
.steps { display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; font-size: 14px; color: var(--text); line-height: 1.5; }
.step-n { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(254, 192, 15, .16); color: var(--yellow); font-size: 12px; font-weight: 800; }

/* ---------- Toast (wireframe style) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .7), inset 0 0 0 1px var(--line);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform .25s var(--ease-out), opacity .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* ---------- Entrance ---------- */
.reveal { animation: up .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.quiet .reveal { animation: none; }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Compact phones (360px and below): tighter so the points card sits above the fold. */
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .title { font-size: 29px; }
  .lede { font-size: 13px; }
  .mission, .reward { padding: 12px 16px; gap: 12px; }
  .score { padding: 18px; }
  .score-value { font-size: 42px; }
  .lv-name { font-size: 10.5px; }
  .card { padding: 16px; }
  .store { gap: 8px; }
  .item-title { font-size: 13px; }
}

/* Tablets and up: a soft floodlight behind the page; dialogs and sheets become centred modals. */
@media (min-width: 720px) {
  body { background: radial-gradient(900px 520px at 50% -120px, rgba(254, 192, 15, .07), transparent 70%), var(--bg); background-repeat: no-repeat; }
  .appbar { background: rgba(20, 20, 20, .96); }
  .dlg-backdrop, .dlg-backdrop.is-sheet { align-items: center; padding: 32px; }
  .sheet { max-height: min(760px, calc(100vh - 64px)); border-radius: 22px; animation: rise .35s var(--ease-out); }
  .sheet-body { padding-bottom: 28px; }
  .toast { bottom: 32px; }
}

/* ---------- Desktop (960px+): the same content, laid out as a two-column dashboard ----------
   The DOM order is the mobile order; grid areas only move things on wide screens. */
@media (min-width: 960px) {
  :root { --gutter: clamp(32px, 4vw, 72px); } /* side margins grow with the window */
  body { background: radial-gradient(1200px 640px at 30% -200px, rgba(254, 192, 15, .08), transparent 70%), var(--bg); background-repeat: no-repeat; }

  /* Header: brand on the left edge of the content, balance pill on the right. */
  .appbar {
    display: flex; justify-content: space-between; gap: 16px; min-height: 64px;
    padding: 10px max(var(--gutter), calc((100% - 1920px) / 2 + var(--gutter)));
  }
  #btn-back.is-hidden { display: none; }
  #btn-back:not(.is-hidden) + .brand { margin-right: auto; }
  .brand-logo { width: 48px; height: 25px; }
  .brand-name { font-size: 19px; }
  .points-pill { margin-right: 0; height: 34px; padding: 0 14px; font-size: 13.5px; }

  /* Full width; only ultra-wide monitors (over 1920px) get a cap so lines stay readable. */
  .app { max-width: 1920px; padding-top: 28px; padding-bottom: 72px; }

  .page:not(.skeleton) {
    display: grid; align-items: start;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 40px; row-gap: 56px;
    grid-template-areas:
      "hero     score"
      "missions perks"
      "earn     earn"
      "store    store"
      "help     help";
  }
  .page > .hero { grid-area: hero; align-self: center; }
  .page > .score { grid-area: score; align-self: center; }
  .page > #card-missions { grid-area: missions; }
  .page > #card-rewards { grid-area: perks; }
  .page > .sec-earn { grid-area: earn; }
  .page > #card-store { grid-area: store; }
  .page > #help { grid-area: help; }
  /* a side-by-side partner can be switched off by the backend: take the full row */
  .page:not(:has(> #card-rewards)) > #card-missions,
  .page:not(:has(> #card-missions)) > #card-rewards { grid-column: 1 / -1; }
  .sec { margin-top: 0; gap: 16px; }
  .sec-title { font-size: 24px; }
  .sec-aside { font-size: 13.5px; }
  .sec, .card, #help { scroll-margin-top: 88px; }

  /* Hero: a proper headline, with the ball in flight to its right. */
  .hero { gap: 14px; padding: 8px 0; }
  .hero::before { left: -20%; top: -60%; width: 120%; height: 200%; }
  .title { font-size: clamp(46px, 4.4vw, 76px); line-height: 1.04; }
  .title-hl { text-underline-offset: 10px; text-decoration-thickness: 3px; }
  .hero-ball { top: 0; right: 4%; width: 168px; height: 144px; }
  .lede { font-size: 16px; max-width: 44ch; margin-top: 4px; }
  .prize { max-width: 520px; margin-top: 14px; padding: 14px 16px 14px 16px; }
  .prize-art, .prize-art svg, .prize-art img { width: 44px; height: 44px; }
  .prize-title { font-size: 16px; }

  /* Points card */
  .score { padding: 28px; border-radius: 22px; }
  .score-label { font-size: 14px; }
  .score-value { font-size: 64px; margin: 16px 0 24px; }
  .lv-bar { height: 8px; }
  .lv-name { font-size: 12.5px; }
  .score-foot { font-size: 14px; margin-top: 18px; }

  /* Missions and level perks, side by side: rows of equal rhythm. */
  .mission, .reward { min-height: 72px; padding: 14px 20px; }
  .row-title { font-size: 15px; }

  /* Earn more: streak and invite stacked on the left, the wheel card tall on the right. */
  .sec-earn { display: grid; grid-template-columns: repeat(var(--cards, 3), minmax(0, 1fr)); gap: 16px 20px; align-items: stretch; }
  .sec-earn > .sec-head { grid-column: 1 / -1; }
  .sec-earn.has-spin { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "head head" "streak spin" "refer spin"; }
  .sec-earn.has-spin > .sec-head { grid-area: head; }
  .sec-earn.has-spin > #card-streak { grid-area: streak; }
  .sec-earn.has-spin > #card-refer { grid-area: refer; }
  .sec-earn.has-spin > #card-spin { grid-area: spin; }
  /* only two cards: the wheel beside the other one, no empty cell */
  .sec-earn.has-spin:not(:has(> #card-streak)) { grid-template-areas: "head head" "refer spin"; }
  .sec-earn.has-spin:not(:has(> #card-refer)) { grid-template-areas: "head head" "streak spin"; }
  .sec-earn.has-spin:not(:has(> #card-streak)):not(:has(> #card-refer)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "spin"; }
  .card { padding: 22px; gap: 18px; }
  .card-title { font-size: 17px; }
  #card-spin { justify-content: space-between; }
  #card-spin .wheel { width: min(320px, 100%); margin: auto; }
  #card-spin .btn { max-width: 320px; margin: 0 auto; }
  #card-streak .btn, #card-refer .btn { margin-top: auto; }
  .day-dot, .day-ball { width: 38px; height: 38px; }
  .day-name { font-size: 13px; }
  .code-text { font-size: 20px; }

  /* Store: every reward in one row of four. */
  .store { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .item { padding: 12px 12px 14px; gap: 6px; }
  .item-art { margin-bottom: 8px; aspect-ratio: 2 / 1; }
  .item-art .ic { width: 36px; height: 36px; }
  .item-logo { width: 64px; height: 34px; }
  .item-title { font-size: 15px; }
  .item-cost { font-size: 14px; }

  /* Help: intro on the left, the list on the right. */
  /* same columns as the page, so the list lines up under Level perks */
  #help {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 40px; row-gap: 16px; align-items: start;
    grid-template-areas: "head head" "faq more"; contain-intrinsic-size: auto 360px;
  }
  #help > .help-head { grid-area: head; }
  #help > .help-faq { grid-area: faq; }
  #help > .help-more { grid-area: more; }
  #help > .help-more.is-alone { grid-area: faq; }
  .help-faq, .help-more:not(.is-alone) { margin-top: 0; border-radius: var(--radius); box-shadow: var(--panel-light); }
  .help-intro { display: block; color: var(--muted); font-size: 15px; max-width: 60ch; margin-top: 4px; }

  /* Loading skeleton in the same shape as the page. */
  .skeleton { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px 40px; }
  .skeleton .sk-title { grid-column: 1; height: 120px; }
  .skeleton .sk-line { grid-column: 1; }
  .skeleton .h60 { grid-column: 1; }
  .skeleton .h180 { grid-column: 2; grid-row: 1 / span 3; height: auto; min-height: 240px; margin-top: 0; }
  .skeleton .h220 { grid-column: 1 / -1; margin-top: 40px; }

  /* Dialogs on a big screen */
  .dlg { max-width: 440px; padding: 32px 28px 24px; }
  .sheet { max-width: 560px; }
}

/* Wide desktops: a little more air. */
@media (min-width: 1280px) {
  .page:not(.skeleton), #help { column-gap: 56px; }
  .sec-earn { gap: 20px 24px; }
  .store { gap: 20px; }
}

/* Mouse and trackpad: hover feedback (touch screens keep the :active states only). */
@media (hover: hover) and (pointer: fine) {
  .btn, .prize, .item, .row summary, .row-btn, button.mission, .icon-btn, .points-pill, .score-link { transition: transform .15s var(--ease-out), background-color .15s, box-shadow .2s, opacity .2s; }
  .btn-primary:hover:not(:disabled) { background: #ffcb33; box-shadow: 0 10px 28px rgba(254, 192, 15, .3); }
  .btn-quiet:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
  .prize:hover { background: var(--surface-2); }
  .prize:hover .prize-go { color: var(--yellow); transform: translateX(2px); }
  .item { transition: transform .2s var(--ease-out), box-shadow .2s; }
  .item:hover { transform: translateY(-3px); box-shadow: var(--panel-light), 0 14px 30px rgba(0, 0, 0, .45); }
  button.mission:hover, .row summary:hover, .row-btn:hover { background: rgba(255, 255, 255, .04); }
  .icon-btn:hover { background: rgba(255, 255, 255, .08); }
  .code .icon-btn:hover { background: rgba(254, 192, 15, .12); }
  .points-pill.show:hover { background: rgba(254, 192, 15, .22); }
  .score-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .link-btn:hover { color: #ffd245; }
}

/* Short landscape screens: keep the wheel inside the viewport. */
@media (max-height: 500px) and (orientation: landscape) {
  .wheel { width: min(200px, 55vh); }
}
