/* Beadz
   A wooden school abacus lying on an exercise-book page. A hundred lacquered beads make a hundred cents: the beads
   slid to the left are Yes (petrol blue), the beads at the right are No (orange-red). The page is the cream of an
   exercise book with its faint blue rules; panels are a lighter sheet with ink lines. Controls are made of the same
   things as the abacus: the main button is a beech block with ink lettering, the leverage slider is a steel rod with
   a mustard bead on it. Headlines and every figure are set in a wide, heavy grotesque, like the numbers printed in a
   school book.
   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 six-digit hex colours. */
:root {
  --ink-0: #f5efe2; --ink-1: #ece4d3; --ink-2: #e0d6c1; --ink-3: #c2b598;
  --paper: #fdfaf3;
  --line: #1e1b16; --line-soft: #e2d8c4; --ink: #1e1b16;
  --fg: #1e1b16; --muted: #5d5547; --dim: #958a76;
  --a: #1f5f8b; --a-soft: rgba(31, 95, 139, .1);
  --b: #d8572a; --b-soft: rgba(216, 87, 42, .1);
  --lev: #1e1b16; --lev-soft: rgba(30, 27, 22, .08);
  --up: #2c7a46; --down: #c23f22; --down-soft: rgba(194, 63, 34, .09);
  --beech: #c99a5b; --grain: #9c6b34; --rule-blue: #9db7d6; --margin: #d9767a; --mustard: #e2a92b;
  --display: "Anybody", "Arial Black", "Helvetica Neue", sans-serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Beadz uses its grotesque */
  --addr: "Spline Sans Mono", ui-monospace, Menlo, monospace; /* only wallet and contract addresses */
  --edge: 2px solid var(--line);
  --hair: 1px solid var(--line-soft);
  --shadow: 0 1px 0 rgba(30, 27, 22, .05), 0 16px 30px -22px rgba(60, 40, 15, .55);
  --r: 5px;
  color-scheme: light;
}
/* the page is an exercise book: faint blue rules under everything */
body { background: var(--ink-0) repeating-linear-gradient(transparent 0 27px, rgba(157, 183, 214, .38) 27px 28px); color: var(--fg); font: 500 15.5px/1.45 var(--sans); }
::selection { background: var(--mustard); color: var(--fg); }

