/* 会员头像（头像库图片覆盖在字母占位上）+ 头像选择弹窗 */
.avatar, .game-hall-avatar { position: relative; overflow: visible; }
.avatar > img.avatar-photo, .game-hall-avatar > img.avatar-photo {
  position: absolute;
  inset: 0;
  bottom: auto;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #24201e;
}
.avatar.has-photo, .game-hall-avatar.has-photo { color: transparent; }
.account-bar .avatar > img:not(.avatar-photo) { z-index: 1; }
.profile-avatar > img.avatar-photo { inset: 0; }
.profile-avatar.avatar-editable { cursor: pointer; }
.profile-avatar.avatar-editable::after {
  content: "更换";
  position: absolute;
  right: -4px;
  bottom: 2px;
  z-index: 1;
  padding: 1px 6px;
  border: 1px solid #c1a3728c;
  border-radius: 9px;
  background: #24201ee6;
  color: var(--gold-active);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
}

.avatar-picker {
  position: fixed;
  inset: 0;
  width: min(100%, var(--demo-width));
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  display: none;
  flex-direction: column;
  background: var(--color-page);
  color: var(--color-hi);
}
.avatar-picker[open] { display: flex; }
.avatar-picker::backdrop { background: #000; }
.avatar-picker-header {
  position: relative;
  display: grid;
  min-height: 44px;
  padding-inline: 44px;
  place-items: center;
}
.avatar-picker-header h2 { margin: 0; font-size: 17px; font-weight: 700; }
.avatar-picker-close {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  width: 44px;
  place-items: center;
  color: var(--color-hi);
}
.avatar-picker-close .chevron { width: 9px; height: 9px; transform: rotate(225deg); }
.avatar-picker-preview { display: grid; place-items: center; padding: 8px 0 12px; }
.avatar-picker-preview img {
  width: 84px;
  height: 84px;
  border: 2px solid #c1a372;
  border-radius: 50%;
  object-fit: cover;
  background: #24201e;
}
.avatar-picker-preview img:not([src]), .avatar-picker-preview img[src=""] { visibility: hidden; }
.avatar-picker-tabs { display: flex; gap: 8px; padding: 0 16px 10px; }
.avatar-picker-tabs button {
  flex: 1;
  height: 32px;
  border: 1px solid #5b4a37;
  border-radius: 16px;
  color: var(--nav-muted);
  font-size: 13px;
}
.avatar-picker-tabs button[aria-selected="true"] { border-color: #c1a372; background: #c1a37226; color: var(--gold-active); font-weight: 700; }
.avatar-picker-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content; /* 否则行高被压缩到容器高度内，头像会重叠 */
  gap: 10px;
  align-content: start;
  padding: 2px 16px 8px;
}
.avatar-picker-item {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: #24201e;
}
.avatar-picker-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-picker-item[aria-pressed="true"] { border-color: #e8cc9d; box-shadow: 0 0 0 2px #e8cc9d55; }
.avatar-picker-more {
  margin: 0 16px 6px;
  height: 32px;
  border-radius: 8px;
  background: #2b2720;
  color: var(--gold-active);
  font-size: 13px;
}
.avatar-picker-status { min-height: 18px; margin: 0 16px; color: #ffc1aa; font-size: 12px; text-align: center; }
.avatar-picker-footer { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); }
.avatar-picker-save {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e8cc9d, #ac855b);
  color: #2a2016;
  font-size: 15px;
  font-weight: 700;
}
.avatar-picker-save:disabled { opacity: .45; cursor: default; }
