/* Recolour only the existing page texture and the ground beneath it. */
body{background:var(--page-ground,var(--bg))}
body::before{filter:var(--page-tint,none)}
html[data-background-theme="blue"]{--page-ground:#101c26;--page-tint:hue-rotate(200deg) saturate(1.1) brightness(1.2)}
html[data-background-theme="green"]{--page-ground:#0f170e;--page-tint:hue-rotate(75deg) saturate(.75)}
html[data-background-theme="red"]{--page-ground:#250c11;--page-tint:hue-rotate(330deg) saturate(1.7)}
html[data-background-theme="purple"]{--page-ground:#1c0d23;--page-tint:hue-rotate(270deg) saturate(1.55)}
html[data-background-theme="grey"]{--page-ground:#0b0b0b;--page-tint:grayscale(1) brightness(.6)}
.backgroundChoices{display:flex;gap:4px}
.backgroundChoices button{display:grid;place-items:center;width:24px;min-width:24px;height:24px;min-height:24px;padding:0;border:2px solid #645b50;border-radius:0;background:var(--swatch);box-shadow:inset 1px 1px #ffffff0b;color:#d8cebc;cursor:pointer}
.backgroundChoices button::after{content:'';width:8px;height:8px;border:2px solid transparent}
.backgroundChoices button[aria-pressed="true"]{border-color:#c1b29a;outline:1px solid #1b1712;outline-offset:1px}
.backgroundChoices button[aria-pressed="true"]::after{border-color:#d8cebc;background:#181613}
.backgroundChoices button:hover{border-color:#a79a85}
.backgroundChoices button:focus-visible{outline:2px solid #e3d6bf;outline-offset:3px}
.backgroundChoices [data-background-choice="brown"]{--swatch:#433327}
.backgroundChoices [data-background-choice="blue"]{--swatch:#35576e}
.backgroundChoices [data-background-choice="green"]{--swatch:#2c4227}
.backgroundChoices [data-background-choice="red"]{--swatch:#592430}
.backgroundChoices [data-background-choice="purple"]{--swatch:#482456}
.backgroundChoices [data-background-choice="grey"]{--swatch:#202020}

/* Theme stays separate from account controls. Desktop shows all swatches. */
.siteToolbar .backgroundPicker{grid-column:2;grid-row:1;justify-self:end;display:flex;align-items:center;gap:0;width:fit-content;max-width:100%;padding:3px 5px;border:1px solid #493f34;background:#181613}
.siteToolbar .backgroundPickerLabel{border:0;background:transparent;color:#b6ab9b;font-size:13px;line-height:1.2;min-height:24px;padding:3px 6px;cursor:pointer}
.siteToolbar .backgroundPickerLabel:disabled{opacity:1;cursor:default}
.siteToolbar .themeChoicesClip{max-width:218px;overflow:hidden;visibility:visible;transition:max-width .18s ease,visibility .18s}
.siteToolbar .backgroundChoices{display:flex;gap:4px;width:max-content;padding:2px 2px 2px 7px}
.siteToolbar .backgroundChoices button{width:26px;min-width:26px;height:26px;min-height:26px}
.top,body.hasMobileHud .top{padding-top:0}
@media(max-width:760px),(max-width:1100px) and (max-height:600px) and (orientation:landscape){
 .siteToolbar .backgroundPicker{position:absolute;top:max(6px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));z-index:16}
 .siteToolbar .themeChoicesClip{position:absolute;top:calc(100% + 4px);right:0;max-width:0;visibility:hidden}
 .siteToolbar .backgroundPicker.expanded .themeChoicesClip{max-width:98px;visibility:visible}
 .siteToolbar .backgroundChoices{display:grid;grid-template-columns:repeat(3,24px);gap:3px;padding:5px;border:1px solid #493f34;background:#181613}
 .siteToolbar .backgroundChoices button{width:24px;min-width:24px;height:24px;min-height:24px}
 body:has(.backgroundPicker.expanded),body.hasMobileHud:has(.backgroundPicker.expanded){padding-top:max(var(--account-header-space,126px),calc(142px + env(safe-area-inset-top)))}
}
@media(max-width:359px){.siteToolbar .backgroundChoices{grid-template-columns:repeat(2,24px)}}
@media(prefers-reduced-motion:reduce){.siteToolbar .themeChoicesClip{transition:none}}
