/* ============================
   UPDOWN MARKET — style.css
   Light · ETH / Robinhood Chain
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #FFFFFF;
  --bg2:      #F7F8FA;
  --bg3:      #F0F2F5;
  --card:     #FFFFFF;
  --card-b:   #E4E7EC;
  --bull:     #00C805;
  --bear:     #FF5000;
  --accent:   #627EEA;
  --eth:      #627EEA;
  --text:     #1A1D26;
  --muted:    #6B7280;
  --dim:      #9CA3AF;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'Inter', system-ui, sans-serif;
  --r:        12px;
  --r2:       8px;
  --shadow:   0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --glow-bull: 0 0 20px rgba(0,200,5,0.2);
  --glow-bear: 0 0 20px rgba(255,80,0,0.2);
  --glow-acc:  0 0 20px rgba(98,126,234,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg2);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }

/* ── Typography ── */
.mono { font-family: var(--mono); }
.bull { color: var(--bull); }
.bear { color: var(--bear); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ── Subtle background pattern ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(98,126,234,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98,126,234,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(98,126,234,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ============================
   HEADER
   ============================ */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-b);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img { height: 32px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--r2);
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Chain badge */
.chain-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(98,126,234,0.08);
  border: 1px solid rgba(98,126,234,0.18);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--mono);
}

.chain-badge svg { flex-shrink: 0; }

/* Live indicator */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--bull);
  font-family: var(--mono);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--bull);
  border-radius: 50%;
  animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,200,5,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(0,200,5,0); }
}

/* Connect button */
.btn-connect {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bull);
  border: none;
  border-radius: var(--r2);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.btn-connect:hover {
  background: #00B004;
  box-shadow: var(--glow-bull);
  transform: translateY(-1px);
}

.btn-connect.connected {
  background: var(--bg3);
  border: 1px solid var(--card-b);
  color: var(--text);
}

.btn-connect.connected:hover {
  background: var(--card-b);
  box-shadow: none;
  transform: none;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}

/* ============================
   HERO
   ============================ */
#hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(98,126,234,0.08);
  border: 1px solid rgba(98,126,234,0.18);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-title .up { color: var(--bull); }
.hero-title .dn { color: var(--bear); }

.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--bull);
  border: none;
  border-radius: var(--r);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
  letter-spacing: 0.01em;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,200,5,0.3);
  background: #00B004;
}

.hero-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-family: var(--sans);
}

.hero-follow:hover {
  background: var(--bg3);
  border-color: var(--dim);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-stat-item {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  padding: 16px 24px;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.hero-stat-val {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}

.hero-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================
   SECTIONS
   ============================ */
section {
  padding: 32px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================
   BALANCE DASHBOARD CARD
   ============================ */
#balance-section { padding-top: 0; }

.balance-card {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--bull));
}

.balance-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.balance-amount {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  font-family: var(--mono);
  color: var(--text);
  letter-spacing: -0.02em;
  transition: all 0.3s;
}

.balance-change {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
}

.balance-meta {
  display: flex;
  gap: 32px;
}

.balance-stat {
  text-align: right;
}

.balance-stat-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
}

.balance-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================
   MARKET GRID
   ============================ */
.market-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ============================
   MARKET CARD
   ============================ */
