/* Sands
   An hourglass in a turned ebony frame with brass rings, standing on an aubergine lacquered shelf against a lilac
   plaster wall. The sand that has run into the lower bulb is the price of Yes; what is left above is No. The page is
   that wall: a pale dusk lilac, with panels of lilac-white like the light through the glass, edged in a deep
   aubergine ink. Headlines and the big figures are set in a high-contrast Didone (Libre Bodoni), the face of old clock
   dials and engraved plates; everything you read or press is a plain grotesque (Familjen Grotesk). Yes is verdigris,
   No is madder rose, and the sand's ochre is the only warm colour. The main button is dusk violet with sand lettering.
   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: #ece6ef; --ink-1: #e3dbe8; --ink-2: #d4cadb; --ink-3: #b3a7bd;
  --paper: #faf7fb;
  --line: #1e1a2e; --line-soft: #dcd3e2; --ink: #1e1a2e;
  --fg: #1e1a2e; --muted: #5f5770; --dim: #948aa2;
  --a: #17806a; --a-soft: rgba(23, 128, 106, .1);
  --b: #c43a4e; --b-soft: rgba(196, 58, 78, .1);
  --lev: #1e1a2e; --lev-soft: rgba(30, 26, 46, .08);
  --up: #17806a; --down: #c43a4e; --down-soft: rgba(196, 58, 78, .08);
  --sand: #e0a94f; --sand-lt: #f5e3bd; --sand-dk: #b67c2f; --dusk: #4a3b8f; --dusk-dk: #2e2361; --ebony: #241b22; --brass: #c9a04e;
  --display: "Libre Bodoni", "Bodoni 72", Didot, "Times New Roman", serif;
  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Sands uses its grotesque */
  --addr: "Sometype Mono", ui-monospace, Menlo, monospace; /* only wallet and contract addresses */
  --edge: 1.5px solid var(--line);
  --hair: 1px solid var(--line-soft);
  --shadow: 0 1px 0 rgba(30, 26, 46, .06), 0 18px 32px -22px rgba(42, 30, 60, .55);
  --r: 6px;
  color-scheme: light;
}
/* the page is the plaster wall: pale lilac with a fine grain */
body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='12' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .24 0 0 0 0 .38 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23p)' opacity='.22'/%3E%3C/svg%3E"), var(--ink-0); color: var(--fg); font: 450 15.5px/1.5 var(--sans); }
::selection { background: var(--sand-lt); color: var(--fg); }

