/* ==========================================================================
   BYTEBOUND - 8-bit pixel theme
   palette locked to ByteSprites.PAL
   fonts: Press Start 2P (chrome), VT323 (body), Silkscreen (numerics)
   ========================================================================== */

:root {
  --bg-black:  #0a0a14;
  --bg-deep:   #15152a;
  --panel:     #1f1f3d;
  --border:    #2e2e5c;
  --hairline:  #3d3d7a;
  --text-dim:  #6e6ea8;
  --text:      #c8c8f5;
  --text-hot:  #ffffff;

  --pink:      #ff3d8b;
  --cyan:      #44ddff;
  --lime:      #5dff8b;
  --gold:      #ffcd3d;
  --purple:    #a44dff;
  --red:       #ff4d4d;
  --blue:      #3d6dff;
  --teal:      #3dffcd;
}

/* ---- reset + page ---- */

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-black);
  color: var(--text);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  min-height: 100vh;
}
img, canvas { image-rendering: pixelated; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--text-hot); }
button { font-family: inherit; }

::selection { background: var(--pink); color: var(--text-hot); }

/* ---- typography ---- */

.h-chrome, .h1, .h2, .h3 {
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 2px;
  color: var(--pink);
  text-shadow: 2px 2px 0 var(--bg-black);
  margin: 0;
}
.h1 { font-size: 24px; line-height: 1.4; }
.h2 { font-size: 16px; line-height: 1.5; color: var(--cyan); }
.h3 { font-size: 11px; line-height: 1.5; color: var(--text-dim); }
.muted { color: var(--text-dim); }
.text-pink   { color: var(--pink); }
.text-cyan   { color: var(--cyan); }
.text-lime   { color: var(--lime); }
.text-gold   { color: var(--gold); }
.text-purple { color: var(--purple); }
.text-red    { color: var(--red); }
.text-hot    { color: var(--text-hot); }
.tabular { font-family: 'Silkscreen', 'DotGothic16', monospace; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- layout ---- */

.page { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.row { display: flex; align-items: center; }
.row-between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- nav bar ---- */

.bb-nav {
  border-bottom: 2px solid var(--hairline);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-black);
  position: sticky; top: 0; z-index: 50;
  gap: 20px; flex-wrap: wrap;
}
.bb-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px; color: var(--pink);
  letter-spacing: 2px;
  text-decoration: none;
  line-height: 1; /* kill the default 1.4 line-height so the text height = font height */
  white-space: nowrap;
}
.bb-brand canvas {
  display: block;
  width: 28px; height: 28px;
  flex: 0 0 auto;
}
.bb-brand span {
  display: inline-block;
  line-height: 1;
  position: relative;
  top: 1px; /* nudge to optically center against the canvas */
}
.bb-nav-links {
  display: flex; gap: 18px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; letter-spacing: 2px;
  flex-wrap: wrap;
}
.bb-nav-links a { color: var(--text-dim); text-decoration: none; line-height: 1; }
.bb-nav-links a:hover { color: var(--text); }
.bb-nav-links a.active { color: var(--pink); }
.bb-nav-right {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Silkscreen', monospace;
  font-size: 13px; color: var(--lime);
}
.bb-wallet {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  background: var(--bg-black);
  color: var(--cyan);
  border: 2px solid var(--cyan);
  padding: 8px 12px;
  cursor: pointer;
  letter-spacing: 1px;
}
.bb-wallet:hover { background: var(--cyan); color: var(--bg-black); }
.bb-wallet.connected { color: var(--lime); border-color: var(--lime); }
.bb-wallet.connected:hover { background: var(--lime); color: var(--bg-black); }

/* ---- NES dialog panel ---- */

.bb-panel {
  position: relative;
  background: var(--panel);
  border: 4px solid var(--bg-black);
  box-shadow:
    inset 4px 4px 0 0 var(--hairline),
    inset -4px -4px 0 0 var(--bg-deep),
    0 0 0 4px var(--bg-black);
  color: var(--text);
  margin: 16px 0;
}
.bb-panel-hot {
  box-shadow:
    inset 4px 4px 0 0 var(--pink),
    inset -4px -4px 0 0 var(--bg-deep),
    0 0 0 4px var(--bg-black),
    0 0 24px rgba(255, 61, 139, 0.4);
}
.bb-panel-title {
  position: absolute;
  top: -14px; left: 12px;
  background: var(--bg-black);
  color: var(--cyan);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 4px 8px;
  border: 2px solid var(--hairline);
  letter-spacing: 1px;
}
.bb-panel-title-hot { color: var(--pink); }
.bb-panel-inner { padding: 20px; }

