/* Split panels keep the close button fixed while their labelled regions scroll separately. */
#game .panels > details > .panel.panel-sections {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 16px));
  height: min(560px, calc(100dvh - 16px));
  max-height: calc(100dvh - 16px);
  padding: 12px;
  overflow: hidden;
}

#game .panel-sections > h2 {
  flex: none;
  min-height: 38px;
  margin: 0 44px 8px 0;
  align-content: center;
}

#game .panels > details > .panel.panel-sections > .panel-nav-close {
  position: absolute;
  top: 12px;
  right: 12px;
  float: none;
  margin: 0;
  z-index: 2;
}

#game .panel-sections > .panel-pane {
  flex: 1 1 0;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 4px 8px;
  border-top: 1px solid #446066;
}

#game .panel-sections > .panel-pane:focus-visible {
  outline: 2px solid #ffd38d;
  outline-offset: -2px;
}

#game #staff .panel-sections:has(> #adminSettings[hidden]) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#game #staff #adminSettings[hidden] + .panel-pane {
  grid-row: 2;
}

#staffNotice {
  margin: 4px 0 0;
}
#staffNotice:empty {
  margin: 0;
}

#game #destinations .panel-pane-settings {
  flex: 0 1 30%;
  min-height: 48px;
}

#game #destinations .panel-pane-places {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#game #destinations .panel-pane-places label {
  flex: none;
  margin: 0 0 8px;
}

#game #destinations #placeFilter {
  width: 100%;
}

#game #destinations #places {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#game #destinations #places:focus-visible {
  outline: 2px solid #ffd38d;
  outline-offset: -2px;
}

#game .panel-sections > .panel-pane-settings.settings-section,
#game .panel-sections > .panel-pane-settings .subsection {
  margin-top: 0;
  padding-top: 4px;
  border-top: 0;
}

#game .panel-sections .panel-pane input:not([type="checkbox"]),
#game .panel-sections .panel-pane select {
  max-width: 100%;
}

#game .panel-sections .panel-pane button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-height: 360px) {
  #game .panels > details > .panel.panel-sections {
    padding: 8px;
  }
  #game .panel-sections > h2 {
    min-height: 38px;
    margin-bottom: 2px;
  }
  #game .panels > details > .panel.panel-sections > .panel-nav-close {
    top: 8px;
    right: 8px;
  }
}
