/* Predict.fun public dashboard — Binance-inspired palette, unofficial. */
:root {
  --bg: #0B0E11;
  --bg-elev: #12161C;
  --bg-card: rgba(30, 35, 41, 0.90);
  --bg-card-solid: #1E2329;
  --line: #2B3139;
  --line-strong: rgba(240, 185, 11, 0.42);
  --yellow: #F0B90B;
  --yellow-bright: #FCD535;
  --yellow-dim: rgba(240, 185, 11, 0.14);
  --yellow-soft: rgba(252, 213, 53, 0.10);
  --text: #EAECEF;
  --muted: #848E9C;
  --faint: #5E6673;
  --up: #0ECB81;
  --down: #F6465D;
  --warn: #F0B90B;
  --shadow: 0 0 0 1px rgba(240, 185, 11, 0.06), 0 16px 40px rgba(0, 0, 0, 0.45);
  --mono: "IBM Plex Mono", "ui-monospace", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --sans: "IBM Plex Sans", "Noto Sans", "Noto Sans CJK SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --radius: 8px;
  --gap-stat: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--yellow) 22%, var(--yellow-bright) 50%, var(--yellow) 78%, transparent 100%);
  opacity: 0.9;
}

.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}
.bg-art, .bg-grid, .bg-veil, .bg-motifs {
  position: absolute;
  inset: 0;
}
.bg-art {
  top: -20%;
  height: 220%;
  background-image: image-set(
    url("bg-binance-tech.webp") type("image/webp"),
    url("bg-binance-tech.jpg") type("image/jpeg")
  );
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  opacity: 1;
  animation: bgDrift 96s linear infinite;
}
.bg-motifs {
  top: -15%;
  height: 230%;
  background-image: url("bg-motifs.svg");
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  opacity: 0.72;
  animation: bgDrift 120s linear infinite reverse;
}
@keyframes bgDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.bg-grid {
  background-image:
    linear-gradient(rgba(240, 185, 11, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 185, 11, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 8%, #000 18%, transparent 78%);
  opacity: 0.7;
}
.bg-veil {
  background:
    radial-gradient(900px 380px at 12% -8%, rgba(240, 185, 11, 0.10), transparent 62%),
    radial-gradient(720px 300px at 92% 0%, rgba(252, 213, 53, 0.07), transparent 58%),
    linear-gradient(180deg, rgba(11, 14, 17, 0.46) 0%, rgba(11, 14, 17, 0.28) 28%, rgba(11, 14, 17, 0.50) 100%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 16px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(11, 14, 17, 0.94) 0%, rgba(11, 14, 17, 0.78) 62%, rgba(11, 14, 17, 0));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(240, 185, 11, 0.22), rgba(30, 35, 41, 0.5));
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.18);
  position: relative;
}
.mark::before {
  content: "";
  position: absolute;
  inset: 8px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 1.5px solid var(--yellow);
  background: transparent;
}
.mark::after {
  content: "";
  position: absolute;
  inset: 13px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(240, 185, 11, 0.55);
}
.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--text);
  line-height: 1.25;
}
.brand-text .sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: none;
}

.status-group {
  display: flex;
  align-items: center;
  gap: var(--gap-stat);
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 28, 0.92);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(94, 102, 115, 0.16);
}
.status-pill.online { color: var(--up); border-color: rgba(14, 203, 129, 0.40); }
.status-pill.online .dot { background: var(--up); box-shadow: 0 0 0 4px rgba(14, 203, 129, 0.16); animation: pulse 1.8s ease-out infinite; }
.status-pill.offline { color: var(--down); border-color: rgba(246, 70, 93, 0.42); }
.status-pill.offline .dot { background: var(--down); box-shadow: 0 0 0 4px rgba(246, 70, 93, 0.16); }
a.status-pill {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
a.status-pill:hover,
a.status-pill:focus-visible {
  background: rgba(24, 28, 34, 0.98);
  box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.20);
}
a.status-pill.online:hover,
a.status-pill.online:focus-visible {
  border-color: rgba(14, 203, 129, 0.72);
  box-shadow: 0 0 0 1px rgba(14, 203, 129, 0.18);
}
a.status-pill.offline:hover,
a.status-pill.offline:focus-visible {
  border-color: rgba(246, 70, 93, 0.72);
}
a.status-pill:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(14, 203, 129, 0); }
}

.equity-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 28, 0.92);
  box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.04);
}
.equity-stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.equity-stat-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--yellow-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.equity-stat-value.is-empty { color: var(--muted); font-weight: 500; }

.hero {
  display: block;
  margin: 8px 0 18px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  backdrop-filter: blur(16px);
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
  margin: 0 0 8px;
}
.equity-num {
  font-family: var(--mono);
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.equity-meta { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.equity-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px 20px;
  align-items: start;
}
@media (max-width: 640px) { .equity-split { grid-template-columns: 1fr; } }
.util-box {
  padding: 4px 0 0 20px;
  border-left: 1px solid var(--line);
}
@media (max-width: 640px) {
  .util-box { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
.util-num { font-size: clamp(28px, 5vw, 40px); }
.wallet-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--line); background: rgba(11, 14, 17, 0.55);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile .label { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.tile .value {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tile .hint { margin-top: 6px; color: var(--faint); font-size: 11px; line-height: 1.45; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.neu { color: var(--text); }

.section-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.section-h h3 { margin: 0; font-size: 15px; letter-spacing: 0.04em; }
.section-h span { color: var(--faint); font-size: 12px; }

.table-card { margin-bottom: 18px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 11px;
  background: rgba(11, 14, 17, 0.45);
}
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
tbody tr:hover td { background: rgba(240, 185, 11, 0.04); }
.badge {
  display: inline-flex; padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--line); font-size: 11px; color: var(--muted);
}
.badge.ok { color: var(--up); border-color: rgba(14, 203, 129, 0.35); }
.badge.warn { color: var(--warn); border-color: rgba(240, 185, 11, 0.40); }
.badge.bad { color: var(--down); border-color: rgba(246, 70, 93, 0.40); }
.badge.live { color: var(--yellow-bright); border-color: var(--line-strong); }

.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--bg-card-solid); border: 1px solid var(--line-strong); color: var(--text);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 40;
  box-shadow: var(--shadow);
}

.venue-panel[hidden] { display: none !important; }

@media (max-width: 860px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .top-actions { justify-content: flex-start; }
  .status-group { width: 100%; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-pill.online .dot { animation: none; }
  .bg-art, .bg-motifs { animation: none; }
}
