/* web/hud/settings.css
   Settings (web/hud/settings.js), a tool on the Stage (web/hud/stage.css): topics down
   the left as tabs, each topic's options beside them as label-and-control rows, filling
   the Stage under its header, the topics and the options each scrolling on their own.
   Report's kind buttons (web/hud/report_window.css) are drawn as these choices are.
   Every size here scales from --sw-size: Settings text size, or on Automatic the panels'
   Text size. */

.sw {
  --sw-size: var(--settings-size, var(--panel-base, var(--mono-size)));
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
.sw-side {
  border-right: 1px solid var(--line); padding: 10px 6px; background: rgba(0, 0, 0, .25);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.sw-topics { display: grid; gap: 2px; min-width: 116px; }
.sw-topics button {
  text-align: left; border: 0; border-radius: 6px; background: transparent;
  padding: 6px 10px; font-size: var(--sw-size); color: var(--dim);
}
.sw-topics button[aria-selected="true"] { background: var(--cell); color: var(--stage-settings); }
.sw-topics button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sw-pane {
  padding: 12px 16px; display: grid; gap: 4px; align-content: start;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.sw-pane[hidden] { display: none; }
.sw-pane label {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 5px 4px; border-bottom: 1px solid var(--line); font-size: var(--sw-size); color: var(--dim);
}
.sw-pane select {
  background: var(--cell); color: var(--ink); max-width: 240px;
  border: 1px solid var(--cell-edge); border-radius: 6px;
  padding: 3px 6px; font-size: var(--sw-size); font-family: inherit;
}
.sw-pane select:focus { outline: none; border-color: var(--accent); }
/* A row with nothing to choose yet -- a tooltip's parts while Tooltips is Off -- greys out
   whole. */
.sw-pane label:has(> select:disabled) { opacity: .45; }
.sw-pane select:disabled { cursor: not-allowed; }
/* The game's own settings (web/hud/game_settings.js), chosen with
   buttons; the one pressed is the current choice. */
.sw-pane .sw-head { font-size: var(--sw-size); color: var(--ink); padding: 2px 4px 4px; margin: 0; }
.sw-pane .sw-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 5px 4px; border-bottom: 1px solid var(--line); font-size: var(--sw-size); color: var(--dim);
}
.sw-choices { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sw-choices button { padding: 3px 10px; font-size: var(--sw-size); }
.sw-choices button[aria-pressed="true"] {
  border-color: var(--accent); color: var(--accent); background: rgba(127, 178, 255, .14);
}
/* A row whose name has a line under it saying what it is, and Pinned emotes' search. */
.sw-pane .what { display: grid; gap: 1px; }
.sw-pane .what small { color: var(--dim); opacity: .8; font-size: calc(var(--sw-size) * .92); }
.sw-pane input[type=text] {
  background: var(--cell); color: var(--ink); border: 1px solid var(--cell-edge);
  border-radius: 6px; padding: 4px 8px; font-size: var(--sw-size); font-family: inherit;
  width: 240px; max-width: 100%;
}
.sw-pane input[type=text]:focus { outline: none; border-color: var(--accent); }
.sw-pane .sw-block {
  display: grid; gap: 6px; padding: 6px 4px 10px; border-bottom: 1px solid var(--line);
  font-size: var(--sw-size); color: var(--dim);
}
.sw-pane .sw-note.sw-refused { color: var(--warn); }
/* The Colour rows of Game window, Panels and Stages (web/swatches.js): rows of swatches,
   each a radio button with its name under it, the picked one ringed, 56 px with no
   gap beside it, wrapping where the Stage is narrow. */
.sw-pane fieldset {
  border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 5px 4px 9px; min-width: 0;
}
.sw-pane legend { float: left; width: 100%; padding: 0 0 7px; font-size: var(--sw-size); color: var(--dim); }
.sw-swatches { clear: both; display: flex; flex-wrap: wrap; gap: 6px 0; }
.sw-pane .swatch {
  position: relative; display: grid; justify-content: center; justify-items: center;
  align-content: start; gap: 5px;
  width: 56px; padding: 0; border: 0; font-size: calc(var(--sw-size) * .88); line-height: 1.2;
  text-align: center; color: var(--dim); cursor: pointer;
}
.swatch input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.swatch .chip {
  width: 40px; height: 28px; border-radius: 5px;
  border: 1px solid #3a3f4c; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.swatch:hover .chip { border-color: var(--dim); }
.swatch input:checked + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch input:focus-visible + .chip { outline: 2px dashed var(--accent); outline-offset: 2px; }
.swatch input:checked ~ .nm { color: var(--ink); }
.sw-pane .sw-note { font-size: calc(var(--sw-size) * .92); color: var(--dim); padding: 4px; margin: 0; }
.sw-pane .sw-note:empty { display: none; }
