/* Sports24King — dark sportsbook theme */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --line: #2a3342;
  --text: #e8edf3;
  --muted: #8b95a7;
  --gold: #d4a72c;
  --green: #2ea043;
  --red: #e5534b;
  --blue: #2f81f7;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
h2 { font-size: 18px; margin: 18px 0 10px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 380px;
}
.brand { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.brand span { color: var(--gold); }
.brand.small { font-size: 20px; }
.tagline { color: var(--muted); margin: 4px 0 20px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.login-tab {
  flex: 1; padding: 10px; background: var(--panel2); color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px;
}
.login-tab.active { color: var(--text); border-color: var(--gold); }
.login-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.login-card input, .inline-form input, .inline-form select, .game-form input, .game-form select,
.slip-row input, .slip-row select, .filter-row select {
  width: 100%; margin-top: 4px; padding: 10px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-size: 14px;
}
.form-error { color: var(--red); font-size: 13px; margin: 8px 0; }
.login-hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: var(--radius); padding: 10px 16px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--gold); color: #111; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }
.linkbtn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 0; }
.badge {
  background: var(--gold); color: #111; border-radius: 10px;
  font-size: 11px; padding: 1px 7px; margin-left: 4px; font-weight: 700;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.mainnav { display: flex; gap: 6px; }
.navbtn {
  background: transparent; border: none; color: var(--muted);
  padding: 8px 12px; cursor: pointer; font-size: 14px; border-radius: var(--radius);
  text-decoration: none; display: inline-block;
}
.navbtn.active, .navbtn:hover { color: var(--text); background: var(--panel2); }
.account-box { display: flex; gap: 14px; margin-left: auto; align-items: center; }
.acct { display: flex; flex-direction: column; font-size: 12px; }
.acct span { color: var(--muted); }
.acct b { font-size: 14px; }
.acct.user { align-items: flex-end; }
.slip-toggle { display: none; }

/* ---------- board layout ---------- */
.view { display: flex; min-height: calc(100vh - 57px); }
.view[hidden] { display: none !important; }
.sports-menu {
  width: 210px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.sport-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); padding: 10px; cursor: pointer; font-size: 14px; text-align: left;
}
.sport-btn:hover { background: var(--panel2); }
.sport-btn.active { border-color: var(--gold); background: var(--panel2); }
.sport-btn .ico { font-size: 18px; width: 26px; text-align: center; }
.sport-btn .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.sport-btn.allbtn {
  justify-content: center; aspect-ratio: 1; max-width: 64px; margin: 0 auto 6px;
  border: 1px solid var(--line); border-radius: 12px; position: relative;
}
.sport-btn.allbtn .ico { font-size: 24px; }
.sport-btn.allbtn .count {
  position: absolute; top: -6px; right: -6px; background: var(--gold); color: #111;
  border-radius: 10px; padding: 1px 7px; font-weight: 700; margin: 0;
}
.board-col { flex: 1; padding: 16px; min-width: 0; }
.day-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.day-chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 20px; padding: 6px 14px; cursor: pointer; font-size: 13px;
}
.day-chip.active { color: #111; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.board-overview {
  background: linear-gradient(135deg, #141b2d, #1c2330); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.board-overview h2 { margin: 0 0 4px; letter-spacing: 1px; }
.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stat-pill { background: var(--panel2); border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; font-size: 13px; }
.league-group {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 16px; overflow: hidden;
}
.league-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--panel2); border-bottom: 1px solid var(--line); font-weight: 700;
}
.league-head .gcount {
  margin-left: auto; background: var(--gold); color: #111; font-size: 12px;
  border-radius: 12px; padding: 2px 10px; font-weight: 700;
}
.game-row {
  display: grid; grid-template-columns: 92px 1fr; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center;
}
.game-row:last-child { border-bottom: none; }
.game-time { color: var(--muted); font-size: 12px; }
.game-teams { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--panel2);
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--gold); flex-shrink: 0;
}
.odds-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.odds-btn {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 8px 10px; cursor: pointer; font-size: 13px;
  min-width: 86px; text-align: center;
}
.odds-btn small { display: block; color: var(--muted); font-size: 11px; }
.odds-btn:hover { border-color: var(--gold); }
.odds-btn.selected { background: var(--gold); color: #111; border-color: var(--gold); }
.odds-btn.selected small { color: #333; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- bet slip ---------- */
.betslip {
  width: 300px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line);
  padding: 16px; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto;
}
.slip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#slip-close { display: none; }
.slip-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.slip-tab {
  flex: 1; padding: 8px; background: var(--panel2); color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 700;
}
.slip-tab.active { color: #111; background: var(--gold); border-color: var(--gold); }
.slip-selections { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.selection {
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.selection button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 15px; }
.slip-row { margin-bottom: 10px; }
.slip-row label { font-size: 13px; color: var(--muted); display: block; }
.towin-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.towin-row b { color: var(--green); }
.quick-stakes { display: flex; gap: 6px; margin-bottom: 12px; }
.quick-stakes button {
  flex: 1; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 6px; cursor: pointer; font-size: 13px;
}
.quick-stakes button:hover { border-color: var(--gold); }

/* ---------- fill mode banner ---------- */
.fill-banner {
  background: #2a230f; border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}

/* ---------- tickets ---------- */
.wagers-col, .admin-col { flex: 1; padding: 16px 20px; max-width: 1100px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.ticket-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ticket-head .tnum { font-weight: 700; color: var(--gold); }
.ticket-head .ttype { color: var(--muted); font-size: 12px; }
.ticket-head .tstake { margin-left: auto; }
.ticket-head .twin { color: var(--green); font-weight: 700; }
.leg { font-size: 13px; padding: 3px 0; color: var(--text); }
.leg .lodds { color: var(--muted); }
.open-spots { color: var(--gold); font-size: 13px; margin-top: 4px; }
.ticket-actions { margin-top: 8px; display: flex; gap: 8px; }
.status-void { color: var(--red); } .status-open { color: var(--green); }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-tab {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--radius); padding: 8px 16px; cursor: pointer;
}
.admin-tab.active { color: #111; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.inline-form input, .inline-form select { width: auto; margin-top: 0; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 600; }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.filter-row select { width: auto; margin-top: 0; }
.game-form-wrap { margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.game-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.odds-fields { display: contents; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sports-menu { width: 64px; padding: 8px; }
  .sport-btn span.lbl, .sport-btn .count { display: none; }
  .sport-btn { justify-content: center; }
  .betslip {
    position: fixed; right: 0; top: 0; height: 100vh; z-index: 100; width: 320px; max-width: 92vw;
    transform: translateX(105%); transition: transform .25s ease; box-shadow: -4px 0 20px rgba(0,0,0,.5);
  }
  .betslip.open { transform: none; }
  #slip-close { display: inline; }
  .slip-toggle { display: inline-block; }
  .game-row { grid-template-columns: 1fr; }
  .game-time { font-size: 11px; }
}

/* ---------- live betting ---------- */
.live-badge {
  display: inline-block; background: #e5484d; color: #fff; font-weight: 700;
  font-size: 11px; padding: 2px 8px; border-radius: 4px; letter-spacing: 1px;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #e5484d; margin-right: 6px; animation: live-pulse 1.6s ease-in-out infinite;
}
.live-row { border-left: 3px solid #e5484d; }
.live-score { font-weight: 700; font-size: 15px; margin: 4px 0; color: var(--text); }
.odds-btn.live-odds { border-color: #e5484d55; }
.odds-btn.live-odds.selected { background: #e5484d; border-color: #e5484d; color: #fff; }
.live-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.live-head h2 { margin: 0; }

/* ---------- clickable account figures ---------- */
.acct-link {
  background: none; border: none; padding: 0; font: inherit; color: inherit;
  cursor: pointer; text-align: left; border-radius: 6px;
}
.acct-link:hover b { text-decoration: underline; }
.acct-link:focus-visible { outline: 2px solid var(--accent, #4f8cff); outline-offset: 2px; }

/* ---------- freeplay ---------- */
.funds-row { margin-top: 8px; }
.funds-toggle { display: flex; gap: 6px; }
.funds-btn {
  flex: 1; padding: 7px 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.funds-btn.active { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.funds-badge {
  display: inline-block; background: #7c5cff; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; letter-spacing: 0.5px; text-transform: uppercase;
}

/* ---------- dashboard ---------- */
.dash { max-width: 720px; margin: 0 auto; padding: 20px 16px; }
.dash-acct { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.dash-acct-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center; cursor: pointer; color: inherit;
  text-decoration: none; display: block; font: inherit;
}
.dash-acct-card span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dash-acct-card b { font-size: 20px; }
.dash-acct-card:hover { border-color: var(--accent, #4f8cff); }
.dash-live { border-color: #e5484d; }
.dash-title { font-size: 18px; margin: 0 0 12px; }
.dash-sports { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.dash-sport {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 12px; text-align: center; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dash-sport:hover { border-color: var(--accent, #4f8cff); transform: translateY(-1px); }
.dash-ico { font-size: 32px; }
.dash-label { font-weight: 600; font-size: 14px; }
.dash-count { font-size: 12px; color: var(--muted); }
.board-back { margin-bottom: 12px; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.board-back a { color: var(--muted); text-decoration: none; }
.board-back a:hover { color: var(--text); }
#board-sport-title { font-weight: 700; font-size: 16px; }
/* ---------- ticket leg details ---------- */
.leg { margin: 6px 0; padding: 6px 0; border-top: 1px solid var(--line); }
.leg:first-of-type { border-top: none; }
.leg-matchup { font-weight: 600; font-size: 13px; }
.leg-pick { font-size: 13px; color: var(--text); margin-top: 2px; }
.leg-time { font-size: 11px; color: var(--muted); }
.leg-result { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; }
.leg-win { background: #1a7f37; color: #fff; }
.leg-loss { background: #cf222e; color: #fff; }
.leg-push { background: #6e7781; color: #fff; }
.sel-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.selection { display: flex; justify-content: space-between; align-items: flex-start; }
/* ---------- win/loss history summary ---------- */
.history-summary { font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.hl-win { color: #1a7f37; }
.hl-loss { color: #cf222e; }
.hl-push { color: #6e7781; }
.hl-net { margin-left: 8px; }
/* ---------- weekly reset history ---------- */
.section-sub { font-size: 15px; margin: 18px 0 8px; color: var(--text); }
