/* /spend-the-gap. Deliberately its own look, not the
   site's: a dark game board in both themes, display type, big numbers. */
.gx {
  --gx-bg: #0b1020;
  --gx-bg2: #161d3d;
  --gx-ink: #f4f6ff;
  --gx-mute: #a3add3;
  --gx-line: rgba(255, 255, 255, .12);
  --gx-green: #3ee08f;
  --gx-red: #ff5d73;
  --gx-gold: #ffcf5c;
  --gx-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --gx-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Let the board meet the header instead of sitting under the shell's 30px gap. */
main#main { padding-top: 0; }

/* overflow: clip, not hidden: hidden would make the board a scroll container
   and break the shop's sticky wallet. */
.gx-board {
  position: relative;
  overflow: clip;
  color: var(--gx-ink);
  padding: 3rem 0 3.5rem;
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(91, 82, 255, .35), transparent 60%),
    radial-gradient(800px 480px at 110% 0%, rgba(255, 93, 115, .22), transparent 60%),
    linear-gradient(180deg, var(--gx-bg), var(--gx-bg2));
}
.gx-board::before {  /* dot grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%);
  mask-image: linear-gradient(180deg, #000, transparent 90%);
  pointer-events: none;
}
.gx-board + .gx-board { padding-top: 0; background: linear-gradient(180deg, var(--gx-bg2), var(--gx-bg)); }
.gx-board + .gx-board::before { display: none; }
.gx-shop { overflow: visible; }
.gx-wrap { position: relative; max-width: 960px; }

/* ---------- The gap ---------- */
.gx-eyebrow {
  font: 700 .8rem/1 var(--gx-display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gx-gold);
  margin: 0 0 1.25rem;
}
.gx-intro { font: 700 clamp(1.15rem, 3vw, 1.5rem)/1.35 var(--gx-display); margin: 0 0 1rem; max-width: 44ch; }
.gx-intro strong { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gx-peak { color: var(--gx-gold); }    /* the break-even bar's color */
.gx-today { color: var(--gx-green); }  /* the today bar's color */
.gx-lede { font: 700 clamp(1.25rem, 3.4vw, 1.75rem)/1.25 var(--gx-display); margin: 0 0 1.75rem; max-width: 46ch; }
.gx-gap {
  display: block;
  font: 800 clamp(3.6rem, 15vw, 8rem)/.95 var(--gx-display);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  margin: .1em 0 .12em;
  background: linear-gradient(90deg, #ff5d73, #ffad5c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gx-hero-sub {
  font: 700 clamp(1rem, 2.6vw, 1.2rem)/1.35 var(--gx-display);
  color: var(--gx-gold);
  margin: -.75rem 0 2rem;
  max-width: 58ch;
  text-wrap: pretty;
}

.gx-label {
  font: 700 .72rem/1 var(--gx-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gx-mute);
  margin-bottom: .6rem;
}
.gx-controls { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; margin-bottom: 1.5rem; }
.gx-modes { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--gx-line); background: rgba(255, 255, 255, .05); }
.gx-mode {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.05rem;
  background: transparent;
  color: var(--gx-mute);
  font: 800 .95rem/1 var(--gx-display);
  transition: background-color .15s, color .15s;
}
.gx-mode:hover { color: var(--gx-ink); }
.gx-mode[aria-pressed="true"] { background: var(--gx-ink); color: #0b1020; }
.gx-levels { display: flex; flex-wrap: wrap; gap: .45rem; }
.gx-lvl {
  appearance: none;
  min-width: 2.85rem;
  height: 2.85rem;
  padding: 0 .6rem;
  border-radius: 999px;
  border: 1px solid var(--gx-line);
  background: rgba(255, 255, 255, .05);
  color: var(--gx-ink);
  font: 800 1.05rem/1 var(--gx-display);
  transition: transform .15s, background-color .15s, box-shadow .15s;
}
.gx-lvl:hover { background: rgba(255, 255, 255, .12); }
.gx-lvl[aria-pressed="true"] {
  background: var(--gx-gold);
  color: #1d1400;
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 8px 26px rgba(255, 207, 92, .35);
}

/* The unified scorecard */
.gx-scorecard {
  max-width: 760px;
  border-radius: 26px;
  padding: 1.75rem 2rem 1.6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid var(--gx-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.gx-scorecard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.gx-scorecard .gx-lede {
  margin: 0 0 1.35rem;
  max-width: 58ch;
}
.gx-scorecard .gx-gap {
  margin: .05em 0 .1em;
}
.gx-scorecard .gx-bar {
  max-width: 100%;
  margin-bottom: 1.25rem;
}
.gx-scorecard .gx-hero-sub {
  margin: 0 0 .9rem;
  font-size: clamp(.95rem, 2.4vw, 1.1rem);
}
.gx-scorecard .gx-fine {
  margin: 0;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.gx-bar { max-width: 760px; }
.gx-bar-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; margin-bottom: .35rem; font-size: .9rem; color: var(--gx-mute); }
.gx-bar-head strong { font: 800 1.15rem var(--gx-display); color: var(--gx-ink); font-variant-numeric: tabular-nums; margin-left: .3rem; }
.gx-bar-head .gx-today { color: var(--gx-green); }
.gx-bar-head .gx-peak { color: var(--gx-gold); }
.gx-bar-end { margin-left: auto; text-align: right; }
.gx-track { display: flex; height: 2.6rem; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.gx-fill-now { background: linear-gradient(90deg, #22b873, #3ee08f); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.gx-fill-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 800 1rem var(--gx-display);
  background: repeating-linear-gradient(135deg, #ff5d73 0 10px, #e2465d 10px 20px);
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.gx-fine { color: var(--gx-mute); font-size: .82rem; margin: 1rem 0 0; }

/* ---------- The shop ---------- */
.gx-h2 { font: 800 clamp(2rem, 6vw, 3rem)/1 var(--gx-display); letter-spacing: -.03em; margin: 0 0 .5rem; color: var(--gx-ink); }  /* style.css colors h2 with the theme text */
.gx-sub { color: var(--gx-mute); margin: 0 0 1.5rem; max-width: 52ch; }
.gx-budget-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 2rem; margin-bottom: 1.25rem; }
.gx-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--gx-line);
  border-radius: 999px;
  padding: .6rem 2.4rem .6rem 1.1rem;
  color: var(--gx-ink);
  font: 800 1.05rem var(--gx-display);
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffcf5c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 1rem center / 12px 8px;
}
.gx-select option { color: #111; background: #fff; }
.gx-budget { font: 800 clamp(1.4rem, 4vw, 1.8rem)/1 var(--gx-display); font-variant-numeric: tabular-nums; }
.gx-budget-note { display: block; font-size: .8rem; color: var(--gx-mute); margin-top: .3rem; }

/* The wallet rides along the top of the screen while you shop. */
.gx-wallet {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-bottom: 1.25rem;
  padding: .7rem 0;
  background: rgba(11, 16, 32, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--gx-line);
  border-bottom: 1px solid var(--gx-line);
}
.gx-wallet-in { display: flex; align-items: center; gap: .75rem 1.25rem; }
.gx-left { font: 800 clamp(1.6rem, 6vw, 2.2rem)/1 var(--gx-display); color: var(--gx-green); font-variant-numeric: tabular-nums; }
.gx-broke .gx-left { color: var(--gx-red); }
.gx-meter { flex: 1; height: .7rem; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; min-width: 3rem; }
.gx-meter-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gx-gold), #ff8a5c); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.gx-broke .gx-meter-fill { background: var(--gx-red); }
.gx-wallet-count { font-size: .8rem; color: var(--gx-mute); white-space: nowrap; }
.gx-wallet-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--gx-line);
  color: var(--gx-ink);
  font: 800 .85rem/1 var(--gx-display);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s, color .15s;
}
.gx-wallet-link strong { font: 800 1.05rem var(--gx-display); color: var(--gx-ink); }
.gx-wallet-link:hover {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
  transform: translateY(-1px);
}
.gx-wallet-link.gx-wallet-has-items {
  background: rgba(255, 207, 92, .15);
  border-color: rgba(255, 207, 92, .4);
  color: var(--gx-gold);
}
.gx-wallet-link.gx-wallet-has-items strong { color: var(--gx-gold); }

.gx-cat { margin-bottom: 1.15rem; }
.gx-cat-title { font: 800 .8rem/1 var(--gx-display); letter-spacing: .16em; text-transform: uppercase; color: var(--gx-gold); margin: 0 0 .6rem; }
.gx-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.gx-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .3rem .4rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--gx-line);
  background: rgba(255, 255, 255, .045);
  transition: background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
}
.gx-item.gx-in {
  border-color: var(--gx-gold);
  background: linear-gradient(180deg, rgba(255, 207, 92, .16), rgba(255, 207, 92, .04));
  box-shadow: 0 0 0 2px rgba(255, 207, 92, .2);
}
.gx-item-add {
  appearance: none;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .55rem .2rem .45rem;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--gx-ink);
  transition: transform .15s;
}
.gx-item-add:hover { transform: translateY(-2px); }
.gx-item-add:active { transform: scale(.96); }
.gx-item.gx-cant:not(.gx-in) .gx-item-add { opacity: .4; }
.gx-emoji { font-family: var(--gx-emoji); font-size: 2.5rem; line-height: 1.1; }
.gx-badge {
  position: absolute;
  top: .2rem;
  right: .35rem;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--gx-gold);
  color: #1d1400;
  font: 800 .8rem/1.6rem var(--gx-display);
  animation: gxBadgeIn .18s cubic-bezier(.175, .885, .32, 1.275);
}
@keyframes gxBadgeIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.gx-item-name { font: 800 .9rem/1.1 var(--gx-display); text-align: center; }
.gx-item-sub { font-size: .7rem; line-height: 1.2; color: var(--gx-mute); text-align: center; }
.gx-item-price { font-size: .75rem; color: var(--gx-mute); font-variant-numeric: tabular-nums; }
.gx-stepper { display: flex; align-items: center; gap: .3rem; margin: .2rem 0 .3rem; }
.gx-step {
  appearance: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--gx-line);
  background: rgba(255, 255, 255, .07);
  color: var(--gx-ink);
  font: 800 1.15rem/1 var(--gx-display);
  transition: transform .1s, background-color .15s, color .15s;
}
.gx-step:not(:disabled):hover {
  background: rgba(255, 255, 255, .15);
  color: var(--gx-gold);
}
.gx-step:not(:disabled):active {
  transform: scale(.92);
}
.gx-step:disabled { opacity: .3; }
.gx-qty {
  width: 4.2rem;
  height: 2.1rem;
  border-radius: 10px;
  border: 1px solid var(--gx-line);
  background: rgba(0, 0, 0, .25);
  color: var(--gx-ink);
  text-align: center;
  font: 800 1rem var(--gx-display);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.gx-qty::-webkit-outer-spin-button, .gx-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gx-more { font-size: .7rem; color: var(--gx-mute); font-variant-numeric: tabular-nums; }
.gx-shake { animation: gxShake .4s; }
@keyframes gxShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.gx-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.25rem; }
.gx-actions-top { justify-content: flex-start; margin-top: 0; margin-bottom: 1.25rem; }
.gx-btn { appearance: none; border-radius: 999px; padding: .8rem 1.35rem; font: 800 1rem var(--gx-display); border: 1px solid transparent; transition: transform .15s, opacity .15s, box-shadow .15s; }
.gx-btn:hover { transform: translateY(-2px); }
.gx-btn:disabled { opacity: .4; transform: none; }
.gx-btn-gold { background: var(--gx-gold); color: #1d1400; box-shadow: 0 4px 14px rgba(255, 207, 92, .25); }
.gx-btn-gold:hover { box-shadow: 0 6px 20px rgba(255, 207, 92, .38); }
.gx-btn-ghost { background: rgba(255, 255, 255, .08); color: var(--gx-ink); border-color: var(--gx-line); }

/* The receipt: also the shareable image. No background-clip text in here
   (html2canvas can't draw it). */
.gx-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 1.6rem 1.4rem 1.2rem;
  background: linear-gradient(160deg, #20296a, #111633 70%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.gx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.gx-back-shop {
  color: var(--gx-mute);
  font: 700 .76rem var(--gx-display);
  text-decoration: none;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--gx-line);
  transition: color .15s, background-color .15s, border-color .15s, transform .15s;
}
.gx-back-shop:hover {
  color: var(--gx-ink);
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .25);
  transform: translateY(-1px);
}
.gx-tag {
  display: inline-block;
  font: 800 .72rem var(--gx-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gx-gold);
  background: rgba(255, 207, 92, .1);
  border: 1px solid rgba(255, 207, 92, .3);
  border-radius: 999px;
  padding: .4rem .85rem;
}
.gx-receipt-title { font: 800 clamp(1.5rem, 5vw, 2rem)/1.1 var(--gx-display); letter-spacing: -.02em; margin: .8rem 0 .6rem; color: var(--gx-ink); }
.gx-strip { display: flex; flex-wrap: wrap; gap: .1rem .2rem; font-family: var(--gx-emoji); font-size: 1.7rem; line-height: 1.2; margin-bottom: .6rem; }
.gx-strip:empty { display: none; }
.gx-lines { list-style: none; margin: 0 0 .9rem; padding: 0; border-top: 1px dashed rgba(255, 255, 255, .2); }
.gx-lines li {
  display: grid;
  grid-template-columns: 1.9rem auto 1fr auto;
  align-items: baseline;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .2);
}
.gx-l-e { font-family: var(--gx-emoji); font-size: 1.25rem; }
.gx-l-q { font: 800 1rem var(--gx-display); color: var(--gx-gold); font-variant-numeric: tabular-nums; }
.gx-l-n { color: var(--gx-ink); }
.gx-l-a { font: 800 1rem var(--gx-display); font-variant-numeric: tabular-nums; }
.gx-lines .gx-empty { display: block; color: var(--gx-mute); text-align: center; padding: 1rem 0; }
.gx-totals { margin: 0 0 .9rem; }
.gx-totals div { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; color: var(--gx-mute); }
.gx-totals dt { font-weight: 400; }
.gx-totals dd { margin: 0; font: 800 1rem var(--gx-display); color: var(--gx-ink); font-variant-numeric: tabular-nums; }
.gx-totals .gx-total-left dd { font-size: 1.35rem; color: var(--gx-green); }
.gx-totals .gx-total-left.gx-over dd { color: var(--gx-red); }
.gx-invest {
  margin-bottom: .8rem;
  padding: .6rem .85rem;
  border-radius: 12px;
  background: rgba(62, 224, 143, .1);
  color: var(--gx-ink);
  font-size: .9rem;
}
.gx-invest strong { color: var(--gx-green); }
.gx-caveat {
  display: inline-block;
  padding: .45rem .85rem;
  border-radius: 10px;
  background: rgba(255, 207, 92, .1);
  color: var(--gx-gold);
  font: 700 .85rem/1.3 var(--gx-display);
}
.gx-barcode {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 .5rem;
  color: var(--gx-ink);
  opacity: .32;
}
.gx-barcode svg {
  width: 150px;
  height: 24px;
}
.gx-credit { margin-top: .6rem; text-align: center; font: 800 .74rem var(--gx-display); letter-spacing: .1em; color: rgba(255, 255, 255, .45); }

