/* ═══════════════════════════════════════════════════════════
   TxPredict — Glassmorphism Design System
   Premium dark-mode UI for World Cup Prediction Markets
   ═══════════════════════════════════════════════════════════ */

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

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  --void:      #08060f;
  --surface:   #0f0d1a;
  --surface-2: #151226;
  --surface-3: #1a1730;
  --bitcoin:   #AB9FF2; /* Soft Phantom Lavender */
  --burnt:     #4E44CE; /* Rich Phantom Purple */
  --emerald:   #10B981;
  --red:       #FF5C5C;
  --blue:      #3B82F6;
  --purple:    #AB9FF2;
  --text-1:    #F5F4FA;
  --text-2:    #9D9AB7;
  --text-3:    #4D4968;
  --border:    rgba(171,159,242,0.09);
  --glow:      rgba(78,68,206,0.22);
  --glass:     rgba(15,13,26,0.65);
  --glass-border: rgba(171,159,242,0.12);
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', monospace;
  --radius:    20px; /* Highly rounded layout style matching Phantom */
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-heading);
  background: var(--void);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(78,68,206,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(171,159,242,0.08) 0%, transparent 60%);
}

a { color: var(--bitcoin); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--burnt); }

/* ── Layout ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(8,6,15,0.7);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-1);
}

.navbar-logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bitcoin), var(--burnt));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--glow);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-1);
  background: rgba(255,255,255,0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bitcoin), var(--burnt));
  color: white;
  box-shadow: 0 0 20px var(--glow), 0 4px 12px rgba(0,0,0,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--glow), 0 8px 20px rgba(0,0,0,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--glass-border);
}
.btn-outline:hover {
  color: var(--text-1);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
}

/* ── Glass Cards ───────────────────────────────────────── */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.glass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.glass-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* ── Hero Section ──────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 0 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(247,147,26,0.3);
  background: rgba(247,147,26,0.08);
  color: var(--bitcoin);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--text-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-3);
}

/* ── Stats Row ─────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 40px 0;
}

.stat-card {
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--bitcoin), var(--burnt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ── Match Cards ───────────────────────────────────────── */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.match-card {
  padding: 20px 24px;
  cursor: pointer;
  transition: all var(--transition);
}
.match-card:hover {
  border-color: rgba(247,147,26,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.match-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.match-group {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.match-team {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}
.match-team.away { text-align: right; }

.match-vs {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.03);
}

.match-odds-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.match-odd {
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.03);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}
.match-odd:hover {
  background: rgba(247,147,26,0.1);
  color: var(--bitcoin);
}

.match-odd-label {
  font-size: 0.6rem;
  color: var(--text-3);
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
}

/* ── Live Badge ────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--emerald);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* ── Odds Flash Animation ──────────────────────────────── */
@keyframes flash-green {
  0%   { color: var(--emerald); text-shadow: 0 0 8px rgba(16,185,129,0.5); }
  100% { color: var(--text-1); text-shadow: none; }
}
@keyframes flash-red {
  0%   { color: var(--red); text-shadow: 0 0 8px rgba(239,68,68,0.5); }
  100% { color: var(--text-1); text-shadow: none; }
}

.odds-up   { animation: flash-green 1.2s ease-out; }
.odds-down { animation: flash-red 1.2s ease-out; }

/* ── Live Match View ───────────────────────────────────── */
.live-match-header {
  text-align: center;
  padding: 48px 0 24px;
}

.live-match-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 8px 0;
}

.live-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 24px 0;
}

.live-score-team {
  text-align: center;
  flex: 1;
  max-width: 200px;
}

.live-score-team h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.live-score-number {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.live-score-separator {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-3);
}

/* ── Odds Table ────────────────────────────────────────── */
.odds-table {
  width: 100%;
}

.odds-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.odds-row:last-child { border-bottom: none; }
.odds-row:hover { background: rgba(255,255,255,0.04); }
.odds-row:active { transform: scale(0.995); }

.odds-row-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.odds-row-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  width: 20px;
}

.odds-row-name {
  font-weight: 500;
  color: var(--text-2);
}

.odds-row-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

