.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000001;
  backdrop-filter: blur(4px);
  padding: 16px;
}
.modal {
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: #1C1C1E;
  color: #EDEDED;
  padding: 10px;
  border: 1px solid #2B2B2D;
  font-family: 'Iranian Sans', Tahoma, sans-serif;
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat !important;
}
.modal-header {
  direction: rtl;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header--close-only {
  justify-content: flex-end;
  margin-bottom: 8px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #444;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.profile-loading {
  text-align: center;
  color: #888;
  padding: 24px 0;
  margin: 0;
}

.chip.user-chip-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  font-family: inherit;
  color: inherit;
  text-align: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.chip.user-chip-btn:hover,
.chip.user-chip-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(184, 14, 19, 0.55);
  outline: none;
}

#playerProfileModal.modal-overlay {
  z-index: 10000001;
}
.player-profile-modal {
  max-width: 380px;
  width: 92%;
  overflow-x: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.player-profile-modal::-webkit-scrollbar {
  display: none;
}
.profile-player-id-btn {
  display: block;
  margin: 0 0 6px auto;
  padding: 4px 12px;
  border: 1px solid rgba(224, 184, 58, 0.45);
  background: linear-gradient(180deg, rgba(224, 184, 58, 0.18), rgba(154, 116, 24, 0.14));
  color: #ffd56a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.profile-player-id-btn:hover,
.profile-player-id-btn:focus-visible {
  background: linear-gradient(180deg, rgba(224, 184, 58, 0.3), rgba(154, 116, 24, 0.22));
  outline: none;
}
.profile-player-id-btn:active {
  transform: scale(0.97);
}
.profile-player-id-btn.is-copied {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.25), rgba(30, 140, 70, 0.2));
  border-color: rgba(46, 204, 113, 0.5);
  color: #6dff9e;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  /* Extra pad so 1.52× frame rim is not clipped by the modal scroller */
  padding: 28px 16px 16px;
  overflow: visible;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}
.profile-hero img.profile-hero-img,
.profile-hero video.profile-hero-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  background: #000;
}
.profile-hero-avatar-wrap {
  --profile-hero-avatar-size: min(150px, 42vw);
  position: relative;
  width: var(--profile-hero-avatar-size);
  height: var(--profile-hero-avatar-size);
  display: inline-block;
  overflow: visible;
}
.profile-hero-avatar-wrap .profile-supervisor-tag {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -70%);
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ffd400;
  color: #000;
  font-family: "Iranian Sans", Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
/* Keep 1.52× frame rim from covering name / edit / actions below the hero. */
.profile-hero-avatar-wrap.has-frame {
  margin-bottom: calc(
    var(--profile-hero-avatar-size) * (var(--avatar-frame-scale, 1.52) - 1) / 2
  );
}
.profile-hero-avatar-wrap.has-frame .profile-hero-img,
.profile-hero-avatar-wrap.has-frame video.profile-hero-img {
  width: var(--avatar-frame-face, 95%);
  height: var(--avatar-frame-face, 95%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.profile-hero-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% * var(--avatar-frame-scale, 1.52));
  height: calc(100% * var(--avatar-frame-scale, 1.52));
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}
.profile-hero img:not(.profile-hero-img):not(.profile-hero-frame) {
  width: min(150px, 42vw);
  height: min(150px, 42vw);
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(184, 14, 19, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.profile-hero-avatar {
  padding: 0;
  border: none;
  background: none;
  cursor: default;
}
.profile-hero-avatar-btn {
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.12s, box-shadow 0.12s;
}
.profile-hero-avatar-btn:hover,
.profile-hero-avatar-btn:focus-visible {
  transform: scale(1.04);
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 14, 19, 0.45);
}
.profile-hero-avatar-btn:disabled {
  cursor: default;
  transform: none;
  box-shadow: none;
}
.profile-avatar-hint {
  font-size: 11px;
  color: #888;
  margin-top: -4px;
}
.avatar-picker-overlay,
.appearance-picker-overlay {
  z-index: 10000002;
}
.appearance-picker-modal {
  max-width: 360px;
  width: 92%;
}
.appearance-section {
  margin-bottom: 16px;
}
.appearance-section:last-child {
  margin-bottom: 0;
}
.appearance-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #e0474b;
}
.avatar-creator-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid #c28c3d;
  background: linear-gradient(180deg, rgba(162, 112, 36, 0.32), rgba(86, 54, 20, 0.38));
  color: #ffe6b2;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.avatar-creator-cta:hover,
