/* Referral leaderboard tab */
.hub-ref-top-shell {
  max-width: min(920px, 100%);
  margin: 0 auto;
  width: 100%;
  animation: hubRefTopFadeIn 0.35s ease;
}

@keyframes hubRefTopFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-ref-top-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(22px, 4vw, 32px);
  margin-bottom: 22px;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(251, 191, 36, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(168, 85, 247, 0.28) 0%, transparent 50%),
    linear-gradient(135deg, #4c1d95 0%, #6d28d9 42%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 16px 48px rgba(76, 29, 149, 0.35);
}

.hub-ref-top-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.hub-ref-top-hero-inner {
  position: relative;
  z-index: 1;
}

.hub-ref-top-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hub-ref-top-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.hub-ref-top-lead {
  margin: 0;
  max-width: 52ch;
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.hub-ref-top-prizes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.hub-ref-top-prize {
  position: relative;
  border-radius: 20px;
  padding: 18px 14px 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-ref-top-prize:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.hub-ref-top-prize--1 {
  order: 2;
  border-color: rgba(234, 179, 8, 0.55);
  background: linear-gradient(180deg, #fffbeb 0%, #fff 55%);
  transform: scale(1.04);
  z-index: 2;
}

.hub-ref-top-prize--2 { order: 1; }
.hub-ref-top-prize--3 { order: 3; }

.hub-ref-top-prize-medal {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.hub-ref-top-prize-place {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.hub-ref-top-prize-amount {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 900;
  color: #0f172a;
}

.hub-ref-top-prize--1 .hub-ref-top-prize-amount {
  color: #b45309;
}

.hub-ref-top-prize--2 .hub-ref-top-prize-amount {
  color: #475569;
}

.hub-ref-top-prize--3 .hub-ref-top-prize-amount {
  color: #c2410c;
}

.hub-ref-top-mine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
}

.hub-ref-top-my-link {
  margin-bottom: 18px;
}

.hub-ref-top-guest-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #64748b;
}

.hub-ref-top-mine-label {
  font-size: 13px;
  font-weight: 800;
  color: #6d28d9;
}

.hub-ref-top-mine-stats {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.hub-ref-top-mine-stats strong {
  color: #7c3aed;
}

.hub-ref-top-table-wrap {
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.hub-ref-top-table-head,
.hub-ref-top-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 72px 72px;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.hub-ref-top-table-head {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.hub-ref-top-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.hub-ref-top-row:last-child {
  border-bottom: none;
}

.hub-ref-top-row:hover {
  background: #fafafa;
}

.hub-ref-top-row--gold {
  background: linear-gradient(90deg, #fffbeb 0%, #fff 70%);
}

.hub-ref-top-row--silver {
  background: linear-gradient(90deg, #f8fafc 0%, #fff 70%);
}

.hub-ref-top-row--bronze {
  background: linear-gradient(90deg, #fff7ed 0%, #fff 70%);
}

.hub-ref-top-row--me {
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: -2px;
  background: linear-gradient(90deg, #f5f3ff 0%, #fff 70%);
}

.hub-ref-top-rank {
  font-size: 16px;
  font-weight: 900;
  color: #94a3b8;
  text-align: center;
}

.hub-ref-top-row--gold .hub-ref-top-rank { color: #ca8a04; }
.hub-ref-top-row--silver .hub-ref-top-rank { color: #64748b; }
.hub-ref-top-row--bronze .hub-ref-top-rank { color: #ea580c; }

.hub-ref-top-player {
  min-width: 0;
}

.hub-ref-top-nick {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-ref-top-prize-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #7c3aed;
  background: #ede9fe;
}

.hub-ref-top-num {
  font-size: 15px;
  font-weight: 800;
  color: #334155;
  text-align: center;
}

.hub-ref-top-num--accent {
  color: #7c3aed;
}

.hub-ref-top-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.hub-ref-top-footnote {
  margin: 16px 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
  font-weight: 600;
}

@media (max-width: 640px) {
  .hub-ref-top-prizes {
    grid-template-columns: 1fr;
  }

  .hub-ref-top-prize--1 {
    order: 0;
    transform: none;
  }

  .hub-ref-top-prize--2,
  .hub-ref-top-prize--3 {
    order: 0;
  }

  .hub-ref-top-table-head,
  .hub-ref-top-row {
    grid-template-columns: 36px minmax(0, 1fr) 56px;
    padding: 12px 14px;
  }

  .hub-ref-top-table-head span:nth-child(4),
  .hub-ref-top-row .hub-ref-top-num:last-child {
    display: none;
  }

}
