/* Site chrome only. Game canvases, boards, pieces and engine variables stay native. */
html[data-shell=light]{color-scheme:light;background:#f3f4f6;--shell-bg:#f3f4f6;--shell-paper:#fff;--shell-ink:#24313d;--shell-muted:#566675;--shell-line:#d7dfe5;--shell-accent:#17634f}
html[data-shell=light] body{background:var(--shell-bg)!important;color:var(--shell-ink)!important}

/* Portal, collections, search and local library. */
html[data-shell=light] body:has(.portal-header){--bg:#f3f4f6;--panel:#fff;--muted:#566675;--mint:#17634f}
html[data-shell=light] :is(.portal-header,.portal-footer,.site-header,.exp-header,body>header,body>footer,.fruit-header,.fruit-footer,.water-header,.water-footer,.header,.topbar,.footer){color:var(--shell-ink);border-color:var(--shell-line);background:var(--shell-bg)}
html[data-shell=light] :is(.portal-header nav a[aria-current=page],.mobile-nav a[aria-current=page]){color:#17634f;background:#e0eee7}
html[data-shell=light] .portal-mark{background:#d5eee1;color:#18563f}
html[data-shell=light] :is(.portal-card,.category-links a,.library-card,.library-empty,.portal-copy .discovery-panel){background:#fff;color:var(--shell-ink);border-color:var(--shell-line);box-shadow:0 3px 12px #24313d05}
html[data-shell=light] :is(.portal-card:hover,.category-links a:hover){border-color:#87a99c}
html[data-shell=light] :is(.library-body p,.library-empty,.portal-copy p,.portal-local-note,.portal-footer .privacy-settings){color:var(--shell-muted)}
html[data-shell=light] :is(.portal-copy a,.section-title a,.category-links svg){color:var(--shell-accent)}
html[data-shell=light] :is(.search-wrap input,.portal-header select,.filter-chips a,.reset-button,.library-tabs a,.library-favorite,.portal-copy button){background:#fff;color:var(--shell-ink);border-color:#c6d2da}
html[data-shell=light] :is(.filter-chips a[aria-current=page],.library-tabs a[aria-current=page],.library-favorite[aria-pressed=true]){background:#e0eee7;color:#17583f;border-color:#93b6a5}
html[data-shell=light] .library-open{background:#21644f;color:#fff}
html[data-shell=light] .mobile-nav{background:#fffffff5;border-color:#d2dce3;box-shadow:0 -3px 18px #24313d08}
html[data-shell=light] .favorite-toggle{background:#fffffff0;color:#304b40;border-color:#b8c9c0;box-shadow:0 2px 5px #0001}
html[data-shell=light] .favorite-toggle[aria-pressed=true]{background:#21644f;color:#fff}
html[data-shell=light] #library-status{color:#8a4e1e}

/* Headers and introductory/editorial areas shared by the game families. */
html[data-shell=light] :is(.site-header,.exp-header,.fruit-header,.water-header,.header,.topbar,body>header) :is(a,.brand,.brand b,.no-download){color:var(--shell-ink)}
html[data-shell=light] :is(.site-header,.exp-header,.fruit-header,.water-header,.header,.topbar,body>header) :is(select,.site-tool,.icon-button){background:#fff;color:#304c42;border-color:#c6d2da}
html[data-shell=light] :is(.hero-copy,.snake-copy,.football-copy,.orbit-copy,.brick-copy,.memory-copy,.sky-copy,.bubble-copy,.tank-copy,.duo-copy,.game-heading,.heading,.fruit-heading,.intro,.masthead){color:var(--shell-ink)}
html[data-shell=light] :is(.hero-copy,.snake-copy,.football-copy,.orbit-copy,.brick-copy,.memory-copy,.sky-copy,.bubble-copy,.tank-copy,.duo-copy,.game-heading,.heading,.fruit-heading,.intro,.masthead) :is(p,.lead,.feature-row,.eyebrow,.muted){color:var(--shell-muted)}
html[data-shell=light] :is(.hero-copy,.snake-copy,.football-copy,.orbit-copy,.brick-copy,.memory-copy,.sky-copy,.bubble-copy,.tank-copy,.duo-copy,.game-heading,.heading,.fruit-heading,.intro,.masthead) h1{color:var(--shell-ink);-webkit-text-fill-color:currentColor;background:none}
html[data-shell=light] :is(.portal-game-bar a,.portal-game-bar .portal-game-name,.portal-game-title-alias,.ops-breadcrumb a,.ops-breadcrumb){color:#385849}
html[data-shell=light] :is(.portal-game-bar small,.portal-offline-note,.game-caption,body>footer,.footer,.fruit-footer,.water-footer,.release-footer,.ops-footer a){color:var(--shell-muted)}

/* Peripheral panels and written instructions; deliberately not .game-surface or .board. */
html[data-shell=light] :is(.game-side,.profile-box,.discovery-panel,.growth-player,.growth-return,.release-record-card,.info-grid article,.save-contract,.search-guide,.growth-topics,.ops-route,.ops-record,.fruit-sidebar,.game-aside,.portal-copy .discovery-panel){background:#fff;color:var(--shell-ink);border-color:var(--shell-line);box-shadow:none}
html[data-shell=light] :is(.game-side,.profile-box,.discovery-panel,.growth-player,.growth-return,.release-record-card,.info-grid article,.save-contract,.search-guide,.growth-topics,.ops-route,.ops-record,.fruit-sidebar,.game-aside) :is(p,small,label,summary,h2,h3){color:var(--shell-ink)}
html[data-shell=light] :is(.guide,.detail,.below,.versus-rules,.fruit-info,.game-info,.search-guide,.search-foundation-nav,.ops-intro,.ops-page-content,.info-grid,.legal,.growth-topics,.release-footer,.release-local-note){color:var(--shell-muted);border-color:var(--shell-line)}
html[data-shell=light] :is(.guide,.detail,.below,.versus-rules,.fruit-info,.game-info,.search-guide,.search-foundation-nav,.ops-page-content,.info-grid) :is(h2,h3,summary){color:var(--shell-ink)}
html[data-shell=light] :is(.guide,.detail,.below,.versus-rules,.fruit-info,.game-info,.search-guide,.search-foundation-nav,.ops-page-content,.info-grid,.release-footer) a{color:var(--shell-accent)}
html[data-shell=light] :is(.game-side,.profile-box,.discovery-panel,.game-aside,.fruit-sidebar) :is(button:not(.primary),select,input:not([type=range],[type=checkbox])){background:#fff;color:#30473e;border-color:#c3d1c9}
html[data-shell=light] :is(.game-side,.profile-box,.game-aside) .primary{background:#21644f;color:#fff;border-color:#21644f}
html[data-shell=light] body[data-game] :is(aside.aside,aside.side,aside.controls){background:#fff;color:#24313d;border-color:#d7dfe5}
html[data-shell=light] body[data-game] :is(aside.aside,aside.side,aside.controls) :is(p,label,small,h2,h3,.muted,.note){color:#455b65}
html[data-shell=light] body[data-game] :is(aside.aside,aside.side,aside.controls) :is(button:not(.primary),select){background:#edf2ef;color:#2b4d3e;border-color:#bdcec3}
html[data-shell=light] :is(.release-nav,.growth-note){background:#e8efeb;color:#345047;border-color:#b9ccbf}
html[data-shell=light] .release-nav a{color:#21563f}

/* Preserve the legacy dark play shells and all inherited in-game text contrast. */
html[data-shell=light] body.game-page :is(.game-shell,.goal-shell,.snake-shell,.orbit-shell,.brick-shell,.memory-shell,.sky-shell,.bubble-shell,.tank-shell,.duo-shell){color-scheme:dark;color:#f6f7ff;background-color:#142032;border-color:#345065;box-shadow:0 12px 30px #24313d18}
html[data-shell=light] body[data-game]:not([data-game=gomoku]):not([data-game=little-restaurant]) .game-surface{color-scheme:dark;color:#e7f3f0}
html[data-shell=light] :is(.game-overlay,.gamekit-modal){color:#f6f7ff}
html[data-shell=light] :is(.input-tags,.focus-tip,.feature-row,.best-panel small,.best-panel span){color:#566675}
html[data-shell=light] .best-panel strong{color:#21644f}
html[data-shell=light] :is(.quick-controls,.player-library){background:#fff;color:#24313d;border-color:#cbd7df}
html[data-shell=light] .quick-controls :is(p,.gesture-mark){color:#385849}
html[data-shell=light] .growth-player :is(button,select,input:not([type=range],[type=checkbox])){background:#f1f5f2;color:#2d493d;border-color:#bdcec4}

/* Soft light chrome for the newer board/card games, even when the board uses its night palette. */
html[data-shell=light] :is(body[data-game=chess],body.tabletop) .surface{background:#fff;border-color:#d7dfe5;color:#24313d;box-shadow:0 12px 35px #24313d07}
html[data-shell=light] :is(body[data-game=chess],body.tabletop) :is(.intro p,.eyebrow,.player div span,.player #save-note,.notice,.aside-note,.guide,.player-info small){color:#566675}
html[data-shell=light] :is(body[data-game=chess],body.tabletop) :is(.tools button,.aside-actions .secondary,button#resume,button#focus,button#restart,.social button){background:#edf1ef;color:#2f4c3e;border-color:#cad6d0}
html[data-shell=light] :is(body[data-game=chess],body.tabletop) .primary{background:#315b47;color:#fffaf0;border-color:#315b47}
html[data-shell=light] :is(body[data-game=chess],body.tabletop) :is(.aside-heading h2,.guide h2,.guide h3){color:#24313d}

/* Site settings, notices and consent are website chrome, not game overlays. */
html[data-shell=light] :is(dialog:not(#pool-result):not(#promotion-dialog),.privacy-choice,.ops-install-banner,.release-update){background:#fff;color:#24313d;border-color:#b9cac2;box-shadow:0 18px 55px #24313d26}
html[data-shell=light] :is(dialog:not(#pool-result):not(#promotion-dialog),.privacy-choice,.ops-install-banner,.release-update) :is(p,label,small){color:#455867}
html[data-shell=light] :is(dialog:not(#pool-result):not(#promotion-dialog),.privacy-choice) :is(button:not(.primary),select,input:not([type=range],[type=checkbox])){background:#edf2ef;color:#2b4d3e;border-color:#bdcec3}
html[data-shell=light] .privacy-choice a{color:#17634f}
html[data-shell=light] .privacy-choice button:first-child{background:#21644f;color:#fff;border-color:#21644f}
html[data-shell=light] :is(body>header,aside,dialog,.privacy-choice,.portal-header){color-scheme:light}
html[data-shell=light] :is(.portal-header,.portal-main,.portal-footer,.mobile-nav,.privacy-choice) :is(a,button,input,select):focus-visible{outline-color:#267257}
html[data-shell=light] :is(input[type=search],input[type=text])::placeholder{color:#667684;opacity:1}