.avatar-creator-cta:focus-visible {
  border-color: #e6bb6c;
  background: rgba(170, 111, 31, 0.38);
  outline: none;
}
.frame-picker-preview--none {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-sizing: border-box;
}
.frame-picker-preview--none .frame-preview-avatar {
  position: static;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.frame-picker-item--none .frame-picker-preview {
  overflow: hidden;
}
.frame-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.frame-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.frame-picker-item:hover:not(:disabled),
.frame-picker-item:focus-visible:not(:disabled) {
  border-color: rgba(184, 14, 19, 0.55);
  background: rgba(184, 14, 19, 0.1);
  outline: none;
  transform: translateY(-1px);
}
.frame-picker-item-active {
  border-color: #B80E13;
  background: rgba(184, 14, 19, 0.16);
  box-shadow: 0 0 0 1px rgba(184, 14, 19, 0.3);
}
.frame-picker-item:disabled {
  opacity: 0.6;
  cursor: wait;
}
.frame-picker-preview {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: visible;
}
.frame-picker-preview img.frame-preview-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% * var(--avatar-frame-scale, 1.52));
  height: calc(100% * var(--avatar-frame-scale, 1.52));
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}
.frame-picker-preview img.frame-preview-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.frame-picker-preview.has-frame img.frame-preview-avatar,
.frame-picker-preview.has-frame video.frame-preview-avatar {
  width: var(--avatar-frame-face, 95%);
  height: var(--avatar-frame-face, 95%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

video.frame-preview-avatar.avatar-media--video {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.frame-picker-name {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  line-height: 1.3;
}
.avatar-picker-modal {
  max-width: 340px;
  width: 92%;
}
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 4px;
}
.avatar-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.avatar-picker-item:hover:not(:disabled),
.avatar-picker-item:focus-visible:not(:disabled) {
  border-color: rgba(184, 14, 19, 0.55);
  background: rgba(184, 14, 19, 0.1);
  outline: none;
  transform: translateY(-1px);
}
.avatar-picker-item-active {
  border-color: #B80E13;
  background: rgba(184, 14, 19, 0.16);
  box-shadow: 0 0 0 1px rgba(184, 14, 19, 0.3);
}
.avatar-picker-item:disabled {
  opacity: 0.6;
  cursor: wait;
}
.avatar-picker-item img,
.avatar-picker-item video,
.avatar-picker-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #000;
}
.avatar-picker-name {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  line-height: 1.3;
}
.profile-hero h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #EDEDED;
}
.profile-name-row,
.profile-avatar-hint,
.profile-referral-code {
  position: relative;
  z-index: 3;
}
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}
.profile-name-row h2 {
  text-align: center;
  word-break: break-word;
}
.profile-referral-code {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #9a9a9a;
  line-height: 1.35;
}
.profile-name-edit {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #e0474b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.12s;
}
.profile-name-edit:hover,
.profile-name-edit:focus-visible {
  background: rgba(184, 14, 19, 0.22);
  outline: none;
  transform: scale(1.05);
}
.profile-name-edit svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.rename-overlay {
  z-index: 10000003;
}
.rename-modal {
  max-width: 320px;
  width: 92%;
}
.rename-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rename-form label {
  font-size: 13px;
  color: #bbb;
}
.rename-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
}
.rename-form input:focus {
  outline: none;
  border-color: rgba(184, 14, 19, 0.55);
}
.rename-error {
  margin: 0;
  font-size: 12px;
  color: #e0474b;
  line-height: 1.4;
}
.rename-submit {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #c41419 0%, #8b0c10 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.rename-submit-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.rename-submit-cost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}
.rename-submit-cost-value {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.rename-submit-gem {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(140, 220, 255, 0.65));
}
.rename-submit.rename-submit--paid {
  background: linear-gradient(180deg, #4a9fe8 0%, #2563b8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 184, 0.35);
}
.rename-submit.rename-submit--paid:hover,
.rename-submit.rename-submit--paid:focus-visible {
  background: linear-gradient(180deg, #5aaff5 0%, #2f74cc 100%);
  outline: none;
}
.rename-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
.ban-modal-overlay {
  z-index: 10000010;
}
.ban-modal {
  max-width: 360px;
  text-align: center;
}
.ban-modal-text {
  margin: 8px 0 20px;
  font-size: 15px;
  line-height: 1.7;
  color: #ddd;
}
.ban-modal-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #c41419 0%, #8b0c10 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.profile-id {
  font-size: 12px;
  color: #aaa;
  direction: ltr;
}
.profile-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.profile-meta-box {
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}
.profile-meta-box .label {
  display: block;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}
.profile-meta-box .value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.profile-exp {
  margin-bottom: 16px;
}
.profile-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #bbb;
  margin-bottom: 6px;
}
.profile-exp-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.profile-exp-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e0474b, #B80E13);
  transition: width 0.3s ease;
}

