/* avatar-picker.css — modal + grid */

/* Hard-hide the original upload UI bits as a belt-and-suspenders measure */
.AvatarEditor input[type="file"] { display: none !important; }
.AvatarEditor .item-upload,
.AvatarEditor .item-remove { display: none !important; }

.ap-modal { position: fixed; inset: 0; z-index: 100000; }
.ap-modal.hidden { display: none; }
.ap-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 12, 8, 0.78);
  backdrop-filter: blur(2px);
}
.ap-dialog {
  position: relative;
  width: min(880px, 92vw);
  max-height: 85vh;
  margin: 4vh auto 0;
  background: #2a1f14;
  border: 2px solid #6b4a25;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  color: #e8d9b8;
  font-family: inherit;
}
.ap-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #6b4a25;
}
.ap-header h3 {
  margin: 0;
  font-size: 20px;
  color: #f0d99a;
  font-weight: 600;
}
.ap-close {
  background: transparent; border: none; color: #e8d9b8;
  font-size: 28px; line-height: 1; cursor: pointer;
  padding: 0 8px;
}
.ap-close:hover { color: #fff; }
.ap-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1 1 auto;
}
.ap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.ap-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 8px;
  background: #1c130a;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s;
  color: #d6c6a4;
  font: inherit;
  font-size: 12px;
  text-align: center;
}
.ap-tile:hover {
  border-color: #b88a3a;
  transform: translateY(-1px);
}
.ap-tile.selected {
  border-color: #f0d99a;
  background: #3a2614;
}
.ap-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.ap-tile span {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: #d6c6a4;
  word-break: break-word;
}
.ap-footer {
  padding: 10px 20px;
  border-top: 1px solid #6b4a25;
  min-height: 22px;
  font-size: 13px;
}
.ap-status.ap-busy { color: #e8d9b8; }
.ap-status.ap-ok { color: #8bcf6e; }
.ap-status.ap-err { color: #e07a7a; }

/* The "Choose Avatar" menu item we insert */
.AvatarEditor .ap-menu-item button {
  width: 100%;
  text-align: left;
}
