/* =====================
   Global Resets & Base
   ===================== */
* {
  margin: 0;
  padding: 0;
  font-size: 15px;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  flex-direction: column;
  margin: 0;
  font-family: "Inter", sans-serif;
  background-color: #121212;
  color: #f5f5f5;
}

/* WHY scrollbar-gutter: stable + overflow-y: auto: see
   dashboard_login/index.css's identical rule — same reasoning, keeps the
   right-aligned nav from shifting sideways between this page and others
   when only one of them scrolls (the overflow-y is required for the
   gutter property to do anything at all — see that file's comment). */
html {
  scrollbar-gutter: stable;
  overflow-y: auto;
}

/* Animated particle canvas */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Keep everything above the canvas */
.wrapper,
#progressBar {
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 20px;
}
section,
h1,
h2,
h3,
h4,
p {
  margin-bottom: 10px;
}

a {
  text-decoration: none;
  color: white;
}

a.active-tab {
  border-top: 3px solid #fcd34d;
  padding-top: 7px;
  color: #fcd34d;
  font-weight: bold;
}

a:not(.active-tab):hover {
  border-top: 3px solid #444;
  padding-top: 7px;
}

/* =====================
   Layout Wrappers
   ===================== */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.bodyContainer {
  flex: 1;
  display: flex;
  min-height: 100vh; /* dashboard */
}

/* =====================
   Header
   ===================== */
.header {
  display: flex;
  align-items: center;
}

.headerContainer {
  background-color: #1f1f1f;
  font-family: "Inter";
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.headerContainer1 {
  font-family: "Inter";
  font-size: 35px;
  font-weight: 900;
  flex-grow: 1;
  margin: 10px;
}

.headerContainer2 {
  display: flex;
  align-items: center;
}

.headerContainer2 ul {
  display: flex;
  align-items: center;
  gap: 20px;
}

.headerContainer2 li {
  justify-content: space-evenly;
  display: flex;
  list-style-type: none;
  margin: 0;
}

/* =====================
   Buttons
   ===================== */
button {
  background-color: #1f1f1f;
  color: white;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  font-family: "Inter";
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #fcd34d;
  color: black;
}

/* Balance button — matches the 404 page's bordered-pill treatment,
   set apart from the plain nav-tab look via #toggleBtn's higher
   specificity overriding the generic button rule above. */
#toggleBtn {
  background: #292929;
  color: #f5f5f5;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}

/* Matches #toggleBtn's button look — see dashboard_login/index.css's
   identical rule for the full reasoning. */
#depositNavItem a {
  background: #292929;
  color: #f5f5f5;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
}

.odds-button {
  background-color: #2e2e2e;
  border: 1px solid #fcd34d;
  padding: 5px 15px;
  font-family: "Inter";
  cursor: pointer;
  color: white;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.odds-button:hover {
  background-color: #fcd34d;
  color: black;
}

/* =====================
   Sidebar
   ===================== */
.sidebar {
  width: 200px;
  background: #292929;
  color: white;
  padding: 20px;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.3rem;
  color: #fcd34d;
  text-align: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 5px;
}

.sidebar li:hover {
  background: #555;
}

.sidebar li.active {
  background: #fcd34d;
  color: black;
}

/* =====================
   Footer
   ===================== */

footer {
  color: #888;
  background-color: #1f1f1f;
  font-weight: normal;
  font-size: 12px; /* change this one number to resize everything */
  text-align: center;
  padding: 30px 40px;
}

footer * {
  font-size: inherit; /* forces the year span to match */
}

/* =====================
   Balance & Blurred Text
   ===================== */
.balance {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 4px;
  color: #fcd34d;
}

.blurred {
  color: transparent;
  text-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
}

/* =====================
   Auth-gated nav items
   ===================== */
/* WHY hidden by default instead of JS hiding them reactively, and WHY
   !important: see dashboard_login/index.css's identical rule — same
   reasoning, same fix, applied here too since this page has the same
   guest-flash issue and the same .headerContainer2 li specificity
   conflict to override. */
.nav-auth-gated {
  display: none !important;
}

/* WHAT: the mirror image of .nav-auth-gated — hidden by default, JS
   reveals it only for guests (no valid token). See
   dashboard_login/index.css's identical rule for the full reasoning. */
.guest-only {
  display: none !important;
}

/* =====================
   Table: Leaderboard
   ===================== */

/* =====================
   Leaderboard Table - REDESIGN
   ===================== */
.content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 20px;
  background: transparent;
}

