.window {
  display: none;
  color: grey;
  flex-direction: column;
  flex: 0 1 auto;
  background-image: url("/png/bg3.png?v=cabdf9c77067");
  min-height: 0
}

.window > .body {
  display: flex;
  flex-wrap: wrap;
  padding: 8px;
  /* Matches InteractiveWindow.MINIMUM_BODY_HEIGHT */
  min-height: 50px;
  box-sizing: border-box;
  justify-content: center;
  align-items: flex-start;
  align-content: flex-start;
  /* Never scroll sideways; the vertical scrollbar is always shown (inactive while everything fits) so the content never reflows when it would appear */
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-width: thin;
}

/* Container slots (32px + 1px border): the grid stays centered, but an incomplete last row starts on the left */
.window[containerIndex] > .body {
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  /* The smallest height is exactly one row of slots (see InteractiveWindow.getMinBodyHeight) */
  min-height: 0;
}

/* Title on the left, minimize and close buttons on the right; the black left border and the bevel of --shadow-header close the bar off on the left as on the top */
.window > .header {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: move;
  padding: 0 4px 0 6px;
  background-image: var(--gradient-surface);
  border-left: 1px solid black;
  border-bottom: 1px solid black;
  box-shadow: var(--shadow-header);
}

.window > .header > button {
  flex: 0 0 auto;
}

.window > .header > button.symbol-button {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #dddddd;
  border: 1px solid black;
  border-radius: 4px;
  background-image: var(--gradient-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.window > .header > button.symbol-button:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-image: var(--gradient-surface-light);
}

.window > .header > .title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e0e0e0;
  font-weight: bold;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px black;
  pointer-events: none;
}

.window > .footer {
  height: 4px;
  cursor: ns-resize;
  background: black;
}

/* Friend list (VIP list): the name is green when online and red when offline (see FriendWindow) */
.friend-entry {
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  padding: 1px 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0 0 1px 0;
  /* Transparent until hovered: the entries keep their size */
  border: 1px solid transparent;
}

/* Hovered friend: accent border like the battle list entries (see new.css) */
.friend-entry:hover {
  border-color: var(--color-accent);
}

/* Icon chosen in Edit Friend before the name; clicks go to the entry (its menu and double-click) */
.material-icons.friend-icon {
  margin-right: 3px;
  font-size: 12px;
  vertical-align: -2px;
  pointer-events: none;
}

.friend-icon-heart { color: var(--color-friend-icon-heart); }
.friend-icon-skull { color: var(--color-friend-icon-skull); }
.friend-icon-bolt { color: var(--color-friend-icon-bolt); }
.friend-icon-target { color: var(--color-friend-icon-target); }
.friend-icon-star { color: var(--color-friend-icon-star); }
.friend-icon-money { color: var(--color-friend-icon-money); }
.friend-icon-shield { color: var(--color-friend-icon-shield); }
.friend-icon-cross { color: var(--color-friend-icon-cross); }
.friend-icon-triangle { color: var(--color-friend-icon-triangle); }
.friend-icon-moon { color: var(--color-friend-icon-moon); }

.friend-empty {
  width: 100%;
  text-align: center;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Edit Friend modal: the friend on top, its description and whether its login is announced */
#friend-edit-modal {
  width: 320px;
  max-width: 90vw;
}

.friend-edit-name {
  margin-bottom: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: bold;
  color: white;
}

.friend-edit-label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.friend-edit-icons-label {
  margin-top: 10px;
}

/* Icon choice: raised square buttons, accent border while hovered and the full accent look on the chosen one */
.friend-edit-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.friend-edit-icons > button.friend-edit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 1px solid black;
  border-radius: 5px;
  background-image: var(--gradient-surface);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
}

.friend-edit-icons > button.friend-edit-icon:hover {
  border-color: var(--color-accent);
}

.friend-edit-icons > button.friend-edit-icon.selected {
  border-color: var(--color-accent);
  background-image: var(--gradient-accent);
  box-shadow: var(--shadow-accent);
}

.friend-edit-icon .material-icons.friend-icon {
  margin: 0;
  font-size: 16px;
  vertical-align: 0;
}

