.game > .game-tools {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: 44px;
  padding-inline: 8px;
}

.game-tools > button,
#window-help-close {
  box-sizing: border-box;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #c7ded4;
  border-radius: 8px;
  color: #174637;
  background: #edf8f1;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.game-tools > button:hover,
#window-help-close:hover {
  background: #dff2e8;
}

.game-tools > button:focus-visible,
#window-sound-panel :focus-visible,
#window-help-panel :focus-visible {
  outline: 2px solid #17694b;
  outline-offset: -3px;
}

#window-sound-panel,
#window-help-panel {
  position: absolute;
  z-index: 3;
  inset-block-start: 100%;
  inset-inline-end: 8px;
  box-sizing: border-box;
  overflow: auto;
  padding: 6px 12px;
  border: 1px solid #c7ded4;
  border-radius: 10px;
  background: #fcfefd;
  box-shadow: 0 8px 20px #173d3030;
}

#window-sound-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  width: min(250px, calc(100% - 16px));
}

#window-help-panel {
  width: min(430px, calc(100% - 16px));
  max-height: min(18rem, 50vh);
  max-height: min(18rem, 50dvh);
  font-size: .875rem;
}

.game.window-expanded #window-help-panel,
.game:fullscreen #window-help-panel {
  max-height: calc(100vh - 52px);
  max-height: calc(100dvh - 52px);
}

#window-help-panel h2 {
  margin: 4px 0;
  font-size: 1rem;
}

#window-help-panel ol {
  margin: 4px 0 8px;
  padding-inline-start: 1.5em;
}

#window-sound-panel[hidden],
#window-help-panel[hidden] {
  display: none;
}

#window-volume {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  accent-color: #17694b;
}

#window-sound-panel label:last-child {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

#window-mute {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: #17694b;
}

body.window-game-expanded {
  overflow: hidden;
}

.game.window-expanded {
  position: fixed;
  z-index: 1000;
  inset: 0;
}

.game.window-expanded:not([hidden]),
.game:fullscreen:not([hidden]) {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
}

.game.window-expanded > .view,
.game:fullscreen > .view {
  box-sizing: border-box;
  max-width: 1080px;
  margin-inline: auto;
}

.game.window-expanded > .game-tools,
.game:fullscreen > .game-tools {
  position: sticky;
  inset-block-start: 0;
  background: #fcfefd;
}