.market-card {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.market-card:hover {
  border-color: var(--dim);
  box-shadow: var(--shadow-lg);
}

.market-card.locked {
  opacity: 0.8;
}

/* Top bar */
.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-asset {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mc-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.mc-icon.btc { background: rgba(247,147,26,0.12); color: #F7931A; }
.mc-icon.eth { background: rgba(98,126,234,0.12); color: #627EEA; }
.mc-icon.link { background: rgba(55,91,210,0.12); color: #375BD2; }
.mc-icon.arb { background: rgba(40,160,240,0.12); color: #28A0F0; }

.mc-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mc-ticker {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mc-round {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

/* Timer */
.mc-timer {
  text-align: right;
}

.mc-countdown {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  transition: color 0.3s;
}

.mc-countdown.urgent { color: var(--bear); animation: pulse-urgent 0.5s ease-in-out infinite alternate; }

@keyframes pulse-urgent {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

.mc-timer-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* Price */
.mc-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.mc-price {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.mc-change {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  padding: 3px 7px;
  border-radius: 5px;
}

.mc-change.pos { background: rgba(0,200,5,0.1); color: var(--bull); }
.mc-change.neg { background: rgba(255,80,0,0.1); color: var(--bear); }

/* Progress bar */
.mc-progress-wrap {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.mc-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
}

/* Prediction display (active) */
.mc-active-pred {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border-radius: var(--r2);
  padding: 8px 12px;
  border: 1px solid var(--card-b);
}

.mc-active-pred.show { display: flex; }

.mc-pred-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}

.mc-pred-badge.up { background: rgba(0,200,5,0.12); color: var(--bull); }
.mc-pred-badge.dn { background: rgba(255,80,0,0.12); color: var(--bear); }

.mc-pred-info {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
}

/* Stake selector */
.mc-stake-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.stake-btn {
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  background: var(--bg2);
  border: 1px solid var(--card-b);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

.stake-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.stake-btn.active {
  background: rgba(98,126,234,0.1);
  border-color: rgba(98,126,234,0.35);
  color: var(--accent);
}

/* Custom stake */
.mc-custom-stake {
  display: flex;
  gap: 5px;
  margin-top: -6px;
}

.custom-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--card-b);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  min-width: 0;
  transition: border-color 0.2s;
}

.custom-input:focus { border-color: rgba(98,126,234,0.5); }
.custom-input::placeholder { color: var(--dim); }

/* Action buttons */
.mc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-up, .btn-dn {
  padding: 12px 8px;
  border: none;
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--sans);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-up {
  background: rgba(0,200,5,0.1);
  border: 1px solid rgba(0,200,5,0.3);
  color: var(--bull);
}

.btn-up:hover:not(:disabled) {
  background: rgba(0,200,5,0.18);
  box-shadow: var(--glow-bull);
  transform: translateY(-1px);
}

.btn-dn {
  background: rgba(255,80,0,0.1);
  border: 1px solid rgba(255,80,0,0.3);
  color: var(--bear);
}

.btn-dn:hover:not(:disabled) {
  background: rgba(255,80,0,0.18);
  box-shadow: var(--glow-bear);
  transform: translateY(-1px);
}

.btn-up:disabled, .btn-dn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow {
  font-size: 16px;
  line-height: 1;
}

/* ============================
   BOTTOM LAYOUT (feed + stats)
   ============================ */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
}

/* ============================
   ACTIVITY FEED
   ============================ */
.feed-card {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.feed-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-b);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-body {
  flex: 1;
  overflow-y: auto;
  max-height: 340px;
  padding: 8px 0;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  transition: background 0.15s;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.feed-item:hover { background: var(--bg2); }

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.feed-dot.bull { background: var(--bull); }
.feed-dot.bear { background: var(--bear); }

.feed-text {
  flex: 1;
  font-size: 12px;
  font-family: var(--mono);
}

.feed-asset {
  font-weight: 600;
  color: var(--text);
}

.feed-dir { color: var(--muted); }

.feed-pnl {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
}

.feed-time {
  font-size: 10px;
  color: var(--dim);
  font-family: var(--mono);
}

.feed-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

/* ============================
   STATS / LEADERBOARD
   ============================ */
.stats-card {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stats-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-b);
}

.stats-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.stats-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.stats-panel {
  display: none;
  padding: 16px;
}

.stats-panel.active { display: block; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg3);
}

.stat-row:last-child { border-bottom: none; }

.stat-name {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
}

/* Rank badge */
.rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: var(--bg2);
  border-radius: var(--r2);
  margin-bottom: 14px;
  border: 1px solid var(--card-b);
}

.rank-icon {
  font-size: 28px;
}

.rank-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.rank-sub {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

/* ============================
   WALLET MODAL
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 360px;
  transform: translateY(16px);
  transition: transform 0.25s;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}

.modal-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

.wallet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg2);
  border: 1px solid var(--card-b);
  border-radius: var(--r2);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 10px;
  font-family: var(--sans);
}

.wallet-option:hover {
  background: var(--bg3);
  border-color: var(--dim);
  box-shadow: var(--shadow);
}

.wallet-option:last-child { margin-bottom: 0; }

.wallet-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.wallet-metamask .wallet-option-icon { background: rgba(245,133,66,0.12); }
.wallet-rabby .wallet-option-icon { background: rgba(128,89,227,0.12); }

.wallet-option-info { text-align: left; }

.wallet-option-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.wallet-option-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Connected state in modal */
.connected-info {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.connected-info.show { display: flex; }

.conn-address {
  background: var(--bg2);
  border: 1px solid var(--card-b);
  border-radius: var(--r2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conn-addr-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.conn-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.conn-badge.metamask { background: rgba(245,133,66,0.15); color: #F58542; }
.conn-badge.rabby { background: rgba(128,89,227,0.15); color: #8059E3; }

.btn-disconnect {
  padding: 11px;
  background: rgba(255,80,0,0.08);
  border: 1px solid rgba(255,80,0,0.25);
  border-radius: var(--r2);
  color: var(--bear);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
  width: 100%;
}

.btn-disconnect:hover {
  background: rgba(255,80,0,0.15);
}

/* ============================
   RESULT MODAL
   ============================ */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.result-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.result-box {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.25s;
  box-shadow: var(--shadow-lg);
}

.result-overlay.open .result-box { transform: scale(1); }

.result-outcome {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.result-outcome.win { color: var(--bull); }
.result-outcome.loss { color: var(--bear); }
.result-outcome.push { color: var(--muted); }

.result-pnl {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  margin-bottom: 20px;
}

.result-details {
  background: var(--bg2);
  border-radius: var(--r2);
  padding: 14px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}

.result-detail-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 2px;
}

.result-detail-val {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
}

.result-balance {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.result-balance span {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
}

.btn-result-close {
  width: 100%;
  padding: 12px;
  background: var(--bull);
  border: none;
  border-radius: var(--r2);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.btn-result-close:hover { background: #00B004; }

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: var(--r2);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  max-width: 280px;
  animation: toast-in 0.3s ease;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--bull); }
.toast.error { border-left: 3px solid var(--bear); }
.toast.info { border-left: 3px solid var(--accent); }

/* ============================
   WIN / LOSS ANIMATIONS
   ============================ */
.market-card.win-flash {
  animation: win-glow 1s ease forwards;
}

.market-card.loss-shake {
  animation: loss-shake 0.5s ease;
}

@keyframes win-glow {
  0% { box-shadow: var(--shadow); }
  30% { box-shadow: 0 0 0 2px var(--bull), 0 0 30px rgba(0,200,5,0.25); }
  100% { box-shadow: var(--shadow); }
}

@keyframes loss-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ============================
   FOOTER
   ============================ */
footer {
  padding: 24px 0;
  border-top: 1px solid var(--card-b);
  margin-top: 40px;
  background: var(--card);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-logo img { height: 24px; opacity: 0.85; }

.disclaimer {
  font-size: 11px;
  color: var(--dim);
  max-width: 640px;
  line-height: 1.5;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover { color: var(--muted); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1100px) {
  .market-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .chain-badge { display: none; }
  .live-badge { display: none; }
  .market-grid { grid-template-columns: 1fr; }
  .balance-card { grid-template-columns: 1fr; }
  .balance-meta { justify-content: flex-start; }
  .hero-stats { gap: 16px; }
  .hero-stat-item { min-width: 100px; padding: 12px 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .balance-stat { text-align: left; }

  .nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid var(--card-b);
    padding: 12px 16px 20px;
    z-index: 99;
    box-shadow: var(--shadow-lg);
  }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .balance-amount { font-size: 28px; }
  .modal-box { margin: 0 12px; }
  .result-box { margin: 0 12px; }
}

/* ============================
   UTILITY
   ============================ */
.hidden { display: none !important; }
.loading-spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--card-b);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.price-up { color: var(--bull) !important; }
.price-dn { color: var(--bear) !important; }

@keyframes count-up {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.count-anim { animation: count-up 0.4s ease; }