/* ============================================================
   FantaXC Surrey League — Main Stylesheet
   Flat, dense, athletic results-archive style
   ============================================================
   Key colours:
     --fantaxc-green : #00FF87  brand accent (used sparingly)
     --bg            : #efefef  page background
     --card-bg       : #ffffff  content areas
     --border        : #d8d8d8  section dividers
     --text          : #1a1a1a  body text
   ============================================================ */

/* ── CSS custom properties ──────────────────────────────────── */
:root {
  --fantaxc-green:       #00FF87;
  --fantaxc-green-hover: #00e07a;

  /* Legacy variable names kept so inline styles in HTML/JS still resolve */
  --green-dark:  #1a1a1a;
  --green-mid:   #444444;
  --green-light: #f0f0f0;
  --blue:        #1a72c7;
  --gold:        #e9c46a;
  --gold-dark:   #c9a227;
  --red:         #cc2222;
  --text:        #1a1a1a;
  --text-light:  #666666;
  --border:      #d8d8d8;
  --border-dark: #aaaaaa;
  --bg:          #ffffff;
  --card-bg:     #ffffff;
  --shadow:      none;
  --radius:      2px;
  --nav-height:  60px;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }   /* same page width whether or not it scrolls */

body {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 1.4rem;  font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.1rem;  font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; }
p  { margin-bottom: 0.5rem; }

/* ── Site header / navigation (built by navigation.js) ───────────
   Layout adapted from the shadcnblocks "Navbar12" block:
   brand left · links (with dropdown panels) · logos + Sign in right;
   below 768px a ☰ button opens a full-screen menu. */
.site-header {
  --nav-ink:   #3D195B;              /* FantaXC purple */
  --nav-hover: rgba(61, 25, 91, 0.10);
  background: var(--fantaxc-green);
  color: var(--nav-ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--fantaxc-green-hover);
  min-height: var(--nav-height);   /* holds the space until navigation.js fills it */
}

.nav-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--nav-height);
  /* Three columns with equal outer sides, so the links sit in the true centre */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}
.nav-bar > .nav-right { justify-self: end; }

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; }
.site-logo {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 1.55rem;
  color: var(--nav-ink);
  white-space: nowrap;
}
.header-tagline {
  display: flex;
  flex-direction: column;
  font-size: 0.6rem;
  line-height: 1.35;
  color: var(--nav-ink);
}

/* Links */
.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  list-style: none;
}
.nav-link,
.nav-trigger a {
  display: inline-flex;
  align-items: center;
  height: 1.875rem;
  padding: 0 0.7rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--nav-ink);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-link:hover,
.nav-trigger a:hover { background: var(--nav-hover); text-decoration: none; }
.nav-link.active,
.nav-trigger.active a { background: rgba(61, 25, 91, 0.14); }

/* Link with a dropdown: the text goes to the page, ▾ opens the panel */
.nav-item.has-menu { position: relative; }
.nav-trigger {
  display: inline-flex;
  align-items: center;
  padding: 0;
  height: auto;
}
.nav-trigger a { padding-right: 0.35rem; border-radius: 6px 0 0 6px; }
.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.875rem;
  width: 1.6rem;
  border: none;
  border-radius: 0 6px 6px 0;
  background: none;
  color: var(--nav-ink);
  cursor: pointer;
}
.nav-trigger.active .nav-menu-toggle { background: rgba(61, 25, 91, 0.14); }
.nav-menu-toggle:hover { background: var(--nav-hover); }
.nav-menu-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.has-menu:hover .nav-menu-toggle svg,
.has-menu.menu-open .nav-menu-toggle svg { transform: rotate(180deg); }

