/* MiroFish × Polymarket — "sonar console" design system (2026-08-29).
   A deep-ocean instrument panel: blue-black ground, phosphor-cyan readings,
   IBM Plex Mono for every number, Space Grotesk for headings. The signature
   element is the probability rail — the 0–100% track that carries the
   model-vs-market gap this whole system trades. */

:root {
  --abyss: #070d1a;          /* page ground */
  --hull: #0d1626;           /* panel */
  --hull2: #111c30;          /* nested surface */
  --line: #1e2c47;
  --fg: #dce7f5;
  --dim: #6e84a8;
  --cyan: #3fd4e0;           /* primary instrument reading */
  --green: #2fde8c;
  --red: #ff5d5d;
  --gold: #f2c14e;           /* market mark / warnings */
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--abyss); color: var(--fg);
  font: 14px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-image: radial-gradient(1200px 500px at 70% -200px, #0d1e3a66, transparent);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
main { max-width: 1160px; margin: 1.4rem auto; padding: 0 1.1rem; min-height: 72vh; }
footer { text-align: center; padding: 1.1rem; border-top: 1px solid var(--line);
  color: var(--dim); font-family: var(--mono); font-size: .76rem; }
.muted { color: var(--dim); }
.mono, td.num, .stat .v { font-family: var(--mono); }

h1 { font-family: var(--disp); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -.01em; margin: .2rem 0 1rem; }
h2 { font-family: var(--disp); font-size: .95rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin: 0 0 .7rem; }
.step { color: var(--cyan); font-family: var(--mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .14em; margin-bottom: .35rem; }

/* ---------- header: the operator's cockpit line ---------- */
.banner { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: .5rem .9rem;
  padding: .55rem 1.1rem; background: #0a1322f2; backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); }
.banner.real { background: #2a0d0df2; border-bottom: 2px solid var(--red); }
.banner-left, .banner-right { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.logo { font-family: var(--disp); font-weight: 700; letter-spacing: -.01em; }
.banner nav { display: inline-flex; gap: .9rem; }
.banner nav a { color: var(--dim); font-weight: 600; font-size: .86rem; }
.banner nav a:hover { color: var(--fg); text-decoration: none; }
.chip { padding: .12rem .65rem; border-radius: 999px; font-weight: 800;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; }
.banner .chip { background: #0f2b1e; color: var(--green); border: 1px solid #1e5c3f; }
.banner.real .chip { background: var(--red); color: #fff; border: 0; }
.ops { display: flex; align-items: center; gap: .45rem; font-family: var(--mono);
  font-size: .72rem; color: var(--dim); }
.ops .gauge { width: 64px; height: 6px; background: var(--hull2); border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden; }
.ops .gauge i { display: block; height: 100%; background: var(--cyan); width: 0; transition: width .5s; }
.ops .gauge.hot i { background: var(--gold); }
.ops .gauge.crit i { background: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.up { background: var(--green); box-shadow: 0 0 6px #2fde8c88; }
.dot.down { background: var(--red); }
.kill { background: transparent; color: var(--red); border: 1px solid var(--red);
  border-radius: 6px; padding: .3rem .7rem; font-weight: 700; font-size: .8rem; cursor: pointer; }
.kill:hover { background: var(--red); color: #fff; }
.kill.engaged { background: var(--gold); border-color: var(--gold); color: #000; }

/* ---------- surfaces ---------- */
.panel { background: var(--hull); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; font-family: var(--mono); }
td { font-size: .88rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--hull2); }
tr:last-child td { border-bottom: 0; }

button.primary { background: var(--cyan); color: #05202a; border: 0; border-radius: 7px;
  padding: .5rem 1.05rem; font-weight: 700; font-family: var(--disp); cursor: pointer; }
button.primary:hover { filter: brightness(1.12); }
button.green { background: var(--green); color: #04220f; }
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line);
  border-radius: 7px; padding: .45rem .95rem; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
input, select { background: var(--abyss); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: .38rem .55rem; font-family: var(--mono); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--hull); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; }
.stat .v { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.stat .k { color: var(--dim); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .09em; font-family: var(--mono); margin-top: .15rem; }
.pos { color: var(--green); } .neg { color: var(--red); }
.big-verdict { font-family: var(--disp); font-size: 1.7rem; font-weight: 700; }
.verdict-enter { color: var(--green); } .verdict-pass { color: var(--gold); }
.pill { display: inline-block; padding: .07rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--hull2); font-size: .76rem; margin: 0 .25rem .25rem 0; }
pre.wrap { white-space: pre-wrap; word-break: break-word; background: var(--abyss);
  border: 1px solid var(--line); border-radius: 8px; padding: .75rem; max-height: 320px;
  overflow: auto; font-size: .8rem; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--hull);
  border: 1px solid var(--line); border-left: 3px solid var(--cyan); padding: .7rem 1rem;
  border-radius: 8px; max-width: 420px; z-index: 20; }
.toast.err { border-left-color: var(--red); }
.flex { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
[hidden] { display: none !important; }

/* ---------- the signature: probability rail ---------- */
.rail { position: relative; height: 8px; background: var(--hull2);
  border: 1px solid var(--line); border-radius: 4px; }
.rail::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px;
  width: 1px; background: var(--line); }
.rail .mk { position: absolute; top: -3px; width: 3px; height: 12px; border-radius: 2px;
  background: var(--cyan); box-shadow: 0 0 8px #3fd4e066; transform: translateX(-50%); }
.rail .mk.model { background: var(--green); box-shadow: 0 0 8px #2fde8c66; }
.rail .mk.market { background: var(--gold); box-shadow: 0 0 8px #f2c14e66; }
.rail .fill { position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(90deg, #3fd4e022, #3fd4e055); }
.rail-row { display: flex; align-items: center; gap: .6rem; }
.rail-row .rail { flex: 1; }
.rail-val { font-family: var(--mono); font-size: .84rem; min-width: 3.4rem; text-align: right; }

/* ---------- markets: category tabs + radar cards ---------- */
.cat-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1rem; }
.cat-tab { background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 999px; padding: .3rem .85rem; font-weight: 600; font-size: .82rem; cursor: pointer; }
.cat-tab .n { font-family: var(--mono); font-size: .7rem; opacity: .75; margin-left: .3rem; }
.cat-tab.active { color: #05202a; background: var(--cyan); border-color: var(--cyan); }
.radar { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: .8rem; margin-bottom: 1rem; }
.mcard { background: var(--hull); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem .9rem; cursor: pointer; transition: border-color .15s, transform .15s; }
.mcard:hover { border-color: var(--cyan); transform: translateY(-1px); }
.mcard .q { font-weight: 600; font-size: .9rem; line-height: 1.35; min-height: 3.6em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .meta { display: flex; justify-content: space-between; color: var(--dim);
  font-family: var(--mono); font-size: .72rem; margin-top: .55rem; }
.mcard .rail-row { margin-top: .6rem; }
.fit { font-family: var(--mono); font-size: .72rem; padding: .05rem .45rem;
  border-radius: 4px; border: 1px solid var(--line); }
.fit.hi { color: var(--green); border-color: #1e5c3f; }
.fit.mid { color: var(--gold); border-color: #6b5518; }
.fit.lo { color: var(--dim); }

/* ---------- run screen ---------- */
.tabs { display: flex; gap: .4rem; margin-bottom: .8rem; }
.tab { background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 7px; padding: .4rem 1rem; font-weight: 700; font-family: var(--disp); cursor: pointer; }
.tab.active { color: var(--fg); background: var(--hull); border-color: var(--cyan); }
.world-frame { width: 100%; height: 72vh; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; }
.progress { background: var(--abyss); border: 1px solid var(--line); border-radius: 5px;
  height: 10px; overflow: hidden; margin: .45rem 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green));
  width: 0; transition: width .6s; }
.feed { max-height: 430px; overflow-y: auto; display: flex; flex-direction: column; gap: .45rem; }
.feed-item { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .65rem;
  background: var(--hull2); animation: feedin .25s ease-out; }
.feed-meta { color: var(--dim); font-size: .74rem; font-family: var(--mono); }
.feed-meta b { color: var(--cyan); font-weight: 600; }
.feed-content { margin-top: .25rem; white-space: pre-wrap; word-break: break-word; font-size: .85rem; }
@keyframes feedin { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }
.phase-line b { font-family: var(--mono); font-size: .78rem; font-weight: 600; }
.phase-line b.on { color: var(--cyan); }

/* ---------- market screen: chart ---------- */
.tf-row { display: flex; gap: .3rem; }
.tf-btn { background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 6px; padding: .18rem .6rem; cursor: pointer; font-weight: 700;
  font-family: var(--mono); font-size: .76rem; }
.tf-btn.active { color: #05202a; background: var(--cyan); border-color: var(--cyan); }
.chart-box { position: relative; margin: .6rem 0 .3rem; }
.chart-lbl { fill: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.chart-tip { position: absolute; pointer-events: none; background: var(--hull);
  border: 1px solid var(--line); border-radius: 4px; padding: .15rem .45rem;
  font-size: .74rem; font-family: var(--mono); transform: translate(-50%, -135%); white-space: nowrap; }
.live-flash { animation: flash .7s ease-out; }
@keyframes flash { 0% { color: var(--cyan); text-shadow: 0 0 12px #3fd4e0aa; } 100% { } }

/* ---------- settings ---------- */
.gauge-row { display: flex; align-items: center; gap: .7rem; margin: .45rem 0; }
.gauge-row .lbl { width: 8.5rem; color: var(--dim); font-family: var(--mono); font-size: .76rem; }
.gauge-big { flex: 1; position: relative; height: 14px; background: var(--abyss);
  border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.gauge-big i { display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .5s; }
.gauge-big.hot i { background: linear-gradient(90deg, var(--gold), var(--red)); }
.gauge-big .gate { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .8; }
.gauge-row .pct { font-family: var(--mono); font-size: .84rem; min-width: 3rem; text-align: right; }
.model-opt { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; cursor: pointer; }
.model-opt.active { border-color: var(--cyan); background: var(--hull2); }
.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .3rem .8rem; font-size: .86rem; }
.kv .k { color: var(--dim); font-family: var(--mono); font-size: .76rem; }
.kv .v { font-family: var(--mono); }

@media (max-width: 640px) {
  .banner nav { gap: .55rem; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv .v { margin-bottom: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
