/* =============================================================================
 * CHAMPIONSHIP.CSS - Styles pour la gestion des championnats Pokémon
 * Version 1.0 - Architecture inspirée de confrontations.css
 * =============================================================================
 */

/* =============================================================================
 * 1. VARIABLES ET THÈME
 * =============================================================================
 */
:root {
  --dark-bg-primary: #1a1e2b;
  --dark-bg-secondary: #242937;
  --dark-bg-tertiary: #2e3445;
  --text-light: #f0f2f5;
  --text-muted: #a0a8b7;
  --primary-color: #4d5bff;
  --primary-light: #6d78ff;
  --primary-dark: #3a47cc;
  --danger: #f44336;
  --info: #3b82f6;
  --warning: #f59e0b;
  --success: #22c55e;
  --border-color: #3a3f51;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --focus-ring: 0 0 0 2px var(--primary-color);
}

/* Accessibilité - focus visible au clavier */
.participant-accordion-header:focus-visible,
.btn:focus-visible,
.participant-fight-header-wrapper:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.participant-accordion-header {
  outline: none;
}

/* Modale ajout de jeu - s'assurer qu'elle s'affiche au-dessus de tout */
#championship-game-modal {
  position: fixed !important;
  z-index: 9999 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

#championship-game-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Duels : même modale d’ajout de jeu que le championnat */
#duel-game-modal {
  position: fixed !important;
  z-index: 9999 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

#duel-game-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Sélecteur de sprites pour jeu personnalisé */
.custom-game-sprites-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-game-sprite-slot {
  flex: 1;
  min-width: 140px;
  max-width: 180px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-game-sprite-slot .sprite-slot-preview {
  position: relative;
}

.custom-game-sprite-slot .sprite-slot-preview {
  position: relative;
  width: 48px;
  height: 48px;
  background: var(--dark-bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.custom-game-sprite-slot .sprite-slot-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.custom-game-sprite-slot .sprite-search-input {
  font-size: 13px;
  padding: 8px 28px 8px 10px;
}

.custom-game-sprite-slot .btn-sprite-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  opacity: 0.8;
}

.custom-game-sprite-slot .sprite-slot-preview .btn-sprite-clear:hover {
  color: var(--danger);
  opacity: 1;
}

.custom-game-sprite-slot:not(.has-sprite) .btn-sprite-clear {
  display: none;
}

.custom-game-sprites-form-group {
  position: relative;
}

#custom-game-sprite-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--dark-bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}

#custom-game-sprite-results.active {
  display: block;
}

.sprite-search-results.active {
  display: block;
}

.sprite-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.sprite-search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sprite-search-result-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* =============================================================================
 * 2. LAYOUT PRINCIPAL - Vue liste des championnats
 * =============================================================================
 */
.championships-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.add-championship-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.championships-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Message vide */
.empty-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-message p:first-child {
  font-size: 24px;
  margin-bottom: 15px;
}

.empty-message p {
  margin: 10px 0;
  font-size: 16px;
}

/* =============================================================================
 * 3. CARTES DE CHAMPIONNAT
 * =============================================================================
 */
.championship-card {
  background: var(--dark-bg-secondary);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.championship-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--primary-color), var(--gold));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.championship-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(77, 91, 255, 0.3);
  border-color: var(--primary-color);
}

.championship-card:hover::before {
  opacity: 1;
}

/* En-tête de la carte */
.championship-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.championship-card-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

.championship-participants-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Corps de la carte */
.championship-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top 3 des joueurs */
.championship-top-3 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--dark-bg-primary);
  border-radius: 12px;
  padding: 16px;
}

.top-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.top-player:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.rank-medal {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.player-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-light);
  font-size: 15px;
}

.player-points {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-light);
}

/* Couleurs des rangs */
.rank-1 .player-name {
  color: var(--gold);
}

.rank-2 .player-name {
  color: var(--silver);
}

.rank-3 .player-name {
  color: var(--bronze);
}

/* Statistiques */
.championship-stats {
  display: flex;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-muted);
}

.championship-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Actions de la carte */
.championship-card-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.championship-card-actions .btn-edit {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
}

.championship-card-actions .btn-edit {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.championship-card-actions .btn-edit:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.championship-card--invite-pending {
  border-color: rgba(245, 158, 11, 0.4);
  cursor: default;
}

.championship-card--invite-pending:hover {
  transform: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.55);
}

.championship-invitation-cta {
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
}

