/* Round player pictures and the picker. Colors come from the title's theme; the pictures carry their own. */
.avatar {
  --avatar-size: 2rem;
  flex: none;
  display: inline-block;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px var(--sw-border);
  line-height: 0;
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar[data-avatar="none"] { background: var(--sw-raised); }

.avatar-picker { width: min(24rem, calc(100vw - 1.5rem)); }
.avatar-picker h2 { margin: 0 0 .25rem; }
.avatar-picker-note { margin: 0 0 .9rem; color: var(--sw-muted); }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 4.6rem)); justify-content: center; gap: .55rem; margin-bottom: 1rem; }
.avatar-choice {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: .25rem;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.avatar-choice .avatar { --avatar-size: 100%; }
.avatar-choice:hover .avatar { box-shadow: 0 0 0 2px var(--sw-accent); }
.avatar-choice:focus-visible { outline: 3px solid var(--sw-focus, var(--sw-accent)); outline-offset: 1px; }
/* The current choice is ringed and ticked, so it never rests on color alone. */
.avatar-choice[aria-pressed="true"] { border-color: var(--sw-accent); position: relative; }
.avatar-choice[aria-pressed="true"]::after {
  content: "\2713";
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font: 700 .75rem/1 system-ui, sans-serif;
  color: var(--sw-on-action);
  background: var(--sw-action);
}
.avatar-picker-close { font: inherit; }

/* A picture before a name in a list or heading: the open-game rows, the waiting room's seats and My record. */
.avatar-line { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; }
.avatar-line > .avatar { --avatar-size: 1.6rem; }
.avatar-line > :not(.avatar) { min-width: 0; overflow-wrap: anywhere; }
.record-head { display: flex; gap: .6rem; }
.record-head > .avatar { --avatar-size: 2.2rem; }
