HTML
<fieldset class="crb-avatar">
<legend class="crb-sr">Avatar</legend>
<label style="--c: #7c6cff"><input type="radio" name="crb-avatar" /><span>A</span></label>
<label style="--c: #ff6c8a"><input type="radio" name="crb-avatar" checked /><span>B</span></label>
<label style="--c: #2ecc8a"><input type="radio" name="crb-avatar" /><span>C</span></label>
<label style="--c: #f5a623"><input type="radio" name="crb-avatar" /><span>D</span></label>
</fieldset>
CSS
.crb-avatar { display: flex; gap: 10px; border: 0; padding: 0; }
.crb-avatar input { appearance: none; -webkit-appearance: none; position: absolute; opacity: 0; }
.crb-avatar label { cursor: pointer; }
.crb-avatar span {
display: flex; align-items: center; justify-content: center;
width: 40px; height: 40px; border-radius: 50%;
background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c), white 30%));
font: 700 14px/1 system-ui, sans-serif; color: #fff;
box-shadow: 0 0 0 0 var(--c);
transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s, opacity 0.25s;
opacity: 0.55;
}
.crb-avatar label:hover span { opacity: 0.85; }
.crb-avatar input:checked + span {
opacity: 1; transform: scale(1.15);
box-shadow: 0 0 0 3px #15151d, 0 0 0 5px var(--c), 0 0 18px var(--c);
}
.crb-sr {
position: absolute !important;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}