/* =============================================================================
 * CONFRONTATION.CSS - Styles pour la gestion des affrontements Pokémon
 * Version 2.1 - Ajout de la modale de sélection de jeu par génération
 * =============================================================================
 */

/* =============================================================================
 * 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;
}

/* =============================================================================
 * 2. LAYOUT PRINCIPAL - Vue liste des affrontements
 * =============================================================================
 */
.battles-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.add-battle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.battles-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

/* =============================================================================
 * 3. CARTES D'AFFRONTEMENT
 * =============================================================================
 */
.battle-item {
  background-color: var(--dark-bg-secondary);
  color: var(--text-light);
  padding: 18px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.battle-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background-color: var(--dark-bg-tertiary);
  border-color: rgba(77, 91, 255, 0.2);
}

.battle-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  position: relative;
}

/* Badge synchronisé */
.sync-badge-left {
  position: absolute;
  top: -6px;
  left: -8px;
  z-index: 10;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--success);
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* Header et titre */
.battle-header {
  text-align: center;
  padding: 8px 0;
}

.battle-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

/* Score */
.battle-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.score-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.score-value {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
}


/* Boutons d'action desktop */
.battle-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-battle-btn,
.delete-battle-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 130px;
}

.btn-icon {
  font-style: normal;
}

.edit-icon {
  color: #60a5fa;
}

.delete-icon {
  color: #f87171;
}

