.teams-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* One full-width row per team: team-color identity panel left, players right.
     Card height follows the roster; a gentle floor keeps small rosters decent. */
  .team {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 200px;
    background: linear-gradient(180deg, #2a2c33 0%, #191a1e 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }
  /* Accent bar across the top, gradient of the team's two colors. */
  .team::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    z-index: 1;
    background: linear-gradient(90deg, var(--team-c1, #888), var(--team-c2, #bbb), var(--team-c1, #888));
  }
  /* No vertical lift on hover (per preference) — just border + shadow. */
  .team:hover {
    border-color: var(--team-accent, #4a4d55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  }

  /* Left identity panel — the team-color zone, blending BOTH team colors. */
  .team-identity {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 1.1rem 1rem;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03); /* fallback if color-mix unsupported */
    background: linear-gradient(150deg,
      color-mix(in srgb, var(--team-c1, #888) 34%, transparent) 0%,
      color-mix(in srgb, var(--team-c2, #bbb) 28%, transparent) 100%);
  }

  .team-name {
    margin: 0 0 0.35rem;
    padding: 0;
    border: none;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    color: var(--gold);
  }

  .team-eyebrow {
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
  }

  .team-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
  }
  .team-badge {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  /* Two badges, one per team color. */
  .team-badge--tag {
    border-color: var(--team-c1, var(--border)); /* fallback */
    border-color: color-mix(in srgb, var(--team-c1, #888) 75%, var(--border));
  }
  .team-badge--count {
    border-color: var(--team-c2, var(--border)); /* fallback */
    border-color: color-mix(in srgb, var(--team-c2, #bbb) 75%, var(--border));
  }
  /* Previous-season O.W.L.s final placement. */
  .team-badge--rank {
    color: var(--gold);
    border-color: rgba(255, 189, 0, 0.45);
    background: rgba(255, 189, 0, 0.08);
  }
  /* Previous-season N.E.W.T.s (playoff) podium. */
  .team-badge--newts {
    color: #79e0e8;
    border-color: rgba(121, 224, 232, 0.45);
    background: rgba(121, 224, 232, 0.08);
  }

    /* Grows to consume the panel's leftover height; the logo scales to fill it. */
    .team-header {
      flex: 1 1 0;
      min-height: 0;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0.5rem 0;
    }

    .team-logo {
      max-height: 100%;
      max-width: 96%;
      filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
      transition: transform 0.3s ease;
    }

    .team-header:hover .team-logo {
      transform: scale(1.05);
    }

  /* Right side: players in a single full-width column (max 10). The taller list
     makes the card taller, so the auto-fit logo grows larger. */
  .player-grid {
    flex: 1;
    padding: 1.1rem 1.3rem !important;
  }

  /* Player row tags: captain, role(s), region, awards. */
  .player-tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
  }
  /* Socials pushed to the right edge of the row. */
  .social-tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-left: auto;
  }
  .ptag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .ptag-icon { width: 12px; height: 12px; object-fit: contain; }

  .ptag--captain,
  .ptag--award {
    color: var(--gold);
    border-color: rgba(255, 189, 0, 0.5);
    background: rgba(255, 189, 0, 0.12);
  }
  .ptag--region { color: var(--ink); }
  /* Co-Captain: softer gold than the captain's, to read as secondary. */
  .ptag--cocaptain {
    color: #d8b24a;
    border-color: rgba(255, 189, 0, 0.32);
    background: rgba(255, 189, 0, 0.07);
  }
  /* Logo-only social chips: tighter padding since there's no text. */
  .ptag--icononly { padding: 0.16rem 0.34rem; }
  /* Role labels: deliberately understated (no role color, no icon). */
  .ptag--role {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
    font-weight: 600;
  }

  /* Social tags: colored by each platform's brand. */
  a.ptag { text-decoration: none; cursor: pointer; }
  a.ptag:hover { filter: brightness(1.18); }
  .ptag--discord { color: var(--ink); text-transform: none; }
  a.player-name { color: inherit; text-decoration: none; }
  a.player-name:hover { text-decoration: underline; }
  a.player-name.captain-name { color: #ffbd00; }
  .ptag--twitch  { color: #c39bff; border-color: rgba(145, 70, 255, 0.5); background: rgba(145, 70, 255, 0.14); }
  .ptag--youtube { color: #ff7a7a; border-color: rgba(255, 0, 0, 0.45); background: rgba(255, 0, 0, 0.12); }
  .ptag--x       { color: #8ecbf5; border-color: rgba(29, 155, 240, 0.5); background: rgba(29, 155, 240, 0.12); }
  .ptag--tiktok  { color: #5cf2e8; border-color: rgba(37, 244, 238, 0.45); background: rgba(37, 244, 238, 0.12); }
  .ptag--seeker { color: #ffd86b; border-color: rgba(255, 216, 107, 0.45); background: rgba(255, 216, 107, 0.1); }
  .ptag--keeper { color: #5fd38d; border-color: rgba(95, 211, 141, 0.45); background: rgba(95, 211, 141, 0.1); }
  .ptag--beater { color: #ef6f6f; border-color: rgba(239, 111, 111, 0.45); background: rgba(239, 111, 111, 0.1); }
  .ptag--chaser { color: #5fa8ef; border-color: rgba(95, 168, 239, 0.45); background: rgba(95, 168, 239, 0.1); }

  .team-colors {
    display: flex;
    justify-content: center;
  }
  
  .color-swatch {
    width: 20px;
    height: 20px;
    margin: 0px 2px 5px;
    border-radius: 50%;
    border: 1px solid var(--search-input-background-color);
  }
  
  .player-list, .full-roster {
    list-style-type: none;
    padding: 0 !important;
    margin:0 !important;
  }
  
  .player {
    background-color: var(--base-background-color);
    border-radius: 2px;
    margin-bottom: 5px;
    position: relative;
  }
  
  .player-info {
    padding: 7px 20px;
    display: flex;
    justify-content: left;
    align-items: center;
  }
  
  .position-sprite {
    width: 25px;
    height: 25px;
    margin-right: 10px;
    margin-left: -7px;
  }
  
  .player-name {
    cursor: pointer;
  }
  
  .player-unavailable {
    font-size: 95%;
    margin-left: auto;
    font-style: italic;
    color: #575757;
    margin-right:-10px;
  }
  
  .player-profile {
    display: none;
    position: absolute;
    width: 300px; 
    border: 1px solid var(--sidebar-border-color);
    border-radius: 4px;
    background-color: var(--base-background-color);
    overflow: hidden;
    z-index: 10;
  }
  .disabled-player-profile{
    display: none;
  }
  .player-details {
    margin-top: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.detail-sprite {
    width: 10px;
    height: 10px;
    margin-right: 10px;
}
 
  .profile-image {
    width: 100%;
  }
  .profile-content {
    padding: 2px 10px 10px 10px;
    width: 80%;
  }
  .attribute-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

/* Update player profile padding to accommodate icons better */
.player-profile {
    padding: 15px;
    background-color: var(--base-background-color);
}

/* Ensure proper spacing between attribute rows */
.player-attributes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Adjust attribute container spacing */
.attribute {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
}
  .player-profile img {
    object-fit: cover;
    transform: scale(1.2);
  }

  .stats-title {
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
    margin-left: 20px;
  }
  
  .stat-bar, .skill-bar {
    display: flex;
    align-items: center;
  }
  
  .stat-name, .skill-name {
    width: 100%;
    font-size: 80%;
    font-weight: normal;
    text-align: right;
    margin-right: 10px;
    margin-left: 10px;
  }
  
  .tick-container {
    display: flex;
    gap: 2px;
  }
  
  .tick {
    width: 7px;
    height: 7px;
  }
  
  .tick.filled {
    background-color: #ffbd00;
  }
  
  .player:last-child .player-profile,
  .player:nth-last-child(2) .player-profile {
    left: auto;
    right: 0;
  }
  
  .see-full-roster {
    background:none;
    font-style: italic;
    font-size: 90%;
    border: none; 
    padding: 5px 40px;
    margin-bottom: 2px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    color: var(--strong-color);
    border-radius: 5px;
    transition: background-color 0.3s;
  }
  
  .see-full-roster:hover { 
    color: #ffbd00;
  }
  
  .hidden {
    display: none !important;
  }
  
  .full-roster {
    list-style-type: none;
    padding: 0 !important;
  }
  .captain-name {
    color: #ffbd00;
}
  .position-sprite {
    width: 24px;
    height: 24px;
  }
  
  .position-sprite-secondary {
    width: 15px;
    height: 15px;
  }
  
.region-sprite {
  width: 15px;
  height: 15px;
  opacity: 30%;
  margin-left: 5px;
  margin-right: 5px;
  vertical-align: middle;
}
  .social-icons {
    display: inline-flex;
    margin-left: 10px;
    margin-right:-10px;
    justify-content: right;
  }

  .social-icon-link {
    margin-right: 3px;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    filter: grayscale(30%);
  }
  .social-icon-link:hover {
    opacity: 1;
    filter: grayscale(0%);
  }
  .social-icon {
    width: 17px;
    height: 17px;
    vertical-align: middle;
  }

  #expand-all-button {
    text-align: center;
    margin-bottom: 2px;
    padding: 5px 30px;
    background-color: #202020;
    color: #fff;
    border: none;
    cursor: pointer;
  }
  
  #expand-all-button:hover {
    color: #ffbd00;
  }

  /* ── Player avatars + fancier roster cards ─────────────────────────────── */
  .player-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    object-fit: cover;
    margin-right: 12px;
    margin-left: -6px;
    border: 2px solid var(--border);
    background: #15161a;
    transition: border-color 0.15s ease, transform 0.15s ease;
  }
  .player:hover .player-avatar { border-color: var(--team-accent, var(--gold)); transform: scale(1.06); }

  /* Player rows: faint team tint, stronger on hover. Tight spacing; never
     split a row across the two columns. */
  .player {
    border-radius: 6px;
    break-inside: avoid;
    margin-bottom: 3px;
    transition: background-color 0.15s ease;
    background: rgba(255, 255, 255, 0.02); /* fallback */
    background: color-mix(in srgb, var(--team-accent, #888) 7%, rgba(255, 255, 255, 0.02));
  }
  .player:hover {
    background: var(--panel-2); /* fallback */
    background: color-mix(in srgb, var(--team-accent, #888) 22%, var(--panel-2));
  }
  .player-info {
    flex-wrap: wrap;
    gap: 5px 8px;
    padding: 6px 12px;
  }
  .player-name { flex: 0 0 auto; }

  .color-swatch { border: 1px solid var(--border); }

  @media (max-width: 768px) {
    /* Stack the identity panel above a single-column roster. */
    .team { flex-direction: column; }
    .team-identity {
      flex-basis: auto;
      border-right: none;
      border-bottom: 1px solid var(--border);
    }
    .player-grid { grid-template-columns: 1fr; }

    .player-profile {
      width: 90%;
      left: 5%;
      right: 5%;
    }

    .player-profile .player-info {
      padding: 0px;
      display: none;
    }

    .player-profile .player-image-container {
      height: 450px;
    }
  }