/* Guess
   The "guess how many" jar from a village fete or an old sweet shop: a glass jar with a navy enamel lid on a mahogany
   counter holds exactly one hundred sweets, so the sweets in it are the price of Yes in cents; a printed show-card
   beside it has the two guesses written in by hand. The page takes its materials from that counter: limewash for the
   ground, a paler card for every panel, dark ink for every edge, the show-card (manila with a printed navy double
   border) for the ticket and the dialogs, the navy of the lid for the active tab and the pressed segments, and an amber
   boiled sweet for every button you press (glossy, with a dark caramel edge). Bottle green is Yes, tomato red is No.
   Headlines and big figures in Castoro (lining figures), the wordmark in Castoro Titling, guesses written in Gochi Hand,
   everything you read in Rosario, Libertinus Mono only for addresses. Loaded after /styles.css, which gives the layout;
   this file only gives the look. The token names below are also read by app.js for the charts, so they stay hex. */
:root {
  --ink-0: #efe7d7; --ink-1: #e5dccb; --ink-2: #d6cbb5; --ink-3: #a5998a;
  --paper: #fbf7ee;
  --line: #241a14; --line-soft: #ddd2bf; --ink: #241a14;
  --fg: #241a14; --muted: #685a4b; --dim: #978a7a;
  --a: #1f6b4a; --a-soft: rgba(31, 107, 74, .1);
  --b: #c0392b; --b-soft: rgba(192, 57, 43, .1);
  --lev: #241a14; --lev-soft: rgba(36, 26, 20, .08);
  --up: #1f6b4a; --down: #c0392b; --down-soft: rgba(192, 57, 43, .08);
  --gold: #e8952a; --gold-hi: #f7c164; --gold-lo: #c46f14; --gold-edge: #6e3a0c; --wine: #23324d; --manila: #f4e3b6;
  --display: "Castoro", "Iowan Old Style", Georgia, serif;
  --titling: "Castoro Titling", "Castoro", Georgia, serif;
  --hand: "Gochi Hand", "Bradley Hand", cursive;
  --sans: "Rosario", "Gill Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Rosario", "Gill Sans", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Guess uses its sans */
  --addr: "Libertinus Mono", ui-monospace, Menlo, monospace;
  --edge: 1.5px solid var(--line);
  --hair: 1px solid var(--line-soft);
  /* the show-card: manila with a printed navy double border inside its edge */
  --plate: inset 0 0 0 6px var(--manila), inset 0 0 0 8.2px var(--wine), inset 0 0 0 10.5px var(--manila), inset 0 0 0 11.3px var(--wine);
  --shadow: 0 1px 0 rgba(36, 26, 20, .05), 0 18px 32px -24px rgba(60, 40, 24, .45);
  --r: 4px;
  color-scheme: light;
}
body { background: radial-gradient(120% 80% at 20% 0%, #f7f1e4 0%, rgba(247, 241, 228, 0) 60%), var(--ink-0); color: var(--fg); font: 450 15.5px/1.5 var(--sans); }
::selection { background: #f7cf8f; color: var(--fg); box-shadow: none; }

/* type: a warm old-style serif for headlines and figures (like the printed show-card), a calm humanist sans for the rest */
h2, h3, .h { font: 700 14px/1.2 var(--sans); letter-spacing: 0; color: var(--fg); text-transform: none; }
h1 { font: 400 clamp(27px, 2.5vw, 37px)/1.12 var(--display); letter-spacing: -.005em; text-transform: none; font-variant-numeric: lining-nums; }
.num, .sum-stats dd, .pos-grid dd, .tbl td.r, .kv dd { font-family: var(--sans); font-weight: 650; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.hint, .empty, .stage-empty, .empty-state p { font-family: var(--sans); color: var(--muted); }

/* the split-flap tiles become plain serif figures that drop into place when they change, like a sweet into the jar */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 400 var(--ff, 22px)/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.flaps > b.sp { width: .28em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: unfold .42s cubic-bezier(.25, .8, .25, 1); }
@keyframes unfold { 0% { opacity: 0; transform: translateY(-.45em); } 70% { transform: translateY(.04em); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: card paper with the lid's navy as a band along its foot */
.top { background: var(--paper); border-bottom: 4px solid var(--wine); box-shadow: 0 1.5px 0 0 #efe3c4 inset, 0 -1.5px 0 0 #efe3c4 inset; }
.logo { gap: 10px; padding-right: 24px; font: 400 27px/1 var(--titling); letter-spacing: .06em; color: var(--fg); }
.logo span { padding-top: 3px; }
.logo .mark { width: 38px; height: 38px; }
.tabs { gap: 2px; }
.tabs a { border-radius: 0; padding: 0 14px; font: 600 15px var(--sans); color: var(--muted); }
.tabs a:hover { background: var(--ink-0); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: linear-gradient(var(--wine), var(--wine)) 50% calc(100% - 9px) / calc(100% - 24px) 3px no-repeat; }
.tabs b { font-family: var(--sans); font-weight: 750; color: var(--wine); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 400 22px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.net { color: var(--muted); }

/* controls: ink edges; the buttons you press are an amber boiled sweet: glossy, dark caramel letters and edge */
.btn { border: var(--edge); border-radius: var(--r); font: 650 14.5px var(--sans); background: var(--paper); color: var(--fg); box-shadow: inset 0 -2px 0 var(--ink-2); transition: transform .08s, box-shadow .08s, background-color .15s; }
.btn:hover:not(:disabled) { background: var(--ink-0); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary { background: radial-gradient(90% 70% at 30% 10%, #ffe2a8 0%, rgba(255, 226, 168, 0) 60%), linear-gradient(180deg, var(--gold-hi), var(--gold) 52%, var(--gold-lo)); color: #2a1408; border-color: var(--gold-edge); font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, .8), inset 0 -3px 0 rgba(110, 58, 12, .35), 0 3px 0 0 var(--gold-edge); }
.btn.primary:hover:not(:disabled) { background: radial-gradient(90% 70% at 30% 10%, #ffe9bb 0%, rgba(255, 233, 187, 0) 60%), linear-gradient(180deg, #f9cb78, #eea33c 52%, #cf7a1c); }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 240, 210, .6), inset 0 -1px 0 rgba(110, 58, 12, .35), 0 1px 0 0 var(--gold-edge); }
.btn.cta { border: 1.5px solid var(--gold-edge); border-radius: 6px; min-height: 60px; font: 400 26px/1 var(--display); letter-spacing: 0; color: #2a1408; border-radius: 14px;
  background: radial-gradient(60% 55% at 26% 18%, #fff0cc 0%, rgba(255, 240, 204, 0) 70%), linear-gradient(180deg, #f8c46a 0%, var(--gold) 50%, var(--gold-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 244, 220, .75), inset 0 -5px 0 rgba(110, 58, 12, .32), 0 5px 0 0 var(--gold-edge), 0 8px 12px -4px rgba(60, 40, 24, .45); }
.btn.cta:hover:not(:disabled) { filter: none; background: radial-gradient(60% 55% at 26% 18%, #fff4d8 0%, rgba(255, 244, 216, 0) 70%), linear-gradient(180deg, #fbcd7c 0%, #eea33c 50%, #cf7a1c 100%); }
.btn.cta:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 244, 220, .5), inset 0 -2px 0 rgba(110, 58, 12, .32), 0 1px 0 0 var(--gold-edge); }
.btn.cta:disabled { background: var(--ink-1); color: var(--dim); border-color: var(--ink-3); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink-2); }
.btn.ghost { background: var(--paper); box-shadow: none; border-color: var(--ink-3); }
.btn.ghost:active:not(:disabled) { transform: none; }
.btn.small { box-shadow: none; border-width: 1px; }
.seg { border: var(--edge); border-radius: var(--r); padding: 2px; background: var(--paper); }
.seg button { border-radius: 3px; font: 650 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--wine); color: var(--paper); box-shadow: none; }
input:not([type="range"]), select { background: var(--paper); border: 1px solid var(--ink-3); border-radius: var(--r); font-family: var(--sans); font-weight: 550; }
input:not([type="range"]):hover, select:hover { border-color: var(--fg); }
input:not([type="range"]):focus-visible, select:focus-visible { outline: 2px solid var(--wine); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--wine); }
.chips button { font: 650 13px var(--sans); border-radius: var(--r); border: 1px solid var(--ink-3); background: var(--paper); }
.chips button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: var(--paper); }

/* market list */
.mk { border-right: var(--edge); background: var(--paper); }
.mk-head { border-bottom: var(--hair); }
.mk-row { border-bottom: var(--hair); }
.mk-row:hover { background: #f6f1e3; }
.mk-row[aria-current="true"] { background: #f2ead6; box-shadow: inset 4px 0 0 var(--gold), inset 5px 0 0 var(--gold-edge); }
.mk-q { font: 600 15px/1.3 var(--sans); letter-spacing: -.005em; }
.mk-meta { font: 550 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 400 17px/1.15 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.mk-px .pa { color: var(--a); } .mk-px .pb { color: var(--b); }
/* the split bar under each market: green for Yes, red for No, ruled in ink */
.mk-split { height: 5px; border-radius: 0; background: var(--b); box-shadow: 0 0 0 1px rgba(36, 26, 20, .55); } .mk-split i { background: var(--a); border-radius: 0; box-shadow: 1px 0 0 var(--paper); }
.thumb { border-radius: 3px; }
.thumb.tile { font-family: var(--display); font-weight: 400; border: var(--edge); }
.legal { color: var(--muted); font: 450 12.5px/1.55 var(--sans); }

/* the two sides: paper cards; the one you picked takes its colour */
.duel { gap: 12px; border: 0; background: transparent; box-shadow: none; }
.duel-side { border: var(--edge); border-radius: var(--r); background: var(--paper); padding: 16px 20px 18px; box-shadow: inset 0 -3px 0 var(--ink-2); transition: background-color .18s, color .18s, transform .08s; }
.duel-side:hover { background: #fffdf6; }
.duel-side:active { transform: translateY(1px); }
.duel-name { font: 700 15px var(--sans); }
.duel-side.a .duel-name { color: var(--a); } .duel-side.b .duel-name { color: var(--b); }
.duel-side.a[aria-pressed="true"] { background: var(--a); border-color: #0f3f2a; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), inset 0 0 0 3px var(--a), inset 0 0 0 4px rgba(255, 250, 235, .35); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #7a1d14; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), inset 0 0 0 3px var(--b), inset 0 0 0 4px rgba(255, 250, 235, .35); }
.duel-side[aria-pressed="true"], .duel-side[aria-pressed="true"] .duel-name, .duel-side[aria-pressed="true"] .lev,
.duel-side[aria-pressed="true"] .duel-price.flaps > b { color: var(--paper); }
.duel-price.flaps { --ff: 48px; }
.duel-price.flaps > b { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.duel-side .lev { font: 600 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 700 12.5px var(--sans); color: var(--muted); box-shadow: none; }

/* the counter with the jar and the show-card under the two sides */
.gsz { margin-top: 14px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1.5px var(--line), var(--shadow); background: var(--ink-0); }
.gsz svg { display: block; width: 100%; height: auto; }
.gsz.wait { width: min(460px, 86vw); margin: 0 0 22px; }

.chart-panel, .stage-row, .more { border-top: var(--hair); }
.panel { border-radius: var(--r); }
.room-num strong { font: 400 33px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.meter { height: 6px; border-radius: 0; background: var(--ink-2); box-shadow: 0 0 0 1px rgba(36, 26, 20, .4); } .meter i { background: var(--gold); border-radius: 0; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.side-pick { gap: 8px; border: 0; }
.side-pick button { border: var(--edge); border-radius: var(--r); padding: 10px 12px; background: var(--paper); }
.side-pick button span { font: 700 14px var(--sans); }
.side-pick button small { font: 400 21px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.side-pick .a[aria-pressed="true"] { background: var(--a); border-color: #0f3f2a; color: var(--paper); }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #7a1d14; color: var(--paper); }
/* the ticket's board: the show-card, manila with its printed navy double border; the figures on it are written in */
.tboard { gap: 10px; padding: 24px 22px 22px; border: 1px solid #b49a5e; border-radius: 5px; background: var(--manila); box-shadow: var(--plate), 0 6px 12px -10px rgba(60, 40, 24, .5); }
.tboard .flaps > b { font: 400 calc(var(--ff, 22px) * 1.15)/1 var(--hand); }
.tboard span { font: 600 13px var(--sans); color: var(--muted); }
.tboard .flaps { --ff: 28px; }
.tboard .flaps.am > b, .flaps.am > b { color: var(--fg); }
#tk-margin { font: 400 28px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.quick { gap: 6px; border: 0; }
.quick button { border: 1px solid var(--ink-3); border-radius: var(--r); font: 650 15px var(--sans); font-variant-numeric: lining-nums tabular-nums; background: var(--paper); }
.quick button:hover { border-color: var(--fg); background: var(--ink-0); }
.lev-head output { font: 400 42px/1 var(--display); letter-spacing: -.01em; color: var(--fg); font-variant-numeric: lining-nums; }
/* the leverage slider: an ink rule filled up to your leverage; the thumb is an amber boiled sweet */
#tk-lev::-webkit-slider-runnable-track { height: 8px; border-radius: 0; border: 1px solid var(--line); background: linear-gradient(var(--fg), var(--fg)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 0 0 / calc(var(--m) * 100%) 100% no-repeat, #f3ecda; }
#tk-lev::-moz-range-track { height: 8px; border-radius: 0; border: 1px solid var(--line); background: linear-gradient(var(--fg), var(--fg)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 0 0 / calc(var(--m) * 100%) 100% no-repeat, #f3ecda; }
#tk-lev::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; border: 1.5px solid var(--line); border-radius: 50%; background: radial-gradient(circle at 36% 30%, #fff3d6 0 12%, #f7c164 26%, var(--gold) 55%, #9a520c 100%); box-shadow: 0 2px 3px rgba(36, 26, 20, .4); }
#tk-lev::-moz-range-thumb { width: 24px; height: 24px; border: 1.5px solid var(--line); border-radius: 50%; background: radial-gradient(circle at 36% 30%, #fff3d6 0 12%, #f7c164 26%, var(--gold) 55%, #9a520c 100%); box-shadow: 0 2px 3px rgba(36, 26, 20, .4); }
.lev-ticks { font: 650 13px var(--sans); font-variant-numeric: lining-nums; } .lev-ticks span.off { color: var(--ink-3); }
.rw-track { height: 6px; border-radius: 0; } .rw-fill { background: var(--ink-3); } .rw-now { background: var(--fg); }
.kv { border-top: var(--hair); } .kv > div { border-bottom: var(--hair); }
.err { border-left: 3px solid var(--down); background: var(--down-soft); border-radius: 2px; }

/* account pages */
.summary { border-bottom: 1.5px solid var(--line); }
.sum-main span { font: 600 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 400 clamp(50px, 7vw, 100px)/1 var(--display); letter-spacing: -.015em; font-variant-numeric: lining-nums tabular-nums; }
.pos { background: var(--paper); border: var(--edge); border-radius: var(--r); box-shadow: inset 0 -3px 0 var(--ink-2); }
.pos-out { font: 700 12.5px var(--sans); }
.empty-state { border: 1px solid #b49a5e; border-radius: 5px; background: var(--manila); box-shadow: var(--plate); }
.empty-state .es-mark { width: 64px; height: 64px; margin-bottom: 6px; }
.empty-state b { font: 400 27px var(--display); }
.tbl th { border-bottom: var(--edge); font: 650 12.5px var(--sans); color: var(--fg); }
.tbl td { border-bottom: var(--hair); }
.mid-num { font: 400 48px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.big-num { font-family: var(--display); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.addr { border: 1px solid var(--ink-3); border-radius: var(--r); background: var(--paper); font-family: var(--addr); font-size: 13px; }
.pick { border: 1px solid #b49a5e; border-radius: 5px; box-shadow: var(--plate), 0 30px 60px -20px rgba(60, 40, 24, .55); background: var(--manila); }
.pick::backdrop { background: rgba(36, 26, 20, .42); }
.pick-item { font: 600 18px/1.2 var(--sans); border-radius: var(--r); }
.pick-item:hover, .pick-item:focus-visible { background: var(--ink-0); color: var(--fg); }
.toast { background: var(--fg); color: var(--paper); border-left: 5px solid var(--gold); border-radius: var(--r); font: 550 15px var(--sans); }

/* loading: the jar fills from empty while the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: italic 400 26px var(--display); color: var(--fg); }
.stage-empty #load-count { font-family: var(--sans); font-weight: 650; font-variant-numeric: tabular-nums; }
.ld-track { display: none; }
.sk { background: linear-gradient(90deg, var(--ink-1), var(--ink-2), var(--ink-1)); background-size: 200% 100%; border-radius: 2px; }

/* the pointer */
.cur-dot { background: var(--fg); }
.cur-box { border: 1.5px solid var(--fg); border-radius: var(--r); }
#cur.go .cur-box { border-color: var(--gold-edge); }

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 400 19px var(--titling); letter-spacing: .04em; color: var(--fg); box-shadow: none; }
.coin-ca { font: 400 13px var(--addr); color: var(--muted); }
.coin-ca:hover, .coin-pump:hover { background: var(--ink-0); color: var(--fg); }
.coin-pump { font: 650 13px var(--sans); color: var(--muted); }

@media (max-width: 760px) {
  .coin { border-top: var(--hair); }
  .logo { font-size: 22px; padding-right: 12px; } .logo .mark { width: 30px; height: 30px; }
  .duel-price.flaps { --ff: 30px; }
  .tabs a { padding: 12px 14px; }
  .tabs a[aria-current="page"] { background-position: 50% calc(100% - 4px); }
  .bal strong { font-size: 18px; } .bal span { font-size: 10.5px; }
  .acct .btn, .seg button { padding-left: 10px; padding-right: 10px; }
  .duel-side { padding: 13px 14px; }
  .gsz { margin-top: 10px; }
  h1 { font-size: 24px; }
}

/* the base layout sets labels in spaced capitals; Guess writes them as words */
h2, h3, .h, .tabs a, .net, .bal span, .seg button, .field label, .chips button, .stage-empty, .stage-empty p, #st-cat, .duel-name,
.side-pick button span, .sum-main span, .pos-out, .tbl th, .eyebrow, .pick-go, h1, .btn, .mk-meta, .duel-side .lev,
.tboard span, .empty-state b, .coin-pump {
  text-transform: none; letter-spacing: 0; }
.net, .stage-empty { font-family: var(--sans); font-weight: 600; }
.field label, .eyebrow, .pick-go { font: 650 13px var(--sans); }

/* Live mode: before a wallet is connected the main button reads "Connect a wallet to trade". In the display face
   that line is wider than a phone, so the button may wrap and the bar never grows past the screen. The bar behind it
   is solid, so a message above the button never sits on the figures scrolling under it. */
.cta-bar { grid-template-columns: minmax(0, 1fr); background: var(--paper); box-shadow: 0 -1px 0 var(--line-soft); }
.cta-bar > * { min-width: 0; }
.btn.cta, .btn.cta:disabled { text-transform: none; letter-spacing: 0; white-space: normal; text-wrap: balance; line-height: 1.12; padding-top: 10px; padding-bottom: 14px; }
.btn.cta:disabled { color: var(--muted); }
