/* =====================================================
   GLOBAL THEME
===================================================== */

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #666;
  --border: #d8d8d8;
  --surface: #f2f2f2;

  --gold: #b88a00;
  --gold-strong: #d4af37;

  /* BCPMM bucket background (subtle cornflower) */
  --bcpmm-bg: #eef4ff;

  --logo-width: 320px;
}

body.dark {
  --bg: #121212;
  --fg: #f4f4f4;
  --muted: #aaa;
  --border: #2a2a2a;
  --surface: #1f1f1f;

  /* Dark-mode cornflower surface */
  --bcpmm-bg: rgba(110, 160, 255, 0.16);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Kefa", "Alegreya", serif;
  transition: background 0.25s ease, color 0.25s ease;
}

/* =====================================================
   TYPOGRAPHY
===================================================== */

h1 {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
}

h2 {
  margin-top: 2.5rem;
  font-size: 1.8rem;
}

a {
  color: #2a5db0;
  text-decoration: underline;
}

a:hover {
  opacity: 0.85;
}

/* =====================================================
   GLOBAL MENU
===================================================== */

.menu-button {
  position: fixed;
  top: 20px;
  right: 22px;
  font-size: 56px;
  cursor: pointer;
  z-index: 1001;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.menu-overlay.active {
  display: block;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  color: var(--fg);
  padding: 22px 18px;
  transform: translateX(100%);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
  z-index: 1002;
}

.menu-panel.open {
  transform: translateX(0);
}

.menu-item {
  margin-top: 40px;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
}

.menu-item:hover {
  opacity: 0.85;
}

/* =====================================================
   TABLES (LEAGUE + PLAYER)
===================================================== */

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

th, td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 700;
}

td.num,
th.num {
  text-align: right;
}

td.rank,
th.rank {
  width: 3rem;
  text-align: right;
}

/* =====================================================
   LADDER POLISH
===================================================== */

.ladder tbody tr:hover {
  background: var(--surface);
}

.ladder td a {
  font-weight: 600;
}

/* Solid gold when ONLY BCPMM is shown */
body.bcpmm-only .ladder td.num {
  color: var(--gold);
  font-weight: 700;
}

/* =====================================================
   PAGER
===================================================== */

#ladder-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-weight: 600;
}

#ladder-pager button {
  background: transparent;
  border: 1px solid var(--muted);
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  color: inherit;
}

#ladder-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* =====================================================
   CLAIM LINK
===================================================== */

.claim-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}

/* =====================================================
   POINTS BREAKDOWN
===================================================== */

.points-category summary {
  cursor: pointer;
  font-weight: 600;
  margin: 0.9rem 0;
  list-style: none;
}

.points-category summary::-webkit-details-marker {
  display: none;
}

.points-category summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.2s ease;
}

.points-category[open] summary::before {
  transform: rotate(90deg);
}

.gold {
  color: var(--gold);
  font-weight: 700;
}

.points-sub {
  padding-left: 1.2rem;
  margin-bottom: 0.75rem;
}

.points-event {
  margin-bottom: 0.65rem;
}

.event-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.event-line {
  font-size: 0.95rem;
}

.multiplier {
  color: #c40000;
  font-weight: 700;
}

.bonus {
  font-size: 0.85rem;
  color: var(--muted);
}

/* The “Total … Points” bar */
.race-total {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 1.05rem;
}

/* =====================================================
   PLAYER PAGE: BCPMM HEADER + BUCKET BACKGROUND
===================================================== */

.bcpmm-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.bcpmm-logo {
  width: 54px;
  height: auto;
  opacity: 0.95;
}

.bcpmm-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

/* Subtle cornflower panel only for BCPMM bucket */
.points-category.bcpmm-bucket {
  background: var(--bcpmm-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

/* Small trophy next to Top 8 bonus lines */
.mini-trophy {
  font-size: 0.9rem;
}

/* =====================================================
   CHAMPIONSHIP (SOLID GOLD – NO PULSE)
===================================================== */

.glimmer {
  font-weight: 700;
  color: var(--gold-strong);
}

/* =====================================================
   INLINE VERIFIED PROFILE (LEAN VERSION)
===================================================== */

.public-profile-inline {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.profile-inline-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.public-avatar-small {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}

.profile-alias-sub {
  font-size: 1rem;
  font-weight: 600;
}

.profile-verified-inline {
  font-size: 0.85rem;
  color: #2e7d32;
  font-weight: 600;
}

.profile-quote-inline {
  margin-top: 0.5rem;
  font-style: italic;
  opacity: 0.85;
}

.profile-store-inline {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  opacity: 0.8;
}