/* ============================================
   OP_Predict — Dark Crypto Theme
   ============================================ */

:root {
  --bg-primary: #080b14;
  --bg-secondary: #0d1220;
  --bg-card: #111827;
  --bg-card-hover: #162033;
  --bg-input: #0d1626;
  --border: #1e2d45;
  --border-light: #253650;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-purple: #8b5cf6;

  --brand-opnet: #ff8c00;
  --brand-opnet-light: #ffa94d;
  --brand-opnet-white: #ffffff;
  --brand-opnet-glow: rgba(255, 140, 0, 0.45);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.3);
  --accent-yellow: #f59e0b;
  --accent-cyan: #06b6d4;

  --text-primary: #f0f6ff;
  --text-secondary: #8b9db8;
  --text-muted: #4a5a72;

  --yes-color: #00ffa3;
  --yes-color-alt: #00e5ff;
  --yes-bg: rgba(0, 255, 163, 0.14);
  --no-color: #7f5bff;
  --no-color-alt: #ff4fd8;
  --no-bg: rgba(127, 91, 255, 0.14);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);

  --font-main: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 140, 0, 0.18), transparent 32%),
    radial-gradient(circle at 80% 15%, rgba(0, 229, 255, 0.18), transparent 30%),
    radial-gradient(circle at 25% 85%, rgba(127, 91, 255, 0.16), transparent 35%),
    var(--bg-primary);
  background-size: 120% 120%;
  animation: market-flow 26s ease-in-out infinite alternate;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,140,0,0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,140,0,0.01) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 140, 0, 0.015) 20%, transparent 42%),
    linear-gradient(300deg, transparent 0%, rgba(0, 229, 255, 0.01) 18%, transparent 40%);
  mix-blend-mode: screen;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
  animation: market-stream 18s linear infinite;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Logo */
.logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 0, 0.28);
  background: rgba(255, 140, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.12) inset;
  animation: logo-pulse 2.6s ease-in-out infinite;
  transform: scale(1.3);
  order: -1;
  margin-right: auto;
}
.logo-image {
  display: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
}
.logo.has-custom-image .logo-image {
  display: block;
}
.logo-op {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-opnet);
  text-shadow: 0 0 12px var(--brand-opnet-glow);
}
.logo-predict {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-opnet-white);
}
.logo-badge {
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-opnet), var(--brand-opnet-light));
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 1px;
}

.powered-badge {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-opnet-light);
  border: 1px solid rgba(255, 169, 77, 0.35);
  background: rgba(255, 140, 0, 0.1);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Nav */
.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 169, 77, 0.16));
  color: var(--brand-opnet-white);
  border: 1px solid rgba(255, 140, 0, 0.35);
}
.create-btn { color: var(--accent-yellow) !important; }
.create-btn:hover { background: rgba(245, 158, 11, 0.1) !important; }

.connect-wallet-btn {
  padding: 8px 16px;
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid rgba(255, 140, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--brand-opnet-orange);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.connect-wallet-btn:hover {
  background: rgba(255, 140, 0, 0.2);
  border-color: rgba(255, 140, 0, 0.5);
  transform: translateY(-1px);
}

.music-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 140, 0, 0.38);
  background: rgba(255, 140, 0, 0.12);
  color: var(--brand-opnet-light);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.music-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.28);
}
.music-toggle.muted {
  opacity: 0.55;
  filter: grayscale(0.2);
}
.music-icon {
  font-size: 15px;
  line-height: 1;
}

/* Wallet Panel */
.wallet-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.wallet-panel.connected {
  border-color: rgba(0, 255, 163, 0.3);
  background: rgba(0, 255, 163, 0.05);
}
.wallet-panel.disconnected {
  border-color: rgba(255, 140, 0, 0.2);
  background: rgba(255, 140, 0, 0.05);
}
.wallet-panel.connected .wallet-chevron {
  color: rgba(0, 255, 163, 0.8);
}
.wallet-panel.disconnected .wallet-chevron {
  color: rgba(255, 140, 0, 0.8);
}
.wallet-panel:hover { border-color: var(--accent-blue); box-shadow: var(--shadow-glow-blue); }
.wallet-panel:hover .wallet-chevron { color: var(--brand-opnet-orange); }

