/* ============================================
   POMP.FUN INVITE LEADERBOARD
   Clean, spacious, de-cluttered design with
   glowing $2,500 centerpiece & fluid animations
   ============================================ */

/* --- Design Tokens (Jackpot.wtf Deep Dark Theme) --- */
:root {
  --bg-deep: #010204;
  --bg-surface: #0d0f16;
  --bg-card: #12161f;
  --surface-primary: #12161f;
  --surface-primary-hover: #171c27;
  --surface-tab: #12161f;
  --surface-tab-hover: #171c27;
  --surface-referrals: #15161b;
  --surface-referrals-hover: #1c1d23;
  --surface-gray: #2b2e36;
  --surface-gray-hover: #383c45;
  --surface-gray-active: #424752;

  --accent: #34d399;
  --accent-light: #a7f3d0;
  --accent-dim: #059669;
  --accent-glow: rgba(52, 211, 153, 0.45);

  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-muted: #d7dee7;

  --border-subtle: rgba(52, 211, 153, 0.15);
  --border-row: rgba(255, 255, 255, 0.04);

  --font-main: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --content-max: 1280px;
}

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

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

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-weight: 700;
}

/* Uploaded atmospheric background with a dark blend layer. */
#background-dot-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  isolation: isolate;
  pointer-events: auto;
  background: #07100d;
  opacity: 1;
  transition: opacity 180ms ease-out;
}

#background-dot-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('/assets/green-wave-bg.webp?v=1');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
}

#background-dot-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}

@media (min-width: 769px) {
  #background-dot-pattern::after {
    display: block;
    background:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.26) 0%,
        rgba(0, 0, 0, 0.34) 54%,
        rgba(0, 0, 0, 0.58) 100%
      ),
      radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(0, 0, 0, 0.20) 58%,
        rgba(0, 0, 0, 0.42) 100%
      );
  }
}

#background-dot-pattern canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  display: none;
}

/* Keep the mobile layout focused on the leaderboard content. */
@media (max-width: 768px) {
  html,
  body {
    /* Keep the leaderboard vertically scrollable while disabling pinch zoom. */
    touch-action: pan-y;
  }

  #background-dot-pattern {
    position: fixed;
    min-height: 0;
    height: 100dvh;
  }

  #background-dot-pattern::after {
    display: block;
    background:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.22) 54%,
        rgba(0, 0, 0, 0.48) 100%
      ),
      radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.15) 58%,
        rgba(0, 0, 0, 0.34) 100%
      );
  }

  #background-dot-pattern::before {
    opacity: 1;
  }

  #background-dot-pattern canvas {
    display: none;
  }

}

/* --- Top Nav --- */
.top-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 24px 16px;
  border: 1px solid var(--border-subtle);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: var(--surface-gray);
  border-bottom-color: var(--border-subtle);
  box-shadow: none;
  overflow: visible;
  z-index: 1000;
}

/* Keep the quick-action controls visible without rendering the desktop header bar. */
@media (min-width: 769px) {
  .top-nav {
    position: absolute;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

/* Reference-style leaderboard: compact cards with a dedicated header surface. */
.leaderboard-table {
  border-spacing: 0;
}

.leaderboard-table thead th {
  height: 32px;
  padding: 8px 14px;
  background: var(--surface-gray);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.leaderboard-table thead th:first-child {
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px 0 0 7px;
}

.leaderboard-table thead th:last-child {
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0 7px 7px 0;
}

.lb-row td {
  height: 44px;
  padding: 7px 14px;
  background: var(--surface-gray);
  border-top: none;
  border-bottom: none;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.lb-row td:first-child {
  border-left: none;
  border-radius: 5px 0 0 5px;
}

.lb-row td:last-child {
  border-right: none;
  border-radius: 0 5px 5px 0;
}



.lb-row:hover td {
  background: var(--surface-gray-hover);
}

.lb-row .col-position {
  color: #718096;
  font-size: 12px;
  font-weight: 500;
}

.leaderboard-table td.col-user {
  display: table-cell;
  vertical-align: middle;
}

.user-cell {
  gap: 8px;
  padding: 0;
}

.lb-row .avatar,
.lb-row .discord-avatar-small {
  width: 28px;
  height: 28px;
}

.lb-row .avatar {
  border-radius: 50%;
}

.lb-row .discord-avatar-small {
  border-radius: 50%;
  border-color: rgba(148, 163, 184, 0.4);
}

.username {
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
}

.ref-val {
  color: #8b98ac;
  font-size: 12px;
  font-weight: 500;
}

.prize-cell {
  align-items: flex-start;
  gap: 1px;
}

.prize-sol-inline {
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.prize-sol-inline .prize-sol-token {
  width: 13px;
  height: 13px;
}

.prize-usd-sub {
  padding-left: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.top-nav-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #ffffff;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  backdrop-filter: none;
}

.nav-icon img,
.nav-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 7px;
  transition: color 0.16s ease;
}

.nav-icon:hover {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: none;
}

.nav-icon:active {
  /* The temporary press effect is managed by .nav-icon-pressing. */
  transform: none;
  box-shadow: none;
}

.nav-icon.nav-icon-pressing {
  transform: none;
}

.nav-icon:focus:not(:active) {
  /* Return to the original state after the press is released. */
  background: transparent;
  border-color: transparent;
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.nav-icon:focus {
  /* Focus should not preserve the pressed appearance after activation. */
  background: transparent;
  border-color: transparent;
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.nav-icon:focus-visible {
  outline: 1px solid rgba(52, 211, 153, 0.6);
  outline-offset: 3px;
}

/* --- Main Spacious Layout --- */
.main-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0px 24px 80px;
}

/* ============================================
   HERO SECTION — Compact Vertical Rhythm
   ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 0px;
  margin-top: -20px;
  margin-bottom: 24px;
}

.prize-amount-small {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 60px);
  font-weight: 800;
  font-style: italic;
  color: #ffffff;
  margin-bottom: 15px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  line-height: 1;
  text-align: center;
  position: relative;
  z-index: 10;
}

.leaderboard-image {
  display: block;
  margin: 0 auto 16px auto;
  width: 100%;
  max-width: 700px;
  height: auto;
  /* Dark shadow keeps the green wordmark readable over the bright background. */
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 20px rgba(64, 228, 150, 0.2));
  position: relative;
  z-index: 5;
}

/* Lower the desktop hero group without changing the mobile composition. */
@media (min-width: 769px) {
  .hero {
    padding-top: 80px;
    margin-bottom: 8px;
  }
  .hero .prize-amount {
    margin-bottom: 28px;
  }
  #dashboard-stats-row {
    margin-top: 0;
    margin-bottom: 0;
  }
}

.logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

/* Container for Prize Centerpiece */
.headline-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

/* --- $2,500 LIVE TYPE CENTERPIECE --- */
.prize-amount {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(50px, 7vw, 78px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  user-select: none;
  transform: perspective(600px) rotateX(10deg) rotateZ(-0.5deg) scaleY(0.96);
  transform-origin: center bottom;
  isolation: isolate;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.34));
}

.prize-amount::before {
  display: none;
}

.prize-amount-face {
  position: relative;
  z-index: 1;
  display: block;
  background: none;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  -webkit-text-stroke: 0;
  text-shadow:
    -1px -1px 0 #002a16,
    1px -1px 0 #002a16,
    -1px 1px 0 #002a16,
    1px 1px 0 #002a16;
}

.headline-sub {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(18px, 3.5vw, 26px);
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #d1fae5 40%, #6ee7b7 75%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter:
    drop-shadow(-0.5px -0.5px 0 rgba(5, 44, 30, 0.45))
    drop-shadow(0.5px -0.5px 0 rgba(5, 44, 30, 0.45))
    drop-shadow(-0.5px 0.5px 0 rgba(5, 44, 30, 0.45))
    drop-shadow(0.5px 0.5px 0 rgba(5, 44, 30, 0.45))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

/* --- Countdown Timer --- */
.countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.countdown-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.countdown-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.countdown-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: capitalize;
}

.countdown-sep {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  margin-top: -12px;
  opacity: 0.7;
}

/* --- CTA Line --- */
.cta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  margin-bottom: 24px;
}

