/* =============================================================================
   POKEMON-MOBILE-SPRITES.CSS - Affichage mobile optimisé
   Gère la mise en page des cartes Pokémon en mode mobile
   ============================================================================= */

/* =============================================================================
   AFFICHAGE MOBILE UNIQUEMENT (≤ 768px)
   ============================================================================= */
@media (max-width: 768px) {
  
  /* ========================================================================
     1. MASQUER TOUS LES ÉLÉMENTS DESKTOP
     ======================================================================== */
  
  .fight-pokemon-list,
  .fight-battle-container,
  .fight-trainer-column,
  .fight-versus-container,
  .fight-trainer-name {
    display: none !important;
  }
  
  /* ========================================================================
     2. AFFICHER LE CONTENEUR MOBILE
     ======================================================================== */
  
  .fight-teams-mobile {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
    padding: 0 4px;
  }
  
  /* ========================================================================
     3. EN-TÊTES D'ÉQUIPE MOBILE
     ======================================================================== */
  
  .team-mobile-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-left: 4px;
  }
  
  .team-mobile-header.trainer-1 {
    color: #60a5fa;
  }
  
  .team-mobile-header.trainer-2 {
    color: #fb923c;
  }
  
  /* ========================================================================
     4. GRILLE 2x3 POUR LES POKÉMON
     ======================================================================== */
  
  .team-pokemon-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    padding: 10px;
  }
  
  /* ========================================================================
     5. CARTES SPRITE INDIVIDUELLES (CENTRÉES)
     ======================================================================== */
  
  .pokemon-sprite-card {
    background: var(--dark-bg-secondary);
    border-radius: 12px;
    padding: 8px 4px; /* Padding symétrique */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    text-align: center !important;
    position: relative; /* Pour un centrage précis */
  }
  
  /* Forcer tous les enfants à se centrer */
  .pokemon-sprite-card > * {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  .pokemon-sprite-card:active {
    transform: scale(0.95);
  }
  
  /* ========================================================================
   6. IMAGE DU SPRITE (CENTRÉE)
   ======================================================================== */

.pokemon-sprite-image {
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block !important;
  margin: 0 auto !important;
  position: relative;
  left: 0 !important;
  right: 0 !important;
}
  
  /* ========================================================================
     7. EFFETS VISUELS SELON STATUT
     ======================================================================== */
  
  .pokemon-sprite-card.status-ko {
    border-color: rgba(239, 68, 68, 0.5);
  }
  
  .pokemon-sprite-card.status-utilise {
    border-color: rgba(34, 197, 94, 0.4);
  }
  
  .pokemon-sprite-card.status-unused {
    border-color: rgba(148, 163, 184, 0.3);
  }
  
  /* ========================================================================
     8. RESPONSIVE - TABLETTES
     ======================================================================== */
  
  @media (max-width: 768px) and (min-width: 481px) {
    .team-pokemon-row {
      gap: 8px;
      padding: 8px;
    }
  }
  
  /* ========================================================================
     9. RESPONSIVE - PETITS ÉCRANS
     ======================================================================== */
  
  @media (max-width: 480px) {
    .team-pokemon-row {
      grid-template-columns: repeat(3, minmax(90px, 1fr));
      gap: 6px;
      padding: 6px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
      scrollbar-color: var(--border-color) transparent;
    }
    
    .team-pokemon-row::-webkit-scrollbar {
      height: 6px;
    }
    
    .team-pokemon-row::-webkit-scrollbar-thumb {
      background: var(--border-color);
      border-radius: 3px;
    }
  }
  
  /* ========================================================================
     10. RESPONSIVE - TRÈS PETITS ÉCRANS
     ======================================================================== */
  
  @media (max-width: 360px) {
    .team-pokemon-row {
      grid-template-columns: repeat(3, 100px);
    }
    
    .pokemon-sprite-card {
      padding: 6px 4px;
    }
    
    .pokemon-sprite-image {
      width: 56px !important;
      height: 56px !important;
    }
  }
}

/* =============================================================================
   DESKTOP : Ne rien changer (≥ 769px)
   ============================================================================= */
@media (min-width: 769px) {
  .fight-teams-mobile {
    display: none !important;
  }
}