@font-face { font-family: "Jersey 15"; src: url(/fonts/Jersey15-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/fonts/Archivo-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --asphalt: #131a2b; --panel: #1c2640; --line: #2e3a5c; --dusk: #3b2a5c; --burlap: #d8b06a; --burlap-shade: #a57e45;
  --neon: #ff6a3d; --glow: #ffd36e; --glow-dim: #d99a2b; --up: #7ff0c8; --down: #f2557d; --ink: #f4ecdd; --muted: #9aa6c2; --ink0: #0b1020;
  --font-pixel: "Jersey 15", "Courier New", monospace; --font-sans: Archivo, "Helvetica Neue", Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Crect x='1' y='0' width='10' height='12' fill='%230b1020'/%3E%3Crect x='0' y='1' width='12' height='10' fill='%230b1020'/%3E%3Crect x='1' y='1' width='10' height='10' fill='%232e3a5c'/%3E%3Crect x='2' y='2' width='8' height='8' fill='%231c2640'/%3E%3Crect x='2' y='2' width='8' height='1' fill='%2326314f'/%3E%3Crect x='2' y='2' width='1' height='8' fill='%2326314f'/%3E%3C/svg%3E"); --frame-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Crect x='1' y='0' width='10' height='12' fill='%230b1020'/%3E%3Crect x='0' y='1' width='12' height='10' fill='%230b1020'/%3E%3Crect x='1' y='1' width='10' height='10' fill='%23ff6a3d'/%3E%3Crect x='2' y='2' width='8' height='8' fill='%23131a2b'/%3E%3Crect x='2' y='2' width='8' height='1' fill='%231c2640'/%3E%3Crect x='2' y='2' width='1' height='8' fill='%231c2640'/%3E%3C/svg%3E"); --frame-plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Crect x='1' y='0' width='10' height='12' fill='%230b1020'/%3E%3Crect x='0' y='1' width='12' height='10' fill='%230b1020'/%3E%3Crect x='1' y='1' width='10' height='10' fill='%23d99a2b'/%3E%3Crect x='2' y='2' width='8' height='8' fill='%23131a2b'/%3E%3Crect x='2' y='2' width='8' height='1' fill='%231c2640'/%3E%3Crect x='2' y='2' width='1' height='8' fill='%231c2640'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--asphalt); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }
.stage { position: fixed; inset: 0; overflow: hidden; }
.city { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; cursor: grab; touch-action: none; }
.city:active { cursor: grabbing; }
.tags, .overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay > * { pointer-events: auto; }

/* pixel frames: every panel is drawn like game UI, not a web card */
.frame { border: 8px solid transparent; border-image: var(--frame) 4 fill / 8px / 0 stretch; background: none; image-rendering: pixelated; }
.frame.hot { border-image-source: var(--frame-hot); }

/* ticker tags over towers */
.bc-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; font: 400 17px/1 var(--font-pixel); white-space: nowrap; color: var(--ink); background: var(--panel); border: 2px solid var(--line); padding: 3px 6px 2px 3px; box-shadow: 3px 3px 0 var(--ink0); will-change: transform; }
.bc-tag img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.bc-tag b { font-weight: 400; color: var(--burlap); }
.bc-tag .up { color: var(--up); } .bc-tag .down { color: var(--down); }
.bc-tag.is-mine { border-color: var(--burlap); }
.bc-tag.is-focus { border-color: var(--neon); background: var(--asphalt); z-index: 2; }
.bc-tag.is-focus::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 6px; height: 6px; margin-left: -3px; background: var(--neon); }