.cta-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.cta-tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.cta-info-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.cta-info-icon:hover {
  opacity: 1;
  transform: scale(1.15);
}

.cta-tooltip-box {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 240px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.cta-info-icon:hover + .cta-tooltip-box,
.cta-info-icon:focus + .cta-tooltip-box {
  opacity: 1;
  pointer-events: auto;
}

.campaign-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ============================================
   TOP 3 PODIUM SECTION — Floating Cards & Polish
   ============================================ */
.podium-section {
  width: 100%;
  margin-bottom: 96px;
}

/* Keep the desktop podium and leaderboard table visually connected. */
@media (min-width: 769px) {
  .podium-section {
    margin-bottom: 28px;
  }
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 0 0 280px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.podium-slot:hover {
  transform: translateY(-6px);
}

.podium-slot-1 {
  margin-bottom: 20px;
  /* Keep the 1st-place card in front of the side placeholders. */
  z-index: 3;
}

.podium-slot-2 {
  z-index: 2;
}

.podium-slot-3 {
  z-index: 1;
}

.podium-avatar-wrap {
  margin-bottom: 10px;
}

.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.podium-avatar-revealed {
  background: rgba(52, 211, 153, 0.12);
  border: 2px solid #4b5563;
  color: var(--accent-light);
  box-shadow: none;
  animation: none;
}

.podium-slot-1 .podium-avatar {
  width: 76px;
  height: 76px;
  border-width: 3px;
  box-shadow: none;
}

.podium-avatar-blur {
  background: var(--surface-gray);
  border: 2px solid #4b5563;
  color: var(--text-muted);
}

.podium-avatar-q {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-muted);
  filter: blur(2px);
}

.podium-username {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.blurred-name {
  filter: blur(4px);
  color: var(--text-muted);
}

.podium-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.podium-stat-label {
  color: var(--text-muted);
}

.podium-stat-value {
  color: var(--text-secondary);
}

.podium-prize-card {
  position: relative;
  background: var(--surface-gray);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 8px 18px;
  margin-bottom: 12px;
  box-sizing: border-box;
  width: 280px;
  min-width: 0;
  height: 52px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.25s ease;
}

.podium-slot:hover .podium-prize-card {
  background: var(--surface-gray-hover);
}

.podium-prize-sol {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-light);
}

.podium-prize-card-1st .podium-prize-sol {
  font-size: 20px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.podium-prize-usd {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.podium-prize-conversion,
.podium-prize-sol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.podium-prize-conversion {
  gap: 3px;
  white-space: nowrap;
}

.podium-prize-sol {
  gap: 2px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.prize-approx {
  color: var(--text-secondary);
  font-weight: 800;
}

.prize-sol-token {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (min-width: 769px) {
  .prize-sol-token {
    width: 18px;
    height: 18px;
  }
}

.podium-badge-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.podium-badge {
  display: block;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.podium-slot:hover .podium-badge {
  opacity: 1;
}

.podium-badge-center { width: 220px; }
.podium-badge-side { width: 180px; }

/* ============================================
   LEADERBOARD TABLE — Spacious & Interactive
   ============================================ */
.leaderboard-section {
  width: 100%;
}

.leaderboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
}

.col-position { width: 10%; }
.col-user { width: 40%; }
.col-referrals { width: 22%; }
.col-prize { width: 28%; }

.leaderboard-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: capitalize;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.lb-row td {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-primary);
  border-top: none;
  border-bottom: none;
  transition: background 0.25s ease;
}

.lb-row td:first-child { border-radius: 5px 0 0 5px; }
.lb-row td:last-child { border-radius: 0 5px 5px 0; }

.lb-row:hover td {
  background: var(--surface-primary-hover);
}

.lb-row .col-position {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Keep the profile and username visually integrated with the row. */
.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
  cursor: pointer;
}

.user-cell:hover,
.lb-row:hover .user-cell {
  background: transparent;
  transform: none;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-blur {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-empty {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.username {
  font-weight: 700;
  color: var(--text-primary);
}

.username.blurred {
  color: var(--text-muted);
  filter: blur(2px);
}

.ref-val {
  font-weight: 700;
  color: var(--text-secondary);
}

.prize-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.prize-sol-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.sol-icon {
  color: var(--accent-dim);
}

.prize-usd-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 0;
}

.prize-sol-inline .prize-sol-token {
  width: 15px;
  height: 15px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .hero {
    width: 100%;
    padding: 18px 18px 14px;
  }

  .podium { gap: 10px; }
  .podium-slot { flex: 1 1 0; min-width: 0; }
  .podium-badge-center { width: 140px; }
  .podium-badge-side { width: 120px; }
  .podium-avatar { width: 46px; height: 46px; }
  .podium-slot-1 .podium-avatar { width: 56px; height: 56px; }
  .prize-amount { font-size: clamp(54px, 10vw, 65px); }
}

.podium-slot:hover .podium-prize-card {
  /* no glow on hover */
}

.podium-prize-sol {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-light);
}

.podium-prize-card-1st .podium-prize-sol {
  font-size: 20px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.podium-prize-usd {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.podium-badge-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.podium-badge {
  display: block;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.podium-slot:hover .podium-badge {
  opacity: 1;
}

.podium-badge-center { width: 220px; }
.podium-badge-side { width: 180px; }

/* ============================================
   LEADERBOARD TABLE — Spacious & Interactive
   ============================================ */
.leaderboard-section {
  width: 100%;
}

.leaderboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
}

.col-position { width: 10%; }
.col-user { width: 40%; }
.col-referrals { width: 22%; }
.col-prize { width: 28%; }

.leaderboard-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: capitalize;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.lb-row td {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-primary);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  transition: background 0.25s ease;
}

.lb-row td:first-child { border-radius: 5px 0 0 5px; }
.lb-row td:last-child { border-radius: 0 5px 5px 0; }

.lb-row:hover td {
  background: var(--surface-primary-hover);
}

.lb-row .col-position {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* User Pill Container Hover Highlight */
.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
  cursor: pointer;
}

.user-cell:hover,
.lb-row:hover .user-cell {
  background: transparent;
  transform: none;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-blur {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.username {
  font-weight: 700;
  color: var(--text-primary);
}

.username.blurred {
  color: var(--text-muted);
  filter: blur(2px);
}

.ref-val {
  font-weight: 700;
  color: var(--text-secondary);
}

.prize-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prize-sol-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.sol-icon {
  color: var(--accent-dim);
}

.prize-usd-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding-left: 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .podium { gap: 10px; }
  .podium-slot { flex: 1 1 0; min-width: 0; }
  .podium-badge-center { width: 140px; }
  .podium-badge-side { width: 120px; }
  .podium-avatar { width: 46px; height: 46px; }
  .podium-slot-1 .podium-avatar { width: 56px; height: 56px; }
  .prize-amount { font-size: clamp(58px, 11vw, 72px); }
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.primary-btn {
  background-color: #00e68a;
  color: #002a16;
  border: none;
  border-bottom: 4px solid #00b36b;
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primary-btn:active {
  border-bottom-width: 0px;
  transform: translateY(4px);
  margin-bottom: 4px;
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-bottom: 4px solid #00804d;
}

.discord-btn {
  background-color: #5865F2;
  color: white;
  border: none;
  border-bottom: 4px solid #4752C4;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.discord-btn:active {
  border-bottom-width: 0px;
  transform: translateY(4px);
  margin-bottom: 4px;
}

/* ============================================
   DASHBOARD 3-CARD LAYOUT
   ============================================ */
.stats-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.personal-stats-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

@keyframes popIn {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.stat-card {
  position: relative;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  overflow: hidden;
  width: 250px;
  max-width: 100%;
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
}

.stat-card-inner {
  background: url('assets/user-bg.png') center/cover;
  background-color: #1a1a1a;
  border-radius: 14px;
  padding: 16px 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* Referral cards share the same row-like surface as leaderboard players. */
#ref-link-card,
#ref-count-card {
  background: var(--surface-primary);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.3);
  box-shadow: none;
  padding: 0;
  border-radius: 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  height: 112px;
  min-height: 112px;
  flex: none;
}

#ref-link-card .stat-card-inner,
#ref-count-card .stat-card-inner {
  background: transparent;
  box-shadow: none;
  border-radius: inherit;
  box-sizing: border-box;
  padding: 14px 28px;
  overflow: hidden;
  height: 100%;
}

#ref-link-card .stat-card-inner::after,
#ref-count-card .stat-card-inner::after {
  content: none;
}

#ref-link-card .stat-card-inner > *,
#ref-count-card .stat-card-inner > * {
  position: relative;
  z-index: 1;
}

#ref-link-card .stat-label,
#ref-count-card .stat-label {
  font-size: 13px;
  line-height: normal;
  margin-bottom: 0;
  white-space: nowrap;
}

#ref-link-card .premium-label,
#ref-count-card .premium-label {
  color: #fff !important;
}

#ref-link-card .premium-content-right {
  align-self: center;
  margin-top: 20px;
}

#ref-link-card .copy-btn {
  padding: 12px !important;
  font-size: 13px;
}

#ref-count-card .stat-count {
  font-size: 42px;
  margin-bottom: 0;
}

.ref-inner {
  align-items: center;
}

.stat-count {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
  line-height: 1;
  margin-bottom: 0;
}

.stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.ref-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 300px;
  min-width: 0;
}