/* type: a wide heavy face for headlines and every figure, a plain grotesque for everything you read or press */
h2, h3, .h { font: 700 13px/1.2 var(--sans); letter-spacing: .01em; color: var(--fg); text-transform: none; }
h1 { font: 800 clamp(26px, 2.4vw, 38px)/1.06 var(--display); font-stretch: 112%; letter-spacing: -.01em; text-transform: none; }
.num, .sum-stats dd, .pos-grid dd, .tbl td.r, .kv dd { font-family: var(--display); font-weight: 750; font-stretch: 110%; 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 printed figures that slide in like a bead along its rod */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 800 var(--ff, 22px)/1 var(--display); font-stretch: 118%; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.flaps > b.sp { width: .24em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: slide .55s cubic-bezier(.25, .9, .3, 1); }
@keyframes slide { 0% { transform: translateX(-.18em); opacity: .2; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: a clean sheet with the red margin rule of the book along its foot */
.top { background: var(--paper); border-bottom: var(--edge); box-shadow: inset 0 -5px 0 var(--paper), inset 0 -6.5px 0 var(--margin); }
.logo { gap: 10px; padding-right: 24px; font: 850 27px/1 var(--display); font-stretch: 130%; letter-spacing: -.01em; color: var(--fg); }
.logo .mark { width: 38px; height: 38px; }
.tabs { gap: 2px; }
.tabs a { border-radius: 0; padding: 0 14px; font: 700 14.5px var(--sans); color: var(--muted); }
.tabs a:hover { background: var(--ink-1); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: transparent; box-shadow: inset 0 -5px 0 var(--a); }
.tabs b { font-family: var(--display); font-weight: 800; color: var(--b); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 800 22px var(--display); font-stretch: 112%; }
.net { color: var(--muted); }

/* controls: the main button is a block of beech with ink lettering, the rest are sheets with an ink edge */
.btn { border: var(--edge); border-radius: var(--r); font: 700 14px var(--sans); background: var(--paper); color: var(--fg); box-shadow: inset 0 -3px 0 var(--ink-2); transition: transform .08s, box-shadow .08s, background-color .15s; }
.btn:hover:not(:disabled) { background: var(--ink-1); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary, .btn.cta {
  color: var(--fg);
  background:
    repeating-linear-gradient(176deg, rgba(156, 107, 52, 0) 0 5px, rgba(156, 107, 52, .2) 5px 6px, rgba(156, 107, 52, 0) 6px 11px, rgba(156, 107, 52, .12) 11px 12.5px, rgba(156, 107, 52, 0) 12.5px 19px),
    linear-gradient(#e2bd85, #cfa064 45%, #c08d50);
  box-shadow: inset 0 1.5px 0 #f2d6a8, inset 0 -3px 0 #9c6b34; }
.btn.primary:hover:not(:disabled), .btn.cta:hover:not(:disabled) { filter: brightness(1.04); background-color: transparent; }
.btn.cta { border: var(--edge); border-radius: var(--r); min-height: 60px; font: 850 21px/1 var(--display); font-stretch: 125%; letter-spacing: -.005em;
  box-shadow: inset 0 2px 0 #f2d6a8, inset 0 -5px 0 #9c6b34, 0 3px 0 var(--line); }
.btn.cta { text-transform: none; }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 0 #f2d6a8, inset 0 -2px 0 #9c6b34, 0 1px 0 var(--line); }
.btn.cta:disabled { background: var(--ink-2); color: var(--dim); border-color: var(--ink-3); box-shadow: none; filter: none; }
.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: 1.5px; }
.seg { border: var(--edge); border-radius: var(--r); padding: 2px; background: var(--paper); }
.seg button { border-radius: 3px; font: 700 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--paper); box-shadow: none; }
input:not([type="range"]), select { background: var(--paper); border: 1.5px solid var(--ink-3); border-radius: var(--r); font-family: var(--sans); font-weight: 600; }
input:not([type="range"]):hover, select:hover { border-color: var(--fg); }
input:not([type="range"]):focus-visible, select:focus-visible { outline: 3px solid var(--mustard); outline-offset: 0; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--fg); }
.chips button { font: 700 13px var(--sans); border-radius: var(--r); border: 1.5px solid var(--ink-3); background: var(--paper); }
.chips button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--paper); }

/* market list: a clean sheet */
.mk { border-right: var(--edge); background: var(--paper); }
.mk-head { border-bottom: var(--hair); }
.mk-row { border-bottom: var(--hair); }
.mk-row:hover { background: rgba(245, 239, 226, .7); }
.mk-row[aria-current="true"] { background: #f7ecd2; box-shadow: inset 6px 0 0 var(--mustard), inset 8px 0 0 var(--fg); }
.mk-q { font: 650 15.5px/1.28 var(--sans); letter-spacing: -.005em; }
.mk-meta { font: 600 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 800 18px/1.1 var(--display); font-stretch: 112%; font-variant-numeric: lining-nums tabular-nums; }
.mk-px .pa { color: var(--a); } .mk-px .pb { color: var(--b); font-weight: 700; }
/* the split bar under each market is one rod of the abacus: ten notches, Yes beads blue from the left, No orange */
.mk-split { position: relative; height: 7px; border-radius: 4px; background: var(--b); }
.mk-split i { background: var(--a); border-radius: 4px 0 0 4px; }
.mk-split::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1.5px), var(--paper) calc(10% - 1.5px) 10%); }
.thumb { border-radius: 4px; }
.thumb.tile { font-family: var(--display); font-weight: 800; border: var(--edge); }
.legal { color: var(--muted); font: 500 12.5px/1.5 var(--sans); }