.championship-invitation-text {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.championship-invitation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.championship-invitation-buttons .btn-primary {
  background: rgba(77, 91, 255, 0.35);
  border: 1px solid rgba(77, 91, 255, 0.5);
  color: var(--text-light);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.championship-invitation-buttons .btn-primary:hover {
  background: rgba(77, 91, 255, 0.5);
}

.championship-invitation-buttons .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.championship-invitation-buttons .btn-secondary:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

/* =============================================================================
 * 4. VUE DÉTAILLÉE D'UN CHAMPIONNAT
 * =============================================================================
 */
.championship-details-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* En-tête */
.championship-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-bottom: 30px;
}

.championship-header .btn-back-compact {
  order: 1;
  flex-shrink: 0;
  width: auto;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: var(--dark-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.championship-header .btn-back-compact:hover {
  color: var(--primary-light);
  background: var(--dark-bg-tertiary);
  border-color: var(--primary-color);
}

.championship-header .btn-back-compact .fa-arrow-left {
  margin-right: 6px;
}

.championship-header h1 {
  order: 2;
  flex: 1;
  min-width: 200px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
  text-align: center;
}

.championship-header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Informations du championnat */
.championship-info-bar {
  display: flex;
  gap: 24px;
  padding: 16px 24px;
  margin-bottom: 16px;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* Filtres Combattants / Statistiques */
/* Filtres format Pokédex : intégrés à la page, options masquées jusqu'au clic */
/* Barre sombre autour de la zone (comme Pokédex) */
#championship-filters.pokedex-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background-color: var(--dark-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

#championship-filters .filter-group {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  gap: 8px;
}

#championship-filters .filter-label {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 8px;
}

#championship-filters .filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--dark-bg-secondary);
  color: var(--text-light);
  font-size: 14px;
  height: 38px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a8b7' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 12px;
  padding-right: 30px;
}

#championship-filters .filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(77, 91, 255, 0.2);
}

#championship-filters #filter-reset-btn {
  margin-top: 25px;
  height: 38px;
}

/* Multi-select : titre aligné verticalement avec la flèche */
#championship-filters .multi-select-header {
  align-items: center;
}
#championship-filters .multi-select-title {
  display: flex;
  align-items: center;
  line-height: 1.25;
  min-height: 22px;
}

/* Toggle filtres - masqué sur desktop */
.championship-filters-toggle {
  display: none;
}

.championship-filters-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  #championship-filters.pokedex-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  #championship-filters .filter-group {
    width: 100%;
  }
  
  /* Mobile : bouton toggle pour ouvrir/fermer les filtres */
  .championship-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: var(--dark-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0;
    min-height: 48px;
  }
  
  .championship-filters-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .championship-filters-toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
  }
  
  #championship-filters.filters-expanded .championship-filters-toggle-arrow {
    transform: rotate(180deg);
  }
  
  .championship-filters-content {
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease;
  }
  
  #championship-filters.filters-expanded .championship-filters-content {
    max-height: 600px;
    opacity: 1;
    padding-top: 16px;
    margin-top: 0;
  }
}

/* Modale de confirmation */
.confirm-modal .modal-content {
  max-width: 420px;
}

.confirm-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.confirm-modal-icon {
  font-size: 24px;
  color: var(--warning);
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.confirm-modal-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 20px 0;
  white-space: pre-line;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirm-modal-actions .btn {
  min-width: 100px;
}

.championship-modal-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 12px 0 0 0;
}

.championship-modal-hint i {
  margin-right: 6px;
  opacity: 0.9;
  color: var(--accent-info, #6b9bd1);
}

.championship-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.championship-info-item strong {
  color: var(--text-light);
  font-weight: 600;
}

/* =============================================================================
 * 5. CLASSEMENT GÉNÉRAL
 * =============================================================================
 */
.championship-overall-ranking {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 193, 7, 0.08) 50%, var(--dark-bg-secondary) 100%);
  border-radius: 16px;
  padding: 24px;
  border: 2px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.08);
}

.championship-overall-ranking h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.championship-overall-ranking h2 i,
.championship-games-header h2 i {
  color: var(--text-light);
}

/* Tableau de classement */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--dark-bg-primary);
  border-radius: 12px;
  overflow: hidden;
}

.ranking-table thead {
  background: var(--dark-bg-tertiary);
}

.ranking-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ranking-table th.col-num {
  text-align: center;
}

