.contextmenu {
  position: absolute;
  width: 80px;
  padding: 2px;
}

/* An entry that opens a new group of entries carries the line that divides them */
.contextmenu button.group {
  border-top: 1px solid rgba(0, 0, 0, 0.5);
}

/* The menu of the game screen names people in its entries, so it needs the room */
#screen-menu {
  width: 130px;
}

#screen-menu button {
  text-align: left;
  padding-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contextmenu > .menu-header {
  background-image: url("../png/bg2.png");
  cursor: auto;
  text-align: center;
  padding: 2px;
}

.contextmenu button {
  width: 100%;
  padding: 2px;
  border: 0px;
  border-radius: 0px;
  margin: 0px;
}

/* The sorting menu of the battle window is wider than a plain context menu and marks
   the option the list is currently ordered by. */
#battle-menu {
  width: 200px;
}

#battle-menu button {
  text-align: left;
  padding-left: 16px;
  position: relative;
}

#battle-menu button.checked::before {
  content: "\2713";
  position: absolute;
  left: 4px;
}

/* Desktop context menus share the BG surface and frame defined in moldura.css. */
body:not(.mobile-layout) .contextmenu {
  background-image: url('../png/bg.png');
  color: white;
}

body:not(.mobile-layout) .contextmenu > .menu-header {
  background-image: url('../png/bg2.png');
  color: white;
  box-shadow: inset 0 -1px #292c27;
}

body:not(.mobile-layout) .contextmenu > button {
  box-sizing: border-box;
  min-height: 20px;
  color: white;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
}

body:not(.mobile-layout) .contextmenu > button.group,
body:not(.mobile-layout) #battle-menu > button:nth-of-type(2n+3) {
  margin-top: 3px;
  border-top: 1px solid #777a72;
  box-shadow: 0 -1px #292c27;
}

body:not(.mobile-layout) .contextmenu > button:hover,
body:not(.mobile-layout) .contextmenu > button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

#friend-list-menu, #friend-window-menu { width: 150px; }
#friend-list-menu > button, #friend-window-menu > button { text-align: left; padding-left: 6px; }
.friend-icon-picker:not([hidden]) { display: grid; grid-template-columns: repeat(6, 22px); gap: 1px; padding: 3px 0; }
.friend-icon-picker > button { display: grid; place-items: center; width: 22px; height: 22px; margin: 0; padding: 0; background: transparent; }
.friend-icon-picker > button:hover { background: rgba(255, 255, 255, 0.18); }
.friend-icon { display: inline-block; flex: 0 0 12px; width: 12px; height: 12px; background: url('../png/viplist/icons.png') no-repeat; image-rendering: pixelated; }
#friend-window .friend-entry { display: flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; }
#friend-window .body.tibia-scroll-content { display: block; text-align: left; }
#friend-window .friend-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
