/* Loom
   A cherry-wood hand loom stands under the two sides. The cloth on it is woven moss for Yes from the left and
   mulberry for No from the right; where the two threads meet in a row is the price when that row was woven. The
   shuttle carries the colour of the side you look at, the reed is marked like a ruler, and a knotted marker thread
   hangs on the warp where your position would be closed.
   The page takes its materials from the loom: undyed cotton for every panel on an oat wool ground, walnut for the
   buttons you press with a woven selvedge along their lower edge (moss and mulberry in a two-by-two check), and
   walnut ink for every edge. Big figures in Texturina, a type cut after the woven look of textura pages; everything
   you read or press in a plain sans. 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: #ece4d4; --ink-1: #e3d9c6; --ink-2: #d6cab3; --ink-3: #ad9f86;
  --paper: #fbf7ef;
  --line: #2a1d1b; --line-soft: #e4dac8; --ink: #2a1d1b;
  --fg: #2a1d1b; --muted: #6c5d55; --dim: #9a8b7c;
  --a: #4c7a24; --a-soft: rgba(76, 122, 36, .1);
  --b: #a1306a; --b-soft: rgba(161, 48, 106, .1);
  --lev: #2a1d1b; --lev-soft: rgba(42, 29, 27, .08);
  --up: #4c7a24; --down: #b5373b; --down-soft: rgba(181, 55, 59, .08);
  --walnut: #3b2722; --walnut-hi: #523830; --box: #e0b65a; --cherry: #a4623f;
  --display: "Texturina", "Iowan Old Style", Georgia, serif;
  --sans: "Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif;
  --mono: "Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Loom uses its sans */
  --addr: "PT Mono", ui-monospace, Menlo, monospace;
  --edge: 1.5px solid var(--line);
  --hair: 1px solid var(--line-soft);
  --selvedge: conic-gradient(var(--a) 25%, var(--b) 0 50%, var(--a) 0 75%, var(--b) 0) 0 100% / 10px 4px repeat-x;
  --shadow: 0 1px 0 rgba(42, 29, 27, .05), 0 18px 32px -24px rgba(70, 40, 24, .55);
  --r: 3px;
  color-scheme: light;
}
body { background: var(--ink-0); color: var(--fg); font: 450 15px/1.5 var(--sans); }
::selection { background: #efd592; color: var(--fg); box-shadow: none; }

/* type: a soft round serif for the big figures, a plain sans for everything else, figures always lining and tabular */
h2, h3, .h { font: 700 13.5px/1.2 var(--sans); letter-spacing: 0; color: var(--fg); text-transform: none; }
h1 { font: 700 clamp(26px, 2.4vw, 36px)/1.12 var(--sans); letter-spacing: -.02em; 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: -.005em; }
.hint, .empty, .stage-empty, .empty-state p { font-family: var(--sans); color: var(--muted); }

/* the split-flap tiles become plain figures that drift into place when they change */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 700 var(--ff, 22px)/1 var(--sans); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.flaps > b.sp { width: .28em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: drift .38s cubic-bezier(.2, .9, .3, 1); }
@keyframes drift { 0% { opacity: 0; transform: translateY(.14em); } 60% { opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: cotton over a walnut rule */
.top { background: var(--paper); border-bottom: 2px solid var(--line); }
.logo { gap: 10px; padding-right: 24px; font: 700 28px/1 var(--display); letter-spacing: 0; color: var(--fg); }
.logo .mark { width: 40px; height: 40px; }
.tabs { gap: 2px; }
.tabs a { border-radius: 0; padding: 0 14px; font: 650 14.5px var(--sans); color: var(--muted); }
.tabs a:hover { background: var(--ink-0); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: var(--selvedge); background-size: 10px 5px; }
.tabs b { font-family: var(--sans); font-weight: 800; color: var(--b); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 700 21px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.net { color: var(--muted); }

/* controls: walnut edges; the buttons you press are walnut with a woven selvedge along the lower edge */
.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: var(--ink-0); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary { background: var(--selvedge), var(--walnut); color: var(--paper); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); padding-bottom: 4px; }
.btn.primary:hover:not(:disabled) { background: var(--selvedge), var(--walnut-hi); }
.btn.primary:active:not(:disabled) { box-shadow: none; }
.btn.cta { border: 1.5px solid var(--line); border-radius: var(--r); min-height: 60px; font: 700 23px/1 var(--display); letter-spacing: 0; color: var(--paper);
  background: conic-gradient(var(--a) 25%, var(--b) 0 50%, var(--a) 0 75%, var(--b) 0) 0 100% / 12px 6px repeat-x, linear-gradient(180deg, #56392f 0%, #3b2722 55%, #2e1e1a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 2px 0 var(--line); }
.btn.cta:hover:not(:disabled) { filter: none; background: conic-gradient(var(--a) 25%, var(--b) 0 50%, var(--a) 0 75%, var(--b) 0) 0 100% / 12px 6px repeat-x, linear-gradient(180deg, #654339 0%, #47302a 55%, #3b2722 100%); }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 var(--line); }
.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: 2px; font: 650 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--walnut); 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(--walnut); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--walnut); }
.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(--walnut); border-color: var(--line); 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: #f6f0e4; }
.mk-row[aria-current="true"] { background: #f3ecdd; box-shadow: inset 4px 0 0 var(--cherry); }
.mk-q { font: 600 15px/1.3 var(--sans); letter-spacing: -.01em; }
.mk-meta { font: 550 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 700 16px/1.15 var(--sans); 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: the two bow colours side by side */
.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: 3px; }
.thumb.tile { font-family: var(--display); font-weight: 700; 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 bow 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: #fffdf8; }
.duel-side:active { transform: translateY(1px); }
.duel-name { font: 750 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: #2f4f14; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #6c1d45; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.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: 46px; }
.duel-price.flaps > b { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
.duel-side .lev { font: 600 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 750 12.5px var(--sans); color: var(--muted); box-shadow: none; }

/* the field under the two sides */
/* the loom under the two sides */
.lmz { margin-top: 14px; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1.5px var(--line), var(--shadow); background: #ebe2d1; }
.lmz svg { display: block; width: 100%; height: auto; }
.lmz.wait { width: min(520px, 86vw); margin: 0 0 22px; }

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

/* 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: 750 14px var(--sans); }
.side-pick button small { font: 700 19px var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.side-pick .a[aria-pressed="true"] { background: var(--a); border-color: #2f4f14; color: var(--paper); }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #6c1d45; color: var(--paper); }
/* the ticket's board: cotton with a walnut edge and the woven selvedge */
.tboard { gap: 10px; padding: 16px 18px 20px; border: var(--edge); border-radius: var(--r); background: var(--selvedge), var(--paper); box-shadow: 0 6px 12px -10px rgba(70, 40, 24, .55); }
.tboard span { font: 600 13px var(--sans); color: var(--muted); }
.tboard .flaps { --ff: 26px; }
.tboard .flaps.am > b, .flaps.am > b { color: var(--fg); }
#tk-margin { font: 700 26px var(--sans); 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 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: 700 40px/1 var(--display); letter-spacing: 0; color: var(--fg); font-variant-numeric: lining-nums; }
/* the leverage slider: a length of string paid out, ink up to your leverage; the thumb is a small paper diamond */
#tk-lev::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; border: 1px solid var(--line); background: linear-gradient(var(--walnut), var(--walnut)) 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, #f1e8d6; }
#tk-lev::-moz-range-track { height: 8px; border-radius: 4px; border: 1px solid var(--line); background: linear-gradient(var(--walnut), var(--walnut)) 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, #f1e8d6; }
#tk-lev::-webkit-slider-thumb { width: 34px; height: 14px; margin-top: -4px; border: 1px solid #6e4f18; border-radius: 50%; background: radial-gradient(ellipse 40% 30% at 50% 50%, var(--a) 0 60%, #5e3f12 61% 100%) 0 0 / 100% 100% no-repeat, linear-gradient(180deg, #f3d68f, #e0b65a 45%, #9c7428); box-shadow: 0 1px 2px rgba(42, 29, 27, .4); }
#tk-lev::-moz-range-thumb { width: 32px; height: 12px; border: 1px solid #6e4f18; border-radius: 50%; background: radial-gradient(ellipse 40% 30% at 50% 50%, var(--a) 0 60%, #5e3f12 61% 100%) 0 0 / 100% 100% no-repeat, linear-gradient(180deg, #f3d68f, #e0b65a 45%, #9c7428); box-shadow: 0 1px 2px rgba(42, 29, 27, .4); }
.lev-ticks { font: 700 13px var(--sans); font-variant-numeric: lining-nums; } .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: 2px; }

/* account pages */
.summary { border-bottom: 2px solid var(--line); }
.sum-main span { font: 650 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 700 clamp(48px, 7vw, 96px)/1 var(--display); letter-spacing: 0; 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: 750 12.5px var(--sans); }
.empty-state { border: 1.5px dashed var(--ink-3); border-radius: var(--r); background: var(--paper); }
.empty-state .es-mark { width: 60px; height: 60px; margin-bottom: 6px; }
.empty-state b { font: 700 25px 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: 700 46px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.big-num { font-family: var(--display); font-weight: 700; 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: var(--edge); border-radius: 6px; box-shadow: 0 30px 60px -20px rgba(70, 40, 24, .55); background: var(--selvedge), var(--paper); }
.pick::backdrop { background: rgba(42, 29, 27, .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); }
.toast { background: var(--fg); color: var(--paper); border-left: 5px solid var(--box); border-radius: var(--r); font: 550 15px var(--sans); }

/* loading: the loom weaves plain rows as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 700 24px 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: 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(--cherry); }

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 700 18px var(--display); color: var(--fg); box-shadow: none; }
.coin-ca { font: 500 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: 23px; padding-right: 12px; } .logo .mark { width: 32px; height: 32px; }
  .duel-price.flaps { --ff: 26px; }
  .tabs a { padding: 12px 14px; }
  .bal strong { font-size: 17px; } .bal span { font-size: 10.5px; }
  .acct .btn, .seg button { padding-left: 10px; padding-right: 10px; }
  .duel-side { padding: 13px 14px; }
  .lmz { margin-top: 10px; }
  h1 { font-size: 23px; }
}

/* the base layout sets labels in spaced capitals; Loom 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: var(--selvedge); background-size: 10px 4px; } }

/* Live mode: before a wallet is connected the main button reads "Connect a wallet to trade". In the wide 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: 8px; padding-bottom: 12px; }
.btn.cta:disabled { color: var(--muted); }
