:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-dark: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --text-primary: #f8fafc;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-hover: #2563eb;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --danger: #ef4444;
}

@keyframes cardScrollTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

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

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  margin-bottom: 32px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFB300;
}

.wallet-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-badge:hover {
  background: rgba(16, 185, 129, 0.3);
}

.nav-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.nav-tab {
  padding: 10px 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.match-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.live-badge {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 5px rgba(239, 68, 68, 1); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
}

.teams-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 8px;
}

.team-logo-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.team-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.odds-btn {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.odds-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .match-layout-grid {
    grid-template-columns: 1fr !important;
  }
  
  .header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .brand {
    font-size: 1.25rem;
  }
  
  #auth-controls {
    gap: 8px !important;
  }
  
  .wallet-badge {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}

.dashboard-card {
  padding: 24px;
}

.dashboard-card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 8px;
}

.list-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.list-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.list-value {
  font-weight: 700;
}

.value-positive {
  color: var(--success);
}

.value-negative {
  color: var(--text-main);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

.bet-input-group {
  margin-bottom: 20px;
  margin-top: 20px;
}

.bet-input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bet-input-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 1.1rem;
}

.bet-input-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.place-bet-btn {
  width: 100%;
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.place-bet-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.place-bet-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


  /* Sportsbook Layout */
  .sportsbook-layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 24px;
    min-height: calc(100vh - 120px);
  }

  /* Left Sidebar */
  .sportsbook-nav {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 24px;
  }
  
  .nav-group-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 4px;
    cursor: pointer;
  }
  
  .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
  }

  /* Main Content Area */
  .sportsbook-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
  }

  /* Banners */
  .promo-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(79, 70, 229, 0.2) 100%);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }
  
  .promo-banner::before {
    content: '';
    position: absolute;
    right: -100px;
    bottom: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.15) 0%, transparent 70%);
    border-radius: 50%;
  }

  .promo-content {
    position: relative;
    z-index: 1;
    max-width: 60%;
  }

  .promo-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #fff;
  }

  .promo-subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 20px;
  }

  .promo-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .promo-btn:hover {
    background: #2563eb;
  }

  .promo-img {
    width: 140px;
    height: 140px;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
  }

  /* Matches Table */
  .matches-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .sportsbook-match-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
  }
  
  .sportsbook-match-card:hover {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(30, 41, 59, 0.7);
  }

  .match-info-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
  }

  .match-time {
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .match-team {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .team-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
  }

  .odds-container {
    display: flex;
    gap: 8px;
  }

  .odd-button {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 16px;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .odd-button:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
  }

  .odd-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .odd-value {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
  }

  /* Right Sidebar (Betslip) */
  .betslip-sidebar {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    gap: 16px;
    min-width: 0;
  }

  .betslip-header {
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .betslip-count {
    background: #3b82f6;
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
  }

  .betslip-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
  }

  .auth-prompt-btn {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: auto;
  }
  
  .auth-prompt-btn:hover {
    background: #059669;
  }

  @media (max-width: 1024px) {
    .sportsbook-layout {
      grid-template-columns: 1fr 300px;
    }
    .sportsbook-nav {
      display: none;
    }
  }

  @media (max-width: 768px) {
    .sportsbook-layout {
      grid-template-columns: 1fr;
    }
    .sportsbook-match-card {
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
    }
    .odds-container {
      width: 100%;
    }
    .odd-button {
      flex: 1;
    }
    .promo-banner {
      flex-direction: column;
      text-align: center;
      gap: 20px;
    }
    .promo-content {
      max-width: 100%;
    }
  }
