/* === DUELS TAB COMPLET === */
.duels-container {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.duels-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.duels-tabs::-webkit-scrollbar {
  display: none;
}

.duels-tab-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.duels-tab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.duels-tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
}

#duels-content {
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

.create-duel-form {
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.create-duel-form h3 {
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 1.3em;
}

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

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
}

.duel-types, .game-modes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.duel-type-btn, .game-mode-btn {
  flex: 1;
  min-width: 120px;
  padding: 15px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.duel-type-btn:hover, .game-mode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.duel-type-btn.active, .game-mode-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  font-size: 1em;
  transition: all 0.3s;
}

.form-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-results {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result-item .league-icon {
  font-size: 1.3em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.player-name {
  font-weight: 600;
  flex: 1;
}

.player-elo {
  color: #feca57;
  font-size: 0.9em;
}

.selected-player {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 12px 15px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
}

.remove-btn {
  background: rgba(255, 107, 107, 0.3);
  border: none;
  color: #ff6b6b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: #ff6b6b;
  color: white;
}

.hint {
  margin-top: 8px;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.5);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(238, 90, 36, 0.4);
}

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

.pending-duels-list, .duels-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.duel-card {
  background: rgba(255, 255, 255, 0.08);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.duel-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.duel-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.duel-sport {
  display: inline-block;
  padding: 5px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 600;
  align-self: flex-start;
}

.duel-vs {
  font-size: 1.05em;
  font-weight: 600;
}

.duel-bet {
  color: #feca57;
  font-weight: 600;
  font-size: 0.95em;
}

.duel-actions {
  display: flex;
  gap: 10px;
}

.duel-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-success {
  background: linear-gradient(135deg, #1dd1a1 0%, #10ac84 100%);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 5px 15px rgba(29, 209, 161, 0.3);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.3);
}

.btn-cancel {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: rgba(255, 193, 7, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.duel-status {
  text-align: center;
  padding: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  border-radius: 8px;
  margin-top: 10px;
}

.duel-status.submitted {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.duel-status.needs-submit {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.duel-status.pending-validation {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  color: #2196f3;
}

/* === FORMULAIRE RÉSULTAT === */
.result-form {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
}

.result-form h4 {
  margin: 0 0 15px 0;
  color: white;
  font-size: 1em;
  text-align: center;
}

.score-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 120px;
}

.score-group label {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
}

.score-group input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 1.5em;
  text-align: center;
  font-weight: bold;
  transition: all 0.3s;
}

.score-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: #667eea;
}

.vs-separator {
  font-size: 1.2em;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 10px;
}

/* === SÉLECTION GAGNANT (BILLARD) === */
.winner-selection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.winner-selection label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
}

.winner-selection label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.winner-selection input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

.winner-selection label:has(input:checked) {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn-submit {
  flex: 1;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-cancel {
  padding: 14px 20px;
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 8px;
  color: #f44336;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-cancel:hover {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.6);
}

.btn-cancel-small {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 8px;
  color: #f44336;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-cancel-small:hover {
  background: rgba(244, 67, 54, 0.25);
  border-color: rgba(244, 67, 54, 0.5);
}

.loading, .empty-state, .error-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1em;
}

.empty-state {
  font-style: italic;
}

.error-state {
  color: #ff6b6b;
}

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

@media (max-width: 600px) {
  .duels-container {
    padding: 15px;
  }
  
  .create-duel-form {
    padding: 20px 15px;
  }
  
  .duel-types, .game-modes {
    flex-direction: column;
  }
  
  .duel-type-btn, .game-mode-btn {
    min-width: auto;
  }
}
/* === HISTORIQUE === */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.history-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 18px;
}

.history-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.duel-date {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85em;
}

.history-match {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.history-match .team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 2px solid transparent;
}

.history-match .team.winner {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.4);
}

.history-match .team-name {
  flex: 1;
  color: white;
  font-weight: 600;
}

.history-match .team-score {
  font-size: 1.5em;
  font-weight: bold;
  color: white;
}

.history-match .trophy {
  font-size: 1.2em;
}

.history-match .vs {
  color: rgba(255, 255, 255, 0.4);
  font-weight: bold;
}

.history-details {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-details .detail {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

.history-details .detail.bonus {
  color: #ffc107;
  font-weight: 600;
}

/* === CLASSEMENTS === */
.rankings-container {
  max-width: 700px;
  margin: 0 auto;
}

.sport-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  justify-content: center;
  flex-wrap: wrap;
}

.sport-btn {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.sport-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sport-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.leaderboard-row.podium {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-row .rank {
  font-size: 1.2em;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
}

.leaderboard-row .league-badge {
  font-size: 1.3em;
  margin: 0 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.leaderboard-row .player-name {
  flex: 1;
  color: white;
  font-weight: 600;
  font-size: 1.05em;
}

.leaderboard-row .elo {
  font-size: 1.3em;
  font-weight: bold;
  color: #667eea;
  min-width: 100px;
  text-align: right;
}

.leaderboard-row .elo small {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: normal;
}

.leaderboard-row .stats {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95em;
  min-width: 120px;
  text-align: right;
}

.leaderboard-row .stats small {
  color: rgba(255, 255, 255, 0.5);
}

/* === MES STATS === */
.my-stats-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.stats-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 25px;
}

.stats-card h3 {
  margin: 0 0 20px 0;
  color: white;
  font-size: 1.4em;
  text-align: center;
}

.stat-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.stat-row.main {
  margin-bottom: 25px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.stat-item.large {
  padding: 20px;
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: white;
  margin-bottom: 5px;
}

.stat-item.large .stat-value {
  font-size: 2.5em;
}

.stat-value.wins {
  color: #4caf50;
}

.stat-value.losses {
  color: #f44336;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.streak {
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  margin-top: 15px;
}

.streak.positive {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #4caf50;
}

.streak.negative {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #f44336;
}

.best-streak {
  padding: 10px 15px;
  margin-top: 10px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  text-align: center;
  color: #ffd700;
  font-weight: 600;
}

@media (max-width: 600px) {
  .stat-row {
    flex-wrap: wrap;
  }
  
  .stat-item {
    min-width: calc(50% - 8px);
  }
  
  .leaderboard-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .leaderboard-row .rank {
    min-width: 30px;
  }
  
  .leaderboard-row .stats {
    width: 100%;
    text-align: left;
    margin-left: 45px;
  }
}

/* === STYLES POUR ELO CHANGE === */
.elo-change {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 8px;
}

.elo-change.positive {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.3);
}

.elo-change.negative {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.3);
}

/* === MODAL HISTORIQUE JOUEUR === */
.player-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.player-history-modal.show {
  opacity: 1;
}

.modal-content {
  background: rgba(45, 52, 54, 0.85);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-history-modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.2em;
}

.close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: rgba(255, 71, 87, 0.3);
}

.modal-body {
  padding: 20px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.player-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 3px solid;
  transition: all 0.3s ease;
}

.player-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.player-history-item.win {
  border-left-color: #2ed573;
}

.player-history-item.loss {
  border-left-color: #ff4757;
}

.player-history-item .result {
  font-weight: 700;
  font-size: 0.9em;
  min-width: 40px;
}

.player-history-item .opponent {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.player-history-item .score {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.player-history-item .date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85em;
  min-width: 60px;
  text-align: right;
}

/* === LEADERBOARD CLICKABLE === */
.leaderboard-row {
  cursor: pointer;
  transition: all 0.3s ease;
}

.leaderboard-row:hover {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.08);
}