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

/* ── THEME TOKENS ── */
[data-theme="dark"] {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #222536;
  --border:    rgba(255,255,255,0.08);
  --border-hi: rgba(255,255,255,0.14);
  --text:      #f1f5f9;
  --sub:       #94a3b8;
  --dim:       #64748b;
  --accent:    #84cc16;
  --a2:        #6366f1;
  --gold:      #84cc16;
  --pos:       #34d399;
  --neg:       #f87171;
  --silver:    #94a3b8;
  --bronze:    #b87333;
  --you-clr:   #34d399;
  --you-bg:    rgba(52,211,153,0.05);
  --nav-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
[data-theme="light"] {
  --bg:        #f4f6fa;
  --surface:   #ffffff;
  --surface2:  #f0f2f8;
  --border:    rgba(0,0,0,0.08);
  --border-hi: rgba(0,0,0,0.14);
  --text:      #111827;
  --sub:       #6b7280;
  --dim:       #9ca3af;
  --accent:    #65a30d;
  --a2:        #4f46e5;
  --gold:      #65a30d;
  --pos:       #059669;
  --neg:       #dc2626;
  --silver:    #64748b;
  --bronze:    #92400e;
  --you-clr:   #059669;
  --you-bg:    rgba(5,150,105,0.05);
  --nav-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}

/* ── TOP BAR ── */
.topbar {
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: stretch; padding: 0 28px;
}
.wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900; font-size: 24px; letter-spacing: -0.5px;
  color: #fff; white-space: nowrap;
  display: flex; align-items: center;
  padding: 14px 0; margin-right: 36px;
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark em { color: var(--accent); font-style: normal; }

/* ── LOGO IMAGE (531×133 px source) ── */
.sa-logo-img {
  display: block;
  background: url('/assets/images/logo-dark.png') center / contain no-repeat;
}
[data-theme="light"] .sa-logo-img {
  background-image: url('/assets/images/logo-light.png');
}
/* Hero: large centred display */
.hero-title .sa-logo-img {
  max-width: 840px; width: 92%; margin: 0 auto;
  aspect-ratio: 531 / 133;
}
/* Nav topbar: compact — 36px tall → ~144px wide */
.wordmark .sa-logo-img {
  height: 36px; width: calc(36px * 531 / 133);
}
/* Login card */
.login-logo .sa-logo-img {
  max-width: 260px; width: 100%; margin: 0 auto;
  aspect-ratio: 531 / 133;
}

/* ── SPORT LOGO BALL DECORATIONS ── */
.sa-ball { display: inline-block; line-height: 0; vertical-align: middle; }
.sa-ball svg { display: block; }
.sa-cricket { width: 0.78em; height: 0.78em; margin: 0 0.03em; }
.sa-soccer  { width: 0.56em; height: 0.56em; margin: 0 0.02em; }
/* Big A */
.sa-big-a {
  font-size: 1.22em; line-height: 0.8;
  display: inline-block; vertical-align: -0.05em;
}
/* Tennis-ball i tittle */
.sa-i-wrap { display: inline-block; position: relative; }
.sa-tennis-dot {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 100%; margin-bottom: -0.08em;
  display: block; width: 0.28em; height: 0.28em; line-height: 0;
}
.sa-tennis-dot svg { display: block; width: 100%; height: 100%; }
.sport-tabs { display: flex; align-items: stretch; flex: 1; overflow-x: auto; }
.stab {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  padding: 0 16px; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  display: flex; align-items: center;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.stab:hover { color: rgba(255,255,255,0.75); }
.stab.active { color: #fff; border-bottom-color: var(--accent); }
.topbar-right {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; padding-left: 20px; flex-shrink: 0;
}
.theme-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.4); background: transparent;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 99px;
  padding: 5px 13px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.3); }
.login-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent); background: rgba(132,204,22,0.1);
  border: 1px solid rgba(132,204,22,0.3); border-radius: 99px;
  padding: 5px 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px;
}
.login-btn:hover { background: rgba(132,204,22,0.18); border-color: rgba(132,204,22,0.5); }
.user-chip {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; gap: 7px;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #1a2e05;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.signout-btn {
  font-size: 10px; color: var(--dim); background: none;
  border: none; cursor: pointer; padding: 0;
  text-decoration: underline;
}
.signout-btn:hover { color: var(--sub); }

/* ── SPORT SUB-NAV ── */
.subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 52px; z-index: 90;
  box-shadow: var(--nav-shadow);
  transition: background .3s, border-color .3s;
}
.subnav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; padding: 0 28px; overflow-x: auto;
}
.ctab {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--sub); padding: 14px 20px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  text-decoration: none; display: flex; align-items: center; gap: 7px;
  transition: color .15s, border-color .15s;
}
.ctab:hover { color: var(--text); }
.ctab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ctab .badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
}
.ctab .badge.live { background: rgba(52,211,153,0.15); color: var(--pos); }
.ctab .badge.done { background: rgba(100,116,139,0.15); color: var(--dim); }

/* ── PAGE LAYOUT ── */
main { max-width: 1100px; margin: 0 auto; padding: 48px 28px 100px; }

/* ── PAGE HEADER ── */
.page-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 4px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.page-title {
  font-family: 'Bebas Neue', 'Syne', sans-serif;
  font-size: 64px; letter-spacing: 2px;
  color: var(--text); line-height: 1; margin-bottom: 12px;
}
.page-sub {
  font-size: 15px; color: var(--sub); margin-bottom: 48px;
  max-width: 520px; line-height: 1.6;
}