.ref-input-group input,
.ref-link-display {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.ref-prefix {
  color: #64748b;
  margin-right: 2px;
}

.ref-link-display strong {
  color: #fff;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.copy-btn {
  padding: 10px 16px;
  font-size: 13px;
}

.referral-input-wrap {
  position: relative;
}

.referral-input-wrap .reg-input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 42px;
}

.referral-status {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: none;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.referral-status.checking,
.referral-status.valid,
.referral-status.invalid {
  display: block;
}

.referral-status.checking {
  display: none;
}

.referral-status.valid {
  color: #22c55e;
}

.referral-status.invalid {
  color: #ef4444;
}

.reg-input.referral-invalid {
  border-color: #ef4444;
}

.reg-input.referral-valid {
  border-color: #22c55e;
}

/* The wallet menu intentionally exposes only the supported action. */
.dropdown-list li:not(:last-child) {
  display: none;
}

.dropdown-list li.dropdown-referrals-item {
  display: block;
}

/* Shown (by script.js) for accounts made without Discord. */
.dropdown-list li#link-discord-item {
  display: block;
}

html.referrals-open,
body.referrals-open {
  overflow: hidden;
}

#your-referrals-count {
  color: #fff;
  text-shadow: none;
}

/* On phones, keep the personal dashboard cards below the leaderboard.
   They live inside the stats row in the desktop layout, so flatten that
   wrapper only at the mobile breakpoint and use the dashboard's visual order. */