/* ---- buttons ---- */

.bb-btn {
  --bb-btn: var(--pink);
  --bb-btn-dark: #8a1a4d;
  position: relative;
  background: var(--bb-btn);
  color: var(--text-hot);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  border: none;
  padding: 14px 24px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.2),
    inset -4px -4px 0 0 var(--bb-btn-dark),
    0 0 0 4px var(--bg-black);
  transition: filter 0.15s;
}
.bb-btn:hover:not(:disabled) {
  box-shadow:
    inset 2px 2px 0 0 var(--text-hot),
    inset -2px -2px 0 0 var(--bb-btn-dark),
    0 0 0 4px var(--bg-black),
    0 0 16px var(--bb-btn);
  filter: brightness(1.1);
}
.bb-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
}
.bb-btn-disabled, .bb-btn:disabled {
  background: var(--hairline);
  color: var(--text-dim);
  box-shadow:
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.05),
    inset -4px -4px 0 0 var(--border),
    0 0 0 4px var(--bg-black);
  cursor: not-allowed;
}

/* ---- stat bars ---- */

.bb-statbar {
  display: flex; gap: 2px;
  background: var(--bg-black);
  padding: 4px;
  border: 2px solid var(--hairline);
  width: max-content;
}
.bb-statbar-cell {
  width: 8px; height: 16px;
  background: var(--bg-deep);
}
.bb-statbar-on {
  background: var(--bb-statbar-color, var(--lime));
  box-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* ---- tier badges ---- */

.bb-tier {
  display: inline-block;
  background: var(--bg-black);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 6px 8px;
  border: 2px solid currentColor;
  letter-spacing: 2px;
}
@keyframes bb-mythic-shimmer {
  0%   { box-shadow: 0 0 6px #ff3d8b, inset 0 0 0 2px #ff3d8b; }
  16%  { box-shadow: 0 0 6px #ffcd3d, inset 0 0 0 2px #ffcd3d; }
  33%  { box-shadow: 0 0 6px #5dff8b, inset 0 0 0 2px #5dff8b; }
  50%  { box-shadow: 0 0 6px #44ddff, inset 0 0 0 2px #44ddff; }
  66%  { box-shadow: 0 0 6px #a44dff, inset 0 0 0 2px #a44dff; }
  83%  { box-shadow: 0 0 6px #ff3d8b, inset 0 0 0 2px #ff3d8b; }
  100% { box-shadow: 0 0 6px #ff3d8b, inset 0 0 0 2px #ff3d8b; }
}
.bb-tier-mythic {
  animation: bb-mythic-shimmer 2.4s steps(6) infinite;
}

/* ---- type chips ---- */

.bb-typechip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-black);
  border: 2px solid;
  padding: 4px 8px 4px 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
}

/* ---- BIOS boot panel ---- */

.bb-bios {
  background: var(--bg-black);
  padding: 24px;
  font-family: 'VT323', monospace;
  font-size: 22px;
  color: var(--lime);
  line-height: 1.4;
  min-height: 240px;
  border: 2px solid var(--hairline);
  box-shadow: inset 0 0 32px rgba(93, 255, 139, 0.13);
}
.bb-bios-cursor {
  color: var(--lime);
  animation: bb-blink 1s steps(2) infinite;
}
@keyframes bb-blink { 50% { opacity: 0; } }

/* ---- wordmark ---- */

.bb-wordmark {
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
}
.bb-wordmark-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 32px;
  letter-spacing: 2px;
}
.bb-wordmark-tag {
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 4px;
}

/* ---- scanlines overlay ---- */

.bb-scanlines { position: relative; }
.bb-scanlines::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 100;
}

/* ---- hero ---- */

.bb-hero {
  position: relative;
  background: var(--bg-black);
  overflow: hidden;
}
.bb-hero canvas { display: block; width: 100%; height: auto; }
.bb-hero-overlay {
  position: absolute;
  left: 56px; bottom: 72px;
  z-index: 110;
  max-width: 460px;
}
.bb-hero-headline {
  font-family: 'Press Start 2P', monospace;
  font-size: 32px;
  color: var(--pink);
  letter-spacing: 2px;
  text-shadow: 4px 4px 0 var(--bg-black), 0 0 24px rgba(255, 61, 139, 0.4);
}
.bb-hero-tag {
  margin-top: 14px;
  font-family: 'VT323', monospace;
  font-size: 26px;
  color: var(--text);
  line-height: 1.2;
}
.bb-hero-stats {
  position: absolute;
  top: 32px; right: 32px;
  z-index: 110;
  display: flex; gap: 20px;
  background: var(--bg-black);
  padding: 12px 16px;
  border: 2px solid var(--hairline);
}
.bb-stat-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.bb-stat-val {
  font-family: 'Silkscreen', monospace;
  font-weight: 700;
  font-size: 20px;
}
@media (max-width: 880px) {
  .bb-hero-overlay { left: 24px; bottom: 24px; max-width: 80%; }
  .bb-hero-headline { font-size: 22px; }
  .bb-hero-tag { font-size: 20px; }
  .bb-hero-stats { top: 12px; right: 12px; gap: 10px; padding: 8px; }
  .bb-stat-val { font-size: 14px; }
}

/* ---- gallery card ---- */

.bb-card {
  background: var(--bg-deep);
  border: 4px solid var(--bg-black);
  box-shadow:
    inset 4px 4px 0 0 var(--hairline),
    inset -4px -4px 0 0 var(--bg-deep);
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.bb-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--text);
  letter-spacing: 1px;
}
.bb-card-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: center;
}
.bb-card-id {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

/* ---- footer ---- */

.bb-footer {
  border-top: 2px solid var(--hairline);
  padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: var(--text-dim);
  margin-top: 64px;
}
.bb-footer .bb-channels { display: flex; gap: 16px; }
.bb-footer a { color: var(--lime); }

/* ---- toasts ---- */

.bb-toast-stack {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.bb-toast {
  background: var(--bg-black);
  border: 4px solid var(--cyan);
  color: var(--text-hot);
  padding: 12px 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  box-shadow: 0 0 16px rgba(68, 221, 255, 0.4);
  pointer-events: auto;
  animation: bb-toast-in 0.2s steps(2);
}
.bb-toast-error { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 77, 77, 0.4); }
.bb-toast-success { border-color: var(--lime); box-shadow: 0 0 16px rgba(93, 255, 139, 0.4); }
.bb-toast-warn { border-color: var(--gold); }
@keyframes bb-toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   ANIMATIONS - the site should feel alive
   ========================================================================== */

/* page-wide soft CRT flicker overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.02) 0,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 4px
  );
  animation: bb-crt-flicker 6s steps(1) infinite, bb-scan-scroll 10s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.6;
}
@keyframes bb-crt-flicker {
  0%, 100% { opacity: 0.55; }
  3%       { opacity: 0.30; }
  4%       { opacity: 0.65; }
  47%      { opacity: 0.55; }
  48%      { opacity: 0.20; }
  49%      { opacity: 0.60; }
}
@keyframes bb-scan-scroll {
  0%   { background-position-y: 0; }
  100% { background-position-y: 96px; }
}

/* sprite idle wobble - apply via .bb-bob class */
.bb-bob { animation: bb-bob 2.4s steps(8) infinite; }
@keyframes bb-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* slower breathe for hero sprites */
.bb-breathe { animation: bb-breathe 3.6s steps(12) infinite; }
@keyframes bb-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* glow pulse for "active" elements */
.bb-glow-cyan { animation: bb-glow-cyan 2.4s ease-in-out infinite; }
@keyframes bb-glow-cyan {
  0%, 100% { box-shadow: 0 0 0 rgba(68, 221, 255, 0); }
  50%      { box-shadow: 0 0 24px rgba(68, 221, 255, 0.6); }
}
.bb-glow-pink { animation: bb-glow-pink 2.4s ease-in-out infinite; }
@keyframes bb-glow-pink {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 61, 139, 0); }
  50%      { box-shadow: 0 0 24px rgba(255, 61, 139, 0.6); }
}
.bb-glow-lime { animation: bb-glow-lime 2.4s ease-in-out infinite; }
@keyframes bb-glow-lime {
  0%, 100% { box-shadow: 0 0 0 rgba(93, 255, 139, 0); }
  50%      { box-shadow: 0 0 24px rgba(93, 255, 139, 0.7); }
}

/* wallet pill: pulse when disconnected, steady when connected */
#bb-wallet:not(.connected) {
  animation: bb-wallet-pulse 2s ease-in-out infinite;
}
@keyframes bb-wallet-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(68, 221, 255, 0); }
  50%      { box-shadow: 0 0 16px rgba(68, 221, 255, 0.7); }
}

