/* Sonar
   A ship's echo sounder, the recording kind: a cabinet in light grey hammertone enamel, a glass window over recorder
   paper, a stylus that burns the echo in. The page is the chart room around it: pale bulkhead grey, panels of
   recorder paper ruled in the paper's own pale sea-green, black bakelite for everything you press, chrome for its
   rims. Headlines and big figures are set in Radio Canada Big, everything you read or press in Overpass (after the
   US highway lettering, the plain hand of signs and instrument plates), addresses in Overpass Mono.
   Yes is the deep sea green of the burnt seabed, No signal vermilion. Copper, the stylus wire, marks what you set:
   the active tab, your leverage, the slider. The ticket's board is an engraved black traffolyte label plate.
   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: #e4e7e0; --ink-1: #d9ddd5; --ink-2: #c9cec5; --ink-3: #a3aaa1;
  --paper: #f7f5ee;
  --line: #1d2522; --line-soft: #d2d7ce; --ink: #1d2522;
  --fg: #1d2522; --muted: #56605b; --dim: #8a928c;
  --a: #1f6b58; --a-soft: rgba(31, 107, 88, .1);
  --b: #c4452b; --b-soft: rgba(196, 69, 43, .1);
  --lev: #a8572a; --lev-soft: rgba(168, 87, 42, .09);
  --up: #1f6b58; --down: #c4452b; --down-soft: rgba(196, 69, 43, .08);
  --copper: #a8572a; --copper-lt: #d8935f; --copper-dk: #6e3415;
  --bake: #1b1f1e; --bake-lt: #3d4341; --chrome: #c6cdca;
  --grid: #b7cdc6; --seabed: #1c342d;
  --display: "Radio Canada Big", "Helvetica Neue", Arial, sans-serif;
  --sans: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --mono: "Overpass", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Sonar uses its sans */
  --addr: "Overpass 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(29, 37, 34, .06), 0 18px 30px -22px rgba(20, 30, 26, .55);
  --r: 5px;
  color-scheme: light;
}
/* the bulkhead: pale grey-green paint with the faint dimple of hammertone, lighter under the chart-room lamp */
body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05' numOctaves='3' seed='7'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='1.4'%3E%3CfeDistantLight azimuth='235' elevation='60'/%3E%3C/feDiffuseLighting%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -.9 0 0 0 .62'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23h)' opacity='.32'/%3E%3C/svg%3E"), radial-gradient(1300px 700px at 14% 0, #eef0eb, transparent 70%); background-color: var(--ink-0); color: var(--fg); font: 450 15.5px/1.5 var(--sans); }
::selection { background: #f0c7a6; color: var(--fg); }

/* type */
h2, h3, .h { font: 700 14px/1.2 var(--sans); letter-spacing: 0; color: var(--fg); text-transform: none; }
h1 { font: 700 clamp(28px, 2.6vw, 40px)/1.08 var(--display); letter-spacing: -.02em; text-transform: none; }
.num, .sum-stats dd, .pos-grid dd, .tbl td.r, .kv dd { font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.hint, .empty, .stage-empty, .empty-state p { font-family: var(--sans); color: var(--muted); }

/* the split-flap tiles become figures that come up the way a stylus mark does: dark first, then settled */
.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(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.flaps > b.sp { width: .28em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: burn .45s ease-out; }
@keyframes burn { 0% { opacity: .2; filter: blur(1.5px); } 100% { opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: the cabinet's own enamel, with a chrome strip along its foot */
.top { background: linear-gradient(#eceee9, #d6dbd3); border-bottom: 0; box-shadow: none; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; pointer-events: none;
  border-top: 1px solid #59615b; background: linear-gradient(#fbfcfb, #aeb6b3 40%, #eef1ef 60%, #7d8783); box-shadow: 0 3px 6px -3px rgba(20, 30, 26, .45); }
main { padding-top: 6px; }
.logo { gap: 10px; padding-right: 24px; font: 700 30px/1 var(--display); letter-spacing: -.03em; color: var(--fg); }
.logo .mark { width: 40px; height: 40px; }
.tabs { gap: 2px; }
.tabs a { border-radius: 0; padding: 0 14px; font: 600 15px var(--sans); color: var(--muted); }
.tabs a:hover { background: rgba(255, 255, 255, .45); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: transparent; box-shadow: inset 0 -3px 0 var(--copper); }
.tabs b { font-family: var(--sans); font-weight: 700; color: var(--copper); }
.bal { border-left: 1px solid var(--ink-3); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 700 23px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.net { color: var(--muted); }

/* controls: paper plates with an ink edge; the main button is black bakelite with a chrome rim */
.btn { border: var(--edge); border-radius: var(--r); font: 600 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: #fffef9; color: var(--fg); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary { background: linear-gradient(#3d4341, var(--bake) 55%, #101312); color: #f2efe4; border-color: #0a0c0b; box-shadow: inset 0 1px 0 #6b7370, inset 0 -2px 0 #000; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(#4a504e, #262b29 55%, #151817); color: #fff; }
.btn.cta { border: 1.5px solid #050606; border-radius: var(--r); min-height: 60px; font: 700 24px/1 var(--display); letter-spacing: -.02em; color: #f4f1e6;
  background: radial-gradient(120% 140% at 30% 0%, #555b59 0%, #2a2f2d 38%, #151817 70%, #0b0d0c 100%);
  box-shadow: inset 0 0 0 3px #171a19, inset 0 0 0 4px rgba(216, 147, 95, .8), inset 0 1px 0 4px rgba(255, 255, 255, .12), inset 0 -4px 0 rgba(0, 0, 0, .45), 0 2px 0 #050606, 0 0 0 2px #c6cdca, 0 0 0 3px #7d8783; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.btn.cta:hover:not(:disabled) { background: radial-gradient(120% 140% at 30% 0%, #646a68 0%, #323735 38%, #1b1e1d 70%, #0e100f 100%); color: #fff; }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 3px #171a19, inset 0 0 0 4px rgba(216, 147, 95, .8), inset 0 -2px 0 rgba(0, 0, 0, .45), 0 0 0 #050606, 0 0 0 2px #c6cdca, 0 0 0 3px #7d8783; }
.btn.cta:disabled { background: var(--ink-2); color: var(--dim); border-color: var(--ink-3); box-shadow: none; text-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: 3px; font: 600 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--bake); color: #f2efe4; box-shadow: inset 0 1px 0 #555b59; }
input:not([type="range"]), select { background: #fffef9; border: 1px 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: 2px solid var(--copper); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--copper); }
.chips button { font: 600 13px var(--sans); border-radius: var(--r); border: 1px solid var(--ink-3); background: var(--paper); }
.chips button[aria-pressed="true"] { background: var(--bake); border-color: var(--bake); color: #f2efe4; }

/* market list: a log book on recorder paper */
.mk { border-right: var(--edge); background: var(--paper); }
.mk-head { border-bottom: var(--hair); }
.mk-row { border-bottom: var(--hair); }
.mk-row:hover { background: #f0efe6; }
.mk-row[aria-current="true"] { background: #e9ebe3; box-shadow: inset 4px 0 0 var(--copper); }
.mk-q { font: 600 15.5px/1.3 var(--sans); letter-spacing: -.003em; }
.mk-meta { font: 500 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 700 18px/1.15 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mk-px .pa { color: var(--a); } .mk-px .pb { color: var(--b); }
/* the bar under each market: Yes as the burnt seabed green from the left, No vermilion */
.mk-split { height: 5px; border-radius: 1px; background: var(--b); } .mk-split i { background: var(--a); border-radius: 1px 0 0 1px; box-shadow: 1.5px 0 0 var(--paper); }
.thumb { border-radius: 4px; }
.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: two paper 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: #fffef9; }
.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: #0e3a2f; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #6e2314; 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: #fbf9f2; }
.duel-price.flaps { --ff: 52px; }
.duel-side .lev { font: 600 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 700 13.5px var(--sans); color: var(--copper); box-shadow: none; }

/* the echo sounder under the two sides */
.snz { margin-top: 14px; border-radius: 7px; overflow: hidden; box-shadow: 0 0 0 1px #9aa29a, var(--shadow); background: #d3d8d0; }
.snz svg { display: block; width: 100%; height: auto; }
.snz.wait { width: 300px; margin: 0 0 22px; }

.chart-panel, .stage-row, .more { border-top: var(--hair); }
.panel { border-radius: var(--r); }
.room-num strong { font: 700 34px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.meter { height: 6px; border-radius: 1px; background: var(--ink-2); } .meter i { background: var(--copper); border-radius: 1px; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.cta-bar { background: linear-gradient(rgba(247, 245, 238, 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: 700 22px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.side-pick .a[aria-pressed="true"] { background: var(--a); border-color: #0e3a2f; color: #fbf9f2; }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #6e2314; color: #fbf9f2; }
/* the ticket's board is an engraved black traffolyte label: white letters cut into it, a chrome screw at each end */
.tboard { position: relative; gap: 10px; padding: 14px 28px; border: 1px solid #050606; border-radius: 4px;
  background: linear-gradient(180deg, #2c3130 0%, #191c1b 45%, #111312 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 6px 12px -10px rgba(10, 15, 12, .9); }
.tboard::before, .tboard::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: linear-gradient(28deg, transparent 44%, #4b524f 44% 56%, transparent 56%), radial-gradient(circle at 35% 30%, #fff, #b3bbb8 50%, #58625e); box-shadow: 0 0 0 .5px #3a403d; }
.tboard::before { left: 10px; } .tboard::after { right: 10px; }
.tboard span { font: 600 13px var(--sans); color: #b9bfbb; }
.tboard .flaps { --ff: 31px; }
.tboard .flaps > b, .tboard .flaps.am > b { color: #f1f1ec; text-shadow: 0 -1px 0 rgba(0, 0, 0, .6); }
.tboard .flaps.am > b { color: var(--copper-lt); }
.flaps.am > b { color: var(--fg); }
#tk-margin { font: 700 29px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.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: #fffef9; }
.lev-head output { font: 700 42px/1 var(--display); letter-spacing: -.03em; color: var(--copper); font-variant-numeric: tabular-nums; }
/* the leverage slider: copper wire up to your leverage; the thumb is a bakelite knob on a chrome skirt */
#tk-lev::-webkit-slider-runnable-track { height: 8px; border-radius: 1px; border: 1px solid var(--line); background: linear-gradient(#d8935f, var(--copper) 55%, var(--copper-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, #fffef9; }
#tk-lev::-moz-range-track { height: 8px; border-radius: 1px; border: 1px solid var(--line); background: linear-gradient(#d8935f, var(--copper) 55%, var(--copper-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, #fffef9; }
#tk-lev::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; background: radial-gradient(circle at 38% 30%, #5b605e, #232726 45%, #0b0c0c 72%, #c6cdca 74%, #7d8783 100%); border: 1px solid #2b302e; border-radius: 50%; box-shadow: 0 2px 3px rgba(10, 15, 12, .4); clip-path: none; }
#tk-lev::-moz-range-thumb { width: 24px; height: 24px; background: radial-gradient(circle at 38% 30%, #5b605e, #232726 45%, #0b0c0c 72%, #c6cdca 74%, #7d8783 100%); border: 1px solid #2b302e; border-radius: 50%; box-shadow: 0 2px 3px rgba(10, 15, 12, .4); 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: 1px; } .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: var(--edge); }
.sum-main span { font: 600 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 700 clamp(52px, 7.6vw, 104px)/.95 var(--display); letter-spacing: -.035em; font-variant-numeric: 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 .es-mark { width: 64px; height: 64px; margin-bottom: 6px; }
.empty-state b { font: 700 27px var(--display); letter-spacing: -.02em; }
.tbl th { border-bottom: var(--edge); font: 600 12.5px var(--sans); color: var(--fg); }
.tbl td { border-bottom: var(--hair); }
.mid-num { font: 700 50px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.addr { border: 1px solid var(--ink-3); border-radius: var(--r); background: #fffef9; font-family: var(--addr); font-size: 12.5px; }
.pick { border: var(--edge); border-radius: 7px; box-shadow: 0 30px 60px -20px rgba(10, 15, 12, .55); background: var(--paper); }
.pick::backdrop { background: rgba(29, 37, 34, .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); box-shadow: inset 4px 0 0 var(--copper); }
.toast { background: var(--bake); color: #f2efe4; border-left: 5px solid var(--copper); border-radius: var(--r); font: 500 15.5px var(--sans); }

/* loading: the paper burns up from the bottom as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 700 25px var(--display); color: var(--fg); letter-spacing: -.02em; }
.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(--copper); }

/* the coin in the top bar */
.coin > * { border-left: 1px solid var(--ink-3); padding: 0 12px; }
.coin-tk { font: 700 20px var(--display); color: var(--fg); letter-spacing: -.02em; box-shadow: inset 0 -4px 0 var(--copper-lt); }
.coin-ca { font: 400 12px var(--addr); color: var(--muted); }
.coin-ca:hover, .coin-pump:hover { background: rgba(255, 255, 255, .5); color: var(--fg); }
.coin-pump { font: 600 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(--copper); }
  .logo { font-size: 26px; } .logo .mark { width: 34px; height: 34px; }
  .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; }
  .snz { margin-top: 10px; }
  .snz.wait { width: 260px; }
  h1 { font-size: 26px; }
}

/* the base layout sets labels in spaced capitals; Sonar 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; }
h1, .empty-state b, .stage-empty p:first-of-type { letter-spacing: -.02em; }
.btn.cta { letter-spacing: -.02em; }
.net, .stage-empty { font-family: var(--sans); font-weight: 600; }
.field label, .eyebrow, .pick-go { font: 600 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 the 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, 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; }
.cta-bar .err { background: linear-gradient(var(--down-soft), var(--down-soft)), var(--paper); }
