/* Theme pairs for the new controls; explicit specificity prevents inherited dark text. */
:root{--prism-control-bg:#79583b;--prism-control-text:#fff4df;--prism-control-border:#b08a5f;--prism-panel:#403125;--prism-body:#f3eee5;--prism-secondary:#ddc9b4}
html[data-theme="green"]{--prism-control-bg:#4a653a;--prism-control-text:#f3f7e7;--prism-control-border:#78955c;--prism-panel:#2f4335;--prism-body:#f0f4e8;--prism-secondary:#c2ceb6}
#playHub.homeActive{overflow:hidden}
#playHub.homeActive #hubHome{height:100%;min-height:0;display:flex;flex-direction:column;gap:10px}
#playHub.homeActive .hubHeading{flex:none;padding:20px 0 16px}
#playHub.homeActive .homeOptions{flex:1;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:10px}
#playHub.homeActive .homeOptions button{min-height:44px;min-width:0;height:100%;padding:12px;gap:7px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
#playHub.homeActive .homeOptions strong{font-size:17px;line-height:1.2;color:#fffaf3;white-space:normal}
#playHub.homeActive .homeOptions .homeModeIcon{font-size:25px;line-height:1;color:#f3eee5;font-weight:400;flex:none}
#playHub.homeActive .homeOptions span:not(.homeModeIcon){font-size:12px;line-height:1.3;color:var(--prism-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.homeCreditBar{flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:6px 8px 6px 12px;min-height:56px;background:var(--prism-panel);border:1px solid var(--prism-control-border);border-radius:14px;color:var(--prism-body)}
.homeCreditBalance{flex:1;min-width:0}.homeCreditBalance strong{display:block;color:var(--prism-body);font-size:15px;line-height:1.2;white-space:nowrap}.homeCreditBalance small{display:block;color:var(--prism-secondary);font-size:11px;line-height:1.2;margin-top:2px}
#playHub #homeCreditOffer button.creditTopup,#settingsPanel #earnCredits{background:var(--prism-control-bg);color:var(--prism-control-text);border:1px solid var(--prism-control-border);font-size:13px;font-weight:700;min-height:44px;border-radius:10px;padding:8px 12px;white-space:nowrap}
#playHub .homeCreditBar button#pinCreditWidget{color:var(--prism-body);background:var(--prism-panel);border:1px solid var(--prism-control-border);font-size:12px;min-height:44px;border-radius:10px;padding:8px 10px;white-space:nowrap}
#playHub .homeCreditBar .creditTopup:disabled,#settingsPanel #earnCredits:disabled{color:var(--prism-control-text);opacity:.65}
#playHub.homeActive[data-home-height="compact"] .hubHeading,#playHub.homeActive[data-home-height="short"] .hubHeading{padding-bottom:4px}
#playHub.homeActive[data-home-height="compact"] .homeOptions button,#playHub.homeActive[data-home-height="short"] .homeOptions button{display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;column-gap:7px;row-gap:3px;padding:8px}
#playHub.homeActive[data-home-height="compact"] .homeOptions strong,#playHub.homeActive[data-home-height="short"] .homeOptions strong{font-size:14px;line-height:1.2}
#playHub.homeActive[data-home-height="compact"] .homeModeIcon,#playHub.homeActive[data-home-height="short"] .homeModeIcon{grid-row:1/3;font-size:22px}
#playHub.homeActive[data-home-height="short"] .homeOptions span:not(.homeModeIcon){display:none}
#playHub.homeActive[data-home-height="short"] .homeOptions button{grid-template-rows:auto}
#playHub.homeActive[data-home-wide="true"] .hubHeading{padding:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:18px;align-items:center}
#playHub.homeActive[data-home-wide="true"] .homeWelcomeRow{grid-column:1;grid-row:1/4;margin:0}
#playHub.homeActive[data-home-wide="true"] .hubHeading>.eyebrow,#playHub.homeActive[data-home-wide="true"] .hubHeading>h1,#playHub.homeActive[data-home-wide="true"] .hubHeading>p{grid-column:2;margin:0}
#playHub.homeActive[data-home-wide="true"] .hubHeading>h1{font-size:30px}
#playHub.homeActive[data-home-wide="true"] .homeOptions{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
#playHub.homeActive[data-home-wide="true"] .homeOptions span:not(.homeModeIcon){display:none}
/* Summary names have their own full-width columns, separate from numeric rows. */
#gameOverview{color:var(--prism-body)}
#gameOverview .overviewScroll{padding:10px 16px 8px}
#gameOverview .overviewHeading{position:relative;text-align:center}
#gameOverview .overviewTopline{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 8px}
#gameOverview .overviewTopline>.eyebrow{margin:0;color:var(--prism-secondary);font-size:11px;letter-spacing:1px;white-space:nowrap}
#gameOverview .overviewTopline .settingRow{display:flex;align-items:center;gap:8px;margin:0;padding:0;justify-content:flex-end;min-width:0}
#gameOverview .overviewTopline label{font-size:12px;white-space:nowrap;color:var(--prism-secondary)}
#gameOverview #reviewSide{width:116px;min-width:116px;max-width:none;min-height:44px;padding:10px 14px;font-size:15px;line-height:1.3;border:1px solid var(--prism-control-border);border-radius:10px;background:var(--prism-panel);color:var(--prism-body)}
#gameOverview #reviewSide option{color:var(--prism-body);background:var(--prism-panel)}
#gameOverview .overviewHeading h1{font-size:25px;color:#fffaf3;line-height:1.2;margin:0 0 5px}
#gameOverview #overviewGame{color:var(--prism-secondary);font-size:12px;line-height:1.3;margin:0 0 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#gameOverview .overviewPlayers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 8px}
#gameOverview .overviewPlayer{grid-column:auto;min-width:0;gap:4px;padding:9px 8px;border:1px solid var(--prism-control-border);background:var(--prism-panel);border-radius:12px}
#gameOverview .overviewPlayer img{width:24px;height:24px}
#gameOverview .overviewPlayer strong{color:var(--prism-body);font-size:14px;line-height:1.25;display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;min-height:24px}
#gameOverview .overviewPlayer>span,#gameOverview .overviewPlayer>small{color:var(--prism-secondary);font-size:11px;line-height:1.25}
#gameOverview #whiteAccuracy,#gameOverview #blackAccuracy{grid-column:auto;color:#fffaf3;background:transparent;padding:0;border-radius:0;font-size:27px;line-height:1.1;font-weight:800;font-variant-numeric:tabular-nums}
#gameOverview .overviewProgress{margin:0 0 6px}
#gameOverview .overviewProgress p{margin:2px 0;color:var(--prism-secondary);font-size:11px}
#gameOverview .overviewProgress progress{margin:5px 0;height:10px;border-radius:999px}
#gameOverview .overviewCountHead,#gameOverview .overviewCount{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(44px,.7fr) minmax(44px,.7fr);column-gap:8px}
#gameOverview .overviewCountHead{font-size:11px;color:var(--prism-secondary);padding:5px 0;border-bottom:1px solid var(--prism-control-border)}
#gameOverview .overviewCountHead>span:not(:first-child){text-align:center}
#gameOverview .overviewCount{min-height:29px;align-items:center}
#gameOverview .overviewCount>strong{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.25;color:var(--prism-body)}
#gameOverview .overviewCount>span{font-size:18px;text-align:center;color:var(--category-color)}
#gameOverview .overviewCount .categoryIcon{flex:none;width:20px;height:20px;font-size:12px;color:#fffaf3}
#gameOverview .overviewFootnote{font-size:11px;line-height:1.4;margin:7px 0 0;padding-top:7px;color:var(--prism-secondary)}
#gameOverview .overviewActions{padding:10px 14px}
#gameOverview #overviewStart{min-height:46px;font-size:18px;background:var(--prism-control-bg);color:var(--prism-control-text);border:1px solid var(--prism-control-border)}
#gameOverview .overviewActions .quiet{min-height:40px;font-size:12px;color:var(--prism-body);background:var(--prism-panel)}
#summaryNameDialog{color:var(--prism-body);background:var(--prism-panel)}#summaryFullName{font-size:18px;line-height:1.5;overflow-wrap:anywhere;color:var(--prism-body)}
@media(max-width:350px){#playHub .homeCreditBar{gap:5px;padding-left:8px}#playHub #homeCreditOffer button.creditTopup{padding:7px 9px}#playHub .homeCreditBar button#pinCreditWidget{padding:7px 8px}#gameOverview .overviewScroll{padding:8px 12px}#gameOverview .overviewTopline{gap:6px}#gameOverview .overviewTopline .settingRow{gap:5px}#gameOverview #reviewSide{min-width:112px;width:112px}#gameOverview .overviewPlayer strong{font-size:13px}}

#playHub .homeCreditBar .creditTopup span{display:block;color:var(--prism-control-text);font-size:13px;line-height:1.15}#playHub .homeCreditBar .creditTopup small{display:block;color:var(--prism-control-text);font-size:11px;line-height:1.15;font-weight:400;margin-top:2px}

/* Override generic setting-row wrapping and pressed feedback only for the approved controls. */
#gameOverview .overviewTopline .settingRow{flex-wrap:nowrap;flex:0 0 auto}
#gameOverview .overviewTopline .settingRow label{min-width:0;flex:none}
#gameOverview #reviewSide{flex:0 0 116px}
#gameOverview .overviewPlayerMeta{display:flex;justify-content:center;align-items:center;gap:5px;width:100%;min-height:22px}
#gameOverview .overviewPlayerMeta img{width:20px;height:20px}
#gameOverview .overviewPlayerMeta span{color:var(--prism-secondary);font-size:11px}
#gameOverview .overviewPlayer{gap:3px;padding:8px}
#gameOverview .overviewPlayer strong{min-height:22px}
#gameOverview .overviewCount{min-height:27px}
#gameOverview .overviewActions{padding:8px 14px}
#gameOverview .overviewActions>div{margin-top:4px}
#gameOverview .overviewActions .quiet{min-height:34px;padding:6px 10px}
#homeCreditOffer,#gameOverview,#earnCredits{--button-press:#8b6948;--button-press-ink:#fff4df;--button-ring:#d8b486}
html[data-theme="green"] :is(#homeCreditOffer,#gameOverview,#earnCredits){--button-press:#587847;--button-press-ink:#f3f7e7;--button-ring:#94b773}
@media(max-width:350px){#gameOverview #reviewSide{flex-basis:112px}}
#settingsPanel #personalAddWidget{color:var(--prism-body);background:var(--prism-panel);border:1px solid var(--prism-control-border);min-height:44px;--button-press:#8b6948;--button-press-ink:#fff4df;--button-ring:#d8b486}
html[data-theme="green"] #settingsPanel #personalAddWidget{--button-press:#587847;--button-press-ink:#f3f7e7;--button-ring:#94b773}

/* Approved 3.57 summary: standard title, compact selector and clearer move counts. */
#gameOverview .overviewScroll{padding:10px 16px 6px}
#gameOverview .overviewHeading{text-align:left}
#gameOverview .overviewHeading h1{font-size:30px;line-height:1.15;margin:0 0 4px;letter-spacing:-.7px}
#gameOverview .overviewTopline{margin-bottom:10px;gap:8px}
#gameOverview #overviewGame{font-size:12px;margin:0;min-width:0}
#gameOverview .overviewTopline .settingRow{gap:7px;flex:none}
#gameOverview .overviewTopline label{min-width:0;flex:none;font-size:12px}
#gameOverview #reviewSide{flex:none;width:96px;min-width:96px;min-height:44px;padding:8px 10px;font-size:15px}
#gameOverview .overviewPlayers{margin-top:0;margin-bottom:6px}
#gameOverview .overviewPlayer{padding:7px 8px;gap:3px}
#gameOverview .overviewPlayerMeta,#gameOverview .overviewPlayer strong{min-height:20px}
#gameOverview .overviewProgress{margin-top:7px}
#gameOverview .overviewCountHead{font-size:12px;padding:6px 0}
#gameOverview .overviewCount{min-height:31px}
#gameOverview .overviewCount>strong{font-size:15px}
#gameOverview .overviewCount>span{font-size:21px;font-weight:750}
#gameOverview .overviewCount .categoryIcon{width:22px;height:22px;font-size:12px}
@media(max-width:350px){#gameOverview .overviewScroll{padding-left:12px;padding-right:12px}}

/* 3.59: compact large-screen frames; phone header geometry is preserved. */
#homeRewardStatus{flex-basis:100%;margin:0;font-size:12px;color:var(--prism-secondary)}
#homeRewardStatus[hidden],#cancelRewardLoading[hidden]{display:none!important}
.homeCreditBar:has(#homeRewardStatus:not([hidden])){flex-wrap:wrap}
#playHub #cancelRewardLoading{min-height:44px;color:var(--prism-body);background:var(--prism-panel)}
@media(min-width:600px) and (min-height:800px){
 #playHub.homeActive #hubHome{max-height:850px;max-width:960px;margin:0 auto}
 #playHub.homeActive .homeOptions{flex:0 1 510px;grid-template-rows:repeat(3,minmax(110px,160px));gap:12px}
 #playHub.homeActive .homeOptions button{padding:18px;gap:8px}
 #playHub.homeActive .homeOptions strong{font-size:19px}
 #playHub.homeActive .homeOptions span:not(.homeModeIcon){font-size:14px}
 #gameOverview{height:auto;max-height:calc(100dvh - 64px);width:min(100%,760px);margin:0 auto}
 #gameOverview .overviewScroll{flex:0 1 auto;padding:18px 20px 12px}
 #gameOverview .overviewActions{padding:12px 20px}
 #gameOverview .overviewCount{min-height:36px}
 #gameOverview .overviewCountHead,#gameOverview #overviewGame,#gameOverview .overviewTopline label{font-size:14px}
 #gameOverview .overviewPlayer>small,#gameOverview .overviewPlayerMeta span,#gameOverview .overviewProgress p,#gameOverview .overviewFootnote{font-size:13px}
}
/* Keep the explicit loading request and Cancel together, including short phones. */
#homeCreditOffer #homeRewardStatus{flex:1 1 calc(100% - 90px);min-width:0}
#homeCreditOffer #cancelRewardLoading{flex:0 0 70px;padding:8px;min-width:0}

@media(max-height:600px){#playHub.homeActive:has(#homeRewardStatus:not([hidden])) .hubHeading{padding-top:10px;padding-bottom:0}#playHub.homeActive:has(#homeRewardStatus:not([hidden])) #hubHome{gap:6px}}
@media(min-width:600px) and (min-height:800px){#playHub.homeActive[data-home-wide="true"] .homeOptions{flex-basis:332px;grid-template-rows:repeat(2,minmax(110px,160px))}}

/* Compact, consistent settings sections and a single native scrolling surface. */
#settingsPanel{overflow-y:auto;overscroll-behavior-y:contain;scroll-behavior:auto;scrollbar-gutter:stable}
#settingsPanel .appSettings{display:flex;flex-direction:column;gap:0}
#settingsPanel .settingsGroup{padding:16px 0;margin:0}
#settingsPanel .settingsGroup h3{margin:0 0 10px;font-size:17px}
#settingsPanel .settingsGroup p{margin:8px 0 10px}
#settingsPanel .settingRow{margin:3px 0}
#settingsPanel .playActions{margin-top:10px;gap:8px}
#settingsPanel #settingsInfo{padding:16px 0 4px}
#settingsPanel summary{min-height:44px;display:flex;align-items:center;font-weight:700}
#settingsPanel button:active{transform:none}

#settingsPanel .settingsGroup{border:1px solid var(--settings-line);border-radius:14px;padding:14px;margin:0 0 12px;background:var(--prism-panel)}
#settingsPanel .settingsGroup:first-child{padding-top:14px}
#settingsPanel .settingsGroup h3{letter-spacing:.1px}
#settingsPanel .settingsGroup>button{max-width:100%}
#settingsPanel #settingsInfo{padding:12px 14px}
#settingsPanel #settingsInfo>summary::after{content:'⌄';margin-left:auto}
#settingsPanel #settingsInfo[open]>summary::after{transform:rotate(180deg)}
