/* ═══════════════════════════════════════════════════════════
   RHC Mint Radar — UI system
   High-contrast, readable, ranked leaderboard + live stream
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg0: #05070c;
  --bg1: #0a0e17;
  --bg2: #101624;
  --surface: #121a2b;
  --surface-2: #182235;
  --surface-hover: #1c2740;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f7ff;
  --text-secondary: #c5d0e8;
  --text-muted: #9aabc8;
  --text-dim: #6f819f;
  --accent: #5b9dff;
  --accent-soft: rgba(91, 157, 255, 0.14);
  --mint: #2ee6a6;
  --mint-soft: rgba(46, 230, 166, 0.14);
  --hot: #ff6a4d;
  --hot-soft: rgba(255, 106, 77, 0.16);
  --gold: #f5c542;
  --gold-soft: rgba(245, 197, 66, 0.16);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.16);
  --danger: #ff5c7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: auto;
  --row-h: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

a {
  color: #8ec0ff;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #c5ddff;
  text-decoration: underline;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--mint);
  color: #041018;
  font-weight: 800;
  border-radius: 0 0 10px 0;
}
.skip-link:focus {
  left: 0;
}

.privacy-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(46, 230, 166, 0.28);
  background: rgba(46, 230, 166, 0.08);
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.45;
}
.privacy-banner strong {
  color: var(--mint);
  font-weight: 800;
}

.hide-sm {
  display: block;
}

.rank-row {
  position: relative;
}

button,
input {
  font: inherit;
}

/* ── Ambient background ─────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 157, 255, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(46, 230, 166, 0.1), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(192, 132, 252, 0.08), transparent 50%),
    var(--bg0);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}
.orb-a {
  width: 420px;
  height: 420px;
  top: -80px;
  left: -60px;
  background: rgba(91, 157, 255, 0.22);
}
.orb-b {
  width: 380px;
  height: 380px;
  right: -40px;
  top: 20%;
  background: rgba(46, 230, 166, 0.14);
  animation-delay: -6s;
}
.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, 30px, 0) scale(1.08);
  }
}

/* ── Shell ───────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid rgba(46, 230, 166, 0.45);
  background: linear-gradient(145deg, #152038, #0c1220);
  box-shadow: var(--shadow);
}
.logo-core {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7dffc8, #2ee6a6 45%, #0d8f66);
  box-shadow: 0 0 20px rgba(46, 230, 166, 0.55);
  animation: corePulse 2.4s ease-in-out infinite;
}
@keyframes corePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.92);
    opacity: 0.85;
  }
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.brand-text h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}
.chain-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #04251a;
  background: linear-gradient(135deg, #5dffc0, #2ee6a6);
}
.byline {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.byline-link {
  color: #7dd3fc;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 211, 252, 0.45);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.byline-link:hover {
  color: #e0f2fe;
  border-bottom-color: #e0f2fe;
  text-decoration: none;
}

.tagline {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 42ch;
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kpi {
  min-width: 104px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(18, 26, 43, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.kpi-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.kpi-value.mono {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.status-val {
  font-size: 0.95rem;
  font-weight: 700;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(245, 197, 66, 0.5);
  animation: ping 1.8s ease infinite;
}
.pulse-dot.live {
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.55);
}
.pulse-dot.err {
  background: var(--danger);
  animation: none;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(46, 230, 166, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 230, 166, 0);
  }
}

/* ── Controls ────────────────────────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#search {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(16, 22, 36, 0.95);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#search::placeholder {
  color: var(--text-dim);
}
#search:focus {
  border-color: rgba(91, 157, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(91, 157, 255, 0.16);
}

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: rgba(16, 22, 36, 0.95);
  border: 1px solid var(--border);
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s var(--ease);
}
.seg-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.seg-btn.active {
  color: #041018;
  background: linear-gradient(135deg, #7ec8ff, #5b9dff 40%, #2ee6a6);
  box-shadow: 0 6px 18px rgba(91, 157, 255, 0.28);
}

.control-toggles {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16, 22, 36, 0.9);
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-ui {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #2a354d;
  position: relative;
  transition: background 0.2s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.switch input:checked + .switch-ui {
  background: linear-gradient(135deg, #2ee6a6, #1bbf84);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(14px);
}
.switch-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Legend ──────────────────────────────────────────────── */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 26, 43, 0.55);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.84rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-item.muted {
  color: var(--text-muted);
  margin-left: auto;
}
.legend-item strong {
  color: var(--text);
}
.lg-swatch {
  width: 28px;
  height: 8px;
  border-radius: 999px;
}
.lg-swatch.heat {
  background: linear-gradient(90deg, #ff8a65, #ff6a4d, #ff3d6e);
}
.lg-swatch.supply {
  background: linear-gradient(90deg, #3d8bfd, #5b9dff, #2ee6a6);
}

/* ── Board layout ────────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1040px) {
  .board {
    grid-template-columns: 1fr;
  }
  .control-toggles {
    margin-left: 0;
  }
  .legend-item.muted {
    margin-left: 0;
  }
}

.panel {
  background: rgba(12, 17, 28, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.panel-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.count-pill {
  min-width: 36px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #04251a;
  background: var(--mint);
}

/* ── Rank list header ────────────────────────────────────── */
.rank-header {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.4fr) 90px minmax(140px, 1.1fr) minmax(120px, 0.9fr) 148px;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 900px) {
  .rank-header {
    display: none;
  }
}

/* ── Rank rows ───────────────────────────────────────────── */
.rank-list {
  position: relative;
  max-height: calc(100vh - 280px);
  min-height: 320px;
  overflow: auto;
  padding: 8px;
  scroll-behavior: smooth;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1.4fr) 90px minmax(140px, 1.1fr) minmax(120px, 0.9fr) 148px;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 34, 53, 0.95), rgba(16, 23, 38, 0.95));
  border: 1px solid var(--border);
  will-change: transform;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.rank-row:hover {
  border-color: rgba(91, 157, 255, 0.35);
  background: linear-gradient(180deg, rgba(30, 42, 66, 0.98), rgba(20, 28, 46, 0.98));
}