/* neighborhood signs: street-sign plates */
.hood { position: absolute; left: 0; top: 0; --tone: var(--burlap); display: grid; gap: 2px; padding: 8px 12px 7px; background: var(--asphalt); border: 0; box-shadow: 0 0 0 2px var(--ink0), inset 0 4px 0 var(--tone), 5px 5px 0 2px var(--ink0); text-align: left; cursor: pointer; will-change: transform; }
.hood b { font: 400 28px/1 var(--font-pixel); color: var(--ink); white-space: nowrap; }
.hood span { font: 600 12px/15px var(--font-sans); color: var(--tone); white-space: nowrap; }
.hood.tone-up { --tone: var(--up); } .hood.tone-neon { --tone: var(--neon); } .hood.tone-glow { --tone: var(--glow); } .hood.tone-down { --tone: var(--down); } .hood.tone-muted { --tone: var(--muted); }
.hood:hover b { color: var(--tone); }
/* landmark plaques */
.psign { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 1px; padding: 5px 9px 4px; border: 6px solid transparent; border-image: var(--frame-plate) 4 fill / 6px / 0 stretch; cursor: pointer; will-change: transform; }
.psign b { font: 400 19px/1 var(--font-pixel); color: var(--glow); white-space: nowrap; }
.psign span { font: 600 10px/13px var(--font-sans); color: var(--muted); white-space: nowrap; }
.psign:hover b { color: var(--ink); }
/* Meme Square billboards */
.board { position: absolute; left: 0; top: 0; width: 136px; padding: 7px 8px 6px; background: var(--asphalt); border: 3px solid var(--glow-dim); box-shadow: 0 0 0 2px var(--ink0), 4px 4px 0 2px var(--ink0); text-align: center; pointer-events: none; will-change: transform; }
.board .b-k { display: block; font: 600 10px/13px var(--font-sans); color: var(--muted); }
.board .b-v { display: block; font: 400 20px/1 var(--font-pixel); color: var(--glow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board.up .b-v { color: var(--up); } .board.neon { border-color: var(--neon); }

/* top bar */
.top { position: absolute; left: 14px; right: 14px; top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 12px; z-index: 5; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand img { height: 30px; display: block; filter: drop-shadow(3px 3px 0 var(--ink0)); }
.districts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.districts::-webkit-scrollbar { display: none; }
.chip { flex: none; font: 600 13px/18px var(--font-sans); padding: 6px 10px; background: var(--panel); color: var(--ink); border: 0; box-shadow: 0 0 0 2px var(--ink0), inset 0 0 0 2px var(--line), 3px 3px 0 2px var(--ink0); cursor: pointer; white-space: nowrap; }
.chip.is-on { box-shadow: 0 0 0 2px var(--ink0), inset 0 0 0 2px var(--neon), 3px 3px 0 2px var(--ink0); }
.net { margin-left: auto; display: flex; align-items: center; gap: 8px; font: 600 13px/18px var(--font-sans); padding: 0 4px; white-space: nowrap; font-variant-numeric: tabular-nums; border-width: 6px; border-image-width: 6px; }
.live { width: 8px; height: 8px; background: var(--neon); display: inline-block; flex: none; }
@media (prefers-reduced-motion: no-preference) { .live { animation: blink 1.2s steps(2, jump-none) infinite; } }
@keyframes blink { 50% { opacity: .25; } }

/* buttons: pixel blocks with a pressed edge */
.btn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; justify-content: center; font: 400 24px/1 var(--font-pixel); padding: 11px 16px 10px; border: 0; background: var(--neon); color: var(--asphalt); box-shadow: 0 0 0 2px var(--ink0), inset 0 -4px 0 rgba(11,16,32,.35), 4px 4px 0 2px var(--ink0); cursor: pointer; text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 2px var(--ink0), inset 0 -2px 0 rgba(11,16,32,.35), 2px 2px 0 2px var(--ink0); }
.btn.ghost { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 2px var(--ink0), inset 0 0 0 2px var(--muted), 4px 4px 0 2px var(--ink0); }
.btn.small { flex: none; font-size: 20px; padding: 8px 13px 7px; }
.connect.is-on { background: var(--burlap); }

/* panel */
.panel { position: absolute; left: 14px; bottom: calc(36px + var(--safe-b)); width: 392px; max-height: calc(100% - 110px); overflow: auto; padding: 10px 14px 8px; z-index: 6; scrollbar-width: thin; }
.panel[data-mode="token"] .v-place, .panel[data-mode="place"] .v-token { display: none; }
.grab { display: none; }
.p-head { display: flex; align-items: center; gap: 12px; }
.p-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--line); object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--ink0); }
.p-names { min-width: 0; flex: 1; }
.p-ticker { font: 400 36px/1 var(--font-pixel); color: var(--burlap); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-name { font: 500 13px/18px var(--font-sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state { font: 600 12px/16px var(--font-sans); padding: 4px 8px; box-shadow: inset 0 0 0 2px var(--line); white-space: nowrap; }
.state.pump, .state.new { box-shadow: inset 0 0 0 2px var(--up); } .state.dump { box-shadow: inset 0 0 0 2px var(--down); }
.p-flags { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.mine { font: 600 12px/16px var(--font-sans); color: var(--asphalt); background: var(--burlap); padding: 3px 8px; }
.find, .back { font: 600 12px/16px var(--font-sans); padding: 4px 9px; background: transparent; color: var(--ink); border: 0; box-shadow: inset 0 0 0 2px var(--muted); cursor: pointer; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 12px 0 10px; }
.label { font: 600 12px/16px var(--font-sans); color: var(--muted); }
.stat { font: 400 32px/1 var(--font-pixel); font-variant-numeric: tabular-nums; }
.sub { font: 600 13px/18px var(--font-sans); margin-top: 2px; }
.up { color: var(--up); } .down { color: var(--down); }
.tabs { display: flex; gap: 6px; margin: 4px 0 6px; }
.tab { font: 400 18px/1 var(--font-pixel); padding: 4px 8px 3px; border: 0; background: transparent; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; color: var(--muted); }
.tab.is-on { color: var(--ink); box-shadow: inset 0 0 0 2px var(--muted); }
.chart { position: relative; height: 176px; margin-bottom: 12px; background: var(--asphalt); box-shadow: 0 0 0 2px var(--ink0); overflow: hidden; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; font: 500 13px/18px var(--font-sans); color: var(--muted); }
.actions { display: flex; gap: 12px; margin: 4px 4px 6px 0; }
.actions .btn:first-child { flex: 1.6; }
.sect { margin-top: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.links a, .links .btn { font: 600 13px/18px var(--font-sans); color: var(--ink); text-decoration: none; padding: 5px 9px; box-shadow: inset 0 0 0 2px var(--line); }
.links a:hover { box-shadow: inset 0 0 0 2px var(--glow-dim); color: var(--glow); }
.links .btn { font: 400 18px/1 var(--font-pixel); color: var(--asphalt); box-shadow: 0 0 0 2px var(--ink0), inset 0 -3px 0 rgba(11,16,32,.35); }
.ca { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ca-copy { font: 500 12px/16px var(--font-sans); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 290px; text-align: left; }
.rail-in { display: none; margin-top: 12px; }
/* place view */
.pl-title { font: 400 36px/1 var(--font-pixel); color: var(--glow); margin-top: 10px; }
.pl-who { font: 600 13px/18px var(--font-sans); color: var(--burlap); margin-top: 4px; }
.pl-blurb { font: 420 14px/20px var(--font-sans); color: var(--ink); margin: 10px 0; }
.pnote { font: 420 14px/20px var(--font-sans); color: var(--muted); margin: 8px 0; }
.pnote b { color: var(--ink); }
.plist { list-style: none; margin: 8px 0; padding: 0; }
.prow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; font: 400 20px/1 var(--font-pixel); box-shadow: inset 0 -2px 0 var(--line); }
.prow[data-id] { cursor: pointer; } .prow[data-id]:hover { background: var(--asphalt); color: var(--glow); }
.prow em { font: 500 12px/16px var(--font-sans); color: var(--muted); font-style: normal; margin-left: 6px; }
.pl-acts { margin: 10px 0 6px; gap: 10px; }

/* right rail: minimap + trades */
.rail { position: absolute; right: 14px; top: calc(62px + var(--safe-t)); bottom: calc(36px + var(--safe-b)); width: 300px; display: flex; flex-direction: column; z-index: 6; padding: 0; }
.mini { display: block; width: 100%; aspect-ratio: 2 / 1; image-rendering: pixelated; cursor: crosshair; box-shadow: 0 2px 0 var(--line); }
.r-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px; }
.r-head h2 { margin: 0; font: 400 24px/1 var(--font-pixel); }
.r-sub { margin-left: auto; font: 500 11px/15px var(--font-sans); color: var(--muted); }
.trades { list-style: none; margin: 0; padding: 0 2px; overflow: auto; flex: 1; scrollbar-width: thin; }
.trade { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; }
.trade a { color: inherit; text-decoration: none; }
.trade .k { font: 400 18px/1 var(--font-pixel); }
.trade .usd { font: 400 22px/1 var(--font-pixel); font-variant-numeric: tabular-nums; }
.trade .w, .trade .ago { font: 500 11px/15px var(--font-sans); color: var(--muted); }
.trade .ago { text-align: right; }
.trade.fresh { background: var(--asphalt); }
.empty { padding: 14px 8px; font: 500 13px/18px var(--font-sans); color: var(--muted); }

.ctl { position: absolute; right: 332px; bottom: calc(36px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; z-index: 6; }
.cbtn { width: 44px; height: 44px; font: 400 26px/1 var(--font-pixel); background: var(--panel); color: var(--ink); border: 0; box-shadow: 0 0 0 2px var(--ink0), inset 0 0 0 2px var(--line), 3px 3px 0 2px var(--ink0); cursor: pointer; }
.cbtn.tilt { display: none; font-size: 16px; }
.cbtn.is-on { box-shadow: 0 0 0 2px var(--ink0), inset 0 0 0 2px var(--neon), 3px 3px 0 2px var(--ink0); }

.hint { position: absolute; left: 50%; bottom: calc(36px + var(--safe-b)); transform: translateX(-50%); width: min(480px, calc(100% - 800px)); min-width: 300px; display: flex; gap: 14px; align-items: center; padding: 4px 6px; z-index: 7; }
.hint p { margin: 0; font: 420 14px/20px var(--font-sans); }
.hint.gone { display: none; }
.foot { position: absolute; left: 14px; right: 330px; bottom: calc(10px + var(--safe-b)); font: 500 11px/16px var(--font-sans); color: var(--muted); z-index: 4; text-shadow: 0 1px 0 var(--asphalt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* phones */
@media (max-width: 860px) {
  .top { left: 8px; right: 8px; gap: 8px; flex-wrap: wrap; }
  .brand img { height: 22px; }
  .net { order: 2; margin-left: auto; font-size: 12px; }
  .connect { order: 3; font-size: 17px; padding: 6px 10px 5px; }
  .districts { order: 4; width: 100%; }
  .chip { font-size: 12px; padding: 5px 8px; }
  .panel { left: 6px; right: 6px; width: auto; bottom: calc(6px + var(--safe-b)); max-height: 70%; padding: 2px 10px 8px; }
  .grab { display: block; width: 100%; height: 20px; border: 0; background: none; cursor: pointer; position: relative; }
  .grab::after { content: ""; position: absolute; left: 50%; top: 7px; width: 44px; height: 4px; margin-left: -22px; background: var(--line); }
  .p-ticker { font-size: 30px; } .stat { font-size: 27px; } .pl-title { font-size: 30px; margin-top: 0; }
  .panel:not(.is-open) .more, .panel:not(.is-open) .v-place #plBody, .panel:not(.is-open) .v-place .pl-blurb { display: none; }
  .panel.is-open .rail-in { display: block; }
  .rail { top: auto; bottom: auto; right: 8px; top: calc(100px + var(--safe-t)); width: 132px; height: auto; background: none; border: 0; }
  .rail .r-head, .rail .trades { display: none; }
  .mini { box-shadow: 0 0 0 2px var(--ink0), 3px 3px 0 2px var(--ink0); }
  .ctl { right: 8px; bottom: auto; top: calc(176px + var(--safe-t)); }
  .cbtn { width: 40px; height: 40px; } .cbtn.tilt { display: block; }
  .hood b { font-size: 21px; } .hood { padding: 6px 9px 5px; }
  .hint { width: auto; left: 6px; right: 150px; transform: none; bottom: auto; top: calc(100px + var(--safe-t)); min-width: 0; flex-direction: column; align-items: flex-start; }
  .foot { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .top { flex-wrap: nowrap; } .districts { width: auto; order: 0; } .brand img { height: 20px; }
  .panel { left: 6px; right: auto; width: 300px; top: 52px; bottom: 6px; max-height: none; }
  .panel:not(.is-open) .more { display: none; }
  .rail { top: 52px; right: 6px; width: 128px; }
  .ctl { top: 124px; right: 6px; bottom: auto; } .cbtn.tilt { display: block; }
  .hint { top: auto; bottom: 6px; left: 316px; right: 150px; flex-direction: row; }
  .foot { display: none; }
}