/* WHAT: feedback shown in .content while the real leaderboard fetch is in
   flight, and if it fails — previously .content just stayed blank the
   whole time, which made the wait feel worse than it was. Neither of
   these had any styling before. */
.leaderboard-loading,
.leaderboard-error {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-size: 16px;
}

.leaderboard-table {
  width: 95%;
  max-width: 1000px;
  border-collapse: collapse;
  margin-top: 20px;
  font-family: "Inter", sans-serif;
  background: #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
}

.leaderboard-table th {
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  color: #fcd34d;
  font-weight: 700;
  font-size: 14px;
  padding: 18px 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #fcd34d;
  text-align: center;
}

.leaderboard-table td {
  padding: 16px;
  text-align: center;
  color: #e0e0e0;
  font-weight: 500;
  border-bottom: 1px solid #2a2a2a;
  transition: all 0.3s ease;
}

.leaderboard-table tbody tr {
  transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
  background: rgba(252, 211, 77, 0.1);
  transform: translateY(-2px);
}

.leaderboard-table tbody tr:hover td {
  color: #ffffff;
}

/* Rank column styling */
.leaderboard-table td:first-child {
  font-weight: 800;
  font-size: 16px;
  width: 80px;
  color: #fcd34d;
}

/* Player name column */
.leaderboard-table td:nth-child(2) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-weight: 600;
  color: #ffffff;
}

/* Profit column - make it stand out */
.leaderboard-table td:nth-child(5) {
  font-weight: 700;
  font-size: 15px;
  color: #10b981; /* Green for positive profits */
}

/* =====================
   Top 3 Ranks - EPIC STYLING
   ===================== */

/* GOLD - 1st Place */
.leaderboard-table tr.rank-1 {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.15) 0%,
    rgba(252, 211, 77, 0.25) 100%
  );
  border-left: 4px solid #fcd34d;
}

.leaderboard-table tr.rank-1 td {
  color: #fcd34d;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(252, 211, 77, 0.3);
}

.leaderboard-table tr.rank-1 td:first-child {
  color: #fcd34d;
  font-size: 18px;
}

/* SILVER - 2nd Place */
.leaderboard-table tr.rank-2 {
  background: linear-gradient(
    135deg,
    rgba(192, 192, 192, 0.1) 0%,
    rgba(230, 230, 230, 0.2) 100%
  );
  border-left: 4px solid #c0c0c0;
}

.leaderboard-table tr.rank-2 td {
  color: #e0e0e0;
  font-weight: 700;
}

.leaderboard-table tr.rank-2 td:first-child {
  color: #c0c0c0;
}

/* BRONZE - 3rd Place */
.leaderboard-table tr.rank-3 {
  background: linear-gradient(
    135deg,
    rgba(205, 127, 50, 0.1) 0%,
    rgba(205, 127, 50, 0.2) 100%
  );
  border-left: 4px solid #cd7f32;
}

.leaderboard-table tr.rank-3 td {
  color: #cd7f32;
  font-weight: 700;
}

.leaderboard-table tr.rank-3 td:first-child {
  color: #cd7f32;
}

/* =====================
   Medal Animations
   ===================== */
@keyframes goldGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(252, 211, 77, 0.3);
  }
  50% {
    box-shadow:
      0 0 30px rgba(252, 211, 77, 0.6),
      0 0 40px rgba(252, 211, 77, 0.3);
  }
}

@keyframes silverGlow {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
  }
  50% {
    box-shadow:
      0 0 25px rgba(192, 192, 192, 0.4),
      0 0 35px rgba(192, 192, 192, 0.2);
  }
}

@keyframes bronzeGlow {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
  }
  50% {
    box-shadow:
      0 0 25px rgba(205, 127, 50, 0.4),
      0 0 35px rgba(205, 127, 50, 0.2);
  }
}

.leaderboard-table tr.rank-1 {
  animation: goldGlow 3s infinite;
}

.leaderboard-table tr.rank-2 {
  animation: silverGlow 3s infinite;
}

.leaderboard-table tr.rank-3 {
  animation: bronzeGlow 3s infinite;
}

