.avatar-overlay{
  position:fixed; inset:0;
  background: var(--bg-main);
  z-index:9999;
  display:flex; align-items:center; justify-content:center;
  padding: 16px;
  overflow: auto;
}

.avatar-card{
  width:860px;
  max-width: calc(100vw - 32px);
  background: var(--bg-panel);
  border: 1px solid var(--text-muted);
  border-radius:4px;
  padding:20px;
  display:flex;
  flex-direction: column;
  gap:14px;
  color: var(--text-main);
}

.avatar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.avatar-title{
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .02em;
}

.avatar-close-x{
  width: 38px;
  height: 38px;
  border-radius: 4px;
  border: 1px solid var(--text-muted);
  background: var(--bg-container);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.avatar-close-x:hover{ transform: translateY(-1px); }
.avatar-close-x:active{ transform: translateY(0); filter: brightness(0.98); }
.avatar-close-x img{ width: 18px; height: 18px; }

.avatar-body{
  display:flex;
  gap:20px;
}

.avatar-preview{
  width:280px;
  display:flex;
  flex-direction: column;
  justify-content:center;
  align-items:center;
  gap: 10px;
}

.avatar{
  width:150px;height:150px;
  border-radius:50%;
  overflow:hidden;
  position:relative;
  background: var(--bg-container);
  border: 1px solid var(--text-muted);
}

.avatar img{ position:absolute; left:50%; transform:translateX(-50%); }

.avatar .skin{ bottom:-30%; width:80%; z-index:0; }
.avatar .body{ bottom:-30%; width:80%; z-index:1; }
.avatar .eyes{ top:36.4%; width:65%; left:60%; z-index:3; transform:translateX(-50%); }
.avatar .head{ top:0; width:90%; z-index:2; }

.avatar.avatar-big{
  width: 220px;
  height: 220px;
  border-radius: 18px;
}

.avatar-hint{
  font-size: 12px;
  opacity: .75;
  text-align: center;
  max-width: 240px;
}

/* debug styles removed */

.avatar-inventory{ flex:1; }

.avatar-inventory{
  display:flex;
  flex-direction: column;
  min-height: 360px;
}

.equipped{
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 4px;
  background: var(--bg-container);
  border: 1px solid var(--text-muted);
}

.equipped-title{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 10px;
}

.equipped-row{
  display:flex;
  gap:10px;
}

.equipped-slot{
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: var(--bg-container);
  border: 1px solid var(--text-muted);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.equipped-slot img{
  width: 84%;
  image-rendering: pixelated;
}
.equipped-slot:hover{
  border-color: var(--accent-yellow);
}

/* Tabs removed — Equipped buttons are the selector */
.equipped-slot.active{
  border-color: var(--accent-yellow);
  box-shadow: inset 0 0 0 2px var(--accent-yellow);
}

.items-box{
  margin-top: 14px;
  padding: 12px;
  border-radius: 4px;
  background: var(--bg-container);
  border: 1px solid var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.items-title{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,64px);
  gap:10px;
  max-height:320px;
  overflow-y:auto;
  flex: 1;
  padding-bottom: 6px;
}

.item-img{
  width:64px;height:64px;
  background: var(--bg-container);
  border: 1px solid var(--text-muted);
  border-radius:4px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  padding: 0;
}
.item-img:hover{ border-color: var(--accent-yellow); }
.item-img:active{ filter: brightness(0.98); }
.item-img img{ width:90%; }
.item-img.selected{
  border-color: var(--accent-yellow);
  box-shadow: inset 0 0 0 2px var(--accent-yellow);
}

.actions{
  display:flex;
  gap:14px;
  margin-top:16px;
}

.actions-sticky{
  position: sticky;
  bottom: 0;
  padding-top: 14px;
  background: var(--bg-panel);
}
.save-btn{
  flex:1;
  background: var(--accent-yellow);
  padding:12px;
  border-radius:4px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-main);
}
.close-btn{
  flex:1;
  background: var(--bg-container);
  padding:12px;
  border-radius:4px;
  border: 1px solid var(--text-muted);
  font-weight: 800;
  cursor: pointer;
  color: var(--text-main);
}