.profile-clan {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(224, 184, 58, 0.28);
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
  text-decoration: none;
  color: inherit;
  direction: rtl;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.profile-clan:hover,
.profile-clan:focus-visible {
  border-color: rgba(224, 184, 58, 0.5);
  outline: none;
}

.profile-clan-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.profile-clan-logo-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.profile-staff-tag {
  font-size: 9px;
  line-height: 1.15;
  font-family: "Iranian Sans", Tahoma, serif;
  text-align: center;
  max-width: 48px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  border-radius: 10px;
  padding: 2px 5px;
}

.profile-staff-tag.staff-tag--owner {
  background: #c4a035;
  color: #1a1a1a;
}

.profile-staff-tag.staff-tag--leader {
  background: #2b6cb0;
  color: #fff;
}

.profile-clan-logo {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(184, 14, 19, 0.45));
}

.profile-clan-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: contain;
}

.profile-clan-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.profile-clan-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ededed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-clan-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(224, 184, 58, 0.9);
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.profile-clan-rank {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.profile-stats-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #e0474b;
}

.profile-achievements {
  margin: 14px 0 8px;
}

.profile-achievements-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #e0b83a;
}

.profile-achievements-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  justify-items: center;
  align-items: center;
}

.profile-achievement-btn {
  width: min(100%, 70px);
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 70px;
  max-height: 70px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.profile-achievement-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.profile-achievement-tip-overlay {
  z-index: 10000005;
}

.profile-achievement-tip-modal {
  max-width: 300px;
  width: min(90vw, 300px);
  text-align: center;
}

.profile-achievement-tip-modal img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

@media (max-width: 380px) {
  .profile-achievements-row {
    gap: 4px;
  }

  .profile-achievement-btn {
    max-width: 56px;
    max-height: 56px;
  }
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.profile-stat {
  background: url("/icons/bg-items.webp") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
}
.profile-stat .label {
  display: block;
  font-size: 10px;
  color: #888;
  margin-bottom: 3px;
}
.profile-stat .value {
  font-size: 15px;
  font-weight: 700;
  color: #eee;
}
.profile-stat.full-width {
  grid-column: 1 / -1;
}

/* ══════════════════════════════════════
   Shared profile modal chrome (app + lobby)
   Matches Persepolis shell; lobby game UI stays separate.
══════════════════════════════════════ */
#appearancePickerModal .appearance-picker-modal,
#renameModal .rename-modal,
#referralModal .referral-modal,
#profileAchievementTip .profile-achievement-tip-modal {
  border: 1.5px solid var(--p-line, rgba(224, 184, 58, 0.28)) !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(91, 45, 158, 0.2) !important;
  color: var(--p-text, #f7f2ea);
}

#playerProfileModal .player-profile-modal {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  color: var(--p-text, #f7f2ea);
}

/* Decorative page frame — grid overlay (app shell + lobby; not app-background.css) */
.player-profile-stack {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  min-height: 100%;
}

.player-profile-stack > .app-pages-bg {
  grid-column: 1;
  grid-row: 1 / -1;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  pointer-events: none;
}

.player-profile-stack .app-pages-bg-top,
.player-profile-stack .app-pages-bg-bottom {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
}

.player-profile-stack .app-pages-bg-middle {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  background: url("/icons/pages-bg-middle.webp") repeat-y center top;
  background-size: 100% auto;
}

.player-profile-stack > .modal-header {
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
  position: relative;
  padding: 16px 16px 0 16px;
  margin-bottom: 0;
}

.player-profile-stack > #playerProfileBody {
  grid-column: 1;
  grid-row: 2;
  z-index: 1;
  position: relative;
  min-height: auto;
  padding: 0 16px 52px 16px;
}

