/* Three shared palettes. Legacy IDs main/store keep existing saved preferences working. */
html[data-site-theme]{color-scheme:dark;--muted:var(--theme-muted);--bg:var(--theme-base);--bg-card:var(--theme-panel);--bg-card-hover:var(--theme-raised);--bg-elevated:var(--theme-raised);--surface:var(--theme-panel);--surface-2:var(--theme-control);--surface-3:var(--theme-raised);--border:var(--theme-edge);--line:var(--theme-edge);--theme-shadow:0 18px 60px #0004;}
html[data-site-theme=main]{--theme-base:#020617;--theme-panel:#0f1c33;--theme-panel-end:#071226;--theme-raised:#1a3151;--theme-control:#142a49;--theme-accent:#99cbff;--theme-edge:#6d9bdc30;--theme-muted:#9caec9;--theme-glow:#1d4ed82b;--brand:#3b82f6;--brand-hover:#60a5fa;--brand-strong:#2563eb;--accent:#818cf8;}
html[data-site-theme=store]{--theme-base:#030509;--theme-panel:#0b1320;--theme-panel-end:#050a12;--theme-raised:#14243a;--theme-control:#101c2d;--theme-accent:#a7cbe9;--theme-edge:#7898ba27;--theme-muted:#9baaba;--theme-glow:#24497424;}
html[data-site-theme=light]{color-scheme:light;--theme-base:#f3f6fb;--theme-panel:#ffffff;--theme-panel-end:#f5f8fd;--theme-raised:#e7eef9;--theme-control:#edf3fc;--theme-accent:#2158a5;--theme-edge:#cbd7e8;--theme-muted:#52647e;--theme-glow:#afcfff55;--theme-danger:#b42338;--theme-success:#087954;--text:#182b46;--text-secondary:#52647e;--brand:#2563eb;--brand-hover:#1d4ed8;--brand-strong:#1e40af;--accent:#4f46e5;--muted:#52647e;--border-hover:#729ad1;--theme-shadow:0 18px 60px #25497518;}
/* Extend shared surfaces to product, auth, top-up and decoration-store pages. */
html[data-site-theme] body :is(.auth-card,.auth-form input,.auth-tabs,.point-topup-card,.point-topup-balance-card,.point-topup-rules,.point-topup-live-preview,.point-topup-input,.point-topup-method,.qr-dialog-shell,.product-detail-card,.product-info,.product-detail-info,.product-summary,.product-detail-panel,.atelier-panel,.atelier-card,.atelier-dialog,.atelier-header,.atelier-toolbar,.atelier-wallet,.atelier-sidebar,.atelier-tabs,.free-game-card,.free-upcoming-card,.public-profile-card,.site-global-search-results,.site-mobile-drawer,.olaf-mobile-search-shell){background:var(--theme-card)!important;border-color:var(--theme-edge)!important;color:var(--text);}
html[data-site-theme] body :is(.olaf-steam-spotlight-info,.olaf-steam-deal-info,.product-hover-preview,.product-hover-body,.member-game-grid a,.home-free-games,.stats-strip article){background:var(--theme-card)!important;border-color:var(--theme-edge)!important;}
html[data-site-theme] body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]),textarea,select){color:var(--text);caret-color:var(--theme-accent);border-color:var(--theme-edge);}
html[data-site-theme=light] body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]),textarea,select){background:var(--theme-panel)!important;color:var(--text)!important;}
html[data-site-theme=light] body :is(h1,h2,h3,h4,h5,h6,label,legend,th,td){color:var(--text)!important;}
html[data-site-theme=light] body :is(.main-nav a,.brand strong,.profile-nav-item,.profile-sidebar-user strong,.member-stats strong,.member-game-grid,.member-private,.rank-progress p,.rank-rules,.profile-order-row,.profile-orders-card,.profile-coupon-card,.profile-points-card,.inventory-card,.user-popover,.notification-popover,.notification-panel,.favorites-dialog,.cart-dialog,.auth-card,.auth-intro,.point-topup-shell,.product-detail-page main,.free-games-page main,.free-random-page main,#avatar-shop-root,.public-profile-page main){color:var(--text)!important;}
html[data-site-theme=light] body :is(.olaf-steam-spotlight-info,.olaf-steam-deal-info,.product-card,.game-card,.catalog-toolbar,.profile-sidebar-card,.profile-orders-card,.member-stats,.member-game-grid,.friends-dialog,.member-friends-page,.auth-card,.atelier-panel,.atelier-card,.product-detail-info,.product-summary,.notification-item,.favorite-list-item) :is(strong,p,small,span,a){color:var(--text);}
html[data-site-theme=light] body :is(.olaf-steam-description,.olaf-steam-kicker,.olaf-steam-section-head p,.product-hover-body,.product-hover-body p,.home-free-game-info small,.auth-card-header p,.auth-switch,.profile-sidebar-email,.member-private,.rank-display-status,.site-footer,.profile-store-nav a,.profile-bio-status){color:var(--theme-muted)!important;}
html[data-site-theme=light] body :is(.olaf-steam-tags a,.product-hover-tags span,.filter-chip,.atelier-tabs button,.atelier-toolbar button,.point-topup-presets button,.google-oauth-btn,.auth-tabs a,.profile-order-pagination button){background:var(--theme-control)!important;color:var(--theme-accent)!important;border-color:var(--theme-edge)!important;}
html[data-site-theme=light] body :is(.olaf-steam-price,.olaf-steam-price-box,.olaf-steam-price-group,.olaf-steam-activity-price){background:var(--theme-control)!important;color:var(--text)!important;}
html[data-site-theme=light] body :is(.olaf-steam-price,.olaf-steam-price-box,.olaf-steam-price-group,.olaf-steam-activity-price) :is(strong,del){color:var(--text)!important;}
/* Artwork overlays remain dark with light lettering; never recolor the actual images. */
html[data-site-theme=light] body #profile-overview-root .member-cover::after{background:linear-gradient(180deg,#02061712 10%,#020617c9)!important;}
html[data-site-theme=light] body :is(.member-cover,.user-profile-card,.hero,.olaf-steam-collection-card,.olaf-steam-theme-card,.olaf-steam-taste-media,.decoration-preview) :is(h1,h2,h3,p,strong,small,span,a,label){color:#f0f6ff!important;}
html[data-site-theme=light] body .member-cover .site-theme-trigger :is(strong,small){color:var(--theme-accent)!important;}
html[data-site-theme=light] body .member-cover .member-bio textarea{color:#f0f6ff!important;background:transparent!important;}
html[data-site-theme=light] body :is(.primary-button,.profile-save-button,.auth-submit,.free-game-claim,.home-free-games-all-link,.olaf-steam-activity-label){color:#fff!important;}
html[data-site-theme=light] body #olaf-steam-storefront .olaf-steam-arrow{color:var(--theme-accent);}
html[data-site-theme=light] body :is(.friend-online,.is-online,.olaf-steam-stock.in-stock){color:var(--theme-success)!important;}
html[data-site-theme=light] body .friends-surface [data-action=remove]{color:var(--theme-danger)!important;}
/* Shared palette trigger: compact in navigation, labeled on the profile. */
html[data-site-theme] body :is(.avatar-atelier,.atelier-preview,.atelier-history,.auth-feature,.pd-section,.pd-sidebar-card,.pd-sidebar-body,.pd-info-card,.pd-arrow-accordion,.pd-package-option,.tag-results-dialog,.pd-steam-related-card,.premium-product-card,.premium-points-card,.premium-summary-card){background:var(--theme-card)!important;border-color:var(--theme-edge)!important;color:var(--text);}
html[data-site-theme=light] body :is(.pd-description,.pd-info-row,.pd-sidebar-publisher,.pd-price-label,.pd-price-main,.pd-feature-text,.pd-package-copy,.pd-arrow-summary-title,.atelier-heading p,.atelier-preview p,.atelier-wallet strong,.atelier-wallet small,.atelier-status,.atelier-empty,.atelier-history,.atelier-dialog p,.atelier-portrait,.atelier-portrait small,.hover-preview-publisher,.hover-preview-description,.hover-preview-hint,.hover-preview-body>small){color:var(--text)!important;}
html[data-site-theme=light] body :is(.pd-genre-tag,.pd-platform-link,.pd-lang-chip,.atelier-cancel,.hover-preview-tags span){background:var(--theme-control)!important;color:var(--theme-accent)!important;border-color:var(--theme-edge)!important;}
html[data-site-theme=light] body .auth-intro h1{-webkit-text-fill-color:var(--text);background:none;}
html[data-site-theme=light] body .pd-bg-backdrop{opacity:.08;}
html[data-site-theme=light] body .product-hover-preview.is-loading .hover-preview-body :is(h3,p:not(.hover-preview-hint),.hover-preview-tags,footer){color:transparent!important;background:linear-gradient(100deg,#e1e9f4 4%,#f9fbff 25%,#e1e9f4 36%);background-size:1000px 100%;}
html[data-site-theme=light] body .atelier-status.is-error{color:var(--theme-danger)!important;}
html body .site-theme-switcher{display:inline-flex;flex:0 0 auto;align-items:center;}
html body .site-theme-trigger{font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:44px;padding:10px 14px;border:1px solid var(--theme-edge)!important;border-radius:14px!important;background:var(--theme-button)!important;color:var(--theme-accent)!important;box-shadow:inset 0 1px #ffffff0b;cursor:pointer;transition:transform .18s,border-color .18s,box-shadow .18s;}
html body .site-theme-trigger:hover{transform:translateY(-2px);border-color:var(--theme-accent)!important;box-shadow:0 5px 20px #336dba20;}
.site-theme-trigger svg{width:21px;height:21px;flex:none;}
.site-theme-trigger-copy{display:grid;text-align:left;gap:2px;line-height:1.3;}.site-theme-trigger-copy small{font-size:9px;color:var(--theme-muted);}.site-theme-trigger-copy strong{font-size:12px;font-weight:500;}
.site-theme-mini-swatches{display:flex;padding-left:5px;}.site-theme-mini-swatches i{width:13px;height:13px;border:1px solid #ffffff66;border-radius:50%;margin-left:-4px;background:#07111e;}.site-theme-mini-swatches i:nth-child(2){background:#21457e;}.site-theme-mini-swatches i:nth-child(3){background:#f5f8ff;border-color:#92a9c7;}
html body .site-theme-switcher .site-theme-trigger{width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;border-radius:9px!important;}
.site-theme-switcher :is(.site-theme-trigger-copy,.site-theme-mini-swatches){display:none;}
html body .site-theme-profile-control{padding:0!important;border:0!important;background:none!important;box-shadow:none!important;}
.site-theme-profile-control>[role=status]:empty{display:none;}.site-theme-profile-control select[hidden]{display:none!important;}
.site-theme-switcher.is-standalone{position:fixed;top:16px;right:16px;z-index:80;}
/* Native modal is outside clipping/stacking contexts and supports Escape/focus trapping. */
html body .site-theme-dialog{box-sizing:border-box;width:min(620px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:28px;border:1px solid var(--theme-edge);border-radius:24px;background:var(--theme-card)!important;color:var(--text);box-shadow:var(--theme-shadow);font-family:Kanit,sans-serif;overflow:auto;}
.site-theme-dialog[open]{animation:theme-picker-in .2s ease-out;}.site-theme-dialog::backdrop{background:#0309178c;backdrop-filter:blur(7px);}
.site-theme-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:24px;}.site-theme-eyebrow{color:var(--theme-accent);font-size:10px;font-weight:600;letter-spacing:.18em;}.site-theme-dialog h2{margin:6px 0;font-size:24px;line-height:1.35;color:var(--text);font-weight:600;}.site-theme-dialog header p{margin:0;color:var(--theme-muted);font-size:12px;}
.site-theme-dialog [data-theme-close]{width:34px;height:34px;border:1px solid var(--theme-edge);border-radius:10px;background:var(--theme-control);color:var(--theme-accent);font-size:23px;cursor:pointer;flex:none;}
.site-theme-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
html body .site-theme-choice{display:flex;flex-direction:column;gap:5px;min-width:0;text-align:left;font:inherit;padding:9px 9px 14px;background:var(--theme-panel)!important;border:1px solid var(--theme-edge);border-radius:16px;color:var(--text);cursor:pointer;transition:transform .2s,border-color .2s,box-shadow .2s;}
html body .site-theme-choice:hover{transform:translateY(-3px);border-color:var(--theme-accent);}.site-theme-choice[aria-pressed=true]{border-color:var(--theme-accent);box-shadow:0 0 0 2px var(--theme-accent);}
.site-theme-choice>small{margin:8px 4px 0;letter-spacing:.08em;font-size:8px;color:var(--theme-muted);}.site-theme-choice>strong{margin:0 4px;font-size:13px;font-weight:500;}.site-theme-choice-description{margin:0 4px;color:var(--theme-muted);font-size:10px;line-height:1.6;}
.site-theme-preview{position:relative;display:grid;grid-template-columns:repeat(3,1fr);gap:5px;width:100%;height:108px;padding:9px;border-radius:10px;box-sizing:border-box;background:var(--preview-bg);border:1px solid #6686a42b;--preview-bg:#050a12;--preview-card:#142238;--preview-bar:#325278;}
.site-theme-preview[data-palette=main]{--preview-bg:#071630;--preview-card:#17375f;--preview-bar:#528cf0;}.site-theme-preview[data-palette=light]{--preview-bg:#f4f7fd;--preview-card:#e1eaf8;--preview-bar:#528cf0;}
.site-theme-preview i{background:var(--preview-card);border-radius:3px;}.theme-preview-nav{grid-column:1/-1;height:8px;border-left:18px solid var(--preview-bar);}.theme-preview-hero{grid-column:1/-1;height:40px;background:linear-gradient(125deg,var(--preview-bar),var(--preview-card))!important;}.theme-preview-tile{height:24px;}.site-theme-preview b{position:absolute;right:5px;bottom:5px;background:#2563eb;color:#fff;border:2px solid #fff;border-radius:50%;width:22px;height:22px;display:none;place-items:center;font-size:12px;}.site-theme-choice[aria-pressed=true] .site-theme-preview b{display:grid;}
.site-theme-save-note{margin:22px 0 0;padding-top:15px;border-top:1px solid var(--theme-edge);font-size:11px;line-height:1.6;color:var(--theme-muted);}
.site-theme-dialog button:focus-visible,.site-theme-trigger:focus-visible{outline:2px solid var(--theme-accent);outline-offset:4px;}
@keyframes theme-picker-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:600px){html body .site-theme-dialog{width:calc(100vw - 20px);padding:20px 14px;border-radius:22px;margin:auto auto 10px;max-height:calc(100dvh - 20px);}.site-theme-dialog h2{font-size:20px;}.site-theme-choices{gap:8px;}.site-theme-choice{padding:6px!important;border-radius:12px!important;}.site-theme-choice>strong{font-size:11px;}.site-theme-choice-description{font-size:9px;}.site-theme-preview{height:90px;padding:6px;gap:4px;}.theme-preview-hero{height:30px;}.theme-preview-tile{height:20px;}}
@media(prefers-reduced-motion:reduce){.site-theme-dialog[open]{animation:none}.site-theme-trigger,.site-theme-choice{transition:none!important;}}