.nav-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 0.5rem;          /* hover bridge between link and panel */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 300;
}
.has-menu:hover .nav-menu-panel,
.has-menu:focus-within .nav-menu-panel,
.has-menu.menu-open .nav-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-menu-panel ul {
  list-style: none;
  min-width: 11rem;
  padding: 0.35rem 0.25rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* A season in the panel (and in the phone menu): year + In-play / Complete */
.nav-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  color: var(--nav-ink);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-sublink:hover { background: #f4f4f5; text-decoration: none; }
.nav-sublink.active { background: rgba(0, 255, 135, 0.18); }
.nav-sublink-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}
.nav-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}
.nav-status.live {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--fantaxc-green);
  color: #000;
}

/* Right-hand side: partner logos | Sign in */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.nav-partners {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.header-partner-logo {
  height: 30px;
  width: auto;
  display: block;
}
.nav-separator {
  width: 1px;
  height: 1.25rem;
  background: rgba(61, 25, 91, 0.25);
}

/* Header buttons */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.875rem;
  padding: 0 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { text-decoration: none; }
.nav-btn-primary { background: var(--nav-ink, #3D195B); color: #fff; }
.nav-btn-primary:hover { background: #2c1142; color: #fff; }
.nav-btn-outline {
  border: 1.5px solid var(--nav-ink, #3D195B);
  color: var(--nav-ink, #3D195B);
}
.nav-btn-outline:hover { background: var(--nav-hover); }
.nav-btn-block { display: flex; width: 100%; height: 2.75rem; font-size: 1rem; }

/* ☰ button and full-screen phone menu (hidden on wider screens) */
.nav-burger {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--nav-ink);
  cursor: pointer;
}
.nav-burger:hover { background: var(--nav-hover); }
.nav-burger svg { width: 22px; height: 22px; }

.site-header svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-sheet {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  background: var(--fantaxc-green);
  border-top: 1px solid var(--fantaxc-green-hover);
  animation: nav-fade-in 0.25s ease-out;
}
.nav-sheet[hidden] { display: none; }
@keyframes nav-fade-in { from { opacity: 0; } to { opacity: 1; } }

.nav-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem;
}
.nav-sheet-link,
.nav-acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 3.75rem;
  padding: 0;
  border: none;
  border-bottom: 1px solid rgba(61, 25, 91, 0.15);
  background: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nav-ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-sheet-link:hover { text-decoration: none; }
.nav-acc-trigger svg { width: 18px; height: 18px; transition: transform 0.2s; }
.nav-acc.open .nav-acc-trigger svg { transform: rotate(180deg); }
.nav-acc-content { display: none; padding: 0.4rem 0 0.75rem; border-bottom: 1px solid rgba(61, 25, 91, 0.15); }
.nav-acc.open .nav-acc-content { display: block; }
.nav-acc-content .nav-sublink { padding: 0.45rem 0.25rem; }
.nav-acc-content .nav-sublink:hover { background: rgba(255, 255, 255, 0.45); }
.nav-acc-content .nav-sublink.active { background: rgba(255, 255, 255, 0.6); }
.nav-acc-content .nav-status        { color: var(--nav-ink); opacity: 0.75; }
.nav-acc-content .nav-status.live   { background: var(--nav-ink); color: #fff; opacity: 1; }

.nav-sheet-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid rgba(61, 25, 91, 0.15);
}
.nav-sheet-footer .nav-partners { justify-content: center; }

@media (max-width: 768px) {
  .nav-bar                          { display: flex; justify-content: space-between; }
  .nav-desktop,
  .nav-right                        { display: none; }
  .nav-burger                       { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 480px) {
  .site-logo                        { font-size: 1.3rem; }
}

/* Budget pill in header */
.budget-pill {
  background: #000;
  color: var(--fantaxc-green);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  white-space: nowrap;
}
.budget-pill.over-budget {
  background: var(--red);
  color: #fff;
}

/* ── Page content wrapper ───────────────────────────────────── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* ── Hero section (home page) ───────────────────────────────── */
.hero {
  background: #111111;
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
}
.hero h1 {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.hero .subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}
.hero .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.1s, color 0.1s;
  text-align: center;
  border-radius: var(--radius);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: 0.85; }

.btn-primary {
  background: var(--fantaxc-green);
  color: #000;
  border-color: var(--fantaxc-green-hover);
}
.btn-primary:hover { background: var(--fantaxc-green-hover); }

.btn-secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-green {
  background: var(--fantaxc-green);
  color: #000;
  border-color: var(--fantaxc-green-hover);
}
.btn-green:hover { background: var(--fantaxc-green-hover); }

.toggle-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-dark);
}
.toggle-btn:hover { background: #f0f0f0; }
.toggle-btn.active {
  background: var(--fantaxc-green);
  color: #000;
  border-color: var(--fantaxc-green-hover);
}
.toggle-btn.active:hover { background: var(--fantaxc-green-hover); }

.btn-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: #aa1111;
}
.btn-danger:hover { background: #aa1111; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-grid .card {
  margin-bottom: 0;
}

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--card-bg);
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 0.6rem 1rem;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  line-height: 1;
}
.stat-value.warning { color: #cc5500; }
.stat-value.danger  { color: var(--red); }

.stat-label {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* ── Filter / search controls ───────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.filter-group label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
select {
  font-size: 0.82rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: #555;
  outline: 1px solid #555;
}

/* ── Athlete table ──────────────────────────────────────────── */
.athlete-table-wrapper {
  overflow-x: auto;
}

.athlete-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  font-size: 13px;
}

.athlete-table th {
  background: transparent;
  color: #000;
  padding: 0.45rem 0.65rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid var(--border-dark);
  border-right: 1px solid transparent;
}
.athlete-table th:last-child { border-right: none; }
.athlete-table th:hover { background: #f0f0f0; }
.athlete-table th[data-sort] { cursor: pointer; }
.athlete-table th.sorted-asc::after   { content: " ▲"; font-size: 9px; }
.athlete-table th.sorted-desc::after  { content: " ▼"; font-size: 9px; }
.athlete-table th.col-has-filter      { background: #ddf0e8; }

/* ── Info icon with tooltip ─────────────────────────────────────── */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: var(--green-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 0.3rem;
  flex-shrink: 0;
  line-height: 1;
}
.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 400;
  white-space: normal;
  width: 260px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.info-icon:hover::after { opacity: 1; }

/* ── Column sort/filter dropdown ────────────────────────────────── */
.col-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border-dark);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  min-width: 170px;
  max-width: calc(100vw - 16px);
  z-index: 1000;
  font-size: 13px;
  padding: 0.3rem 0;
}
.col-dd-sort-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.col-dd-sort-btn:hover { background: #f0f0f0; }
.col-dd-sep {
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}
.col-dd-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.col-dd-item:hover { background: #f8f8f8; }
.col-dd-selall {
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.1rem;
  padding-bottom: 0.3rem;
}
.col-dd-list {
  max-height: 180px;
  overflow-y: auto;
}
.col-dd-footer {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  padding: 0.4rem 0.75rem 0.3rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.athlete-table td {
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid #eeeeee;
  border-right: 1px solid transparent;
  vertical-align: middle;
}
.athlete-table td:last-child { border-right: none; }
.athlete-table tr:last-child td { border-bottom: none; }
/* Centre columns 2–11: Gender, Club, Age Group, Div, match scores */
.athlete-table tbody td:nth-child(n+2):nth-child(-n+11) { text-align: center; }
.athlete-table tr:hover td { background: #f8fff4; }
.athlete-table tr.in-team td { background: #efffee; }

/* ── Club bib image ─────────────────────────────────────────── */
.club-bib-img {
  height: 22px;
  width: auto;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
}

/* ── Gender badge ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-m    { background: #dbeafe; color: #1e40af; }
.badge-f    { background: #fce7f3; color: #9d174d; }
.badge-gold { background: var(--gold); color: var(--text); }

/* Price formatting */
.price {
  font-weight: 700;
  color: #000;
  white-space: nowrap;
}

/* ── Team roster list (sidebar) ─────────────────────────────── */
.team-list { list-style: none; }
.team-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eeeeee;
  font-size: 0.82rem;
}
.team-list-item:last-child { border-bottom: none; }
.team-list-item .athlete-info { flex: 1; }
.team-list-item .athlete-name { font-weight: 700; font-size: 0.82rem; }
.team-list-item .athlete-meta { font-size: 0.72rem; color: var(--text-light); }

/* ── Match score cards ──────────────────────────────────────── */
.match-scores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.match-score-card {
  background: var(--card-bg);
  padding: 0.9rem 1rem;
  text-align: center;
}
.match-score-card .match-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}
.match-score-card .match-total {
  font-size: 1.6rem;
  font-weight: 700;
  color: #000;
  line-height: 1;
}
.match-score-card .match-breakdown {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

/* Season total banner */
.season-total {
  text-align: center;
  padding: 1rem 1.25rem;
  background: #111;
  color: #fff;
  margin-bottom: 1rem;
}
.season-total .total-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.season-total .total-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--fantaxc-green);
}

/* ── Leaderboard table ──────────────────────────────────────── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}
.leaderboard-table th {
  background: #eeeeee;
  color: #000;
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-dark);
}
.leaderboard-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #eeeeee;
  font-size: 0.85rem;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: #f5f5f5; }

/* Rank column */
.rank-cell {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  width: 40px;
}
.rank-1 { color: #d4ac0d; }
.rank-2 { color: #808080; }
.rank-3 { color: #a0522d; }
.trophy-icon { font-size: 0.85rem; margin-left: 0.2rem; }

/* ── Rules page ─────────────────────────────────────────────── */
.rules-section { margin-bottom: 1.5rem; }
.rules-section h2 {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  color: #000;
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.rule-card {
  background: var(--card-bg);
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--fantaxc-green);
}
.rule-card .rule-icon { font-size: 1.4rem; margin-bottom: 0.3rem; }
.rule-card .rule-title { font-weight: 700; font-size: 0.8rem; margin-bottom: 0.2rem; }
.rule-card .rule-value { font-size: 1.1rem; font-weight: 700; color: #000; }

/* Trophies list on rules page */
.trophy-list { list-style: none; }
.trophy-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.trophy-list li:last-child { border-bottom: none; }
.trophy-list .t-icon { font-size: 1.25rem; flex-shrink: 0; }
.trophy-list .t-text strong { display: block; }

/* ── Alert / notice boxes ───────────────────────────────────── */
.alert {
  padding: 0.55rem 0.8rem;
  border-left: 3px solid;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  line-height: 1.5;
  border-radius: 0;
  overflow-wrap: anywhere;
}
.alert-info    { background: #f0f4ff; color: #1e40af; border-color: #3b82f6; }
.alert-warning { background: #fffbf0; color: #7a3b00; border-color: #f59e0b; }
.alert-danger  { background: #fff5f5; color: #991b1b; border-color: #ef4444; }
.alert-success { background: #f0fff8; color: #065f46; border-color: #10b981; }

.show-phone,
.show-phone-inline { display: none; }
#athlete-table thead tr.phone-head { display: none; }
.th-sub { font-weight: 400; font-size: 0.72rem; color: var(--text-light); margin-top: 0.15rem; }

/* ── My Team page ────────────────────────────────────────────── */
.section-heading {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 0.3rem;
  margin: 0 0 1rem;
}
#team-table .remove-col           { text-align: right; width: 1%; white-space: nowrap; }
#team-table.locked .remove-col    { display: none; }

/* ── Team Managers list (leaderboard.js) ─────────────────────── */
/* Placeholder numbers before the game starts: blurred and unselectable */
.hazed {
  display: inline-block;
  filter: blur(4px);
  opacity: 0.8;
  user-select: none;
  pointer-events: none;
}
.entrants-table tr.is-me td       { background: #fffbeb; }
.entrants-table tr.clickable      { cursor: pointer; }
.entrants-table tr.clickable:focus-visible td { background: #f3fff8; }
.entrants-table tr.clickable:focus-visible { outline: 2px solid #3D195B; outline-offset: -2px; }
.entrant-chevron {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--text-light);
  font-weight: 700;
  transition: transform 0.15s;
}
.entrants-table tr[aria-expanded="true"] .entrant-chevron { transform: rotate(90deg); }
.you-tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--fantaxc-green);
  color: #000;
  border-radius: 2px;
  vertical-align: middle;
}
/* ── Leaderboard pages: season title with ‹ › arrows (navigation.js) ── */
.season-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.season-title {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 1.1;
  color: #3D195B;   /* FantaXC purple, as in the menu bar */
}
.season-stepper { margin-left: auto; text-align: right; }
.season-head { align-items: flex-end; }

/* ‹ All athletes › under the season title: same size and colour as
   "n of 6 seasons", on the same line */
.view-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-light);
}
.view-label { min-width: 5.6rem; text-align: center; }
.view-arrow {
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: 1px solid #e4e4e7;
  border-radius: 5px;
  background: none;
  color: var(--text-light);
  cursor: pointer;
}
.view-arrow:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.view-arrow svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.season-arrows { display: flex; justify-content: flex-end; gap: 0.3rem; }
.season-arrow {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  color: var(--text);
  transition: background 0.15s;
}
.season-arrow:hover { background: rgba(0, 0, 0, 0.05); text-decoration: none; }
.season-arrow[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.season-arrow svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.season-position { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--text-light); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Leaderboard table, styled like the SL Archive tables: no heading
   background, lighter heading text, thin lines between rows */
.entrants-table th {
  background: none;
  color: #8a8f98;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  vertical-align: bottom;
  border-bottom: 1px solid #e5e5e5;
}
.entrants-table td                { border-bottom: 1px solid #efefef; }
.entrants-table tr:hover td       { background: none; }
.entrants-table tr.clickable:hover td { background: #f7f7f7; }

/* Position (🏆 for first, then 2, 3…) and the manager's club kit */
.entrants-table .col-rank {
  width: 1.9rem;
  padding-left: 0.4rem;
  padding-right: 0;
  color: var(--text-light);
  text-align: left;
  white-space: nowrap;
}
.entrants-table .col-rank .trophy { margin-left: 0; }
.entrants-table .col-kit {
  width: 1.8rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  text-align: center;
}
.entrants-table .col-kit .club-bib-img { vertical-align: middle; }
.entrants-table td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  line-height: 1.3;
}
/* Team: "Manager: Club name" on one line; long club names end in "…" */
.entrants-table td.col-manager    { white-space: nowrap; }
.entrants-table .team-name {
  display: inline-block;
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  font-weight: 400;
}
.entrants-table .trophy           { margin-left: 0.2rem; }

/* White grid lines: Spend | Scoring, and Match 4 | League Total */
.entrants-table .col-divide       { border-left: 2px solid #fff; }

/* Spend isn't bold; athlete names aren't bold; age group sits by the bib */
.entrants-table .spend            { white-space: nowrap; font-weight: 400; }
.entrants-table td.athlete-subrow-name { font-weight: 400; }
.athlete-link { color: inherit; }
.athlete-link:hover { color: #3D195B; text-decoration: underline; }
.entrants-table tr.backmarker td.athlete-subrow-name { font-style: italic; color: var(--text-light); }
.entrants-table tr.athlete-subrow.gender-total td { font-weight: 700; background: #e8e8e8; border-bottom: 2px solid #ddd; }
.entrants-table tr.gender-total td.athlete-subrow-name { font-weight: 700; }
.entrants-table tr.athlete-subrow.gender-total td.col-score { color: var(--text); }
.age-group {
  margin-left: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-light);
}

/* Sortable headings (table-sort.js): the heading text is the button */
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}
.sort-btn:hover { text-decoration: underline; }
.sort-arrow { font-size: 0.6rem; line-height: 1; }

.entrants-scroll { overflow-x: auto; }

/* Every leaderboard (current and past seasons) uses the same fixed column
   widths, taken from the 2025-26 table, so they line up whatever the teams
   happen to contain. Teams takes the remaining width. Phones keep the
   natural widths and scroll sideways. */
@media (min-width: 769px) {
  .entrants-table                     { table-layout: fixed; width: 100%; }
  .entrants-table th.col-rank         { width: 30px; }
  .entrants-table th.col-kit          { width: 30px; }
  .entrants-table th.col-athletes     { width: 88px; }
  .entrants-table th.col-num          { width: 104px; }
  .entrants-table th.col-score        { width: 66px; }
  .entrants-table th.col-total        { width: 76px; }
  .entrants-table td.col-manager      { overflow: hidden; text-overflow: ellipsis; }
}
.trophy                           { cursor: help; white-space: nowrap; }
.trophy:focus-visible             { outline: 2px solid #3D195B; outline-offset: 1px; border-radius: 2px; }
.trophy-tip {
  position: fixed;
  z-index: 1000;
  max-width: 16rem;
  padding: 0.4rem 0.6rem;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.trophy-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Scoring columns and the "Scoring" heading over them */
/* Spend and the score columns are right-aligned */
.entrants-table .col-score,
.entrants-table .col-num          { text-align: right; white-space: nowrap; }
.entrants-table td.col-total      { font-weight: 700; }
.entrants-table .results-link {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
}

/* A team's athletes, listed under its row */
.entrants-table tr.athlete-subrow td {
  background: #fafafa;
  padding-top: 0.05rem;
  padding-bottom: 0.05rem;
  line-height: 1.2;
  border-bottom: 1px solid #efefef;
}
.entrants-table tr.athlete-subrow.last td { border-bottom: 2px solid #ddd; }
.entrants-table tr.athlete-subrow td.col-score         { color: var(--text-light); }
.entrants-table tr.athlete-subrow td.col-score.counted { color: var(--text); font-weight: 700; }
.athlete-subrow-athlete           { white-space: nowrap; text-align: center; }
.entrants-table tr.athlete-subrow .club-bib-img { height: 14px; vertical-align: middle; }
.entrants-table tr.athlete-subrow .badge { padding: 0 0.3rem; }
.entrants-table tr.athlete-subrow:hover td { background: #f3f3f3; }

/* ── Sign-in screen (account.js) ───────────────────────────── */
/* Adapted from the shadcnblocks "Login6" block */
.signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 0 3rem;
}
.signin-logo img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 14px;
}
.signin-heading { text-align: center; max-width: 24rem; }
.signin-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.signin-subtitle {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
}
.signin-box {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2.5rem 1.5rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Buttons */
.signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 2.5rem;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.signin-btn:disabled { opacity: 0.6; cursor: default; }
.signin-btn:focus-visible { outline: 2px solid #3D195B; outline-offset: 2px; }
.signin-btn-google {
  background: #3D195B;
  color: #fff;
}
.signin-btn-google:hover { background: #2c1142; }
.signin-google-icon {
  width: 18px;
  height: 18px;
  padding: 2px;
  background: #fff;
  border-radius: 50%;
  box-sizing: content-box;
}
.signin-btn-secondary {
  background: var(--fantaxc-green);
  color: #1a1a1a;
  border-color: var(--fantaxc-green-hover);
}
.signin-btn-secondary:hover { background: var(--fantaxc-green-hover); }

/* "OR" divider */
.signin-or {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}
.signin-or::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e4e4e7;
}
.signin-or span {
  position: relative;
  background: #fff;
  padding: 0 0.6rem;
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

/* Fields */
.signin-form { display: flex; flex-direction: column; gap: 1rem; }
.signin-field { display: flex; flex-direction: column; gap: 0.4rem; }
.signin-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.signin-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.signin-label-row a {
  font-size: 0.78rem;
  color: var(--text-light);
}
.signin-label-row a:hover { color: var(--text); }
.signin-field input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.signin-field input::placeholder { color: #a1a1aa; }
.signin-field input:focus {
  outline: none;
  border-color: #3D195B;
  box-shadow: 0 0 0 3px rgba(61, 25, 91, 0.15);
}

.signin-msg:empty { display: none; }
.signin-msg .alert { margin-bottom: 0; }

/* "Need an account? Sign up" */
.signin-switch {
  display: flex;
  gap: 0.3rem;
  font-size: 0.875rem;
  color: var(--text-light);
}
.signin-switch a {
  font-weight: 600;
  color: #3D195B;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* ── Page title section ─────────────────────────────────────── */
.page-title-section {
  background: #fff;
  border-bottom: 2px solid var(--fantaxc-green);
  padding: 1rem;
  text-align: center;
}
.page-title-section h1 {
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 1.4rem;
  color: #000;
  margin-bottom: 0.2rem;
}
.page-title-section p {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: #111;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 0.9rem 1rem;
  margin-top: 2rem;
  font-size: 0.78rem;
}
.site-footer a { color: var(--fantaxc-green); }

/* ── Utility classes ────────────────────────────────────────── */
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.text-muted      { color: var(--text-light); }
.text-green      { color: #1a1a1a; }
.text-gold       { color: var(--gold-dark); }
.text-red        { color: var(--red); }
.font-bold       { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex  { display: flex; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #555;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive breakpoints ─────────────────────────────────── */
@media (min-width: 640px) {
  .page-content { padding: 1.25rem 1.5rem; }
}
@media (min-width: 1024px) {
  .page-content { padding: 1.25rem 2rem; }
}

/* ≤ 768px — tablets: hide partner logos, collapse table columns */
@media (max-width: 768px) {
  col.col-mobile-hide               { visibility: collapse; }

  .athlete-table                    { font-size: 11px; }
  .athlete-table th,
  .athlete-table td                 { padding: 0.25rem 0.4rem; }
  .club-bib-img                     { height: 16px; }

  .leaderboard-table                { font-size: 0.78rem; }
  .leaderboard-table th,
  .leaderboard-table td             { padding: 0.3rem 0.5rem; }

}

/* ≤ 640px — small tablets / large phones: hamburger nav, bigger tap targets */
@media (max-width: 640px) {
  /* Larger touch targets for buttons and inputs.
     16px text stops iPhones zooming in when a box is tapped. */
  .btn                              { min-height: 40px; }
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="date"],
  select,
  textarea                          { padding: 0.5rem 0.55rem !important; font-size: 16px !important; min-height: 42px; }
  .signin-field input               { font-size: 16px; height: 2.75rem; }
  .signin-label-row a,
  .signin-switch a                  { padding: 0.5rem 0; margin: -0.5rem 0; }

  /* Pick Team table: keep name, M/F, club, average and price on screen.
     Rows are tapped to add/remove, so the button column is hidden too.
     Cells are hidden (not <col>s) so the table stays full width, and a
     phone-only heading row replaces the two-row desktop headings. */
  #athlete-table colgroup,
  #athlete-table thead tr:not(.phone-head) { display: none; }
  #athlete-table thead tr.phone-head { display: table-row; }
  #athlete-table td:nth-child(4),
  #athlete-table td:nth-child(5),
  #athlete-table td:nth-child(n+6):nth-child(-n+9),
  #athlete-table td:nth-child(11),
  #athlete-table td:nth-child(13) { display: none; }

  /* My Team: hide Age (4) and match positions (6–9). Hiding the cells, not
     the <col>s, keeps the table full width. */
  #team-table th:nth-child(4),
  #team-table td:nth-child(4),
  #team-table th:nth-child(n+6):nth-child(-n+9),
  #team-table td:nth-child(n+6):nth-child(-n+9) { display: none; }
  .show-phone                       { display: block; }
  .show-phone-inline                { display: inline; }
  .hide-phone                       { display: none; }
  #team-table .remove-col .btn      { min-height: 36px; min-width: 36px; padding: 0 0.5rem; }
  /* Leaderboards on phones: no Athletes or Spend column, and the rest fits
     the screen with no sideways scrolling. Narrow position, kit and score
     columns; Teams takes the remaining width (a long manager name ends in
     "…"; the club name and icons sit on a second line, cut short with "…",
     and an opened team's name wraps in full). */
  .entrants-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.72rem;
  }
  .entrants-table th:nth-child(4),
  .entrants-table th:nth-child(5),
  .entrants-table td:nth-child(4),
  .entrants-table td:nth-child(5)   { display: none; }
  .entrants-table th,
  .entrants-table td                { padding: 0.4rem 0.1rem; }
  .entrants-table th.col-rank       { width: 1.1rem; }
  .entrants-table th.col-kit        { width: 1.25rem; }
  .entrants-table th.col-score      { width: 2.3rem; }
  .entrants-table th.col-total      { width: 2.65rem; }
  .page-content                     { padding-left: 0.75rem; padding-right: 0.75rem; }
  .entrants-table .col-divide       { border-left: 0; }
  .entrants-scroll                  { overflow-x: hidden; }
  .entrants-table .col-rank         { padding-left: 0.1rem; padding-right: 0; }
  .entrants-table .col-kit          { padding-left: 0; padding-right: 0; }
  .entrants-table .col-kit .club-bib-img { height: 15px; }

  .entrants-table td.col-manager    { white-space: nowrap; overflow: hidden; }
  .entrants-table .team-mgr {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .entrants-table .team-sep         { display: none; }
  .entrants-table .team-extra {
    display: block;
    width: 0;
    min-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    color: var(--text-light);
  }
  .entrants-table .team-name        { display: inline; max-width: none; }
  .entrants-table tr[aria-expanded="true"] .team-extra {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  .entrants-table tr.athlete-subrow td.col-manager {
    padding-left: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .entrants-table tr.athlete-subrow .club-bib-img { height: 13px; }
  .entrants-table .trophy           { margin-left: 0.1rem; }
  .table-tap-hint                   { font-size: 0.8rem; color: var(--text-light); margin: 0 0 0.5rem; }
  .athlete-table tbody tr           { cursor: pointer; }
  .athlete-table tr.in-team td:first-child::before {
    content: "✓ ";
    color: #0a8a4a;
    font-weight: 700;
  }
  .athlete-table tr.in-team td:first-child { box-shadow: inset 3px 0 0 #00c46a; }

  /* Submit button full-width on mobile */
  #submit-team-btn                  { width: 100%; margin-left: 0; }

  /* Mobile nav card on home page */
  #mobile-nav-card                  { display: block !important; }

  /* Stat bar: allow wrapping into a 2×2 grid */
  #stats-bar                        { flex-shrink: 1 !important; }

  /* Page title section: tighter on small screens */
  .page-title-section               { padding: 0.75rem 1rem; }
}

/* ≤ 480px — phones: shrink further */
@media (max-width: 480px) {
  .hero                             { padding: 2rem 1rem; }

  .athlete-table                    { font-size: 12px; }
  .athlete-table th,
  .athlete-table td                 { padding: 0.2rem 0.3rem; }

  /* Stack card-grid to single column */
  .card-grid                        { grid-template-columns: 1fr; }
}