.ranking-table th.col-narrow {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.ranking-table td {
  padding: 14px 16px;
  color: var(--text-light);
  font-size: 15px;
  border-top: 1px solid var(--border-color);
}

.ranking-table td.col-num {
  text-align: center;
}

.ranking-table td.col-narrow {
  padding-left: 8px;
  padding-right: 8px;
}

.ranking-table th.col-pos,
.ranking-table td.col-pos {
  width: 50px;
}

.ranking-table td:first-child {
  font-weight: 700;
  font-size: 16px;
}

.ranking-table tbody tr {
  transition: background 0.2s ease;
}

.ranking-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Couleurs des positions */
.ranking-table tr.rank-1 td:first-child {
  color: var(--gold);
}

.ranking-table tr.rank-2 td:first-child {
  color: var(--silver);
}

.ranking-table tr.rank-3 td:first-child {
  color: var(--bronze);
}

/* Colonnes statistiques */
.ranking-table td.wins {
  color: var(--success);
  font-weight: 600;
}

.ranking-table td.losses {
  color: var(--danger);
  font-weight: 600;
}

/* Explications sous le tableau (classement général) — repliable */
.ranking-rules {
  margin-top: 20px;
  background: var(--dark-bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.ranking-rules-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.ranking-rules-summary::-webkit-details-marker {
  display: none;
}

.ranking-rules-summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.ranking-rules[open] .ranking-rules-summary::after {
  transform: rotate(180deg);
}

.ranking-rules-body {
  padding: 0 18px 16px 18px;
}

.ranking-rules ul {
  margin: 0;
  padding-left: 1.25em;
}

.ranking-rules li {
  margin-bottom: 6px;
}

.ranking-rules li:last-child {
  margin-bottom: 0;
}

/* Classement compact (mobile) */
.ranking-compact {
  display: none;
}

/* =============================================================================
 * 6. JEUX DU CHAMPIONNAT
 * =============================================================================
 */
.championship-games-section {
  margin-top: 24px;
}

.championship-games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.championship-import-export-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.championship-import-export-cta .btn-export,
.championship-import-export-cta .btn-import {
  cursor: pointer;
  margin: 0;
}

.championship-import-export-cta .btn-import {
  margin-bottom: 0;
}

.championship-games-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.championship-games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Carte de jeu dans un championnat */
.championship-game-card {
  position: relative;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 0;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* CTA compacts dans les cartes de jeu */
.championship-game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.championship-game-card .btn-add-fight-to-game,
.championship-game-card .btn-delete-game-from-championship {
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: none;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.btn-add-fight-to-game {
  background: rgba(77, 91, 255, 0.25);
  color: var(--primary-light);
  border: 1px solid rgba(77, 91, 255, 0.4);
}

.btn-add-fight-to-game:hover {
  background: rgba(77, 91, 255, 0.4);
  color: white;
}

.btn-delete-game-from-championship {
  background: rgba(248, 113, 113, 0.08);
  color: #f9a8a8;
  border: 1px solid rgba(248, 113, 113, 0.25);
  flex: 0;
}

.btn-delete-game-from-championship:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
}

.btn-add-fight-to-game:active,
.btn-delete-game-from-championship:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .championship-game-card-actions {
    flex-direction: column;
    padding: 12px 16px;
  }
  
  .championship-game-card .btn-add-fight-to-game,
  .championship-game-card .btn-delete-game-from-championship {
    min-height: 44px;
    font-size: 14px;
  }
  
  .championship-game-card .btn-delete-game-from-championship {
    flex: 1;
  }
}

.championship-game-card-readonly {
  cursor: default;
  opacity: 0.95;
}

.championship-game-card-readonly:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.championship-game-card-main {
  padding: 0;
  position: relative;
}

/* Bouton crayon en angle haut de la carte */
.championship-game-card-main .btn-edit-game-from-championship {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* En-tête du jeu : sprites → nom → stats (cliquable pour classement) */
.championship-game-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: var(--dark-bg-primary);
}

.championship-game-header-clickable {
  transition: background 0.2s ease;
  min-height: 120px;
  padding-right: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.championship-game-header-clickable:hover {
  background: var(--dark-bg-secondary);
}

/* Ligne 1 : sprites Pokémon */
.championship-game-sprites {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 8px;
  min-height: 60px;
}

.championship-game-sprites .pokemon-sprites {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.championship-game-sprites .pokemon-sprite {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.championship-game-sprites .pokemon-sprites.triple .pokemon-sprite {
  width: 36px;
  height: 36px;
}

.championship-game-sprites .pokemon-sprites.double .pokemon-sprite {
  width: 44px;
  height: 44px;
}

.championship-game-sprites-fallback {
  color: var(--text-muted);
  font-size: 28px;
  opacity: 0.6;
}

/* Ligne 2 : nom du jeu */
.championship-game-header-info {
  flex: 1;
  padding: 8px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.championship-game-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 6px 0;
}

.championship-game-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.championship-game-stats {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.championship-game-expand-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.championship-game-card-ranking-expanded .championship-game-expand-icon {
  transform: rotate(180deg);
}

/* Bouton crayon pour modifier le jeu */
.btn-edit-game-from-championship {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(77, 91, 255, 0.12);
  border: 1px solid rgba(77, 91, 255, 0.35);
  color: var(--primary-color);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-edit-game-from-championship:hover {
  background: rgba(77, 91, 255, 0.22);
  border-color: var(--primary-color);
  color: var(--primary-light);
  transform: scale(1.05);
}

.btn-edit-game-from-championship:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Classement déroulant : top 3 visible par défaut, tout au clic */
.championship-game-ranking-full {
  max-height: 140px;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--dark-bg-primary);
  border-top: 1px solid var(--border-color);
}

.championship-game-card-ranking-expanded .championship-game-ranking-full {
  max-height: 800px;
}

.game-ranking-full-list {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-ranking-full-list .game-ranking-item {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.game-ranking-empty {
  padding: 12px 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}


/* Classement du jeu (mini) */
.championship-game-ranking {
  padding: 16px 20px;
  background: var(--dark-bg-secondary);
}

.game-ranking-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.game-ranking-position {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.game-ranking-item:nth-child(1) .game-ranking-position {
  background: var(--gold);
  color: #000;
}

.game-ranking-item:nth-child(2) .game-ranking-position {
  background: var(--silver);
  color: #000;
}

.game-ranking-item:nth-child(3) .game-ranking-position {
  background: var(--bronze);
  color: #000;
}

.game-ranking-player {
  flex: 1;
  font-weight: 500;
  color: var(--text-light);
  font-size: 14px;
}

.game-ranking-points {
  font-weight: 700;
  color: var(--primary-light);
  font-size: 14px;
}

/* =============================================================================
 * 7. MENU DÉROULANT DES COMBATTANTS
 * =============================================================================
 */
.participants-dropdown {
  margin-top: 24px;
}

.participants-dropdown h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.participants-dropdown h2 i {
  color: var(--text-light);
}

/* Section Pokémon - les plus utilisés par combattant */
.championship-pokemon-section,
.championship-stats-section {
  margin-top: 24px;
}

.championship-pokemon-section h2,
.championship-stats-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.championship-pokemon-section h2 i,
.championship-stats-section h2 i {
  color: var(--text-light);
}

.stats-accordion .participant-stats-count {
  font-size: 13px;
  color: var(--text-muted);
}

.pokemon-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pokemon-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.pokemon-stat-sprite {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.pokemon-stat-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pokemon-stat-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 15px;
}

.pokemon-stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pokemon-stat-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* Badges statistiques - tons plus doux */
.pokemon-stat-badge.uses {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.pokemon-stat-badge.victories {
  background: rgba(74, 222, 128, 0.18);
  color: #6ee7a0;
}

.pokemon-stat-badge.defeats {
  background: rgba(248, 113, 113, 0.18);
  color: #f9a8a8;
}

/* Section Statistiques - graphique, faces à face, séries */
.championship-stats-chart-container {
  position: relative;
  width: 100%;
  height: 280px;
  min-height: 200px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--dark-bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.championship-stats-chart-container canvas {
  width: 100% !important;
  max-width: 100%;
}

.championship-head-to-head h3,
.championship-streaks h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.championship-head-to-head h3 i,
.championship-streaks h3 i {
  color: var(--primary-color);
}

.head-to-head-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.head-to-head-card {
  padding: 14px 18px;
  background: var(--dark-bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.head-to-head-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.head-to-head-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.head-to-head-stats .stat-label {
  font-weight: 600;
  color: var(--text-light);
  min-width: 80px;
  display: inline-block;
}

.championship-streaks {
  margin-top: 24px;
}

.streaks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.streak-card {
  padding: 12px 16px;
  background: var(--dark-bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-muted);
}

.streak-card .streak-player {
  font-weight: 600;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

.participant-accordion {
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.participant-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  gap: 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.participant-accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.participant-info {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  min-width: 0;
}

.participant-record {
  display: flex;
  gap: 12px;
  font-size: 14px;
  flex-shrink: 0;
}

.participant-wins {
  color: #6ee7a0;
  font-weight: 600;
}

.participant-losses {
  color: #f9a8a8;
  font-weight: 600;
}

/* Contenu de l'accordéon */
.participant-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--dark-bg-primary);
}

.participant-accordion.open .participant-accordion-content {
  max-height: min(92vh, 9999px);
}

.participant-fight-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--dark-bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.participant-fight-item:hover {
  background: var(--dark-bg-tertiary);
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.fight-opponent {
  font-weight: 600;
  color: var(--text-light);
}

.fight-result {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.fight-result.victory {
  color: var(--success);
}

.fight-result.defeat {
  color: var(--danger);
}

.fight-points {
  font-size: 13px;
  color: var(--text-muted);
}

/* =============================================
   ACCORDÉONS PARTICIPANTS - COMBATS
   ============================================= */

.participant-fights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px 16px;
    max-height: min(70vh, 640px);
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.participant-fight-card {
    background: rgba(77, 91, 255, 0.04);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    /* hidden masquait le texte du bandeau (flex/grid + colonnes à 0) */
    overflow: visible;
    color: var(--text-light, #f0f2f5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.participant-fight-card:hover {
    background: rgba(77, 91, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.participant-fight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
}

.participant-fight-header.fight-result-win,
.participant-fight-header-wrapper.fight-result-win {
    background: rgba(74, 222, 128, 0.08);
    border-bottom: 2px solid rgba(74, 222, 128, 0.2);
}

.participant-fight-header.fight-result-loss,
.participant-fight-header-wrapper.fight-result-loss {
    background: rgba(248, 113, 113, 0.08);
    border-bottom: 2px solid rgba(248, 113, 113, 0.2);
}

.participant-fight-header.fight-result-draw,
.participant-fight-header-wrapper.fight-result-draw {
    background: rgba(156, 163, 175, 0.06);
    border-bottom: 2px solid rgba(156, 163, 175, 0.15);
}

.fight-opponent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-light);
}

.fight-result-icon {
    font-size: 20px;
}

.fight-result-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fight-result-text {
    font-weight: 600;
    font-size: 14px;
}

.fight-result-win .fight-result-text {
    color: var(--success);
}

.fight-result-loss .fight-result-text {
    color: var(--danger);
}

.fight-result-draw .fight-result-text {
    color: var(--text-muted);
}

.fight-points {
    font-weight: 700;
    font-size: 13px;
}

.participant-fight-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.participant-fight-details.open {
    max-height: 2500px;
}

.participant-fight-details .fight-mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 16px;
    border-top: 2px solid var(--border-color);
}

/* CTA Modifier déplacé dans fight-meta-row */

.fight-label {
    color: var(--text-muted);
    font-size: 14px;
}

.fight-result-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badges plus doux pour combats */
.fight-result-badge-victory {
    background: rgba(74, 222, 128, 0.18);
    color: #6ee7a0;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.fight-result-badge-defeat {
    background: rgba(248, 113, 113, 0.18);
    color: #f9a8a8;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.fight-result-badge-draw {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.btn-edit-fight-in-detail {
    width: 100%;
    padding: 10px 16px;
    background: rgba(77, 91, 255, 0.15);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-edit-fight-in-detail:hover {
    background: rgba(77, 91, 255, 0.25);
    transform: translateY(-1px);
}

.btn-delete-fight-in-detail {
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-delete-fight-in-detail:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.fight-game-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.fight-game-name i {
    color: var(--primary);
}

.fight-stats {
    display: flex;
    gap: 15px;
}

.fight-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.fight-stat i {
    color: var(--success);
}


/* =============================================
   AFFICHAGE MOBILE DES COMBATS
   ============================================= */

/* Structure cartes combat - DESKTOP : layout horizontal compact */
.participant-fight-header-wrapper {
    padding: 14px 18px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    overflow-x: auto;
    overflow-y: visible;
    min-width: 0;
}

.fight-top-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fight-title-block {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.fight-title-block .fight-label {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.fight-title-block .fight-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    word-break: break-word;
}

.fight-result-badge {
    flex-shrink: 0;
    min-width: 82px;
    text-align: center;
}

.fight-meta-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

/* Desktop : 3 colonnes — largeurs min > 0 sinon la grille peut se réduire à 0 px et le texte disparaît */
.fight-header-grid {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) minmax(6.5rem, 12.5rem) minmax(9rem, 1fr);
    align-items: center;
    gap: 12px 16px;
    flex: 1 1 18rem;
    min-width: min(100%, 22rem);
    overflow: visible;
}

.participant-fight-card .fight-header-grid {
    color: var(--text-light, #f0f2f5);
}

.participant-fight-card .fight-header-grid .fight-col-title,
.participant-fight-card .fight-header-grid .fight-col-result,
.participant-fight-card .fight-header-grid .fight-col-vs {
    min-width: 0;
    overflow: visible;
}

.fight-col-title {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.fight-col-title .fight-label {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1.3;
}

.fight-col-title .fight-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    word-break: break-word;
    line-height: 1.35;
    /* Annule les styles globaux éventuels de fights.css sur .fight-name */
    width: auto;
    max-width: 100%;
    text-align: left;
    justify-self: stretch;
    white-space: normal;
}

.fight-col-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: 6.5rem;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.fight-col-vs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Colonne fixe 200px : victoire + points toujours au même endroit (rétrocompat HTML ancien) */
.fight-meta-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 200px;
    min-width: 200px;
}

.fight-meta-infos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Points dans la ligne meta (à côté du badge victoire) */
.fight-meta-points {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-light);
    background: rgba(255, 215, 0, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
}

.fight-meta-edit {
    flex: 0 0 auto;
}

.fight-meta-edit-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.fight-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.fight-meta-item i {
    color: var(--primary-color);
    opacity: 0.9;
}

.fight-meta-item.fight-points {
    font-weight: 700;
    font-size: 15px;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.12);
    padding: 6px 12px;
    border-radius: 8px;
    margin-left: auto;
}

.fight-meta-edit .btn-edit-fight-in-detail,
.fight-meta-edit .btn-delete-fight-in-detail {
    margin: 0;
    padding: 6px 12px;
    font-size: 13px;
    width: auto;
}

.fight-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
}

.fight-mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-team-section {
    background: var(--dark-bg-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.mobile-team-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
}

.mobile-team-header.team-winner {
    background: rgba(74, 222, 128, 0.1);
    border-bottom-color: rgba(74, 222, 128, 0.2);
}

.mobile-team-header.team-loser {
    background: rgba(248, 113, 113, 0.08);
    border-bottom-color: rgba(248, 113, 113, 0.15);
}

.team-trainer-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-light);
}

.team-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1c2e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.mobile-pokemon-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 15px;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Scrollbar horizontale stylisée */
.mobile-pokemon-grid::-webkit-scrollbar {
    height: 8px;
}

.mobile-pokemon-grid::-webkit-scrollbar-track {
    background: var(--dark-bg-primary);
    border-radius: 4px;
}

.mobile-pokemon-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.mobile-pokemon-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.mobile-pokemon-card {
    background: var(--dark-bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0; /* ✅ Empêche les cartes de rétrécir */
    width: 140px; /* ✅ Largeur fixe pour chaque carte */
}

.mobile-pokemon-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.mobile-pokemon-card.pokemon-ko {
    border: 2px solid rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.mobile-pokemon-card.pokemon-used {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.08);
}

.mobile-pokemon-card.pokemon-unused {
    opacity: 0.7;
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(148, 163, 184, 0.05);
}

.mobile-pokemon-sprite {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-pokemon-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    image-rendering: auto;
}

.ko-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid white;
}

.mobile-pokemon-info {
    text-align: center;
    width: 100%;
}

.mobile-pokemon-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.mobile-pokemon-types {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
}

.type-icon-small {
    width: 24px;
    height: 24px;
}

.mobile-pokemon-level {
    font-size: 12px;
    color: var(--text-muted);
}

.mobile-vs-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.versus-icon-mobile {
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

@media (max-width: 768px) {
    .mobile-pokemon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop : 6 Pokémon en ligne */
@media (min-width: 769px) {
    .mobile-pokemon-grid {
        display: flex;
        flex-direction: row;
        gap: 12px;
        padding: 15px;
        overflow-x: auto;
    }
    
    .mobile-pokemon-card {
        flex-shrink: 0;
        width: 140px;
    }
}

/* Mobile : Grille 2 colonnes pour économiser l'espace */
@media (max-width: 768px) {
    .mobile-pokemon-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }
    
    .mobile-pokemon-card {
        width: auto;
    }
}

/* =============================================================================
 * 8. MODALES
 * =============================================================================
 */

/* Modale de championnat */
.championship-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.championship-modal.active {
  display: flex;
}

.championship-modal-content {
  background-color: var(--dark-bg-secondary);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Override pokemon-battle-tracker.css : .modal-content transform casse position:fixed des listes */
#championship-modal.active .championship-modal-content {
  transform: none !important;
}

/* Pas de transform ici : sinon position:fixed des listes (recherche pseudos) est relatif à la modale */
@keyframes modalSlideIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.championship-modal-header {
  padding: 24px 30px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.championship-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.championship-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.championship-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.championship-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 30px;
}

.championship-modal-body::-webkit-scrollbar {
  width: 8px;
}

.championship-modal-body::-webkit-scrollbar-track {
  background: var(--dark-bg-primary);
  border-radius: 4px;
}

.championship-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.championship-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Modale détail combat */
.fight-detail-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fight-detail-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.fight-detail-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 700;
}

.fight-detail-trainer {
  color: var(--text-muted);
}

.fight-detail-trainer.fight-detail-me {
  color: var(--primary-color);
}

.fight-detail-versus {
  color: var(--danger);
  font-size: 14px;
}

.fight-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.fight-detail-game {
  color: var(--text-muted);
}

.fight-detail-game i {
  margin-right: 6px;
  color: var(--primary-color);
}

.fight-detail-result.fight-detail-win {
  color: #6ee7a0;
  font-weight: 600;
}

.fight-detail-result.fight-detail-loss {
  color: #f9a8a8;
  font-weight: 600;
}

.fight-detail-result.fight-detail-draw {
  color: #9ca3af;
  font-weight: 600;
}

.fight-detail-points {
  color: var(--gold);
  font-weight: 700;
  font-size: 16px;
  background: rgba(255, 215, 0, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
}

.fight-detail-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.fight-detail-team-section {
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 16px;
  border: 2px solid var(--border-color);
}

.fight-detail-team-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-light);
}

.fight-detail-team-title.fight-detail-me {
  color: var(--primary-color);
}

.fight-detail-pokemon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fight-detail-pokemon-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--dark-bg-tertiary);
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

.fight-detail-pokemon-card.pokemon-ko {
  border: 2px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.fight-detail-pokemon-card.pokemon-used {
  border: 2px solid var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.fight-detail-pokemon-card.pokemon-unused {
  opacity: 0.7;
  border-color: var(--text-muted);
  background: rgba(160, 168, 183, 0.1);
}

.fight-detail-pokemon-card.pokemon-used .fight-detail-pokemon-status {
  color: var(--success);
}

.fight-detail-pokemon-card.pokemon-unused .fight-detail-pokemon-status {
  color: var(--text-muted);
}

.fight-detail-pokemon-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center bottom;
  flex-shrink: 0;
}

.fight-detail-pokemon-info {
  flex: 1;
  min-width: 0;
}

.fight-detail-pokemon-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.fight-detail-pokemon-status {
  font-size: 11px;
  color: var(--text-muted);
}

.fight-detail-pokemon-card.pokemon-ko .fight-detail-pokemon-status {
  color: var(--danger);
}

@media (max-width: 600px) {
  .fight-detail-teams {
    grid-template-columns: 1fr;
  }
  
  .fight-detail-pokemon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.championship-modal-actions {
  padding: 20px 30px;
  border-top: 2px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Formulaire */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--dark-bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(77, 91, 255, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Recherche de participants (style identique à confrontations.js) */
.participants-search-container {
  margin-bottom: 16px;
  position: relative;
  z-index: 20;
}

.participant-search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--dark-bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 15px;
  transition: all 0.3s ease;
}

.participant-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(77, 91, 255, 0.1);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: var(--dark-bg-primary);
  border: 2px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Liste portée sur body + positionnée en fixed par JS (au-dessus modale / scroll) */
.search-results.search-results--viewport-fixed {
  position: fixed;
  border-top: 2px solid var(--border-color);
  border-radius: 8px;
  z-index: 10050;
}

.search-results.active {
  display: block;
}

.participant-search-exact-hint {
  padding: 8px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color, #4a9eff);
  border-bottom: 1px solid var(--border-color);
  background: rgba(74, 158, 255, 0.08);
}

.search-result-pseudo-muted {
  opacity: 0.75;
  font-size: 12px;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-result-item:hover {
  background: var(--dark-bg-tertiary);
}

.search-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.search-result-info {
  flex: 1;
}

.search-result-name {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 2px;
}

.search-result-pseudo {
  font-size: 13px;
  color: var(--text-muted);
}

/* Liste des participants sélectionnés */
.selected-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.participant-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 12px;
  background: var(--primary-color);
  color: white;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
}

.participant-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.participant-nickname-input {
  width: 100%;
  min-width: 160px;
  max-width: 220px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  box-sizing: border-box;
}

.participant-nickname-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.participant-badge-remove {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.participant-badge-remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

.participant-badge-link {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.participant-badge-link:hover {
  background: rgba(255, 255, 255, 0.35);
}

.participant-badge-no-pseudo .participant-badge-link {
  background: rgba(255, 255, 255, 0.15);
}

.participant-badge-no-pseudo .participant-badge-link:hover {
  background: rgba(255, 255, 255, 0.3);
}

.participant-badge-no-pseudo {
  background: rgba(156, 163, 175, 0.4) !important;
  border: 1px solid rgba(156, 163, 175, 0.5);
}

/* Boutons */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: inherit;
}

.btn-cancel {
  background: var(--dark-bg-primary);
  color: var(--text-light);
  border: 2px solid var(--border-color);
}

.btn-cancel:hover {
  background: var(--dark-bg-secondary);
  border-color: var(--text-muted);
}

.btn-submit,
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(77, 91, 255, 0.3);
}

.btn-submit i,
.btn-action i {
  flex-shrink: 0;
}

.btn-submit:hover,
.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 91, 255, 0.5);
}

.btn-submit:active,
.btn-action:active {
  transform: translateY(0);
}

.btn-back {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 14px;
}

.btn-back:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--text-light);
  color: var(--text-light);
}

/* =============================================================================
 * 9. RESPONSIVE - TABLETTE (≤ 992px)
 * =============================================================================
 */
@media (max-width: 992px) {
  .championships-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .championship-games-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .championship-info-bar {
    flex-wrap: wrap;
  }
}

/* =============================================================================
 * 10. RESPONSIVE - MOBILE (≤ 768px)
 * =============================================================================
 */
@media (max-width: 768px) {
  .championships-container,
  .championship-details-container {
    padding: 0 12px;
  }
  
  .championships-list {
    grid-template-columns: 1fr;
  }
  
  .championship-card {
    padding: 20px;
  }
  
  .championship-card-header h3 {
    font-size: 18px;
  }
  
  .championship-participants-count {
    font-size: 13px;
    padding: 4px 10px;
  }
  
  .championship-top-3 {
    padding: 12px;
  }
  
  .top-player {
    padding: 8px;
  }
  
  .rank-medal {
    font-size: 20px;
    width: 28px;
  }
  
  .player-name {
    font-size: 14px;
  }
  
  .player-points {
    font-size: 15px;
  }
  
  /* Classement - Version compacte */
  .ranking-table {
    display: none;
  }
  
  .ranking-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .ranking-compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--dark-bg-primary);
    border-radius: 8px;
  }
  
  .ranking-compact-position {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
  }
  
  .ranking-compact-item:nth-child(1) .ranking-compact-position {
    background: var(--gold);
    color: #000;
  }
  
  .ranking-compact-item:nth-child(2) .ranking-compact-position {
    background: var(--silver);
    color: #000;
  }
  
  .ranking-compact-item:nth-child(3) .ranking-compact-position {
    background: var(--bronze);
    color: #000;
  }
  
  .ranking-compact-player {
    flex: 1;
    font-weight: 600;
    color: var(--text-light);
  }
  
  .ranking-compact-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  
  .ranking-compact-points {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 16px;
  }
  
  .ranking-compact-record {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  /* Jeux */
  .championship-games-list {
    grid-template-columns: 1fr;
  }
  
  /* CTA Ajouter un jeu - adapté mobile */
  .championship-games-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  #add-game-to-championship-btn {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 15px;
    justify-content: center;
  }
  
  #add-game-to-championship-btn .btn-add-game-text {
    display: inline;
  }
  
  /* Header - mobile : bouton retour plus marqué */
  .championship-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .championship-header .btn-back-compact {
    align-self: flex-start;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    background: var(--dark-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  
  .championship-header .btn-back-compact:hover {
    background: var(--dark-bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-light);
  }
  
  .championship-header h1 {
    font-size: 24px;
    order: 2;
    text-align: center;
  }
  
  /* CTA header mobile : alignement uniforme */
  .championship-header-actions {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
  }
  
  .championship-header-actions .btn {
    flex: 1 1 0;
    min-width: 90px;
    min-height: 44px;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
  }
  
  .championship-overall-ranking {
    padding: 20px;
  }
  
  .championship-overall-ranking h2 {
    font-size: 20px;
  }
  
  .participants-dropdown h2,
  .championship-pokemon-section h2,
  .championship-stats-section h2,
  .championship-games-header h2 {
    font-size: 20px;
  }
  
  /* Accordéons - zone tactile 44px min */
  .participant-accordion-header {
    padding: 16px 20px;
    min-height: 48px;
  }
  
  .participant-name {
    font-size: 15px;
  }
  
  .participant-record {
    font-size: 13px;
  }
  
  /* Cartes combat - agencement mobile simplifié */
  .participant-fight-header-wrapper {
    padding: 16px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
  }
  
  .fight-header-grid {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    color: var(--text-light, #f0f2f5);
  }
  
  .fight-col-result {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  
  .fight-col-vs {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .fight-meta-edit {
    order: 2;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .fight-meta-edit-stack {
    flex-direction: row;
    gap: 10px;
    justify-content: flex-end;
  }
  
  .fight-meta-edit .btn-edit-fight-in-detail,
  .fight-meta-edit .btn-delete-fight-in-detail {
    width: auto;
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }
  
  .fight-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 10px;
  }
  
  .fight-meta-result {
    width: 100%;
    flex: none;
    min-width: 0;
    justify-content: space-between;
    align-items: center;
  }
  
  .fight-meta-infos {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .fight-meta-infos .fight-meta-item {
    font-size: 13px;
  }
  
  .fight-col-title .fight-label {
    display: none;
  }
  
  .fight-name {
    font-size: 15px;
  }
  
  /* Modales */
  .championship-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .championship-modal-header {
    padding: 20px;
  }
  
  .championship-modal-title {
    font-size: 20px;
  }
  
  .championship-modal-body {
    padding: 20px;
  }
  
  .championship-modal-actions {
    padding: 16px 20px;
    flex-direction: column;
  }
  
  .championship-modal-actions .btn {
    width: 100%;
  }
}

/* =============================================================================
 * 11. RESPONSIVE - PETIT MOBILE (≤ 480px)
 * =============================================================================
 */
@media (max-width: 480px) {
  .empty-message p:first-child {
    font-size: 20px;
  }
  
  .championship-card {
    padding: 16px;
  }
  
  .championship-card-header h3 {
    font-size: 16px;
  }
  
  .top-player {
    gap: 10px;
  }
  
  .rank-medal {
    font-size: 18px;
    width: 24px;
  }
  
  .player-name {
    font-size: 13px;
  }
  
  .player-points {
    font-size: 14px;
  }
  
  .championship-header h1 {
    font-size: 20px;
  }
  
  .championship-overall-ranking {
    padding: 16px;
  }
  
  .championship-overall-ranking h2 {
    font-size: 18px;
  }
  
  .participants-dropdown h2,
  .championship-stats-section h2,
  .championship-games-header h2 {
    font-size: 18px;
  }
  
  .ranking-compact-item {
    padding: 10px;
  }
  
  .ranking-compact-position {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .ranking-compact-player {
    font-size: 14px;
  }
  
  .ranking-compact-points {
    font-size: 15px;
  }
  
  /* Modale confirmation - pleine largeur petit mobile */
  .confirm-modal .modal-content {
    width: calc(100% - 24px);
    margin: 12px;
  }
  
  .confirm-modal-actions .btn {
    min-height: 48px;
    font-size: 16px;
  }
}

/* =============================================================================
 * 12. ANIMATIONS & TRANSITIONS
 * =============================================================================
 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.championship-card,
.championship-game-card,
.participant-accordion {
  animation: fadeIn 0.3s ease;
}

/* =============================================================================
 * 13. UTILITAIRES
 * =============================================================================
 */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

/* =============================================================================

/* Badges de rôle */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.role-badge.owner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.role-badge.invitation-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.role-badge.participant {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Bouton Quitter */
.btn-leave {
    flex: 1;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-leave:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    transform: translateY(-2px);
}

/* Cloche invitations championnat : fixe bas-droite (comme page Duels) */
.championship-page-notifications.notification-icon-bottom-right {
    z-index: 950;
}

/* Surnoms : une ligne « Pseudo – surnom » (italique), listes & stats championnat */
.pseudo-alias-inline {
    display: inline;
    line-height: 1.25;
}

.pseudo-nickname-sep {
    font-weight: 500;
    opacity: 0.85;
}

.pseudo-nickname-inline {
    font-size: 0.88em;
    font-style: italic;
    font-weight: 500;
    opacity: 0.88;
}

.participant-name .pseudo-alias-inline-with-nick,
.ranking-table td .pseudo-alias-inline-with-nick {
    display: inline;
}

.head-to-head-title .pseudo-alias-inline,
.ranking-compact-player .pseudo-alias-inline,
.game-ranking-player .pseudo-alias-inline {
    display: inline;
}

.vs-inline {
    font-weight: 600;
    opacity: 0.9;
    margin: 0 0.2em;
}