/* ============================================================
   THORNEPLAY — MAIN STYLESHEET
   Navy & Gold theme
   ============================================================ */

/* ---- Google Fonts already loaded via HTML ---- */

:root {
  --green: #1e3a5f;
  --green-dark: #0f172a;
  --green-mid: #2a4a7f;
  --gold: #c9a84c;
  --gold-light: #e8c453;
  --gold-pale: #fdf6e3;
  --white: #ffffff;
  --off-white: #f7f7f5;
  --grey-100: #f2f2f0;
  --grey-200: #e4e4e0;
  --grey-400: #aeaeaa;
  --grey-600: #6b6b67;
  --grey-800: #2c2c28;
  --text: #1a1a18;
  --text-light: #555551;
  --red: #c0392b;
  --blue: #2471a3;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --font-head: 'Rajdhani', sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--off-white);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--green-dark);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon { display: none; }
.logo-text { display: none; }
.logo-svg-wrap { display: flex; align-items: center; }

/* Competition banner below header */
.comp-banner {
  background: linear-gradient(90deg, #0a1020 0%, #1e3a5f 40%, #1e3a5f 60%, #0a1020 100%);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  text-align: center;
  padding: 7px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c9a84c;
}
.comp-banner-divider { opacity: 0.4; margin: 0 12px; font-size: 10px; }

.header-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.85);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,0.12); color: var(--white); text-decoration: none; }
.nav-btn-outline { border-color: rgba(255,255,255,0.3); }
.nav-btn-gold { background: var(--gold); color: var(--green-dark); border-color: var(--gold); font-weight: 700; }
.nav-btn-gold:hover { background: var(--gold-light); }

/* ============================================================
   HOME PAGE
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #1a4a7f 100%);
  padding: 80px 20px 80px;
  display: flex;
  gap: 60px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero-content { max-width: 540px; }
.hero-eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-light); font-weight: 700; margin-bottom: 12px; }
.hero-title { font-family: var(--font-head); font-size: clamp(36px, 5vw, 58px); color: var(--white); line-height: 1.1; margin-bottom: 20px; font-weight: 900; }
.hero-title .gold { color: var(--gold-light); }
.hero-desc { color: rgba(255,255,255,0.85); font-size: 17px; line-height: 1.6; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 240px;
}
.stat-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.stat-card.gold-card { background: rgba(201, 162, 39, 0.2); border-color: var(--gold); }
.stat-num { display: block; font-family: var(--font-head); font-size: 36px; font-weight: 900; color: var(--white); line-height: 1; }
.stat-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.7); margin-top: 4px; }

.btn-primary {
  background: var(--gold);
  color: var(--green-dark);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--gold-light); text-decoration: none; transform: translateY(-1px); }
.btn-primary.btn-full { width: 100%; text-align: center; }
.btn-primary.btn-gold { background: var(--gold); }

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.25); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.how-it-works { padding: 72px 20px; background: var(--white); }
.section-title { font-family: var(--font-head); font-size: 32px; font-weight: 700; text-align: center; color: var(--green-dark); margin-bottom: 48px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; max-width: 900px; margin: 0 auto; }
.step { text-align: center; padding: 32px 24px; border: 1px solid var(--grey-200); border-radius: var(--radius); background: var(--off-white); }
.step-num { width: 48px; height: 48px; background: var(--green-dark); color: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 22px; font-weight: 900; margin: 0 auto 16px; }
.step h3 { font-family: var(--font-head); font-size: 20px; color: var(--green-dark); margin-bottom: 10px; }
.step p { color: var(--text-light); font-size: 14px; line-height: 1.6; }

.rules-section { padding: 64px 20px; background: var(--green-dark); }
.rules-section .section-title { color: var(--white); }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.rule-item { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: 16px 20px; color: rgba(255,255,255,0.9); font-size: 14px; display: flex; align-items: center; gap: 12px; }
.rule-icon { font-size: 18px; flex-shrink: 0; }

.site-footer {
  background: var(--grey-800);
  color: var(--grey-400);
  text-align: center;
  padding: 20px;
  font-size: 12px;
}
.site-footer-brand {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 40px 20px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  border-top: 4px solid var(--gold);
}

.auth-title { font-family: var(--font-head); font-size: 28px; color: var(--green-dark); margin-bottom: 6px; }
.auth-sub { color: var(--text-light); font-size: 14px; margin-bottom: 28px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-light); margin-top: 20px; }
.auth-switch a { color: var(--green); font-weight: 600; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 700; color: var(--grey-800); text-transform: uppercase; letter-spacing: 0.04em; }
.form-group input {
  padding: 11px 14px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s;
  background: var(--white);
}
.form-group input:focus { outline: none; border-color: var(--green); }
.hint { font-weight: 400; color: var(--grey-400); font-size: 12px; text-transform: none; letter-spacing: 0; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fdf2f2; border: 1px solid #f5c6cb; color: var(--red); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ============================================================
   DAY TABS
   ============================================================ */
