/* ─── App Dashboard Styles ─── */
/* Dark gaming aesthetic for the FlagPool tournament dashboard.
   Does NOT own landing page styles — those live in theme.css. */

/* ─── Tokens (inherits landing vars, adds dashboard-specific) ─── */
:root {
  --bg: #060810;
  --surface: #0d1117;
  --surface-2: #161b22;
  --surface-3: #1c2230;
  --border: #1c2333;
  --border-hover: #2d3548;
  --fg: #e6edf3;
  --fg-muted: #7d8590;
  --fg-dim: #484f58;
  --accent: #00E5A0;
  --accent-dim: rgba(0, 229, 160, 0.12);
  --accent-glow: rgba(0, 229, 160, 0.3);
  --red: #FF4545;
  --red-dim: rgba(255, 69, 69, 0.12);
  --yellow: #FFB800;
  --yellow-dim: rgba(255, 184, 0, 0.12);
  --blue: #58A6FF;
  --blue-dim: rgba(88, 166, 255, 0.12);
  --purple: #BC8CFF;
  --purple-dim: rgba(188, 140, 255, 0.12);
  --font-display: 'Bebas Neue', 'Arial Black', sans-serif;
  --font-body: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --panel-radius: 12px;
  --topbar-h: 60px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ─── Top Bar ─── */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(6, 8, 16, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 24px; }
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--fg);
}
.topbar-name {
  font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 0.08em;
}
.topbar-tvl {
  display: flex; align-items: baseline; gap: 6px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 160, 0.2);
  border-radius: 100px;
}
.tvl-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--fg-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.tvl-value { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); }
.tvl-unit { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); opacity: 0.7; }

.topbar-center { display: flex; align-items: center; gap: 20px; }
.stage-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px;
  background: var(--yellow-dim);
  border: 1px solid rgba(255, 184, 0, 0.25);
  border-radius: 100px;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--yellow); letter-spacing: 0.1em;
}
.stage-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--yellow); }
  50% { opacity: 0.6; box-shadow: 0 0 8px 2px var(--yellow); }
}
.match-timer { display: flex; flex-direction: column; align-items: center; }
.timer-label { font-family: var(--font-mono); font-size: 0.55rem; color: var(--fg-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.timer-value { font-family: var(--font-display); font-size: 1.4rem; color: var(--fg); letter-spacing: 0.05em; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-connect {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: var(--accent);
  color: var(--bg);
  border: none; border-radius: 8px;
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-connect:hover {
  background: #00ffb2;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

/* ─── Main Layout ─── */
.app-main {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 1px;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--border);
}

.panel {
  background: var(--bg);
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-h));
}

/* ─── Panel Headers ─── */
.panel-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--fg-muted); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 16px 8px;
}

/* ─── Pool Filter Row ─── */
.pool-filter-row { display: flex; gap: 4px; }
.filter-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--fg); }
.filter-btn.active {
  background: var(--accent-dim);
  border-color: rgba(0, 229, 160, 0.3);
  color: var(--accent);
}

/* ─── Pool Cards ─── */
.pool-list { padding: 8px; }
.pool-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: 1px solid transparent;
}
.pool-item:hover {
  background: var(--surface);
  border-color: var(--border);
}
.pool-item.hot::after {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--accent); border-radius: 0 2px 2px 0;
  animation: hot-pulse 1.5s ease-in-out infinite;
}
@keyframes hot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pool-item.eliminated { opacity: 0.4; }
.pool-item.eliminated .pool-item-name { text-decoration: line-through; }

.pool-item-flag {
  width: 36px; height: 24px; border-radius: 3px;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.pool-item-flag svg { width: 100%; height: 100%; display: block; }
.pool-item-info { min-width: 0; }
.pool-item-name {
  font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.pool-item-name .rank-num {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--fg-dim); width: 16px; display: inline-block;
}
.pool-item-meta {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--fg-dim); display: flex; gap: 8px;
}
.pool-item-stats { text-align: right; }
.pool-item-sol {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--accent); font-weight: 500;
  display: block;
}
.pool-item-shares {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--fg-dim); display: block;
}

/* Hotness bar */
.pool-heat {
  grid-column: 1 / -1;
  height: 2px;
  background: var(--surface-2);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 2px;
}
.pool-heat-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 1s ease;
}
.heat-high { background: linear-gradient(90deg, var(--accent), #00ffcc); }
.heat-med { background: var(--yellow); }
.heat-low { background: var(--fg-dim); }

/* ─── Live Match Banner ─── */
.live-match {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 229, 160, 0.04) 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.live-match::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,229,160,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.5;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--red); letter-spacing: 0.15em;
  margin-bottom: 16px;
  position: relative;
}
.live-pulse {
  display: block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red);
  animation: live-blink 1.2s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 69, 69, 0.6); }
  50% { opacity: 0.4; box-shadow: 0 0 12px 4px rgba(255, 69, 69, 0.3); }
}

.match-teams {
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  position: relative;
}
.match-team { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.match-flag {
  width: 64px; height: 42px; border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex;
}
.match-flag svg { width: 100%; height: 100%; }
.match-team-name { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.04em; }
.match-team-pool { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.match-vs { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vs-text {
  font-family: var(--font-display); font-size: 1.8rem;
  color: var(--fg-dim);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.vs-stage { font-family: var(--font-mono); font-size: 0.55rem; color: var(--fg-dim); letter-spacing: 0.08em; }

.match-drain-bar {
  height: 4px; background: var(--surface-2);
  border-radius: 2px; overflow: hidden; margin-bottom: 10px;
  position: relative;
}
.drain-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--accent));
  border-radius: 2px;
  transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-glow);
}
.match-payout-info {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: var(--font-mono); font-size: 0.65rem;
  position: relative;
}
.payout-label { color: var(--fg-dim); }
.payout-value { color: var(--accent); font-weight: 500; }