/* the two sides: two cards; the one you picked takes its bead 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 -4px 0 var(--ink-2); transition: background-color .18s, color .18s, transform .08s; }
.duel-side:hover { background: var(--ink-0); }
.duel-side:active { transform: translateY(1px); }
.duel-name { font: 800 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); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.duel-side.b[aria-pressed="true"] { background: var(--b); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22); }
.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: #fff; }
.duel-price.flaps { --ff: 50px; }
.duel-side .lev { font: 700 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 800 12.5px var(--sans); color: var(--fg); box-shadow: inset 0 -4px 0 var(--mustard); }

/* the sheet under the two sides, with the abacus lying on it */
.bz { margin-top: 14px; border: 1px solid #d9ccb1; border-radius: 3px; overflow: hidden; box-shadow: var(--shadow); background: #f5efe2; }
.bz svg { display: block; width: 100%; height: auto; }
.bz.wait { width: min(520px, 84vw); margin: 0 0 20px; }
.bz.wait .bz-live .bz-bead { transition-duration: .35s; }

.chart-panel, .stage-row, .more { border-top: var(--hair); }
.panel { border-radius: var(--r); }
.room-num strong { font: 800 34px var(--display); font-stretch: 112%; }
.meter { height: 7px; border-radius: 4px; background: var(--ink-2); } .meter i { background: var(--fg); border-radius: 4px; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.cta-bar { background: linear-gradient(rgba(253, 250, 243, 0), var(--paper) 24%); }
.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: 800 14px var(--sans); }
.side-pick button small { font: 800 20px var(--display); font-stretch: 112%; font-variant-numeric: lining-nums tabular-nums; }
.side-pick .a[aria-pressed="true"] { background: var(--a); color: #fff; }
.side-pick .b[aria-pressed="true"] { background: var(--b); color: #fff; }
.tboard { gap: 10px; padding: 16px 18px; border: var(--edge); border-radius: var(--r); background: var(--ink-0); }
.tboard span { font: 600 13px var(--sans); color: var(--muted); }
.tboard .flaps { --ff: 30px; }
.tboard .flaps.am > b, .flaps.am > b { color: var(--fg); }
#tk-margin { font: 800 28px var(--display); font-stretch: 112%; font-variant-numeric: lining-nums tabular-nums; }
.quick { gap: 6px; border: 0; }
.quick button { border: 1.5px solid var(--ink-3); border-radius: var(--r); font: 800 15px var(--display); font-stretch: 110%; background: var(--paper); }
.quick button:hover { border-color: var(--fg); background: var(--ink-1); }
.lev-head output { font: 850 40px/1 var(--display); font-stretch: 118%; letter-spacing: -.01em; color: var(--fg); }
/* the leverage slider is a steel rod: mustard lacquer up to your leverage, the thumb is a bead on it */
#tk-lev::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; border: 1.5px solid #5a5f66;
  background: linear-gradient(#f0c869, #e2a92b 55%, #b98418) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(#b9bec4, #b9bec4) 0 0 / calc(var(--m) * 100%) 100% no-repeat, linear-gradient(#fbfcfd, #c9ced3 40%, #8d949b); }
#tk-lev::-moz-range-track { height: 8px; border-radius: 4px; border: 1.5px solid #5a5f66;
  background: linear-gradient(#f0c869, #e2a92b 55%, #b98418) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(#b9bec4, #b9bec4) 0 0 / calc(var(--m) * 100%) 100% no-repeat, linear-gradient(#fbfcfd, #c9ced3 40%, #8d949b); }
#tk-lev::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11.5px; border: 1.5px solid rgba(30, 27, 22, .7); border-radius: 50%; clip-path: none;
  background: radial-gradient(circle at 34% 28%, #fff 0 9%, rgba(255, 255, 255, 0) 22%), radial-gradient(circle at 40% 36%, #f3cd72, #e2a92b 50%, #a5700f 100%); box-shadow: 2px 4px 5px rgba(58, 36, 16, .35); }
#tk-lev::-moz-range-thumb { width: 26px; height: 26px; border: 1.5px solid rgba(30, 27, 22, .7); border-radius: 50%; clip-path: none;
  background: radial-gradient(circle at 34% 28%, #fff 0 9%, rgba(255, 255, 255, 0) 22%), radial-gradient(circle at 40% 36%, #f3cd72, #e2a92b 50%, #a5700f 100%); box-shadow: 2px 4px 5px rgba(58, 36, 16, .35); }
.lev-ticks { font: 800 13.5px var(--display); font-stretch: 110%; } .lev-ticks span.off { color: var(--ink-3); }
.rw-track { height: 7px; border-radius: 4px; } .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: 4px solid var(--down); background: var(--down-soft); border-radius: 3px; }

/* account pages */
.summary { border-bottom: var(--edge); }
.sum-main span { font: 700 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 850 clamp(50px, 7.4vw, 100px)/.92 var(--display); font-stretch: 115%; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.pos { background: var(--paper); border: var(--edge); border-radius: var(--r); box-shadow: inset 0 -4px 0 var(--ink-2); }
.pos-out { font: 800 12.5px var(--sans); }
.empty-state { border: 2px dashed var(--ink-3); border-radius: var(--r); background: var(--paper); }
.empty-state .flaps { --ff: 24px; margin-bottom: 10px; }
.empty-state .flaps > b { color: var(--dim); }
.empty-state b { font: 800 24px var(--display); font-stretch: 112%; }
.tbl th { border-bottom: var(--edge); font: 700 12.5px var(--sans); color: var(--fg); }
.tbl td { border-bottom: var(--hair); }
.mid-num { font: 850 46px/1 var(--display); font-stretch: 112%; }
.addr { border: 1.5px solid var(--ink-3); border-radius: var(--r); background: var(--paper); font-family: var(--addr); font-size: 12px; }
.pick { border: var(--edge); border-radius: 6px; box-shadow: 0 0 0 6px var(--beech), 0 0 0 8px var(--line); background: var(--paper); }
.pick::backdrop { background: rgba(30, 27, 22, .4); }
.pick-item { font: 700 18px/1.2 var(--sans); border-radius: var(--r); }
.pick-item:hover, .pick-item:focus-visible { background: var(--ink-1); color: var(--fg); box-shadow: inset 4px 0 0 var(--mustard); }
.toast { background: var(--fg); color: var(--paper); border-left: 6px solid var(--mustard); border-radius: var(--r); font: 600 15.5px var(--sans); }

/* loading: the beads slide across one by one as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 800 22px var(--display); font-stretch: 115%; color: var(--fg); }
.ld-track { display: none; }
.sk { background: linear-gradient(90deg, var(--ink-1), var(--ink-2), var(--ink-1)); background-size: 200% 100%; border-radius: 3px; }

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

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 800 19px var(--display); font-stretch: 115%; color: var(--fg); box-shadow: inset 0 -5px 0 var(--mustard); }
.coin-ca { font: 500 12px var(--addr); color: var(--muted); }
.coin-ca:hover, .coin-pump:hover { background: var(--ink-1); color: var(--fg); }
.coin-pump { font: 700 13px var(--sans); color: var(--muted); }

@media (max-width: 760px) {
  .coin { border-top: var(--hair); }
  .top { box-shadow: none; border-bottom: 2px solid var(--line); }
  .tabs a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--a); }
  .logo { font-size: 23px; } .logo .mark { width: 30px; height: 30px; }
  .duel-price.flaps { --ff: 27px; } .duel-price.flaps > b { font-stretch: 100%; }
  .bal strong { font-size: 16px; } .bal span { font-size: 10.5px; }
  .acct .btn, .seg button { padding-left: 10px; padding-right: 10px; }
  .duel-side { padding: 13px 14px; }
  .bz { margin-top: 10px; }
  h1 { font-size: 25px; }
}

/* the base layout sets labels in spaced capitals; Beadz 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: 700 13px var(--sans); }
@media (max-width: 760px) { .tabs a[aria-current="page"] { background: transparent; } }

/* Live mode: before a wallet is connected the main button reads "Connect a wallet to trade". In a wide display face
   that line is wider than a phone, so the button may wrap and the bar never grows past the screen. */
.cta-bar { grid-template-columns: minmax(0, 1fr); }
.cta-bar > * { min-width: 0; }
@media (max-width: 760px) { .cta-bar .btn { white-space: normal; text-wrap: balance; line-height: 1.15; } }
/* phones: the wide face crowded "up to 3.0×" against the price; a smaller price and a gap keep them apart */
@media (max-width: 420px) { .duel-price.flaps { --ff: 23px; } .duel-side .lev { margin-right: 8px; } }
