.profile-card-mini {
  position: fixed;
  top: clamp(14px, 2vw, 28px);
  right: clamp(14px, 2vw, 30px);
  z-index: 370;
  width: clamp(390px, 32vw, 500px);
  height: 118px;
  padding: 18px 72px 18px 142px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(231, 190, 93, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 50%, rgba(36, 154, 255, 0.18), transparent 28%),
    linear-gradient(90deg, rgba(7, 13, 18, 0.98), rgba(6, 13, 21, 0.96) 52%, rgba(3, 8, 13, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.54), inset 0 0 0 1px rgba(255, 246, 196, 0.08);
  color: #f7edd3;
  text-align: left;
}

.profile-card-mini::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 10px;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(231, 190, 93, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 43%, rgba(36, 154, 255, 0.2), transparent 48%),
    linear-gradient(145deg, rgba(19, 39, 55, 0.92), rgba(2, 8, 13, 0.98));
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.4), 0 0 22px rgba(38, 167, 242, 0.16);
}

.profile-mini-avatar {
  position: absolute;
  left: 24px;
  top: 14px;
  z-index: 1;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.profile-card-mini::after,
.profile-card-full::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(56, 96, 124, 0.58);
  border-top: 0;
  background: linear-gradient(180deg, rgba(19, 43, 61, 0.5), rgba(6, 15, 24, 0.78));
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  opacity: 0.72;
}

.profile-card-mini::after {
  right: 20px;
  top: 14px;
  width: 36px;
  height: 74px;
}

.profile-card-mini:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 232, 139, 0.92);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.58), 0 0 22px rgba(232, 194, 77, 0.16);
}

.profile-mini-level {
  position: absolute;
  left: 51px;
  top: 88px;
  width: 36px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(231, 190, 93, 0.86);
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(12, 30, 46, 0.98), rgba(2, 8, 14, 0.99));
  color: #fff4c8;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.profile-mini-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-mini-copy strong,
.profile-mini-copy small {
  overflow: visible;
  font-family: var(--serif);
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: clip;
}

.profile-mini-copy strong {
  color: #fff3d1;
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  font-weight: 900;
  text-shadow: 0 4px 16px #000;
}

.profile-mini-copy small {
  color: #86a5ba;
  font-size: clamp(1rem, 1.05vw, 1.18rem);
  text-shadow: 0 2px 10px #000;
}

.profile-card-menu {
  position: fixed;
  inset: 0;
  z-index: 3900;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.profile-card-menu[hidden] { display: none; }

.profile-card-dialog {
  position: relative;
  width: min(1160px, calc(100vw - 44px));
}

.profile-card-close {
  position: absolute;
  right: 0;
  top: -50px;
  z-index: 2;
}

.profile-card-full {
  position: relative;
  width: 100%;
  min-height: 590px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  padding: 54px 60px;
  overflow: hidden;
  border: 2px solid rgba(231, 190, 93, 0.76);
  border-radius: 10px;
  background:
    radial-gradient(circle at 19% 42%, rgba(38, 167, 242, 0.15), transparent 30%),
    linear-gradient(135deg, rgba(7, 12, 16, 0.99), rgba(8, 21, 32, 0.98) 48%, rgba(2, 8, 13, 0.99));
  color: #f7edd3;
  box-shadow: 0 30px 76px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(255, 246, 196, 0.08);
}

.profile-card-full::after {
  right: 70px;
  top: 0;
  width: 76px;
  height: 126px;
  opacity: 0.58;
}

.profile-avatar-frame {
  position: relative;
  width: 282px;
  height: 356px;
  justify-self: center;
  border: 2px solid rgba(231, 190, 93, 0.84);
  border-radius: 26px 26px 58px 58px;
  background:
    radial-gradient(circle at 50% 36%, rgba(48, 160, 255, 0.2), transparent 47%),
    linear-gradient(145deg, rgba(18, 41, 58, 0.92), rgba(2, 8, 13, 0.99));
  box-shadow: inset 0 0 0 8px rgba(0, 0, 0, 0.34), 0 0 28px rgba(38, 167, 242, 0.16);
}

.profile-full-avatar {
  width: 100%;
  height: 100%;
  padding: 12px;
  border-radius: 24px 24px 56px 56px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.52));
}

.profile-avatar-level {
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 70px;
  height: 56px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(231, 190, 93, 0.86);
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(12, 30, 46, 0.98), rgba(2, 8, 14, 0.99));
  color: #fff4c8;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 4px 14px #000;
}

.profile-card-content {
  min-width: 0;
  display: grid;
  gap: 34px;
  align-content: center;
}