/* hero headline subtle flicker */
.bb-hero-headline { animation: bb-headline-flicker 8s infinite; }
@keyframes bb-headline-flicker {
  0%, 100%  { opacity: 1; }
  92%       { opacity: 1; }
  93%       { opacity: 0.6; }
  94%       { opacity: 1; }
  96%       { opacity: 0.85; }
  97%       { opacity: 1; }
}

/* boot-on-load reveal */
@keyframes bb-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bb-panel, .bb-card { animation: bb-fade-in 0.5s ease-out both; }

/* staggered card reveal in galleries */
.bb-card:nth-child(8n+1) { animation-delay: 0.00s; }
.bb-card:nth-child(8n+2) { animation-delay: 0.05s; }
.bb-card:nth-child(8n+3) { animation-delay: 0.10s; }
.bb-card:nth-child(8n+4) { animation-delay: 0.15s; }
.bb-card:nth-child(8n+5) { animation-delay: 0.20s; }
.bb-card:nth-child(8n+6) { animation-delay: 0.25s; }
.bb-card:nth-child(8n+7) { animation-delay: 0.30s; }
.bb-card:nth-child(8n+8) { animation-delay: 0.35s; }

/* gallery card hover - lift + brighten */
.bb-card { transition: transform 0.15s, filter 0.15s, box-shadow 0.15s; }
.bb-card:hover {
  transform: translateY(-3px);
  filter: brightness(1.15);
  box-shadow:
    inset 4px 4px 0 0 var(--cyan),
    inset -4px -4px 0 0 var(--bg-deep),
    0 0 24px rgba(68, 221, 255, 0.4);
}