/* Market tabs selection styling */
.market-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.market-tab {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 5px 12px;
  font-size: 0.74rem;
  font-family: var(--font-main);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.market-tab.active {
  background: var(--surface-3);
  color: var(--text-1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.market-tab:hover:not(.active) {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.01);
}

/* ── Schedule Table ────────────────────────────────────── */
.schedule-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bitcoin);
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(247,147,26,0.1);
  margin-top: 24px;
}
.schedule-date:first-child { margin-top: 0; }

.schedule-match {
  display: grid;
  grid-template-columns: 80px 1fr 60px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition);
}
.schedule-match:hover { background: rgba(255,255,255,0.02); }

.schedule-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}

.schedule-team { font-weight: 500; }
.schedule-team.away { text-align: right; }
.schedule-vs {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
}

.schedule-stage {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  text-align: right;
}

/* ── Page Views ────────────────────────────────────────── */
.view { display: none; padding-bottom: 80px; }
.view.active { display: block; }

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

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ── Loading & Empty States ────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--bitcoin);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

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

/* ── Footer ────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* ── Revamped High-Fidelity Events Timeline ───────────────────────── */
.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

.event-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  font-size: 0.85rem;
  gap: 12px;
}

.event-row.home-event {
  justify-content: flex-start;
  text-align: left;
}

.event-row.away-event {
  justify-content: flex-end;
  text-align: right;
}

.event-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-3);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
  font-size: 0.78rem;
  margin-top: 1px;
}
.event-row.away-event .event-time {
  text-align: left;
}

.event-icon {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.event-info {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.event-main-text {
  color: var(--text-1);
  font-weight: 500;
  font-size: 0.82rem;
}

.event-scorer {
  font-weight: 600;
}

.event-sub-text {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 1px;
}

.text-emerald {
  color: var(--emerald) !important;
}

.text-red {
  color: #ff5c5c !important;
}

.font-semibold {
  font-weight: 600;
}

/* Card representations */
.card-icon {
  display: inline-block;
  width: 9px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 3px;
}
.card-icon.yellow {
  background: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}
.card-icon.red {
  background: #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

/* ── Match Tabs & Lineups ─────────────────────────────────────── */
.match-nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 4px;
}

.match-nav-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
  text-align: center;
}

.match-nav-tab:hover {
  color: var(--text-1);
}

.match-nav-tab.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--bitcoin);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lineups-container {
  display: flex;
  flex-direction: column;
}

.lineups-header {
  text-align: center;
  margin-bottom: 16px;
}

.lineups-header h4 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.12em;
  margin: 0;
  background: rgba(255,255,255,0.02);
  padding: 6px 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.04);
  text-transform: uppercase;
}

.lineups-columns {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.lineups-col {
  flex: 1;
  min-width: 0;
}

.lineup-team-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.lineup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.player-card:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.player-avatar-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.player-avatar-img.loaded {
  opacity: 1;
}

.player-initials {
  position: relative;
  z-index: 1;
}

.player-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.player-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  min-width: 0;
}

.player-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.verified-badge-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  flex-shrink: 0;
}

.verified-icon-inline {
  width: 13px;
  height: 13px;
  display: block;
}

.player-meta {
  font-size: 0.68rem;
  color: var(--text-2);
  margin-top: 1px;
}

