.club-profile {
  --gap: 1rem;
  --sub-key-color: hsl(from var(--key-color) h 28% 10%);
  --border-image: var(--frame-clubprofile); 
  --border-slice: 30;
  --border-width: 1.875rem;

  display: flex;
  flex-wrap: wrap;

  justify-content: center;
  align-content: center;
  align-items: center;
  column-gap: var(--gap);
  row-gap: calc(var(--gap) / 2);
  padding: var(--gap);
  margin-inline: auto;
  margin-block-end: 3rem;

  background-color: hsl(from var(--esports-nav-base-color) h s 10%);
  background-image: radial-gradient(circle at top,
        hsl(from var(--key-color) h s l / 0.2),
        transparent 100%);
  filter: drop-shadow(0 5px 15px hsl(from black h s l / 0.5));
  user-select: none;
}

@media (width <= 1280px) {
  .club-profile {
    width: min(100%, 54rem);
  }
  .club-profile .break {
    display: block;
    height: 0;
    flex-basis: 100%;
  }
}

@media (width <= 600px) {
  .club-profile {
    display: grid;
    grid-template-columns: auto;
  }
}

.profile-images {
  --width: 8.75rem;
  display: grid;
  grid-template-areas: "profile";
  width: fit-content;
  width: var(--width);
  aspect-ratio: 1/1;
  align-self: center;

  .profile-picture,
  .profile-rank-icon {
    grid-area: profile;
    align-self: center;
    justify-self: center;
  }

  .profile-picture {
    width: var(--width);
    aspect-ratio: 1/1;
    --border-image: var(--frame-profilepicture); 
    --border-slice: 30;
    --border-width: 1.875rem;
  }

  img {
    width: 100%;
    height: auto;
  }

  .profile-rank-icon {
    align-self: flex-end;
    translate: 0 0.5rem;
    width: 2rem;
  }
}

.profile-stats {
  align-self: center;

  --padding: 0.25rem;
  --border-image: var(--frame-profiletext); 
  --border-slice: 10;
  --border-width: 0.625rem;
  padding-inline: var(--padding);

  &.frame {
    padding-block: 0.75rem;
    padding-inline: calc(var(--padding) / 2);
  }

  &.profile-leaderboard {
    text-align: center;
  }

  .profile-text-featured {
    font-family: var(--font-family);
    font-weight: 700;
    color: hsl(from var(--key-color) h s calc(l + 10));
    filter: drop-shadow(0 0 10px hsl(from var(--key-color) h s l / 0.8));
  }

  .profile-text-xl {
    font-size: 2rem;
    line-height: 1;
  }

  .profile-text-l {
    font-size: 1rem;
    line-height: 1.1;
  }

  .profile-text-s {
    font-size: 0.875rem;
    text-transform: uppercase;
  }

  .profile-text-s span {
    color: var(--key-color);
  }

  #userName {
    margin-block-end: 0.25em;
  }
}

.profile-teams {
  --logo-width: 6.25rem;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.5rem;

  .profile-team-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: var(--logo-width);
  }

  img {
    width: var(--logo-width);
    height: auto;
  }

  .profile-team-label {
    margin-block-start: 0.25em;
    font-size: 0.625rem;
    text-transform: uppercase;
    text-align: center;
    text-wrap: balance;
  }
}

@media (600px < width <= 800px) {
  .profile-teams {
    margin-block: 0.25em;
    gap: var(--gap);
  }
}

@media (width <= 600px) {
  .profile-images {
    justify-self: center;
  }
  .profile-stats {
    text-align: center;
  }
  #userName,
  .profile-teams {
    margin-block: 0.25em;
  }
}





/* Decorative Elements */

.club-profile::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2.5rem;
  background-image: var(--deco-clubprofile); 
  background-position: bottom center;
  background-size: contain;
  background-repeat: no-repeat;
  inset-block-start: -2.5rem;
}


.skeleton *:where(
  #userProfilePicture,
  #userRankIcon,
  .profile-stats p,
  .profile-teams
) {
  background-color: hsl(from var(--key-color) h s l / 0.4);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  opacity: 0.4;

  color: transparent !important; /* Hide any fallback text */
  user-select: none;
}

@keyframes shimmer {
  100% { background-position: -200% 0; }
}