:root {
  --bg: #07080d;
  --bg-2: #0c1018;
  --panel: #10151f;
  --panel-2: #141b27;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(34, 197, 94, 0.18);
  --text: #e9f0ef;
  --muted: #8b9aa8;
  --dim: #667687;
  --green: #16c784;
  --green-2: #00e896;
  --red: #ea3943;
  --red-2: #ff5a63;
  --gold: #f5b942;
  --amber: #ff8a3d;
  --cyan: #3ee0c6;
  --blue: #5b8cff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}
button, input { font: inherit; }

.bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(22, 199, 132, 0.16), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(245, 185, 66, 0.08), transparent 55%),
    radial-gradient(800px 600px at 80% 100%, rgba(88, 70, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #090b11 0%, #07080d 100%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.top, .stats, .layout, .foot { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px 8px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}
.logo-ring, .logo-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.logo-ring {
  border: 2px solid rgba(22, 199, 132, 0.35);
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.45);
  animation: pulse-ring 2.4s ease-out infinite;
}
.logo-core {
  inset: 9px;
  background: radial-gradient(circle at 35% 35%, #b6ffdf, var(--green) 55%, #0a5);
  box-shadow: 0 0 18px rgba(22, 199, 132, 0.85);
}
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  80% { transform: scale(1.15); opacity: 0; }
  100% { opacity: 0; }
}
.wordmark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.tag {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-pill {
  margin-left: 4px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1a1408;
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  box-shadow: 0 0 24px rgba(245, 185, 66, 0.35);
  white-space: nowrap;
}
.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.clock {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ws {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 21, 31, 0.8);
  font-size: 12px;
  font-weight: 600;
}
.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
}
.ws[data-state="connected"] { color: var(--green); border-color: rgba(22,199,132,.3); }
.ws[data-state="connected"] .ws-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1.6s ease-in-out infinite;
}
.ws[data-state="reconnecting"],
.ws[data-state="connecting"] { color: var(--gold); }
.ws[data-state="reconnecting"] .ws-dot,
.ws[data-state="connecting"] .ws-dot {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 0.7s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 22px 6px;
}
.stat {
  background: linear-gradient(180deg, rgba(20, 27, 39, 0.92), rgba(12, 16, 24, 0.92));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 11px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-label {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.stat-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-value.accent { color: var(--green-2); text-shadow: 0 0 18px rgba(22,199,132,.35); }
.stat-value.gold { color: var(--gold); text-shadow: 0 0 18px rgba(245,185,66,.35); font-size: 18px; }
.stat-sub { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-stat { border-color: rgba(245, 185, 66, 0.28); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 400px);
  gap: 16px;
  padding: 10px 22px 20px;
  align-items: start;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.games-panel .panel-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.panel-head h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.feed-head { align-items: center; }
.feed-rate {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  background: rgba(22, 199, 132, 0.08);
  border: 1px solid rgba(22, 199, 132, 0.2);
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.games {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 14px 16px 13px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 28, 40, 0.96), rgba(12, 16, 24, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--card-color, var(--green));
  opacity: 0.85;
}
.card.rush-up {
  border-color: rgba(22, 199, 132, 0.55);
  box-shadow:
    0 0 0 1px rgba(22, 199, 132, 0.2),
    0 0 22px rgba(22, 199, 132, 0.32),
    0 0 40px rgba(22, 199, 132, 0.18),
    var(--shadow);
}
.card.rush-down {
  border-color: rgba(234, 57, 67, 0.4);
  box-shadow:
    0 0 0 1px rgba(234, 57, 67, 0.1),
    0 0 22px rgba(234, 57, 67, 0.14),
    var(--shadow);
}
.card.is-hot {
  border-color: rgba(245, 185, 66, 0.7);
  box-shadow:
    0 0 0 1px rgba(245, 185, 66, 0.28),
    0 0 18px rgba(245, 185, 66, 0.45),
    0 0 48px rgba(245, 185, 66, 0.28),
    0 0 22px rgba(22, 199, 132, 0.18),
    var(--shadow);
}
.card.is-hot.rush-up {
  box-shadow:
    0 0 0 1px rgba(245, 185, 66, 0.35),
    0 0 20px rgba(245, 185, 66, 0.5),
    0 0 52px rgba(245, 185, 66, 0.32),
    0 0 28px rgba(22, 199, 132, 0.32),
    var(--shadow);
}
.card-main { min-width: 0; }
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.card-titles { min-width: 0; flex: 1; }
.card-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-event {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.token {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid rgba(62, 224, 198, 0.25);
  background: rgba(62, 224, 198, 0.08);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.sport-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 999px;
}
.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1a1408;
  background: linear-gradient(90deg, #ffd56a, #ff8a3d);
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(255, 138, 61, 0.55);
  animation: hotpulse 1.4s ease-in-out infinite;
}
@keyframes hotpulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.12); }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.metric {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
}
.metric-label { color: var(--dim); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.metric-value {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.metric-sub { color: var(--muted); font-size: 10px; margin-top: 1px; }

.flow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.chip.plus {
  color: var(--green);
  background: rgba(22, 199, 132, 0.1);
  border-color: rgba(22, 199, 132, 0.25);
  text-shadow: 0 0 8px rgba(22,199,132,.4);
}
.chip.minus {
  color: var(--red-2);
  background: rgba(234, 57, 67, 0.1);
  border-color: rgba(234, 57, 67, 0.25);
  text-shadow: 0 0 8px rgba(234,57,67,.35);
}
.chip.idle { color: var(--muted); }

.card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 118px;
}
.rush {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
}
.rush.up {
  color: var(--green-2);
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.35);
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.25);
}
.rush.down {
  color: var(--red-2);
  background: rgba(234, 57, 67, 0.12);
  border: 1px solid rgba(234, 57, 67, 0.35);
  box-shadow: 0 0 16px rgba(234, 57, 67, 0.2);
}
.rush.steady {
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.spark {
  width: 118px;
  height: 36px;
  display: block;
}
.price {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.price b { color: var(--text); font-weight: 600; }

.feed-panel {
  position: sticky;
  top: 12px;
  background: linear-gradient(180deg, rgba(16, 21, 31, 0.92), rgba(10, 13, 20, 0.92));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 12px 10px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.feed {
  list-style: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  max-height: min(70vh, 760px);
}
.feed::-webkit-scrollbar { width: 8px; }
.feed::-webkit-scrollbar-thumb { background: #223044; border-radius: 8px; }

.bet {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px 8px;
  animation: slide-in 0.42s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes slide-in {
  from { transform: translateX(22px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.bet-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.bet-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.bet-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.bet-type.back, .bet-type.spin { color: var(--green); border-color: rgba(22,199,132,.3); background: rgba(22,199,132,.08); }
.bet-type.lay, .bet-type.cashout { color: var(--red-2); border-color: rgba(234,57,67,.3); background: rgba(234,57,67,.08); }
.bet-type.over-under { color: var(--gold); border-color: rgba(245,185,66,.3); background: rgba(245,185,66,.08); }
.bet-text {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
}
.bet-text .amt {
  font-family: var(--mono);
  color: var(--green-2);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(22,199,132,.25);
}
.bet-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.foot {
  padding: 4px 22px 22px;
  color: var(--dim);
  font-size: 11px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 8px 14px 18px; }
  .stats { grid-template-columns: 1fr 1fr; padding: 8px 14px 4px; gap: 8px; }
  .top { padding: 12px 14px 6px; flex-wrap: wrap; }
  .demo-pill { margin-left: 0; }
  .top-right { margin-left: auto; }
  .feed-panel {
    position: relative;
    top: 0;
    max-height: none;
    min-height: 0;
    order: -1;
  }
  .feed { max-height: 42vh; }
  .metrics { grid-template-columns: 1fr 1fr 1fr; }
  .stat-value { font-size: 18px; }
  .stat-value.gold { font-size: 15px; }
  .card { grid-template-columns: 1fr; }
  .card-side { flex-direction: row; align-items: center; min-width: 0; justify-content: space-between; }
  .foot { padding: 4px 14px 24px; }
}

@media (max-width: 420px) {
  .wordmark { font-size: 18px; }
  .clock { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .card-name { font-size: 15px; }
}

/* --- feed live board additions --- */
.games-head { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.games-head > div:first-child { flex: 1; min-width: 180px; }
.group-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.gbtn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.gbtn[aria-pressed="true"] {
  color: #04140e;
  background: linear-gradient(180deg, #b6ffdf, var(--green));
  box-shadow: 0 0 14px rgba(22,199,132,0.35);
}
.crumbs {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs span + span::before { content: " · "; color: var(--dim); }
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.split-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(234,57,67,0.25);
  overflow: hidden;
  grid-column: 1 / -1;
  display: flex;
}
.split-bar .back { background: var(--green); box-shadow: 0 0 8px rgba(22,199,132,0.6); }
.split-bar .lay { background: var(--red); }
.split-side { font-family: var(--mono); font-size: 11px; }
.split-side.back { color: var(--green); }
.split-side.lay { color: var(--red-2); }
.split-side b { font-weight: 600; }
#sourcePill[data-mode="live"] {
  color: #04140e;
  background: linear-gradient(180deg, #b6ffdf, var(--green));
  box-shadow: 0 0 24px rgba(22,199,132,0.4);
}
#sourcePill[data-mode="mock"] {
  color: #1a1408;
  background: linear-gradient(180deg, #ffe08a, var(--gold));
}
#feedStatus[data-state="live"] { color: var(--green); border-color: rgba(22,199,132,.3); }
#feedStatus[data-state="live"] .ws-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1.6s ease-in-out infinite;
}
#feedStatus[data-state="reconnecting"] { color: var(--gold); }
#feedStatus[data-state="reconnecting"] .ws-dot {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 0.7s ease-in-out infinite;
}
#feedStatus[data-state="disconnected"] { color: var(--red-2); border-color: rgba(234,57,67,.3); }
#feedStatus[data-state="disconnected"] .ws-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }

@media (max-width: 900px) {
  .games-head { align-items: flex-start; }
  .top-right { gap: 8px; }
  .ws { padding: 5px 8px; font-size: 11px; }
}

/* ---- Top 10 live events ---- */
.top10 { position: relative; z-index: 1; margin: 0 22px 14px; }
.top10-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 14px 14px; }
.t10 { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); min-width: 0; }
.t10.hot { border-color: rgba(245,185,66,.55); box-shadow: 0 0 18px rgba(245,185,66,.25); }
.t10-rank { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; background: rgba(22,199,132,.12); color: var(--green); }
.t10.hot .t10-rank { background: rgba(245,185,66,.18); color: var(--gold); }
.t10-main { flex: 1 1 auto; min-width: 0; }
.t10-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t10-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t10-cat { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.c-sports { background: rgba(22,199,132,.14); color: var(--green); }
.c-casino { background: rgba(245,185,66,.16); color: var(--gold); }
.c-fantasy, .c-binary { background: rgba(167,139,250,.16); color: #a78bfa; }
.t10-bar { height: 4px; margin-top: 6px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.t10-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); box-shadow: 0 0 8px rgba(22,199,132,.6); }
.t10-num { flex: 0 0 auto; text-align: right; font-family: var(--mono); }
.t10-bets { font-size: 16px; font-weight: 700; }
.t10-bets small { font-size: 10px; color: var(--muted); font-weight: 400; }
.t10-vol { font-size: 11px; color: var(--muted); }
.t10-split { font-size: 10px; } .t10-split .b { color: var(--blue); font-weight: 600; } .t10-split .l { color: #ff6fa8; font-weight: 600; }
.t10-empty { color: var(--muted); padding: 10px; grid-column: 1 / -1; }
@media (max-width: 760px) {
  .top10 { margin: 0 10px 12px; }
  .top10-list { grid-template-columns: 1fr; padding: 4px 10px 12px; }
}

/* ---- grouped cards: top-7 + show more ---- */
.groups-more-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 14px; }
.groups-info { color: var(--muted); font-size: 12px; }
.groups-more { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--green); background: rgba(22,199,132,.08); border: 1px solid rgba(22,199,132,.4); border-radius: 999px; padding: 7px 16px; box-shadow: 0 0 12px rgba(22,199,132,.18); }
.groups-more:hover { background: rgba(22,199,132,.16); }
.groups-more[hidden] { display: none; }
@media (max-width: 760px) { .groups-more-row { flex-direction: column; align-items: stretch; text-align: center; } }
.groups-more:disabled { cursor: default; color: var(--muted); background: transparent; border-color: var(--line); box-shadow: none; }

/* ---- live bets feed: notification-style drop-in (JS-driven, new rows only) ---- */
.feed .bet { animation: none; overflow: hidden; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  .feed .bet { animation: none !important; transition: none !important; }
}

/* ---- 7bets branding + stat sparklines ---- */
.brand-logo { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 16px rgba(207,103,72,.45); }
.stat-spark { display: block; width: 100%; height: 28px; margin-top: 6px; overflow: visible; }
.stat-spark .sp-line { fill: none; stroke: var(--green); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(22,199,132,.6)); }
.stat-spark .sp-area { fill: rgba(22,199,132,.12); stroke: none; }
.stat-spark[data-trend="down"] .sp-line { stroke: var(--red-2); filter: drop-shadow(0 0 3px rgba(234,57,67,.55)); }
.stat-spark[data-trend="down"] .sp-area { fill: rgba(234,57,67,.10); }
.stat-spark.gold-spark .sp-line { stroke: var(--gold); filter: drop-shadow(0 0 3px rgba(245,185,66,.55)); }
.stat-spark.gold-spark .sp-area { fill: rgba(245,185,66,.12); }
.stat-spark.gold-spark[data-trend="down"] .sp-line { stroke: var(--red-2); }

/* ---- Top 10 live re-order (in place) ---- */
.t10 { will-change: transform; }
.t10-up .t10-count { animation: t10up .9s ease-out; }
.t10-down .t10-count { animation: t10down .9s ease-out; }
@keyframes t10up { 0% { color: var(--green); text-shadow: 0 0 8px rgba(22,199,132,.8); } 100% { color: inherit; text-shadow: none; } }
@keyframes t10down { 0% { color: var(--red-2); } 100% { color: inherit; } }
@media (prefers-reduced-motion: reduce) { .t10-up .t10-count, .t10-down .t10-count { animation: none; } }

/* ---- stat cards: number left, sparkline on the right ---- */
.stat.has-spark { display: grid; grid-template-columns: minmax(0, 1fr) minmax(56px, 42%); grid-template-rows: auto auto auto; column-gap: 10px; align-items: start; }
.stat.has-spark > :not(.stat-spark) { grid-column: 1; min-width: 0; }
.stat.has-spark > .stat-value { white-space: nowrap; }
.stat.has-spark > .stat-spark { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 100%; height: 38px; margin-top: 0; }
@media (max-width: 900px) { .stat.has-spark { grid-template-columns: minmax(0, 1fr) minmax(44px, 36%); column-gap: 8px; } .stat.has-spark > .stat-spark { height: 30px; } }
@media (max-width: 340px) { .stat.has-spark { display: block; } .stat.has-spark > .stat-spark { height: 24px; margin-top: 6px; } }

/* ---- mobile header (phones): brand + status on row 1, source pill on row 2 ---- */
@media (max-width: 600px) {
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand status";
    align-items: center;
    column-gap: 10px;
    padding: 10px 14px 2px;
  }
  .brand { grid-area: brand; gap: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-text { min-width: 0; }
  .wordmark { font-size: 19px; }
  .tag { font-size: 10px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-right { grid-area: status; margin-left: 0; justify-self: end; gap: 6px; }
  .ws { padding: 4px 8px; font-size: 11px; gap: 5px; white-space: nowrap; }
  /* stat cards: label spans the card, value left + sparkline right underneath */
  .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat.has-spark > .stat-label { grid-column: 1 / -1; }
  .stat.has-spark > .stat-spark { grid-row: 2 / span 2; }
}