#playerProfileModal .modal-title,
#appearancePickerModal .modal-title,
#renameModal .modal-title,
#referralModal .modal-title,
#profileAchievementTip .modal-title {
  color: var(--p-gold-light, #ffd56a) !important;
  font-weight: 800 !important;
}

#playerProfileModal,
#playerProfileModal *,
#appearancePickerModal,
#appearancePickerModal *,
#renameModal,
#renameModal *,
#referralModal,
#referralModal *,
#profileAchievementTip,
#profileAchievementTip * {
  border-radius: 0 !important;
}

#playerProfileModal{
  direction: rtl;
}

#playerProfileModal .modal-close,
#appearancePickerModal .modal-close,
#renameModal .modal-close,
#referralModal .modal-close,
#profileAchievementTip .modal-close,
#playerProfileModal .profile-hero-img,
#playerProfileModal .profile-hero-avatar-wrap,
#playerProfileModal video.profile-hero-img,
#playerProfileModal .avatar-media--video,
#appearancePickerModal .avatar-picker-item img,
#appearancePickerModal .avatar-picker-item video,
#appearancePickerModal .avatar-picker-thumb,
#appearancePickerModal .frame-preview-avatar,
#appearancePickerModal video.frame-preview-avatar,
#referralModal .referral-invited-avatar {
  border-radius: 50% !important;
}

.appearance-section-title,
.profile-stats-title {
  color: var(--p-gold-light, #ffd56a);
}

.profile-exp-fill {
  background: linear-gradient(90deg, #9e2d2d, var(--p-gold, #e0b83a));
}

.profile-hero h2 {
  color: var(--p-cream, #fff4d8);
}

.profile-meta-box {
  border-color: var(--p-line, rgba(224, 184, 58, 0.28));
}

.profile-stat,
.profile-stat.full-width {
  border-color: rgba(184, 153, 15, 0.28);
}

.avatar-picker-item-active,
.frame-picker-item-active {
  border-color: var(--p-gold, #e0b83a);
  background: rgba(224, 184, 58, 0.14);
  box-shadow: 0 0 0 1px rgba(224, 184, 58, 0.3);
}

.avatar-picker-item:hover:not(:disabled),
.avatar-picker-item:focus-visible:not(:disabled),
.frame-picker-item:hover:not(:disabled),
.frame-picker-item:focus-visible:not(:disabled) {
  border-color: rgba(224, 184, 58, 0.55);
  background: rgba(224, 184, 58, 0.1);
}

.profile-hero-avatar-btn:hover,
.profile-hero-avatar-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(224, 184, 58, 0.45);
}

#clanProfileModal.modal-overlay {
  z-index: 10000002;
}

#clanProfileModal .clan-profile-modal {
  max-width: 420px;
  width: 94%;
  max-height: min(92vh, 900px);
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  color: var(--p-text, #f7f2ea);
}

#clanProfileModal .player-profile-stack {
  max-height: min(92vh, 900px);
  overflow: hidden;
}

#clanProfileModal .clan-profile-modal-body {
  grid-column: 1;
  grid-row: 2;
  z-index: 1;
  position: relative;
  min-height: 0;
  max-height: calc(min(92vh, 900px) - 52px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 52px 16px;
  scrollbar-width: thin;
}

#clanProfileModal .clan-profile-name {
  margin: 0;
  font-size: 1.2rem;
}

#clanProfileModal .clan-friend-chip {
  font: inherit;
  cursor: pointer;
}

#clanProfileModal,
#clanProfileModal * {
  border-radius: 0 !important;
}

#clanProfileModal {
  direction: rtl;
}
