/* ============================================================
   Market League — Design System
   Dark theme, violet accent, matches the provided reference UI
   ============================================================ */

:root {
  --bg: #000000;
  --bg-elevated: #0c0c10;
  --bg-card: #0a0a0d;
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);

  --purple-400: #8b7dff;
  --purple-500: #6d5dfb;
  --purple-600: #5747e0;
  --purple-900: #241f5c;
  --purple-gradient: linear-gradient(150deg, #4c3fae 0%, #6a59f5 55%, #7a68ff 100%);

  --text-primary: #f5f5f7;
  --text-secondary: #9a9aa6;
  --text-tertiary: #66666f;

  --green: #22c55e;
  --gold: #f2b53c;
  --silver: #c7c9d1;
  --bronze: #e08a4f;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

img { max-width: 100%; display: block; }

::selection { background: var(--purple-500); color: #fff; }

:focus-visible {
  outline: 2px solid var(--purple-400);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0d;
}

.nav-brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-cta {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--purple-500);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: #111114;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: #17171b; }

.btn-block { width: 100%; }

/* ---------- Badge / pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 22px 0 20px;
}

.hero p.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Prize pool card (hero) ---------- */
.pool-card {
  background: var(--purple-gradient);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -25px rgba(90, 70, 220, 0.55);
}

.pool-card-top {
  padding: 26px 26px 22px;
}

.pool-label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pool-amount {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
}

.pool-amount .trophy { font-size: 30px; line-height: 1; }
.pool-amount .num { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; }

.pool-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.pool-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 20px 0;
}

.pool-stats {
  display: flex;
  gap: 40px;
}

.pool-stats .stat-num { font-size: 22px; font-weight: 800; }
.pool-stats .stat-label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.pool-card-bottom {
  background: rgba(0, 0, 0, 0.22);
  padding: 20px 26px 24px;
}

.countdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.countdown .cell {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}

.countdown .cell.emph { background: rgba(0, 0, 0, 0.55); }

.countdown .n { font-size: 20px; font-weight: 800; }
.countdown .u {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ---------- Section headings ---------- */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border-soft);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 12px 28px -22px rgba(0, 0, 0, 0.7);
}

/* ---------- Prize list (prizes page) ---------- */
.prize-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Used for the 3-up "How it works" cards on the homepage. Kept separate
   from the 2-up prize-layout columns above so responsive rules for each
   never fight one another. */
.prize-layout.three-col { grid-template-columns: repeat(3, 1fr); }

.prize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-soft);
}

.prize-row:last-child { border-bottom: none; }

.prize-row-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.prize-row-left .medal { font-size: 26px; flex-shrink: 0; }

.prize-row-left .place {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.prize-row-left .detail { font-size: 14px; color: var(--text-secondary); }
.prize-row-left .detail b { color: var(--text-primary); font-weight: 600; }

.prize-row-right { text-align: right; }
.prize-row-right .amt { font-size: 22px; font-weight: 800; }
.prize-row-right .sub { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; }

.tier-head {
  padding: 20px 24px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.tier-row:last-child { border-bottom: none; }

.tier-range { color: var(--text-secondary); width: 68px; flex-shrink: 0; }

.tier-mid { flex: 1; }
.tier-mid b { font-weight: 600; }

.tier-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(242, 181, 60, 0.12);
  border: 1px solid rgba(242, 181, 60, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
  margin-right: 8px;
  letter-spacing: 0.03em;
}

.tier-count {
  background: rgba(109, 93, 251, 0.15);
  color: var(--purple-400);
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 6px;
}

.tier-total {
  display: flex;
  justify-content: space-between;
  padding: 18px 24px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.tier-total b { color: var(--text-primary); font-size: 16px; }

/* ---------- Leaderboard ---------- */
.lb-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  gap: 24px;
  align-items: start;
}

.leader-card { padding: 24px; }

.leader-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-500);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

.leader-meta { font-size: 12.5px; color: var(--text-tertiary); text-align: right; }

.leader-id { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.leader-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: #17171c; border: 1px solid var(--border);
  color: var(--text-secondary); overflow: hidden; flex-shrink: 0;
}
.leader-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.leader-id .name { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.leader-equity-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-tertiary); margin-bottom: 6px;
}
.leader-equity-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.leader-equity { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }

