/* Settings (UI.soundModal in js/ui.js; Gage 11-15: "organizing the settings area, adding visuals, and making it simpler").
   One sheet of groups, each a field-journal card with its picture and a ruled heading. Three kinds of control:
   sliders (a picture, the name, the level), picture pickers (.stg-pick: the picked one is the red plate) and switch tiles
   (.stg-tile: the whole tile is the switch from css/comms.css, lit red when on, with a lamp in its corner).
   Red, black and white on warm gunmetal; no decoration takes a tap; nothing here animates but the pressed states. */
.sheet-box.stg { gap: 10px; padding: 9px 12px 12px; }
/* the title and the close button stay put as one bar while the groups scroll under it (a floating X covered the controls) */
.stg > h2 { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; min-height: 52px; margin: -61px -12px 0; padding: 0 62px 0 12px; font-size: 34px;
  background: linear-gradient(130deg, #30291f, #25221d); border-bottom: 1px solid #b49b7238; box-shadow: 0 7px 10px -7px #000c; }
.stg > .sheet-x { top: 5px; }
.stg-body, .stg-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; align-content: start; }
.stg-foot { display: grid; gap: 10px; min-width: 0; }

/* ---- a group ---- */
.stg-g > *, .stg-more-body > * { min-width: 0; }
.stg-g { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; padding: 8px 10px 10px; background: linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18; border: 1px solid #b49b7238; box-shadow: 0 3px 0 #080908, inset 0 1px #eddbc012; }
.stg-h { margin: 0; display: flex; align-items: center; gap: 8px; font: 400 21px/1 var(--display); letter-spacing: .09em; text-transform: uppercase; color: #f27661; }
.stg-h .wi { box-sizing: content-box; width: 24px; height: 24px; padding: 2px; background: #0d0c0b; box-shadow: 0 0 0 1px #6b5e4c80; }
.stg-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #9f897266, #9f897200); }
/* a small centred caption between two hairlines: what the picker under it sets */
.stg-cap { display: flex; align-items: center; gap: 8px; margin-top: 2px; font: 400 13px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: #b3aaa0; }
.stg-cap::before, .stg-cap::after { content: ''; flex: 1; height: 1px; background: #9f89722e; }
.stg .stg-hint { margin: 0; font-size: 12.5px; line-height: 1.35; color: #cdbfa9; text-align: center; }
.stg-hint:empty, .stg-notes > span:empty { display: none; }
.stg-notes > span { display: block; }
.stg-notes button { display: inline-flex; margin: 6px auto 0; }

/* ---- sound: a picture, the name and the level over each slider ---- */
.stg .vol-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 0 9px; margin: 0; }
.stg .vol-row > .wi { grid-row: 1 / 3; width: 26px; height: 26px; }
.stg .vol-row .field-label { font-size: 16px; line-height: 1; letter-spacing: .05em; color: #eadbc3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg .vol-row b { font-size: 15px; line-height: 1; min-width: 40px; color: #b3aaa0; }
.stg .vol-row input.vol { grid-column: 2 / -1; height: 24px; }
.stg .nowplaying { gap: 8px; padding: 0 0 0 9px; min-height: 44px; font-size: 16px; letter-spacing: .04em; color: #cdbfa9; background: #100f0e; border: 1px solid #51463c80; }
.stg .nowplaying > .wi { width: 18px; height: 18px; }
.stg .nowplaying #np { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg .nowplaying .btn { min-height: 44px; margin: -1px; font-size: 17px; }

/* ---- picture pickers: map colours, graphics, quality ---- */
.stg-pick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.stg-pick button { position: relative; display: grid; justify-items: center; align-content: end; gap: 5px; min-width: 0; min-height: 48px; padding: 6px 5px; background: #12110f; border: 1px solid #51463c; color: #b3aaa0; transition: background-color .14s, border-color .14s, color .14s; }
.stg-pick button svg { display: block; width: 100%; height: auto; max-height: 62px; }
.stg-pick button b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 400 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
#gfxq-seg button b { font-size: 14px; letter-spacing: .02em; }
.stg-pick button.on { background: linear-gradient(150deg, #a32a2f, #58202a); border-color: #f6a48d; color: #fff; box-shadow: inset 0 1px #fa9a7955, 0 2px 0 #080908; }
.stg-pick button:active { transform: translateY(1px); }
.stg-pick button:focus-visible, .stg-tile > .sw:focus-visible { outline: 3px solid #ffd36e; outline-offset: 1px; }
/* the key under the map colours: green is an ally, red an enemy */
.stg-cap::after { order: 2; }
.stg-key { order: 3; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-style: normal; letter-spacing: .12em; color: #cdbfa9; }
.stg-key i { width: 10px; height: 10px; border: 1px solid #15120e; box-shadow: 0 0 0 1px #6b5e4c66; }
.stg-key i.ally { background: #3f8a48; }
.stg-key i.foe { background: #c2332d; margin-left: 8px; }
/* quality: one, two or three bars; Auto is the rising-bars icon (the game picks) */
.stg-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.stg-bars u { width: 7px; background: #3a342d; box-shadow: 0 0 0 1px #15120e; text-decoration: none; }
.stg-bars u:nth-child(1) { height: 8px; }
.stg-bars u:nth-child(2) { height: 14px; }
.stg-bars u:nth-child(3) { height: 20px; }
.stg-bars[data-n="1"] u:nth-child(-n+1), .stg-bars[data-n="2"] u:nth-child(-n+2), .stg-bars[data-n="3"] u { background: #eadbc3; }
.stg-pick button > .wi { width: 24px; height: 24px; }
#gfx-seg svg { width: auto; height: 40px; }

/* ---- switch tiles ---- */
.stg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stg-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stg-tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; min-width: 0; min-height: 72px; padding: 6px 4px 5px; background: #12110f; border: 1px solid #51463c; color: #b3aaa0; text-align: center; transition: background-color .14s, border-color .14s, color .14s; }
/* the picture sits on its own dark plate, so it reads the same on a lit tile and a dark one (24 px: the size the pixel art is baked at) */
.stg-tile > .wi { box-sizing: content-box; width: 24px; height: 24px; padding: 4px; background: #0d0c0b; box-shadow: 0 0 0 1px #6b5e4c80; }
.stg-tile > b { font: 400 15px/1.05 var(--display); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.stg-tiles.four .stg-tile > b { font-size: 13px; letter-spacing: 0; }
/* the switch covers its tile; its knob is the lamp in the corner */
.stg-tile > .sw, .stg-tile > .sw[aria-checked="true"] { position: absolute; inset: 0; width: auto; height: auto; background: none; border: 0; box-shadow: none; }
.stg-tile > .sw > i, .stg-tile > .sw[aria-checked="true"] > i { top: 5px; left: auto; right: 5px; width: 8px; height: 8px; transform: none; background: #2a2622; box-shadow: 0 0 0 1px #6b5e4c; }
.stg-tile:has(> .sw[aria-checked="true"]) { background: linear-gradient(150deg, #a32a2f, #58202a); border-color: #f6a48d; color: #fff; box-shadow: inset 0 1px #fa9a7955, 0 2px 0 #080908; }
.stg-tile > .sw[aria-checked="true"] > i { background: #fff4e6; box-shadow: 0 0 0 1px #15120e, 0 0 6px #ffd9c9; }
.stg-tile:has(> .sw:active) { transform: translateY(1px); }
.stg-tile:has(> .sw[aria-busy="true"]) { opacity: .7; }

/* ---- account, language, purchases: the blocks other files hand over, set flat inside their group ---- */
.stg .acct { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.stg .acct small { font-size: 12.5px; line-height: 1.3; }
.stg .acct-del { margin: 0; align-self: auto; justify-self: start; }
.stg .language-picker { margin: 0; gap: 5px; }
.stg .language-picker > .field-label { display: none; }
.stg .language-picker select { min-height: 44px; }
.stg .language-picker small { font-size: 12.5px; text-align: center; }
.stg .language-picker small:empty, html[lang="en"] .stg .language-picker small:first-of-type { display: none; } /* "Some screens still use English" only matters in another language */
.stg-g > .card { margin: 0; }

/* ---- More: the rare options, folded ---- */
.stg-more { min-width: 0; background: #171614; border: 1px solid #b49b7238; }
.stg-more > summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding-left: 10px; font: 400 21px/1 var(--display); letter-spacing: .09em; text-transform: uppercase; color: #cfc4b2; }
.stg-more > summary .wi { box-sizing: content-box; width: 24px; height: 24px; padding: 2px; background: #0d0c0b; box-shadow: 0 0 0 1px #6b5e4c80; }
.stg-more[open] > summary { border-bottom: 1px solid #9f897234; }
.stg-more-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; padding: 10px; }
.stg .sc-btns .btn { font-size: 16px; overflow: hidden; }
.stg-more-body .sound-check { margin: 0; }
.stg-privacy { display: grid; gap: 6px; }
.stg-privacy .diagnostics-choice { margin-top: 0; }
.stg-more-body > .btn, .stg-privacy > .btn { justify-self: start; }
.stg .legal-links { margin: 0; flex-wrap: wrap; align-items: center; gap: 4px 18px; }

/* ---- a desktop or a tablet on its side: three columns side by side, the whole sheet at once, Done beside the links ---- */
@media (min-width: 900px) {
  .sheet-box.stg, body.pc-wide .sheet-box.stg { max-width: 1040px; }
  .stg-body { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .stg-foot { grid-template-columns: minmax(0, 1fr) 240px; align-items: center; padding-top: 2px; }
  .stg .legal-links { justify-content: flex-start; }
}
@media (max-width: 350px) {
  .sheet-box.stg { padding: 12px 8px 10px; }
  .stg-g { padding: 8px 7px 9px; }
  .stg-tile > b, .stg-pick button b { font-size: 13.5px; letter-spacing: .02em; }
}
@media (prefers-reduced-motion: reduce) { .stg-pick button, .stg-tile { transition: none; } }
