/* ==========================================================================
   LIVE TOURNAMENT LEADERBOARD & SCORECARD STYLES
   ========================================================================== */

.leaderboard-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 16px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.live-indicator-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Leaderboard Table */
.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 48px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th {
  background: rgba(6, 64, 43, 0.8);
  padding: 16px 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bright-gold);
  border-bottom: 1px solid var(--border-color);
  font-weight: 800;
}

.leaderboard-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 1rem;
}

.leaderboard-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 0.95rem;
}

.rank-1 {
  background: var(--gold-gradient);
  color: #000;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.rank-2 {
  background: #cbd5e1;
  color: #0f172a;
}

.rank-3 {
  background: #b45309;
  color: #fff;
}

.team-name-cell {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.team-members-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Score Pill Badges */
.score-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.1rem;
  min-width: 54px;
  text-align: center;
}

.score-under {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.score-even {
  background: rgba(251, 191, 36, 0.2);
  color: var(--bright-gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.score-over {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Modal Popup for Score Update */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-card);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

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

.score-adjuster-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 24px 0;
}

.score-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--bright-gold);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.score-btn:hover {
  background: var(--bright-gold);
  color: #000;
}

.score-display-val {
  font-size: 2.5rem;
  font-weight: 900;
  min-width: 80px;
  text-align: center;
}

/* ==========================================================================
   MOBILE RESPONSIVE LEADERBOARD STYLES
   ========================================================================== */
@media (max-width: 640px) {
  .leaderboard-header-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 16px;
    gap: 14px;
  }

  .leaderboard-header-banner div {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .leaderboard-header-banner .btn {
    width: 100%;
    justify-content: center;
  }

  /* Transform Leaderboard Table into Clean Mobile Cards */
  .leaderboard-table, 
  .leaderboard-table tbody, 
  .leaderboard-table tr, 
  .leaderboard-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .leaderboard-table thead {
    display: none;
  }

  .leaderboard-table tr {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: rgba(17, 34, 25, 0.4);
  }

  .leaderboard-table td {
    padding: 0;
    border: none;
  }

  /* Rank Badge Position */
  .leaderboard-table td:nth-child(1) {
    position: absolute;
    top: 16px;
    left: 14px;
    width: auto;
  }

  /* Team Name & Members */
  .leaderboard-table td:nth-child(2) {
    padding-left: 46px;
    padding-right: 74px;
    margin-bottom: 12px;
  }

  .team-name-cell {
    font-size: 1rem;
    line-height: 1.25;
  }

  /* Score Pill Badge Position */
  .leaderboard-table td:nth-child(3) {
    position: absolute;
    top: 16px;
    right: 14px;
    width: auto;
  }

  .score-pill {
    padding: 4px 10px;
    font-size: 0.95rem;
    min-width: 48px;
  }

  /* Meta Details Row (Thru, Hole, Tee time) */
  .leaderboard-table td:nth-child(4),
  .leaderboard-table td:nth-child(5),
  .leaderboard-table td:nth-child(6) {
    display: inline-block;
    width: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 4px;
    margin-top: 4px;
  }

  .modal-box {
    padding: 20px;
    width: 95%;
  }
}