.player-handle {
  font-size: 0.62rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* Responsive adjustment for small viewports */
@media (max-width: 576px) {
  .lineups-columns {
    flex-direction: column;
    gap: 24px;
  }
  .lineups-columns:last-of-type {
    margin-bottom: 0;
  }
}

/* ── Wallet Status ─────────────────────────────────────── */
.wallet-connected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .match-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .schedule-match { grid-template-columns: 60px 1fr 40px 1fr; }
  .schedule-stage { display: none; }
  .hero { padding: 48px 0 24px; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .live-score-number { font-size: 2.5rem; }
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Modals ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-enter {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-body {
  padding: 24px;
}
.modal-match-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal-prediction-outcome {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--bitcoin);
  margin-bottom: 20px;
}
.modal-input-group {
  margin-bottom: 20px;
}
.modal-input-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-input-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-mono);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}
.modal-input-group input:focus {
  border-color: var(--bitcoin);
}
.modal-payout-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.modal-payout-box span {
  font-size: 0.85rem;
  color: var(--text-2);
}
.modal-payout-box strong {
  font-family: var(--font-mono);
  color: var(--emerald);
  font-size: 1.2rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover {
  color: var(--text-1);
}

/* ── Portfolio Table ─────────────────────────────────────── */
.portfolio-table {
  width: 100%;
  border-collapse: collapse;
}
.portfolio-th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.portfolio-td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.portfolio-tr:last-child .portfolio-td {
  border-bottom: none;
}
.portfolio-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
}
.portfolio-badge.win {
  background: rgba(16,185,129,0.1);
  color: var(--emerald);
}
.portfolio-badge.pending {
  background: rgba(247,147,26,0.1);
  color: var(--bitcoin);
}
.portfolio-badge.lose {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

/* ── Volatility Indicators & Flashing ────────────────────── */
@keyframes flash-green {
  0% { background: rgba(16,185,129,0.25); }
  100% { background: transparent; }
}
@keyframes flash-red {
  0% { background: rgba(239,68,68,0.25); }
  100% { background: transparent; }
}
.flash-up {
  animation: flash-green 1.2s ease-out;
}
.flash-down {
  animation: flash-red 1.2s ease-out;
}
.volatility-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.volatility-badge.up {
  color: var(--emerald);
  background: rgba(16,185,129,0.12);
}
.volatility-badge.down {
  color: var(--red);
  background: rgba(239,68,68,0.12);
}

/* ── Trending Widget (Phantom Inspired) ─────────────────── */
.trending-widget {
  margin: 12px 0 32px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(78,68,206,0.1) 0%, rgba(15,13,26,0.85) 100%);
  border: 1px solid rgba(171,159,242,0.15);
  box-shadow: 0 12px 40px rgba(8,6,15,0.6);
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.trending-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trending-live-tag {
  background: rgba(255, 92, 92, 0.15);
  color: #ff5c5c;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 100px;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trending-live-tag .live-dot {
  background: #ff5c5c;
  box-shadow: 0 0 8px #ff5c5c;
  margin: 0;
}

.trending-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
}

.trending-subtitle {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 400;
}

.trending-header-right {
  display: flex;
  gap: 12px;
  color: var(--text-3);
  font-size: 0.95rem;
}

.trending-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .trending-grid {
    grid-template-columns: 1fr;
  }
}

.trending-card {
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.trending-card:hover {
  transform: translateY(-2px);
  border-color: rgba(171,159,242,0.22);
  box-shadow: 0 8px 24px rgba(78,68,206,0.12);
}

.t-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-2);
  margin-bottom: 12px;
}

.t-card-live-time {
  color: #ff5c5c;
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-card-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}

.t-card-team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.t-card-flag-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.t-card-team-code {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
}

.t-card-score-col {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.05em;
  padding: 0 16px;
  text-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.t-card-progress {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 100px;
  overflow: hidden;
  display: flex;
  margin-top: 12px;
}

.t-card-progress-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.t-card-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-2);
  margin-top: 6px;
}

/* Upcoming game lists */
.t-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  height: 100%;
}

.t-upcoming-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all var(--transition);
}

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

.t-upcoming-row:hover {
  padding-left: 4px;
}

.t-upcoming-row:hover .t-upcoming-teams {
  color: var(--bitcoin);
}

.t-upcoming-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.t-upcoming-icon-ball {
  font-size: 0.95rem;
}

.t-upcoming-teams {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  transition: color var(--transition);
}

.t-upcoming-prob {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  text-align: right;
}

.t-upcoming-prob-fav {
  font-weight: 700;
  color: var(--emerald);
}

/* Phantom Card Style */
.t-phantom-card {
  background: linear-gradient(135deg, rgba(78,68,206,0.18) 0%, rgba(15,13,26,0.95) 100%);
  border: 1px solid rgba(171,159,242,0.18);
}

.t-phantom-badge {
  color: var(--bitcoin);
  font-size: 0.75rem;
  font-weight: 600;
}

.t-phantom-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 10px;
}

.t-phantom-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 6px;
}

.t-phantom-svg-wrap {
  position: absolute;
  right: -10px;
  bottom: -20px;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity var(--transition);
}

.t-phantom-card:hover .t-phantom-svg-wrap {
  opacity: 0.75;
}

/* ── Profile/Wallet Drawer ──────────────────────────────── */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5,4,10,0.65);
  backdrop-filter: blur(8px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--glass-border);
  box-shadow: -12px 0 40px rgba(0,0,0,0.6);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  z-index: 1060;
}

