/* sports.css - 澳门 VIP 奢华黑金 H5 实时赛事竞猜视口专用样式 */

.sports-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 顶部跑马灯与状态栏 */
.sports-banner-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  box-shadow: var(--shadow-card);
}

.sports-marquee {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.marquee-pill {
  background: var(--gold-gradient);
  color: #000;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.marquee-track {
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition-fast);
}

.ws-status-badge.connected .ws-dot {
  background: var(--green-emerald);
  box-shadow: 0 0 10px var(--green-emerald);
}

.ws-status-badge.connecting .ws-dot {
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.ws-status-badge.disconnected .ws-dot {
  background: var(--red-accent);
}

/* 分类 Tab 与操作栏 */
.sports-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sports-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sports-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.sports-tab-btn:hover, .sports-tab-btn.active {
  background: var(--gold-gradient);
  color: #000;
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-glow-gold);
}

.btn-my-bets {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cyan-gradient);
  color: #000;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-glow-cyan);
  transition: var(--transition-fast);
}

.btn-my-bets:hover {
  transform: translateY(-1px);
}

/* 赛事列表网格 */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.match-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-gold);
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.match-league {
  font-weight: 800;
  font-size: 13px;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.match-status-badge.live {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseLive 2s infinite;
}

.match-status-badge.finished {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 对战区 */
.match-teams-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.team-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
}

.team-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #2a374d 0%, #161f30 100%);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.team-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-vs-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.match-score {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 2px;
  font-family: monospace;
}

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

/* 赔率下注按钮组 (1X2) */
.odds-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.odd-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.odd-btn:hover {
  border-color: var(--border-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.odd-btn.selected {
  background: var(--gold-gradient);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-glow-gold);
}

.odd-btn.selected .odd-label,
.odd-btn.selected .odd-val {
  color: #000 !important;
  font-weight: 800;
}

.odd-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.odd-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan-neon);
}

/* 下注抽屉浮层 (Betting Slip Drawer) */
.bet-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.bet-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bet-drawer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), var(--shadow-glow-gold);
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bet-drawer.active {
  transform: translateY(0);
}

.bet-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.bet-drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

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

.bet-selection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bet-match-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bet-match-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.bet-choice-badge {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.bet-choice-odds {
  font-size: 18px;
  font-weight: 900;
  color: var(--cyan-neon);
}

.bet-amount-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bet-amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.bet-currency-symbol {
  position: absolute;
  left: 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
}

.bet-amount-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 34px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  outline: none;
}

.bet-amount-input:focus {
  border-color: var(--cyan-neon);
  box-shadow: var(--shadow-glow-cyan);
}

.quick-chips-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip-btn:hover {
  background: var(--gold-gradient);
  color: #000;
  border-color: var(--gold-primary);
}

.payout-calculation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.payout-val {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold-primary);
  font-family: monospace;
}

.btn-confirm-bet {
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-glow-gold);
  transition: var(--transition-fast);
}

.btn-confirm-bet:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 184, 0, 0.6);
}

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

/* 我的注单模态框 (My Bets Modal) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), var(--shadow-glow-gold);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-gold);
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bet-record-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bet-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.bet-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.bet-status-pill.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-secondary);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.bet-status-pill.won {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bet-status-pill.lost {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.bet-record-match {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.bet-record-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
}

.bet-record-payout {
  font-weight: 800;
  font-size: 14px;
}

.bet-record-payout.won {
  color: var(--green-emerald);
}

/* 浮动中奖祝贺 Notification */
.win-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--gold-gradient);
  color: #000;
  border-radius: var(--radius-md);
  padding: 16px 22px;
  font-weight: 800;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 184, 0, 0.6);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInToast 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .sports-banner-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .sports-marquee {
    width: 100%;
    min-width: 0;
  }
  .matches-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sports-container {
    padding: 10px 12px;
    gap: 14px;
  }
  .match-card {
    padding: 14px;
  }
  .team-name {
    max-width: 100px;
    font-size: 13px;
  }
  .match-score {
    font-size: 20px;
  }
  .bet-drawer {
    padding: 16px 16px max(22px, env(safe-area-inset-bottom));
    max-height: 90dvh;
    overflow-y: auto;
  }
  .win-toast {
    left: 12px;
    right: 12px;
    top: 12px;
    padding: 12px 16px;
  }
}

@media (max-width: 420px) {
  .quick-chips-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .matches-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .bet-drawer {
    max-height: 92dvh;
    overflow-y: auto;
    padding: 12px 18px;
    gap: 10px;
  }
}
