.intro[hidden] {
  display: none !important;
}
.game-settings[hidden] {
  display: none;
}
.game-settings {
  position: absolute;
  top: 76px;
  right: 28px;
  z-index: 35;
  width: 365px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 94px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #d5dfd0;
  border-radius: 20px;
  background: #fffef7f5;
  box-shadow: 0 16px 48px #294b342b;
  font:
    13px/1.6 'Malgun Gothic',
    sans-serif;
  color: #426953;
}
.game-settings header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.game-settings h2 {
  font-size: 17px;
  margin: 0;
}
.game-settings h3 {
  font-size: 12px;
  margin: 18px 0 8px;
  color: #769080;
}
.game-settings header button {
  border: 0;
  background: transparent;
  color: #608473;
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
}
.game-settings .tools,
.game-settings .theme-controls {
  position: static;
  inset: auto;
  transform: none;
  width: auto;
  max-width: 100%;
  margin: 0;
}
.game-settings .tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.game-settings .tools button,
.game-settings .tools a {
  margin: 0;
  min-width: 0;
  padding: 9px 6px;
  text-align: center;
  font-size: 11px;
  white-space: nowrap;
}
.game-settings .theme-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  padding: 4px;
  background: #edf3e8;
  border: 0;
  backdrop-filter: none;
}
.game-settings .settings-help {
  border-top: 1px solid #dae3d4;
  margin: 18px 0 0;
  padding-top: 12px;
  color: #789082;
  font-size: 11px;
}
#help[aria-expanded='true'] {
  background: #4d8b76;
  color: white;
}
@media (max-width: 700px) {
  .game-settings {
    top: 68px;
    right: 12px;
    padding: 16px;
  }
}

.game-settings #render-quality {
  width: 100%;
  border: 1px solid #b9cdb5;
  border-radius: 10px;
  background: #f7faef;
  padding: 9px 12px;
  color: #426953;
  font: inherit;
}
#render-quality-description {
  margin: 8px 0 0;
  font-size: 11px;
  color: #789082;
  line-height: 1.7;
}
html[data-render-quality='light'] * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Keep settings reachable on a narrow screen, above the main dice action. */
@media (max-width: 700px) {
  .topbar {
    display: flex;
    position: fixed;
    top: auto;
    bottom: calc(166px + env(safe-area-inset-bottom));
    left: auto;
    right: 16px;
    width: auto;
    height: auto;
    padding: 0;
    gap: 8px;
    z-index: 36;
  }
  .topbar .brand,
  .topbar .header-meta {
    display: none;
  }
  .game-settings {
    top: auto;
    bottom: calc(210px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 230px);
  }
}

.game-settings .tools button span { display: inline; }