.wallet-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  flex-shrink: 0;
}
.wallet-info { display: flex; flex-direction: column; gap: 1px; }
.wallet-address {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.wallet-balance {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.balance-unit {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 400;
}
.wallet-chevron { color: var(--text-muted); font-size: 12px; }

/* Wallet Dropdown */
.wallet-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-card);
  z-index: 200;
}
.wallet-dropdown.open { display: block; animation: fadeDown 0.15s ease; }
.wallet-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.wallet-dropdown-item:last-of-type { border-bottom: none; }
.wd-label { font-size: 11px; color: var(--text-muted); }
.wd-value { font-family: var(--font-mono); font-size: 11px; color: var(--text-primary); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.wallet-dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.wallet-dropdown-note { font-size: 11px; color: var(--text-muted); text-align: center; }
.wallet-dropdown-btn {
  width: 100%;
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid rgba(255, 140, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--brand-opnet-orange);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.wallet-dropdown-btn:hover {
  background: rgba(255, 140, 0, 0.2);
  border-color: rgba(255, 140, 0, 0.5);
}
.wallet-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
  letter-spacing: 1px;
}

/* ============================================
   MAIN / PAGES
   ============================================ */
.main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 1;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-blue);
}
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.filter-btn.active {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.18), rgba(255, 169, 77, 0.2));
  border-color: rgba(255, 140, 0, 0.45);
  color: var(--brand-opnet-white);
}

/* ============================================
   MARKETS GRID
   ============================================ */
.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.market-card {
  background: linear-gradient(150deg, rgba(17, 24, 39, 0.95), rgba(14, 20, 35, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.market-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-opnet), var(--brand-opnet-light));
  opacity: 0;
  transition: opacity var(--transition);
}
.market-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.market-card:hover::before { opacity: 1; }

