:root {
  --ink: #080b0b;
  --panel: #101515;
  --panel-2: #151b1a;
  --line: rgba(218, 201, 158, .15);
  --paper: #e6dfcb;
  --muted: #898d83;
  --gold: #d7a94b;
  --gold-soft: #8b713c;
  --bull: #3ecf8e;
  --bull-deep: #0d7652;
  --bear: #ef6262;
  --bear-deep: #8c252b;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --display: "Arial Narrow", "Aptos Display", Impact, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% -10%, rgba(215, 169, 75, .1), transparent 33rem),
    radial-gradient(circle at 8% 35%, rgba(13, 118, 82, .08), transparent 31rem),
    radial-gradient(circle at 92% 36%, rgba(140, 37, 43, .08), transparent 31rem),
    var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .22;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

button, a { font: inherit; }
a { color: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: -50px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--gold);
}
.skip-link:focus { top: 12px; }

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .16;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 11, .88);
  backdrop-filter: blur(15px);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-coin {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #17130a;
  background: var(--gold);
  border: 1px solid #f0cf83;
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(215, 169, 75, .2);
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 800;
  transform: rotate(8deg);
}

.brand strong, .brand small { display: block; }
.brand strong {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .13em;
}
.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .2em;
}

.header-actions { display: flex; align-items: center; gap: 18px; }
.battle-clock { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.battle-clock strong { color: var(--paper); font-size: 11px; }
.battle-clock i { width: 1px; height: 19px; margin: 0 4px; background: var(--line); }

.signal-pill, .node-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 2px;
  letter-spacing: .12em;
  font-size: 9px;
}

.signal-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #101414;
  cursor: pointer;
}
.signal-pill:hover { border-color: var(--gold-soft); color: var(--paper); }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px currentColor; }
.signal-pill.is-live { color: var(--bull); border-color: rgba(62, 207, 142, .3); }
.signal-pill.is-live .signal-dot { background: var(--bull); animation: livePulse 1.8s infinite; }
.signal-pill.is-demo { color: var(--gold); border-color: rgba(215, 169, 75, .32); }
.signal-pill.is-demo .signal-dot { background: var(--gold); }
.signal-pill.is-offline { color: var(--bear); }
.signal-pill.is-offline .signal-dot { background: var(--bear); }

.node-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
}
.node-link:hover { color: var(--gold); border-color: var(--gold-soft); }

main { width: min(1536px, 100%); margin: 0 auto; padding: 0 clamp(14px, 2.6vw, 42px) 56px; }

.command-deck {
  display: grid;
  grid-template-columns: minmax(230px, .82fr) minmax(390px, 1.36fr) minmax(230px, .82fr);
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}

.army-card, .market-core { position: relative; min-height: 186px; background: rgba(15, 20, 20, .92); overflow: hidden; }
.army-card { padding: 23px 24px 19px; }
.army-card::after {
  position: absolute;
  right: -50px;
  bottom: -95px;
  width: 200px;
  height: 200px;
  content: "";
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 50%;
  box-shadow: 0 0 0 25px rgba(255,255,255,.015), 0 0 0 58px rgba(255,255,255,.01);
}
.bear-card::after { right: auto; left: -50px; }

.army-heading { display: flex; align-items: center; gap: 13px; }
.army-heading p, .eyebrow, .section-kicker, .intel-heading span {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .19em;
}
.army-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: .09em;
}
.bull-card h2, .bull-card .army-count strong { color: var(--bull); }
.bear-card h2, .bear-card .army-count strong { color: var(--bear); }

