/* ==========================================================================
   功夫牛牛 — 猜界 GUESSX (prediction market)

   House style, taken from the 德州扑克 lobby rather than invented: a royal-
   purple radial ground, art on the right fading into it, a gold-gradient title,
   a gold hairline inset on every framed panel, and gold for every figure that
   matters. The stakeholder's cover art is teal; it is kept, and framed so it
   dissolves into the purple instead of fighting it.

   Numbers are the content: gold, 700+, tabular-nums. Small text never uses
   --text-dim/--text-mute below 14px (kfnn-brand) — it uses --text-2.

   OUTCOME COLOURS. Jade for the first outcome, cinnabar for the second, as in
   the stakeholder's own "YES / NO" art. They are never the ONLY signal — every
   outcome carries its text label — so the screen works for a colourblind reader.

   No urgency anywhere: no ticking counter, no "only N left", no pulsing CTA.
   ========================================================================== */

.gx-hall, .gx-market, .gx-sheet {
  --gx-yes: #3ECF8E;
  --gx-yes-dim: rgba(62, 207, 142, .14);
  --gx-yes-line: rgba(62, 207, 142, .42);
  --gx-no: #F27A6A;
  --gx-no-dim: rgba(242, 122, 106, .14);
  --gx-no-line: rgba(242, 122, 106, .42);
  --gx-gold: #E6B446;
  --gx-gold-hi: #FADC96;
  --gx-gold-deep: #BE8C50;
  --gx-gold-grad: linear-gradient(160deg, #FADC96, #E6B446 45%, #BE8C50);
  --gx-frame: inset 0 0 0 1px rgba(230, 180, 70, .16);
  --gx-panel: linear-gradient(180deg, rgba(58, 22, 88, .55), rgba(33, 11, 55, .92));
  --gx-felt-hi: #4a1a6b;
  --gx-felt: #2c0b42;
  --gx-felt-lo: #16031f;
}

.gx-hall { padding: 0 16px 28px; }
.gx-market { padding: 6px 16px 28px; display: flex; flex-direction: column; gap: 12px; }

/* --- hero (the 德州扑克 treatment) ----------------------------------------- */

.gx-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 188px;
  padding: 20px 18px;
  margin: 12px 0 16px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, var(--gx-felt-hi), var(--gx-felt) 55%, var(--gx-felt-lo));
  border: 1px solid var(--border-strong);
  box-shadow: var(--gx-frame), 0 10px 30px rgba(0, 0, 0, .35);
}
/* The art sits right and fades into the purple on two edges, which is also
   what keeps its teal from fighting the royal-purple ground. */