.market-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.market-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.cat-crypto { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.cat-politics { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.cat-sports { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.cat-tech { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }

.market-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 100px;
}
.status-active { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.status-resolved { background: rgba(75,85,99,0.3); color: var(--text-muted); }
.status-ended { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.market-question {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Probability Bar */
.prob-bar-container { margin-bottom: 12px; }
.prob-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.prob-yes { font-size: 13px; font-weight: 700; color: var(--yes-color); }
.prob-no { font-size: 13px; font-weight: 700; color: var(--no-color); }
.prob-bar {
  height: 8px;
  background: linear-gradient(90deg, rgba(0, 255, 163, 0.12), rgba(127, 91, 255, 0.12));
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.prob-bar-yes {
  height: 100%;
  background: linear-gradient(90deg, var(--yes-color), var(--yes-color-alt));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.market-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.market-volume {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.volume-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.volume-label { font-size: 11px; color: var(--text-muted); }

.market-countdown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
}
.countdown-urgent { color: var(--accent-red) !important; }

/* Position badge on card */
.position-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pos-yes { background: var(--yes-bg); color: var(--yes-color); border: 1px solid rgba(16,185,129,0.3); }
.pos-no { background: var(--no-bg); color: var(--no-color); border: 1px solid rgba(239,68,68,0.3); }

/* Claimable badge */
.claimable-badge {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  border-bottom: 1px solid rgba(245,158,11,0.3);
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
  text-align: center;
  letter-spacing: 0.5px;
}

/* ============================================
   MARKET DETAIL PAGE
   ============================================ */
.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }

.detail-container { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }

.detail-main { display: flex; flex-direction: column; gap: 20px; }

.detail-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-question {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}
.detail-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Large prob bar for detail */
.detail-prob-bar-container { margin-bottom: 8px; }
.detail-prob-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}
.detail-prob-bar {
  height: 14px;
  background: linear-gradient(90deg, rgba(0, 255, 163, 0.12), rgba(127, 91, 255, 0.12));
  border-radius: 100px;
  overflow: hidden;
}
.detail-prob-bar-yes {
  height: 100%;
  background: linear-gradient(90deg, var(--yes-color), var(--yes-color-alt));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-pool-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Stats row in detail */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.detail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.detail-stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-blue);
}
.detail-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Recent trades */
.trades-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.trades-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.trade-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.trade-item:last-child { border-bottom: none; }
.trade-addr { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.trade-side { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.trade-yes { background: var(--yes-bg); color: var(--yes-color); }
.trade-no { background: var(--no-bg); color: var(--no-color); }
.trade-amount { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.trade-time { font-size: 11px; color: var(--text-muted); }

/* Sidebar: Bet Panel */
.bet-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

.bet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.bet-card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.bet-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.bet-btn {
  padding: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.bet-yes {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.2), rgba(0, 229, 255, 0.2));
  color: var(--yes-color);
  border-color: rgba(0, 255, 163, 0.48);
}
.bet-yes:hover, .bet-yes.selected {
  background: linear-gradient(135deg, var(--yes-color), var(--yes-color-alt));
  border-color: rgba(0, 229, 255, 0.7);
  color: white;
  box-shadow: 0 0 16px var(--accent-green-glow);
}
.bet-no {
  background: linear-gradient(135deg, rgba(127, 91, 255, 0.2), rgba(255, 79, 216, 0.2));
  color: var(--no-color);
  border-color: rgba(127, 91, 255, 0.5);
}
.bet-no:hover, .bet-no.selected {
  background: linear-gradient(135deg, var(--no-color), var(--no-color-alt));
  border-color: rgba(255, 79, 216, 0.75);
  color: white;
  box-shadow: 0 0 16px var(--accent-red-glow);
}

.bet-input-group { margin-bottom: 12px; }
.bet-input-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.bet-input-wrapper { position: relative; }
.bet-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 10px 60px 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.bet-input:focus { border-color: var(--accent-blue); }
.bet-input-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.bet-quick-amounts {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.quick-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-width: 48px;
}
.quick-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }

.bet-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}
.bet-preview-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.bet-preview-row:last-child { margin-bottom: 0; }
.bet-preview-label { color: var(--text-muted); }
.bet-preview-value { color: var(--text-primary); font-weight: 600; }
.bet-preview-value.highlight { color: var(--accent-green); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-opnet), var(--brand-opnet-light));
  color: white;
  box-shadow: 0 4px 14px rgba(255,140,0,0.34);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(255,140,0,0.54); transform: translateY(-1px); }
.btn-yes {
  background: linear-gradient(135deg, var(--yes-color), var(--yes-color-alt));
  color: white;
  box-shadow: 0 4px 14px var(--accent-green-glow);
  width: 100%;
}
.btn-yes:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(16,185,129,0.5); transform: translateY(-1px); }
.btn-no {
  background: linear-gradient(135deg, var(--no-color), var(--no-color-alt));
  color: white;
  box-shadow: 0 4px 14px var(--accent-red-glow);
  width: 100%;
}
.btn-no:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(239,68,68,0.5); transform: translateY(-1px); }
.btn-warning {
  background: linear-gradient(135deg, var(--accent-yellow), #d97706);
  color: white;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-warning:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(245,158,11,0.5); transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-claim {
  background: linear-gradient(135deg, var(--accent-yellow), #d97706);
  color: white;
  width: 100%;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
  animation: pulse-glow 2s infinite;
}
.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-light); color: var(--text-primary); }

/* Resolved outcome box */
.resolved-box {
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 8px;
}
.resolved-yes { background: var(--yes-bg); border: 1px solid rgba(16,185,129,0.3); }
.resolved-no { background: var(--no-bg); border: 1px solid rgba(239,68,68,0.3); }
.resolved-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.resolved-outcome { font-size: 28px; font-weight: 700; }
.resolved-yes .resolved-outcome { color: var(--yes-color); }
.resolved-no .resolved-outcome { color: var(--no-color); }

/* My position card */
.my-position-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.my-position-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.my-position-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.my-position-row:last-of-type { border-bottom: none; }
.my-position-label { color: var(--text-muted); }
.my-position-value { font-weight: 600; }
.no-position { font-size: 13px; color: var(--text-muted); text-align: center; padding: 16px 0; }

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-container { max-width: 800px; }
.leaderboard-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lb-header {
  display: grid;
  grid-template-columns: 60px 1fr 120px 100px 100px 100px;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.lb-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 100px 100px 100px;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--transition);
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--bg-card-hover); }
.lb-row.me { background: rgba(59,130,246,0.06); }