.profile-identity {
  min-width: 0;
  padding-right: 100px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(231, 190, 93, 0.18);
}

.profile-full-name,
.profile-full-title {
  overflow: visible;
  font-family: var(--serif);
  line-height: 1.12;
  white-space: nowrap;
  text-overflow: clip;
}

.profile-full-name {
  color: #fff3d1;
  font-size: clamp(3rem, 4.6vw, 4.75rem);
  font-weight: 900;
  text-shadow: 0 5px 22px #000;
}

.profile-full-title {
  margin-top: 2px;
  color: #86a5ba;
  font-size: clamp(1.45rem, 2vw, 2rem);
  text-shadow: 0 3px 14px #000;
}

.profile-progress {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-level-label {
  padding: 9px 12px;
  border: 1px solid rgba(231, 190, 93, 0.76);
  border-radius: 6px;
  background: rgba(6, 12, 18, 0.84);
  color: #f3c46d;
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 900;
  text-align: center;
}

.profile-xp-meter { min-width: 0; }

.profile-xp-bar {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(105, 190, 239, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(4, 13, 20, 0.98), rgba(8, 18, 25, 0.96));
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9), 0 0 10px rgba(25, 120, 180, 0.18);
}

.profile-xp-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0c5d98, #20b8f3 72%, #76ddff);
  box-shadow: 0 0 13px rgba(38, 167, 242, 0.86);
  transition: width 280ms ease;
}

.profile-xp-text {
  margin-top: 8px;
  color: #f7ead0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: right;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(231, 190, 93, 0.2);
  padding-top: 26px;
}

.profile-stat {
  min-width: 0;
  min-height: 122px;
  display: grid;
  grid-template-rows: 48px auto auto;
  gap: 7px;
  align-items: end;
  justify-items: center;
  padding: 0 12px;
  text-align: center;
  border-left: 1px solid rgba(231, 190, 93, 0.2);
}

.profile-stat:first-child { border-left: 0; }

.profile-stat::before {
  content: "";
  width: 48px;
  height: 48px;
  border: 1px solid rgba(231, 190, 93, 0.54);
  border-radius: 10px;
  background:
    radial-gradient(circle at center, rgba(38, 167, 242, 0.2), transparent 58%),
    linear-gradient(135deg, rgba(231, 190, 93, 0.32), rgba(14, 31, 45, 0.72));
}

.profile-stat small {
  color: #86a5ba;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.1;
}

.profile-stat strong {
  color: #d8a443;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.1;
}

@media (max-width: 980px) {
  .profile-card-full {
    min-height: 510px;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    padding: 42px 38px;
  }

  .profile-avatar-frame {
    width: 210px;
    height: 282px;
  }

  .profile-card-content { gap: 24px; }
  .profile-identity { padding-right: 74px; }
  .profile-full-name { font-size: clamp(2.2rem, 5.4vw, 3.6rem); }
  .profile-full-title { font-size: 1.35rem; }
  .profile-stat { padding-inline: 6px; }
  .profile-stat small { font-size: 0.88rem; }
  .profile-stat strong { font-size: 1.05rem; }
}

@media (max-width: 820px) {
  .profile-card-mini {
    width: min(430px, 64vw);
    min-width: 340px;
    height: 104px;
    padding-left: 124px;
  }

  .profile-card-mini::before {
    width: 82px;
    height: 82px;
  }

  .profile-mini-avatar {
    left: 24px;
    top: 14px;
    width: 76px;
    height: 76px;
  }

  .profile-mini-level {
    left: 45px;
    top: 78px;
  }

  .profile-card-full {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 34px;
  }

  .profile-avatar-frame { display: none; }
  .profile-identity { padding-right: 82px; }
}

@media (max-width: 560px) {
  .profile-card-mini {
    top: 12px;
    right: 12px;
    width: min(340px, 86vw);
    min-width: 0;
    height: 92px;
    padding: 12px 52px 12px 106px;
  }

  .profile-card-mini::before {
    left: 14px;
    width: 72px;
    height: 72px;
  }

  .profile-mini-avatar {
    left: 18px;
    top: 14px;
    width: 66px;
    height: 66px;
  }

  .profile-mini-level {
    left: 34px;
    top: 68px;
    width: 34px;
    height: 26px;
    font-size: 0.95rem;
  }

  .profile-mini-copy strong { font-size: 1.45rem; }
  .profile-mini-copy small { font-size: 0.94rem; }
  .profile-card-full { padding: 26px 20px; }
  .profile-progress { grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .profile-stat:nth-child(3) { border-left: 0; }
}