.day-tabs-wrap {
  background: var(--white);
  border-bottom: 2px solid var(--grey-200);
  padding: 0 20px;
  position: sticky;
  top: 64px;
  z-index: 100;
}
.day-tabs {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.day-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 24px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -2px;
}
.day-tab:hover { color: var(--green); }
.day-tab.active { color: var(--green-dark); border-bottom-color: var(--gold); font-weight: 700; }
.day-label { font-size: 11px; color: inherit; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }
.day-name { font-size: 14px; }

/* ============================================================
   RACES PAGE - RACECARDS
   ============================================================ */
.races-main { max-width: 1300px; margin: 0 auto; }

.races-container { padding: 24px 20px 60px; }

.races-day-header { margin-bottom: 24px; }
.races-day-header h2 { font-family: var(--font-head); font-size: 26px; color: var(--green-dark); }
.races-day-sub { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* Race Card */
.race-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--grey-200);
}

.race-card-header {
  background: var(--green-dark);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.race-header-left { display: flex; align-items: center; gap: 16px; }
.race-time {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
  min-width: 52px;
}
.race-name {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--white);
  font-weight: 700;
  line-height: 1.2;
}
.race-meta { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.race-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.race-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.race-status-badge.open { background: rgba(46, 213, 115, 0.2); color: #2ed573; border: 1px solid rgba(46,213,115,0.3); }
.race-status-badge.locked { background: rgba(255,165,0,0.2); color: #ffa502; border: 1px solid rgba(255,165,0,0.3); }
.race-status-badge.resulted { background: rgba(201,162,39,0.2); color: var(--gold-light); border: 1px solid rgba(201,162,39,0.3); }

.my-pick-badge {
  background: var(--gold);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Racecard Table */
.racecard-table-wrap { overflow-x: auto; }
.racecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.racecard-table thead tr {
  background: var(--grey-100);
  border-bottom: 2px solid var(--grey-200);
}
.racecard-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-600);
  font-weight: 700;
  white-space: nowrap;
}
.racecard-table tbody tr { border-bottom: 1px solid var(--grey-100); transition: background 0.1s; }
.racecard-table tbody tr:hover { background: var(--grey-100); }
.racecard-table tbody tr:last-child { border-bottom: none; }
.racecard-table td { padding: 10px 12px; vertical-align: middle; }

.runner-row.runner-nr { opacity: 0.45; background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(0,0,0,0.02) 6px, rgba(0,0,0,0.02) 12px); }
.runner-row.runner-my-pick { background: var(--gold-pale); }
.runner-row.runner-my-pick:hover { background: #f9eec4; }

/* Cloth Numbers */
.cloth-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  color: white;
}
.cloth-0 { background: #c0392b; }
.cloth-1 { background: #2980b9; }
.cloth-2 { background: #27ae60; }
.cloth-3 { background: #e67e22; }
.cloth-4 { background: #8e44ad; }
.cloth-5 { background: #16a085; }
.cloth-6 { background: #d35400; }
.cloth-7 { background: #2c3e50; }

.horse-name-wrap { display: flex; flex-direction: column; gap: 3px; }
.horse-name-main { font-weight: 700; color: var(--text); font-size: 14px; }
.my-pick-marker { font-size: 11px; color: var(--gold); font-weight: 600; }
.nr-badge { font-size: 10px; background: var(--red); color: white; padding: 1px 5px; border-radius: 3px; font-weight: 700; width: fit-content; }

.form-figures { font-family: monospace; font-size: 13px; color: var(--text-light); letter-spacing: 0.05em; }

.odds-display {
  font-weight: 700;
  font-size: 15px;
  color: var(--green-dark);
  white-space: nowrap;
}
.nr-text { color: var(--red); font-weight: 700; font-size: 13px; }

/* Position badges in resulted races */
.pos-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; }
.pos-1 { background: var(--gold); color: var(--green-dark); }
.pos-place { background: #e8f5e9; color: var(--green-dark); border: 1px solid #a5d6a7; }
.pos-other { background: var(--grey-100); color: var(--grey-600); }

/* Select / Selected buttons */
.runner-select-btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.runner-select-btn:hover { background: var(--green-mid); }
.runner-select-btn.btn-selected { background: var(--gold); color: var(--green-dark); }
.runner-select-btn.btn-selected:hover { background: var(--gold-light); }
.locked-pick { font-size: 13px; color: var(--gold); font-weight: 700; }

/* Column widths */
.col-no { width: 44px; }
.col-horse { min-width: 150px; }
.col-form { width: 80px; }
.col-age { width: 50px; }
.col-wgt { width: 70px; }
.col-jockey { min-width: 130px; }
.col-trainer { min-width: 130px; }
.col-odds { width: 80px; }
.col-action { width: 100px; }

/* ============================================================
   SELECTION MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-top: 4px solid var(--gold);
}
.modal-large { max-width: 640px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-family: var(--font-head); font-size: 18px; color: var(--green-dark); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--grey-400); padding: 4px; }
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--grey-200);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-horse-name { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.modal-horse-sub { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

.odds-choice-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-600); margin-bottom: 12px; }
.odds-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.odds-option { display: block; cursor: pointer; }
.odds-option input { display: none; }
.odds-option-inner {
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.odds-option input:checked + .odds-option-inner {
  border-color: var(--green);
  background: #f0f7f2;
}
.odds-option-title { font-weight: 700; font-size: 14px; color: var(--text); }
.odds-option-price { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--green-dark); }
.odds-option-desc { font-size: 11px; color: var(--text-light); }

.modal-calculation {
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: 16px;
}
.calc-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-600); font-weight: 700; margin-bottom: 10px; }
.calc-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--text-light); }
.calc-total { font-weight: 700; color: var(--text); font-size: 15px; padding-top: 8px; border-top: 1px solid var(--grey-200); margin-top: 4px; }

/* ============================================================
   MY PICKS PAGE
   ============================================================ */
.picks-main { max-width: 1000px; margin: 0 auto; }
.picks-header { padding: 32px 20px 0; }
.picks-header h1 { font-family: var(--font-head); font-size: 32px; color: var(--green-dark); }
.picks-sub { color: var(--text-light); font-size: 15px; margin-top: 6px; }

.picks-container { padding: 24px 20px 60px; }

.picks-summary-bar {
  background: var(--green-dark);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  gap: 32px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; gap: 4px; }
.summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.6); }
.summary-value { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--white); }
.summary-value.gold { color: var(--gold-light); }

.picks-table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--grey-200); }
.picks-table { width: 100%; border-collapse: collapse; }
.picks-table thead tr { background: var(--grey-100); border-bottom: 2px solid var(--grey-200); }
.picks-table th { padding: 11px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-600); font-weight: 700; text-align: left; }
.picks-table tbody tr { border-bottom: 1px solid var(--grey-100); }
.picks-table tbody tr:last-child { border-bottom: none; }
.picks-table tbody tr:hover { background: var(--grey-100); }
.picks-table td { padding: 12px 16px; vertical-align: middle; }

.race-name-cell { font-weight: 600; color: var(--text); }
.race-time-cell { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.horse-name-cell { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.jockey-cell { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-odds { background: var(--grey-100); color: var(--green-dark); border: 1px solid var(--grey-200); }
.badge-sp { background: #e8f0fe; color: #1a56db; border: 1px solid #b8cffd; }
.badge-win { background: var(--gold); color: var(--green-dark); }
.badge-place { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-lost { background: var(--grey-100); color: var(--grey-600); }
.badge-pending { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.badge-locked { background: rgba(255,165,0,0.12); color: #e67e22; border: 1px solid rgba(255,165,0,0.25); }

.points-positive { color: var(--green-dark); font-size: 15px; }
.points-zero { color: var(--grey-400); }

/* ============================================================
   LEADERBOARD PAGE
   ============================================================ */
.lb-main { max-width: 800px; margin: 0 auto; padding: 0 20px 60px; }
.lb-header { padding: 32px 0 0; margin-bottom: 24px; }
.lb-header h1 { font-family: var(--font-head); font-size: 32px; color: var(--green-dark); }
.lb-sub { color: var(--text-light); font-size: 15px; margin-top: 6px; }

.lb-toggle { display: flex; gap: 0; margin-bottom: 24px; background: var(--grey-100); border-radius: var(--radius); padding: 4px; width: fit-content; }
.toggle-btn {
  background: transparent;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s;
}
.toggle-btn.active { background: var(--white); color: var(--green-dark); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.lb-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--grey-200); }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead tr { background: var(--green-dark); }
.lb-table th { padding: 12px 20px; color: rgba(255,255,255,0.8); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; text-align: left; }
.lb-table tbody tr { border-bottom: 1px solid var(--grey-100); transition: background 0.1s; }
.lb-table tbody tr:last-child { border-bottom: none; }
.lb-table tbody tr:hover { background: var(--grey-100); }
.lb-table td { padding: 14px 20px; vertical-align: middle; }

.lb-my-row { background: var(--gold-pale) !important; }
.lb-my-row:hover { background: #f9eec4 !important; }
.lb-top3 td { font-weight: 600; }

.lb-rank { font-family: var(--font-head); font-size: 20px; width: 60px; }
.lb-name { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.lb-races { color: var(--text-light); font-size: 13px; }
.lb-points { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--green-dark); text-align: right; }
.pts-label { font-size: 12px; color: var(--grey-400); font-family: var(--font-body); }

.you-badge {
  background: var(--gold);
  color: var(--green-dark);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.lb-hidden-notice {
  padding: 60px 32px;
  text-align: center;
}
.lb-hidden-icon { font-size: 48px; margin-bottom: 16px; }
.lb-hidden-notice h3 { font-family: var(--font-head); font-size: 22px; color: var(--green-dark); margin-bottom: 10px; }
.lb-hidden-notice p { color: var(--text-light); font-size: 15px; line-height: 1.6; max-width: 400px; margin: 0 auto; }

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.admin-page { background: var(--grey-100); }
.admin-header { background: #1a1a1a; border-bottom-color: #c0392b; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }
.admin-title { font-family: var(--font-head); font-size: 28px; color: var(--text); margin-bottom: 6px; }
.admin-desc { color: var(--text-light); font-size: 15px; margin-bottom: 32px; }

.admin-day-group { margin-bottom: 40px; }
.admin-day-title { font-family: var(--font-head); font-size: 22px; color: var(--green-dark); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.admin-table thead tr { background: var(--grey-100); border-bottom: 2px solid var(--grey-200); }
.admin-table th { padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-600); font-weight: 700; text-align: left; }
.admin-table tbody tr { border-bottom: 1px solid var(--grey-100); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table td { padding: 12px 14px; vertical-align: middle; font-size: 14px; }
.admin-time { font-weight: 700; color: var(--green-dark); font-size: 15px; }
.admin-racename { font-weight: 600; }

.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.status-open { background: #e8f5e9; color: #2e7d32; }
.status-locked { background: #fff8e1; color: #f57f17; }
.status-resulted { background: #e8f0fe; color: #1a56db; }

.admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 0.15s; }
.btn-sm:hover { opacity: 0.85; }
.btn-lock { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.btn-settle { background: var(--green); color: white; }
.btn-view { background: var(--grey-100); color: var(--text); border: 1px solid var(--grey-200); }
.settled-label { font-size: 13px; color: var(--green); font-weight: 600; }

.settle-instructions { font-size: 14px; color: var(--text-light); margin-bottom: 16px; line-height: 1.5; }
.settle-manual-note { background: #fff3cd; border: 1px solid #ffc107; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; color: #856404; margin-bottom: 16px; }
.settle-results-area textarea {
  width: 100%;
  font-family: monospace;
  font-size: 13px;
  padding: 12px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  resize: vertical;
  line-height: 1.5;
}
.settle-results-area textarea:focus { outline: none; border-color: var(--green); }
.settle-picks-ref { margin-top: 16px; }
.settle-picks-ref h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.settle-ref-table { border-collapse: collapse; font-size: 13px; }
.settle-ref-table td, .settle-ref-table th { padding: 5px 12px; border: 1px solid var(--grey-200); }
.settle-ref-table th { background: var(--grey-100); font-weight: 700; }
.settle-no-picks { font-size: 14px; color: var(--text-light); font-style: italic; margin-bottom: 16px; }

/* ============================================================
   UTILITY / SHARED
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-light);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--grey-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}
.empty-icon { font-size: 48px; }
.empty-state h3 { font-family: var(--font-head); font-size: 22px; color: var(--green-dark); }
.empty-state p { color: var(--text-light); max-width: 360px; }

.error-state { padding: 40px; text-align: center; color: var(--red); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--grey-800);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--red); }

/* ============================================================
   ALL PICKS PAGE
   ============================================================ */
.allpicks-main { max-width: 1400px; margin: 0 auto; padding: 0 20px 60px; }
.allpicks-header { padding: 32px 0 0; margin-bottom: 8px; }
.allpicks-header h1 { font-family: var(--font-head); font-size: 32px; color: var(--green-dark); }
.allpicks-sub { font-size: 14px; margin-top: 8px; margin-bottom: 16px; padding: 10px 16px; border-radius: var(--radius-sm); }
.note-hidden { background: #fff8e1; color: #856404; border: 1px solid #ffc107; }
.note-visible { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.ap-table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--grey-200); }
.ap-table { border-collapse: collapse; font-size: 13px; background: var(--white); min-width: 100%; }
.ap-table thead tr { background: var(--green-dark); }
.ap-table th { padding: 10px 12px; color: rgba(255,255,255,0.85); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; text-align: left; white-space: nowrap; }
.ap-table tbody tr { border-bottom: 1px solid var(--grey-100); transition: background 0.1s; }
.ap-table tbody tr:last-child { border-bottom: none; }
.ap-table tbody tr:hover { background: var(--grey-100); }
.ap-my-row { background: var(--gold-pale) !important; }
.ap-my-row:hover { background: #f9eec4 !important; }

.ap-player-col { min-width: 120px; position: sticky; left: 0; background: var(--green-dark); z-index: 2; }
.ap-race-col { min-width: 110px; max-width: 140px; }
.ap-total-col { min-width: 80px; text-align: right; }
.ap-race-time { font-weight: 700; color: var(--gold-light); font-size: 13px; }
.ap-race-name { font-size: 11px; color: rgba(255,255,255,0.7); line-height: 1.3; white-space: normal; }

.ap-player { font-weight: 700; padding: 10px 12px; display: flex; align-items: center; gap: 6px; position: sticky; left: 0; background: var(--white); z-index: 1; border-right: 2px solid var(--grey-200); }
.ap-my-row .ap-player { background: var(--gold-pale); }
.ap-my-row:hover .ap-player { background: #f9eec4; }

.ap-cell { padding: 8px 10px; vertical-align: top; border-right: 1px solid var(--grey-100); }
.ap-cell-empty { color: var(--grey-400); text-align: center; }
.ap-no-pick { font-size: 16px; color: var(--grey-300); }
.ap-horse { font-weight: 600; color: var(--text); font-size: 13px; line-height: 1.3; }
.ap-cell-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.ap-sp-badge { font-size: 10px; background: #e8f0fe; color: #1a56db; padding: 1px 5px; border-radius: 3px; font-weight: 700; }
.ap-odds-badge { font-size: 11px; color: var(--green-dark); font-weight: 700; }
.ap-pts { font-size: 11px; font-weight: 700; }
.ap-pts-positive { color: var(--green-dark); }
.ap-pts-zero { color: var(--grey-400); }

.ap-winner { background: #c9a84c !important; border-left: 3px solid #a07c20; }
.ap-winner .ap-horse { color: #1a1a18; font-weight: 700; }
.ap-winner-trophy { font-size: 12px; margin-left: 4px; }
.ap-placed { background: #f0fdf4 !important; border-left: 3px solid #4caf50; }
.ap-unplaced { opacity: 0.65; }

.ap-total { padding: 10px 12px; font-family: var(--font-head); font-size: 16px; font-weight: 700; text-align: right; color: var(--grey-400); }
.ap-total-positive { color: var(--green-dark); }

.ap-legend { margin-top: 16px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-light); }
.ap-legend-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius-sm); }
.ap-legend-item.ap-winner { background: #c9a84c; border-left: 3px solid #a07c20; font-weight: 600; color: #1a1a18; }
.ap-legend-item.ap-placed { background: #f0fdf4; font-weight: 600; color: var(--text); }
.ap-legend-item.ap-unplaced { background: var(--grey-100); }
@media (max-width: 768px) {
  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .header-nav { gap: 4px; }
  .nav-btn { padding: 6px 10px; font-size: 13px; }

  .hero { padding: 48px 20px; gap: 32px; }
  .hero-title { font-size: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .race-card-header { flex-direction: column; align-items: flex-start; }
  .race-header-right { margin-top: 8px; }

  /* Hide less important columns on mobile */
  .col-form, .col-age, .col-wgt, .col-trainer { display: none; }

  .auth-card { padding: 32px 20px; }

  .odds-options { grid-template-columns: 1fr; }

  .lb-main { padding: 0 12px 40px; }
  .lb-table td, .lb-table th { padding: 10px 12px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .header-nav { gap: 4px; }
  .nav-btn { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 48px 20px; gap: 32px; }
  .hero-title { font-size: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .race-card-header { flex-direction: column; align-items: flex-start; }
  .race-header-right { margin-top: 8px; }
  .col-form, .col-age, .col-wgt, .col-trainer { display: none; }
  .auth-card { padding: 32px 20px; }
  .odds-options { grid-template-columns: 1fr; }
  .lb-main { padding: 0 12px 40px; }
  .lb-table td, .lb-table th { padding: 10px 12px; }
}

/* Admin unlock button */
.btn-unlock { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.btn-settle-quick { background: var(--gold); color: var(--green-dark); }

/* Jockey silks */
.jockey-cell-wrap { display: flex; align-items: center; gap: 6px; }
.silk-img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }

/* Default pick asterisk and row highlight */
.row-default { background: #fffbeb !important; }
.default-pick-badge {
  font-size: 10px; background: #fff3cd; color: #856404;
  border: 1px solid #ffc107; padding: 1px 6px; border-radius: 3px;
  font-weight: 700; margin-left: 6px; cursor: help;
}

/* Wins/places on leaderboard */
.lb-meta { font-size: 11px; color: var(--grey-400); margin-top: 2px; }
