/* ─── Wynbook Dark Luxury Theme ─── */

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #111114;
  --bg-tertiary: #18181c;
  --bg-card: #1a1a1f;
  --bg-hover: #222228;
  --bg-input: #16161a;

  --gold: #d4a843;
  --gold-dim: #b8922e;
  --gold-glow: rgba(212, 168, 67, 0.15);
  --gold-bright: #e6be5a;

  --back-blue: #2563eb;
  --back-blue-dim: #1d4ed8;
  --back-blue-bg: rgba(37, 99, 235, 0.12);
  --back-blue-glow: rgba(37, 99, 235, 0.25);

  --lay-pink: #db2777;
  --lay-pink-dim: #be185d;
  --lay-pink-bg: rgba(219, 39, 119, 0.12);
  --lay-pink-glow: rgba(219, 39, 119, 0.25);

  --text-primary: #e8e8ed;
  --text-secondary: #9898a4;
  --text-muted: #5a5a6a;
  --text-gold: #d4a843;

  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --orange: #f59e0b;

  --border: #2a2a32;
  --border-light: #333340;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --sidebar-width: 240px;
  --betslip-width: 320px;
  --header-height: 56px;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);

  --glass-bg: rgba(26, 26, 31, 0.85);
  --glass-border: rgba(255, 255, 255, 0.06);
}

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

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dim); }

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── App Layout ─── */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
#header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

#header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(212, 168, 67, 0.3) 40%, transparent 100%);
}

.header-logo {
  height: 28px;
  flex-shrink: 0;
}

.header-logo img { height: 100%; }

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}

.header-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.header-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.header-nav a.active {
  color: var(--gold);
  background: var(--gold-glow);
}

/* Search Bar */
.header-search {
  margin-left: 12px;
  flex-shrink: 0;
}

.search-input {
  width: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--gold);
  width: 260px;
  box-shadow: 0 0 8px var(--gold-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.header-spacer { flex: 1; }

.header-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.header-balance .balance-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.balance-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
}

.header-balance .balance-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-balance .balance-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--green);
  font-size: 14px;
}

.header-balance .balance-value.exposure {
  color: var(--red);
}

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

.header-user .username {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}

.btn-auth {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-login {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-login:hover {
  background: var(--gold-glow);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 4px 10px;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ─── Three-Column Layout ─── */
#layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ─── Sidebar ─── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  padding: 0 16px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.sidebar-item.active {
  background: var(--gold-glow);
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

.sidebar-comp-item {
  padding-left: 28px;
  font-size: 12px;
}

.sidebar-comp-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-expand-icon {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
}

.sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sidebar-item.live .sidebar-icon {
  color: var(--green);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Main Content ─── */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg-primary);
}

/* ─── Section Headers ─── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header .section-icon {
  font-size: 20px;
}

.section-header .section-badge {
  background: var(--gold-glow);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

/* ─── Team Badge ─── */
.team-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  font-family: var(--font-body);
  line-height: 1;
}

/* ─── Winner Section (Tournament) ─── */
.winner-section {
  margin-bottom: 28px;
}

.winner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.winner-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  position: relative;
}

