:root {
  --ink: #0d1420; --panel: rgba(13, 20, 32, .78); --line: rgba(255, 255, 255, .12); --txt: #eef3f8; --dim: #9fb0c3;
  --gold: #ffc83a; --buy: #5fe07a; --sell: #ff6b5e; --sky: #7cc8ff;
  --pix: 'Pixelify Sans', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--ink); color: var(--txt); font: 15px/1.5 system-ui, -apple-system, sans-serif; overflow-x: hidden; }
button, input { font: inherit; }
a { color: var(--sky); }

/* ---------- the stage: the island fills the first screen ---------- */
.app { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font: 700 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; background: rgba(13, 20, 32, .72); color: #dfe9f3; will-change: transform; }
.lbl-tape { background: var(--gold); color: #2b1d00; font: 700 13px/1 var(--pix); letter-spacing: .5px; padding: 4px 8px; }
.lbl-pick { background: #fff; color: var(--ink); font-size: 12px; }

.top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: linear-gradient(rgba(13, 20, 32, .85), rgba(13, 20, 32, 0)); z-index: 3; }
.brand { display: flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font: 700 19px/1 var(--pix); letter-spacing: .5px; margin-right: auto; }
.brand img { width: 26px; height: 26px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.stat small { font: 600 9px/1 var(--mono); color: var(--dim); letter-spacing: .8px; }
.stat b { font: 700 15px/1.1 var(--mono); }
.hm { display: none; }
.pill { flex: none; font: 700 10px/1 var(--mono); padding: 5px 7px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: var(--dim); letter-spacing: .5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.live { background: var(--buy); color: #04210c; }
.mute { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(13, 20, 32, .6); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.mute.off { opacity: .45; text-decoration: line-through; }

.rainbar { position: absolute; top: calc(58px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 3; font: 600 11px/1 var(--mono); pointer-events: none; }
.rainbar b { flex: none; color: #04210c; background: var(--sky); padding: 4px 6px; border-radius: 5px; font-size: 9px; letter-spacing: .6px; }
.rain { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, #000 85%, transparent); color: #fff; text-shadow: 0 1px 3px #000a; }
.rain i { font-style: normal; margin-right: 10px; display: inline-block; animation: pop .5s ease-out; }
.announce { position: absolute; top: calc(84px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 3; background: var(--gold); color: #2b1d00; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.clock { position: absolute; top: calc(84px + env(safe-area-inset-top)); left: 12px; z-index: 2; font: 600 11px/1.3 var(--mono); color: #fff; background: rgba(13, 20, 32, .6); padding: 5px 8px; border-radius: 8px; }
.clock:empty { display: none; }
.clock b { color: var(--gold); }

.toasts { position: absolute; top: calc(116px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 3; pointer-events: none; }
.toast { font: 700 13px/1.2 var(--mono); padding: 7px 11px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); animation: toast 3.6s ease forwards; max-width: calc(100vw - 24px); text-align: center; }
.toast.buy { border-color: var(--buy); color: #d9ffe1; }
.toast.buy b { color: var(--buy); }
.toast.sell { border-color: var(--sell); color: #ffe0dc; }
.toast.sell b { color: var(--sell); }
.toast.meteor { border-color: var(--gold); color: #fff3cf; }
.toast.meteor b { color: var(--gold); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px) scale(.96); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.banner { position: absolute; left: 12px; right: 12px; top: 34%; z-index: 4; text-align: center; padding: 16px 14px; border-radius: 16px; background: rgba(13, 20, 32, .86); border: 2px solid var(--gold); pointer-events: none; animation: pop .4s ease-out; }
.banner h3 { margin: 0 0 4px; font: 700 30px/1.05 var(--pix); color: var(--gold); letter-spacing: 1px; }
.banner p { margin: 0; font: 600 14px/1.4 var(--mono); }
.banner.out { opacity: 0; transition: opacity .3s; }

/* ---------- the dock (bottom) ---------- */
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 26px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(13, 20, 32, 0), rgba(13, 20, 32, .9) 34%); display: flex; flex-direction: column; gap: 8px; }
.mini { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 2px; font: 600 12px/1.35 var(--mono); min-height: 50px; justify-content: flex-end; }
.mini li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000c; animation: pop .35s ease-out; }
.mini li:nth-child(1) { opacity: .55; } .mini li:nth-child(2) { opacity: .8; }
.b { color: var(--buy); } .s { color: var(--sell); } .g { color: var(--gold); } .d { color: var(--dim); }
.actions { display: flex; gap: 8px; }
.actions button, .findform button, .card .cf button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; cursor: pointer; }
.actions button:active, .card .cf button:active { transform: scale(.98); }
.findform { display: flex; gap: 8px; }
.findform input { flex: 3; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .45); color: #fff; padding: 0 12px; font: 600 14px var(--mono); min-width: 0; }
.findform button { flex: 1; background: var(--sky); color: #04203a; border: 0; }
.card { position: relative; background: rgba(13, 20, 32, .92); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.card .x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: none; color: var(--dim); font-size: 24px; cursor: pointer; }
.card .ct { display: flex; align-items: baseline; gap: 10px; }
.card .ct b { font: 700 22px/1 var(--pix); }
.card .ct span { font: 600 12px var(--mono); color: var(--dim); }
.card .cs { display: flex; gap: 18px; margin: 8px 0 10px; }
.card .cs span { display: flex; flex-direction: column; }
.card .cs small { font: 600 10px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
.card .cs b { font: 700 18px var(--mono); }
.card .cf { display: flex; gap: 8px; }
.card .cf #cardshare { background: var(--gold); color: #2b1d00; border: 0; }
.cabar { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 10px; }
.calabel { font: 700 12px var(--pix); color: var(--gold); flex: none; }
.cabar code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px var(--mono); color: #dfe9f3; }
.cabar button, .cabar .buy { flex: none; min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 10px; border: 0; font-weight: 800; cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.cabar button { background: rgba(255, 255, 255, .14); color: #fff; }
.cabar .buy { background: var(--buy); color: #04210c; }
.cabar .buy.off, .cabar button:disabled { opacity: .45; pointer-events: none; }

/* ---------- below the fold ---------- */
.below { max-width: 980px; margin: 0 auto; padding: 18px 12px 60px; display: grid; gap: 14px; }
.panel { background: #131c2b; border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.panel h2 { margin: 0 0 10px; font: 700 20px/1 var(--pix); display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--buy); box-shadow: 0 0 0 0 var(--buy); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } }
.feed, .tallest { list-style: none; margin: 0; padding: 0; font: 600 13px/1.4 var(--mono); }
.feed li, .tallest li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.feed li:first-child, .tallest li:first-child { border-top: 0; }
.feed .t { color: var(--dim); flex: none; font-size: 11px; width: 42px; }
.feed .m { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed a { color: inherit; text-decoration: none; }
.tallest li { cursor: pointer; min-height: 44px; align-items: center; }
.tallest .r { width: 26px; color: var(--dim); }
.tallest .n { flex: 1; }
.tallest .v { color: var(--gold); }
.empty { color: var(--dim); }
.how ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.sched { background: rgba(255, 200, 58, .1); border: 1px solid rgba(255, 200, 58, .3); border-radius: 12px; padding: 10px 12px; }
.fine { color: var(--dim); font-size: 12px; }

@media (min-width: 761px) {
  .hm { display: flex; }
  .top { padding: 12px 18px; gap: 20px; }
  .brand { font-size: 24px; }
  .stat b { font-size: 18px; }
  .rainbar { top: 64px; left: 18px; right: 18px; }
  .clock { top: 92px; left: 18px; font-size: 12px; }
  .announce { top: 92px; left: auto; right: 18px; max-width: 420px; }
  .dock { left: auto; right: 18px; bottom: 18px; width: 420px; border-radius: 18px; padding: 12px; background: rgba(13, 20, 32, .78); border: 1px solid var(--line); backdrop-filter: blur(6px); }
  .lbl { font-size: 12px; }
  .pill { max-width: 220px; }
  .below { grid-template-columns: 1fr 1fr; }
  .how { grid-column: 1 / -1; }
}

/* ---------- ?stream=1: the pump.fun livestream view ---------- */
body.stream { overflow: hidden; }
body.stream .below, body.stream .actions, body.stream .findform, body.stream .card, body.stream .mute { display: none !important; }
body.stream .app { height: 100vh; }
body.stream .dock { left: 18px; right: auto; bottom: 18px; width: min(560px, calc(100vw - 36px)); background: rgba(13, 20, 32, .72); border-radius: 18px; padding: 12px; }
body.stream .mini { font-size: 15px; min-height: 66px; }
body.stream .cabar button, body.stream .cabar .buy { display: none; }
body.stream .cabar code { font-size: 15px; }
body.stream .lbl { font-size: 14px; }
body.stream .lbl-tape { font-size: 18px; }
body.stream .toast { font-size: 17px; }
