.playerProfilePanel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 16px;
  position: relative;
  border: 1px solid rgba(91, 226, 255, 0.3);
  background: rgba(8, 12, 20, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 24px rgba(91, 226, 255, 0.2);
  backdrop-filter: blur(8px);
  min-width: min(320px, 80vw);
}

.profileMount {
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.playerProfilePanel .avatarShell {
  position: relative;
  width: 56px;
  height: 56px;
}

.playerProfilePanel .avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid rgba(120, 220, 255, 0.45);
  background: radial-gradient(circle at 30% 30%, rgba(120, 220, 255, 0.5), rgba(12, 18, 32, 0.9));
  box-shadow: 0 0 12px rgba(120, 220, 255, 0.35);
  object-fit: cover;
}

.playerProfilePanel .avatarPlaceholder {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(120, 220, 255, 0.45);
  background: radial-gradient(circle at 30% 30%, rgba(120, 220, 255, 0.5), rgba(12, 18, 32, 0.9));
  box-shadow: 0 0 12px rgba(120, 220, 255, 0.35);
  position: absolute;
  inset: 0;
}

.playerProfilePanel .infos {
  display: grid;
  gap: 4px;
}

.playerProfilePanel .username {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.playerProfilePanel .level {
  font-size: 12px;
  opacity: 0.75;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playerProfilePanel .xp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
}

.playerProfilePanel .xp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(91, 226, 255, 0.8), rgba(120, 120, 255, 0.9));
  box-shadow: 0 0 12px rgba(91, 226, 255, 0.55);
  transition: width 420ms ease;
}

.playerProfilePanel .xp-bar.is-hidden {
  display: none;
}

.playerProfilePanel .guestText {
  display: none;
  gap: 4px;
}

.playerProfilePanel .guestTitle {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.playerProfilePanel .guestSubtitle {
  font-size: 11px;
  opacity: 0.7;
  max-width: 220px;
  line-height: 1.35;
}

.playerProfilePanel .guestLoginBtn {
  display: none;
  align-self: center;
  justify-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(91, 226, 255, 0.5);
  background: rgba(10, 16, 26, 0.65);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(91, 226, 255, 0.2);
}

.playerProfilePanel .guestLoginBtn:hover {
  border-color: rgba(120, 220, 255, 0.8);
  color: #fff;
}

.playerProfilePanel.is-guest {
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 12px;
  min-width: min(260px, 70vw);
}

.playerProfilePanel.is-guest .avatar {
  display: none;
}

.playerProfilePanel.is-guest .avatarPlaceholder {
  filter: grayscale(0.2) brightness(0.95);
  opacity: 0.9;
}

.playerProfilePanel.is-guest .infos {
  display: none;
}

.playerProfilePanel.is-guest .guestText {
  display: grid;
}

.playerProfilePanel.is-guest .guestLoginBtn {
  display: inline-flex;
}

.playerProfilePanel .accountActions {
  display: inline-flex;
  gap: 6px;
  justify-self: end;
  align-self: center;
}

.playerProfilePanel .accountMiniBtn {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(91, 226, 255, 0.35);
  background: rgba(10, 16, 26, 0.5);
  color: rgba(230, 242, 255, 0.9);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.playerProfilePanel .accountMiniBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.playerProfilePanel .accountMiniBtn:hover:not(:disabled) {
  border-color: rgba(120, 220, 255, 0.75);
}

.playerProfilePanel.is-guest .accountActions {
  justify-self: start;
}

.playerProfilePanel.is-levelup {
  animation: levelUpFlash 0.6s ease;
}

.playerProfilePanel.is-ranked-unlocked {
  animation: rankedGlow 0.7s ease;
}

.profileToast {
  position: absolute;
  right: 12px;
  bottom: -22px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(91, 226, 255, 0.35);
  background: rgba(10, 16, 26, 0.9);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.profileToast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes levelUpFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 210, 120, 0);
  }
  40% {
    transform: scale(1.03);
    box-shadow: 0 0 24px rgba(255, 210, 120, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 210, 120, 0);
  }
}

@keyframes rankedGlow {
  0% {
    box-shadow: 0 0 0 rgba(120, 255, 170, 0);
  }
  50% {
    box-shadow: 0 0 26px rgba(120, 255, 170, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(120, 255, 170, 0);
  }
}

.playerProfilePanel.is-loading {
  animation: profilePulse 0.8s ease-in-out infinite;
}

@keyframes profilePulse {
  0% {
    box-shadow: 0 0 0 rgba(91, 226, 255, 0.0);
  }
  50% {
    box-shadow: 0 0 18px rgba(91, 226, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(91, 226, 255, 0.0);
  }
}

@media (max-width: 980px) {
  .playerProfilePanel {
    width: 100%;
    min-width: 0;
  }
}