.winner-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.2) 0%, transparent 50%, rgba(212, 168, 67, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.winner-card:hover {
  border-color: rgba(212, 168, 67, 0.3);
  background: var(--bg-hover);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

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

.winner-odds {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ─── Odds Buttons ─── */
.odds-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  font-family: var(--font-mono);
  transition: all 0.15s;
  line-height: 1.2;
}

.odds-btn .odds-price {
  font-weight: 700;
  font-size: 13px;
}

.odds-btn .odds-size {
  font-size: 9px;
  opacity: 0.7;
}

.odds-btn.back {
  background: var(--back-blue-bg);
  color: var(--back-blue);
}

.odds-btn.back:hover {
  background: rgba(37, 99, 235, 0.22);
  box-shadow: 0 0 10px var(--back-blue-glow);
}

.odds-btn.back.selected {
  background: var(--back-blue);
  color: #fff;
  box-shadow: 0 0 14px var(--back-blue-glow);
}

.odds-btn.lay {
  background: var(--lay-pink-bg);
  color: var(--lay-pink);
}

.odds-btn.lay:hover {
  background: rgba(219, 39, 119, 0.22);
  box-shadow: 0 0 10px var(--lay-pink-glow);
}

.odds-btn.lay.selected {
  background: var(--lay-pink);
  color: #fff;
  box-shadow: 0 0 14px var(--lay-pink-glow);
}

.odds-btn.suspended {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Depth level styling for 3-level odds */
.odds-btn.depth-1 {
  opacity: 0.75;
  min-width: 64px;
}

.odds-btn.depth-2 {
  opacity: 0.55;
  min-width: 60px;
}

/* ─── Event Cards ─── */
.event-group {
  margin-bottom: 28px;
}

.event-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.event-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.event-card-header .competition-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-inplay {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 600;
  font-size: 11px;
}

/* P&L Badge */
.event-pnl-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.pnl-positive {
  color: var(--green);
  background: var(--green-bg);
}

.pnl-negative {
  color: var(--red);
  background: var(--red-bg);
}

/* Market Type Badges */
.market-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.fancy-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.bm-badge {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
}

.tv-badge {
  background: rgba(147, 51, 234, 0.15);
  color: #a855f7;
}

/* Matched Amount */
.matched-amount {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.8;
}

.event-runner-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 12px;
  border-bottom: 1px solid rgba(42, 42, 50, 0.5);
}

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

.runner-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.runner-odds {
  display: flex;
  gap: 4px;
}

.depth-odds {
  gap: 3px;
}

.odds-header-row {
  display: flex;
  justify-content: flex-end;
  padding: 4px 14px 0;
  gap: 4px;
}

.odds-header-label {
  width: 72px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.odds-header-label.back { color: var(--back-blue); }
.odds-header-label.lay { color: var(--lay-pink); }

/* 3-level depth header */
.depth-header-row {
  display: flex;
  align-items: center;
  padding: 4px 14px 0;
  gap: 3px;
}

.depth-header-row .depth-spacer {
  flex: 1;
}

.depth-header-row .odds-header-label {
  width: 64px;
}

.depth-header-row .odds-header-label.best {
  width: 72px;
  font-weight: 700;
}

.depth-row .runner-odds {
  gap: 3px;
}

/* ─── Match Detail Page ─── */
.match-back-nav {
  margin-bottom: 16px;
}

.match-back-nav a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.match-back-nav a:hover {
  color: var(--gold);
}

.match-title-bar {
  margin-bottom: 16px;
}

.match-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Score Banner */
.score-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.score-text {
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
}

.score-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.score-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-team-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.score-team-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.score-overs {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.score-vs {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.score-meta {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.score-status {
  text-align: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

/* Match Sections */
.match-section {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.match-section-header {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.odds-header {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: var(--back-blue);
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

.bookmaker-header {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15) 0%, rgba(212, 168, 67, 0.05) 100%);
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 168, 67, 0.2);
}

.fancy-header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  color: var(--green);
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.other-header {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1) 0%, transparent 100%);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

/* Market Block */
.market-block {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.market-block:last-child {
  border-bottom: none;
}

.market-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(42, 42, 50, 0.5);
}

.market-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-status-badge.suspended {
  background: var(--red-bg);
  color: var(--red);
}

.market-status-badge.open {
  background: var(--green-bg);
  color: var(--green);
}

/* Fancy Table */
.fancy-table-header {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.fancy-name-col {
  flex: 1;
}

.fancy-no-col {
  width: 80px;
  text-align: center;
  color: var(--lay-pink);
}

.fancy-yes-col {
  width: 80px;
  text-align: center;
  color: var(--back-blue);
}

.fancy-category {
  border-top: 1px solid var(--border);
}

.fancy-category-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(42, 42, 50, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fancy-row {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(42, 42, 50, 0.3);
  gap: 8px;
}

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

.fancy-row.suspended {
  opacity: 0.4;
}

.fancy-market-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fancy-no-btn,
.fancy-yes-btn {
  width: 76px;
  min-width: 76px;
  flex-shrink: 0;
}

/* ─── Bet Slip Panel ─── */
#betslip-panel {
  width: var(--betslip-width);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.betslip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.betslip-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.betslip-count {
  background: var(--gold);
  color: #0a0a0c;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.betslip-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.betslip-clear:hover {
  color: var(--red);
  background: var(--red-bg);
}

.betslip-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.betslip-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  gap: 8px;
}

.betslip-empty .empty-icon {
  font-size: 32px;
  opacity: 0.5;
}

/* Single bet slip item */
.slip-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
}

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

.slip-event-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.slip-runner-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.slip-remove:hover {
  color: var(--red);
  background: var(--red-bg);
}

.slip-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.slip-type-badge.back {
  background: var(--back-blue-bg);
  color: var(--back-blue);
}

.slip-type-badge.lay {
  background: var(--lay-pink-bg);
  color: var(--lay-pink);
}

.slip-odds {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  margin-left: 6px;
}

.slip-stake-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.slip-stake-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.slip-stake-input:focus {
  border-color: var(--gold);
}

.slip-stake-input::placeholder {
  color: var(--text-muted);
}

.quick-stakes {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.quick-stake-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 2px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-stake-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

.slip-return {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}

.slip-return .label { color: var(--text-muted); }
.slip-return .value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--green);
}

/* Betslip footer */
.betslip-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  flex-shrink: 0;
}

.betslip-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}

.betslip-total .label {
  color: var(--text-secondary);
  font-weight: 500;
}

.betslip-total .value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.btn-place-bets {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: #0a0a0c;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.2);
}

.btn-place-bets:hover {
  background: linear-gradient(135deg, var(--gold-dim) 0%, var(--gold) 100%);
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.35);
  transform: translateY(-1px);
}

.btn-place-bets:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ─── Auth Pages ─── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card .auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 13px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.form-input:focus {
  border-color: var(--gold);
}

.form-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--gold);
  color: #0a0a0c;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link a {
  color: var(--gold);
  font-weight: 600;
}

