/* Shared light palette. Explicit dark selection uses the original cinematic theme. */
:root:not([data-theme="dark"]){color-scheme:light;--bg:#f5f7f4;--surface:#fff;--panel:#edf2e9;--line:#1b301314;--line-strong:#1b30132b;--lime:#467000;--lime-hover:#365900;--text:#19251c;--muted:#566454;--a-bg:#f5f7f4;--a-side:#fff;--a-panel:#fff;--a-panel-alt:#edf2e9;--a-line:#1b301314;--a-border:#1b30132b;--a-text:#19251c;--a-muted:#566454;--a-lime:#467000;--a-amber:#8c5a0b;--a-blue:#23669d;--a-red:#ab3425}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;padding:9px;border:1px solid #ffffff30;border-radius:10px;background:transparent;color:#dce5d9;cursor:pointer}
.theme-toggle[hidden]{display:none}.theme-toggle svg{width:21px;height:21px}.theme-sun{display:none}[data-theme="dark"] .theme-sun{display:block}[data-theme="dark"] .theme-moon{display:none}
:root:not([data-theme="dark"]) .theme-toggle{color:#425b31;border-color:#24421c30;background:#fff}
.theme-toggle:focus-visible{outline:2px solid #527b17;outline-offset:4px}
@media(max-width:540px){.hub-site .header-actions{gap:10px}.theme-toggle{width:36px;height:40px;padding:8px}}

/* Storefront, authentication and customer account share the same layout. */
:root:not([data-theme="dark"]) .hub-site{background:var(--bg)}
:root:not([data-theme="dark"]) :is(.search input,.hub-site .search input,input,select,textarea,.directory-filters input,.directory-filters select,.comparison-filter select){background:#fff;border-color:var(--line-strong);color:var(--text)}
:root:not([data-theme="dark"]) :is(input,select,textarea):focus{background:#fff;border-color:var(--lime)}
:root:not([data-theme="dark"]) :is(button,.button):hover{background:#e6eedf;border-color:#78994e}
:root:not([data-theme="dark"]) :is(.icon-button,.quick-link>.icon,.nav nav>a,.hub-nav-primary>a,.view-all,.footer-mark){color:#40503d}
:root:not([data-theme="dark"]) :is(.icon-button:hover,.hub-nav-primary>a:hover,.hub-nav-primary>a[aria-current=page]){color:var(--lime)}
:root:not([data-theme="dark"]) :is(.nav,.news,.game-card,.hub-site .game-card,.catalog-empty,.directory-intro,.source-group,.directory-bottom,.game-gallery,.cart-item,.cart-summary){background:#fff;border-color:var(--line-strong)}
:root:not([data-theme="dark"]) :is(.account-button .icon,.filters a,.hub-site .filters a,.provider-mark,.source-header,.edition-table thead th){background:#eaf0e5;color:#40503d}
:root:not([data-theme="dark"]) :is(.primary,.primary:hover,.image-arrow,.cart-count,.filters a[aria-current=true],.hub-site .filters a[aria-current=true],.admin-tabs a[aria-current=page],.nav nav>a[aria-current=page]){background:#c3f23b;color:#1b2a08;border-color:transparent}
:root:not([data-theme="dark"]) :is(.content p,.product-summary h2,.edition-table tbody th,.edition-table td b){color:#263b29}
:root:not([data-theme="dark"]) :is(.signature small,.price small,.hub-site .caption p,.founder-photo-label,.founder-role,.founder-copy>p:not(.founder-role),.directory-count,.directory-card-bottom>span,.provider-identity span[dir=ltr],.source-action small,.edition-table td[dir=ltr],.edition-table td b span,.size-unknown,.source-empty,.source-note,.cart-heading h1 span,.cart-shop-link,.cart-unit,.cart-quantity-form label,.cart-line-total small,.cart-pay-total small,.cart-drawer-footer small,.cart-explainer,.cart-summary-row>span,.cart-payment-note,.cart-drawer-header span,.cart-drawer-footer p){color:#566454}
:root:not([data-theme="dark"]) :is(.game-image,.game-gallery,.gallery-total,.hub-site .price){border-color:var(--line-strong)}
:root:not([data-theme="dark"]) .unavailable{color:#4c642f;background:#f0f6e7;border-color:#9cb87366}
:root:not([data-theme="dark"]) .founder{background:linear-gradient(115deg,#e6efda70,transparent 80%)}
:root:not([data-theme="dark"]) .notifications p{background:#fff;box-shadow:0 12px 40px #20301b15}
:root:not([data-theme="dark"]) .source-visit:hover{background:#c3f23b;color:#1b2a08}
:root:not([data-theme="dark"]) .gallery-total{color:#566454}
:root:not([data-theme="dark"]) :is(.cart-stepper,.cart-drawer){background:#fff;border-color:var(--line-strong)}
:root:not([data-theme="dark"]) :is(.cart-stepper button,.cart-drawer-footer){background:#edf2e9;border-color:var(--line-strong)}
:root:not([data-theme="dark"]) .cart-close{color:#40503d}
:root:not([data-theme="dark"]) :is(.cart-remove,.cart-remove:hover,.edition-editor-row>button){color:#ab3425}
:root:not([data-theme="dark"]) .cart-feedback{color:#31550d;background:#eef7e3;border-color:#8aa96c}
:root:not([data-theme="dark"]) .cart-feedback.is-error{color:#9f2d1d;background:#fff1ed;border-color:#d9a89b}
:root:not([data-theme="dark"]) .cart-toast{color:#263b29;background:#fff;border-color:#8aa96c;box-shadow:0 8px 30px #20301b20}

/* Artwork keeps its cinematic contrast in both themes. */
:root:not([data-theme="dark"]) :is(.hero,.explore>a,.directory-intro){--lime:#c3f23b;--lime-hover:#d3ff58;color:#f6f7f2}
:root:not([data-theme="dark"]) .hero :is(p,.hero-secondary){color:#e0e6dc}
:root:not([data-theme="dark"]) .explore p{color:#c2cdbb}
:root:not([data-theme="dark"]) .explore>a>.icon{color:#e0e6dc}
:root:not([data-theme="dark"]) .directory-intro p{color:#d0dac8}
:root:not([data-theme="dark"]) .hero .primary:hover{background:#d3ff58}

/* Administration: surfaces, tables, dialogs, editors and status colors. */
:root:not([data-theme="dark"]) :is(.adm-primary,.primary){background:#c3f23b;color:#1b2a08}
:root:not([data-theme="dark"]) :is(.adm-primary:hover,.primary:hover){background:#d3ff58}
:root:not([data-theme="dark"]) :is(.adm-button,.adm-button:hover,.button,.button:hover,.adm-filters,.admin-tabs a,.edition-editor-row,.adm-ticket-message,.adm-dialog .edition-editor-row,.adm-entry-sources,.adm-source-item){background:#edf2e9;color:#40503d;border-color:var(--a-border,var(--line-strong))}
:root:not([data-theme="dark"]) :is(.adm-stat,.adm-stat:hover,.adm-content-card,.adm-content-strip){background:#fff;border-color:var(--a-border)}
:root:not([data-theme="dark"]) :is(.adm-topbar,.adm-table th,.adm-account>div,.adm-dialog .adm-editor-panel>h2,.adm-dialog .adm-editor-panel>.adm-panel-heading){background:#f3f6ef}
:root:not([data-theme="dark"]) :is(.adm-dialog input,.adm-dialog select,.adm-dialog textarea,input[type=file]){background:#fff;border-color:var(--a-border)}
:root:not([data-theme="dark"]) input[type=file]::file-selector-button{background:#edf2e9;border-color:var(--a-border);color:#40503d}
:root:not([data-theme="dark"]) :is(.adm-kicker,.adm-store-link,.adm-icon-button,.adm-sidebar-bottom,.adm-nav-group>p,.adm-nav-group>a,.adm-stat-top,.adm-stat-bottom,.adm-panel-heading p,.adm-panel-heading>a,.adm-panel-heading>.icon,.adm-table th,.adm-product-cell small,.adm-table small,.adm-donut small,.adm-status-legend>a,.adm-empty p,.adm-shortcuts>a small,.adm-shortcuts>a>.icon,.adm-content-strip p,.adm-content-strip>a,.adm-release-summary,.adm-footer,.adm-footer span[dir=ltr],.adm-filters label>span,.adm-search-field .icon,.adm-reset,.adm-editor label,.adm-editor p,.adm-editor .muted,.adm-dialog label,.adm-record-table td:before,.adm-ticket-message small,.adm-card-summary,.adm-card-meta,.adm-card-meta>span:last-child,.adm-source-item a[dir=ltr],.adm-source-item small,nav[aria-label="صفحه‌بندی"]){color:#566454}
:root:not([data-theme="dark"]) :is(.adm-table td,.adm-status-legend b,.adm-empty h3,.adm-content-strip>a b,.adm-ticket-message p,.adm-modal-close){color:#263b29}
:root:not([data-theme="dark"]) .adm-topbar-location>b{color:#263b29}
:root:not([data-theme="dark"]) :is(.adm-topbar-location,.adm-account summary small,.adm-account summary>.icon,.adm-nav-group>a>.icon){color:#566454}
:root:not([data-theme="dark"]) :is(.adm-record-id){color:#566454!important}
:root:not([data-theme="dark"]) :is(.adm-file-info,.adm-count,.adm-edit-link,.adm-shortcuts>a>i,nav[aria-label="صفحه‌بندی"] a){color:#426318}
:root:not([data-theme="dark"]) :is(.adm-nav-group>a[aria-current=page],.adm-nav-group>a:hover,.admin-tabs a[aria-current=page]){background:#edf5dc;color:#365c0a}
:root:not([data-theme="dark"]) :is(.adm-stat:nth-child(4) .adm-stat-top i){color:#7650a3}
:root:not([data-theme="dark"]) :is(.adm-table tbody tr:hover,.adm-status-legend>a:hover){background:#f3f7ee;color:#263b29}
:root:not([data-theme="dark"]) :is(.adm-message,.adm-badge.published,.adm-badge.paid,.adm-badge.verified){color:#35600c;background:#eef7e3;border-color:#b4c99a}
:root:not([data-theme="dark"]) :is(.adm-errors,.adm-badge.unavailable,.adm-badge.pending,.adm-badge.open){color:#855307;background:#fff6e5;border-color:#e1c58c}
:root:not([data-theme="dark"]) :is(.adm-badge.draft,.adm-badge.admin){color:#225f8d;background:#edf5fc;border-color:#b9d4e9}
:root:not([data-theme="dark"]) .adm-badge.failed{color:#a33424;background:#fff0ec;border-color:#deb2a8}
:root:not([data-theme="dark"]) .adm-badge{color:#51664a;background:#f0f4ec}
:root:not([data-theme="dark"]) .adm-art-placeholder{background:#edf2e9;color:#566454}
:root:not([data-theme="dark"]) :is(input::placeholder,textarea::placeholder){color:#687564}

/* Shared pagination. */
:root:not([data-theme="dark"]) .sudo-pagination[aria-label] .sudo-pagination-frame{background:#fff;border-color:#28451a26;box-shadow:0 5px 20px #20301b08}
:root:not([data-theme="dark"]) .sudo-pagination[aria-label] .sudo-page-link{color:#40503d;background:#f8faf5;border-color:#28451a26}
:root:not([data-theme="dark"]) .sudo-pagination[aria-label] :is(a.sudo-page-link:hover,.sudo-page-link[aria-current=page]){color:#1b2a08;background:#c3f23b;border-color:#9ebd37}
:root:not([data-theme="dark"]) .sudo-pagination[aria-label] :is(.sudo-page-info,.sudo-page-ellipsis){color:#566454}
