:root {
  --bg: #070908;
  --panel: #0d110f;
  --line: #1c2520;
  --text: #e6ede8;
  --muted: #7f8f86;
  --green: #3dff8a;
  --green-d: #1f8f4e;
  --red: #ff3b3b;
  --amber: #ffb020;
  --blue: #7cc4ff;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --head: 'Chakra Petch', system-ui, sans-serif;
  --cabar: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; padding-bottom: calc(var(--cabar) + env(safe-area-inset-bottom)); overflow-x: hidden; }
a { color: var(--green); }
button { font: inherit; }

/* ---------- header ---------- */
#top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: rgba(7, 9, 8, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #1f3a2a; flex: 0 0 auto; }
.name { display: flex; flex-direction: column; min-width: 0; }
.mark { font: 700 22px/1 var(--head); letter-spacing: .06em; }
.mark b { color: var(--green); margin-left: 6px; }
.tag { font: 500 11px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#live-dot { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
#live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#live-dot.on { color: var(--green); }
#live-dot.on::before { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.icon { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon svg path:first-child { fill: currentColor; }
.icon .off { display: none; }
.icon.off .on { display: none; }
.icon.off .off { display: inline; }

#announce { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--amber); border-radius: 10px; color: var(--amber); font: 500 13px var(--mono); }

/* ---------- layout ---------- */
#app { display: grid; gap: 14px; padding: 12px 16px 16px; max-width: 1400px; margin: 0 auto; }
@media (min-width: 980px) {
  #app { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); align-items: start; }
  #watch { position: sticky; top: 72px; }
}

/* ---------- siren bar ---------- */
#siren { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); transition: background .3s, border-color .3s; }
#siren .lamp { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--green-d); box-shadow: 0 0 10px var(--green-d); }
#siren .txt { display: flex; flex-direction: column; min-width: 0; }
#siren .k { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
#siren .v { font: 700 17px/1.3 var(--mono); overflow-wrap: anywhere; }
#siren.move .lamp { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
#siren.alarm { background: #2a0b0b; border-color: var(--red); animation: alarm .5s 6 alternate; }
#siren.alarm .lamp { background: var(--red); box-shadow: 0 0 18px var(--red); animation: blink .25s infinite; }
#siren.alarm .k { color: var(--red); }
@keyframes alarm { to { background: #4a0f0f; } }

/* ---------- radar ---------- */
#scope { position: relative; margin-top: 12px; width: 100%; aspect-ratio: 1 / 1; max-height: calc(100vh - 230px); max-width: calc(100vh - 230px); min-height: 300px; margin-left: auto; margin-right: auto; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 50%, #0b1a12 0%, #06100a 60%, #040806 100%); border: 1px solid #12301f; box-shadow: inset 0 0 60px rgba(61, 255, 138, .06); }
@media (max-width: 979px) { #scope { max-height: none; max-width: 560px; } }
#radar { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; padding: 10px 14px; border-radius: 14px; background: rgba(4, 8, 6, .72); border: 1px solid rgba(61, 255, 138, .18); }
#center .lbl { font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
#center .big { font: 700 clamp(30px, 10vw, 54px)/1.05 var(--head); color: var(--green); text-shadow: 0 0 18px rgba(61, 255, 138, .35); }
#center .sub { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
#center .sub b { color: var(--text); }

#banner { position: absolute; left: 13%; right: 13%; top: 17%; text-align: center; padding: 10px 12px; border-radius: 12px; background: rgba(20, 4, 4, .9); border: 1px solid var(--red); animation: pop .25s ease-out; }
#banner.green { background: rgba(4, 20, 10, .92); border-color: var(--green); }
#banner.amber { background: rgba(24, 16, 2, .92); border-color: var(--amber); }
#banner .kicker { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--red); }
#banner.green .kicker { color: var(--green); }
#banner.amber .kicker { color: var(--amber); }
#banner .title { font: 700 clamp(18px, 5.4vw, 28px)/1.15 var(--head); }
#banner .sub { font: 500 12px/1.4 var(--mono); color: #c9d4cd; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
#preview-tag { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); font: 500 11px var(--mono); color: var(--amber); background: rgba(0, 0, 0, .6); padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 176, 32, .4); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.chip { font: 500 12px var(--mono); color: var(--muted); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.chip b { color: var(--text); }

/* ---------- panels ---------- */
#side { display: grid; gap: 14px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.panel h2 { margin: 0 0 8px; font: 700 16px var(--head); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: baseline; gap: 8px; }
.panel h2 small { font: 500 11px var(--mono); color: var(--muted); text-transform: none; letter-spacing: 0; }
.hint, .fine { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.fine { margin: 10px 0 0; font-size: 12px; }
#how ul { margin: 0; padding-left: 18px; color: #c4cfc8; font-size: 14px; }
#how li { margin: 6px 0; }

/* moves */
#moves, #feed { list-style: none; margin: 0; padding: 0; }
#moves { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
#moves li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 2px; border-top: 1px solid var(--line); font: 500 13px/1.35 var(--mono); }
#moves li:first-child { border-top: 0; }
#moves li.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(61, 255, 138, .14); } }
#moves .amt { font-weight: 700; font-size: 15px; color: var(--green); }
#moves li.big .amt { color: var(--red); }
#moves li.mid .amt { color: var(--amber); }
#moves .usd { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
#moves time { color: var(--muted); font-size: 12px; text-align: right; }
#moves .path { grid-column: 1 / -1; color: #aebbb3; overflow-wrap: anywhere; }
#moves .path a { color: #aebbb3; text-decoration: none; border-bottom: 1px dotted #4a5a50; }
.t { display: inline-block; font: 700 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 6px; border-radius: 6px; margin-left: 4px; font-style: normal; vertical-align: 1px; }
.t.swept { background: rgba(255, 59, 59, .16); color: #ff7b7b; }
.t.old { background: rgba(255, 176, 32, .16); color: var(--amber); }
.t.busy { background: rgba(124, 196, 255, .14); color: var(--blue); }
.t.fresh { background: rgba(61, 255, 138, .12); color: var(--green); }

/* events */
#feed li { padding: 8px 2px; border-top: 1px solid var(--line); font: 500 13px/1.45 var(--mono); color: #c4cfc8; }
#feed li:first-child { border-top: 0; }
#feed time { color: var(--muted); margin-right: 8px; }
#feed .y { color: var(--amber); font-weight: 700; }
#feed .r { color: var(--red); font-weight: 700; }
#feed .g { color: var(--green); font-weight: 700; }

/* bunkers */
#bunkers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) and (max-width: 979px) { #bunkers { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bk { position: relative; background: #0a0e0c; border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px 6px; text-align: center; min-width: 0; }
.bk.me { border-color: var(--green); }
.bk.new { animation: land .9s ease-out; }
@keyframes land { 0% { transform: translateY(-14px) scale(1.1); border-color: var(--green); box-shadow: 0 0 22px rgba(61, 255, 138, .5); } }
.bk svg { width: 100%; height: auto; display: block; }
.bk .w { font: 700 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .s { font: 500 10px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .x { font: 500 10px var(--mono); color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .x.clean { color: var(--green); }
.bk .rk { position: absolute; top: 4px; left: 6px; font: 700 10px var(--mono); color: var(--muted); }
.empty { color: var(--muted); font: 500 13px var(--mono); grid-column: 1 / -1; padding: 8px 0; }

/* ---------- CA bar ---------- */
#cabar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 8px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(7, 9, 8, .96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.ca { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ca .lbl { font: 700 11px var(--mono); color: var(--muted); }
.ca code { font: 500 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.btn { flex: 0 0 auto; min-height: 44px; min-width: 64px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--green); color: #031008; font: 700 15px var(--head); letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- stream (pump.fun livestream) + OG ---------- */
body.stream { padding: 0; overflow: hidden; }
body.stream #top, body.stream #side, body.stream #cabar, body.stream #announce { display: none; }
body.stream #app { display: block; padding: 18px; max-width: none; height: 100vh; }
body.stream #watch { position: static; }
body.stream #scope { max-height: calc(100vh - 200px); max-width: calc(100vh - 200px); }
@media (min-aspect-ratio: 4/3) {
  body.stream #app { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
  body.stream #siren { min-height: 80px; }
  body.stream #siren .v { font-size: 22px; }
  body.stream #scope { max-height: calc(100vh - 170px); max-width: calc(100vh - 170px); }
  body.stream .chips { display: none; }
  body.stream #side { display: grid; align-content: start; height: calc(100vh - 36px); }
  body.stream #side > :not(#feed-panel) { display: none; }
  body.stream #moves { max-height: calc(100vh - 110px); overflow: hidden; }
  body.stream #moves li { font-size: 15px; }
  body.stream #moves .amt { font-size: 18px; }
}
body.og #siren, body.og .chips, body.og #side, body.og #top, body.og #cabar, body.og #preview-tag { display: none !important; }
body.og #ogtitle { display: block !important; }
#ogtitle { position: fixed; left: 56px; top: 50%; transform: translateY(-50%); max-width: 520px; }
#ogtitle .big { font: 700 72px/1 var(--head); color: var(--green); letter-spacing: .04em; }
#ogtitle .line { font: 700 30px/1.25 var(--head); margin-top: 14px; }
#ogtitle .url { font: 500 20px var(--mono); color: var(--muted); margin-top: 18px; }
body.og #app { display: block; padding: 0; }
body.og #scope { position: fixed; right: 40px; top: 40px; width: 550px; height: 550px; margin: 0; max-width: none; max-height: none; }

@media (prefers-reduced-motion: reduce) { #siren.alarm, .bk.new, #moves li.new { animation: none; } }