/* type: a Didone for headlines and big figures, the grotesque with even figures for everything else */
h2, h3, .h { font: 700 13.5px/1.2 var(--sans); letter-spacing: .005em; color: var(--fg); text-transform: none; }
h1 { font: 600 clamp(29px, 2.7vw, 42px)/1.06 var(--display); letter-spacing: -.01em; 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: 700; 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 engraved figures that settle into place like sand */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 600 var(--ff, 22px)/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.flaps > b.sp { width: .28em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: settle .5s cubic-bezier(.2, .9, .3, 1); }
@keyframes settle { 0% { transform: translateY(-.14em); opacity: .25; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: lilac-white over a single ink rule */
.top { background: var(--paper); border-bottom: var(--edge); box-shadow: none; }
.logo { gap: 10px; padding-right: 24px; font: 600 32px/1 var(--display); letter-spacing: -.015em; color: var(--fg); }
.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-1); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: transparent; box-shadow: inset 0 -3px 0 var(--sand); }
.tabs b { font-family: var(--sans); font-weight: 700; color: var(--b); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 700 24px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.net { color: var(--muted); }

/* controls: lilac-white plates with an ink edge; the main button is dusk violet with sand lettering */
.btn { border: var(--edge); border-radius: var(--r); font: 650 14px 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: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary { background: var(--fg); color: var(--paper); box-shadow: inset 0 1px 0 #48405e, inset 0 -2px 0 #000; }
.btn.primary:hover:not(:disabled) { background: #2d2742; }
.btn.cta { border: 1.5px solid var(--dusk-dk); border-radius: var(--r); min-height: 60px; font: 600 25px/1 var(--display); letter-spacing: 0; color: var(--sand-lt);
  background: linear-gradient(180deg, #5e4ea6 0%, var(--dusk) 48%, #3d3079 100%);
  box-shadow: inset 0 1px 0 rgba(230, 220, 255, .35), inset 0 -4px 0 rgba(0, 0, 0, .3), 0 2px 0 var(--dusk-dk); }
.btn.cta:hover:not(:disabled) { filter: none; background: linear-gradient(180deg, #6a5ab3 0%, #54449b 48%, #45388a 100%); }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(230, 220, 255, .3), inset 0 -2px 0 rgba(0, 0, 0, .3), 0 0 0 var(--dusk-dk); }
.btn.cta:disabled { background: var(--ink-2); color: var(--dim); border-color: var(--ink-3); box-shadow: 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: 1px; }
.seg { border: var(--edge); border-radius: var(--r); padding: 2px; background: var(--paper); }
.seg button { border-radius: 4px; font: 650 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--paper); box-shadow: none; }
input:not([type="range"]), select { background: #fff; 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(--dusk); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--dusk); }
.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(--fg); border-color: var(--fg); 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: #f4eff7; }
.mk-row[aria-current="true"] { background: #f7efe2; box-shadow: inset 4px 0 0 var(--sand-dk); }
.mk-q { font: 600 15.5px/1.3 var(--sans); letter-spacing: -.005em; }
.mk-meta { font: 550 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 700 18px/1.15 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.mk-px .pa { color: var(--a); } .mk-px .pb { color: var(--b); }
/* the bar under each market: the two shares of the sand, Yes below in verdigris, No in rose */
.mk-split { height: 5px; border-radius: 3px; background: var(--b); } .mk-split i { background: var(--a); border-radius: 3px 0 0 3px; box-shadow: 1.5px 0 0 var(--paper); }
.thumb { border-radius: 4px; }
.thumb.tile { font-family: var(--display); font-weight: 600; border: var(--edge); }
.legal { color: var(--muted); font: 450 12.5px/1.55 var(--sans); }

/* the two sides: two lilac-white plates; the one you picked is filled in 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: #fff; }
.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: #0c4b3e; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #7a1f2d; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.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: #fdfaff; }
.duel-price.flaps { --ff: 54px; }
.duel-side .lev { font: 600 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 700 12.5px var(--sans); color: var(--dusk); box-shadow: none; }

/* the hourglass on its shelf under the two sides */
.hgz { margin-top: 14px; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px #c9bdd2, var(--shadow); background: #e4dcea; }
.hgz svg { display: block; width: 100%; height: auto; }
.hgz.wait { width: 210px; margin: 0 0 22px; }

.chart-panel, .stage-row, .more { border-top: var(--hair); }
.panel { border-radius: var(--r); }
.room-num strong { font: 600 36px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.meter { height: 6px; border-radius: 3px; background: var(--ink-2); } .meter i { background: var(--sand-dk); border-radius: 3px; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.cta-bar { background: linear-gradient(rgba(250, 247, 251, 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: 700 14px var(--sans); }
.side-pick button small { font: 600 22px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.side-pick .a[aria-pressed="true"] { background: var(--a); border-color: #0c4b3e; color: #fdfaff; }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #7a1f2d; color: #fdfaff; }
/* the ticket's board is a small brass plate */
.tboard { gap: 10px; padding: 14px 18px; border: 1px solid #8f6a26; border-radius: 5px; background: linear-gradient(180deg, #f3dc9f, #dcb764 55%, #c9a04e); box-shadow: inset 0 0 0 3px rgba(255, 244, 210, .45), 0 6px 12px -10px rgba(60, 40, 10, .7); }
.tboard span { font: 650 13px var(--sans); color: #4a3510; }
.tboard .flaps { --ff: 32px; }
.tboard .flaps > b, .tboard .flaps.am > b { color: #2e1f06; }
.flaps.am > b { color: var(--fg); }
#tk-margin { font: 600 30px 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: 700 16px var(--sans); font-variant-numeric: tabular-nums; background: var(--paper); }
.quick button:hover { border-color: var(--fg); background: #fff; }
.lev-head output { font: 600 44px/1 var(--display); letter-spacing: -.01em; color: var(--fg); font-variant-numeric: lining-nums; }
/* the leverage slider: a glass tube filled with sand up to your leverage; the thumb is a brass knob */
#tk-lev::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; border: 1px solid var(--line); background: linear-gradient(var(--sand), var(--sand-dk)) 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, #fff; }
#tk-lev::-moz-range-track { height: 10px; border-radius: 5px; border: 1px solid var(--line); background: linear-gradient(var(--sand), var(--sand-dk)) 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, #fff; }
#tk-lev::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -8px; background: radial-gradient(circle at 36% 32%, #f8e3a8, #c9a04e 55%, #6b4d17); border: 1.5px solid var(--line); border-radius: 50%; box-shadow: 0 2px 3px rgba(30, 26, 46, .35); clip-path: none; }
#tk-lev::-moz-range-thumb { width: 22px; height: 22px; background: radial-gradient(circle at 36% 32%, #f8e3a8, #c9a04e 55%, #6b4d17); border: 1.5px solid var(--line); border-radius: 50%; box-shadow: 0 2px 3px rgba(30, 26, 46, .35); clip-path: none; }
.lev-ticks { font: 700 13.5px var(--sans); } .lev-ticks span.off { color: var(--ink-3); }
.rw-track { height: 6px; border-radius: 3px; } .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: 3px; }

/* account pages */
.summary { border-bottom: var(--edge); }
.sum-main span { font: 650 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 600 clamp(54px, 8vw, 108px)/.95 var(--display); 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 -3px 0 var(--ink-2); }
.pos-out { font: 700 12.5px var(--sans); }
.empty-state { border: 1.5px 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: 600 28px 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: 600 52px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.big-num { font-family: var(--display); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.addr { border: 1px solid var(--ink-3); border-radius: var(--r); background: #fff; font-family: var(--addr); font-size: 12.5px; }
.pick { border: var(--edge); border-radius: 8px; box-shadow: 0 30px 60px -20px rgba(42, 30, 60, .55); background: var(--paper); }
.pick::backdrop { background: rgba(30, 26, 46, .42); }
.pick-item { font: 650 18px/1.2 var(--sans); border-radius: var(--r); }
.pick-item:hover, .pick-item:focus-visible { background: var(--ink-0); color: var(--fg); box-shadow: inset 4px 0 0 var(--sand-dk); }
.toast { background: var(--fg); color: var(--paper); border-left: 5px solid var(--sand); border-radius: var(--r); font: 550 15.5px var(--sans); }

/* loading: the sand runs through as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 600 26px var(--display); color: var(--fg); }
.stage-empty #load-count { font-family: var(--sans); font-weight: 700; 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: 3px; }

/* 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(--dusk); }

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 700 20px var(--display); color: var(--fg); box-shadow: inset 0 -4px 0 var(--sand); }
.coin-ca { font: 400 12.5px var(--addr); color: var(--muted); }
.coin-ca:hover, .coin-pump:hover { background: var(--ink-1); color: var(--fg); }
.coin-pump { font: 650 13px var(--sans); color: var(--muted); }

@media (max-width: 760px) {
  .coin { border-top: var(--hair); }
  .tabs a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--sand); }
  .logo { font-size: 28px; } .logo .mark { width: 32px; height: 32px; }
  .duel-price.flaps { --ff: 30px; }
  .tabs a { padding: 12px 14px; }
  .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; }
  .hgz { margin-top: 10px; }
  h1 { font-size: 27px; }
}

/* the base layout sets labels in spaced capitals; Sands 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); }
@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; } }

/* the main button reads as a sentence in the Didone, not spaced capitals; an error sits on solid paper so the ticket
   scrolling under the bar never shows through it */
.btn.cta { text-transform: none; letter-spacing: 0; }
.cta-bar .err { background: linear-gradient(var(--down-soft), var(--down-soft)), var(--paper); }