.drawer-overlay.active .drawer {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Page entrance animations */
.view {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  animation: slideUpFade 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view.active {
  display: block;
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Match Countdown Timer ─────────────────────────────── */
.match-countdown {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--bitcoin);
  background: rgba(171,159,242,0.06);
  border: 1px dashed rgba(171,159,242,0.22);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  text-align: center;
  margin-top: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Toast Notifications ───────────────────────────────── */
.toast {
  background: rgba(13,11,26,0.92);
  backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--glass-border);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 0.82rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.toast.active {
  transform: translateX(0);
  opacity: 1;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
}

.toast.success::before { background: var(--emerald); }
.toast.error::before { background: #ff5c5c; }
.toast.info::before { background: var(--bitcoin); }

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  margin-left: auto;
  transition: color var(--transition);
}
.toast-close:hover {
  color: var(--text-1);
}

/* ── Locked Odds Row ──────────────────────────────────── */
.odds-row.locked {
  opacity: 0.45;
  cursor: not-allowed !important;
  background: rgba(255,255,255,0.01) !important;
  pointer-events: none !important;
}
}

.text-win {
  color: var(--emerald) !important;
}

.text-loss {
  color: #ff5c5c !important;
}

#leaderboard-tbody tr {
  transition: background var(--transition);
}

#leaderboard-tbody tr:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* ── Mobile Hamburger Menu ───────────────────────────── */
@media (max-width: 768px) {
  #menu-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .navbar-nav {
    display: none !important;
  }

  /* Shrink wallet button on desktop nav — hide it; mobile wallet is in drawer */
  .navbar-inner > .btn {
    display: none !important;
  }
}

/* Hamburger icon animation when open */
#menu-toggle-btn.open svg line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  transform-origin: center;
}
#menu-toggle-btn.open svg line:nth-child(2) {
  opacity: 0;
}
#menu-toggle-btn.open svg line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  transform-origin: center;
}
#menu-toggle-btn svg line {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Mobile drawer */
.mobile-menu-drawer {
  position: fixed;
  top: 64px; /* height of navbar */
  left: 0;
  right: 0;
  z-index: 1500;
  background: rgba(10, 10, 14, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  pointer-events: none;
}

.mobile-menu-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Backdrop */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1499;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.mobile-menu-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* Nav list */
.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
  letter-spacing: 0.01em;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--text-1);
  background: rgba(255,255,255,0.04);
  padding-left: 32px;
}

.mobile-nav-link.active {
  color: var(--bitcoin);
  border-left: 3px solid var(--bitcoin);
}

/* ── Fancy Wallet Button ─────────────────────────────────── */
.btn-wallet-fancy {
  background: rgba(78, 68, 206, 0.12);
  color: var(--text-1);
  border: 1px solid rgba(171, 159, 242, 0.22);
  padding: 8px 18px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(78, 68, 206, 0.08), inset 0 1px 1px rgba(255,255,255,0.05);
}

.btn-wallet-fancy::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  transition: 0.5s;
}

.btn-wallet-fancy:hover::before {
  left: 100%;
}

.btn-wallet-fancy:hover {
  background: rgba(78, 68, 206, 0.25);
  border-color: rgba(171, 159, 242, 0.5);
  box-shadow: 0 0 25px rgba(78, 68, 206, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn-wallet-fancy:active {
  transform: translateY(1px);
}

.btn-wallet-fancy .solana-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.3s ease;
  display: block;
}

.btn-wallet-fancy:hover .solana-icon {
  transform: rotate(15deg) scale(1.1);
}

/* Wallet Connected Capsule State */
.btn-wallet-fancy.wallet-connected {
  background: rgba(20, 241, 149, 0.08);
  border-color: rgba(20, 241, 149, 0.35);
  color: #14F195;
  box-shadow: 0 0 15px rgba(20, 241, 149, 0.12);
}

.btn-wallet-fancy.wallet-connected:hover {
  background: rgba(20, 241, 149, 0.15);
  border-color: rgba(20, 241, 149, 0.6);
  box-shadow: 0 0 25px rgba(20, 241, 149, 0.25);
}

.btn-wallet-fancy .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14F195;
  display: inline-block;
  box-shadow: 0 0 8px #14F195;
}

.btn-wallet-fancy .live-dot.pulse {
  animation: wallet-pulse-glow 2s infinite;
}

@keyframes wallet-pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(20, 241, 149, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(20, 241, 149, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(20, 241, 149, 0);
  }
}
