:root {
  --bg: #0a0a12;
  --surface: #13131f;
  --surface2: #1a1a2e;
  --border: #2a2a3e;
  --text: #e2e8f0;
  --dim: #64748b;
  --accent: #8b5cf6;
  --accent2: #6d28d9;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.header-left h1 { font-size: 1.2rem; font-weight: 700; }
.logo { font-size: 1.5rem; }
.badge { font-size: 0.65rem; background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }

/* Tabs */
.tabs { display: flex; gap: 0; background: var(--surface2); border-radius: 8px; overflow: hidden; }
.tab { background: transparent; border: none; color: var(--dim); padding: 0.5rem 1rem; cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: all 0.2s; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: white; }

/* Buttons */
.btn { border: none; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--blue)); color: white; }
.btn-accent:hover { opacity: 0.9; }
.btn-green { background: var(--green); color: white; }
.btn-red { background: var(--red); color: white; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

/* Wallet */
.wallet-info { display: flex; align-items: center; gap: 0.5rem; }
.wallet-addr { font-size: 0.8rem; background: var(--surface2); padding: 0.4rem 0.75rem; border-radius: 8px; font-family: monospace; }
.wallet-bal { font-size: 0.75rem; color: var(--green); }
.hidden { display: none !important; }

/* Inputs */
.input { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; color: var(--text); font-family: inherit; font-size: 0.85rem; outline: none; }
.input:focus { border-color: var(--accent); }
.search-input { min-width: 240px; }
.select { cursor: pointer; }

/* Main */
.main { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Stats Bar */
.stats-bar { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; padding: 1rem 1.5rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.stat { display: flex; flex-direction: column; }
.stat-val { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--dim); margin-top: 0.2rem; }

/* Filters */
.filters { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

/* Market Grid */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; }
.market-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; cursor: pointer; transition: all 0.2s; position: relative; }
.market-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.market-card .source-badge { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.source-badge.polymarket { background: rgba(59,130,246,0.15); color: var(--blue); }
.source-badge.kalshi { background: rgba(34,197,94,0.15); color: var(--green); }
.source-badge.azuro { background: rgba(233,69,96,0.15); color: #e94560; }
.source-badge.azuro { background: rgba(139,92,246,0.15); color: var(--accent); }
.market-card .category { font-size: 0.7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.market-card .title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.market-card .odds-bar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.odds-btn { flex: 1; padding: 0.5rem; border-radius: 8px; text-align: center; font-weight: 600; font-size: 0.85rem; border: none; cursor: pointer; transition: all 0.15s; }
.odds-btn.yes { background: rgba(34,197,94,0.12); color: var(--green); }
.odds-btn.yes:hover { background: rgba(34,197,94,0.25); }
.odds-btn.no { background: rgba(239,68,68,0.12); color: var(--red); }
.odds-btn.no:hover { background: rgba(239,68,68,0.25); }
.market-card .meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--dim); }
.market-card .volume { font-weight: 500; }

/* Probability Bar */
.prob-bar { height: 4px; background: var(--surface2); border-radius: 2px; margin-bottom: 0.75rem; overflow: hidden; }
.prob-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

/* Loading */
.loading { text-align: center; color: var(--dim); padding: 3rem; font-size: 0.9rem; }
.load-more { text-align: center; margin-top: 1.5rem; }

/* Swap Container */
.swap-container { max-width: 600px; margin: 0 auto; }
.swap-container h2 { margin-bottom: 0.5rem; }
.subtitle { color: var(--dim); font-size: 0.85rem; margin-bottom: 1.5rem; }
.widget-frame { margin-bottom: 2rem; }
.onramp-section { text-align: center; padding: 2rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.onramp-section h3 { margin-bottom: 0.5rem; }

/* Rewards */
.rewards-container { max-width: 800px; margin: 0 auto; }
.token-hero { text-align: center; margin-bottom: 2rem; }
.token-hero h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.rewards-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.reward-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.reward-val { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.reward-label { font-size: 0.75rem; color: var(--dim); margin-top: 0.3rem; }
.tokenomics { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem; }
.tokenomics h3 { margin-bottom: 1rem; }
.token-info .row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.token-info .row:last-child { border-bottom: none; }
.token-info .row span:first-child { color: var(--dim); }
.referral-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem; text-align: center; }
.referral-code { font-family: monospace; font-size: 1.2rem; background: var(--surface2); padding: 0.75rem 1.5rem; border-radius: 8px; margin-top: 1rem; cursor: pointer; display: inline-block; }
.leaderboard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lb-row { display: flex; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 40px; font-weight: 700; color: var(--accent); }
.lb-wallet { flex: 1; font-family: monospace; font-size: 0.8rem; }
.lb-volume { min-width: 100px; text-align: right; font-weight: 600; }
.lb-pred { min-width: 80px; text-align: right; color: var(--accent); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--dim); font-size: 1.2rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal .title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.modal .desc { color: var(--dim); font-size: 0.85rem; line-height: 1.6; margin-bottom: 1.5rem; }
.modal .trade-section { display: flex; gap: 0.75rem; margin-top: 1rem; }
.modal .trade-section .btn { flex: 1; padding: 0.75rem; font-size: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--dim); }
.empty-state p { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .header { flex-direction: column; gap: 0.5rem; padding: 0.5rem; }
  .header-center { order: 3; width: 100%; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; font-size: 0.75rem; padding: 0.5rem; }
  .market-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; }
  .filters { flex-direction: column; }
  .search-input { min-width: auto; }
  .rewards-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Arbitrage */
.arb-container { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.arb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.arb-spread { font-size: 1.5rem; font-weight: 700; color: var(--green); margin-bottom: 0.5rem; }
.arb-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.arb-details { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.arb-side { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.arb-vs { color: var(--dim); font-weight: 600; font-size: 0.8rem; }
.arb-price { font-weight: 600; font-size: 1.1rem; }
.arb-strategy { font-size: 0.8rem; color: var(--dim); background: var(--surface2); padding: 0.5rem 0.75rem; border-radius: 8px; }

/* Movers */
.movers-container { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.mover-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: border-color 0.2s; }
.mover-card:hover { border-color: var(--accent); }
.mover-change { font-size: 1.3rem; font-weight: 700; min-width: 80px; text-align: center; }
.mover-title { flex: 1; font-size: 0.9rem; font-weight: 500; }
.mover-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--dim); }

/* News in modal */
.news-section { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.news-item { display: block; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); text-decoration: none; color: var(--text); transition: color 0.15s; }
.news-item:hover { color: var(--accent); }
.news-headline { display: block; font-size: 0.85rem; line-height: 1.4; }
.news-meta { display: block; font-size: 0.7rem; color: var(--dim); margin-top: 0.15rem; }