@media (max-width: 768px) {
  #dashboard-view {
    display: flex;
    flex-direction: column;
  }

  #dashboard-view > .hero {
    order: 1;
    padding-top: 70px;
  }

  #dashboard-stats-row #personal-dashboard {
    order: 6;
    margin-top: 32px;
  }

  #dashboard-view > .cta-line {
    order: 3;
  }

  #dashboard-view > .podium-section {
    order: 4;
  }

  #dashboard-view > .leaderboard-section {
    order: 5;
  }

  #dashboard-stats-row {
    display: contents;
  }

  #dashboard-stats-row #personal-dashboard {
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: -16px;
    margin-bottom: 0;
    padding: 0 12px;
  }

  #dashboard-stats-row #personal-dashboard .stat-card {
    width: 100%;
    box-sizing: border-box;
  }

  #ref-link-card .premium-inner {
    padding: 18px 14px !important;
    gap: 10px;
  }

  #ref-link-card .premium-content-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  #ref-link-card .ref-link-display {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    font-size: clamp(14px, 4vw, 18px) !important;
  }

  #ref-link-card .premium-content-right {
    flex: 0 0 auto;
    max-width: 100%;
  }

  #ref-link-card .copy-btn {
    min-width: 92px;
    max-width: 100%;
    white-space: nowrap;
  }

  .cta-tooltip-box {
    left: auto;
    right: 0;
    transform: none;
    width: min(240px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }

  /* display: contents removes the original stats-row box (and its 40px
     bottom margin). Preserve that rhythm so the CTA and podium do not jump
     upward when the account dashboard cards are moved to the page bottom. */
  #dashboard-view > .cta-line {
    margin-top: 48px;
  }
}

/* ============================================
   REGISTRATION MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s forwards;
}

.modal-overlay.oauth-return {
  animation: none;
}

.modal-container {
  display: flex;
  position: relative;
  width: 800px;
  max-width: 95vw;
  height: 520px;
   background: #15161b;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.5);
  transform: translateY(20px);
  animation: slideUpModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal-overlay.oauth-return .modal-container {
  animation: none;
  transform: translateY(0);
}

.modal-left {
  flex: 1 1 50%;
  max-width: 50%;
  padding: 20px 40px 40px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.modal-right {
  flex: 1 1 50%;
  max-width: 50%;
  position: relative;
  background: #0a0b0d;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.modal-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.modal-avatar-3d {
  position: absolute;
  top: 50%;
  right: -60px;
  transform: translateY(-50%);
  width: 100%; 
  max-width: 360px;
  z-index: 10;
  pointer-events: none; /* So it doesn't block clicks underneath */
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 10px;
}

.modal-header-icon {
  background: rgba(255,255,255,0.05);
  width: 72px;
  height: 72px;
  padding: 18px;
  border: none;
  border-radius: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.modal-header-icon:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.reg-input {
  background: #0d0e12;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 14px 16px;
  color: white;
  font-family: var(--font-main);
  outline: none;
  font-size: 14px;
}

.reg-input:focus {
  border-color: var(--accent);
}

.reg-input[readonly] {
  color: var(--text-muted);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: #0d0e12;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

.custom-checkbox input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.complete-btn {
  width: 100%;
}

.complete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-footer-logo {
  margin-top: auto;
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 20px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  background: #1a1a2e;
  border-left: 4px solid var(--accent);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  max-width: 350px;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.success {
  border-left-color: #10b981;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
  to { transform: translateX(100%); opacity: 0; }
}

/* NAVBAR ADJUSTMENTS */
.nav-wallet-wrap {
  margin-left: 12px;
  display: flex;
  align-items: center;
}

/* Override existing leaderbord avatar for discord */
.podium-avatar {
  background-size: cover;
  background-position: center;
}
.leaderboard-table td.col-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discord-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #4b5563;
}
.podium-avatar-revealed .discord-avatar-small {
  border-color: #4b5563;
}
.podium-avatar .discord-avatar-small {
  object-fit: contain;
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--surface-gray);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 1000;
  padding: 8px 0;
}

.nav-wallet-wrap {
  position: relative;
}

.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-list li {
  margin: 0;
  padding: 0;
}

.dropdown-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #a0aec0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-list a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.dropdown-list svg {
  color: #718096;
}