.army-sigil { position: relative; display: block; width: 39px; height: 39px; border: 1px solid currentColor; border-radius: 50%; opacity: .9; }
.bull-sigil { color: var(--bull); }
.bull-sigil::before {
  position: absolute; inset: 8px 9px 9px; content: ""; border: 5px solid currentColor; border-top: 0; border-radius: 4px 4px 11px 11px;
}
.bull-sigil::after {
  position: absolute; top: 6px; left: 5px; width: 27px; height: 10px; content: ""; border-top: 3px solid currentColor; border-radius: 50%; transform: rotate(8deg);
}
.bear-sigil { color: var(--bear); }
.bear-sigil::before { position: absolute; inset: 8px; content: ""; background: currentColor; border-radius: 45% 45% 50% 50%; }
.bear-sigil::after { position: absolute; top: 5px; left: 7px; width: 8px; height: 8px; content: ""; border: 5px solid currentColor; border-radius: 50%; box-shadow: 13px 0 0 -5px var(--panel), 13px 0 0 0 currentColor; }

.army-count { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
.army-count strong { font-family: var(--display); font-size: clamp(35px, 3vw, 47px); line-height: .9; letter-spacing: .02em; }
.army-count span { color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.army-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.army-stats div { display: flex; flex-direction: column; gap: 4px; }
.army-stats span { color: var(--muted); font-size: 7px; letter-spacing: .13em; }
.army-stats strong { font-size: 11px; }

.market-core { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 30px 10px; text-align: center; }
.market-core::before { position: absolute; top: 0; left: 50%; width: 1px; height: 14px; content: ""; background: var(--gold); box-shadow: 0 172px 0 var(--gold); }
.eyebrow { color: var(--gold); }
.price-line { display: flex; align-items: flex-start; justify-content: center; margin-top: 5px; }
.price-line .currency { margin: 6px 5px 0 0; color: var(--gold-soft); font-family: var(--display); font-size: 22px; }
.price-line strong { font-family: var(--display); font-size: clamp(42px, 4.5vw, 66px); line-height: .93; letter-spacing: .015em; text-shadow: 0 0 28px rgba(230, 223, 203, .08); }
.price-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 8px; letter-spacing: .09em; }
.price-meta .positive { color: var(--bull); }
.price-meta .negative { color: var(--bear); }
.divider { opacity: .32; }
.price-spark { width: min(420px, 86%); height: 32px; margin-top: 2px; overflow: visible; }
.spark-line { fill: none; stroke: var(--gold); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.spark-area { fill: url(#sparkFill); }

.pressure-section { display: grid; grid-template-columns: 125px 1fr 125px; align-items: center; gap: 13px; margin: 14px 2px 18px; }
.pressure-label { display: flex; align-items: baseline; gap: 7px; }
.pressure-label strong { font-family: var(--display); font-size: 20px; }
.pressure-label span { color: var(--muted); font-size: 7px; letter-spacing: .11em; }
.bear-label { justify-content: flex-end; }
.bull-label strong { color: var(--bull); }
.bear-label strong { color: var(--bear); }
.pressure-track { position: relative; height: 9px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--bull-deep), var(--bear-deep)); overflow: visible; }
.pressure-bull { width: 50%; height: 100%; background: var(--bull); opacity: .78; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.pressure-mid { position: absolute; top: -4px; left: 50%; width: 2px; height: 15px; background: var(--paper); box-shadow: 0 0 10px rgba(255,255,255,.35); transition: left .8s cubic-bezier(.2,.7,.2,1); }
.pressure-mid span { position: absolute; top: 19px; left: 50%; width: max-content; color: var(--muted); font-size: 7px; letter-spacing: .14em; transform: translateX(-50%); }

.battle-panel { border: 1px solid var(--line); background: rgba(13, 17, 17, .94); box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.panel-header { display: flex; justify-content: space-between; align-items: center; min-height: 74px; padding: 13px 21px; border-bottom: 1px solid var(--line); }
.section-kicker { color: var(--gold); }
.panel-header h1 { margin: 0; font-family: var(--display); font-size: 21px; letter-spacing: .1em; }
.battle-verdict { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; text-align: right; }
.battle-verdict span { color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.battle-verdict strong { color: var(--gold); font-family: var(--display); font-size: 14px; letter-spacing: .08em; }
.battle-verdict.bulls strong { color: var(--bull); }
.battle-verdict.bears strong { color: var(--bear); }

.canvas-wrap { position: relative; height: clamp(360px, 44vw, 610px); min-height: 360px; overflow: hidden; background: #090d0c; }
#battleCanvas { display: block; width: 100%; height: 100%; }
.canvas-wrap::after { position: absolute; inset: 0; content: ""; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.6); }
.theater-label { position: absolute; top: 17px; display: flex; align-items: center; gap: 8px; color: rgba(230,223,203,.55); font-size: 7px; letter-spacing: .18em; }
.theater-label i { width: 28px; height: 1px; background: currentColor; }
.theater-left { left: 18px; color: rgba(62,207,142,.63); }
.theater-right { right: 18px; color: rgba(239,98,98,.63); }

.price-standard { position: absolute; top: 45%; left: 50%; z-index: 3; display: flex; align-items: center; flex-direction: column; pointer-events: none; transform: translate(-50%, -50%); transition: left .8s cubic-bezier(.2,.7,.2,1); }
.price-standard span { display: grid; width: 54px; height: 54px; place-items: center; color: #191408; background: var(--gold); border: 3px solid #e8ca80; border-radius: 50%; box-shadow: 0 0 0 5px rgba(215,169,75,.14), 0 0 33px rgba(215,169,75,.27); font-family: Arial, sans-serif; font-size: 31px; font-weight: 900; transform: rotate(7deg); }
.price-standard::after { width: 1px; height: 74px; content: ""; background: linear-gradient(var(--gold), transparent); }
.price-standard small { order: -1; margin-bottom: 8px; padding: 4px 7px; color: var(--gold); background: rgba(8,11,11,.82); border: 1px solid rgba(215,169,75,.3); font-size: 9px; letter-spacing: .06em; }

.demo-banner { position: absolute; bottom: 17px; left: 50%; z-index: 4; display: flex; align-items: center; gap: 11px; padding: 8px 12px; color: var(--gold); background: rgba(8,11,11,.9); border: 1px solid rgba(215,169,75,.35); transform: translateX(-50%); }
.demo-banner[hidden] { display: none; }
.demo-banner strong { font-size: 8px; letter-spacing: .13em; }
.demo-banner span { color: var(--muted); font-size: 8px; }

.battle-legend { display: flex; min-height: 48px; align-items: center; gap: clamp(12px, 2.6vw, 34px); padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; letter-spacing: .07em; }
.battle-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.bull-dot { background: var(--bull); box-shadow: 0 0 8px var(--bull); }
.bear-dot { background: var(--bear); box-shadow: 0 0 8px var(--bear); }
.legend-bolt { width: 6px; height: 10px; background: var(--gold); clip-path: polygon(55% 0, 100% 0, 63% 40%, 100% 40%, 0 100%, 34% 51%, 0 51%); }
.battle-controls { display: flex; gap: 7px; margin-left: auto; }
.battle-legend button { padding: 7px 10px; color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 8px; letter-spacing: .1em; }
.battle-legend button:hover { color: var(--gold); border-color: var(--gold-soft); }
.battle-legend button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold-soft); background: rgba(215,169,75,.08); }

.intel-grid { display: grid; grid-template-columns: 1fr .94fr 1fr; gap: 12px; margin-top: 12px; }
.intel-card { min-height: 335px; padding: 19px; border: 1px solid var(--line); background: rgba(15,20,20,.93); }
.intel-heading { display: flex; align-items: flex-start; justify-content: space-between; min-height: 40px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.intel-heading h3 { margin: 0; font-family: var(--display); font-size: 14px; letter-spacing: .11em; }
.intel-heading > div > span { color: var(--gold); }
.intel-heading > .refresh-rate { margin: 0; padding: 5px 6px; color: var(--muted); border: 1px solid var(--line); font-size: 7px; }

.book-head, .book-row { display: grid; grid-template-columns: .9fr 1.15fr 1.15fr .9fr; align-items: center; text-align: center; }
.book-head { padding: 11px 6px 7px; color: var(--muted); font-size: 7px; letter-spacing: .12em; }
.book-ladder { min-height: 220px; }
.book-row { position: relative; height: 40px; border-top: 1px solid rgba(255,255,255,.035); overflow: hidden; }
.book-row > span { z-index: 1; font-size: 10px; }
.book-row .book-price { color: var(--paper); font-weight: bold; }
.book-row .bid-size { color: var(--bull); }
.book-row .ask-size { color: var(--bear); }
.depth-bar { position: absolute; top: 6px; bottom: 6px; opacity: .13; transition: width .7s ease; }
.depth-bar.bid { right: 50%; background: var(--bull); }
.depth-bar.ask { left: 50%; background: var(--bear); }
.book-empty { display: grid; min-height: 220px; place-items: center; color: var(--muted); font-size: 9px; text-align: center; }

.momentum-dial { position: relative; width: min(310px, 90%); height: 105px; margin: 22px auto 0; overflow: hidden; border-bottom: 1px solid var(--line); }
.momentum-dial::before { position: absolute; bottom: -102px; left: 50%; width: 202px; height: 202px; content: ""; border: 16px solid transparent; border-top-color: var(--gold-soft); border-left-color: var(--bull-deep); border-right-color: var(--bear-deep); border-radius: 50%; transform: translateX(-50%) rotate(45deg); opacity: .7; }
.dial-scale { position: absolute; bottom: -82px; left: 50%; width: 164px; height: 164px; transform: translateX(-50%); }
.dial-scale i { position: absolute; top: 0; left: 50%; width: 1px; height: 10px; background: rgba(230,223,203,.48); transform-origin: 0 82px; }
.dial-scale i:nth-child(1) { transform: rotate(-75deg); }.dial-scale i:nth-child(2) { transform: rotate(-56deg); }.dial-scale i:nth-child(3) { transform: rotate(-37deg); }.dial-scale i:nth-child(4) { transform: rotate(-18deg); }.dial-scale i:nth-child(5) { transform: rotate(0); }.dial-scale i:nth-child(6) { transform: rotate(18deg); }.dial-scale i:nth-child(7) { transform: rotate(37deg); }.dial-scale i:nth-child(8) { transform: rotate(56deg); }.dial-scale i:nth-child(9) { transform: rotate(75deg); }
.dial-needle { position: absolute; bottom: 0; left: 50%; width: 2px; height: 76px; background: var(--paper); box-shadow: 0 0 9px rgba(255,255,255,.35); transform: rotate(0deg); transform-origin: 50% 100%; transition: transform .8s ease; }
.dial-needle::after { position: absolute; bottom: -6px; left: 50%; width: 12px; height: 12px; content: ""; background: var(--paper); border-radius: 50%; transform: translateX(-50%); }
.dial-bull, .dial-bear { position: absolute; bottom: 10px; font-family: var(--display); font-size: 9px; letter-spacing: .12em; }
.dial-bull { left: 5px; color: var(--bull); }.dial-bear { right: 5px; color: var(--bear); }
.momentum-copy { min-height: 74px; padding: 15px 10px 10px; text-align: center; }
.momentum-copy strong { color: var(--gold); font-family: var(--display); font-size: 17px; letter-spacing: .08em; }
.momentum-copy p { max-width: 330px; margin: 7px auto 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.wall-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.wall-stats div { display: grid; gap: 5px; padding: 13px 10px 0; }
.wall-stats div + div { border-left: 1px solid var(--line); text-align: right; }
.wall-stats span { color: var(--muted); font-size: 7px; letter-spacing: .09em; }
.wall-stats strong { font-size: 13px; }
.wall-stats div:first-child strong { color: var(--bull); }.wall-stats div:last-child strong { color: var(--bear); }
.wall-stats small { color: var(--muted); font-size: 8px; }

.live-mark { display: flex; align-items: center; gap: 5px; color: var(--bull) !important; }
.live-mark i { width: 5px; height: 5px; background: var(--bull); border-radius: 50%; animation: livePulse 1.8s infinite; }
.dispatch-list { height: 245px; margin: 10px 0 0; padding: 0; list-style: none; overflow: hidden; }
.dispatch-list li { display: grid; grid-template-columns: 65px 1fr; min-height: 48px; padding: 10px 3px; border-bottom: 1px solid rgba(255,255,255,.045); animation: dispatchIn .35s ease; }
.dispatch-list time { color: var(--gold-soft); font-size: 8px; }
.dispatch-list p { margin: 0; color: #b9b8ae; font-size: 9px; line-height: 1.45; }
.dispatch-list li.bull p { color: #b5d9c8; }.dispatch-list li.bear p { color: #ddbab8; }

.method-note { max-width: 1080px; margin: 20px auto 0; color: #686d65; font-size: 8px; line-height: 1.65; text-align: center; letter-spacing: .04em; }
.method-note strong { color: var(--gold-soft); }

footer { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 14px clamp(18px, 3vw, 48px); color: #5e625c; border-top: 1px solid var(--line); font-size: 8px; letter-spacing: .13em; }
footer a { color: var(--gold-soft); text-decoration: none; }

@keyframes livePulse { 50% { opacity: .42; box-shadow: 0 0 0 5px rgba(62,207,142,0); } }
@keyframes dispatchIn { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 980px) {
  .battle-clock { display: none; }
  .command-deck { grid-template-columns: 1fr 1fr; }
  .market-core { grid-column: 1 / -1; grid-row: 1; }
  .army-card { min-height: 166px; }
  .intel-grid { grid-template-columns: 1fr 1fr; }
  .dispatch-card { grid-column: 1 / -1; min-height: 270px; }
  .dispatch-list { height: 190px; }
}

@media (max-width: 680px) {
  .site-header { min-height: 64px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 7px; }
  .brand-coin { width: 35px; height: 35px; font-size: 21px; }
  .node-link { display: none; }
  .signal-pill { padding: 0 9px; }
  main { padding-inline: 9px; }
  .command-deck { margin-top: 12px; }
  .market-core { min-height: 164px; padding-inline: 12px; }
  .price-line strong { font-size: 39px; }
  .army-card { min-height: 150px; padding: 16px 14px; }
  .army-sigil { width: 33px; height: 33px; }
  .army-heading h2 { font-size: 15px; }
  .army-heading p { font-size: 7px; }
  .army-count { margin-top: 16px; }
  .army-count strong { font-size: 32px; }
  .army-stats { display: block; margin-top: 12px; }
  .army-stats div + div { display: none; }
  .pressure-section { grid-template-columns: 68px 1fr 68px; gap: 7px; }
  .pressure-label { flex-direction: column; gap: 1px; }
  .bear-label { align-items: flex-end; }
  .pressure-label strong { font-size: 16px; }
  .pressure-label span { font-size: 6px; }
  .panel-header { padding-inline: 12px; }
  .panel-header h1 { font-size: 16px; }
  .battle-verdict strong { font-size: 11px; }
  .canvas-wrap { height: 410px; }
  .price-standard span { width: 44px; height: 44px; font-size: 25px; }
  .demo-banner { width: calc(100% - 20px); justify-content: center; }
  .demo-banner span { display: none; }
  .battle-legend { justify-content: space-between; }
  .battle-legend span:nth-child(2), .battle-legend span:nth-child(3) { display: none; }
  .battle-controls { margin-left: 0; }
  .intel-grid { grid-template-columns: 1fr; }
  .dispatch-card { grid-column: auto; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