.gx-lvl:focus-visible, .gx-mode:focus-visible, .gx-item-add:focus-visible, .gx-step:focus-visible,
.gx-qty:focus-visible, .gx-btn:focus-visible, .gx-select:focus-visible { outline: 3px solid var(--gx-gold); outline-offset: 3px; }

/* ---------- Below the board ---------- */
.gx-notes { max-width: 760px; }
.gx-door {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--bs-border-color);
  color: inherit;
  text-decoration: none;
  font: 800 1.1rem var(--gx-display);
  transition: transform .15s, border-color .15s;
}
.gx-door:hover { transform: translateY(-2px); border-color: var(--bs-primary); }
.gx-door small { display: block; font: 400 .85rem var(--bs-body-font-family); color: var(--bs-secondary-color); }

@media (max-width: 575.98px) {
  .gx-scorecard { padding: 1.25rem 1.15rem 1.1rem; border-radius: 20px; }
  .gx-wallet-in { gap: .5rem .75rem; }
  .gx-wallet-link { padding: .25rem .55rem; font-size: .75rem; }
  /* Phones: 2-column vertical grid for smooth, natural scanning. */
  .gx-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .55rem;
  }
  .gx-item {
    padding: .3rem .3rem .55rem;
    min-width: 0;
  }
  .gx-emoji { font-size: 2.1rem; }
  .gx-qty { width: 3.4rem; height: 1.95rem; font-size: .95rem; }
  .gx-step { width: 1.95rem; height: 1.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-fill-now, .gx-fill-gap, .gx-meter-fill, .gx-lvl, .gx-mode, .gx-item, .gx-item-add, .gx-btn, .gx-door { transition: none; }
  .gx-shake { animation: none; }
}
/* While html2canvas clones the receipt: no box-shadow (it paints the inset
   highlight as a translucent slab) and normal letter-spacing (negative
   spacing splits digits apart). */
.gx-capture { box-shadow: none; }
.gx-capture .gx-receipt-title { letter-spacing: normal; }
.gx-capture .gx-back-shop { display: none !important; }