.chip {
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 7px;
}
.chip.pos { background: rgba(34, 197, 94, 0.14); color: var(--green); }
.chip.neg { background: rgba(239, 68, 68, 0.14); color: #ef4444; }

.lb-table-card { overflow: hidden; }

.lb-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}

.lb-table-head .h-left { font-weight: 700; }
.lb-table-head .h-right { color: var(--text-tertiary); }

.lb-row {
  display: grid;
  grid-template-columns: 32px 30px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  transition: background 0.12s ease;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255, 255, 255, 0.02); }

.lb-rank { color: var(--text-tertiary); font-weight: 600; text-align: center; }
.lb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #17171c; border: 1px solid var(--border);
  color: var(--text-secondary); overflow: hidden; flex-shrink: 0;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.lb-name { font-weight: 600; min-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-equity { text-align: right; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; white-space: nowrap; }
.lb-pct.pos { color: var(--green); }
.lb-pct.neg { color: #ef4444; }

.lb-empty {
  padding: 40px 22px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ---------- Sponsors ---------- */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.sponsor-card {
  padding: 26px 20px;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.sponsor-card:hover {
  border-color: var(--purple-500);
  transform: translateY(-2px);
}

.sponsor-logo {
  width: 100%;
  height: 56px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: grayscale(0.15);
}

.sponsor-logo-fallback {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--purple-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.sponsor-name { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.sponsor-tagline { font-size: 12.5px; color: var(--text-tertiary); }

.sponsor-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 22px 26px;
}
.sponsor-strip img { height: 30px; object-fit: contain; filter: grayscale(0.2); }
.sponsor-strip .sponsor-name-inline { font-weight: 700; font-size: 14px; }

/* ---------- Admin: image upload ---------- */
.upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.upload-preview {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); background: #0f0f13; flex-shrink: 0;
}
.upload-preview.empty { display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 10px; }
.upload-status { font-size: 12px; color: var(--text-tertiary); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text-secondary); }

/* ---------- Register page ---------- */
.register-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}
.register-info { padding-bottom: 6px; }
.register-info .prose li { font-size: 14px; }

/* ---------- Rules page ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: 22px; margin: 34px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }
.prose ul { padding-left: 20px; list-style: disc; margin: 10px 0; }

/* ---------- Admin ---------- */
.admin-shell { padding: 40px 0 80px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 26px; margin: 0; }

.login-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 100%; max-width: 360px; padding: 32px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card p { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  background: #0f0f13;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
}
.field input:focus, .field select:focus { border-color: var(--purple-500); }

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: none;
}
.form-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: none;
}

.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.admin-panel { padding: 22px; }
.admin-panel h3 { font-size: 15px; margin: 0 0 16px; }