.gx-hero-img {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 66%; height: 100%;
  object-fit: cover; object-position: 62% 30%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 48%), linear-gradient(#000 76%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 48%), linear-gradient(#000 76%, transparent);
  mask-composite: intersect;
  filter: saturate(.9) hue-rotate(12deg);
  opacity: .92;
}
.gx-hero-text { position: relative; z-index: 2; width: 60%; }
.gx-hero-text h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .5px;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
.gx-mark {
  background: var(--gx-gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 1.5px;
  text-shadow: none;
}
.gx-hero-text p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.gx-hero-rules {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; margin-top: 12px; padding: 0 15px;
  border-radius: var(--r-pill);
  background: rgba(230, 180, 70, .16);
  border: 1px solid rgba(230, 180, 70, .32);
  color: var(--gx-gold-hi);
  font-size: 13px; font-weight: 700;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.gx-hero-rules:active { transform: scale(.96); background: rgba(230, 180, 70, .26); }
.gx-hero-locked .gx-hero-img { opacity: .5; filter: saturate(.5); }

/* --- tabs + chips ------------------------------------------------------- */

/* A segmented control: one track, a gold pill under the active tab. */
.gx-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.gx-tab {
  flex: 1; min-width: 0; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 6px;
  border-radius: calc(var(--r-lg) - 4px);
  color: var(--text-2);
  font-size: 14px; font-weight: 700; text-align: center; line-height: 1.2;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.gx-tab.on {
  background: var(--gx-gold-grad);
  color: #2A1A05;
  box-shadow: 0 4px 14px rgba(230, 180, 70, .25), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* Duration row: how soon the result comes. The fast bands carry a ⚡ in gold
   so "I want a result today" is one tap and easy to spot. */
.gx-horizon {
  display: flex; gap: 8px;
  margin: 0 -16px 10px; padding: 0 16px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gx-horizon[hidden] { display: none; }
.gx-horizon::-webkit-scrollbar { display: none; }
.gx-hz-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px; padding: 0 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .18);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.gx-hz-chip.is-fast { color: var(--gx-gold-hi); }
.gx-hz-chip.is-fast svg { color: var(--gx-gold); }
.gx-hz-chip.on { background: var(--gx-gold-grad); border-color: transparent; color: #2A1A05; }
.gx-hz-chip.on svg { color: #2A1A05; }
.gx-hz-chip i {
  font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums;
  min-width: 18px; padding: 1px 6px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08); text-align: center;
}
.gx-hz-chip.on i { background: rgba(42, 26, 5, .18); }

.gx-card-tags { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gx-fast {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 800;
  color: #2A1A05; background: var(--gx-gold-grad);
  border-radius: var(--r-sm); padding: 2px 7px;
}

.gx-cats {
  display: flex; gap: 8px;
  margin: 0 -16px 12px; padding: 0 16px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gx-cats:empty { display: none; }
.gx-cats::-webkit-scrollbar { display: none; }
.gx-cat-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 15px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.gx-cat-chip.on { background: rgba(230, 180, 70, .14); border-color: rgba(230, 180, 70, .55); color: var(--gx-gold-hi); }
.gx-cat-chip i {
  font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums;
  min-width: 18px; padding: 1px 6px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08); text-align: center;
}
.gx-cat-chip.on i { background: rgba(230, 180, 70, .25); }

/* --- market card -------------------------------------------------------- */

.gx-list { display: flex; flex-direction: column; gap: 12px; }

.gx-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  background: var(--gx-panel);
  border: 1px solid var(--border);
  box-shadow: var(--gx-frame), 0 6px 18px rgba(0, 0, 0, .22);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.gx-card:active { transform: scale(.99); border-color: var(--border-strong); }
.gx-card.is-refund { opacity: .92; }

.gx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.gx-cat {
  flex: none;
  font-size: 12px; font-weight: 800; letter-spacing: .3px;
  color: var(--gx-gold);
  background: rgba(230, 180, 70, .12);
  border: 1px solid rgba(230, 180, 70, .22);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}
.gx-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--text-2);
  background: rgba(255, 255, 255, .06);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gx-pill-ico { opacity: .85; }
.gx-pill-done { color: var(--gx-gold-hi); background: rgba(230, 180, 70, .14); }
.gx-pill-void { color: var(--text-2); background: rgba(255, 255, 255, .08); }

.gx-card-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; line-height: 1.42; color: var(--text); }
.gx-card-refund {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 4px; font-size: 13px; color: var(--text-2);
}

.gx-bar {
  display: flex; height: 8px; gap: 2px;
  border-radius: var(--r-pill); overflow: hidden;
  background: rgba(255, 255, 255, .06);
}
/* No stakes yet: a neutral track, not a 50/50 nobody placed. */
.gx-bar-empty { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 6px, transparent 6px 10px); }
.gx-bar-seg { transition: width 320ms var(--ease-out); }
.gx-bar-seg:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.gx-bar-seg:last-child { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.gx-bar-seg.gx-seg-0 { background: linear-gradient(90deg, #2fa872, var(--gx-yes)); }
.gx-bar-seg.gx-seg-1 { background: linear-gradient(90deg, var(--gx-no), #d4574a); }
.gx-bar-seg.gx-seg-2 { background: var(--gx-gold-grad); }

.gx-card-odds { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.gx-odds-empty { justify-content: center; font-size: 13px; font-weight: 700; color: var(--text-2); }
.gx-odd { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.gx-odd em {
  font-style: normal; font-size: 13px; font-weight: 700; color: var(--text-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gx-odd b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gx-odd i {
  font-style: normal; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--gx-gold-hi); padding: 1px 6px; border-radius: var(--r-sm); background: rgba(230, 180, 70, .12);
}
.gx-odd-0 b { color: var(--gx-yes); }
.gx-odd-1 b { color: var(--gx-no); }
.gx-card-odds .gx-odd:last-child { flex-direction: row-reverse; }

.gx-card-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 12.5px; color: var(--text-2);
}
.gx-vol { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.gx-vol svg { opacity: .7; }
.gx-card-mine { margin-left: auto; color: var(--gx-gold-hi); font-weight: 800; font-variant-numeric: tabular-nums; }
.gx-card-go { margin-left: auto; color: var(--gx-gold); display: inline-flex; }

.gx-more {
  min-height: 46px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  color: var(--gx-gold-hi);
  font-size: 14px; font-weight: 700;
}

/* --- one market ------------------------------------------------------- */

.gx-m-head {
  padding: 14px;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 0% 0%, rgba(74, 26, 107, .9), rgba(33, 11, 55, .95) 60%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--gx-frame);
}
.gx-m-title { margin: 4px 0 0; font-size: 20px; font-weight: 900; line-height: 1.38; color: var(--text); }
.gx-m-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.gx-m-meta span { display: inline-flex; align-items: center; gap: 5px; }

.gx-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.gx-banner div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gx-banner span { font-size: 12.5px; font-weight: 700; }
.gx-banner b { font-size: 14px; font-weight: 800; color: var(--text); line-height: 1.45; }
.gx-banner-win {
  background: linear-gradient(135deg, rgba(230, 180, 70, .2), rgba(190, 140, 80, .08));
  border-color: rgba(230, 180, 70, .5);
  color: var(--gx-gold);
}
.gx-banner-win b { font-size: 18px; background: var(--gx-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gx-banner-refund { border-color: rgba(255, 255, 255, .14); }

.gx-panel {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--gx-panel);
  border: 1px solid var(--border);
  box-shadow: var(--gx-frame);
}
.gx-panel h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: var(--text); }
.gx-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gx-panel-head h4 { margin: 0; }
.gx-panel-sub { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gx-panel-note {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 12px 0 0; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}

.gx-pool-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.gx-pool-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .04);
}
.gx-pool-row.is-winner { background: rgba(230, 180, 70, .1); box-shadow: inset 0 0 0 1px rgba(230, 180, 70, .45); }
.gx-pool-name { font-size: 15px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-pool-name.gx-seg-0 { color: var(--gx-yes); }
.gx-pool-name.gx-seg-1 { color: var(--gx-no); }
.gx-pool-meta { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gx-pool-pct { font-size: 16px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.gx-pool-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px; color: var(--text-2);
}
.gx-pool-total b { font-size: 19px; font-weight: 900; color: var(--gx-gold); font-variant-numeric: tabular-nums; }

/* The one action: two equal targets, neither the default. */
.gx-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.gx-stake-btn {
  min-height: 60px; padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out);
}
.gx-stake-btn:active { transform: scale(.975); filter: brightness(1.08); }
.gx-stake-btn.gx-seg-0 { background: linear-gradient(180deg, rgba(62, 207, 142, .22), rgba(62, 207, 142, .1)); border-color: var(--gx-yes-line); color: var(--gx-yes); }
.gx-stake-btn.gx-seg-1 { background: linear-gradient(180deg, rgba(242, 122, 106, .22), rgba(242, 122, 106, .1)); border-color: var(--gx-no-line); color: var(--gx-no); }
.gx-stake-label {
  font-size: 16px; font-weight: 900;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gx-stake-mult { font-size: 13px; font-weight: 800; color: var(--gx-gold-hi); font-variant-numeric: tabular-nums; }
.gx-actions-note { margin: -2px 2px 0; font-size: 12px; line-height: 1.5; color: var(--text-2); text-align: center; }

.gx-closed-note {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .04);
  border: 1px dashed var(--border-strong);
  color: var(--text-2); font-size: 14px; font-weight: 700;
}

/* My position: scenarios, then one expandable receipt per stake. */
.gx-scen {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--r-md);
  background: rgba(230, 180, 70, .07);
  border: 1px solid rgba(230, 180, 70, .2);
}
.gx-scen-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.gx-scen-row span { font-weight: 700; }
.gx-scen-row.gx-seg-0 span { color: var(--gx-yes); }
.gx-scen-row.gx-seg-1 span { color: var(--gx-no); }
.gx-scen-row b { font-weight: 900; color: var(--gx-gold-hi); font-variant-numeric: tabular-nums; }
.gx-scen-note { margin: 2px 0 0; font-size: 12px; color: var(--text-2); }

.gx-stake-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gx-stake-item + .gx-stake-item { border-top: 1px solid rgba(255, 255, 255, .06); }
.gx-stake-row {
  width: 100%; min-height: 48px;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 6px 0;
  text-align: left; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums;
}
.gx-stake-row > svg { transition: transform var(--t-fast) var(--ease-out); opacity: .7; }
.gx-stake-item.is-open .gx-stake-row > svg { transform: rotate(180deg); }
.gx-stake-amt { color: var(--text); font-weight: 700; }
.gx-stake-detail { display: none; padding: 0 0 12px; }
.gx-stake-item.is-open .gx-stake-detail { display: block; }

.gx-receipt {
  margin: 0; padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; gap: 7px;
}
.gx-receipt > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gx-receipt dt { font-size: 12.5px; color: var(--text-2); flex: none; }
.gx-receipt dd { margin: 0; font-size: 13px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

.gx-terms dl { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.gx-terms dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.gx-terms dt { font-size: 13px; color: var(--text-2); flex: none; }
.gx-terms dd { margin: 0; font-size: 13px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.gx-terms p { margin: 0 0 12px; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.gx-src { overflow-wrap: anywhere; }
.gx-link { color: var(--gx-gold-hi); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.gx-muted { color: var(--text-2); }

/* --- positions (我的记录) ---------------------------------------------- */

.gx-stats {
  padding: 16px 14px;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 0% 0%, rgba(74, 26, 107, .95), rgba(33, 11, 55, .95) 60%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--gx-frame), 0 8px 22px rgba(0, 0, 0, .25);
}
.gx-stats-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 14px; }
.gx-stats-hero span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.gx-stats-hero b { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gx-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.gx-stats-grid > div {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px; border-radius: var(--r-md); background: rgba(0, 0, 0, .16); text-align: center;
}
.gx-stats-grid span { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.gx-stats-grid b { font-size: 14px; font-weight: 900; color: var(--gx-gold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gx-stats-foot { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--text-2); }

.gx-pos-card {
  border-radius: var(--r-lg);
  background: var(--gx-panel);
  border: 1px solid var(--border);
  box-shadow: var(--gx-frame);
  overflow: hidden;
}
.gx-pos-head {
  width: 100%; min-height: 64px;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  text-align: left; color: inherit;
}
.gx-pos-main { flex: 1; min-width: 0; }
.gx-pos-tags { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.gx-state { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .07); color: var(--text-2); }
.gx-state-won { color: var(--gx-yes); background: var(--gx-yes-dim); }
.gx-state-lost { color: var(--gx-no); background: var(--gx-no-dim); }
.gx-pos-main h4 {
  margin: 0 0 6px; font-size: 14.5px; font-weight: 800; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gx-pos-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gx-pos-right { flex: none; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gx-pos-right > svg { opacity: .7; transition: transform var(--t-fast) var(--ease-out); }
.gx-pos-card.is-open .gx-pos-right > svg { transform: rotate(180deg); }
.gx-pos-body { display: none; padding: 0 14px 14px; }
.gx-pos-card.is-open .gx-pos-body { display: flex; flex-direction: column; gap: 10px; }
.gx-pos-body .gx-panel-note { margin: 0; padding-top: 0; border-top: 0; }
.gx-pos-stake-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.gx-pos-link { align-self: flex-end; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; font-size: 13px; font-weight: 700; color: var(--gx-gold-hi); }

.gx-pos-pick {
  font-size: 13px; font-weight: 800;
  padding: 3px 9px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .07); color: var(--text-2);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gx-pos-pick.gx-seg-0 { background: var(--gx-yes-dim); color: var(--gx-yes); }
.gx-pos-pick.gx-seg-1 { background: var(--gx-no-dim); color: var(--gx-no); }
.gx-pos-win { color: var(--gx-yes); font-weight: 900; }
.gx-pos-win small { display: block; font-size: 11.5px; font-weight: 800; opacity: .85; text-align: right; }
.gx-pos-lose { color: var(--gx-no); font-weight: 900; }
.gx-pos-void, .gx-pos-open { color: var(--text-2); font-weight: 700; }

/* --- stake sheet (inside the shared modal) ------------------------------ */

.gx-sheet { text-align: left; }
.gx-sheet-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: var(--r-md);
  font-weight: 900; font-size: 16px;
}
.gx-sheet-pick.gx-seg-0 { background: var(--gx-yes-dim); color: var(--gx-yes); box-shadow: inset 0 0 0 1px var(--gx-yes-line); }
.gx-sheet-pick.gx-seg-1 { background: var(--gx-no-dim); color: var(--gx-no); box-shadow: inset 0 0 0 1px var(--gx-no-line); }
.gx-sheet-pick-odds { display: inline-flex; align-items: baseline; gap: 8px; }
.gx-sheet-pick-odds em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.gx-sheet-pick-odds b { color: var(--gx-gold-hi); font-variant-numeric: tabular-nums; }

.gx-sheet-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.gx-sheet-field {
  display: flex; align-items: center; gap: 8px;
  height: 54px; padding: 0 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--border-strong);
}
.gx-sheet-field:focus-within { border-color: var(--gx-gold); box-shadow: 0 0 0 3px rgba(230, 180, 70, .18); }
.gx-sheet-cur { font-size: 15px; font-weight: 800; color: var(--gx-gold); }
.gx-sheet-input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--gx-gold-hi); font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.gx-sheet-input.is-bad { color: var(--gx-no); }
.gx-sheet-err { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: var(--gx-no); }

.gx-sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gx-chip {
  min-height: 44px; min-width: 52px; padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.gx-chip:active { transform: scale(.96); border-color: var(--gx-gold); }

.gx-sheet-quote {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  margin-top: 16px; padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(230, 180, 70, .1);
  border: 1px solid rgba(230, 180, 70, .35);
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.gx-sheet-quote b { font-size: 17px; font-weight: 900; color: var(--gx-gold-hi); font-variant-numeric: tabular-nums; }
.gx-sheet-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.gx-sheet-warn { display: flex; align-items: flex-start; gap: 6px; color: var(--gx-gold-hi); }
.gx-sheet-bal { margin: 8px 0 0; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gx-sheet-bal b { color: var(--text); }

/* The confirm button names the amount ("Sahkan pertaruhan RM10.00" in ms), so
   it may wrap instead of overflowing the sheet at 360px (UI/UX audit). */
#modal-actions .gx-confirm { white-space: normal; line-height: 1.2; min-height: 48px; height: auto; padding-top: 8px; padding-bottom: 8px; }

/* --- rules, empty, retry -------------------------------------------------- */

.gx-rules { text-align: left; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.gx-rules p { margin: 0 0 10px; }
.gx-rules ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.gx-rules-note { margin-top: 12px !important; font-size: 13px; }

.gx-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 20px; text-align: center; color: var(--text-2);
}
.gx-empty svg { opacity: .45; }
.gx-empty p { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.gx-empty span { font-size: 13px; }
.gx-retry {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; margin-top: 8px; padding: 0 18px;
  border-radius: var(--r-pill);
  background: rgba(230, 180, 70, .14);
  border: 1px solid rgba(230, 180, 70, .35);
  color: var(--gx-gold-hi); font-size: 14px; font-weight: 800;
}

/* --- lobby card ---------------------------------------------------------------- */

/* The stakeholder's cover art is flat teal beside two purple/gold siblings; a
   royal-purple wash ties it into the row without replacing it. */
#guessx-card .game-card-art-wrap { position: relative; }
#guessx-card .game-card-art-wrap::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(92, 34, 130, .28), rgba(33, 11, 55, .5));
  mix-blend-mode: multiply;
}
#guessx-card .game-card-beta, #guessx-card .game-card-soon { z-index: 1; }

/* --- round-2 review ------------------------------------------------------------ */

/* Hero: a left scrim so a long (ms) subtitle never sits on the art's sign. */
.gx-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(22, 3, 31, .82) 0%, rgba(22, 3, 31, .45) 46%, transparent 72%);
}

/* Settled cards: the winner is marked, the loser dimmed, no odds. */
.gx-odd.is-won b { color: var(--gx-gold); }
.gx-odd.is-won i { background: var(--gx-gold-grad); color: #2A1A05; }
.gx-odd.is-lost { opacity: .45; }

.gx-zero { color: var(--text); }
.gx-scen-row b small { font-size: 12px; font-weight: 800; margin-left: 2px; }
.gx-scen-row b.gx-scen-loss { color: var(--text-2); }

/* Pending result, with the challenge path. */
.gx-proposal { border-color: rgba(230, 180, 70, .4); }
.gx-proposal h4 { display: inline-flex; align-items: center; gap: 6px; }
.gx-proposal-result { margin: 0 0 8px; font-size: 16px; font-weight: 900; color: var(--gx-gold-hi); }
.gx-dispute-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; margin-top: 12px; padding: 0 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border-strong);
  color: var(--text); font-size: 13.5px; font-weight: 700;
}
.gx-dispute-done { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--gx-yes); }
.gx-dispute-text {
  width: 100%; margin-top: 10px; padding: 12px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--border-strong);
  color: var(--text); font-size: 14px; line-height: 1.55; resize: vertical;
}
.gx-dispute-text:focus { outline: 2px solid var(--gx-gold); outline-offset: 1px; }

/* Public change log. */
.gx-revs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gx-revs li { padding: 10px 12px; border-radius: var(--r-md); background: rgba(0, 0, 0, .18); }
.gx-rev-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.gx-rev-head span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.gx-rev-body { margin-top: 4px; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.gx-rev-why { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }

/* Sheet: a tidy 3-column chip grid (six chips wrapped 5+1), and the confirm
   amount on its own line. */
.gx-sheet-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gx-chip { min-width: 0; }
/* .btn is a flex ROW, so display:block on the <small> did nothing and the label
   wrapped beside the amount ("确认下/注" · "RM/300.00") — round-3 UI/UX. Stack them. */
#modal-actions .gx-confirm { flex-direction: column; justify-content: center; gap: 1px; }
#modal-actions .gx-confirm small { display: block; font-size: 12.5px; font-weight: 800; opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The quick-pick chip matching the typed amount. */
.gx-chip.on { background: rgba(230, 180, 70, .16); border-color: rgba(230, 180, 70, .6); color: var(--gx-gold-hi); }

/* When the result comes — the promise the ⚡ filter is built on. */
.gx-card-foot { flex-wrap: wrap; row-gap: 6px; }
.gx-eta { color: var(--gx-gold-hi); font-weight: 700; }

/* My-record filters sit under the stats dashboard. */
.gx-my-filters { margin: 0 -16px; }

/* --- focus + motion ----------------------------------------------------------- */

.gx-card:focus-visible, .gx-tab:focus-visible, .gx-cat-chip:focus-visible, .gx-chip:focus-visible,
.gx-stake-btn:focus-visible, .gx-hero-rules:focus-visible, .gx-retry:focus-visible, .gx-more:focus-visible,
.gx-pos-head:focus-visible, .gx-stake-row:focus-visible, .gx-link:focus-visible, .gx-pos-link:focus-visible {
  outline: 2px solid var(--gx-gold);
  outline-offset: 2px;
}

/* ---- topic banners (server/game/guessx/themes.js) -------------------------
   Every market carries a picture. On a card it bleeds to the card's edges with
   the tags sitting on a scrim; on the market screen it is the hero, fading into
   the header panel so the title reads on the felt, never on the photo. */
.gx-card { overflow: hidden; }
.gx-card-art {
  position: relative;
  margin: -14px -14px 11px;
  height: 108px;
}
.gx-card-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
}
.gx-card-art::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22, 3, 31, .55) 0%, rgba(22, 3, 31, 0) 42%);
  pointer-events: none;
}
.gx-card-art .gx-card-head {
  position: absolute; z-index: 1;
  top: 10px; left: 12px; right: 12px;
  margin: 0;
}
.gx-card-art .gx-cat { background: rgba(22, 3, 31, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gx-card-art .gx-pill { background: rgba(22, 3, 31, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gx-card-art.no-img { height: auto; margin: 0 0 9px; background: none; }
.gx-card-art.no-img::after { content: none; }
.gx-card-art.no-img .gx-card-head { position: static; }
.gx-card.is-refund .gx-card-art img { filter: grayscale(.55) brightness(.85); }

.gx-m-head.has-art { padding: 0; overflow: hidden; }
.gx-m-art { position: relative; height: 176px; }
.gx-m-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
.gx-m-head.is-refund .gx-m-art img { filter: grayscale(.55) brightness(.85); }
.gx-m-head.has-art .gx-m-head-body { position: relative; margin-top: -46px; padding: 0 14px 14px; }
.gx-m-head.has-art .gx-cat,
.gx-m-head.has-art .gx-pill { background: rgba(22, 3, 31, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---- trend chart (public/js/guessx/chart.js) ------------------------------ */
.gx-chart { padding-bottom: 10px; }
.gx-chart-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 22px; }
.gx-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
.gx-chart-key {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); min-width: 0;
}
.gx-chart-key i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.gx-chart-key b { color: var(--text); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gx-chart-key.gx-seg-0 b { color: var(--gx-yes); }
.gx-chart-key.gx-seg-1 b { color: var(--gx-no); }
.gx-chart-when { flex: none; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.gx-chart-plot { margin: 8px -4px 4px; }
.gx-chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gx-chart-grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; stroke-dasharray: 2 4; }
.gx-chart-ylab, .gx-chart-xlab { fill: rgba(255, 255, 255, .62); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gx-chart-ylab { text-anchor: end; }
.gx-chart-cursor { stroke: rgba(250, 220, 150, .55); stroke-width: 1; }
.gx-chart-dot { filter: drop-shadow(0 0 4px rgba(255, 255, 255, .35)); }
.gx-chart-empty {
  display: grid; place-items: center;
  aspect-ratio: 340 / 162;
  font-size: 13px; color: var(--text-2);
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: var(--r-md, 10px);
}
.gx-chart-empty .skeleton { width: 86%; }
.gx-chart-tabs { display: flex; gap: 4px; }
.gx-chart-tab {
  flex: 1;
  min-height: 40px;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.gx-chart-tab.on { color: var(--gx-gold-hi); background: rgba(230, 180, 70, .12); border-color: rgba(230, 180, 70, .4); }
.gx-chart-tab:focus-visible { outline: 2px solid var(--gx-gold); outline-offset: 1px; }

.gx-chart-delta { margin-left: 2px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gx-chart-delta em { font-style: normal; font-weight: 600; opacity: .7; }
.gx-chart-delta.up { color: var(--gx-yes); }
.gx-chart-delta.down { color: var(--gx-no); }
.gx-chart-vol { fill: rgba(230, 180, 70, .38); }
.gx-chart-thin { opacity: .5; }
.gx-chart-mine { fill: var(--gx-felt); stroke: var(--gx-gold-hi); stroke-width: 2; }
.gx-chart-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 2px 6px; }
.gx-chart-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-2); }
.gx-chart-note i { flex: none; width: 14px; height: 0; border-top: 2px dashed rgba(255, 255, 255, .45); }
.gx-chart-note i.mine { width: 8px; height: 8px; border: 2px solid var(--gx-gold-hi); border-radius: 50%; }

.gx-rules-orig { margin: -4px 0 10px; font-size: 12.5px; color: var(--text-2); }
.gx-rules-orig summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; color: var(--gx-gold); font-weight: 700; }
.gx-rules-orig p { margin: 4px 0 0; line-height: 1.6; white-space: pre-line; }

@media (max-width: 370px) {
  .gx-hero-text { width: 66%; }
  .gx-hero-text h2 { font-size: 22px; }
  .gx-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx-pool-row { grid-template-columns: minmax(0, 1fr) auto; }
  .gx-pool-meta { grid-column: 1 / -1; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .gx-bar-seg, .gx-stake-row > svg, .gx-pos-right > svg { transition: none; }
  .gx-card:active, .gx-stake-btn:active, .gx-chip:active, .gx-hero-rules:active { transform: none; }
}