/* ─── My Bets Page ─── */
.bets-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

.bet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: all 0.15s;
}

.bet-row:hover {
  border-color: var(--border-light);
}

.bet-info { flex: 1; }

.bet-event {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.bet-selection {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.bet-market {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.bet-details {
  text-align: right;
  flex-shrink: 0;
}

.bet-odds {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.bet-stake {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.bet-pnl {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.bet-pnl.positive { color: var(--green); }
.bet-pnl.negative { color: var(--red); }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.open, .status-badge.pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--orange);
}

.status-badge.won {
  background: var(--green-bg);
  color: var(--green);
}

.status-badge.lost {
  background: var(--red-bg);
  color: var(--red);
}

.status-badge.void, .status-badge.cashout {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.type-badge.back {
  background: var(--back-blue-bg);
  color: var(--back-blue);
}

.type-badge.lay {
  background: var(--lay-pink-bg);
  color: var(--lay-pink);
}

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

.wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.wallet-card .wallet-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.wallet-card .wallet-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
}

.wallet-card .wallet-value.balance { color: var(--text-primary); }
.wallet-card .wallet-value.exposure { color: var(--red); }
.wallet-card .wallet-value.available { color: var(--green); }

.btn-reset {
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ─── Leaderboard ─── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(42, 42, 50, 0.5);
}

.leaderboard-table tr:hover td {
  background: var(--bg-hover);
}

.lb-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  width: 40px;
}

.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-profit {
  font-family: var(--font-mono);
  font-weight: 700;
}

.lb-profit.positive { color: var(--green); }
.lb-profit.negative { color: var(--red); }

.lb-winrate {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ─── Toast ─── */
#toast-container {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 340px;
}

.toast.success {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

.toast.error {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ─── Loading / Empty States ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}

.empty-state .empty-icon {
  font-size: 40px;
  opacity: 0.5;
  margin-bottom: 8px;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  #sidebar { display: none; }
  :root { --sidebar-width: 0px; }
}

@media (max-width: 800px) {
  #betslip-panel { display: none; }
  :root { --betslip-width: 0px; }
  #main { padding: 12px; }
  .header-search { display: none; }
  .score-teams { flex-direction: column; gap: 12px; }
  .depth-header-row .odds-header-label { width: 50px; font-size: 9px; }
  .odds-btn.depth-1, .odds-btn.depth-2 { min-width: 50px; }
}

/* ─── Misc Utilities ─── */
.text-mono { font-family: var(--font-mono); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ─── Team Logo in Badge ─── */
.team-badge-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.team-logo-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ─── Market Tabs (SkyExch-style) ─── */
.market-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.market-tab-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.market-tab-btn.active {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  box-shadow: 0 -2px 8px rgba(212, 168, 67, 0.25);
}

/* ─── One-Click Bet Toggle ─── */
.one-click-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: all 0.2s;
  user-select: none;
  flex-shrink: 0;
}

.one-click-toggle:hover {
  border-color: var(--gold-dim);
}

.one-click-toggle.active {
  background: rgba(212, 168, 67, 0.15);
  border-color: var(--gold);
}

.one-click-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.one-click-toggle.active .one-click-label {
  color: var(--gold);
}

.one-click-switch {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg-hover);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.one-click-toggle.active .one-click-switch {
  background: var(--gold);
}

.one-click-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s;
}

.one-click-toggle.active .one-click-knob {
  left: 16px;
  background: #111;
}

/* ─── Enhanced Score Banner ─── */
.score-target {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.score-football {
  justify-content: center;
}

.score-football-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-football-goals {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.score-football-minute {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

/* ─── Responsive additions ─── */
@media (max-width: 800px) {
  .one-click-toggle { display: none; }
  .market-tabs { gap: 2px; }
  .market-tab-btn { padding: 6px 12px; font-size: 11px; }
}

/* Team logo images - make white background transparent on dark theme */
.team-logo-img {
  border-radius: 4px;
  mix-blend-mode: screen;
  vertical-align: middle;
  margin-right: 6px;
}
