/* ──────────────────────────────────────────────────────────────────────────
   BONK_MARKET.BYSE — VIBRANT PIXEL POP
   palette: bg=#0000FF (0R 0G 1B 1A)   ink=#000040 (0R 0G 0.25B 1A)
   pop accents: hot-pink + neon-yellow + lime + cyan
   font: Press Start 2P everywhere. NO sans-serif. NO smooth borders.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:     #0000FF;
  --ink:    #000040;
  --paper:  #FFFFFF;
  --pink:   #FF2D95;
  --yellow: #FFE600;
  --lime:   #B6FF1A;
  --cyan:   #00E5FF;
  --pixel:  "Press Start 2P", monospace;
  --shadow-hard: 6px 6px 0 var(--ink);
}

* {
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--pixel);
  color: var(--ink);
  background: var(--bg);
  /* Chunky 8x8 pixel grid so the whole page reads as a CRT */
  background-image:
    linear-gradient(rgba(0,0,64,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,64,0.10) 1px, transparent 1px);
  background-size: 8px 8px;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: geometricPrecision;
}

body {
  display: flex; flex-direction: column;
  min-height: 100vh;
  overflow: hidden; /* feed scrolls, body does not */
  position: relative;
}

/* CRT scanlines overlay */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 2px,
    transparent      2px,
    transparent      4px
  );
  pointer-events: none;
  z-index: 50;
  mix-blend-mode: multiply;
}

/* ── TOP HEADER ────────────────────────────────────────────────────────── */
.top {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 18px 14px;
  gap: 16px;
  border-bottom: 4px solid var(--ink);
  background: var(--bg);
  z-index: 10;
}

.cta {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--ink);
  padding: 12px 16px;
  text-decoration: none;
  box-shadow: var(--shadow-hard);
  transform: translate(-2px,-2px);
  transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
  white-space: nowrap;
}
.cta:hover  { background: var(--lime); }
.cta:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.cta-spark {
  color: var(--pink);
  animation: blink 0.7s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.logo {
  margin: 0;
  text-align: right;
  font-family: var(--pixel);
  font-size: clamp(20px, 5.5vw, 44px);
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-shadow:
     4px  4px 0 var(--paper),
     8px  8px 0 var(--ink);
}
.logo-row { display: block; }
.logo-row-1 { color: var(--yellow); }
.logo-row-2 { color: var(--pink); }
.logo-row-3 {
  color: var(--cyan);
  font-size: 0.55em;
  letter-spacing: 0.15em;
  margin-top: 6px;
}

/* ── FEED ──────────────────────────────────────────────────────────────── */
.feed {
  flex: 1 1 auto;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 28px 14px 96px;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) var(--ink);
}
.feed::-webkit-scrollbar { width: 14px; }
.feed::-webkit-scrollbar-track { background: var(--ink); }
.feed::-webkit-scrollbar-thumb {
  background: var(--yellow);
  border: 3px solid var(--ink);
}

.loading {
  margin-top: 30vh;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--ink);
  animation: blink 0.9s steps(2) infinite;
}

/* ── PIXEL CHAT BUBBLE (no price) ──────────────────────────────────────── */
.bubble {
  scroll-snap-align: start;
  max-width: 680px;
  margin: 0 auto 28px;
  padding: 14px 16px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 0; /* SQUARE — pixel only */
  box-shadow: var(--shadow-hard);
  position: relative;
  animation: drop 0.25s steps(3) both;
}
@keyframes drop {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* alternating accent stripe along the top (8-bit highlight bar) */
.bubble::before {
  content: "";
  display: block;
  height: 8px;
  margin: -14px -16px 12px;
  background: var(--pink);
  border-bottom: 4px solid var(--ink);
}
.bubble:nth-child(4n+2)::before { background: var(--lime); }
.bubble:nth-child(4n+3)::before { background: var(--cyan); }
.bubble:nth-child(4n+4)::before { background: var(--yellow); }

/* chat thread tail */
.bubble:nth-child(even) { margin-left: auto;  margin-right: 4%; }
.bubble:nth-child(odd)  { margin-right: auto; margin-left:  4%; }

.bubble-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ticker {
  font-family: var(--pixel);
  font-size: 12px;
  background: var(--ink);
  color: var(--yellow);
  padding: 6px 8px;
  border: 3px solid var(--ink);
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #000;
}
.bubble-name {
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.04em;
  word-break: break-word;
}

.bubble-desc {
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.7;
  color: var(--ink);
  background: #F3F3FF;
  border: 3px solid var(--ink);
  padding: 10px 12px;
  margin: 0 0 14px;
}

.bubble-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vote {
  font-family: var(--pixel);
  font-size: 10px;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 8px 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}
.vote:hover  { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.vote:active { transform: translate(2px, 2px);  box-shadow: 0 0 0 var(--ink); }
.vote.up   { background: var(--lime); }
.vote.down { background: var(--pink); color: var(--paper); }
.vote[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: 3px 3px 0 var(--ink); transform: none; }

.bubble-id {
  margin-left: auto;
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--ink);
  opacity: 0.6;
  letter-spacing: 0.1em;
}

/* ── PING BAR ──────────────────────────────────────────────────────────── */
.ping {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 10px 14px;
  border-top: 4px solid var(--yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 30;
}
.ping-pill {
  background: var(--lime);
  color: var(--ink);
  padding: 4px 8px;
  border: 2px solid var(--paper);
}
.ping.offline .ping-pill { background: var(--pink); color: var(--paper); animation: blink 0.5s steps(2) infinite; }
.ping-sep { color: var(--yellow); margin: 0 6px; }

/* ── MOBILE ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .top { flex-direction: column-reverse; align-items: stretch; }
  .logo { text-align: left; }
  .bubble:nth-child(even),
  .bubble:nth-child(odd) { margin-left: 0; margin-right: 0; }
  .ping { font-size: 8px; }
}