.edit-battle-btn {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.edit-battle-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.delete-battle-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.delete-battle-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* Boutons mobiles (cachés par défaut) */
.battle-actions-container,
.mobile-edit-btn,
.mobile-delete-btn {
  display: none;
}

/* =============================================================================
 * 3.1 ZONE VS COMPACTE POUR LA LISTE (Split Diagonal)
 * =============================================================================
 */

.battle-vs-compact {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 120px;
  margin: 0 auto;
  background: var(--dark-bg-primary);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border: 1px solid var(--border-color);
}

/* Fond diagonal */
.battle-vs-compact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    var(--trainer1-color, #6b7280) 0%,
    var(--trainer1-color, #6b7280) 47%,
    transparent 47%,
    transparent 53%,
    var(--trainer2-color, #6b7280) 53%,
    var(--trainer2-color, #6b7280) 100%
  );
  opacity: 0.18;
  z-index: 0;
}

/* Ligne diagonale centrale */
.battle-vs-compact::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 50%;
  width: 3px;
  height: 300%;
  background: linear-gradient(
    to bottom,
    var(--trainer1-color, #6b7280) 0%,
    #f0f2f5 50%,
    var(--trainer2-color, #6b7280) 100%
  );
  transform: translateX(-50%) rotate(40deg);
  z-index: 1;
  box-shadow: 
    0 0 12px rgba(255, 255, 255, 0.3),
    0 0 24px rgba(255, 255, 255, 0.15);
}

/* Classes de couleurs */
.battle-vs-compact.trainer1-winning {
  --trainer1-color: #10b981;
  --trainer2-color: #f97316;
}

.battle-vs-compact.trainer2-winning {
  --trainer1-color: #f97316;
  --trainer2-color: #10b981;
}

.battle-vs-compact.tie {
  --trainer1-color: #6b7280;
  --trainer2-color: #6b7280;
}

/* Éléments au-dessus du fond */
.battle-vs-compact > * {
  position: relative;
  z-index: 2;
}

/* Structure dresseur */
.vs-compact-trainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Noms */
.vs-compact-name {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  text-align: center;
}

/* Couleurs des noms selon le statut */
.vs-compact-trainer-1.winning .vs-compact-name,
.vs-compact-trainer-2.winning .vs-compact-name {
  color: #10b981;
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.vs-compact-trainer-1.losing .vs-compact-name,
.vs-compact-trainer-2.losing .vs-compact-name {
  color: #f97316;
  text-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.vs-compact-trainer.tie .vs-compact-name {
  color: #9ca3af;
  text-shadow: 0 0 15px rgba(156, 163, 175, 0.3);
}

/* Scores */
.vs-compact-score {
  font-size: 28px;
  font-weight: 900;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 2px solid currentColor;
}

/* Couleurs des scores */
.vs-compact-trainer-1.winning .vs-compact-score,
.vs-compact-trainer-2.winning .vs-compact-score {
  color: #10b981;
  text-shadow: none;/*0 0 4px rgba(16, 185, 129, 0.8);*/
  box-shadow: 
    0 0 15px rgba(16, 185, 129, 0.3),
    inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.vs-compact-trainer-1.losing .vs-compact-score,
.vs-compact-trainer-2.losing .vs-compact-score {
  color: #f97316;
  text-shadow: none;/*0 0 4px rgba(16, 185, 129, 0.8);*/
  box-shadow: 
    0 0 20px rgba(249, 115, 22, 0.3),
    inset 0 0 15px rgba(249, 115, 22, 0.1);
}

.vs-compact-trainer.tie .vs-compact-score {
  color: #9ca3af;
  text-shadow:none;/* 0 0 6px rgba(156, 163, 175, 0.6);*/
  box-shadow: 
    0 0 20px rgba(156, 163, 175, 0.2),
    inset 0 0 15px rgba(156, 163, 175, 0.1);
}

/* Icône VS */
.vs-compact-icon {
  font-size: 22px;
  font-weight: 900;
  color: #f0f2f5;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 14px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* =============================================================================
 * RESPONSIVE - Version compacte
 * =============================================================================
 */
@media (max-width: 768px) {
  .battle-vs-compact {
    height: 100px;
    min-height: 100px;
    grid-template-columns: 1fr auto 1fr;  /* ✅ Garde le layout horizontal */
    grid-template-rows: 1fr;
    gap: 12px;
    padding: 15px 12px;
  }
  
  .vs-compact-trainer {
    gap: 6px;
  }
  
  .vs-compact-name {
    font-size: 12px;
    letter-spacing: 0.8px;
    line-height: 1.2;
  }
  
  .vs-compact-score {
    font-size: 20px;
    width: 38px;
    height: 38px;
    border-width: 1.5px;
  }
  
  .vs-compact-icon {
    font-size: 16px;
    padding: 6px 10px;
  }
  
  /* Ligne diagonale plus fine sur mobile */
  .battle-vs-compact::after {
    width: 2px;
  }
}

@media (max-width: 480px) {
  .battle-vs-compact {
    height: 90px;
    min-height: 90px;
    padding: 12px 10px;
    gap: 10px;
  }
  
  .vs-compact-name {
    font-size: 11px;
    letter-spacing: 0.6px;
  }
  
  .vs-compact-score {
    font-size: 18px;
    width: 36px;
    height: 36px;
  }
  
  .vs-compact-icon {
    font-size: 14px;
    padding: 5px 8px;
  }
}

/* =============================================================================
 * 4. BOUTONS GÉNÉRAUX
 * =============================================================================
 */
.btn-action {
  background-color: var(--primary-color);
  color: var(--text-light);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-action:active {
  background-color: var(--primary-dark);
  transform: translateY(0);
}

.btn-back {
  background-color: transparent;
  border: 1px solid var(--text-muted);
  color: 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);
}

/* =============================================================================
 * 5. GESTION DES JEUX POKÉMON
 * =============================================================================
 */

/* Liste des jeux */
.games-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 colonnes par défaut sur desktop */
  gap: 20px;
  margin-top: 30px;
}

/* Responsive : 2 colonnes sur tablette */
@media (max-width: 1024px) {
  .games-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive : 1 colonne sur mobile (déjà existant) */
@media (max-width: 768px) {
  .games-list {
    grid-template-columns: 1fr;
  }
}

/* Carte de jeu */
.game-card {
    position: relative;             
  overflow: hidden; 
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 24px rgba(77, 91, 255, 0.3);
  background: var(--dark-bg-tertiary);
}

.game-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
  position: relative;             
  z-index: 2;   
}

.game-score {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  position: relative;              
  z-index: 2;  
}

.game-score .score-trainer1 {
  color: #60a5fa;
  background-color: rgba(59, 130, 246, 0.15);
  padding: 4px 12px;
  border-radius: 8px;
}

.game-score .score-trainer2 {
  color: #fb923c;
  background-color: rgba(251, 146, 60, 0.15);
  padding: 4px 12px;
  border-radius: 8px;
}

.game-score .separator {
  color: var(--text-muted);
  font-size: 20px;
}

.game-stats {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;               
  z-index: 2;
}

/* Message si aucun jeu */
.empty-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-games p {
  margin: 10px 0;
  font-size: 16px;
}

.empty-games p:first-child {
  font-size: 24px;
  margin-bottom: 15px;
}

/* Header du jeu (vue détaillée d'un jeu) */
.game-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.game-header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 100%;
}

.game-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  width: 100%;
}

/* Score centré dans le header */
.game-score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  padding: 8px 0;
}

.game-score-header .score-trainer1 {
  color: #60a5fa;
  background-color: rgba(59, 130, 246, 0.15);
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 50px;
  text-align: center;
}

.game-score-header .score-trainer2 {
  color: #fb923c;
  background-color: rgba(251, 146, 60, 0.15);
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 50px;
  text-align: center;
}

.game-score-header > span:not(.score-trainer1):not(.score-trainer2) {
  color: var(--text-muted);
  font-size: 20px;
}

#back-to-games-btn {
  align-self: flex-start;
}

/* =============================================================================
 * VERSION FINALE - Style Split Diagonal Rétro-éclairé
 * Inspiré des cartes d'affrontement
 * =============================================================================
 */

/* ========================================
   BASE - Carte de jeu
======================================== */
.game-card {
  position: relative;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  text-align: center;
  min-height: 200px;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  background: var(--dark-bg-tertiary);
}

/* ========================================
   TITRE - Une seule ligne obligatoire
======================================== */
.game-info {
  position: relative;
  z-index: 2;
  padding: 16px 20px 12px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.game-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  
  /* ✅ FORCER SUR UNE LIGNE */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  
  /* Ombre pour lisibilité */
  text-shadow: 
    1px 1px 3px rgba(0, 0, 0, 0.8),
    0 0 6px rgba(0, 0, 0, 0.5);
}

/* ========================================
   ZONE SCORE - Style Split Diagonal
======================================== */
.game-score {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  height: 100px;
  background: var(--dark-bg-primary);
  z-index: 2;
}

/* Fond diagonal avec couleurs dynamiques */
.game-score::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    var(--trainer1-color, #6b7280) 0%,
    var(--trainer1-color, #6b7280) 47%,
    transparent 47%,
    transparent 53%,
    var(--trainer2-color, #6b7280) 53%,
    var(--trainer2-color, #6b7280) 100%
  );
  opacity: 0.10;  /* ✅ Réduit de 0.18 → 0.10 pour plus de transparence */
  z-index: 0;
}

/* Ligne diagonale centrale lumineuse - RETIRÉE */
/* .game-score::after { ... } */

/* ✅ Classes de couleurs selon le score */
.game-card[data-winning="trainer1"] .game-score {
  --trainer1-color: #10b981;
  --trainer2-color: #f97316;
}

.game-card[data-winning="trainer2"] .game-score {
  --trainer1-color: #f97316;
  --trainer2-color: #10b981;
}

.game-card[data-winning="tie"] .game-score {
  --trainer1-color: #6b7280;
  --trainer2-color: #6b7280;
}

/* Éléments au-dessus du fond */
.game-score > * {
  position: relative;
  z-index: 2;
}

/* ========================================
   SCORES - Style moderne rétro-éclairé
======================================== */
.game-score .score-trainer1,
.game-score .score-trainer2 {
  font-size: 32px;
  font-weight: 900;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  border: 2px solid currentColor;
  margin: 0 auto;
}

/* Couleurs selon le statut */
.game-card[data-winning="trainer1"] .score-trainer1 {
  color: #10b981;
  box-shadow: 
    0 0 15px rgba(16, 185, 129, 0.3),
    inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.game-card[data-winning="trainer1"] .score-trainer2 {
  color: #f97316;
  box-shadow: 
    0 0 15px rgba(249, 115, 22, 0.3),
    inset 0 0 10px rgba(249, 115, 22, 0.1);
}

.game-card[data-winning="trainer2"] .score-trainer1 {
  color: #f97316;
  box-shadow: 
    0 0 15px rgba(249, 115, 22, 0.3),
    inset 0 0 10px rgba(249, 115, 22, 0.1);
}

.game-card[data-winning="trainer2"] .score-trainer2 {
  color: #10b981;
  box-shadow: 
    0 0 15px rgba(16, 185, 129, 0.3),
    inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.game-card[data-winning="tie"] .score-trainer1,
.game-card[data-winning="tie"] .score-trainer2 {
  color: #9ca3af;
  box-shadow: 
    0 0 15px rgba(156, 163, 175, 0.2),
    inset 0 0 10px rgba(156, 163, 175, 0.1);
}

/* Séparateur */
.game-score .separator {
  color: #f0f2f5;
  font-size: 20px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ========================================
   STATS - Discret en bas
======================================== */
.game-stats {
  position: relative;
  z-index: 2;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   SPRITES POKÉMON - En arrière-plan subtil
======================================== */
.game-card .pokemon-sprites {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: -40px;
  opacity: 0.15;  /* ✅ Augmenté de 0.08 → 0.15 pour voir les sprites */
  pointer-events: none;
  z-index: 1;
  filter: brightness(0.5) contrast(1.1) saturate(1.2);
  width: 100%;
  height: 100%;
}

.game-card .pokemon-sprite {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.game-card .pokemon-sprites.double {
  gap: -30px;
}

.game-card .pokemon-sprites.double .pokemon-sprite {
  width: 130px;
  height: 130px;
}

.game-card .pokemon-sprites.triple {
  gap: -50px;
}

.game-card .pokemon-sprites.triple .pokemon-sprite {
  width: 100px;
  height: 100px;
}

.game-card:hover .pokemon-sprites {
  opacity: 0.25;  /* ✅ Augmenté de 0.15 → 0.25 */
  transform: translate(-50%, -50%) scale(1.03);
  transition: all 0.4s ease;
}

/* ========================================
   RESPONSIVE MOBILE
======================================== */
@media (max-width: 768px) {
  .game-card {
    min-height: 180px;
  }

  .game-info {
    padding: 14px 16px 10px;
  }

  .game-info h3 {
    font-size: 14px;
  }

  .game-score {
    height: 90px;
  }

  .game-score .score-trainer1,
  .game-score .score-trainer2 {
    font-size: 28px;
    width: 52px;
    height: 52px;
  }

  .game-score .separator {
    font-size: 18px;
    padding: 6px 10px;
  }

  .game-stats {
    padding: 10px 16px;
    font-size: 11px;
  }

  .game-card .pokemon-sprite {
    width: 100px;
    height: 100px;
  }

  .game-card .pokemon-sprites.double .pokemon-sprite {
    width: 110px;
    height: 110px;
  }

  .game-card .pokemon-sprites.triple .pokemon-sprite {
    width: 85px;
    height: 85px;
  }
}

@media (max-width: 480px) {
  .game-card {
    min-height: 170px;
  }

  .game-info h3 {
    font-size: 13px;
  }

  .game-score {
    height: 80px;
  }

  .game-score .score-trainer1,
  .game-score .score-trainer2 {
    font-size: 24px;
    width: 48px;
    height: 48px;
  }

  .game-score .separator {
    font-size: 16px;
    padding: 5px 8px;
  }
}

/* =============================================================================
 * 6. FORMULAIRES
 * =============================================================================
 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--dark-bg-primary);
  color: var(--text-light);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(77, 91, 255, 0.25);
}

/* =============================================================================
 * 7. MODALES - Base
 * =============================================================================
 */
.battle-modal,
.delete-confirmation-modal,
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.battle-modal.active,
.delete-confirmation-modal.active,
.confirm-modal.active {
  display: flex;
}

.battle-modal-content,
.delete-modal-content,
.confirm-modal-content {
  background-color: var(--dark-bg-secondary);
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  padding: 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.battle-modal-header,
.delete-modal-header,
.confirm-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battle-modal-title,
.delete-modal-title,
.confirm-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-light);
}

.battle-modal-close,
.delete-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.battle-modal-close:hover,
.delete-modal-close:hover {
  color: var(--text-light);
}

.battle-modal-form,
.delete-modal-body,
.confirm-modal-body {
  padding: 20px;
}

.battle-modal-actions,
.delete-modal-actions,
.confirm-modal-actions {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  background-color: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--text-light);
  color: var(--text-light);
}

.btn-submit {
  background-color: var(--primary-color);
  border: none;
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-submit:hover {
  background-color: var(--primary-light);
}

/* =============================================================================
 * 7.1 MODALE DE SÉLECTION DE JEU (Nouvelle version avec générations)
 * =============================================================================
 */

/* Modale de sélection de jeu */
.game-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.game-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-modal-content {
  background: var(--dark-bg-primary);
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-modal-header {
  padding: 24px 30px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.game-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;
}

.game-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.game-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px 30px;
}

/* Onglets */
.game-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.game-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: -2px;
}

.game-tab:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.game-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Contenu des onglets */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections par génération */
.games-by-generation {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.generation-section {
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.generation-section:hover {
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.generation-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.gen-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  color: white;
  padding: 0 8px;
}

/* Grille de jeux */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.game-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--dark-bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.game-btn:hover::before {
  opacity: 1;
}

.game-btn:active {
  transform: translateY(0);
}

.game-icon {
  font-size: 32px;
  position: relative;
  z-index: 1;
}

.game-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Jeu personnalisé */
.custom-game-container {
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--border-color);
}

.custom-game-desc {
  color: var(--text-muted);
  margin: 0 0 24px 0;
  font-size: 15px;
  line-height: 1.6;
}

.form-control {
  width: 100%;
  padding: 14px 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(102, 126, 234, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.custom-game-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.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;
}

#cancel-custom-game-btn {
  background: var(--dark-bg-primary);
  color: var(--text-light);
  border: 2px solid var(--border-color);
}

#cancel-custom-game-btn:hover {
  background: var(--dark-bg-secondary);
  border-color: var(--text-muted);
}

#create-custom-game-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
}

#create-custom-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#create-custom-game-btn:active {
  transform: translateY(0);
}

/* Scroll personnalisé */
.game-modal-body::-webkit-scrollbar {
  width: 8px;
}

.game-modal-body::-webkit-scrollbar-track {
  background: var(--dark-bg-primary);
  border-radius: 4px;
}

.game-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.game-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 8.1 Conteneur principal de la zone VS */
.battle-vs-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 230px;
  margin: 20px auto;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  padding: 0 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 8.2 Fond diagonal avec couleurs dynamiques */
.battle-vs-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    var(--trainer1-color, #6b7280) 0%,
    var(--trainer1-color, #6b7280) 47%,
    transparent 47%,
    transparent 53%,
    var(--trainer2-color, #6b7280) 53%,
    var(--trainer2-color, #6b7280) 100%
  );
  opacity: 0.18;
  z-index: 0;
}

/* 8.3 Ligne diagonale centrale */
.battle-vs-container::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 50%;
  width: 4px;
  height: 300%;
  background: linear-gradient(
    to bottom,
    var(--trainer1-color, #6b7280) 0%,
    #f0f2f5 50%,
    var(--trainer2-color, #6b7280) 100%
  );
  transform: translateX(-50%) rotate(40deg);
  z-index: 1;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.4),
    0 0 30px rgba(255, 255, 255, 0.2);
}

/* 8.4 Classes de couleurs dynamiques selon le gagnant */
.battle-vs-container.trainer1-winning {
  --trainer1-color: #10b981; /* Vert pour gagnant */
  --trainer2-color: #f97316; /* Rouge-orangé pour perdant */
}

.battle-vs-container.trainer2-winning {
  --trainer1-color: #f97316; /* Rouge-orangé pour perdant */
  --trainer2-color: #10b981; /* Vert pour gagnant */
}

.battle-vs-container.tie {
  --trainer1-color: #6b7280; /* Gris pour égalité */
  --trainer2-color: #6b7280; /* Gris pour égalité */
}

/* 8.5 Positionnement des éléments au-dessus du fond */
.battle-vs-container > * {
  position: relative;
  z-index: 2;
}

/* 8.6 Structure des dresseurs */
.vs-trainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.vs-trainer:nth-child(1) {
  animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.vs-trainer:nth-child(3) {
  animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

/* 8.7 Noms des dresseurs */
.vs-trainer-name {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--text-light);
  text-align: center;
}

/* Couleurs des noms selon le statut (gagnant/perdant/égalité) */
.vs-trainer-1.winning .vs-trainer-name,
.vs-trainer-2.winning .vs-trainer-name {
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.vs-trainer-1.losing .vs-trainer-name,
.vs-trainer-2.losing .vs-trainer-name {
  color: #f97316;
  text-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.vs-trainer.tie .vs-trainer-name {
  color: #9ca3af;
  text-shadow: 0 0 20px rgba(156, 163, 175, 0.3);
}

/* 8.8 Scores */
.vs-score {
  font-size: 42px;
  font-weight: 900;
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  border: 2px solid currentColor;
  transition: all 0.2s ease;
}

/* Couleurs des scores selon le statut */
.vs-trainer-1.winning .vs-score,
.vs-trainer-2.winning .vs-score {
  color: #10b981;
  text-shadow: none;/*0 0 15px rgba(16, 185, 129, 0.8);*/
  box-shadow: 
    0 0 25px rgba(16, 185, 129, 0.3),
    inset 0 0 20px rgba(16, 185, 129, 0.1);
}

.vs-trainer-1.losing .vs-score,
.vs-trainer-2.losing .vs-score {
  color: #f97316;
  text-shadow: none; /*0 0 15px rgba(249, 115, 22, 0.8);*/
  box-shadow: 
    0 0 25px rgba(249, 115, 22, 0.3),
    inset 0 0 20px rgba(249, 115, 22, 0.1);
}

.vs-trainer.tie .vs-score {
  color: #9ca3af;
  text-shadow: none; /*0 0 15px rgba(156, 163, 175, 0.6);*/
  box-shadow: 
    0 0 25px rgba(156, 163, 175, 0.2),
    inset 0 0 20px rgba(156, 163, 175, 0.1);
}

/* 8.9 Icône VS centrale */
.vs-icon {
  font-size: 32px;
  font-weight: 900;
  color: #f0f2f5;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 22px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: zoomIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* 8.10 Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 8.11 RESPONSIVE TABLET (< 768px) */
@media (max-width: 768px) {
  .battle-vs-container {
    height: auto;
    min-height: 280px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 30px 20px;
  }
  
  .vs-trainer-name {
    font-size: 24px;
    letter-spacing: 2px;
  }
  
  .vs-score {
    font-size: 36px;
    width: 70px;
    height: 70px;
  }
  
  .vs-icon {
    font-size: 28px;
    padding: 12px 18px;
  }
}

/* 8.12 RESPONSIVE MOBILE (< 480px) */
@media (max-width: 480px) {
  .battle-vs-container {
    padding: 25px 15px;
    gap: 15px;
    min-height: 260px;
  }
  
  .vs-trainer {
    gap: 12px;
  }
  
  .vs-trainer-name {
    font-size: 20px;
    letter-spacing: 1.5px;
  }
  
  .vs-score {
    font-size: 32px;
    width: 65px;
    height: 65px;
  }
  
  .vs-icon {
    font-size: 24px;
    padding: 10px 16px;
  }
}

/* 8.13 RESPONSIVE TRÈS PETIT MOBILE (< 380px) */
@media (max-width: 380px) {
  .battle-vs-container {
    padding: 20px 12px;
    gap: 12px;
    min-height: 240px;
  }
  
  .vs-trainer-name {
    font-size: 18px;
    letter-spacing: 1px;
  }
  
  .vs-score {
    font-size: 28px;
    width: 60px;
    height: 60px;
  }
  
  .vs-icon {
    font-size: 20px;
    padding: 8px 14px;
  }
}

/* =============================================================================
 * 9. SYSTÈME DE NOTIFICATIONS
 * =============================================================================
 */
.notification-icon-container {
  position: relative;
  display: inline-block;
}

.notification-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(77, 91, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-icon:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(77, 91, 255, 0.5);
}

.notification-count,
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(244, 67, 94, 0.6);
  border: 2px solid var(--dark-bg-secondary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.notifications-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 420px;
  max-height: 600px;
  background: var(--dark-bg-secondary);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.notifications-menu.active,
.notifications-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notifications-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notifications-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.notifications-header .close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notifications-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.notifications-content,
.notifications-body {
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: var(--dark-bg-primary);
}

.notifications-content::-webkit-scrollbar,
.notifications-body::-webkit-scrollbar {
  width: 6px;
}

.notifications-content::-webkit-scrollbar-track,
.notifications-body::-webkit-scrollbar-track {
  background: var(--dark-bg-primary);
}

.notifications-content::-webkit-scrollbar-thumb,
.notifications-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.empty-message,
.empty-notifications {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 24px;
  font-size: 15px;
  margin: 0;
}

/* Cartes d'invitation */
.invitation-item {
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.invitation-item:last-child {
  margin-bottom: 0;
}

.invitation-item:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.invitation-header {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.invitation-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.invitation-info {
  flex: 1;
}

.invitation-from {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.invitation-from strong {
  font-weight: 700;
  color: var(--primary-light);
}

.invitation-details {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.invitation-trainer {
  font-size: 13px;
  color: var(--text-muted);
}

.invitation-actions {
  display: flex;
  gap: 10px;
}

.btn-reject,
.btn-accept {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-reject {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-reject:hover {
  background: rgba(148, 163, 184, 0.25);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-accept {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(77, 91, 255, 0.4);
}

.btn-accept:hover {
  background: linear-gradient(135deg, var(--primary-light), #8b5cf6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 91, 255, 0.6);
}

.btn-accept:active,
.btn-reject:active {
  transform: translateY(0);
}

/* =============================================================================
 * NOUVELLE STRUCTURE : Vignette jeu + Actions
 * =============================================================================
 */

/* Wrapper principal : vignette + actions côte à côte */
.game-info-actions-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Vignette du jeu (à gauche) */
.game-card-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: var(--dark-bg-primary);
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

.game-card-display .game-info h2 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
}

.game-card-display .game-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 32px;
  font-weight: 700;
}

.game-card-display .game-stats {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Stack de CTA (à droite) */
.game-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.game-actions-stack .btn {
  width: 100%;
  min-width: auto;
  max-width: none;
  padding: 14px 20px;
  font-size: 14px;
}

/* =============================================================================
 * 10. RESPONSIVE - MOBILE
 * =============================================================================
 */
@media (max-width: 768px) {
  /* ========== VIGNETTE JEU + ACTIONS ========== */
  
  /* Mobile : tout en colonne */
  .game-info-actions-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  /* Vignette du jeu - plus compacte */
  .game-card-display {
    padding: 16px;
    gap: 12px;
  }
  
  .game-card-display .game-info h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }
  
  .game-card-display .game-score {
    font-size: 28px;
    gap: 10px;
  }
  
  /* Actions en scroll horizontal */
  .game-actions-stack {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  
  .game-actions-stack .btn {
    flex: 0 0 auto;
    min-width: 110px;
    max-width: 120px;
    padding: 10px 12px;
    font-size: 12px;
    scroll-snap-align: start;
  }
  
  /* Icônes plus petites sur mobile */
  .game-actions-stack .btn i {
    font-size: 11px;
  }
  
  /* Scroll bar custom */
  .game-actions-stack::-webkit-scrollbar {
    height: 6px;
  }
  
  .game-actions-stack::-webkit-scrollbar-track {
    background: var(--dark-bg-primary);
    border-radius: 3px;
  }
  
  .game-actions-stack::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
  }
  
  .game-actions-stack::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
  }
  
  /* ========== CARTES D'AFFRONTEMENT ========== */
  
  .battle-item {
    padding: 16px;
  }
  
  .battle-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .sync-badge-left {
    top: -4px;
    right: -4px;
    left: auto;
  }
  
  .sync-badge {
    font-size: 9px;
    padding: 3px 8px;
  }
  
  .battle-header {
    padding-top: 12px;
  }
  
  .battle-name {
    font-size: 18px;
  }
  
  .score-container {
    font-size: 16px;
  }
  
  .score-value {
    min-width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  /* Masquer boutons desktop */
  .battle-btn-stack {
    display: none !important;
  }
  
  /* Afficher boutons mobiles */
  .battle-actions-container {
    display: flex !important;
    gap: 10px;
    margin-top: 8px;
  }
  
  .mobile-edit-btn,
  .mobile-delete-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  
  .mobile-edit-btn {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
  }
  
  .mobile-delete-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
  }
  
  /* ========== JEUX ========== */
  
  .games-list {
    grid-template-columns: 1fr;
  }
  
  .game-header {
    padding: 16px;
    gap: 12px;
  }
  
  .game-header h2 {
    font-size: 18px;
  }
  
  .game-score-header {
    font-size: 20px;
  }
  
  .game-score-header .score-trainer1,
  .game-score-header .score-trainer2 {
    padding: 6px 12px;
    min-width: 45px;
  }
  
  .game-card {
    padding: 20px;
  }
  
  .game-score {
    font-size: 24px;
  }
  
  /* ========== NOTIFICATIONS ========== */
  
  .notifications-menu {
    width: calc(100vw - 32px);
    right: 16px;
    max-height: 70vh;
  }
  
  .notifications-content,
  .notifications-body {
    max-height: calc(70vh - 80px);
  }
  
  /* ========== MODALE DE JEU ========== */
  
  .game-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .game-modal-header {
    padding: 20px;
  }
  
  .game-modal-title {
    font-size: 20px;
  }
  
  .game-modal-body {
    padding: 16px 20px 24px;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
  
  .game-btn {
    padding: 12px 8px;
  }
  
  .game-icon {
    font-size: 28px;
  }
  
  .game-label {
    font-size: 13px;
  }
  
  .generation-section {
    padding: 16px;
  }
  
  .generation-title {
    font-size: 16px;
  }
  
  .gen-badge {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
  }
  
  .custom-game-container {
    padding: 20px;
  }
}

/* =============================================================================
 * 11. RESPONSIVE - TRÈS PETIT MOBILE (< 480px)
 * =============================================================================
 */
@media (max-width: 480px) {
  /* Vignette jeu encore plus compacte */
  .game-card-display .game-info h2 {
    font-size: 18px;
  }
  
  .game-card-display .game-score {
    font-size: 24px;
  }
  
  /* Actions encore plus petites */
  .game-actions-stack .btn {
    min-width: 100px;
    max-width: 110px;
    padding: 9px 10px;
    font-size: 11px;
  }
  
  .empty-games {
    padding: 60px 15px;
  }
  
  .empty-games p:first-child {
    font-size: 20px;
  }
  
  .game-score {
    font-size: 22px;
  }
  
  .notification-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  
  .notification-count,
  .notification-badge {
    font-size: 10px;
    min-width: 20px;
    height: 20px;
  }
  
  .notifications-header {
    padding: 16px 20px;
  }
  
  .notifications-title {
    font-size: 16px;
  }
  
  .invitation-item {
    padding: 14px;
  }
  
  .invitation-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-accept,
  .btn-reject {
    width: 100%;
  }
  
  /* Modale de jeu mobile */
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .game-tabs {
    gap: 4px;
  }
  
  .game-tab {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* =============================================================================
 * STATISTIQUES POKÉMON - Accordéon déroulant (VERSION AVEC SCROLL)
 * =============================================================================
 */

.stats-accordion {
  margin: 20px 0 30px 0;
  background: var(--dark-bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.stats-accordion-header {
  width: 100%;
  padding: 16px 20px;
  background: var(--dark-bg-tertiary);
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stats-accordion-header:hover {
  background: rgba(77, 91, 255, 0.1);
}

.stats-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
}

.stats-arrow {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.stats-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.stats-accordion-content.open {
  max-height: 2000px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px;
}

.stats-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ✅ COULEURS PAR DRESSEUR */
.stats-column-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* Ne pas compresser le titre */
}

.stats-trainer-1 {
  color: #60a5fa !important; /* Bleu */
}

.stats-trainer-2 {
  color: #fb923c !important; /* Orange */
}

.column-arrow {
  display: none; /* Caché par défaut, visible seulement sur mobile */
  font-size: 14px;
  margin-left: 8px;
}

/* ✅ LISTE SCROLLABLE - Version dynamique */
.pokemon-stats-list {
  max-height: 500px; /* Hauteur par défaut (top 10) */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: max-height 0.3s ease; /* Animation douce */
}

/* ✅ Quand on affiche tout, pas de limite */
.pokemon-stats-list.expanded {
  max-height: none !important;
}

/* ✅ Scrollbar personnalisée */
.pokemon-stats-list::-webkit-scrollbar {
  width: 8px;
}

.pokemon-stats-list::-webkit-scrollbar-track {
  background: var(--dark-bg-primary);
  border-radius: 4px;
}

.pokemon-stats-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.pokemon-stats-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
.pokemon-stats-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--dark-bg-primary);
}

/* Item Pokémon */
.pokemon-stat-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--dark-bg-primary);
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0; /* Ne pas compresser les items */
}

.pokemon-stat-item:hover {
  background: var(--dark-bg-tertiary);
  transform: translateX(4px);
}

.pokemon-stat-sprite {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.pokemon-stat-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-loader {
  color: var(--text-muted);
  font-size: 12px;
}

.sprite-error {
  font-size: 24px;
  color: var(--text-muted);
}

.pokemon-stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ✅ STRUCTURE : Nom + Types regroupés */
.pokemon-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pokemon-stat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: capitalize;
}

.pokemon-stat-types {
  display: flex;
  gap: 4px;
}

.pokemon-stat-type {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  flex-shrink: 0;
}

.pokemon-stat-type .type-icon-img {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
}

/* ✅ BARRES DE PROGRESSION PAR DRESSEUR */
.pokemon-stat-bar-container {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.pokemon-stat-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Dresseur 1 = Bleu */
.trainer-1-bar {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Dresseur 2 = Orange */
.trainer-2-bar {
  background: linear-gradient(90deg, #f97316, #fb923c);
}

.pokemon-stat-count {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ✅ BOUTONS AFFICHER PLUS/MOINS PAR DRESSEUR */
.btn-show-more {
  padding: 8px 16px;
  background: var(--dark-bg-primary);
  color: var(--text-light);
  border: 2px solid;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: 8px;
  flex-shrink: 0; /* Ne pas compresser le bouton */
}

.trainer-1-btn {
  border-color: #60a5fa;
  color: #60a5fa;
}

.trainer-1-btn:hover {
  background: #60a5fa;
  color: white;
}

.trainer-2-btn {
  border-color: #fb923c;
  color: #fb923c;
}

.trainer-2-btn:hover {
  background: #fb923c;
  color: white;
}

.no-stats {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 14px;
}

/* =============================================================================
 * RESPONSIVE MOBILE
 * =============================================================================
 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  /* ✅ Rendre les titres cliquables sur mobile */
  .stats-column-title {
    cursor: pointer;
    user-select: none;
  }
  
  .column-arrow {
    display: inline-block !important;
  }
  
  /* ✅ Liste collapsible sur mobile */
  .pokemon-stats-list.collapsed {
    display: none;
  }
  
  /* ✅ Hauteur réduite sur mobile */
  .pokemon-stats-list {
    max-height: 400px;
  }
  
  .pokemon-stat-sprite {
    width: 50px;
    height: 50px;
  }
  
  .pokemon-stat-name {
    font-size: 13px;
  }
  
  .pokemon-stat-type {
    width: 18px;
    height: 18px;
  }
}

/* ✅ Très petits écrans */
@media (max-width: 480px) {
  .pokemon-stats-list {
    max-height: 300px;
  }
}