/* ═══════════════════════════════════════════════════════════════
   MATRIX SPINS — Tournament Leaderboard v1.0
   Live rankings, prize tiers, countdown, past winners
   ═══════════════════════════════════════════════════════════════ */

/* ── Tournament Hero ────────────────────────────────────────── */
.tourney-hero {
  background: linear-gradient(135deg, #2d1040 0%, #0d1229 50%, #1a1842 100%);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.tourney-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.tourney-hero .trophy { font-size: 3rem; margin-bottom: 0.5rem; }

.tourney-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.tourney-hero h1 .purple { color: #c084fc; }
.tourney-hero h1 .gold { color: var(--gold); }

.tourney-hero .prize-amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffd700, #ff6b35, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.3rem 0;
}

.tourney-hero .sub { color: var(--muted); font-size: 0.9rem; }

/* ── Countdown ──────────────────────────────────────────────── */
.tourney-countdown {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.cd-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  min-width: 64px;
  text-align: center;
}

.cd-block .num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #f0f0f5;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.cd-block .unit {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Status Pill ────────────────────────────────────────────── */
.tourney-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tourney-status.live {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

.tourney-status.live .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.tourney-status.upcoming { background: rgba(99,102,241,0.15); color: #818cf8; }
.tourney-status.ended { background: rgba(255,255,255,0.06); color: var(--muted); }

/* ── Leaderboard Table ──────────────────────────────────────── */
.lb-card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.lb-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lb-card-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  margin: 0;
}

.lb-refresh {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.lb-refresh:hover { border-color: var(--gold); color: var(--gold); }

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th {
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lb-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.lb-table tr:hover { background: rgba(255,255,255,0.02); }

.lb-table .rank {
  font-weight: 800;
  width: 50px;
  font-variant-numeric: tabular-nums;
}

.lb-table .rank.gold { color: #ffd700; }
.lb-table .rank.silver { color: #c0c0c0; }
.lb-table .rank.bronze { color: #cd7f32; }

.lb-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(168,85,247,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.lb-player .name { font-weight: 600; }
.lb-player .you-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(212,175,55,0.15);
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.3rem;
}

.lb-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lb-table .prize {
  text-align: right;
  font-weight: 700;
  color: var(--gold);
}

/* ── Prize Distribution ─────────────────────────────────────── */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.prize-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}

.prize-card:hover { border-color: var(--gold); }

.prize-card.first  { border-color: rgba(255,215,0,0.3); background: linear-gradient(180deg, rgba(255,215,0,0.05), transparent); }
.prize-card.second { border-color: rgba(192,192,192,0.3); }
.prize-card.third  { border-color: rgba(205,127,50,0.3); }

.prize-card .medal { font-size: 1.8rem; margin-bottom: 0.3rem; }
.prize-card .place { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.prize-card .amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  margin-top: 0.2rem;
}

/* ── Your Position Banner ───────────────────────────────────── */
.your-position {
  background: linear-gradient(135deg, rgba(212,175,55,0.06), rgba(168,85,247,0.04));
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.your-position .pos-info { display: flex; align-items: center; gap: 1rem; }
.your-position .pos-rank {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}
.your-position .pos-label { font-size: 0.82rem; color: var(--muted); }
.your-position .pos-label strong { color: var(--text); display: block; font-size: 1rem; }

/* ── Past Tournaments ───────────────────────────────────────── */
.past-tourney {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.past-tourney:last-child { border-bottom: none; }

.past-tourney .icon { font-size: 1.5rem; }
.past-tourney .info { flex: 1; }
.past-tourney .info .title { font-weight: 600; font-size: 0.9rem; }
.past-tourney .info .meta { font-size: 0.75rem; color: var(--muted); }
.past-tourney .winner { text-align: right; }
.past-tourney .winner .name { font-weight: 600; font-size: 0.88rem; color: var(--gold); }
.past-tourney .winner .prize { font-size: 0.75rem; color: var(--muted); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tourney-hero { padding: 1.5rem; }
  .tourney-hero h1 { font-size: 1.4rem; }
  .tourney-hero .prize-amount { font-size: 2rem; }
  .tourney-countdown { gap: 0.5rem; }
  .cd-block { min-width: 52px; padding: 0.5rem 0.6rem; }
  .cd-block .num { font-size: 1.3rem; }
  .prize-grid { grid-template-columns: repeat(3, 1fr); }
  .lb-table th, .lb-table td { padding: 0.6rem 0.6rem; font-size: 0.82rem; }
  .your-position { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .tourney-hero .prize-amount { font-size: 1.6rem; }
  .cd-block .num { font-size: 1.1rem; }
  .prize-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
  .prize-card .amount { font-size: 1rem; }
  .lb-avatar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tourney-status.live .dot { animation: none; opacity: 1; }
}
