:root {
  --bg: #04060a;
  --ink: #eafff4;
  --dim: #8fa89b;
  --green: #3dffa0;
  --red: #ff4d7a;
  --gold: #ffd23f;
  --glass: rgba(8, 12, 16, 0.62);
  --line: rgba(61, 255, 160, 0.22);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 500 14px/1.35 Inter, system-ui, sans-serif; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.up { color: var(--green); }
.dn { color: var(--red); }

#hud { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 12px calc(10px + var(--safe-b)); }
#hud > * { pointer-events: auto; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.brand { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.logo { font: 400 34px/0.9 Bungee, Inter, sans-serif; color: var(--green); letter-spacing: 1px; text-shadow: 0 0 18px rgba(61, 255, 160, 0.55), 0 3px 0 #0b5a36; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); font-weight: 800; max-width: 52vw; }
.chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #0c1a14; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--dim); font-size: 11px; }
body.riding-other .chip { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.18); }

.mcbox { text-align: right; padding: 8px 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.lbl { font-size: 10px; letter-spacing: 1.5px; color: var(--dim); font-weight: 800; }
.mc { font: 800 26px/1.05 'JetBrains Mono', monospace; color: var(--ink); }
#mcch { font: 800 11px 'JetBrains Mono', monospace; }

.stats { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stats span { padding: 5px 9px; border-radius: 999px; background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.06); font-size: 12px; color: var(--dim); backdrop-filter: blur(6px); }
.stats b { color: var(--ink); font-family: 'JetBrains Mono', monospace; }
.modetag { align-self: flex-start; margin-top: 6px; font-size: 11px; padding: 3px 9px; border-radius: 6px; background: rgba(255, 210, 63, 0.12); color: var(--gold); border: 1px solid rgba(255, 210, 63, 0.25); }

.feed { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-width: 360px; pointer-events: none !important; }
.feed .line { display: flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 5px 9px; border-radius: 10px; background: rgba(6, 9, 12, 0.66); border: 1px solid rgba(255, 255, 255, 0.05); animation: slidein 0.35s ease-out; transition: opacity 1s; width: fit-content; }
.feed .line.old { opacity: 0.35; }
.feed .ic { font-size: 14px; }
@keyframes slidein { from { transform: translateX(-16px); opacity: 0; } }

.banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(0.85); text-align: center; opacity: 0; pointer-events: none !important; transition: opacity 0.25s, transform 0.35s cubic-bezier(.2, 1.6, .4, 1); width: min(92vw, 640px); }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner .bt { font: 400 clamp(38px, 11vw, 78px)/1 Bungee, Inter, sans-serif; letter-spacing: 1px; color: var(--green); text-shadow: 0 0 28px rgba(61, 255, 160, 0.6), 0 4px 0 #063d24; }
.banner .bs { margin-top: 8px; font-weight: 800; font-size: clamp(13px, 3.6vw, 17px); color: var(--ink); text-shadow: 0 2px 8px #000; }
.banner.gold .bt { color: var(--gold); text-shadow: 0 0 30px rgba(255, 210, 63, 0.65), 0 4px 0 #5c4300; }
.banner.red .bt { color: var(--red); text-shadow: 0 0 30px rgba(255, 77, 122, 0.6), 0 4px 0 #5c0b22; }

.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.cams { display: flex; gap: 6px; }
.cams button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); background: var(--glass); backdrop-filter: blur(8px); font-weight: 800; font-size: 12px; letter-spacing: 0.8px; color: var(--dim); }
.cams button.on { color: #04140c; background: var(--green); border-color: var(--green); }
.cams #mute { flex: 0 0 48px; font-size: 18px; }

.cabar { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(6, 10, 13, 0.82); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.catext { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 6px; }
.calbl { font-size: 9.5px; letter-spacing: 1.3px; color: var(--dim); font-weight: 800; }
.ca { font: 600 12px 'JetBrains Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.cabar.live .ca { color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.1); background: #121a20; font-weight: 900; letter-spacing: 0.8px; text-decoration: none; color: var(--ink); font-size: 13px; }
.btn.buy { background: var(--green); color: #04140c; border-color: var(--green); }
.cabar:not(.live) .btn { opacity: 0.45; }
.other { min-height: 46px; border-radius: 14px; border: 1px solid rgba(255, 210, 63, 0.4); background: linear-gradient(90deg, rgba(255, 210, 63, 0.16), rgba(61, 255, 160, 0.14)); font-weight: 900; letter-spacing: 1px; color: var(--ink); backdrop-filter: blur(8px); }
.streamca { display: none; }

/* pump.fun livestream: full show, big CA, no controls */
body.stream .cams, body.stream .other, body.stream .cabar { display: none; }
body.stream .bottom { flex-direction: column; align-items: center; }
body.stream .streamca { display: block; width: min(900px, 100%); text-align: center; font: 800 clamp(14px, 2.4vw, 26px) 'JetBrains Mono', monospace; padding: 10px; border-radius: 14px; background: rgba(6, 10, 13, 0.82); border: 1px solid var(--line); }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center; z-index: 20; opacity: 0; transition: opacity 0.25s; }
.sheet.open { opacity: 1; }
.sheet .panel { width: min(560px, 100%); max-height: 86vh; overflow: auto; background: #0a0f13; border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 16px 14px calc(16px + var(--safe-b)); transform: translateY(30px); transition: transform 0.25s; }
.sheet.open .panel { transform: none; }
.ph { display: flex; justify-content: space-between; align-items: center; font-size: 17px; margin-bottom: 12px; }
.ph button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #131c22; font-size: 16px; }
.caform { display: flex; gap: 8px; }
.caform input { flex: 1; min-width: 0; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #060a0d; color: var(--ink); padding: 0 12px; font: 600 14px 'JetBrains Mono', monospace; outline: none; }
.caform input:focus { border-color: var(--green); }
.sub { margin: 14px 0 8px; font-weight: 800; color: var(--dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coin { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; min-height: 44px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.07); background: #0f161b; font-size: 12px; }
.coin img, .coin .ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #13201a; margin: 0; font-size: 22px; }
.coin .cs { font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin .cm { color: var(--dim); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.muted { grid-column: 1 / -1; color: var(--dim); padding: 12px 0; text-align: center; }
.row { display: flex; gap: 8px; margin-top: 14px; }
.btn.wide { flex: 1; }

.start { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, rgba(4, 8, 10, 0.35), rgba(2, 4, 6, 0.86)); transition: opacity 0.5s; padding: 20px; }
.start.gone { opacity: 0; pointer-events: none; }
.start .inner { text-align: center; max-width: 420px; }
.biglogo { font: 400 clamp(84px, 28vw, 150px)/0.9 Bungee, Inter, sans-serif; color: var(--green); text-shadow: 0 0 40px rgba(61, 255, 160, 0.55), 0 7px 0 #0b5a36; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.tag1 { font-weight: 900; font-size: clamp(18px, 5.4vw, 24px); margin-top: 10px; }
.rules { list-style: none; padding: 0; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 8px; font-weight: 700; color: var(--ink); }
.rules li { padding: 9px 12px; border-radius: 12px; background: rgba(10, 16, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.06); }
.go { width: 100%; min-height: 60px; border-radius: 16px; border: 0; background: var(--green); color: #04140c; font: 400 22px Bungee, Inter, sans-serif; letter-spacing: 1px; box-shadow: 0 0 30px rgba(61, 255, 160, 0.45), 0 5px 0 #0b5a36; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 46px rgba(61, 255, 160, 0.75), 0 5px 0 #0b5a36; } }
.hint { margin-top: 12px; color: var(--dim); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(190px + var(--safe-b)); transform: translateX(-50%) translateY(10px); padding: 10px 16px; border-radius: 12px; background: #111a20; border: 1px solid var(--line); font-weight: 700; opacity: 0; transition: 0.25s; pointer-events: none; z-index: 40; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (min-width: 820px) {
  #hud { padding: 18px 22px; }
  .logo { font-size: 44px; }
  .mc { font-size: 34px; }
  .bottom { flex-direction: row; align-items: stretch; }
  .cams { flex: 0 0 auto; }
  .cams button { flex: 0 0 74px; }
  .cabar { flex: 1; max-width: 560px; }
  .other { flex: 0 0 auto; padding: 0 20px; }
  .banner { top: 34%; }
  .feed .line { font-size: 13.5px; }
}
