
.container-ligas {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto 24px auto;
  padding: 24px;
  background-color: rgba(20,20,20,0.9);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.ligas-title {
  text-align: center;
  color: #f0f0f0;
  margin: 0 0 20px 0;
  font-size: 2rem;
}

.ligas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.liga-card {
  display: block;
  background: rgba(21, 21, 21, 0.7);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  color: #ddd;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.liga-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

/* --- imagens --- */
/* LOGO maior que a BANDEIRA */
.image-container {
  position: relative;
  width: 100%;
  height: 180px;                /* logo grande */
  border-radius: 10px;
  overflow: hidden;
  background: #141414;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
}
.liga-logo {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
}

/* Bandeira bem pequena (quase tamanho do texto) */
:root{
  --flag-height: 30px;        /* altura da bandeira no desktop */
  --flag-height-sm: 24px;     /* altura no mobile */
}
.flag-container {
  position: relative;
  width: 100%;
  height: calc(var(--flag-height) + 10px); /* caixa um pouco maior que a bandeira */
  border-radius: 8px;
  overflow: hidden;
  background: #141414;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 0;
}
.bandeira-pais {
  max-height: var(--flag-height); /* <<< tamanho real da bandeira */
  width: auto;                    /* preserva proporção */
  max-width: 90%;
  object-fit: contain;
  display: block;
}

/* Loading spinner */
.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- textos --- */
.liga-nome {
  margin: 6px 0 4px;
  font-size: 1.08rem;
  font-weight: 600;
  color: #fff;
  text-align: center;           /* centraliza */
}
.liga-pais {
  margin: 0;
  color: #aaa;
  font-size: .95rem;
  text-align: center;           /* centraliza */
}

/* Responsivo - MOBILE */
@media (max-width: 768px) {
  .container-ligas { 
    padding: 16px; 
    margin: 40px auto 20px auto;
  }
  
  .ligas-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  
  .ligas-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .liga-card {
    padding: 12px;
    border-radius: 10px;
  }
  
  .image-container { 
    height: 100px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  
  .liga-logo {
    width: 85%;
    height: 85%;
  }
  
  .flag-container {
    height: calc(var(--flag-height-sm) + 8px);
    margin-bottom: 6px;
    border-radius: 6px;
    padding: 3px 0;
  }
  
  .bandeira-pais {
    max-height: var(--flag-height-sm);
    max-width: 85%;
  }
  
  .liga-nome {
    font-size: 0.9rem;
    margin: 4px 0 3px;
    line-height: 1.2;
  }
  
  .liga-pais {
    font-size: 0.8rem;
  }
  
  .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }
}

/* MOBILE PEQUENO */
@media (max-width: 520px) {
  .container-ligas { 
    padding: 12px;
    margin: 30px auto 16px auto;
  }
  
  .ligas-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  
  .ligas-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  
  .liga-card {
    padding: 10px;
  }
  
  .image-container { 
    height: 90px;
    margin-bottom: 6px;
  }
  
  .flag-container {
    height: calc(var(--flag-height-sm) + 6px);
    margin-bottom: 5px;
  }
  
  .liga-nome {
    font-size: 0.85rem;
    margin: 3px 0 2px;
  }
  
  .liga-pais {
    font-size: 0.75rem;
  }
}

/* MOBILE EXTRA PEQUENO */
@media (max-width: 380px) {
  .ligas-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .liga-card {
    padding: 8px;
  }
  
  .image-container {
    height: 80px;
  }
  
  .liga-nome {
    font-size: 0.8rem;
  }
  
  .liga-pais {
    font-size: 0.7rem;
  }
}

/* Desktop: garantir que nada mude */
@media (min-width: 769px) {
  .container-ligas {
    padding: 24px;
    margin: 0 auto 24px auto;
  }
  
  .ligas-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .liga-card {
    padding: 16px;
    border-radius: 12px;
  }
  
  .image-container {
    height: 180px;
    margin-bottom: 12px;
  }
  
  .flag-container {
    height: calc(var(--flag-height) + 10px);
    margin-bottom: 8px;
  }
  
  .liga-nome {
    font-size: 1.08rem;
    margin: 6px 0 4px;
  }
  
  .liga-pais {
    font-size: 0.95rem;
  }
}

/* ========== MOBILE OTIMIZADO ========== */
/* MOBILE GRANDE */
@media (max-width: 768px) {
  .container-ligas { 
    padding: 12px; 
    margin: 30px auto 16px auto;
  }
  
  .ligas-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  
  .ligas-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
  
  .liga-card {
    padding: 8px;
    border-radius: 8px;
  }
  
  .image-container { 
    height: 70px;
    margin-bottom: 6px;
    border-radius: 6px;
  }
  
  .liga-logo {
    width: 80%;
    height: 80%;
  }
  
  /* BANDEIRA BEM MENOR NO MOBILE */
  .flag-container {
    height: 20px; /* Container bem menor */
    margin-bottom: 3px;
    border-radius: 3px;
    padding: 1px 0;
  }
  
  .bandeira-pais {
    max-height: 14px; /* Bandeira realmente pequena */
    max-width: 60%;
  }
  
  .liga-nome {
    font-size: 0.75rem;
    margin: 3px 0 2px;
    line-height: 1.1;
    font-weight: 500;
  }
  
  .liga-pais {
    font-size: 0.65rem;
    line-height: 1.1;
  }
  
  .loading-spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
  }
}

/* MOBILE PEQUENO */
@media (max-width: 520px) {
  .container-ligas { 
    padding: 10px;
    margin: 25px auto 12px auto;
  }
  
  .ligas-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .ligas-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
  
  .liga-card {
    padding: 6px;
    border-radius: 6px;
  }
  
  .image-container { 
    height: 60px;
    margin-bottom: 4px;
  }
  
  .liga-logo {
    width: 75%;
    height: 75%;
  }
  
  /* Bandeira ainda menor em mobile pequeno */
  .flag-container {
    height: 18px;
    margin-bottom: 2px;
  }
  
  .bandeira-pais {
    max-height: 12px;
    max-width: 55%;
  }
  
  .liga-nome {
    font-size: 0.7rem;
    margin: 2px 0 1px;
  }
  
  .liga-pais {
    font-size: 0.6rem;
  }
}

/* MOBILE EXTRA PEQUENO */
@media (max-width: 380px) {
  .ligas-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  
  .liga-card {
    padding: 5px;
  }
  
  .image-container {
    height: 50px;
  }
  
  /* Bandeira mínima em mobile extra pequeno */
  .flag-container {
    height: 16px;
  }
  
  .bandeira-pais {
    max-height: 10px;
    max-width: 50%;
  }
  
  .liga-nome {
    font-size: 0.65rem;
  }
  
  .liga-pais {
    font-size: 0.55rem;
  }
}