/* ─── Schedule ─── */
.schedule-list { padding: 0 16px 16px; }
.schedule-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: border-color 0.2s;
}
.schedule-item:hover { border-color: var(--border-hover); }
.schedule-item.is-live { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-dim); }
.sched-team {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 500;
}
.sched-team.right { justify-content: flex-end; }
.sched-team .mini-flag { width: 28px; height: 18px; border-radius: 3px; overflow: hidden; display: flex; }
.sched-team .mini-flag svg { width: 100%; height: 100%; }
.sched-vs {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--fg-dim); text-align: center; width: 30px;
}
.sched-time {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--fg-muted); text-align: right;
}
.sched-time.live-tag { color: var(--red); font-weight: 500; }

/* ─── Results ─── */
.results-list { padding: 0 16px 16px; }
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
.result-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.result-item.drain::before { background: var(--red); }
.result-teams {
  display: flex; align-items: center; gap: 8px; flex: 1;
  font-size: 0.85rem;
}
.result-winner { color: var(--accent); font-weight: 600; }
.result-loser { color: var(--fg-muted); }
.result-arrow { color: var(--fg-dim); font-size: 0.7rem; }
.result-drain {
  font-family: var(--font-mono); font-size: 0.75rem;
  display: flex; flex-direction: column; align-items: flex-end;
}
.result-drain-amount { color: var(--red); }
.result-drain-label { font-size: 0.55rem; color: var(--fg-dim); }
.result-time {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--fg-dim);
}

/* Drain animation overlay */
.drain-anim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 69, 69, 0.08) 50%, transparent 100%);
  animation: drain-sweep 2s ease-out forwards;
  pointer-events: none;
}
@keyframes drain-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); opacity: 0; }
}

/* ─── Leaderboard ─── */
.lb-tabs { display: flex; gap: 4px; }
.lb-tab {
  padding: 4px 12px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--font-mono);
  font-size: 0.65rem; color: var(--fg-muted);
  cursor: pointer; transition: all 0.15s;
}
.lb-tab:hover { color: var(--fg); border-color: var(--border-hover); }
.lb-tab.active { background: var(--yellow-dim); border-color: rgba(255, 184, 0, 0.3); color: var(--yellow); }

.lb-list { padding: 8px; }
.lb-list.hidden { display: none; }
.lb-entry {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.lb-entry:hover { background: var(--surface); }
.lb-rank {
  font-family: var(--font-display); font-size: 1rem;
  text-align: center;
}
.lb-rank.gold { color: var(--yellow); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }
.lb-wallet {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--fg-muted);
  display: flex; flex-direction: column; gap: 1px;
}
.lb-wallet-addr { color: var(--fg); font-weight: 500; }
.lb-wallet-country { font-size: 0.6rem; color: var(--fg-dim); }
.lb-value {
  text-align: right;
  font-family: var(--font-mono);
}
.lb-sol { font-size: 0.8rem; color: var(--accent); display: block; }
.lb-pct { font-size: 0.55rem; color: var(--fg-dim); display: block; }

.country-select {
  width: 100%; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--fg);
  font-family: var(--font-body); font-size: 0.8rem;
  margin-bottom: 8px; cursor: pointer;
}
.country-select option { background: var(--surface); }

/* ─── Activity Feed ─── */
.activity-section {
  border-top: 1px solid var(--border);
}
.activity-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
.activity-feed { padding: 0 8px 8px; max-height: 300px; overflow-y: auto; }
.activity-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.5;
  animation: feed-in 0.3s ease;
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.activity-item.deposit { border-left-color: var(--accent); }
.activity-item.claim { border-left-color: var(--yellow); }
.activity-item.drain { border-left-color: var(--red); }
.activity-item .wallet { color: var(--blue); font-family: var(--font-mono); font-size: 0.7rem; }
.activity-item .amount { color: var(--accent); font-weight: 500; }
.activity-item .country-name { color: var(--fg); font-weight: 500; }
.activity-item .time { font-family: var(--font-mono); font-size: 0.6rem; color: var(--fg-dim); float: right; }

/* ─── Animated Counter ─── */
.counter-animate {
  display: inline-block;
  transition: transform 0.15s;
}
.counter-animate.tick {
  transform: translateY(-2px);
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .app-main {
    grid-template-columns: 280px 1fr 300px;
  }
}
@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr;
  }
  .panel {
    max-height: none;
    border-bottom: 1px solid var(--border);
  }
  .topbar-center { display: none; }
  .topbar-tvl { display: none; }
}
@media (max-width: 768px) {
  .app-topbar { padding: 0 12px; }
  .topbar-name { font-size: 1.1rem; }
  .match-teams { flex-direction: column; gap: 12px; }
  .match-team-name { font-size: 1.2rem; }
  .schedule-item { grid-template-columns: 1fr auto 1fr; }
  .sched-time { grid-column: 1 / -1; text-align: center; }
  .btn-connect { padding: 6px 12px; font-size: 0.75rem; }
  .btn-connect svg { display: none; }
}