/* slot hover - cyan border pulse */
.slot { transition: border-color 0.15s, transform 0.15s; }
.slot:hover { transform: scale(1.04); }

/* count-up tabular numbers */
.tabular { transition: color 0.2s; }
.bb-stat-flash { animation: bb-stat-flash 0.6s steps(4); }
@keyframes bb-stat-flash {
  0%   { color: var(--text-hot); text-shadow: 0 0 12px var(--text-hot); }
  100% { color: inherit; text-shadow: none; }
}

/* h1 underline accent */
.h1 {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}
.h1::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: linear-gradient(to right, var(--pink) 0, var(--cyan) 50%, transparent 100%);
  animation: bb-h1-bar 3s linear infinite;
  background-size: 200% 100%;
}
@keyframes bb-h1-bar {
  0%   { background-position-x: 0%; }
  100% { background-position-x: -200%; }
}

/* nav link hover ripple */
.bb-nav-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 0.15s;
}
.bb-nav-links a::before {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--pink);
  transition: width 0.18s ease-out;
}
.bb-nav-links a:hover::before,
.bb-nav-links a.active::before { width: 100%; }

/* wallet "connected" lime ring breath */
#bb-wallet.connected { animation: bb-glow-lime 3s ease-in-out infinite; }

/* button arrow nudge on hover */
.bb-btn:hover:not(:disabled) {
  letter-spacing: 3px;
}

/* type chip subtle pulse on canvas */
.bb-typechip canvas { animation: bb-typechip-pulse 2s ease-in-out infinite; }
@keyframes bb-typechip-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.85; }
}

/* tier badge pulse non-mythic */
.bb-tier:not(.bb-tier-mythic) { animation: bb-tier-soft 3s ease-in-out infinite; }
@keyframes bb-tier-soft {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

/* hero stats glow */
.bb-hero-stats { animation: bb-hero-stats-glow 4s ease-in-out infinite; }
@keyframes bb-hero-stats-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(68, 221, 255, 0); }
  50%      { box-shadow: 0 0 24px rgba(68, 221, 255, 0.3); }
}

/* random data motes overlay (uses absolute-positioned dots) */
.bb-motes {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 105;
}
.bb-mote {
  position: absolute;
  width: 2px; height: 2px;
  animation: bb-mote-fly 6s linear infinite;
}
@keyframes bb-mote-fly {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(var(--mx, 100px), var(--my, -100px)); opacity: 0; }
}

/* hero overlay slide-in */
.bb-hero-overlay { animation: bb-fade-in 0.7s 0.2s ease-out both; }

/* footer marquee-ish */
.bb-footer span:first-child {
  animation: bb-pulse-arrow 2s steps(2) infinite;
}
@keyframes bb-pulse-arrow {
  0%   { color: var(--text-dim); }
  50%  { color: var(--lime); }
  100% { color: var(--text-dim); }
}