.admin-table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th {
  text-align: left; color: var(--text-tertiary); font-weight: 600;
  font-size: 11.5px; letter-spacing: 0.03em; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
table.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.admin-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden;
  background: #17171c; border: 1px solid var(--border); color: var(--text-secondary);
  vertical-align: middle; margin-right: 8px; flex-shrink: 0;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-avatar svg { width: 60%; height: 60%; }
table.admin-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 8px; }
.icon-btn {
  background: #131317; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 7px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--purple-500); }
.icon-btn.danger:hover { color: #f87171; border-color: #f87171; }
.pnl-input {
  width: 90px; background: #0f0f13; border: 1px solid var(--border);
  border-radius: 7px; color: #fff; padding: 7px 8px; font-size: 13px;
  font-family: var(--font); flex-shrink: 0;
}
.pnl-input:focus { border-color: var(--purple-500); }

.tag-select { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag-select button {
  background: #111114; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; font-weight: 600;
}
.tag-select button.active { background: var(--purple-500); color: #fff; border-color: var(--purple-500); }

/* Dynamic prize-tier / funded-tier rows in the admin form. Wraps instead
   of overflowing on narrow panels or phones. */
.tier-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.tier-input-row input[type="text"],
.tier-input-row input[type="number"] {
  flex: 1 1 90px;
  min-width: 0;
}
.tier-input-row .ft-narrow { flex: 0 1 64px; min-width: 56px; }
.tier-input-row .ft-account { flex: 1 1 110px; }
.tier-input-row .ft-lottery-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-secondary); white-space: nowrap;
  flex-shrink: 0;
}
.tier-input-row .ft-lottery-label input[type="checkbox"] { width: auto; flex: none; }
.tier-input-row .icon-btn { flex-shrink: 0; }

/* Registration open/closed switch on the competition form */
.reg-toggle-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  background: #0f0f13;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  margin: 0 !important;
}
.reg-toggle-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 999px;
  background: #26262d;
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}
.reg-toggle-label input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9a9aa6;
  transition: transform 0.15s ease, background 0.15s ease;
}
.reg-toggle-label input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}
.reg-toggle-label input[type="checkbox"]:checked::before {
  transform: translateX(16px);
  background: #06210f;
}
.reg-toggle-label span { display: flex; flex-direction: column; gap: 3px; }
.reg-toggle-label strong { font-size: 13.5px; color: var(--text-primary); font-weight: 700; }
.reg-toggle-label small { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; font-weight: 400; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .prize-layout, .lb-layout, .admin-grid, .register-layout { grid-template-columns: 1fr; }
  .prize-layout.three-col { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 40px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .sponsor-grid { grid-template-columns: repeat(2, 1fr); }
}

.nav-links.open {
  display: flex;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: #000;
  border-bottom: 1px solid var(--border-soft);
  flex-direction: column;
  padding: 16px 24px;
  gap: 4px;
  box-shadow: 0 16px 32px -20px rgba(0, 0, 0, 0.6);
}

.nav-links.open a {
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 15px;
}
.nav-links.open a:last-child { border-bottom: none; }

@media (max-width: 480px) {
  /* On very narrow phones, drop the duplicate CTA button next to the
     hamburger — the same destination is always available as the first
     link in the menu — so the header never crowds or clips. */
  .nav-cta { display: none; }
}

@media (max-width: 560px) {
  .hero { padding: 50px 0 40px; }
  .hero h1 { font-size: 32px; }
  .pool-amount .num { font-size: 32px; }
  .section-head h2 { font-size: 26px; }
  .sponsor-grid { grid-template-columns: 1fr 1fr; }
  .prize-layout.three-col { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .container { padding: 0 18px; }

  /* Comfortable touch targets and less-cramped spacing on phones */
  .btn { padding: 13px 18px; font-size: 14px; }
  .icon-btn { padding: 9px 12px; font-size: 12.5px; min-height: 38px; }
  .row-actions { gap: 6px; flex-wrap: wrap; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .admin-panel { padding: 18px; }
  .login-card { padding: 26px 22px; }
  .prize-row, .tier-row { padding: 16px 18px; }
  .prize-row-right { text-align: left; }
  .lb-table-head { padding: 14px 16px; }
  table.admin-table th, table.admin-table td { padding: 10px 12px; }

  /* Leaderboard rows: keep every column visible, just tighten spacing
     and let equity/return stack neatly instead of disappearing. */
  .lb-row {
    grid-template-columns: 22px 26px 1fr auto;
    grid-template-areas:
      "rank avatar name name"
      "rank avatar equity pct";
    row-gap: 4px;
    column-gap: 10px;
    padding: 12px 16px;
  }
  .lb-rank { grid-area: rank; }
  .lb-avatar { grid-area: avatar; width: 26px; height: 26px; }
  .lb-name { grid-area: name; }
  .lb-equity { grid-area: equity; text-align: left; font-size: 12.5px; }
  .lb-pct { grid-area: pct; min-width: 0; font-size: 13px; }
}