.rank-row.is-hot {
  border-color: rgba(255, 106, 77, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 106, 77, 0.08), 0 10px 30px rgba(255, 106, 77, 0.08);
}

.rank-row.is-new {
  border-color: rgba(192, 132, 252, 0.4);
}

.rank-row.pulse-mint {
  animation: mintGlow 1.1s var(--ease);
}

@keyframes mintGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.55);
    border-color: rgba(46, 230, 166, 0.7);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.rank-row.rank-up::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2ee6a6, #5b9dff);
}

/* Mobile stack */
@media (max-width: 900px) {
  .rank-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "rank col"
      "rank heat"
      "rank supply"
      "rank stats"
      "rank act";
    gap: 8px 12px;
  }
  .cell-rank {
    grid-area: rank;
  }
  .cell-col {
    grid-area: col;
  }
  .cell-heat {
    grid-area: heat;
  }
  .cell-supply {
    grid-area: supply;
  }
  .cell-stats {
    grid-area: stats;
  }
  .cell-act {
    grid-area: act;
    justify-content: flex-start;
  }
}

/* Rank badge */
.rank-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  position: relative;
}
.rank-badge.top1 {
  color: #1a1200;
  background: linear-gradient(145deg, #ffe08a, #f5c542);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(245, 197, 66, 0.35);
}
.rank-badge.top2 {
  color: #10141c;
  background: linear-gradient(145deg, #e8eefc, #a8b6d4);
  border-color: transparent;
}
.rank-badge.top3 {
  color: #1a1008;
  background: linear-gradient(145deg, #f0b27a, #d6894a);
  border-color: transparent;
}
.rank-delta {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: #04251a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.rank-delta.show {
  opacity: 1;
  transform: scale(1);
}
.rank-delta.down {
  background: var(--hot);
  color: #fff;
}

/* Collection cell */
.col-main {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1c2a44, #121a2b);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 1.1rem;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.col-copy {
  min-width: 0;
}
.col-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}
.col-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.sym {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.chip.type {
  color: #b9d7ff;
  background: var(--accent-soft);
  border-color: rgba(91, 157, 255, 0.25);
}
.chip.new {
  color: #efd0ff;
  background: var(--purple-soft);
  border-color: rgba(192, 132, 252, 0.3);
}
.chip.ok {
  color: #b8ffe0;
  background: var(--mint-soft);
  border-color: rgba(46, 230, 166, 0.28);
}
.addr {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Heat */
.heat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.heat-val {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}
.heat-val em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.heat-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.heat-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb088, #ff6a4d, #ff3d6e);
  transition: width 0.7s var(--ease);
  box-shadow: 0 0 12px rgba(255, 106, 77, 0.45);
}

/* Supply bar */
.supply-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.supply-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.supply-top b {
  color: #fff;
  font-family: var(--mono);
  font-weight: 600;
}
.supply-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.supply-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d8bfd 0%, #5b9dff 45%, #2ee6a6 100%);
  transition: width 0.85s var(--ease);
  box-shadow: 0 0 14px rgba(91, 157, 255, 0.35);
}
.supply-bar > i::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35));
  animation: sheen 2.4s ease-in-out infinite;
}
@keyframes sheen {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.85;
  }
}
.supply-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Stats */
.stats-box {
  display: grid;
  gap: 3px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.stats-box b {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.76rem;
}

/* Actions */
.cell-act {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, #3d8bfd, #2ee6a6);
  color: #041018;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(46, 230, 166, 0.2);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.x {
  background: #0a0a0a;
  border-color: #333;
  color: #fff;
}
.btn.ghost-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Feed stream ─────────────────────────────────────────── */
.feed-stream {
  max-height: calc(100vh - 280px);
  min-height: 320px;
  overflow: auto;
  padding: 8px;
}

.feed-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(18, 26, 43, 0.9);
  border: 1px solid var(--border);
  transform-origin: top center;
  animation: feedIn 0.55s var(--ease) both;
}
.feed-item.enter-fresh {
  animation: feedInFresh 0.65s var(--ease) both;
  border-color: rgba(46, 230, 166, 0.35);
  background: linear-gradient(135deg, rgba(46, 230, 166, 0.1), rgba(18, 26, 43, 0.95));
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes feedInFresh {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(0.96);
    filter: brightness(1.3);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.feed-name {
  font-weight: 800;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}
.feed-name .sym {
  margin-left: 6px;
}
.feed-line {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--mono);
}
.feed-links {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}
.feed-links a {
  color: #9ec5ff;
}
.feed-right {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.feed-right .ago {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}
.feed-item.is-new-col .feed-name::after {
  content: "NEW";
  margin-left: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #efd0ff;
  background: var(--purple-soft);
  border: 1px solid rgba(192, 132, 252, 0.35);
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

/* Empty */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state.hidden {
  display: none !important;
}
.empty-state.compact {
  padding: 28px 16px;
}
.empty-icon {
  font-size: 2rem;
  color: var(--mint);
  margin-bottom: 10px;
  animation: corePulse 2.4s ease-in-out infinite;
}
.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.05rem;
}
.empty-state p {
  margin: 0 auto;
  max-width: 36ch;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.footer .sep {
  opacity: 0.5;
}

/* Scrollbars */
.rank-list::-webkit-scrollbar,
.feed-stream::-webkit-scrollbar {
  width: 10px;
}
.rank-list::-webkit-scrollbar-thumb,
.feed-stream::-webkit-scrollbar-thumb {
  background: rgba(158, 180, 220, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.rank-list::-webkit-scrollbar-thumb:hover,
.feed-stream::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 180, 220, 0.38);
  background-clip: padding-box;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   Responsive: tablet + mobile + large desktop
   ═══════════════════════════════════════════════════════════ */

/* Large desktop */
@media (min-width: 1400px) {
  .shell {
    width: min(1520px, calc(100% - 48px));
  }
  .rank-list,
  .feed-stream {
    max-height: calc(100vh - 300px);
  }
}

/* Tablet */
@media (max-width: 1040px) {
  .shell {
    width: calc(100% - 24px);
    padding: 16px 0 32px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kpi {
    min-width: 0;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .rank-list,
  .feed-stream {
    max-height: none;
    min-height: 0;
  }

  .rank-panel .rank-list {
    max-height: min(70vh, 720px);
  }

  .feed-panel .feed-stream {
    max-height: min(50vh, 480px);
  }

  .control-toggles {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .shell {
    width: calc(100% - 16px);
    padding: 12px 0 28px;
  }

  .brand-text h1 {
    font-size: 1.35rem;
  }

  .tagline {
    font-size: 0.84rem;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hide-sm {
    display: none !important;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .seg {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .seg-btn {
    text-align: center;
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .control-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .switch {
    justify-content: center;
  }

  .legend-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .legend-item.muted {
    margin-left: 0;
  }

  .rank-header {
    display: none;
  }

  .rank-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "rank col"
      "heat heat"
      "supply supply"
      "stats stats"
      "act act";
    gap: 10px;
    padding: 12px;
  }

  .cell-rank {
    grid-area: rank;
    align-self: start;
  }
  .cell-col {
    grid-area: col;
  }
  .cell-heat {
    grid-area: heat;
  }
  .cell-supply {
    grid-area: supply;
  }
  .cell-stats {
    grid-area: stats;
  }
  .cell-act {
    grid-area: act;
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 6px;
  }

  .cell-act .btn {
    width: 100%;
  }

  .col-name {
    max-width: 100%;
    white-space: normal;
  }

  .rank-list,
  .feed-stream {
    max-height: none;
  }

  .rank-panel .rank-list {
    max-height: none;
  }

  .feed-panel .feed-stream {
    max-height: min(55vh, 420px);
  }

  .panel-head {
    padding: 14px 14px 10px;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
  .footer .sep {
    display: none;
  }

  .privacy-banner {
    font-size: 0.8rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .kpi-value {
    font-size: 1rem;
  }
  .cell-act {
    grid-template-columns: 1fr 1fr;
  }
  .logo {
    width: 44px;
    height: 44px;
  }
}

/* Safe areas (notched phones) */
@supports (padding: max(0px)) {
  .shell {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

/* Touch targets */
@media (pointer: coarse) {
  .btn {
    min-height: 40px;
    padding: 0 12px;
  }
  .seg-btn {
    min-height: 42px;
  }
  #search {
    height: 48px;
    font-size: 16px; /* prevents iOS zoom */
  }
}