.referrals-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s forwards;
}

.referrals-overlay[hidden] { display: none; }

.referrals-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 900px;
  max-width: 95vw;
  height: 600px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 40px;
  color: #edfdf4;
  background: var(--surface-gray);
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.5);
  transform: translateY(20px);
  animation: slideUpModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.referrals-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.referrals-close:hover { background: rgba(255,255,255,0.1); }
.referrals-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.referrals-heading-row h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: normal; }
.referrals-state { min-height: 20px; margin: 0 0 10px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.referrals-state.error { color: #ff9b9b; }
.referrals-list { display: grid; align-content: start; flex: 0 1 auto; gap: 8px; min-height: 0; max-height: 390px; overflow-y: auto; padding-right: 3px; }
.referral-row { display: flex; align-items: center; gap: 13px; padding: 14px 18px; background: var(--surface-gray-hover); border-top: 1px solid rgba(255,255,255,0.02); border-bottom: 1px solid rgba(0,0,0,0.3); border-radius: 10px; transition: background 0.25s ease; }
.referral-row:hover { background: var(--surface-gray-active); }
.referral-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 8px; object-fit: cover; background: var(--surface-gray-hover); }
.referral-avatar-fallback { display: grid; place-items: center; color: var(--accent); font-size: 13px; font-weight: 800; }
.referral-details { min-width: 0; flex: 1 1 auto; }
.referral-name { overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.referral-joined { margin-top: 4px; color: var(--text-secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
.referral-row.is-pending { border-color: rgba(251, 191, 36, 0.22); }
.referral-status-pending { flex: 0 0 auto; padding: 5px 8px; border: 1px solid rgba(251, 191, 36, 0.35); border-radius: 999px; color: #fcd34d; background: rgba(251, 191, 36, 0.09); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-align: center; }
.referral-empty { padding: 42px 20px; text-align: center; border: 1px dashed rgba(255,255,255,0.1); border-radius: 8px; color: var(--text-secondary); font-size: 14px; }
.referral-skeleton { height: 62px; border-bottom: 1px solid rgba(255,255,255,0.05); background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.07), rgba(255,255,255,.025)); background-size: 200% 100%; animation: referralShimmer 1.3s ease-in-out infinite; }
@keyframes referralShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 768px) {
  .referrals-overlay { padding: 12px; }
  .referrals-panel {
    width: min(460px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 436px;
    min-height: 0;
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 24px max(28px, env(safe-area-inset-bottom));
  }
  .referrals-list { max-height: none; overflow-y: visible; }
  .referrals-heading-row { align-items: start; }
  .referral-row { gap: 10px; padding: 12px 14px; }
  .referral-avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .referral-joined { font-size: 11px; }
  .referral-status-pending { max-width: 100px; padding: 4px 6px; font-size: 9px; line-height: 1.2; white-space: normal; }
}
.nav-wallet-wrap {
  position: relative;
  z-index: 9999;
}

@keyframes fadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(5px); }
}

@keyframes slideUpModal {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Move only the invite CTA visually on mobile without changing the flow below it. */
@media (max-width: 768px) {
  .cta-line {
    position: relative;
    top: -70px;
    margin-bottom: -42px;
  }

  /* Match the header-to-prize spacing with the prize-to-heading spacing. */
  .prize-amount {
    margin-bottom: 16px;
  }

  .leaderboard-section {
    position: relative;
    top: -65px;
  }

  html,
  body {
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  .top-nav {
    position: fixed;
    top: 0;
    left: 0;
    padding: 16px 16px 8px;
  }

  .main-content {
    padding-top: 76px;
  }

  .top-nav-controls {
    gap: 8px;
  }

  .nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

}

/* Keep every podium profile picture free of decorative glow. */
.podium-slot-1 .podium-avatar,
.podium-slot-1 .podium-avatar-revealed {
  box-shadow: none;
  animation: none;
}

.podium-slot-2 .podium-avatar,
.podium-slot-2 .podium-avatar-revealed {
  box-shadow: none;
  animation: none;
}

.podium-slot-3 .podium-avatar,
.podium-slot-3 .podium-avatar-revealed {
  box-shadow: none;
  animation: none;
}

/* Whole podium slot lifts on hover */
.podium-slot {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.podium-slot:hover {
  transform: translateY(-4px);
}

/* ============================================
   WALLET PICKER MODAL
   ============================================ */
#wallet-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInPicker 0.2s ease;
}

@keyframes fadeInPicker { from { opacity:0; } to { opacity:1; } }

#wallet-picker-modal {
  background: #121520;
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: 20px;
  padding: 28px 24px 22px;
  width: 340px;
  max-width: 92vw;
  box-shadow: 0 0 60px rgba(52,211,153,0.08);
  animation: slideUpModal 0.25s cubic-bezier(0.4,0,0.2,1);
}

.wallet-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wallet-picker-header span {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
#wallet-picker-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}
#wallet-picker-close:hover { color: #fff; }

.wallet-picker-sub {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 18px;
}

#wallet-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  width: 100%;
  text-align: left;
  color: inherit;
  font-family: inherit;
}
.wallet-option:hover {
  background: rgba(52,211,153,0.08);
  border-color: rgba(52,211,153,0.3);
}
.wallet-option:active { transform: scale(0.98); }

.wallet-option img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.wallet-option-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-primary);
  border: 1px solid rgba(203, 213, 225, 0.24);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.wallet-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wallet-option-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.wallet-option-status {
  font-size: 12px;
  color: #34d399;
  font-weight: 500;
}
.wallet-option-status.not-installed {
  color: #64748b;
}
.wallet-picker-install {
  text-align: center;
  font-size: 12px;
  color: #64748b;
}
.wallet-picker-install a {
  color: #34d399;
  text-decoration: none;
  font-weight: 600;
}
.wallet-picker-install a:hover { text-decoration: underline; }

/* ============================================
   REGISTRATION MODAL — MOBILE FULL-SCREEN
   Hide the artwork panel on narrow screens so the
   account-creation form fills the entire viewport.
   ============================================ */
@media (max-width: 768px) {
  #reg-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  #reg-modal-overlay .modal-container {
    width: min(460px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #reg-modal-overlay .modal-right {
    display: none;
  }

  #reg-modal-overlay .modal-left {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 28px 24px max(28px, env(safe-area-inset-bottom));
    overflow: visible;
    box-sizing: border-box;
  }

  #reg-modal-overlay .modal-header-icon {
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 12px;
  }

  #reg-modal-overlay .modal-header-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Keep the registration escape hatch compact and neutral. */
