/* ---------------------------------------------------------------------------
   Teams grid & card
--------------------------------------------------------------------------- */
/* Grid layout for teams */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  align-items: start;
}

/* Team card style */
.team-card {
  background: #1c1c2f;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Team name styling */
.team-card h3 {
  font-size: 1.2rem;
  line-height: 1.6;
  min-height: calc(2 * 1.6em);
  margin-bottom: 10px;
}

/* Team logo centered */
.team-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto 15px auto;
}

/* Player list styling */
.team-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Each player row */
.team-card li {
  font-size: 0.9rem;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Role icon beside name */
.role-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  display: inline-block;
}

/* Tooltip styling */
.role-icon-wrapper {
  position: relative;
  display: inline-block;
}

/* Tooltip text (initially hidden) */
.role-icon-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

/* Tooltip arrow */
.role-icon-wrapper::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Show tooltip on hover */
.role-icon-wrapper:hover::after,
.role-icon-wrapper:hover::before {
  opacity: 1;
}

/* mobile */
@media (max-width: 768px) {
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }
}
