/* User appearance preferences: default light, dark, and user-selectable accents. */
:root{color-scheme:light;--theme-accent:#d3a444;--theme-on-accent:#14213b;--theme-bg:#fff;--theme-surface:#fff;--theme-surface-alt:#fffdf5;--theme-text:#14213b;--theme-muted:#43536d;--theme-border:#e8e2d3}
:root[data-theme-mode="dark"]{color-scheme:dark;--theme-bg:#091425;--theme-surface:#122238;--theme-surface-alt:#192c45;--theme-text:#f4f7ff;--theme-muted:#c6d4e8;--theme-border:#455975}
body{background:var(--theme-bg);color:var(--theme-text)}
nav .logo,h1 span,.eyebrow,#game-count,.search-label,#reset-games,#games .game-category-heading h3{color:var(--theme-accent)}
nav .links a:hover,footer a:hover{color:var(--theme-accent)}
.button,.filter-chip[aria-pressed="true"],.skip-link{background:var(--theme-accent);color:var(--theme-on-accent);border-color:var(--theme-accent)}
.button:hover{filter:brightness(.94);background:var(--theme-accent)}
.card,#games .card,#games .game-category,.library-tools,#game-search,#no-games-found{background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
#games .card{background:var(--theme-surface)}
#games .game-category{background:var(--theme-surface-alt)}
.card h3,#games h2,.card p,#games .game-category .card p,#games .game-category-heading p,.library-summary p,.hero p,#about,#about p,#premium-heading + p,.tag,small,footer{color:var(--theme-text)}
.hero p,.card p,#games .game-category .card p,.tag,small,footer,#about{color:var(--theme-muted)}
.filter-chip,#games .game-category-count{background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
#game-search{color:var(--theme-text);border-color:var(--theme-accent)}
#games h2::after{background:var(--theme-accent)}
.card:hover{border-color:var(--theme-accent)}
footer{border-color:var(--theme-border)}
.theme-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.theme-icon-button,.theme-preferences-button{border:1px solid var(--theme-border);border-radius:10px;background:var(--theme-surface);color:var(--theme-text);font:700 .9rem system-ui;padding:10px 12px;cursor:pointer;min-height:44px}
.theme-icon-button{font-size:1.3rem;min-width:44px}
.theme-panel{position:fixed;z-index:10000;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center;padding:18px}
.theme-panel[hidden]{display:none}
.theme-dialog{width:min(100%,460px);max-height:90vh;overflow:auto;background:var(--theme-surface);color:var(--theme-text);border:1px solid var(--theme-border);border-radius:18px;padding:24px;box-shadow:0 24px 60px #0005}
.theme-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.theme-dialog h2{margin:0;font-size:1.5rem}
.theme-dialog fieldset{border:1px solid var(--theme-border);border-radius:12px;margin:20px 0;padding:14px}
.theme-dialog legend{font-weight:700;padding:0 6px}
.theme-mode-options{display:flex;flex-wrap:wrap;gap:14px}
.theme-mode-options label{display:flex;align-items:center;gap:6px;cursor:pointer}
.theme-swatches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.theme-swatch{min-height:62px;border:2px solid var(--theme-border);border-radius:12px;background:var(--theme-surface-alt);color:var(--theme-text);cursor:pointer;font-weight:700;font-size:.78rem}
.theme-swatch[aria-pressed="true"]{border-color:var(--theme-text);outline:2px solid var(--theme-accent);outline-offset:2px}
.theme-swatch-dot{display:block;width:22px;height:22px;border-radius:50%;margin:0 auto 6px;border:1px solid #0002}
.theme-custom-color{display:flex;align-items:center;gap:12px;margin-top:16px}
.theme-custom-color input{width:52px;height:44px;cursor:pointer}
.theme-dialog button:focus-visible,.theme-dialog input:focus-visible,.theme-icon-button:focus-visible,.theme-preferences-button:focus-visible{outline:3px solid #5d9df4;outline-offset:3px}
@media(max-width:600px){.theme-controls{width:100%;justify-content:flex-end}.theme-dialog{padding:18px}}

/* Unified homepage palette: diamond-white and soft-gold by default. */
:root[data-theme-mode="dark"]{--theme-bg:#091425;--theme-surface:#122238;--theme-surface-alt:#192c45;--theme-text:#f4f7ff;--theme-muted:#c6d4e8;--theme-border:#455975}
body{background:var(--theme-bg);color:var(--theme-text)}
header{background:var(--theme-bg)}
.bpa-home-nav .links a{color:var(--theme-text)}
.bpa-home-nav .links a:hover{color:var(--theme-accent)}
#games .game-category .card{background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text)}
#games .game-category .card p{color:var(--theme-muted)}
#games .game-category-heading p{color:var(--theme-muted)}
#games .game-category-heading h3{color:var(--theme-text)}
#games .game-category-count{background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
#games .library-tools{background:var(--theme-surface-alt);border-color:var(--theme-border)}
#games .filter-chip{background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
#games .filter-chip[aria-pressed="true"]{background:var(--theme-accent);color:var(--theme-on-accent);border-color:var(--theme-accent)}
#games .library-summary p,#games .library-intro{color:var(--theme-muted)}
#games .game-category{background:var(--theme-surface-alt);border-color:var(--theme-border)}
#games .card:hover{box-shadow:0 8px 24px rgba(20,33,59,.10)}
:root[data-theme-mode="dark"] #games .card:hover{box-shadow:0 8px 24px rgba(0,0,0,.3)}
#game-search:focus-visible{outline:3px solid var(--theme-accent);outline-offset:2px}
.theme-dialog p{color:var(--theme-muted)}
.theme-icon-button:hover,.theme-preferences-button:hover{border-color:var(--theme-accent)}