.modal-logout-control {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8b919c;
  cursor: pointer;
  appearance: none;
  opacity: 0.9;
  transition: color 0.2s, opacity 0.2s;
}

.modal-logout-control svg {
  display: block;
  width: 19px;
  height: 19px;
}

.modal-logout-control:hover {
  color: #b5bac4;
  opacity: 1;
}

@media (max-width: 768px) {
  .modal-logout-control {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
}

/* ============================================
   DISCORD REGISTRATION GATE
   Link Discord -> Join Server -> Create Account
   ============================================ */
#join-server-wrap {
  flex-direction: column;
  gap: 10px;
}

/* "Join Discord Server" — same purple, full width */
.join-server-btn {
  width: 100%;
  text-decoration: none;
}

/* "I've joined — verify me" — subtle secondary action */
.check-member-btn {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 12px 20px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.check-member-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.check-member-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hint text under the join buttons */
.join-server-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.join-server-hint a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Badge shown when Discord is linked + server verified */
.discord-linked-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 8px;
  color: #34d399;
  font-size: 13px;
  font-weight: 700;
}

/* Discord link row under the username input */
.discord-link-row {
  margin-top: 10px;
}

/* Unlink button inside the linked badge */
.discord-unlink-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.discord-unlink-btn:hover {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Link / Unlink Discord buttons under the username input — full width,
   identical styling (both use .discord-btn) */
.discord-full-btn {
  width: 100%;
}

/* Disabled state for the purple Discord-style buttons (Join Server, etc.) —
   same dimmed look as the primary button so gating is visually obvious */
.discord-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.discord-btn:disabled:active {
  border-bottom-width: 4px;
  transform: none;
  margin-bottom: 0;
}

/* The supplied artwork is one shared 1st/2nd/3rd-place podium. */
.podium {
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.podium-slots {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .podium-slots {
    gap: 10px;
  }
}



.prize-usd-sub,
.prize-sol-inline,
.prize-sol-inline .prize-approx {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Keep leaderboard rows as one continuous table row. */
.lb-row td {
  padding: 8px 18px;
  vertical-align: middle;
  background: var(--surface-gray);
}

.lb-row:hover td {
  background: var(--surface-gray-hover);
}

.leaderboard-table td.col-user {
  display: table-cell;
  vertical-align: middle;
}

.user-cell {
  padding-top: 2px;
  padding-bottom: 2px;
}

.leaderboard-pagination {
  position: absolute;
  top: 468px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 0;
}

.leaderboard-pagination[hidden] {
  display: none;
}

.leaderboard-page-btn {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.leaderboard-page-btn:hover:not(:disabled) {
  color: var(--accent);
}

.leaderboard-page-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.leaderboard-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.leaderboard-page-label {
  min-width: 72px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Keep pagination anchored to the exact position below a seven-row page. */
.leaderboard-section {
  position: relative;
  width: min(100%, 960px);
  margin-inline: auto;
  padding-bottom: 46px;
}

.leaderboard-table-wrap {
  height: auto;
  min-height: 452px;
  overflow: visible;
}

@media (max-width: 768px) {
  .podium-slot {
    flex-basis: 0;
  }

  .podium-prize-card {
    width: 100%;
    padding-inline: 6px;
  }

  /* Let longer leaderboard pages contribute to document height on phones,
     while reserving the same seven-row slot for short pages so pagination
     controls do not jump upward. */
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scroll-behavior: auto;
  }

  body {
    height: auto;
    min-height: 100dvh;
    overflow-x: clip;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .leaderboard-table-wrap {
    height: auto;
    min-height: 0;
    overflow-y: visible;
  }

  .leaderboard-pagination {
    position: static;
    margin-top: 14px;
  }
}

/* Final leaderboard presentation overrides: keep the header as a short row card. */
.leaderboard-table {
  border-spacing: 0 6px;
}

.leaderboard-table thead th {
  height: 32px;
  padding: 8px 14px;
  background: var(--surface-gray);
  border-top: none;
  border-bottom: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.leaderboard-table thead th:first-child {
  border-left: none;
  border-radius: 9px 0 0 9px;
}

.leaderboard-table thead th:last-child {
  border-right: none;
  border-radius: 0 9px 9px 0;
}

.leaderboard-table .lb-row td {
  height: 60px;
  padding: 12px 18px;
  background: var(--surface-gray);
  border-top: none;
  border-bottom: none;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.leaderboard-table .lb-row td:first-child {
  border-left: none;
  border-radius: 5px 0 0 5px;
}

.leaderboard-table .lb-row td:last-child {
  border-right: none;
  border-radius: 0 5px 5px 0;
}

.leaderboard-table .lb-row:hover td {
  background: var(--surface-gray-hover);
}

.leaderboard-table .lb-row .col-position {
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
}

.leaderboard-table .user-cell {
  gap: 12px;
  padding: 6px 16px 6px 6px;
  border-radius: 10px;
}

.leaderboard-table .lb-row .avatar,
.leaderboard-table .lb-row .discord-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-gray);
  border: 2px solid #4b5563;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .leaderboard-table .lb-row td {
    height: 52px;
    padding: 0 12px;
  }

  .leaderboard-table .user-cell {
    padding: 6px 12px 6px 4px;
  }
}

.leaderboard-table .username {
  color: #f1f5f9;
  font-size: 15px;
  font-weight: 600;
}

.leaderboard-table .ref-val {
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
}

.leaderboard-table .prize-cell {
  align-items: flex-start;
  gap: 1px;
}



.leaderboard-table .prize-sol-inline {
  gap: 5px;
  font-size: 12px;
}

.leaderboard-table .prize-sol-inline .prize-sol-token {
  width: 13px;
  height: 13px;
}

.leaderboard-table .prize-usd-sub {
  padding-left: 0;
  font-size: 10px;
}

/* Prize rows: SOL leads with its icon; USD is smaller beneath and never green. */
.leaderboard-table .prize-sol-inline,
.leaderboard-table .prize-sol-inline [data-sol-amount] {
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 700;
}

.leaderboard-table .prize-usd-sub {
  padding-left: 0;
  color: #64748b !important;
  font-size: 10px;
  font-weight: 500;
}



.podium-prize-card .podium-prize-usd {
  color: #94a3b8 !important;
  font-size: 10px;
}

.podium-prize-card .podium-prize-sol {
  color: var(--accent) !important;
  font-size: 12px;
}

/* Final winner: every leaderboard SOL amount is green. */


/* Final rule: every leaderboard spot's SOL amount is green. */


/* Every leaderboard spot uses green for SOL; USD remains muted below it. */


.podium-prize-card .prize-approx {
  color: #94a3b8 !important;
}

/* Make prize values easier to read, with green reserved for ranks 1–6. */
.leaderboard-table .prize-sol-inline,
.leaderboard-table .prize-sol-inline .prize-approx,
.leaderboard-table .prize-sol-inline [data-sol-amount] {
  color: #ffffff !important;
}

.leaderboard-table .prize-usd-sub {
  color: #8b98ac !important;
}

.leaderboard-table .prize-usd-sub {
  font-size: 15px;
  font-weight: 700;
}

.leaderboard-table .prize-sol-inline {
  font-size: 14px;
}

.leaderboard-table .prize-sol-inline .prize-sol-token {
  width: 18px;
  height: 18px;
}





/* Final winner: every leaderboard SOL amount is green. */


/* Keep every live conversion label visually identical to its USD amount. */
.podium-prize-usd,
.podium-prize-sol,
.podium-prize-card-1st .podium-prize-sol {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.podium-prize-conversion .prize-approx {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.podium-prize-card .podium-prize-usd,
.podium-prize-card .podium-prize-sol,
.podium-prize-card .prize-approx {
  color: var(--accent) !important;
  font-size: 12px;
}

.podium-prize-card .podium-prize-usd,
.podium-prize-card .prize-approx {
  color: #94a3b8 !important;
  font-size: 10px;
}

.podium-prize-card .podium-prize-sol {
  color: var(--accent) !important;
  font-size: 12px;
}

@media (min-width: 769px) {
  .podium-prize-card .podium-prize-usd,
  .podium-prize-card .podium-prize-sol,
  .podium-prize-card .prize-approx {
    font-size: 18px;
  }

  .podium-prize-card .podium-prize-usd,
  .podium-prize-card .prize-approx {
    font-size: 16px;
  }

  .podium-prize-card .podium-prize-sol {
    font-size: 18px;
  }
}

/* Match row SOL amounts to the podium scale and keep podium SOL text white. */
.leaderboard-table .prize-sol-inline,
.leaderboard-table .prize-sol-inline [data-sol-amount],
.podium-prize-card .podium-prize-sol {
  color: #ffffff !important;
  font-size: 18px !important;
}

@media (max-width: 768px) {
  .leaderboard-table .prize-sol-inline,
  .leaderboard-table .prize-sol-inline [data-sol-amount],
  .podium-prize-card .podium-prize-sol {
    font-size: 12px !important;
  }

  .leaderboard-table .prize-usd-sub,
  .podium-prize-card .podium-prize-usd {
    font-size: 10px !important;
  }
}

/* Keep empty final-page slots clear while matching a populated row's layout. */
.leaderboard-table .lb-padding-row {
  visibility: hidden;
}

.leaderboard-table .lb-padding-row > td,
.leaderboard-table .lb-padding-row:hover > td {
  background: transparent !important;
}

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


/* Dashboard Premium Card Overrides */
.premium-card {
  background: #141920 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  width: auto;
  min-width: 250px;
  flex: 1;
}

.premium-card:hover {
  border: none !important;
  box-shadow: none !important;
}

.card-bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 85% 50%, rgba(52, 211, 153, 0.15) 0%, transparent 60%);
}

.hex-pattern-overlay {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 45%;
  background-image: url('data:image/svg+xml;utf8,<svg width="40" height="69.282" xmlns="http://www.w3.org/2000/svg"><polygon points="30.39,11.32 30.39,23.32 20.00,29.32 9.61,23.32 9.61,11.32 20.00,5.32" fill="none" stroke="rgba(52,211,153,0.3)" stroke-width="1.5"/><polygon points="10.39,45.96 10.39,57.96 0.00,63.96 -10.39,57.96 -10.39,45.96 -0.00,39.96" fill="none" stroke="rgba(52,211,153,0.3)" stroke-width="1.5"/><polygon points="50.39,45.96 50.39,57.96 40.00,63.96 29.61,57.96 29.61,45.96 40.00,39.96" fill="none" stroke="rgba(52,211,153,0.3)" stroke-width="1.5"/></svg>');
  background-size: 24px 41.569px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 60%);
  mask-image: linear-gradient(to right, transparent, black 60%);
  opacity: 0.8;
}

.floating-coin-bg {
  position: absolute;
  top: 50%;
  right: -20px;
  width: 250px;
  height: auto;
  transform: translateY(-50%);
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

.premium-inner {
  position: relative !important;
  z-index: 1 !important;
  padding: 24px 28px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: transparent !important;
}

.premium-content-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.premium-label {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 700 !important;
  color: #a7f3d0 !important;
  font-size: 14px !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
  text-transform: none !important;
}

.premium-value {
  font-family: 'Work Sans', sans-serif !important;
  font-size: 28px !important;
  font-weight: 900 !important;
  color: white !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
  margin: 0 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.premium-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-btn {
  background: var(--accent) !important;
  color: #0f1319 !important;
  border: none !important;
  font-weight: 800 !important;
  padding: 10px 24px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  height: auto !important;
  line-height: normal !important;
}

.premium-btn:hover {
  background: var(--accent-light) !important;
  transform: translateY(-2px) !important;
}

#ref-link-display.premium-value {
  font-size: 18px !important;
}

.ref-prefix {
  opacity: 0.5;
  font-weight: 600;
}

/* ============================================
   VANITY INVITE LINKS — staff-only panel
   ============================================ */
.vanity-panel {
  width: 100%;
  max-width: 560px;
  margin: 20px auto 8px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.vanity-panel[hidden] {
  display: none;
}

.vanity-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.vanity-hint {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
}

.vanity-form {
  display: flex;
  gap: 8px;
}

.vanity-form .reg-input {
  flex: 1 1 0;
  min-width: 0;
}

.vanity-save {
  flex: 0 0 auto;
  padding: 0 20px;
  border-radius: 8px;
  text-transform: none;
}

.vanity-save:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vanity-status {
  min-height: 18px;
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.vanity-status.is-error {
  color: #f87171;
}

.vanity-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vanity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-referrals);
  font-size: 13px;
}

.vanity-link {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-light);
}

.vanity-user {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.vanity-edit {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

.vanity-edit:hover {
  background: var(--surface-gray);
}

.vanity-empty {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .vanity-form {
    flex-direction: column;
  }

  .vanity-save {
    min-height: 44px;
  }
}

/* Staff user lookup (inside .vanity-panel) */
.vanity-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-row);
}

.vanity-form input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1);
}

.vanity-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vanity-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--surface-referrals);
  font-size: 13px;
}