.lb-rank { font-family: var(--font-mono); font-size: 14px; font-weight: 700; text-align: center; }
.rank-1 { color: #fbbf24; }
.rank-2 { color: #9ca3af; }
.rank-3 { color: #cd7f32; }

.lb-addr-container { display: flex; align-items: center; gap: 8px; }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.lb-addr { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.lb-you { font-size: 10px; background: var(--accent-blue); color: white; padding: 1px 6px; border-radius: 4px; }
.lb-balance { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--accent-blue); }
.lb-wins { font-size: 13px; font-weight: 600; color: var(--yes-color); }
.lb-losses { font-size: 13px; font-weight: 600; color: var(--no-color); }
.lb-pnl-pos { font-size: 13px; font-weight: 600; color: var(--yes-color); }
.lb-pnl-neg { font-size: 13px; font-weight: 600; color: var(--no-color); }

/* ============================================
   HISTORY
   ============================================ */
.history-container { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.history-question { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.history-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.history-outcome {
  font-size: 24px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 80px;
}
.outcome-yes { background: var(--yes-bg); color: var(--yes-color); border: 1px solid rgba(16,185,129,0.3); }
.outcome-no { background: var(--no-bg); color: var(--no-color); border: 1px solid rgba(239,68,68,0.3); }

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.admin-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent-blue); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }

.outcome-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.outcome-btn {
  padding: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.outcome-btn.yes-btn { background: var(--yes-bg); color: var(--yes-color); border-color: rgba(16,185,129,0.3); }
.outcome-btn.yes-btn.active { background: var(--yes-color); color: white; box-shadow: 0 0 16px var(--accent-green-glow); }
.outcome-btn.no-btn { background: var(--no-bg); color: var(--no-color); border-color: rgba(239,68,68,0.3); }
.outcome-btn.no-btn.active { background: var(--no-color); color: white; box-shadow: 0 0 16px var(--accent-red-glow); }

.admin-active-markets { margin-top: 20px; }
.admin-market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 8px;
}
.admin-market-item:last-child { border-bottom: none; }
.admin-market-q { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-market-vol { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  opacity: 0;
  min-width: 240px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--yes-color); color: var(--yes-color); }
.toast.error { border-color: var(--no-color); color: var(--no-color); }
.toast.info { border-color: var(--accent-blue); color: var(--accent-blue); }
.toast.warn { border-color: var(--accent-yellow); color: var(--accent-yellow); }

.logo.has-custom-image .logo-op,
.logo.has-custom-image .logo-predict {
  display: none;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 480px;
  max-width: calc(100vw - 32px);
  position: relative;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.25s ease;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }

.confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.confirm-details {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
}
.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.confirm-detail-row:last-child { margin-bottom: 0; }
.confirm-detail-label { color: var(--text-muted); }
.confirm-detail-value { font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 4px 24px rgba(245,158,11,0.6); }
}

@keyframes logo-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.12) inset, 0 0 12px rgba(255, 140, 0, 0.22);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 169, 77, 0.32) inset, 0 0 22px rgba(255, 140, 0, 0.45);
  }
}

@keyframes market-flow {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

@keyframes market-stream {
  0% { transform: translate3d(-2%, 0, 0); }
  50% { transform: translate3d(2%, -1.5%, 0); }
  100% { transform: translate3d(-2%, 0, 0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Number count animation */
.count-up { animation: countUp 0.4s ease; }
@keyframes countUp {
  from { transform: scale(1.15); color: var(--accent-blue); }
  to { transform: scale(1); }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .detail-container { grid-template-columns: 1fr; }
  .bet-panel { position: static; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header-inner { gap: 10px; }
  .nav { display: none; }
  .powered-badge { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .markets-grid { grid-template-columns: 1fr; }
  .lb-header, .lb-row { grid-template-columns: 40px 1fr 80px 70px; }
  .lb-header > :nth-child(4), .lb-row > :nth-child(4),
  .lb-header > :nth-child(5), .lb-row > :nth-child(5) { display: none; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* Glowing accent lines (decorative) */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  margin: 24px 0;
  opacity: 0.3;
}