.friend-edit-icon .material-icons.friend-icon-none {
  font-size: 16px;
  color: var(--color-text-dim);
}

.friend-edit-notify {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  cursor: pointer;
}

#skill-window .body {
  display: block;
}

/* World Map window (see MapWindow and WorldMap): the square map fills the width of the window, the crosshair marks its
   center and the zoom buttons are the ones of the World Map modal (.map-modal-zoom, modal.css) */
#map-window > .body {
  display: block;
  padding: 0;
  overflow: hidden;
}

#map-window .world-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
}

#map-window .world-map canvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: black;
  image-rendering: pixelated;
  touch-action: none;
}

#map-window .world-map .vline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-bottom: 1px solid white;
  pointer-events: none;
}

#map-window .world-map .hline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-right: 1px solid white;
  pointer-events: none;
}

#map-window .world-map-position {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  color: white;
  text-shadow: 1px 1px 1px black;
  pointer-events: none;
}

/* The Stats window keeps the height it gets when opened or resized (see SkillWindow.open) */
#skill-window {
  flex-shrink: 0;
}

/* Window filters (battle list, stats): funnel button on the left of the header and the panel it opens (colors from theme.css) */
#battle-window,
#skill-window {
  position: relative;
}

.window > .header > button.window-filter-button svg,
.window > .header > button.window-sort-button svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  /* Clicks must land on the button: its action attribute is read from the event target */
  pointer-events: none;
}

/* Some category is hidden, or the battle list is not in the order of appearance */
.window > .header > button.window-filter-button.filtered,
.window > .header > button.window-sort-button.sorted {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* The panel is open */
.window > .header > button.window-filter-button.selected,
.window > .header > button.window-sort-button.selected {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-image: var(--gradient-surface-light);
  box-shadow: 0 0 4px var(--color-accent-glow);
}

/* The battle list sort panel (see BattleWindow) has the same look as the filter panels */
.window-filter-panel,
.window-sort-panel {
  display: none;
  position: absolute;
  /* Right below the header (24px + its border) */
  top: 25px;
  left: 4px;
  z-index: 100;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
  padding: 4px;
  background-image: url("/png/bg2.png?v=5b440427c14f");
  border: 1px solid black;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  cursor: auto;
}

.window-filter-panel.open,
.window-sort-panel.open {
  display: flex;
}

.window-filter-title {
  margin-bottom: 2px;
  padding: 1px 4px 3px;
  color: #e0e0e0;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Title of a later section (e.g., PVP) */
.window-filter-option + .window-filter-title,
.window-filter-grid + .window-filter-title {
  margin-top: 4px;
}

/* Options in two columns: keeps a long list (e.g., the stats) short enough for the side panel */
.window-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}

/* Row of buttons at the bottom of the panel: extra actions on the left (e.g., Show all), Ok on the right */
.window-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.window-filter-actions > button {
  margin: 0;
  padding: 1px 8px;
  color: #dddddd;
  font: inherit;
  border: 1px solid black;
  border-radius: 4px;
  background-image: var(--gradient-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

/* Ok closes the panel: it carries the accent border */
.window-filter-actions > button[action="confirm"] {
  min-width: 44px;
  border-color: var(--color-accent);
}

.window-filter-actions > button:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-image: var(--gradient-surface-light);
}

/* The Stats filter spans the window: its options are in two columns */
#skill-window > .window-filter-panel {
  right: 4px;
}

.window-filter-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 4px;
  color: white;
  white-space: nowrap;
  cursor: pointer;
}

.window-filter-option:hover {
  background-color: rgba(0, 0, 0, 0.35);
}

/* Checked in the accent color like every check box (see controls.css) */
.window-filter-option > input {
  margin: 0;
  cursor: pointer;
}

/* Long names in the two column grid are cut instead of widening the panel */
.window-filter-grid > .window-filter-option > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skull filters while the Players category is hidden */
.window-filter-option.disabled {
  opacity: 0.45;
  cursor: default;
}

.window-filter-option.disabled:hover {
  background-color: transparent;
}

.window-filter-option.disabled > input {
  cursor: default;
}