.vanity-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}

.vanity-result-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 14px;
}

.vanity-chip {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.vanity-chip.is-verified {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent);
}

.vanity-chip.is-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.vanity-result-row {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.vanity-result-key {
  flex: 0 0 92px;
  color: var(--text-muted);
  opacity: 0.75;
}

.vanity-result-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.vanity-result .vanity-edit {
  align-self: flex-start;
  margin-top: 6px;
}

/* Staff lookup ticket details: Discord state, referral reasons */
.vanity-result-row {
  align-items: baseline;
}

.vanity-result-value {
  line-height: 1.7;
}

.vanity-result-head .vanity-match {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.7;
}

.vanity-chip.is-bad {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.vanity-chip.is-muted {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.vanity-result-value > .vanity-chip,
.vanity-result-value > .vanity-mini {
  margin-left: 6px;
}

.vanity-result-value > :first-child {
  margin-left: 0;
}

.vanity-mini {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  vertical-align: 1px;
  white-space: nowrap;
  cursor: pointer;
}

.vanity-mini:hover {
  background: var(--surface-gray);
}

.vanity-mini:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vanity-name {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-light);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(167, 243, 208, 0.35);
  text-underline-offset: 2px;
  cursor: pointer;
}

.vanity-name:hover {
  text-decoration-color: currentColor;
}

.vanity-refs {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vanity-refs[hidden] {
  display: none;
}

.vanity-refs-title {
  margin: 12px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.vanity-refs > .vanity-refs-title:first-child {
  margin-top: 0;
}

.vanity-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vanity-ref {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  min-width: 0;
}

.vanity-ref + .vanity-ref {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.vanity-ref-who {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vanity-ref-sub {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

.vanity-ref-sub.is-alt {
  color: #f87171;
  opacity: 1;
}

.vanity-ref-when {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.vanity-ref .vanity-chip {
  flex: 0 0 auto;
}

.vanity-refs-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.75;
}

.vanity-counted {
  margin-top: 12px;
}

.vanity-counted > summary {
  margin: 0;
  cursor: pointer;
}

.vanity-counted-names {
  margin: 6px 0 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
  color: var(--text-muted);
}

.vanity-results-label {
  margin: 8px 0 -2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .vanity-mini {
    padding: 0 10px;
    line-height: 24px;
  }

  .vanity-ref {
    flex-wrap: wrap;
    row-gap: 2px;
    padding: 4px 0;
  }
}