/* preview stage glow */
.preview-stage {
  position: relative;
  overflow: hidden;
}
.preview-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(68,221,255,0.08), transparent 60%);
  animation: bb-preview-glow 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bb-preview-glow {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ==========================================================================
   MOBILE - real responsive pass, not just font shrinks
   ========================================================================== */

html { overflow-x: hidden; }
body { overflow-x: hidden; }

/* tables get horizontal scroll on small screens */
.bb-panel-inner table {
  display: block;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
.manual table { display: block; overflow-x: auto; white-space: nowrap; }

/* breakpoint: tablet */
@media (max-width: 880px) {
  .bb-nav {
    padding: 12px 16px;
    gap: 10px;
  }
  .bb-nav-links { gap: 12px; font-size: 8px; width: 100%; order: 3; }
  .bb-brand { order: 1; font-size: 12px; gap: 8px; }
  .bb-brand canvas { width: 24px; height: 24px; }
  .bb-nav-right { order: 2; gap: 10px; font-size: 11px; }
  .bb-wallet { font-size: 8px; padding: 7px 10px; }

  .bb-hero-overlay { left: 20px; bottom: 20px; max-width: calc(100% - 40px); }
  .bb-hero-headline { font-size: 22px; }
  .bb-hero-tag { font-size: 18px; }
  .bb-hero-stats { top: 10px; right: 10px; gap: 10px; padding: 8px 10px; }
  .bb-stat-val { font-size: 14px; }

  .h1 { font-size: 18px; }
  .h2 { font-size: 13px; }
  .h3 { font-size: 9px; }

  /* Trade page nibble vault details get wide on mobile */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* yield distribution rules: collapse to 2 columns instead of 4 */
  .bb-panel-inner > div[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* breakpoint: phone */
@media (max-width: 640px) {
  .page { padding: 0 14px; }
  .bb-nav {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .bb-brand { font-size: 12px; justify-content: center; }
  .bb-nav-right { justify-content: space-between; }
  .bb-nav-links {
    justify-content: center;
    font-size: 8px; gap: 10px;
    padding-top: 4px;
    border-top: 1px dashed var(--hairline);
  }
  .bb-nav-links a { padding: 4px 0; }

  .bb-hero-overlay { left: 14px; bottom: 14px; }
  .bb-hero-headline { font-size: 18px; }
  .bb-hero-tag { font-size: 16px; }
  .bb-hero-stats {
    top: 8px; right: 8px;
    gap: 8px; padding: 6px 8px;
    flex-wrap: wrap;
  }
  .bb-stat-label { font-size: 7px; }
  .bb-stat-val { font-size: 12px; }

  .bb-btn { font-size: 9px; padding: 10px 14px; letter-spacing: 1px; }
  .bb-panel-inner { padding: 14px; }
  .bb-panel-title { font-size: 8px; padding: 3px 6px; top: -12px; }

  .h1 { font-size: 14px; letter-spacing: 1px; }
  .h2 { font-size: 11px; }

  /* gallery cards smaller on phone */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 10px; }
  .bb-card { padding: 10px; gap: 6px; }
  .bb-card-name { font-size: 9px; }

  /* bytes page: slot grid 2 wide on phone */
  .slot-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .byte-row { padding: 14px; gap: 16px; }

  /* mint page quantity row */
  .qty-row { flex-wrap: wrap; gap: 6px; }
  .qty-btn { width: 36px; height: 36px; font-size: 12px; }
  .qty-val { font-size: 22px; min-width: 50px; }

  .bb-typechip { font-size: 7px; padding: 3px 6px 3px 4px; }
  .bb-tier { font-size: 7px; padding: 4px 6px; letter-spacing: 1px; }

  .bb-footer {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    font-size: 14px;
  }
  .bb-footer .bb-channels { justify-content: center; }

  /* picker overlay padding */
  .picker { padding: 12px; }
  .picker-inner { padding: 16px; }

  /* tabular numbers shrink slightly */
  .tabular { font-size: inherit; }

  /* manual tighter */
  .manual h2 { font-size: 11px; padding-top: 20px; margin-top: 30px; }
  .manual h3 { font-size: 9px; }
  .manual p, .manual li { font-size: 16px; }

  /* h1 bar shorter */
  .h1::after { height: 1px; }
}

/* breakpoint: tiny */
@media (max-width: 380px) {
  .bb-nav-links { font-size: 7px; gap: 8px; }
  .bb-nav-right { gap: 8px; font-size: 10px; }
  .bb-wallet { font-size: 7px; padding: 6px 8px; }
  .bb-hero-headline { font-size: 16px; }
  .bb-hero-tag { font-size: 14px; }
  .qty-btn { width: 32px; height: 32px; }
}