/* =====================
   Striped Rows for Readability
   ===================== */
.leaderboard-table
  tbody
  tr:nth-child(even):not(.rank-1):not(.rank-2):not(.rank-3) {
  background: rgba(40, 40, 40, 0.5);
}

.leaderboard-table
  tbody
  tr:nth-child(odd):not(.rank-1):not(.rank-2):not(.rank-3) {
  background: rgba(30, 30, 30, 0.5);
}

/* =====================
   Mobile Responsive
   ===================== */
/* WHY the extra (max-height: 500px) and (orientation: landscape) clause
   on both mobile media queries in this file, not just max-width alone: a
   phone that's comfortably under 768px wide in portrait is typically
   740-915px wide in LANDSCAPE — over the threshold, so these blocks used
   to get skipped entirely on a real phone turned sideways, silently
   falling back to the desktop layout. Confirmed via My Bets
   (activeBets), where that exact fallback caused a real overflow bug —
   applied here proactively since the same gap exists on this page too,
   even though it hasn't visibly broken here (yet). Landscape phones are
   short, though, even when they're "wide" by this query's own standard —
   matching on a short height in landscape catches them anyway, on top of
   the original portrait width check. */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  .content {
    padding: 10px;
  }

  .leaderboard-table {
    width: 100%;
    font-size: 12px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 12px 8px;
  }

  .leaderboard-table td:first-child {
    width: 50px;
    font-size: 14px;
  }

  .leaderboard-table td:nth-child(2) {
    max-width: 120px;
  }
}

/* =====================
   Bet Slip & Progress Bar
   ===================== */

#progressBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background: linear-gradient(to right, #ffd700, #ff5a5f);
  z-index: 9999;
  transition: width 0.2s ease-out;
}

/* =====================
   Mobile / Responsive
   ===================== */
body,
html {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

section,
h1,
h2,
h3,
h4,
p {
  margin-bottom: 10px;
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  .headerContainer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .headerContainer2 ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    gap: 25px;
  }

  .headerContainer2 ul li {
    list-style: none;
    padding: 8px 12px;
  }

  .bodyContainer {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-right: none;
    padding: 10px;
  }

  .sidebar h2 {
    width: 100%;
    text-align: center;
  }

  .sidebar ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .sidebar ul li {
    margin: 8px;
    padding: 10px 16px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #1f1f1f;
    flex: 1 1 auto;
    min-width: 80px;
  }

  table {
    width: 100%;
    font-size: 12px;
    overflow-x: auto;
  }
}

/* Nov 16: logo alignment — the global "h1 { margin-bottom: 10px }" rule
   pushed "FairPlay" up, so the scales icon looked too low next to it. */
.websiteName h1 {
  margin: 0;
}

/* ── Top Referrers tab (Nov 24, referralBoard.js) ─────────────────────── */
/* Same width as the other leaderboard tables (max 1000px) and centered,
   so the pitch box and the table line up on wide screens too. */
.referral-board { width: 95%; max-width: 1000px; margin: 0 auto; }
.referral-board .leaderboard-table { width: 100%; margin-left: auto; margin-right: auto; }
.referral-board-title { color: #fcd34d; margin: 0 0 12px; font-size: 22px; }
.referral-board-subtitle { color: #fcd34d; margin: 28px 0 10px; font-size: 18px; }
.referral-board-contest {
  background: #1f1f1f; border: 1px solid #fcd34d; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 12px; color: #fff;
}
.referral-board-note { color: #9ca3af; font-size: 13px; margin: 6px 0 12px; line-height: 1.5; }
.referral-board-empty {
  background: #1f1f1f; border-radius: 10px; padding: 24px; text-align: center; color: #fff;
}
.referral-board-empty p:first-child { font-size: 18px; color: #fcd34d; margin: 0 0 6px; }
.referral-board-pitch {
  background: linear-gradient(135deg, #2a2410, #1f1f1f); border: 1px solid #3a3220;
  border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; color: #fff;
}
.referral-board-pitch-main { margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.5; }
.referral-board-pitch-shade { margin: 0 0 10px; color: #d1d5db; font-size: 14px; line-height: 1.5; font-style: italic; }
.referral-board-cta { color: #fcd34d; font-weight: 600; text-decoration: underline; }
