/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-alt: #22263a;
  --border: #2e3248;
  --text: #e8eaf0;
  --text-muted: #7c82a0;
  --accent: #4f8ef7;
  --accent-hover: #6ba3f9;
  --green: #3ecf8e;
  --red: #f76f6f;
  --yellow: #f7c948;
  --radius: 8px;
  --nav-height: 60px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
}

.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-right: auto;
  letter-spacing: -0.3px;
}

.nav-brand span {
  color: var(--accent);
}

nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  touch-action: manipulation;
}

nav a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

nav a.active {
  color: var(--accent);
  background: rgba(79, 142, 247, 0.1);
}

/* Page layout */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-alt);
}

tbody td {
  padding: 12px 12px;
  font-size: 14px;
}

/* Trend indicators */
.trend-up {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.trend-down {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.trend-neutral {
  color: var(--text-muted);
  font-size: 13px;
}

/* Rank number */
.rank {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  width: 32px;
}

.team-name {
  font-weight: 600;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

/* Game card matchup row */
.game-matchup-row {
  display: flex;
  align-items: center;
  padding: 14px 20px 12px;
  gap: 8px;
}

.matchup-side {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.matchup-side--away {
  justify-content: flex-end;
}

.game-matchup-row .team-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.matchup-team-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matchup-center {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 0 6px;
}

/* Inline logo + name in bet options and account history rows */
.bet-team-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bet-team-row .team-logo {
  width: 20px;
  height: 20px;
}

/* Logo + pick label inside the bet slip */
.bet-slip-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bet-slip-team .team-logo {
  width: 22px;
  height: 22px;
}

/* Both team logos side-by-side for total bets */
.bet-slip-matchup-logos {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bet-slip-matchup-logos .team-logo {
  width: 22px;
  height: 22px;
}

.power-rating {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Betting */
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}

.game-card-meta {
  padding: 7px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.game-card-body {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.game-card-markets {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.game-card-note {
  padding: 10px 16px 14px;
}

.market-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}

.market-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.bet-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 56px;
  width: 100%;
  touch-action: manipulation;
}

.bet-option:last-child {
  margin-bottom: 0;
}

.bet-option > span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.bet-option:hover {
  border-color: var(--accent);
  background: rgba(79, 142, 247, 0.07);
  box-shadow: 0 0 0 1px rgba(79, 142, 247, 0.15);
}

.bet-option:active {
  opacity: 0.8;
}

.bet-option.selected {
  border-color: var(--green);
  background: rgba(62, 207, 142, 0.08);
  box-shadow: 0 0 0 1px rgba(62, 207, 142, 0.2);
}

.bet-option .odds {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.bet-option.selected .odds {
  color: var(--green);
}

/* Section dividers */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 28px 0 14px;
  white-space: nowrap;
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Leaderboard */
.leaderboard-rank {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-muted);
  width: 40px;
}

.leaderboard-rank.gold { color: var(--yellow); }
.leaderboard-rank.silver { color: #a8b0c8; }
.leaderboard-rank.bronze { color: #c8845a; }

.credits {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

/* Account */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-value.green { color: var(--green); }
.stat-value.red   { color: var(--red); }
.stat-value.accent { color: var(--accent); }

.stat-positive { color: var(--green); font-weight: 800; }
.stat-negative { color: var(--red);   font-weight: 800; }
.stat-neutral  { color: var(--text-muted); font-weight: 700; }

/* Bet status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-open {
  background: rgba(79, 142, 247, 0.15);
  color: var(--accent);
}

.badge-won {
  background: rgba(62, 207, 142, 0.15);
  color: var(--green);
}

.badge-lost {
  background: rgba(247, 111, 111, 0.15);
  color: var(--red);
}

.badge-push {
  background: rgba(124, 130, 160, 0.15);
  color: var(--text-muted);
}

/* Admin nav link — hidden until JS confirms is_admin */
#admin-nav-link {
  display: none;
}

/* Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  min-height: 44px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Power rating explanation */
.explanation {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 28px;
}

.explanation h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.explanation ul {
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

/* Bet slip (wager entry within a market group) */
.bet-slip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.bet-slip-input {
  width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.bet-slip-input:focus {
  border-color: var(--accent);
}

.bet-slip-msg {
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
}

.bet-slip-msg.error {
  color: var(--red);
}

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--green);
  color: #0f1117;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  pointer-events: none;
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Betting — no lines placeholder */
.lines-coming-soon {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 16px;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 14px;
  margin-top: 8px;
}

/* Games page layout */
.games-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

/* Bet slip panel */
.bet-slip-panel {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.slip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.slip-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.slip-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.slip-items {
  max-height: 60vh;
  overflow-y: auto;
}

.slip-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.slip-item:last-child {
  border-bottom: none;
}

.slip-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.slip-item-pick {
  font-size: 13px;
  font-weight: 600;
}

.slip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.slip-remove:hover {
  color: var(--red);
  background: rgba(247, 111, 111, 0.1);
}

.slip-item-game {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.slip-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slip-item-odds {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 44px;
  font-variant-numeric: tabular-nums;
}

.slip-item-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
}

.slip-item-input:focus {
  border-color: var(--accent);
}

.slip-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.slip-totals {
  margin-bottom: 4px;
}

.slip-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.slip-totals-row:last-child {
  font-weight: 600;
  color: var(--text);
}

.slip-msg {
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-muted);
  min-height: 16px;
}

.slip-msg.error {
  color: var(--red);
}

.slip-msg.success {
  color: var(--green);
}

/* Slip item — info block (pick + game label stacked) */
.slip-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

/* Override: game label sits inside the header now, no bottom margin needed */
.slip-item-info .slip-item-game {
  margin-bottom: 0;
}

/* Wager row: input + odds badge side by side */
.slip-item-row {
  margin-top: 8px;
}

/* Compact odds badge next to the wager input */
.slip-item-odds-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: 4px;
  padding: 4px 7px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Invalid wager input */
.slip-item-input.error {
  border-color: var(--red);
}

/* Odds badge on its own row */
.slip-item-odds-row {
  margin-top: 8px;
}

/* Risk row: label + input + unit */
.slip-item-risk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.slip-risk-label,
.slip-risk-unit {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Payout preview line beneath the risk row */
.slip-item-preview {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.slip-preview-payout strong {
  color: var(--text);
}

.slip-preview-invalid {
  color: var(--red);
  font-style: italic;
}

/* Slip item — market type + odds badge row */
.slip-item-market-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 2px;
}

.slip-item-market-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* Green CTA button for place bets */
.btn-green {
  background: var(--green);
  color: #0f1117;
}

.btn-green:hover {
  filter: brightness(1.1);
}

.btn-green:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Remaining balance turns red when over budget */
#slip-remaining.negative {
  color: var(--red);
  font-weight: 700;
}

/* Remaining row: separator + bold */
.slip-totals-remaining {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 600;
  color: var(--text) !important;
}

/* Success state shown in the slip items area after bets are placed */
.slip-success {
  padding: 28px 16px;
  text-align: center;
}

.slip-success-icon {
  font-size: 28px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1;
}

.slip-success p {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

/* Final score — compact card (no duplicate header) */
.final-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}

.final-score-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.final-score-team .team-logo {
  width: 30px;
  height: 30px;
}

.final-score-name {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.final-score-name.winner {
  color: var(--text);
  font-weight: 600;
}

.final-score-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.final-score-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-muted);
}

.final-score-number.winner {
  color: var(--green);
}

.final-score-sep {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-muted);
}

.final-score-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px 12px;
  gap: 8px;
}

.final-score-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Schedule note */
.schedule-note {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px;
}

.schedule-note.betting-closed {
  color: var(--red);
  font-style: normal;
  font-weight: 600;
}

/* Final badge */
.badge-final {
  background: rgba(124, 130, 160, 0.12);
  color: var(--text-muted);
}

.badge-forfeit {
  background: rgba(247, 201, 72, 0.15);
  color: var(--yellow);
}

/* Balance audit column — settled bets and parlays */
.balance-audit {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Account page — parlay entries */
.parlay-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.parlay-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.parlay-entry:first-child {
  padding-top: 0;
}

.parlay-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.parlay-n-legs {
  font-size: 13px;
  font-weight: 600;
}

.parlay-entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.parlay-entry-detail {
  font-size: 13px;
  color: var(--text-muted);
}

.parlay-entry-detail strong {
  color: var(--text);
}

.parlay-entry-legs {
  margin-top: 6px;
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.parlay-leg-item {
  font-size: 12px;
  color: var(--text-muted);
}

.parlay-leg-odds-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.parlay-payout-pos {
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.parlay-payout-neg {
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.parlay-leg-unavailable {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Remove padding on the td that wraps a parlay row so it aligns with the table */
.parlay-table-row td {
  padding: 0;
}

.parlay-table-row .parlay-entry {
  padding: 12px 12px;
}

/* Slip mode toggle (Straight / Parlay) */
.slip-mode-toggle {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.slip-mode-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.slip-mode-btn:hover {
  color: var(--text);
}

.slip-mode-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Parlay "add more" notice */
.parlay-min-notice {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Parlay combined odds display */
.parlay-summary {
  margin-bottom: 10px;
}

.parlay-combined-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.parlay-combined-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Game card state variants */
.game-card--bettable {
  border-color: rgba(79, 142, 247, 0.3);
}

.game-card--final,
.game-card--inactive {
  border-color: rgba(46, 50, 72, 0.5);
}

.game-card--inactive .game-card-meta {
  background: transparent;
  border-bottom-color: rgba(46, 50, 72, 0.4);
}

.game-card--inactive .matchup-team-name {
  color: var(--text-muted);
  font-weight: 500;
}

/* Account — net result column */
.net-pos {
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.net-neg {
  color: var(--red);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.net-neutral {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Admin modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  bottom: 0;
}

.modal-result {
  font-size: 13px;
  padding: 8px 20px 12px;
  min-height: 28px;
}

/* Hidden on desktop — shown on mobile via media query below */
.game-card-sb-grid {
  display: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Tablet — collapse sidebar; bet slip becomes a collapsible bottom drawer */
@media (max-width: 768px) {
  .games-layout {
    grid-template-columns: 1fr;
  }

  /* Pad bottom so last game card clears the mobile bar */
  .games-list {
    padding-bottom: 80px;
  }

  .bet-slip-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 2px solid var(--accent);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .bet-slip-panel.drawer-open {
    transform: translateY(0);
  }

  .slip-header,
  .slip-mode-toggle,
  .slip-footer {
    flex-shrink: 0;
  }

  .slip-items {
    max-height: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* Show close button only on mobile */
  .slip-drawer-close {
    display: block;
  }

  /* Hide desktop matchup row on mobile bettable cards (DK grid shows teams) */
  .game-card--bettable .game-matchup-row {
    display: none;
  }

  /* Show DK grid, hide desktop 3-column layout */
  .game-card-markets {
    display: none;
  }

  .game-card-sb-grid {
    display: block;
  }
}

/* Mobile phones */
@media (max-width: 680px) {
  nav {
    padding: 0 12px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-brand {
    font-size: 15px;
    flex-shrink: 0;
    margin-right: 4px;
  }

  nav a {
    font-size: 12px;
    padding: 6px 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .page {
    padding: 16px 12px 32px;
  }

  .page-header {
    margin-bottom: 18px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .card {
    overflow-x: auto;
    padding: 16px;
  }

  .game-card-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .game-card-markets {
    grid-template-columns: 1fr;
    padding: 8px 12px 12px;
    gap: 6px;
  }

  .game-matchup-row {
    padding: 12px 14px 10px;
  }

  .game-matchup-row .team-logo {
    width: 28px;
    height: 28px;
  }

  .matchup-team-name {
    font-size: 13px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 22px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none;
  }

  /* Slip place-bet button goes full width on mobile */
  .slip-footer .btn {
    width: 100%;
  }
}

/* Logout button — visually distinct from regular nav tabs */
.logout-btn {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca !important;
}

/* ── Week group collapsing (betting page) ─────────────────────────────────── */

.week-group-header {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.week-group-header:hover {
  background: rgba(255, 255, 255, 0.08);
}

.week-group-body.collapsed {
  display: none;
}

.week-toggle {
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Login page ───────────────────────────────────────────────────────────── */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.login-bg-logo {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.login-bg-logo img {
  width: min(85vw, 640px);
  height: auto;
  opacity: 0.055;
  filter: blur(3px);
  user-select: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(26, 29, 39, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 390px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}

.login-card-logo {
  text-align: center;
  margin-bottom: 18px;
}

.login-card-logo img {
  width: 72px;
  height: auto;
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 28px;
}

.login-submit-btn {
  width: 100%;
}

.login-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 10px;
  min-height: 18px;
  text-align: center;
}

@media (max-width: 460px) {
  .login-card {
    padding: 32px 22px;
    border-radius: 10px;
    margin: 0 12px;
    max-width: none;
    width: auto;
  }
}

/* Very small phones */
@media (max-width: 400px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  nav a {
    font-size: 11px;
    padding: 5px 6px;
  }
}

/* ── Slip header right-side cluster (count + close button) ──────────────────── */

.slip-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slip-drawer-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
  touch-action: manipulation;
}

.slip-drawer-close:hover {
  color: var(--text);
}

/* ── Sportsbook game card grid (DK-style) ───────────────────────────────────── */

.sb-col-headers {
  display: grid;
  grid-template-columns: 1fr 84px 84px 84px;
  gap: 6px;
  padding: 6px 12px 4px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.sb-teams-col { /* spacer */ }

.sb-mkt-hdr {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 2px 0;
}

.sb-team-row {
  display: grid;
  grid-template-columns: 1fr 84px 84px 84px;
  gap: 6px;
  padding: 7px 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.sb-team-row.sb-team-row--last {
  border-bottom: none;
}

.sb-tie-row {
  display: grid;
  grid-template-columns: 1fr 84px 84px 84px;
  gap: 6px;
  padding: 4px 12px 8px;
  align-items: center;
  border-top: 1px solid var(--border);
}

.sb-team-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 4px;
}

.sb-team-info .team-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.sb-team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-tie-label {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

.sb-mkt-col {
  /* wrapper — fills column */
}

.sb-mkt-empty {
  min-height: 52px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid rgba(46, 50, 72, 0.3);
  opacity: 0.4;
}

.sb-bet-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  min-height: 52px;
  width: 100%;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sb-bet-tile:hover {
  border-color: var(--accent);
  background: rgba(79, 142, 247, 0.07);
  box-shadow: 0 0 0 1px rgba(79, 142, 247, 0.15);
}

.sb-bet-tile:active {
  opacity: 0.75;
}

.sb-bet-tile.selected {
  border-color: var(--green);
  background: rgba(62, 207, 142, 0.1);
  box-shadow: 0 0 0 1px rgba(62, 207, 142, 0.2);
}

.sb-tile-line {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  min-height: 14px;
}

.sb-tile-odds {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.sb-bet-tile.selected .sb-tile-line {
  color: rgba(62, 207, 142, 0.7);
}

.sb-bet-tile.selected .sb-tile-odds {
  color: var(--green);
}

/* ── Mobile bet slip bottom bar ─────────────────────────────────────────────── */

.mobile-bet-slip-bar {
  display: none;
}

.bet-slip-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
  -webkit-tap-highlight-color: transparent;
}

.bet-slip-backdrop.visible {
  display: block;
}

@media (max-width: 768px) {
  .mobile-bet-slip-bar {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 148;
    background: var(--accent);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .mobile-bet-slip-bar.bar-visible {
    transform: translateY(0);
  }

  .mobile-slip-bar-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    height: 56px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-slip-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-slip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    min-width: 22px;
    text-align: center;
  }

  .mobile-slip-bar-label {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.1px;
  }

  .mobile-slip-bar-payout {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
  }

  .mobile-slip-bar-chevron {
    margin-left: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s;
    flex-shrink: 0;
  }

  .mobile-bet-slip-bar.drawer-open .mobile-slip-bar-chevron {
    transform: rotate(180deg);
  }

  /* Compact grid on small phones */
  .sb-col-headers,
  .sb-team-row,
  .sb-tie-row {
    grid-template-columns: 1fr 68px 68px 68px;
    gap: 4px;
  }

  .sb-col-headers {
    padding: 5px 10px 3px;
  }

  .sb-team-row {
    padding: 6px 10px;
  }

  .sb-tie-row {
    padding: 4px 10px 7px;
  }

  .sb-tile-odds {
    font-size: 13px;
  }
}