/* ── CONTEST CARDS ── */
.section-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}
.contest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  cursor: pointer;
}
.contest-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.contest-card.active-card {
  border-color: rgba(52,211,153,0.3);
}
.contest-card.active-card:hover { border-color: rgba(52,211,153,0.55); }
.contest-card.archived-card { opacity: 0.85; }
.contest-card.coming-card { opacity: 0.55; cursor: default; }
.contest-card.coming-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
.card-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.active-card .card-stripe { background: var(--pos); }
.archived-card .card-stripe { background: var(--dim); }
.coming-card .card-stripe { background: var(--border-hi); }
.card-sport {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 6px;
}
.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px; letter-spacing: 1px;
  color: var(--text); margin-bottom: 10px; line-height: 1.1;
}
.card-meta {
  font-size: 12px; color: var(--sub);
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px;
}
.card-meta .sep { color: var(--dim); }
.card-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px;
}
.card-status.live { background: rgba(52,211,153,0.1); color: var(--pos); border: 1px solid rgba(52,211,153,0.25); }
.card-status.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pos); animation: pulse 1.5s infinite; }
.card-status.done { background: rgba(100,116,139,0.1); color: var(--dim); border: 1px solid rgba(100,116,139,0.2); }
.card-status.soon { background: rgba(99,102,241,0.1); color: var(--a2); border: 1px solid rgba(99,102,241,0.2); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.card-footer {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--accent); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card-footer .arr { font-size: 16px; }
.coming-card .card-footer { color: var(--dim); }

/* ── COMING SOON FULL PAGE ── */
.coming-soon-full {
  padding: 100px 0; text-align: center;
}
.cs-icon { font-size: 52px; margin-bottom: 20px; }
.cs-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.cs-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px; letter-spacing: 2px;
  color: var(--text); margin-bottom: 14px;
}
.cs-body { font-size: 15px; color: var(--sub); max-width: 380px; margin: 0 auto; line-height: 1.65; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--dim); margin-bottom: 32px;
}
.breadcrumb a { color: var(--dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--sub); }
.breadcrumb .sep { color: var(--border-hi); }
.breadcrumb .current { color: var(--sub); }

/* ── TABLE CARD SYSTEM (shared with contest pages) ── */
.tbl-wrap {
  border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 44px; background: var(--bg); overflow: hidden;
}
[data-theme="light"] .tbl-wrap { background: #e8eaf2; }
.tbl-cap {
  padding: 11px 18px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--dim); background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; padding: 6px; background: transparent; }
thead tr { background: transparent; }
thead th {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--dim); padding: 4px 14px 10px;
  text-align: left; border: none; background: transparent;
}
thead th:not(:nth-child(1)):not(:nth-child(2)) { text-align: right; }
tbody tr { border: none; }
tbody td {
  background: var(--surface); border: none;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 11px 14px; font-size: 13px; color: var(--sub);
  vertical-align: middle; transition: background .12s;
}
tbody td:first-child { border-left: 1px solid var(--border); border-radius: 12px 0 0 12px; padding-left: 10px; }
tbody td:last-child { border-right: 1px solid var(--border); border-radius: 0 12px 12px 0; text-align: right; }
tbody tr:hover td { background: var(--surface2); }
tbody tr:nth-child(1) td { background: rgba(132,204,22,0.07); border-color: rgba(132,204,22,0.22); }
tbody tr:nth-child(1):hover td { background: rgba(132,204,22,0.12); }
tbody tr:nth-child(2) td { border-color: rgba(148,163,184,0.2); }
tbody tr:nth-child(3) td { border-color: rgba(184,115,51,0.2); }
tbody tr.you-row td { background: var(--you-bg); border-color: rgba(52,211,153,0.18); }
tbody tr.you-row:hover td { background: rgba(52,211,153,0.09); }

/* ── RANK CIRCLE ── */
.rc { display: flex; align-items: center; }
.av { display: none; }
.rn {
  font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: 0.5px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: var(--sub); flex-shrink: 0;
}
[data-theme="light"] .rn { background: rgba(0,0,0,0.07); }
tbody tr:nth-child(1) .rn { background: #84cc16; color: #1a2e05; }
tbody tr:nth-child(2) .rn { background: var(--silver); color: #0f1117; }
tbody tr:nth-child(3) .rn { background: var(--bronze); color: #fff; }

/* ── NAME & STAT CELLS ── */
.nm { font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 14px; color: var(--text); cursor: pointer; }
tbody tr:nth-child(1) .nm { color: var(--gold); font-weight: 600; }
.you-row .nm { color: var(--you-clr) !important; font-weight: 600; }
.you-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--you-clr); background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.35);
  padding: 2px 7px; border-radius: 4px; margin-left: 8px; vertical-align: middle;
}
.pos { color: var(--pos) !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.neg { color: var(--neg) !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.neu { color: var(--sub); font-weight: 400; font-variant-numeric: tabular-nums; }
.dsh { color: var(--dim); }
.acc-hi  { color: var(--pos) !important; font-weight: 600; }
.acc-mid { color: var(--sub); font-weight: 400; }
.acc-lo  { color: var(--neg) !important; font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .wordmark { font-size: 18px; margin-right: 16px; }
  .wordmark .sa-logo-img { height: 26px; width: calc(26px * 531 / 133); }
  .page-title { font-size: 44px; }
  main { padding: 32px 18px 80px; }
  .cards-grid { grid-template-columns: 1fr; }
}
