.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: #1c1c1c;
  border-radius: 18px;
  color: #fff;
  padding: 16px;
  border: 1px solid #444;
  font-family: 'Iranian Sans', Tahoma, sans-serif;
}
.modal-header {
  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(255, 215, 0, 0.35);
  outline: none;
}

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

.player-profile-modal::-webkit-scrollbar {
  display: none;
}
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}
.profile-hero img.profile-hero-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.profile-hero-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: inline-block;
}
.profile-hero-frame {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  pointer-events: none;
  z-index: 2;
}
.profile-hero img:not(.profile-hero-img):not(.profile-hero-frame) {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 215, 0, 0.45);
  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(255, 215, 0, 0.35);
}
.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: #ffd700;
}
.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(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.08);
  outline: none;
  transform: translateY(-1px);
}
.frame-picker-item-active {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.25);
}
.frame-picker-item:disabled {
  opacity: 0.6;
  cursor: wait;
}
.frame-picker-preview {
  position: relative;
  width: 64px;
  height: 64px;
}
.frame-picker-preview img.frame-preview-ring {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  pointer-events: none;
  z-index: 2;
}
.frame-picker-preview img.frame-preview-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.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(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.08);
  outline: none;
  transform: translateY(-1px);
}
.avatar-picker-item-active {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.25);
}
.avatar-picker-item:disabled {
  opacity: 0.6;
  cursor: wait;
}
.avatar-picker-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.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: #ffd700;
}
.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-name-edit {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffd700;
  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(255, 215, 0, 0.18);
  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(255, 215, 0, 0.45);
}
.rename-error {
  margin: 0;
  font-size: 12px;
  color: #ff6b6b;
  line-height: 1.4;
}
.rename-submit {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd700, #e6b800);
  color: #1a1a1a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.rename-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
.profile-logout-btn {
  margin-top: 4px;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #c62828;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.profile-logout-btn:hover,
.profile-logout-btn:focus-visible {
  background: #e53935;
  outline: none;
}
.profile-logout-btn:active {
  transform: scale(0.98);
}
.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, #ffd700, #e6b800);
  color: #1a1a1a;
  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: rgba(255, 255, 255, 0.05);
  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, #ffd700, #ffb300);
  transition: width 0.3s ease;
}
.profile-stats-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd700;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.profile-stat {
  background: rgba(0, 0, 0, 0.25);
  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;
}
