:root{font-family:'DM Sans',sans-serif;color:#f3eee5;background:#241c17;font-size:16px;color-scheme:dark}*{box-sizing:border-box}body{margin:0}button,select,textarea{font:inherit}button,.file{border:0;border-radius:8px;padding:11px 16px;background:#efd5aa;color:#392819;font-weight:700;cursor:pointer}button:hover{filter:brightness(1.1)}button:disabled{opacity:.5;cursor:wait}button.quiet{background:#503c2d;color:#ddc9b4}a{color:#efd5aa}header{height:80px;padding:0 5%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #3b2d23}.brand{text-decoration:none;font-size:36px;display:flex;gap:12px;align-items:center}.brand span{font-size:17px;letter-spacing:3px;font-weight:700}.engine{color:#ddc9b4;font-size:14px}main{max-width:1280px;margin:auto;padding:32px 36px}.intro{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px;gap:20px}.eyebrow{font-size:12px;letter-spacing:2px;color:#edcba0;margin:0 0 8px;font-weight:700}h1{font:800 36px 'Manrope',sans-serif;margin:0 0 9px;letter-spacing:-1px}.intro p:last-child{color:#ddc9b4;margin:0;line-height:1.6}#importPanel{background:#382b22;border:1px solid #88694e;border-radius:12px;padding:20px;margin-bottom:26px}#importPanel label{display:block;margin-bottom:10px}textarea{width:100%;height:110px;background:#241c17;border:1px solid #80624a;border-radius:8px;padding:12px;color:#f3eee5;font-size:14px;resize:vertical}.importActions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}.importActions .file{margin:0;background:#3b2d23;color:#f3eee5}input[type=file]{display:none}#importStatus{color:#edb989;font-size:14px}.workspace{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(350px,1fr);gap:32px}.player{display:flex;justify-content:space-between;align-items:center;padding:14px 0;font-weight:700}.player span:last-child{font-size:14px;color:#ddc9b4}.boardWrap{display:flex;gap:12px}.eval{width:24px;flex:none;background:#3b2d23;border-radius:4px;position:relative;overflow:hidden}#evalFill{position:absolute;bottom:0;width:100%;height:50%;background:#f3eee5;transition:height .3s}#evalText{position:absolute;top:8px;left:1px;font-size:12px;color:#fff;writing-mode:vertical-rl;text-shadow:0 1px 3px black}#board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,1fr);border-radius:5px;overflow:hidden}.square{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1;background:#e0e5cf;color:#3b2d23;font-family:Georgia,serif;font-size:clamp(26px,4.4vw,57px);user-select:none}.square.dark{background:#6d8977}.square.last{background:#c3cc78}.square.dark.last{background:#a3b15e}.piece.white{color:#fff;text-shadow:0 1px 1px #111,1px 0 1px #111,-1px 0 1px #111}.piece.black{color:#3b2d23;text-shadow:0 1px 1px #ddc9b4}.coord{position:absolute;font:700 11px 'DM Sans',sans-serif;left:3px;top:3px;color:#80624a}.filecoord{bottom:1px;top:auto;right:4px;left:auto}.boardControls{display:flex;gap:6px;align-items:center;margin:10px 0 22px}.boardControls button{background:#493729;color:#f3eee5;padding:10px 12px}.boardControls span{flex:1;text-align:center;font-size:14px}.chartCard{border:1px solid #3b2d23;border-radius:10px;padding:15px}.row{display:flex;justify-content:space-between;gap:12px;align-items:center}.chartCard .row{font-size:12px;color:#ddc9b4}.chartCard .row span:first-child{font-size:14px}#chart{width:100%;height:100px;margin-top:10px;cursor:pointer}aside{background:#382b22;border:1px solid #88694e;border-radius:12px;padding:24px;min-width:0}.reviewHeader{display:flex;justify-content:space-between;align-items:center}h2{font:700 22px 'Manrope',sans-serif;margin:0}#result{color:#ddc9b4;font-size:16px}.reviewActions{display:flex;gap:8px;margin:22px 0 12px}select{background:#241c17;border:1px solid #80624a;border-radius:8px;padding:8px;color:#f3eee5;font-size:14px;min-width:0;flex:1}#status{font-size:14px;color:#ddc9b4;line-height:1.5}progress{width:100%;height:5px;margin:10px 0 20px;accent-color:#efd5aa}#summary{display:flex;gap:12px;margin-bottom:16px}#summary div{flex:1;background:#241c17;padding:12px;border-radius:8px;font-size:14px}#summary strong{display:block;font-size:25px;color:#efd5aa;margin:5px 0}.explanation{background:#3b2d23;border:1px solid #80624a;padding:20px;border-radius:10px;margin-bottom:24px;min-height:225px}.badge{padding:5px 9px;border-radius:5px;background:#445939;color:#d2efac;font-size:14px;font-weight:700}.badge.bad{background:#703b32;color:#ffd1bd}.badge.warn{background:#63522e;color:#ffe19c}h3{font-size:22px;margin:15px 0 10px}#explain{font-size:16px;line-height:1.65;color:#ddc9b4;margin:0 0 15px}#line{font-size:14px;color:#ddc9b4;line-height:1.8;margin-bottom:12px}#lineControls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:14px}#lineControls[hidden]{display:none}.moveHeading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.moveHeading button{font-size:14px;padding:7px 11px}#moves{max-height:285px;overflow:auto}.moveRow{display:grid;grid-template-columns:35px 1fr 1fr;align-items:center;border-top:1px solid #80624a;padding:5px 0;gap:4px}.moveRow>span{color:#a58a6e;font-size:14px}.moveRow button{background:transparent;color:#f3eee5;text-align:left;display:flex;align-items:center;justify-content:space-between;padding:8px 10px;font-weight:500}.moveRow button.active{background:#80624a}.moveRow small{font-size:12px;color:#efd5aa}.moveRow small.bad{color:#ffa787}.moveRow small.warn{color:#e9ce83}footer{font-size:12px;line-height:1.8;color:#a58a6e;margin:28px 0}footer a{color:#ddc9b4}@media(max-width:800px){main{padding:24px 16px}.workspace{grid-template-columns:1fr;gap:20px}header{height:64px}.intro{align-items:flex-start}h1{font-size:28px}.intro p:last-child{font-size:14px}.intro button{font-size:14px;padding:10px;flex:none}.square{font-size:clamp(26px,8.5vw,60px)}aside{padding:18px}.brand span{font-size:14px;letter-spacing:2px}.engine{font-size:12px}.chartCard .row{flex-wrap:wrap}}button:focus-visible,a:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #ddc9b4;outline-offset:3px}

/* Coaching surface sits directly above the position, on every screen. */
.intro{margin-bottom:20px}h1{font-size:30px}.coachCard{margin:0 0 12px;padding:20px;background:#3b2d23;border-color:#80624a;min-height:0;box-shadow:0 8px 24px #0002}.coachHeader{display:flex;gap:12px;align-items:center;margin-bottom:14px}.coachAvatar{width:44px;height:44px;flex:none;display:grid;place-items:center;font-size:32px;background:#efd5aa;color:#3b2d23;border-radius:12px}.coachHeader>div{flex:1}.coachHeader strong{display:block;font-size:16px}.coachHeader>div>span{font-size:13px;color:#ddc9b4;display:block;margin-top:3px}.coachCard h3{font-size:22px;margin:14px 0 10px}.coachCard #score{font-size:12px;white-space:nowrap;color:#ddc9b4}.openingContext{padding:10px 12px;background:#3b2d23;border-radius:7px;border-left:3px solid #ddc9b4}.openingContext>span{font-size:14px;color:#ddc9b4;font-weight:700}.openingContext p{font-size:14px;line-height:1.5;color:#ddc9b4;margin:5px 0 0}.coachCard #explain{margin-bottom:12px}.coachReply,.coachAlternative{font-size:15px;line-height:1.6;margin:10px 0;padding:10px 12px;background:#3b2d23;border-radius:6px}.coachReply{border-left:3px solid #cda36e}.coachAlternative{border-left:3px solid #ddc9b4;color:#ddc9b4}.coachTakeaway{border-top:1px solid #80624a;padding-top:12px;display:flex;gap:10px;align-items:baseline;font-size:14px;line-height:1.6;margin:12px 0;color:#ddc9b4}.coachTakeaway strong{font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#efd5aa}.coachButtons{display:flex;gap:8px;flex-wrap:wrap}.coachButtons button{font-size:14px}.coachCard #line{margin-top:12px;font-size:14px}.badge.brilliant,.moveMark.brilliant{background:#197c85;color:#d5ffff}.badge.great,.moveMark.great{background:#305fa0;color:#e1ecff}.badge.book,.moveMark.book{background:#705e42;color:#ffecd1}.moveRow small.brilliant{color:#77e5ed}.moveRow small.great{color:#93bfff}.moveRow small.book{color:#d4bc8e}.moveMark{position:absolute;right:1px;top:1px;min-width:22px;height:22px;padding:2px;border-radius:50%;font:700 13px 'DM Sans',sans-serif;display:grid;place-items:center;color:#392819;background:#efd5aa;box-shadow:0 1px 4px #0005}.moveMark.bad{background:#d3573e;color:white}.moveMark.warn{background:#d6a851;color:#241b0c}.variationNotice{font-size:14px;color:#efd5aa}.ratingRules{margin:10px 0}.ratingRules summary{cursor:pointer;color:#ddc9b4;font-size:14px}.ratingRules p{font-size:14px;max-width:900px}#importPanel[hidden]{display:none}@media(min-width:801px){aside{align-self:start;position:sticky;top:18px}#moves{max-height:600px}.boardColumn{max-width:640px}}@media(max-width:800px){.coachCard{padding:16px}.coachCard h3{font-size:20px}.coachCard .row{align-items:baseline}.coachCard #score{white-space:normal}.coachTakeaway{display:block}.coachTakeaway strong{display:block;margin-bottom:4px}.intro{gap:10px}.intro h1{font-size:25px}.openingContext p{font-size:14px}.coachCard #explain{font-size:16px}.coachHeader{gap:8px}.badge{font-size:13px}.moveMark{min-width:20px;height:20px;font-size:12px}}
/* Viewport review: evaluation, coaching, board and navigation stay together. */
.reviewPageTitle{font-weight:800;font-size:20px;letter-spacing:-.4px}.headerActions{display:flex;gap:8px}.headerActions button{padding:8px 12px;min-height:40px}.intro{display:none}header{height:54px;padding:0 18px;background:#2b211b;border:0}.brand{font-size:28px}.brand span{font-size:13px;letter-spacing:1px}.engine{display:none}main{padding:0;max-width:none}.workspace{display:block;background:#30251e}.boardColumn{--board-size:max(220px,min(100vw,620px,calc(100dvh - 320px - env(safe-area-inset-bottom,0px))));width:min(100%,620px);max-width:620px;margin:auto;height:calc(100dvh - 54px - env(safe-area-inset-bottom,0px));min-height:486px;display:grid;grid-template-rows:22px minmax(112px,1fr) var(--board-size) 44px 64px;gap:0;padding:0}.eval{width:100%;height:22px;background:#444541;border-radius:0;grid-row:1;overflow:hidden}#evalFill{height:100%;width:50%;left:0;top:0;bottom:auto;background:#f1f1ed;transition:width .25s}#evalText{writing-mode:horizontal-tb;top:3px;left:8px;font-size:12px;font-weight:700;color:#171916;text-shadow:0 0 2px #fff,0 0 4px #fff}.player{display:none}.boardWrap{grid-row:3;display:block;width:var(--board-size);height:var(--board-size);justify-self:center;container-type:inline-size}#board{width:100%;height:100%;border-radius:0;aspect-ratio:1}.square{min-width:0;min-height:0;font-size:9cqw;background:#eef0d2}.square.dark{background:#789653}.square.last{background:#f2ec88}.square.dark.last{background:#b7c660}.piece.black{color:#654b34;text-shadow:1px 0 0 #211c14,-1px 0 0 #211c14,0 1px 0 #211c14}.piece.white{color:#fffdf0;text-shadow:1px 0 0 #80624a,-1px 0 0 #80624a,0 1px 0 #80624a}.coord{color:#80624a;font-size:11px}.square.dark .coord{color:#dce9b9}.compactCoach{grid-row:2;display:flex;gap:12px;align-items:end;justify-content:center;background:transparent;border:0;box-shadow:none;border-radius:0;margin:0;padding:12px 10px;min-height:0;overflow:hidden}.compactCoach>.coachAvatar{width:44px;height:56px;flex:none;align-self:end;font-size:38px;background:#345466;color:#f3eee5;border-radius:18px 18px 10px 10px;margin-bottom:8px}.coachBubble{position:relative;background:#fff;color:#30332e;padding:14px 16px;border-radius:16px;width:100%;max-height:100%;overflow:auto;scrollbar-width:thin;color-scheme:light}.coachBubble:before{content:'';position:absolute;left:-10px;bottom:24px;width:16px;height:18px;background:#fff;border-radius:0 0 0 14px}.bubbleHeading{display:flex;align-items:center;gap:8px}.compactCoach h3{font-size:16px;line-height:1.25;flex:1;margin:0;font-weight:800;color:#30332e;min-width:0}.compactCoach .badge{font-size:12px;padding:4px 6px;flex:none;max-width:75px}.compactCoach #score{font-size:14px;white-space:nowrap;background:#f3eee5;color:#3b2d23;border-radius:6px;padding:5px 7px;font-weight:700}.compactCoach :is(#coachBrief,#mistakeNotes){font-size:16px;line-height:1.4;margin:8px 0 0;font-weight:500}.bubbleFooter{display:flex;align-items:center;gap:8px;font-size:12px;margin-top:6px;color:#a58a6e}.bubbleFooter #compactOpening{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}.bubbleFooter #coachReview{font-size:13px;padding:6px 9px;white-space:nowrap}.bubbleFooter #compactStatus{white-space:nowrap}.boardControls{grid-row:4;margin:0;padding:2px 12px;gap:4px;background:#382b22;min-width:0}.boardControls button{background:transparent;padding:7px 12px;min-width:40px;min-height:40px;color:#ddc9b4}.boardControls span{font-size:16px;font-weight:700;color:#f3eee5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.boardControls #first,.boardControls #last{display:none}.reviewToolbar{grid-row:5;display:flex;align-items:center;gap:8px;padding:8px 12px;background:#382b22}.reviewToolbar button{flex:1;min-height:46px;font-size:14px;padding:8px}.reviewToolbar #mobileNext{flex:2;font-size:20px;background:linear-gradient(#eed2a5,#c69a61);color:white;box-shadow:inset 0 1px 0 #ddc9b4;border-radius:10px}.reviewToolbar #exitLine{flex:2}.reviewToolbar button[hidden]{display:none}.reviewToolbar #showLine{font-size:0}.reviewToolbar #showLine:after{content:'Show Line';font-size:14px}.sheet{width:min(620px,calc(100vw - 24px));max-height:85dvh;overflow:auto;padding:20px;color:#f3eee5;background:#382b22;border:1px solid #80624a;border-radius:16px;box-shadow:0 12px 60px #0008;margin:auto;color-scheme:dark}.sheet::backdrop{background:#080e0abd;backdrop-filter:blur(4px)}.sheetHeading{display:flex;align-items:center;justify-content:space-between;margin:0 0 16px;gap:12px;font-size:18px}.sheetHeading button{min-height:40px;min-width:40px;padding:8px}.sheet aside{position:static;background:transparent;border:0;padding:0;margin:0;align-self:auto}.sheet .chartCard{margin-top:20px}.sheet #moves{max-height:40dvh}.sheet .fullCoach h3{font-size:22px;margin:16px 0}.sheet #explain{font-size:16px;color:#ddc9b4;line-height:1.7}.sheet .coachHeader{display:flex}.sheet .fullCoach #detailScore{font-size:14px;color:#efd5aa;white-space:nowrap}.sheet .coachButtons:empty{display:none}#importPanel{margin:auto}footer{max-width:900px;padding:16px 24px;margin:0 auto;background:#241c17}dialog:not([open]){display:none}
@media(max-width:800px){header{padding:0 12px}.brand span{display:none}.brand{font-size:28px}.reviewPageTitle{font-size:19px}.headerActions{gap:4px}.headerActions button{font-size:14px;padding:8px 10px}main{padding:0}.workspace{gap:0}.boardColumn{width:100%;max-width:620px}.compactCoach{padding:10px 8px;gap:9px}.compactCoach>.coachAvatar{width:34px;height:48px;font-size:31px;border-radius:14px 14px 8px 8px}.coachBubble{padding:12px;border-radius:13px}.compactCoach h3{font-size:16px}.compactCoach .badge{font-size:11px;padding:4px}.compactCoach #score{font-size:13px;padding:4px 5px}.bubbleHeading{gap:6px}.compactCoach :is(#coachBrief,#mistakeNotes){font-size:16px;line-height:1.35}.reviewToolbar{gap:6px}.boardControls{padding-left:8px;padding-right:8px}footer{display:none}.sheet{width:calc(100vw - 16px);max-height:88dvh;padding:16px}.moveMark{height:20px;min-width:20px}.square{font-size:9cqw}}
@media(max-height:650px){.compactCoach>.coachAvatar{display:none}.compactCoach{padding:6px 8px}.coachBubble{padding:9px 12px}.compactCoach :is(#coachBrief,#mistakeNotes){line-height:1.3;margin-top:5px}.bubbleFooter #compactOpening{display:none}.bubbleFooter:has(#coachReview[hidden]):has(#compactStatus:empty){display:none}}
@media(prefers-reduced-motion:reduce){#evalFill{transition:none}}
/* Player strips and artwork remain inside the viewport review. */
.boardColumn{--board-size:max(220px,min(100vw,620px,calc(100dvh - 372px - env(safe-area-inset-bottom,0px))));grid-template-rows:22px minmax(112px,1fr) 26px var(--board-size) 26px 44px 64px;min-height:538px}.compactCoach{grid-row:2}.player{display:flex;height:26px;padding:2px 12px;align-items:center;gap:12px;font-size:14px;background:#382b22;min-width:0}.boardColumn>.player:nth-child(3){grid-row:3}.boardColumn>.player:nth-child(5){grid-row:5}.player>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player>span:last-child{font-size:12px;flex:none}.boardWrap{grid-row:4}.boardControls{grid-row:6}.reviewToolbar{grid-row:7;gap:6px}.reviewToolbar #voiceToggle{flex:0 0 38px;font-size:19px;padding:6px;min-width:38px}.reviewToolbar button{padding:6px;font-size:13px}.reviewToolbar #mobileNext{font-size:20px}#board{position:relative;overflow:visible}.square{overflow:visible}.piece{width:92%;height:92%;object-fit:contain;display:block;filter:drop-shadow(0 2px 1px #0003);position:relative;pointer-events:none;user-select:none;transform-origin:center}.captureGhost{filter:drop-shadow(0 2px 1px #0003)}.importTabs{display:flex;gap:8px;margin-bottom:18px}.importTabs button{flex:1}.importTabs [aria-selected="false"]{background:#503c2d;color:#ead9c8}.fetchRow{display:flex;gap:8px}.fetchRow input{min-width:0;flex:1;border:1px solid #8b6e56;border-radius:8px;padding:10px;background:#241c17;color:#f3eee5;font:inherit;font-size:16px}.fetchRow button{font-size:14px;padding:10px}.archiveRow{display:flex;gap:12px;align-items:center;margin-top:15px}.archiveRow label{margin:0!important;font-size:14px}.archiveRow select{width:100%}#gamesStatus,#voiceStatus,#installStatus,#offlineStatus{font-size:14px;line-height:1.6;color:#decbb7}.importGame{width:100%;display:block;padding:13px;text-align:left;border:1px solid #88694e;background:#493729;color:#f3eee5;margin-bottom:8px}.importGame strong{font-size:15px;font-weight:700;display:block}.importGame span{font-size:13px;font-weight:400;color:#ddc9b4;display:block;margin-top:5px}#gameList{max-height:46dvh;overflow:auto}.appSettings{border-top:1px solid #88694e;margin-top:20px;padding-top:5px}.appSettings h3{font-size:17px}.settingRow{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px;font-size:14px}.settingRow label{flex:1;min-width:120px}.settingRow select{max-width:65%;flex:2}.settingRow input{accent-color:#efd5aa;width:22px;height:22px}#replayVoice{font-size:14px}.credits{font-size:12px;line-height:1.8;margin-top:14px;color:#d0bca8}#manualImport[hidden],#chessImport[hidden]{display:none}
@media(max-width:360px){.reviewToolbar{gap:3px;padding:8px}.reviewToolbar button{font-size:12px;padding:4px}.reviewToolbar #showLine:after{font-size:12px}.reviewToolbar #voiceToggle{flex-basis:34px;min-width:34px}.reviewToolbar #mobileNext{font-size:18px}.fetchRow{flex-wrap:wrap}.fetchRow input{flex-basis:180px}.compactCoach h3{font-size:15px}}
/* Summary is its own screen; the review opens only after Start Review. */
#boardWorkspace[hidden],#gameOverview[hidden]{display:none}.gameOverview{width:min(100%,680px);height:calc(100dvh - 54px - env(safe-area-inset-bottom,0px));margin:auto;background:#30251e;color:#eee;display:flex;flex-direction:column}.overviewScroll{min-height:0;flex:1;overflow:auto;padding:20px 20px 12px;overscroll-behavior:contain}.overviewHeading h1{font-size:25px;margin:0 0 8px}.overviewHeading>p:last-child{font-size:13px;color:#d0bca8;margin:0 0 16px}.overviewPlayers{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin:12px 0 18px;align-items:center}.overviewPlayer{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0;gap:5px}.overviewPlayer img{width:34px;height:34px}.overviewPlayer strong{font-size:14px;overflow-wrap:anywhere;line-height:1.3}.overviewPlayer>span{font-size:12px;color:#d0bca8}.overviewAccuracy{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;align-items:center;border-bottom:1px solid #80624a;padding-bottom:16px}.overviewAccuracy>strong{font-size:16px}.overviewAccuracy>strong>span{display:block;font-weight:400;font-size:12px;color:#d0bca8;margin-top:4px}.overviewAccuracy>div{font-size:28px;font-weight:800;padding:12px 4px;text-align:center;border-radius:8px}#whiteAccuracy{background:#f3eee5;color:#30332e}#blackAccuracy{background:#4a4b46;color:#f5f5f1}.overviewProgress{margin:8px 0 10px}.overviewProgress p{font-size:13px;color:#decbb7;margin:8px 0 4px}.overviewProgress progress{margin:2px 0 8px}.overviewCount{display:grid;grid-template-columns:minmax(90px,1fr) minmax(35px,.65fr) 34px minmax(35px,.65fr);gap:8px;align-items:center;min-height:49px}.overviewCount>strong{font-size:15px}.overviewCount>span{text-align:center;font-size:23px;font-weight:800;color:var(--category-color)}.overviewCount .categoryIcon{border-radius:50%;background:var(--category-color);color:white;width:30px;height:30px;font-size:18px;display:grid;place-items:center}.overviewCount.brilliant{--category-color:#28c3ae}.overviewCount.great{--category-color:#87abd1}.overviewCount.best{--category-color:#82bb52}.overviewCount.excellent{--category-color:#82bb52}.overviewCount.good{--category-color:#9dbe7b}.overviewCount.book{--category-color:#d0a57b}.overviewCount.inaccuracy{--category-color:#f0c343}.overviewCount.mistake{--category-color:#ffa463}.overviewCount.blunder{--category-color:#ee6354}.overviewCount.miss{--category-color:#d6a851}.overviewFootnote{font-size:12px;line-height:1.6;color:#d0bca8;padding-top:14px;border-top:1px solid #80624a;margin:12px 0 0}.overviewActions{padding:12px 16px;background:#382b22;flex:none;box-shadow:0 -4px 18px #0002}.overviewActions>#overviewStart{width:100%;min-height:54px;font-size:21px;background:linear-gradient(#eed2a5,#c69a61);color:white;border-radius:11px}.overviewActions>div{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:8px}.overviewActions .quiet{font-size:13px;padding:7px 10px;min-height:34px}.overviewAgain{margin-bottom:16px;width:100%}@media(max-width:360px){.overviewScroll{padding:14px 12px}.overviewCount{min-height:44px}.overviewPlayers{gap:8px}.overviewAccuracy{gap:8px}.overviewHeading h1{font-size:23px}.overviewActions{padding:10px 12px}.overviewCount>strong{font-size:14px}}
.overviewPlayers,.overviewAccuracy{grid-template-columns:minmax(90px,1fr) minmax(35px,.65fr) 34px minmax(35px,.65fr);gap:8px}.overviewPlayers .whitePlayer,#whiteAccuracy{grid-column:2}.overviewPlayers .blackPlayer,#blackAccuracy{grid-column:4}.overviewAccuracy>div{font-size:26px;font-variant-numeric:tabular-nums}@media(max-width:380px){.overviewAccuracy>div{font-size:24px}}
.boardArrows{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:6}.square.chosen{box-shadow:inset 0 0 0 4px #f4c348}.square.legalTarget:after{content:'';position:absolute;width:20%;height:20%;border-radius:50%;background:#17391e66;pointer-events:none;z-index:7}.square.legalTarget:has(.piece):after{width:80%;height:80%;background:transparent;border:4px solid #17391e88}.arrowLegend{font-size:13px;line-height:1.6;color:#b8c7ac}.arrowLegend .green{color:#a6d768}.arrowLegend .orange{color:#ffc165}.arrowLegend .blue{color:#71ccfa}.promotionOptions{display:flex;gap:8px;flex-wrap:wrap}.promotionOptions button{flex:1;min-width:80px}.reviewToolbar #tryMoves{min-width:30px}.reviewToolbar:has(#exitLine:not([hidden])) #movesToggle{display:none}.reviewToolbar:has(#exitLine:not([hidden])) #coachDetailsToggle{display:none}.square[role=button]{cursor:pointer;touch-action:manipulation}
#playHub{position:fixed;inset:0;z-index:20;background:#2b211b;color:#f3eee5;overflow:auto;padding:20px max(16px,calc((100vw - 640px)/2));}#playHub[hidden],#playHub [hidden]{display:none!important}.hubHeading{padding:22px 0}.hubHeading h1{font-size:38px;margin:8px 0}.hubHeading p,#savedStatus{color:#ddc9b4}.homeOptions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.homeOptions button{display:flex;flex-direction:column;text-align:left;padding:20px 14px;background:#493729;border:1px solid #80624a;min-height:126px;font-size:24px;gap:8px}.homeOptions strong{font-size:18px}.homeOptions span{font-size:13px;color:#ddc9b4;font-weight:400}.savedGame{padding:16px;background:#3b2d23;border-radius:12px;margin:12px 0}.savedGame p{font-size:13px;color:#ddc9b4}.savedGame button{margin:4px}#playSetup label,.gameNameLabel{display:block;margin:16px 0}#playSetup input,#playSetup select,.gameNameLabel input{display:block;width:100%;margin-top:6px;padding:12px;border-radius:8px;border:1px solid #8b6e56;background:#493729;color:white}.playHeading{display:flex;align-items:center;justify-content:space-between;gap:8px}.playHeading strong{font-size:14px}#playMessage{padding:12px 0;min-height:46px;font-weight:700;color:#edcba0}#playBoard{display:grid;grid-template-columns:repeat(8,1fr);width:min(100%,calc(100dvh - 350px));min-width:220px;aspect-ratio:1;margin:0 auto;position:relative;}.playPlayer{padding:8px;font-weight:700;margin:auto;width:min(100%,calc(100dvh - 350px))}#playBoard .square{aspect-ratio:1;position:relative;cursor:pointer}#playBoard .piece{width:94%;height:94%;position:absolute;top:3%;left:3%}#playMoves{max-height:46px;overflow:auto;margin:10px 0;font-size:13px;color:#ddc9b4;line-height:1.6}.playActions{display:flex;gap:8px;flex-wrap:wrap}.playActions button{flex:1;padding:12px 8px}#playSaved{font-size:12px;color:#ddc9b4}.gameNameLabel{font-size:13px;margin:10px 0}.gameNameLabel input{padding:8px}.primary{background:#e4c390;color:#392819}#playConfirm,#playPromotion{max-width:90vw;background:#493729;color:white;border:1px solid #8b6e56;border-radius:14px;padding:22px}#playPromotion button{margin:6px}
/* First paint shows only the logo, before any scripts initialise. */
body.booting>header,body.booting>main{visibility:hidden}#startupLogo{position:fixed;inset:0;z-index:1000;background:#2b211b;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#fff}#startupLogo img{width:112px;height:112px;border-radius:28px}#startupLogo strong{font-size:30px;letter-spacing:-.6px}#startupLogo span{color:#ddc9b4;font-size:14px}
#playHub{background:radial-gradient(ellipse at top right,#63472f 0,transparent 55%),linear-gradient(155deg,#2b211b,#241c17);color:#f3eee5}#playHub button{color:#f3eee5}#playHub .primary{color:#392819}#playHub .hubHeading{position:relative;padding:20px 0 24px}.homeLogo{width:68px;height:68px;background:#ead9ba;border:1px solid #b17e4c;border-radius:20px;margin-bottom:18px;box-shadow:0 10px 30px #0003}.homeLogo img{width:100%;height:100%;border-radius:20px}.hubHeading .eyebrow{color:#edcba0;font-size:11px;letter-spacing:2px}.hubHeading h1{font-size:38px;letter-spacing:-1.3px;color:#fff}.homeOptions{gap:14px}.homeOptions button{position:relative;overflow:hidden;border-radius:18px;background:linear-gradient(145deg,#594330,#3b2d23);border:1px solid #866548;box-shadow:0 6px 18px #0002;font-size:28px;padding:18px;min-height:146px;color:#edcba0}.homeOptions button:nth-child(2){background:linear-gradient(145deg,#5e4733,#403125);border-color:#87674b}.homeOptions button:nth-child(3){background:linear-gradient(145deg,#624a32,#403125);border-color:#8d6b47}.homeOptions button:nth-child(4){background:linear-gradient(145deg,#5c4739,#403125);border-color:#886d55}.homeOptions strong{color:#fff;font-size:17px;letter-spacing:-.2px}.homeOptions span{color:#ead9c8;line-height:1.45;font-size:12px}.homeOptions button:active{transform:scale(.98);filter:brightness(1.12)}#playHub h2{font-size:20px;margin-top:28px;color:#fff}.savedGame{border:1px solid #80624a;background:#493729cc;border-radius:16px}.savedGame strong{color:#fff}#savedStatus{font-size:13px}.savedGame .quiet{background:#594330;color:#f3eee5;border-radius:8px}#settingsPanel{color:#f3eee5}#settingsPanel .appSettings{padding:12px 0}#settingsPanel select{max-width:62%}#settingsPanel .sheetHeading strong{font-size:22px}#reviewEmpty{text-align:center;padding:60px 22px;max-width:480px;margin:auto;color:#f3eee5}.emptyReviewIcon{font-size:72px;color:#edcba0}#reviewEmpty p{line-height:1.6;color:#ddc9b4}#reviewEmpty button{margin-top:12px}#boardWorkspace[hidden],#reviewEmpty[hidden]{display:none!important}

#startupLogo{background:#2b211b}#startupLogo img{width:180px;height:180px;border-radius:0;object-fit:contain}

/* Spacious review navigation; Flip is isolated in the header. */
.boardControls{gap:12px;padding:4px 12px}.boardControls #prev,.boardControls #next{width:60px;min-width:60px;height:56px;min-height:56px;font-size:25px;border-radius:12px;background:#594330;touch-action:manipulation}.boardControls #position{font-size:15px;min-width:0}.boardColumn{--board-size:max(220px,min(100vw,620px,calc(100dvh - 396px - env(safe-area-inset-bottom,0px))));grid-template-rows:22px minmax(112px,1fr) 26px var(--board-size) 26px 68px 64px;min-height:562px}.headerActions #flip{min-width:48px;min-height:44px;font-size:22px;margin-right:12px;border:1px solid #80624a;border-radius:10px}.reviewToolbar #mobileNext{min-height:52px;font-size:22px}@media(max-width:360px){.headerActions{gap:4px}.headerActions button{padding:6px 8px}.headerActions #flip{margin-right:6px;min-width:44px}.boardControls{gap:8px}.boardControls #prev,.boardControls #next{width:56px;min-width:56px}}
#learnScreen{position:fixed;inset:0;z-index:25;background:#2b211b;color:#f3eee5;padding:18px max(16px,calc((100vw - 620px)/2));overflow:auto}#learnScreen[hidden],#learnScreen [hidden]{display:none!important}.lessonCard{display:block;width:100%;text-align:left;padding:17px;margin:10px 0;background:#594330;color:white;border:1px solid #866548;border-radius:14px}.homeOptions #learnChoice{background:linear-gradient(120deg,#80624a,#2a393c)}.homeOptions{grid-auto-rows:1fr}.homeOptions button{height:100%;min-height:146px}#lessonBoard{display:grid;grid-template-columns:repeat(8,1fr);width:min(100%,420px);aspect-ratio:1;margin:14px auto;position:relative}#lessonBoard .square{padding:0;border-radius:0;aspect-ratio:1;position:relative}#lessonBoard .piece{width:94%;height:94%;margin:auto}#lessonNotes{background:#fff;color:#3b2d23;padding:18px;border-radius:14px;line-height:1.55}#lessonFeedback{min-height:48px;line-height:1.5;color:#ddc9b4}.onlineSettings input[type=password]{width:100%;padding:12px;border-radius:8px;background:#493729;color:white;border:1px solid #8b6e56}.onlineSettings p{font-size:13px;line-height:1.5;color:#ddc9b4}#onlineCoachStatus{font-size:13px;color:#ddc9b4;padding:8px}#onlineCoachButton{margin:8px 0;width:100%}

#lessonBoard .coord{z-index:2;font-size:12px;font-weight:800;pointer-events:none;color:#80624a}#lessonBoard .dark .coord{color:#f3eee5}.overviewHeading .settingRow{justify-content:center;gap:12px}.overviewHeading select{background:#80624a;color:#fff;padding:8px;border-radius:7px}

#lessonSearch{width:100%;padding:14px;border-radius:12px;background:#382b22;color:#fff;border:1px solid #666;margin:12px 0}#lessonSideLabel{display:flex;align-items:center;gap:12px;margin:12px 0}#lessonPracticeSide{padding:12px;background:#382b22;color:#fff;border:1px solid #777;border-radius:10px}#lessonSideLabel[hidden]{display:none}

.settingsGroup{border-bottom:1px solid #80624a;padding:14px 0;margin:0 0 12px}.settingsGroup h3{margin:0 0 12px;color:#f3eee5}.settingsGroup p{color:#ddc9b4;font-size:.9rem;line-height:1.45}.settingsGroup label{display:block;margin:10px 0 6px}.settingsGroup select,.settingsGroup input:not([type=checkbox]){max-width:100%;width:100%}.settingsGroup summary{font-weight:700;padding:8px 0;cursor:pointer}.settingsGroup .playActions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.settingsGroup [hidden]{display:none!important}

/* Review and selection clarity */
.compactCoach>.coachAvatar{display:none}.coachBubble:before{display:none}.compactCoach{gap:0;padding:10px}.headerActions #homeButton,.playHeading #playHome{min-height:48px;min-width:88px;padding:12px 16px;font-size:16px}.settingRow:has(select){flex-wrap:wrap}.settingRow select{max-width:100%;width:100%;flex:1 1 100%;min-width:0;font-size:14px}.importGame.loading{border-color:#ecd3a3;background:#f0e2c8;color:#392819;opacity:1}.importGame.loading span{color:#5b3b25;font-weight:700}#savedGamesPage{max-width:620px;margin:auto;padding:20px}#savedGamesPage[hidden]{display:none}

#coachVoiceMode,#backgroundVoice{font-size:14px;width:100%;max-width:100%;min-width:0}#homeButton{white-space:nowrap}

@media(max-width:620px){header{padding:0 8px;gap:6px}.brand{display:none}.reviewPageTitle{flex:1;min-width:0;font-size:16px;line-height:1.1}.headerActions{gap:6px;flex:none}.headerActions button{padding:8px}.headerActions #flip{margin-right:0;min-width:44px}.headerActions #homeButton{padding:12px 10px;min-width:88px}}

.lessonCoach{padding:0;margin:14px 0;background:transparent;border:0;box-shadow:none;min-height:0}.lessonCoach .coachBubble{max-height:none;padding:14px 16px}.lessonCoach .bubbleHeading strong{font-size:16px;line-height:1.25;color:#30332e}.lessonCoach #lessonNotes{padding:0;margin:8px 0 0;border:0;border-radius:0;background:transparent;font-size:16px;line-height:1.4;color:#30332e;font-weight:500}.lessonCoach #lessonCoachLabel{background:#f3eee5;color:#80624a;font-size:12px;padding:4px 6px;white-space:nowrap}.lessonCoach .bubbleFooter{font-size:12px}#lessonBoard .piece{position:relative}
.player,.playPlayer{gap:6px}.playerName{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.playPlayer{display:flex;align-items:center;height:34px;padding-top:7px;padding-bottom:7px}.capturedPieces{display:flex;flex:none;align-items:center;gap:3px;white-space:nowrap;height:20px;min-width:0}.capturedPieces[hidden]{display:none}.captureGroup{display:inline-flex;align-items:center;gap:1px}.captureGroup img{width:15px;height:18px;object-fit:contain}.captureGroup small{font-size:10px;color:#ddc9b4}.capturedPieces .materialGain{font-size:12px;font-weight:700;color:#edcba0;margin-left:2px}
#learnScreen.lessonActive{display:flex;flex-direction:column;gap:8px;overflow:hidden;padding:10px max(12px,calc((100vw - 620px)/2)) calc(10px + env(safe-area-inset-bottom,0px));--lesson-board:min(420px,calc(100vw - 24px),max(160px,calc(100dvh - 430px - env(safe-area-inset-bottom,0px))))}.lessonActive>.playHeading{height:48px;flex:none}.lessonActive #lessonWorkspace{flex:1;min-height:0;display:grid;grid-template-rows:40px minmax(88px,1fr) 36px var(--lesson-board) 40px 40px 44px;gap:6px}.lessonHeading{display:flex;align-items:center;gap:8px;min-width:0}.lessonHeading #lessonTitle{flex:1;min-width:0;font-size:16px;line-height:1.15;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0}.lessonHeading #lessonSideLabel{margin:0;gap:5px;font-size:11px;flex:none}.lessonHeading #lessonPracticeSide{font-size:13px;padding:6px;max-width:80px}.lessonActive .lessonCoach{margin:0;min-height:0;overflow:hidden}.lessonActive .lessonCoach .coachBubble{height:100%;display:flex;flex-direction:column;padding:12px 14px;overflow:hidden}.lessonActive .lessonCoach .bubbleHeading,.lessonActive .lessonCoach .bubbleFooter{flex:none}.lessonActive .lessonCoach #lessonNotes{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.lessonVoiceRow{display:flex;align-items:center;gap:8px;min-width:0}.lessonVoiceRow #lessonSpeak{min-height:36px;font-size:12px;padding:7px 10px;flex:none}.lessonVoiceMessages{min-width:0;flex:1}.lessonVoiceMessages p{margin:0;font-size:10px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lessonVoiceMessages p:empty{display:none}.lessonActive #lessonBoard{width:var(--lesson-board);height:var(--lesson-board);min-height:0;margin:0;justify-self:center}.lessonActive #lessonFeedback{margin:0;min-height:0;overflow:auto;font-size:12px;line-height:1.3;overscroll-behavior:contain}.lessonActive .playActions{gap:6px}.lessonActive .playActions button{font-size:13px;padding:8px;min-width:0}.lessonActive #lessonAnalyse{font-size:15px;padding:8px;min-height:0}
@media(max-height:600px){.lessonActive #lessonWorkspace{grid-template-rows:32px minmax(88px,1fr) 32px var(--lesson-board) 32px 36px 40px}.lessonHeading #lessonTitle{font-size:14px}.lessonActive .lessonCoach .coachBubble{padding:9px 12px}.lessonActive .lessonCoach #lessonNotes{font-size:14px}.lessonActive .lessonCoach .bubbleHeading strong{font-size:14px}}
@media(orientation:landscape) and (max-height:560px){#learnScreen.lessonActive{--lesson-board:min(42vw,calc(100dvh - 80px - env(safe-area-inset-bottom,0px)),360px)}.lessonActive #lessonWorkspace{grid-template-columns:var(--lesson-board) minmax(0,1fr);grid-template-rows:32px minmax(88px,1fr) 32px 28px 36px 36px;gap:4px 10px}.lessonActive #lessonBoard{grid-column:1;grid-row:1/-1;align-self:center}.lessonActive .lessonHeading{grid-column:2;grid-row:1}.lessonActive .lessonCoach{grid-column:2;grid-row:2}.lessonActive .lessonVoiceRow{grid-column:2;grid-row:3}.lessonActive #lessonFeedback{grid-column:2;grid-row:4}.lessonActive .playActions{grid-column:2;grid-row:5}.lessonActive #lessonAnalyse{grid-column:2;grid-row:6}}

.player .capturedPieces .materialGain{font-size:12px;color:#edcba0}

/* Chess Prism palette and warm wood board; existing geometry is unchanged. */
.coachBubble{background:#fffaf1;color:#273446}.coachBubble:before{background:#fffaf1}
.square{background-color:#f0e2c8;background-image:repeating-linear-gradient(8deg,transparent 0px,transparent 7px,#79533008 8px,transparent 9px)}
.square.dark{background-color:#ae805b;background-image:repeating-linear-gradient(8deg,transparent 0px,transparent 7px,#5d35100c 8px,transparent 9px)}
.square.last{background-color:#e6ca87}.square.dark.last{background-color:#bd975f}
.coord,#lessonBoard .coord{color:#6d482e}.square.dark .coord,#lessonBoard .dark .coord{color:#241508}
#playHub .primary{background:#e4c390;color:#392819}.reviewToolbar #mobileNext{background:linear-gradient(#eed2a5,#c69a61)}
.homeLogo{background:#ead9ba;border-color:#b17e4c}

#playExit,#playRecover{max-width:90vw;background:#493729;color:#f3eee5;border:1px solid #8b6e56;border-radius:14px;padding:22px}#playExit h3,#playRecover h3{margin-top:0}

progress{accent-color:#e4c390}

:root{--selection-tint:rgba(240,226,200,.32);--selection-outline:#ecd3a3}
button,a,[role="button"]{-webkit-tap-highlight-color:var(--selection-tint)}
.importGame{user-select:none;-webkit-user-select:none}
.importGame:focus-visible{outline:3px solid var(--selection-outline);outline-offset:2px}
.importGame:active:not(.loading){background:#f0e2c8;color:#392819}
.importGame:active:not(.loading) span{color:#5b3b25}

/* Give coaching sixteen extra pixels without extending the fitted review. */
.boardColumn{--board-size:max(220px,calc(min(100vw,620px,calc(100dvh - 396px - env(safe-area-inset-bottom,0px))) - 16px))}
.compactCoach .coachBubble{padding:12px 14px}.compactCoach :is(#coachBrief,#mistakeNotes){font-size:15px;line-height:1.38}
.helpSheet{--help-accent:#e4c390;--help-ink:#392819;--help-border:#80624a;line-height:1.5}
.helpReviewLink{display:block;width:100%;min-height:48px;margin:14px 0 18px;padding:11px 16px;border:1px solid var(--help-border);border-radius:12px;background:var(--help-accent);color:var(--help-ink);font-weight:700;line-height:1.3;text-align:center;white-space:normal;box-shadow:0 2px 6px #0002}.helpReviewLink:hover{filter:brightness(1.06)}.helpReviewLink:focus-visible{outline:3px solid var(--help-accent);outline-offset:3px}
.helpSheet .sheetHeading{flex-wrap:wrap}.helpSheet h2{font-size:23px;line-height:1.25;margin:12px 0}.helpSheet p{margin:12px 0}.helpSheet details{padding:12px 0;border-bottom:1px solid var(--help-border)}.helpSheet summary{cursor:pointer;font-weight:700;padding:6px 0}.helpSheet li{margin:6px 0}.tourMark{font-size:42px;color:var(--help-accent)}.helpActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.helpActions button{min-height:44px;flex:1}.helpActions .primary{background:var(--help-accent);color:var(--help-ink)}.tourPreference{display:flex;align-items:center;gap:10px;font-size:14px;padding:12px 0}.tourPreference input{width:20px;height:20px;flex:none;accent-color:var(--help-accent)}.homeHelp{text-align:center;margin:18px 0}.helpEntry{min-height:44px;min-width:44px}.helpSheet [hidden]{display:none!important}#tourSaveStatus:empty{display:none}#helpProgress{font-size:13px;opacity:.8}
html[data-theme="green"] .helpSheet{--help-accent:#b2d980;--help-ink:#21321b;--help-border:#586349}

:root{--button-press:#f0e2c8;--button-press-ink:#392819;--button-ring:#ecd3a3}
html[data-theme="green"]{--button-press:#b2d980;--button-press-ink:#21321b;--button-ring:#c8ec87}
button:not(:disabled):active,button.tapFeedback:not(:disabled){background:var(--button-press)!important;color:var(--button-press-ink)!important;box-shadow:inset 0 0 0 2px var(--button-ring)!important}
button:focus-visible{outline:3px solid var(--button-ring);outline-offset:2px}
button[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--button-ring)}
button.tapFeedback span,button:active:not(:disabled) span{color:inherit!important}

/* Preserve the original Home layout; Help is an overlay icon only. */
#homeHelp{position:absolute;right:0;top:4px;width:44px;height:44px;font-size:22px;padding:8px}
.sheetHeading>strong{flex:1;min-width:0}.sheetHeadingActions{display:flex;gap:8px;flex:none;align-items:center;margin-left:auto}
.sheetHeadingActions button{width:44px;height:44px;min-width:44px;padding:8px;font-size:20px}

/* A quiet ivory sweep; Home geometry remains unchanged. */
:root{--logo-glare:rgba(255,244,216,.50);--logo-mask:url("/icons/wood/logo.svg")}
html[data-theme="green"]{--logo-glare:rgba(239,255,218,.38);--logo-mask:url("/icons/green/logo.svg")}
.homeLogo,.splashEmblem{position:relative;overflow:hidden;isolation:isolate}
.homeLogo::after,.splashEmblem::after{content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 43%,var(--logo-glare) 50%,transparent 57%);background-size:300% 100%;background-position:100% 0;mask:var(--logo-mask) center/contain no-repeat;-webkit-mask:var(--logo-mask) center/contain no-repeat;pointer-events:none;animation:logoSheen 12s linear infinite}
.homeLogo::after{animation-play-state:paused}
html[data-logo-motion="running"] .homeLogo::after{animation-play-state:running}
@keyframes logoSheen{0%{background-position:100% 0;opacity:0}2%{opacity:1}16.7%{background-position:0% 0;opacity:1}17%,100%{background-position:0% 0;opacity:0}}
#startupLogo .splashEmblem{width:180px;height:180px;border-radius:27px}
#startupLogo .splashEmblem img{width:100%;height:100%;border-radius:27px;display:block}
html[data-reduced-motion="true"] .homeLogo::after,html[data-reduced-motion="true"] .splashEmblem::after{animation:none;display:none}
@media(prefers-reduced-motion:reduce){.homeLogo::after,.splashEmblem::after{animation:none;display:none}}

/* One stable frame for every tour step; text scrolls within it on short screens. */
.helpSheet.tourMode[open]{display:flex;flex-direction:column;width:min(520px,calc(100vw - 24px));height:min(560px,85dvh);max-height:85dvh;overflow:hidden}
.helpSheet.tourMode #helpContent{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.helpSheet.tourMode .sheetHeading,.helpSheet.tourMode #helpProgress,.helpSheet.tourMode .tourPreference,.helpSheet.tourMode .helpActions,.helpSheet.tourMode #tourSaveStatus{flex:none}
.tourMark img{display:block;width:64px;height:64px;object-fit:contain;border-radius:10px;transform:none}

/* Let the app draw rounded button feedback; suppress WebView tap rectangles. */
button{-webkit-tap-highlight-color:transparent}

#lichessImport[hidden]{display:none}#lichessGameList{max-height:46dvh;overflow:auto}.importTabs button{min-width:0;padding-left:8px;padding-right:8px}

.homeWelcomeRow{display:flex;align-items:center;gap:14px;height:70px;margin-bottom:18px;padding-right:48px;box-sizing:border-box;overflow:visible}.homeWelcomeRow .homeLogo{flex:0 0 68px;margin:0}.homeMessage{--welcome-paper:#ead9ba;--welcome-border:#b17e4c;position:relative;box-sizing:border-box;min-width:0;flex:1;min-height:58px;margin:0;padding:8px 10px;border-radius:14px;background:var(--welcome-paper);border:1px solid var(--welcome-border);color:#392b20;display:flex;flex-direction:column;justify-content:center;gap:3px;text-align:left;box-shadow:0 3px 10px #0002;transform-origin:left center;pointer-events:none}.homeMessage::before{content:'';position:absolute;width:11px;height:11px;left:-7px;top:calc(50% - 6px);background:var(--welcome-paper);border-left:1px solid var(--welcome-border);border-bottom:1px solid var(--welcome-border);transform:rotate(45deg)}.homeGreeting{font-size:12px;line-height:1.2;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.homeMessageText{font-size:13px;line-height:1.25;overflow-wrap:break-word}.messageWaiting{opacity:0}.messageEntrance{animation:personalWelcome .65s cubic-bezier(.2,.75,.25,1) both}@keyframes personalWelcome{0%{opacity:0;transform:translateX(-20px) scale(.82)}70%{opacity:1;transform:translateX(1px) scale(1.025)}100%{opacity:1;transform:translateX(0) scale(1)}}html[data-theme="green"] .homeMessage{--welcome-paper:#f3f5e8;--welcome-border:#c5d2b4;color:#203325}html[data-theme="green"] .homeGreeting{color:#29412b}@media(max-width:350px){.homeWelcomeRow{gap:12px}.homeMessage{padding:6px 8px}.homeMessageText{font-size:12px}.homeGreeting{font-size:11px}}.personalSettings{margin-top:18px;padding-top:12px;border-top:1px solid #8a7059}.personalSettings p,.personalSetup p{font-size:13px;line-height:1.4}.personalSettings input[type="text"],.personalSetup input{display:block;box-sizing:border-box;width:100%;margin:8px 0;padding:10px;border-radius:10px}.personalActions{display:flex;gap:12px;justify-content:flex-end;margin-top:18px}.personalSetup{max-width:420px}.personalSetup[open]{display:block}html[data-reduced-motion="true"] .messageEntrance{animation:none}@media(prefers-reduced-motion:reduce){.messageEntrance{animation:none}}

/* Isolated online board, using the existing theme palette and pieces. */
#onlinePanel{position:fixed;inset:0;z-index:25;overflow:auto;background:var(--bg,#2b211b);color:var(--text,#e5d9ca);padding:14px 18px;display:flex;flex-direction:column;gap:8px}#onlinePanel[hidden]{display:none}#onlinePanel .playHeading{flex:none}#onlineStatus{margin:0;font-size:14px;min-height:34px}#onlineLobby{width:min(100%,520px);margin:auto;display:grid;gap:14px}#onlineLobby[hidden],#onlineGame[hidden],#onlineMatch[hidden]{display:none}#onlineLobby label{display:grid;gap:7px;margin:14px 0}#onlineLobby input,#onlineLobby select{width:100%}#onlineMatch button{margin:6px 3px}.onlineFair{font-size:13px;opacity:.85}#onlineGame{display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;gap:6px}#onlineBoard{display:grid;grid-template-columns:repeat(8,1fr);width:min(100%,calc(100dvh - 318px),560px);aspect-ratio:1;flex:none;background:#ead9ba}#onlineBoard .square{aspect-ratio:1;position:relative}#onlineBoard .piece{width:100%;height:100%;object-fit:contain}.onlinePlayer{width:min(100%,calc(100dvh - 318px),560px);display:flex;justify-content:space-between;gap:8px;font-size:14px}.onlinePlayer strong{font-variant-numeric:tabular-nums}#onlineMoves{font-size:12px;min-height:17px;text-align:center}#onlineGame .playActions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}#onlineGame button{padding:8px 11px;font-size:13px}#onlinePromotion button{margin:6px}html[data-theme="green"] #onlinePanel{background:#212320;color:#edf1e7}#playSetup #savedChoice{margin-top:14px;width:100%}

@media (orientation:landscape) and (max-height:500px){#onlinePanel{padding:8px 14px;gap:3px}#onlineStatus{min-height:20px;font-size:12px}#onlineGame{display:grid;grid-template-columns: minmax(100px,calc(100dvh - 106px)) 1fr;grid-template-rows:auto auto 1fr auto;gap:4px 14px;align-items:center}#onlineBoard{grid-column:1;grid-row:1/5;width:100%;max-height:calc(100dvh - 106px)}.onlinePlayer{grid-column:2;width:100%}#onlineMoves,#onlineGame .playActions{grid-column:2}#onlineGame .playActions{align-self:center}#onlineGame button{font-size:12px;padding:6px 8px}}

/* More board space; secondary online actions live in Game Options. */
#onlinePanel{padding:10px 12px;gap:4px}#onlineStatus{min-height:22px;margin:0;font-size:13px}#onlineGame{gap:4px}#onlineBoard{width:min(100%,calc(100dvh - 218px),620px)}.onlinePlayer{width:min(100%,calc(100dvh - 218px),620px)}#onlineBoard .piece{width:94%;height:94%;position:absolute;top:3%;left:3%}#onlineGame .playActions:has(#onlineReview){display:none}#onlineGame:has(#onlineNew:not([hidden])) .playActions:has(#onlineReview){display:flex}#onlineOptions .onlineOptionsButtons,#onlineChooserList{display:grid;gap:10px;margin-top:18px}.onlineSelect{display:flex;width:100%;justify-content:space-between;align-items:center;padding:14px;text-align:left;border:1px solid #866548;border-radius:10px;background:#493729;color:#f3eee5}.onlineSelect:after{content:'▾';margin-left:10px}.onlineChoiceOption{text-align:left;padding:14px}.onlineChoiceOption[aria-pressed="true"]{background:#e4c390;color:#392819;border:1px solid #b17e4c}html[data-theme="green"] .onlineSelect{background:#293632;border-color:#465446;color:#ccd7cf}html[data-theme="green"] .onlineChoiceOption[aria-pressed="true"]{background:#c8ec87;color:#18251e}#onlineTimeNote{margin:0;font-size:12px;line-height:1.4}
@media(orientation:landscape) and (max-height:500px){#onlineBoard{width:100%;max-height:calc(100dvh - 106px)}.onlinePlayer{width:100%}}

#playScreen>.playHeading{display:grid;grid-template-columns:1fr auto;gap:8px 14px}#playScreen #playModeTitle{grid-column:1/-1;grid-row:2;text-align:center;font-size:16px;line-height:1.2;padding-top:4px}#playScreen #playHome{grid-column:1;grid-row:1;justify-self:start}#playScreen #playFlip{grid-column:2;grid-row:1}#playScreen #playHelp{grid-column:2;grid-row:1;justify-self:end}#playScreen .playHeading:has(#playHelp){grid-template-columns:1fr auto auto}#playScreen .playHeading:has(#playHelp) #playHelp{grid-column:3}#playSetup>#setupTitle{margin-top:20px}

/* Online uses the same navigation, theme backdrop and board presentation as local play. */
#onlinePanel{padding:20px max(16px,calc((100vw - 640px)/2));gap:0;background:radial-gradient(ellipse at top right,#63472f 0,transparent 55%),linear-gradient(155deg,#2b211b,#241c17);color:#f3eee5}
html[data-theme="green"] #onlinePanel{background:radial-gradient(ellipse at top right,#294434 0,transparent 55%),linear-gradient(155deg,#19251e,#171c19);color:#f7faf4}
#onlinePanel [hidden]{display:none!important}#onlinePanel>.playHeading{display:grid;grid-template-columns:1fr auto auto;gap:8px 14px}#onlineBack{justify-self:start}#onlineHelp{grid-column:3;grid-row:1}#onlineFlip{grid-column:2;grid-row:1}#onlineGameTitle{grid-column:1/-1;grid-row:2;text-align:center;font-size:16px;line-height:1.2;padding-top:4px}
#onlineStatus{padding:12px 0;min-height:46px;font-weight:700;color:#edcba0}html[data-theme="green"] #onlineStatus{color:#bfe68f}
#onlinePanel:has(#onlineGame[hidden]) #onlineStatus{order:2;min-height:0;padding:0 0 12px;font-weight:400;font-size:13px}#onlineLobby{width:100%;margin:0;display:block}#onlineSetupTitle{margin-top:20px;margin-bottom:16px}#onlineAccount{margin:16px 0}#onlineLobby label{display:block;margin:16px 0}#onlineLobby .onlineSelect{margin:6px 0 0;padding:12px;border-radius:8px;font-size:16px;background:#493729;border-color:#8b6e56;color:white}#onlineMatch button:not(.onlineSelect){margin:6px 0}#onlineLogout{display:block}#onlineTimeNote{margin-top:16px}
#onlineGame{flex:none;gap:0;--online-board:min(100%,calc(100dvh - 300px),640px)}#onlineBoard,.onlinePlayer{width:var(--online-board)}.onlinePlayer{font-weight:700;align-items:center;min-height:34px;padding:7px 8px;font-size:14px;gap:6px}.onlinePlayer strong{flex:none;font-size:14px}.onlinePlayer .playerName{min-width:40px}.onlinePlayer .capturedPieces{flex-shrink:1;overflow:hidden}#onlineMoves{margin:10px 0;line-height:1.6;min-height:17px;color:#ddc9b4;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#onlineGame>.playActions{width:100%;gap:8px;flex-wrap:nowrap}#onlineGame button{flex:1;padding:12px 8px;font-size:16px}#onlineGame:has(#onlineNew:not([hidden]))>.playActions{margin-bottom:8px}
@media(max-width:360px){#onlineGame{--online-board:min(100%,calc(100dvh - 320px),640px)}.onlinePlayer{font-size:12px}.onlinePlayer strong{font-size:12px}#onlineGame button{font-size:14px}}
@media(orientation:landscape) and (max-height:500px){#onlinePanel{padding:8px 14px}#onlinePanel>.playHeading{gap:3px 14px}#onlineStatus{min-height:24px;padding:3px 0}#onlineGame{display:grid;grid-template-columns:minmax(100px,calc(100dvh - 128px)) 1fr;grid-template-rows:auto auto 1fr auto;gap:4px 14px}#onlineBoard{grid-column:1;grid-row:1/5;width:100%;max-height:calc(100dvh - 128px)}.onlinePlayer{grid-column:2;width:100%;flex-wrap:wrap}#onlineGame button{font-size:12px;padding:6px 8px}#onlineMoves{white-space:normal;margin:4px 0}}

/* One divider between App Information and personalization. */
.personalSettings{border-top:0;margin-top:6px;padding-top:6px}.onlinePlayer .playerName{cursor:pointer}

.onlineAccountActions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 8px}.onlineAccountActions button{flex:1 1 160px;min-height:44px;padding:12px 14px}#onlineSignupHelp{margin:8px 0 16px;line-height:1.45}

/* Persistent import selection and larger boards within each screen's budget. */
.importTabs button[aria-selected="false"]{background:#503c2d;color:#ddc9b4;box-shadow:none}
.importTabs button[aria-selected="true"]{background:#efd5aa;color:#392819;box-shadow:inset 0 0 0 2px #b17e4c}
html[data-theme="green"] .importTabs button[aria-selected="false"]{background:#293632;color:#ccd7cf}
html[data-theme="green"] .importTabs button[aria-selected="true"]{background:#c8ec87;color:#18251e;box-shadow:inset 0 0 0 2px #90b55f}
@media(orientation:portrait){
 #onlinePanel{padding-bottom:12px}
 #playHub:has(#playScreen:not([hidden])),#onlinePanel{padding-left:max(8px,calc((100vw - 640px)/2));padding-right:max(8px,calc((100vw - 640px)/2))}
 #playBoard,.playPlayer{width:min(100%,calc(100dvh - 350px - env(safe-area-inset-bottom,0px)))}
 #onlineGame{--online-board:min(100%,calc(100dvh - 280px - env(safe-area-inset-bottom,0px)),640px)}
 .boardColumn{--board-size:max(220px,min(calc(100vw - 16px),604px,calc(100dvh - 412px - env(safe-area-inset-bottom,0px))))}
 #learnScreen.lessonActive{padding-left:max(8px,calc((100vw - 620px)/2));padding-right:max(8px,calc((100vw - 620px)/2));--lesson-board:min(480px,calc(100vw - 16px),max(160px,calc(100dvh - 430px - env(safe-area-inset-bottom,0px))))}
}
@media(orientation:portrait) and (max-width:360px){#onlineGame{--online-board:min(100%,calc(100dvh - 300px - env(safe-area-inset-bottom,0px)),640px)}}
@media(orientation:portrait){#playScreen #playMessage{padding:8px 0;min-height:38px}#playScreen #playMoves{margin:6px 0}}
/* Review preparation and game-specific mistake practice. */

/* Review and practice share header, board geometry and coaching presentation. */
body>header,.mistakeReviewHeader{display:grid;grid-template-columns:88px minmax(0,1fr) 44px 64px;gap:6px;align-items:center;height:54px;padding:0 8px;background:#2b211b}
body>header .brand{display:none}body>header .headerActions{display:contents}body>header .reviewPageTitle,.mistakeReviewHeader .reviewPageTitle{grid-column:2;grid-row:1;font-size:16px;line-height:1.1;font-weight:800;min-width:0;letter-spacing:-.4px}
body>header #homeButton,.mistakeReviewHeader #mistakeHome{grid-column:1;grid-row:1;min-width:88px;min-height:48px;padding:12px 10px;font-size:16px}
body>header #flip,.mistakeReviewHeader #mistakeFlip{grid-column:3;grid-row:1;min-width:44px;min-height:44px;margin:0;padding:8px;font-size:22px;border:1px solid #80624a;border-radius:10px}
body>header #importToggle,.mistakeReviewHeader #mistakeBack{grid-column:4;grid-row:1;padding:8px;font-size:14px;min-height:40px}
.mistakeScreen{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:0;background:#30251e;color:#f3eee5;overflow:auto}.mistakeScreen[open]{display:block}.mistakeScreen:not([open]){display:none}
.mistakeColumn{min-height:0}.mistakeColumn>.mistakeEval{grid-row:1}.mistakeEval #mistakeProgress{font-size:12px;display:block;padding:3px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mistakeColumn>.mistakeCoach{grid-row:2;display:flex}
.mistakeColumn>.mistakeTopPlayer{grid-row:3}.mistakeColumn>.boardWrap{grid-row:4}.mistakeColumn>.mistakeBottomPlayer{grid-row:5}.mistakeColumn>.mistakeControls{grid-row:6}.mistakeColumn>.mistakeActions{grid-row:7}
#mistakeBoard{display:grid;grid-template-columns:repeat(8,1fr);width:100%;height:100%;position:relative;overflow:hidden}#mistakeBoard .square{padding:0;border:0;border-radius:0;min-width:0;min-height:0;cursor:pointer}#mistakeBoard .square:disabled{opacity:1;cursor:default}#mistakeBoard .piece{position:absolute;width:94%;height:94%;top:3%;left:3%}
.mistakeControls #mistakePrev,.mistakeControls #mistakeNext{width:60px;min-width:60px;height:56px;min-height:56px;font-size:25px;border-radius:12px;background:#594330;color:#ddc9b4;padding:7px 12px}.mistakeControls #mistakePosition{flex:1;text-align:center;font-size:15px;font-weight:700}.mistakeBottomPlayer #mistakeArrowNote{min-width:0;font-size:11px;text-align:right;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.mistakeTopPlayer #mistakeCount{margin-left:auto;font-size:13px}.mistakeActions button{font-size:14px}.mistakeScreen #mistakePromotion button{margin:5px}
.reviewToolbar #mobileNext{background:#efd5aa;color:#161616;font-size:14px;font-weight:700;box-shadow:none;border-radius:8px;flex:1}
html[data-theme="green"] .mistakeScreen{background:#30322e;color:#f7faf4}html[data-theme="green"] .mistakeReviewHeader{background:#212320}html[data-theme="green"] .mistakeReviewHeader #mistakeFlip{border-color:#556348}html[data-theme="green"] .reviewToolbar #mobileNext{background:#b2d980;color:#161616;box-shadow:none}
@media(orientation:portrait) and (max-height:600px){.boardColumn{min-height:0;--board-size:max(160px,min(calc(100vw - 16px),604px,calc(100dvh - 412px - env(safe-area-inset-bottom,0px))))}}
.boardColumn .compactCoach .coachBubble{height:100%;display:flex;flex-direction:column;overflow:hidden}.boardColumn .compactCoach .bubbleHeading,.boardColumn .compactCoach .bubbleFooter{flex:none}.boardColumn :is(#coachBrief,#mistakeNotes){flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
#coachReview{color:#161616}html[data-theme="green"] #boardWorkspace .reviewToolbar #mobileNext{background:#c8ec87;color:#161616;box-shadow:none}
.computerSections{display:flex;gap:8px;margin:16px 0}.computerSections button{flex:1;min-height:44px}.computerSections button[aria-pressed="true"]{background:#efd5aa!important;color:#161616!important}.botCards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.botCards button{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:12px;border:1px solid #80624a;background:#493729;font-size:20px;min-height:96px}.botCards strong{font-size:14px}.botCards span{font-size:12px;font-weight:400}.botCards button[aria-pressed="true"]{background:#efd5aa;color:#161616!important}.botCards button[aria-pressed="true"] strong,.botCards button[aria-pressed="true"] span{color:#161616}#botSurprise{width:100%;margin:8px 0;min-height:44px}#botDescription{font-size:13px;line-height:1.4}#botSelection[hidden]{display:none!important}
#playScreen #playMessage.botMessage{height:46px;min-height:46px;box-sizing:border-box;margin:0;padding:6px 8px;display:flex;gap:8px;align-items:center;background:#fff;color:#30332e;border-radius:12px;font-weight:500;line-height:1.3}#playMessage .botAvatar{font-size:22px;flex:none}#playMessage .botLine{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html[data-theme="green"] .computerSections button[aria-pressed="true"],html[data-theme="green"] .botCards button[aria-pressed="true"]{background:#c8ec87!important;color:#161616!important}html[data-theme="green"] .botCards button{background:#293632;border-color:#526a45;color:#f7faf4}
.boardColumn{min-height:0}.reviewToolbar #mobileNext{font-size:13px}
@media(orientation:landscape) and (max-height:560px){
 .boardColumn{--board-size:min(42vw,calc(100dvh - 128px - env(safe-area-inset-bottom,0px)));display:grid;grid-template-columns:var(--board-size) minmax(0,1fr);grid-template-rows:22px 26px minmax(0,1fr) 68px 64px;gap:0 12px;width:min(100%,740px);max-width:740px;min-height:0}
 .boardColumn>.eval{grid-column:1/-1;grid-row:1}.boardColumn>.compactCoach{grid-column:2;grid-row:2/4;align-self:stretch;min-height:0}.boardColumn>.player:nth-child(3){grid-column:1;grid-row:2;align-self:start}.boardColumn>.boardWrap{grid-column:1;grid-row:2/-1;align-self:center}.boardColumn>.player:nth-child(5){grid-column:1;grid-row:5;align-self:end}.boardColumn>.boardControls{grid-column:2;grid-row:4}.boardColumn>.reviewToolbar{grid-column:2;grid-row:5}.boardColumn>.player{padding-left:5px;padding-right:5px;font-size:12px}.boardColumn>.player .capturedPieces{display:none}.boardColumn .reviewToolbar{padding:6px 8px;gap:3px}.boardColumn .reviewToolbar button{font-size:12px;padding:4px}.boardColumn .reviewToolbar #mobileNext{font-size:13px}
}
body>header #homeButton,.mistakeReviewHeader #mistakeHome{height:48px;white-space:nowrap}
@media(orientation:portrait){#playScreen #playMessage.botMessage{height:38px;min-height:38px;padding:4px 8px}#playMessage .botLine{line-height:1.15}}
body>header .headerActions #flip,.mistakeReviewHeader #mistakeFlip{width:44px;min-width:44px;margin:0}

#playScreen #playMessage.botMessage{background:#fffaf1;color:#273446}html[data-theme="green"] #playScreen #playMessage.botMessage{background:#fff;color:#30332e}

/* Computer setup uses exclusive tabs and the saved profile name. */
#playHub.computerSetupActive{padding:0;overflow:hidden}
#playSetup.computerSetup{display:flex;flex-direction:column;gap:8px;margin:auto;width:min(100%,620px);height:100dvh;padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));box-sizing:border-box;overflow:auto}
.computerSetup #setupBack{align-self:flex-start;min-height:40px;padding:8px 12px}
.computerSetup #setupTitle{margin:0;font-size:24px;line-height:1.2}
.computerSetup #computerOptions{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0}
.computerSetup .computerSections{margin:0;flex:none}
.computerSetup .computerSections button{margin:0;min-height:40px;padding:8px;font-size:14px}
.computerSetup #computerOptions>label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;flex:none}
.computerSetup #playSide{width:140px;margin:0;padding:7px}
.computerSetup #classicLevels{flex:1;min-height:0}.computerSetup #classicLevels label{margin:0}.computerSetup #classicLevels p{font-size:13px}
.computerSetup #botSelection{display:flex;flex-direction:column;gap:6px;flex:1;min-height:0}
.computerSetup #botDescription{margin:0;font-size:12px;line-height:1.3;flex:none}
.computerSetup .botCards{flex:1;min-height:0;grid-template-columns:1fr 1fr;grid-template-rows:repeat(3,minmax(0,1fr));gap:6px;margin:0}
.computerSetup .botCards button{min-height:0;padding:6px;gap:2px;font-size:18px;overflow:hidden;justify-content:center}
.computerSetup .botCards strong{font-size:13px}.computerSetup .botCards span{font-size:11px}
.computerSetup #botSurprise{margin:0;min-height:34px;padding:6px;font-size:13px;flex:none}
.computerSetup #startPlay,.computerSetup #savedChoice{margin:0;min-height:42px;padding:8px;font-size:15px;flex:none}
.computerSetup #savedChoice{min-height:34px;font-size:13px}
.computerSetup #classicLevels[hidden],.computerSetup #botSelection[hidden],.computerSetup #playWhiteLabel,.computerSetup #playBlackLabel{display:none!important}
.mistakeDetails .coachBubble{max-height:none;overflow:visible}.mistakeDetails .coachBubble h3{margin:16px 0 6px;font-size:16px;color:inherit}.mistakeDetails .coachBubble h3:first-child{margin-top:0}.mistakeDetails .coachBubble p{margin:0;line-height:1.5;font-size:15px;color:inherit}
@media(max-height:500px) and (min-width:600px){.computerSetup .botCards{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.computerSetup #botDescription{display:none}.computerSetup #setupTitle{font-size:18px}.computerSetup #setupBack{min-height:32px;padding:4px 10px}#playSetup.computerSetup{gap:5px;padding:8px 12px}.computerSetup #computerOptions{gap:5px}.computerSetup #startPlay,.computerSetup #savedChoice{min-height:32px;padding:5px}}

.computerSetup .botCards button{display:grid;grid-template-columns:24px minmax(0,1fr);grid-template-rows:auto auto;column-gap:5px;row-gap:2px;align-content:center;text-align:left}.computerSetup .botCards .botChoiceIcon{grid-column:1;grid-row:1/3;font-size:22px;align-self:center}.computerSetup .botCards strong,.computerSetup .botCards span:not(.botChoiceIcon){grid-column:2;min-width:0}.computerSetup .botCards strong{line-height:1.1}.computerSetup #setupBack{margin:0}
.computerSetup .botCards button{padding:3px 6px;row-gap:1px}.computerSetup .botCards strong{line-height:1.05}
#playSetup.computerSetup>#setupTitle{margin-top:0}.computerSetup #savedChoice{min-height:30px}.computerSetup #botSurprise{min-height:32px}
@media(max-height:500px) and (min-width:600px){.computerSetup #savedChoice{min-height:26px}.computerSetup #botSurprise{min-height:28px}}

/* Coaching v25: reserve reading space; content must never move the board. */
.boardColumn .compactCoach .coachBubble{padding:10px 12px}
.boardColumn .compactCoach .bubbleHeading{display:flex;align-items:center;gap:7px;min-height:24px;flex:none}
.boardColumn .compactCoach .bubbleHeading h3{font-size:15px;line-height:1.2;margin:0;min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.boardColumn .compactCoach .badge{font-size:11px;line-height:1.2;padding:4px 6px;white-space:nowrap;flex:none}
.boardColumn .compactCoach :is(#coachBrief,#mistakeNotes){font-size:15px;line-height:1.38;margin:7px 0;overflow:auto}
.boardColumn .compactCoach .bubbleFooter{display:flex;align-items:center;gap:6px;min-height:24px;flex:none;flex-wrap:nowrap}
.boardColumn #compactOpening{display:none}
.boardColumn .compactCoach .bubbleFooter button{font-size:11px;padding:4px 8px;min-height:24px;white-space:nowrap}
.boardColumn #compactStatus{font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
@media(orientation:landscape) and (max-height:600px){.boardColumn .compactCoach .coachBubble{padding:8px 10px}.boardColumn .compactCoach .bubbleHeading h3{font-size:14px}}

/* Keep the compact coach useful without reserving a second board-sized panel. */
.boardColumn .compactCoach .bubbleFooter:has(.expandCoach[hidden]):not(:has(#coachReview:not([hidden]))):not(:has(#compactStatus:not(:empty))){display:none}
.boardColumn .compactCoach .bubbleFooter{min-height:20px}
.boardColumn .compactCoach :is(#coachBrief,#mistakeNotes){margin:5px 0 0}

/* Compact account ratings; expands inside the lobby, never over the live board. */
#onlineRatings{background:#382b20;border:1px solid #80664b;border-radius:16px;padding:14px;margin:12px 0 18px;color:#f4e8d6}#onlineRatings[hidden]{display:none}#onlineRatings>strong{font-size:15px}.onlineRatingGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}.onlineRatingCard{min-width:0;display:flex;flex-direction:column;gap:5px;padding:10px 6px;background:#ffffff08;border-radius:10px;text-align:center}.onlineRatingCard span{font-size:12px;line-height:1.3;overflow-wrap:anywhere;color:#dac7ad}.onlineRatingCard strong{font-size:20px;font-variant-numeric:tabular-nums;line-height:1.25;color:inherit}#onlineRatings summary{min-height:36px;padding:9px 0;cursor:pointer;font-size:14px;color:#ecd3a3}#onlineRatings small{display:block;font-size:12px;line-height:1.4;color:#d4c3ad}html[data-theme="green"] #onlineRatings{background:#20362d;border-color:#536f52;color:#edf3df}html[data-theme="green"] #onlineRatings summary{color:#c8ec87}html[data-theme="green"] .onlineRatingCard span,html[data-theme="green"] #onlineRatings small{color:#c8d4c0}@media(min-width:700px){#onlineRatings details .onlineRatingGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Fitted online setup: secondary content opens in sheets, not inline. */
#onlinePanel:has(#onlineGame[hidden]){overflow:hidden;padding-top:10px;padding-bottom:10px}#onlinePanel:has(#onlineGame[hidden])>.playHeading{flex:none;min-height:40px}#onlineLobby{min-height:0;flex:1;align-content:start}#onlineSetupTitle{font-size:28px;line-height:1.15;margin:10px 0 6px}#onlineAccount{font-size:14px;margin:6px 0}#onlinePanel:has(#onlineGame[hidden]) #onlineStatus{font-size:12px;line-height:1.25;padding:0;margin:4px 0;overflow-wrap:anywhere}#onlineRatings{display:flex;align-items:center;gap:8px;padding:7px 9px;margin:8px 0;border-radius:12px}#onlineRatings>.onlineRatingGrid{flex:1;margin:0;gap:4px}#onlineRatings .onlineRatingCard{padding:4px 2px;gap:2px;background:transparent}#onlineRatings .onlineRatingCard strong{font-size:18px}#onlineRatings .onlineRatingCard span{font-size:12px}#onlineRatings .onlineAllRatingsButton{flex:none;font-size:12px;min-height:36px;padding:6px 9px}#onlineAllRatings .onlineRatingGrid{grid-template-columns:repeat(3,minmax(0,1fr))}#onlineAllRatings small{font-size:12px}#onlineAllRatings .onlineRatingCard span{color:inherit;opacity:.85}.onlineSetupFields{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:9px}#onlineLobby .onlineSetupFields label{margin:4px 0;font-size:13px}#onlineLobby .onlineSelect{font-size:14px;margin:4px 0 0;padding:10px 8px;min-height:42px;width:100%}#onlineMatch .onlineMatchActions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:7px 0}#onlineMatch .onlineMatchActions button{margin:0!important;padding:9px 8px;min-height:40px;font-size:13px}#onlineSeek{grid-column:1/-1}#onlineAccountMore{padding:7px 10px;min-height:34px;font-size:12px;margin:3px 0}#onlineTimeNote{font-size:12px;line-height:1.3;margin:5px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.onlineFairBrief{font-size:12px;margin:5px 0}#onlineAccountActions{margin:8px 0}#onlineSignupHelp{margin:6px 0;font-size:12px;line-height:1.3}#onlineBrowserSession .onlineMatchActions{display:grid;grid-template-columns:1fr 1fr;gap:6px}#onlineBrowserSession button{font-size:13px;min-height:38px;padding:8px}
@media(orientation:landscape) and (max-height:540px){#onlineLobby{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px 18px;align-content:start}#onlineSetupTitle,#onlineAccount,#onlineStatus,#onlineRatings,#onlineAccountMore{grid-column:1}#onlineSetupTitle{font-size:24px;margin:4px 0}#onlineRatings{margin:3px 0}#onlineMatch,#onlineBrowserSession{grid-column:2;grid-row:1/7}#onlineTimeNote,.onlineFairBrief{grid-column:1;margin:2px 0}#onlineTimeNote{-webkit-line-clamp:2}#onlineMatch .onlineMatchActions{margin:4px 0}#onlinePanel:has(#onlineGame[hidden])>.playHeading{min-height:34px}#onlinePanel:has(#onlineGame[hidden])>.playHeading button{min-height:32px;padding:5px 10px}}
@media(orientation:portrait) and (max-height:540px){#onlinePanel:has(#onlineGame[hidden]){padding-top:6px;padding-bottom:6px}#onlineSetupTitle{font-size:24px;margin:5px 0 3px}#onlineAccount{margin:3px 0}#onlineRatings{margin:5px 0;padding:5px 7px}#onlinePanel:has(#onlineGame[hidden]) #onlineStatus{margin:2px 0}#onlineLobby .onlineSetupFields label{margin:2px 0}#onlineLobby .onlineSelect{min-height:38px;padding:7px 6px;font-size:13px}#onlineMatch .onlineMatchActions{margin:4px 0;gap:4px}#onlineMatch .onlineMatchActions button{min-height:36px;padding:6px}#onlineAccountMore{margin:0;min-height:30px;padding:5px 8px}#onlineTimeNote{-webkit-line-clamp:2;margin:3px 0}.onlineFairBrief{display:none}}

/* 3.66: balanced secondary actions, shared sizing in both themes. */
.onlineUtilityActions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;margin:6px 0}
#onlineLobby .onlineUtilityActions button{width:100%;min-height:40px;margin:0;padding:8px;font-size:13px;white-space:normal}
@media(orientation:landscape) and (max-height:540px){.onlineUtilityActions{grid-column:2;margin:2px 0}#onlineMatch{grid-row:1/5!important}}
#onlineLobby .onlineUtilityActions>button{grid-column:auto;align-self:stretch}
#onlineLobby .onlineSetupFields label{display:flex;flex-direction:column}
#onlineLobby .onlineSetupFields .onlineSelect{flex:1}
@media(orientation:landscape) and (max-height:540px){.onlineUtilityActions{grid-row:5}#onlineLobby .onlineUtilityActions>button{min-height:36px;padding:6px}}

/* Keep the searching action aligned with the full-width primary action. */
#onlineMatch .onlineMatchActions #onlineCancel{grid-column:1/-1}
#onlineRatings .onlineAllRatingsButton{min-height:44px}
#overviewPick{min-height:44px}
/* Effective touch areas, without changing the Home logo or the board geometry. */
#onlineRatings .onlineAllRatingsButton,#overviewPick{min-height:48px}
#settingsPanel button,#settingsPanel select{min-height:48px}
/* Settings: keep tap targets on controls/rows, not standalone field labels.
   Giving every label a 48px minimum caused the gaps and low checkboxes. */
#settingsPanel{scroll-padding:20px;--settings-field-bg:#241c17;--settings-line:#80624a}
html[data-theme="green"] #settingsPanel{--settings-field-bg:#203025;--settings-line:#78955c}
#settingsPanel .sheetHeading{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--settings-line)}
#settingsPanel .appSettings{border-top:0;margin-top:0;padding:0}
#settingsPanel .settingsGroup{padding:20px 0;margin:0;border-color:var(--settings-line)}
#settingsPanel .settingsGroup:first-child{padding-top:8px}
#settingsPanel .settingsGroup h3{font-size:18px;line-height:1.3;margin:0 0 14px;color:var(--prism-body)}
#settingsPanel h4{font-size:16px;line-height:1.3;margin:20px 0 10px;color:var(--prism-body)}
#settingsPanel label{min-height:0;min-width:0;font-size:15px;line-height:1.4;margin:14px 0 6px;color:var(--prism-body)}
#settingsPanel .settingRow{display:flex;flex-wrap:nowrap;align-items:center;gap:12px;min-height:48px;margin:6px 0;font-size:15px}
#settingsPanel .settingRow>label{display:flex;align-items:center;align-self:stretch;flex:1 1 auto;margin:0;min-width:0;padding:8px 0}
#settingsPanel input[type="checkbox"]{flex:0 0 24px;width:24px;height:24px;margin:0;accent-color:#efd5aa}
html[data-theme="green"] #settingsPanel input[type="checkbox"]{accent-color:#c8ec87}
#settingsPanel .settingRow:has(>select){display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:14px 0}
#settingsPanel .settingRow:has(>select)>label{padding:0}
#settingsPanel select,#settingsPanel input:not([type="checkbox"]):not([type="range"]):not([type="file"]){display:block;box-sizing:border-box;max-width:100%;width:100%;min-width:0;min-height:48px;margin:0;padding:11px 12px;border:1px solid var(--settings-line);border-radius:10px;background:var(--settings-field-bg);color:var(--prism-body);font:inherit;font-size:16px}
#settingsPanel input[type="range"]{display:block;width:100%;min-width:0;height:36px;margin:0;accent-color:#efd5aa}
html[data-theme="green"] #settingsPanel input[type="range"]{accent-color:#c8ec87}
#settingsPanel small{display:block;font-size:13px;line-height:1.4;color:var(--prism-secondary);margin:2px 0 10px}
#settingsPanel p{font-size:14px;line-height:1.5;color:var(--prism-secondary);margin:10px 0 14px;overflow-wrap:anywhere}
#settingsPanel p:empty{display:none}
#settingsPanel .playActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px 0 0}
#settingsPanel .playActions button{min-width:0;min-height:48px;line-height:1.3;padding:10px;font-size:14px;overflow-wrap:anywhere}
#settingsPanel #backgroundNotifications,#settingsPanel #deviceVoiceSettings{width:100%;margin:0 0 4px;font-size:14px}
#settingsPanel .personalSettings{margin-top:0;padding-top:20px;border-color:var(--settings-line)}
#settingsPanel .personalSettings label:has(>input[type="checkbox"]){display:flex;align-items:center;gap:12px;min-height:48px}
#settingsPanel .personalSettings label>input[type="checkbox"]{order:1;margin-left:auto}
#settingsPanel input:focus-visible{outline:3px solid var(--prism-control-border);outline-offset:2px}
#settingsPanel [hidden]{display:none!important}

/* 3.71: friend challenges share the existing Online Play surfaces and palette. */
.friendTabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:3px;border:1px solid var(--prism-control-border);border-radius:12px;margin:5px 0 10px}
#onlineLobby .friendTabs button{min-height:40px;margin:0;padding:8px;font-size:14px;background:transparent;color:var(--prism-body)}
#onlineLobby .friendTabs button[aria-pressed="true"]{background:var(--prism-control-bg);color:var(--prism-control-text)}
#friendForm[hidden],#friendPending[hidden],#friendBanner[hidden]{display:none!important}
#friendForm .friendHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0 10px;color:var(--prism-body)}
#friendForm .friendHeading strong{font-size:18px}#friendRecent{font-size:12px;padding:6px 8px;min-height:36px}
#friendForm label{display:block;font-size:13px;line-height:1.3;margin:7px 0 4px;color:var(--prism-secondary)}
#friendForm input,#friendForm select{display:block;width:100%;max-width:100%;min-width:0;min-height:44px;border:1px solid var(--prism-control-border);border-radius:9px;background:var(--prism-panel);color:var(--prism-body);padding:9px 10px;font:inherit;font-size:15px;margin-top:4px}
.friendFields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#friendSend,#friendEnable{width:100%;min-height:44px;margin:10px 0 0;background:var(--prism-control-bg);color:var(--prism-control-text);border:1px solid var(--prism-control-border)}
#friendStatus{font-size:12px;line-height:1.35;margin:7px 0;color:var(--prism-secondary)}
#friendIncoming{width:100%;min-height:40px;padding:8px;font-size:13px;margin:5px 0}
.friendPending{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}.friendPending span{flex:1 1 100%;font-size:12px;color:var(--prism-secondary)}.friendPending button{flex:1;min-height:40px;font-size:13px}
.friendRow{display:flex;flex-wrap:wrap;gap:8px;padding:14px 0;border-bottom:1px solid var(--prism-control-border);color:var(--prism-body)}.friendRow strong{flex:1 1 100%;font-size:15px;overflow-wrap:anywhere}.friendRow button{min-height:44px;flex:1;font-size:14px}.friendSheet p{font-size:14px;line-height:1.5;color:var(--prism-secondary)}
#friendBanner{position:fixed;z-index:110;left:12px;right:12px;top:max(10px,env(safe-area-inset-top));max-width:620px;margin:auto;display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid var(--prism-control-border);background:var(--prism-panel);color:var(--prism-body);box-shadow:0 6px 24px #0007}#friendBanner span{flex:1;min-width:0;font-size:14px;line-height:1.3;overflow-wrap:anywhere}#friendBanner button{min-height:44px;padding:8px 10px;font-size:14px}
@media(orientation:landscape) and (max-height:540px){#onlineMatch:has(#friendForm:not([hidden])){grid-row:1/8!important;overflow:auto;max-height:calc(100dvh - 65px)}#friendIncoming{grid-column:1}.friendHeading{margin-bottom:3px!important}#friendForm label{margin-top:3px}#friendForm input,#friendForm select{min-height:38px;padding:6px 8px}.friendTabs{margin-bottom:5px}}
@media(orientation:portrait) and (max-height:700px){#onlinePanel:has(#friendForm:not([hidden])) #onlineTimeNote{display:none}#onlinePanel:has(#friendForm:not([hidden])) #onlineSetupTitle{font-size:24px;margin:4px 0}#onlinePanel:has(#friendForm:not([hidden])) #onlineRatings{margin:4px 0;padding:3px 7px}#friendForm .friendHeading strong{font-size:16px}#friendForm .friendHeading{margin:3px 0}#friendForm label{margin-top:4px}.friendTabs{margin:3px 0 5px}#friendStatus{margin:4px 0}}
#onlinePanel:has(#friendForm:not([hidden])) #onlineTimeNote{display:none}
#friendForm.friendWaiting>:is(label,input,select,.friendFields,#friendSend,#friendEnable){display:none!important}
@media(max-height:700px){#friendForm{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(80px,1fr);column-gap:8px;align-items:start}#friendForm>.friendHeading{grid-column:1/-1;grid-row:1}#friendForm>label[for="friendUsername"]{grid-row:2;grid-column:1}#friendForm>#friendUsername{grid-row:3;grid-column:1}#friendForm>label[for="friendColor"]{grid-row:2;grid-column:2}#friendForm>#friendColor{grid-row:3;grid-column:2}#friendForm>.friendFields{grid-row:4;grid-column:1/-1}#friendForm>:is(#friendSend,#friendEnable){grid-row:5;grid-column:1/-1;margin-top:6px}#friendForm>:is(#friendStatus,#friendPending){grid-column:1/-1}#friendForm input,#friendForm select{min-height:40px;font-size:14px;padding:7px 8px}}
@media(orientation:landscape) and (max-height:540px){#friendForm #friendStatus{font-size:11px;line-height:1.2;margin:2px 0}#onlinePanel:has(#friendForm:not([hidden])) .onlineUtilityActions{grid-column:1;grid-row:6}#friendForm>.friendHeading{margin-top:0!important}#friendForm .friendFields label{margin-top:2px}}

/* Compact, theme-aware external resources; no embeds or background requests. */
.helpSocialLinks{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0;--social-icon-cutout:var(--help-ink)}
.helpSocialLink{display:flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;min-height:46px;padding:10px 14px;border:1px solid var(--help-border);border-radius:14px;text-decoration:none;font:inherit;font-weight:700;line-height:1.3;color:inherit;background:transparent;flex:1 1 190px;max-width:100%}
.helpSocialLink.youtube{background:var(--help-accent);color:var(--help-ink)}
.helpSocialLink.youtube svg{--social-icon-cutout:var(--help-accent)}
.helpSocialLink svg{width:24px;height:24px;flex:none}
.helpSocialLink:focus-visible{outline:3px solid var(--help-accent);outline-offset:3px}
.helpSocialLink:active{opacity:.85}
.helpCommunity{border-bottom:1px solid var(--help-border);padding-bottom:6px}
.helpCommunity h2{font-size:18px}
@media(max-width:380px){.helpSocialLinks{gap:8px}.helpSocialLink{padding:10px;font-size:14px}}

/* Organized Openings & Defences Repertoire & Learning Hub */
.lessonTabBar{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.categoryTab{flex:1 1 auto;min-height:38px;padding:7px 12px;border-radius:10px;background:#382b22;color:#ddc9b4;border:1px solid #6e533d;font-size:13px;font-weight:700;cursor:pointer}
.categoryTab.active{background:#e4c390;color:#2b211b;border-color:#efd5aa}
.openingFilterRow{display:flex;flex-direction:column;gap:6px;margin:6px 0 12px;padding:10px;border-radius:12px;background:#35281f;border:1px solid #6e533d}
.filterGroup{display:flex;flex-wrap:wrap;gap:6px}
.filterChip{padding:6px 10px;min-height:34px;border-radius:8px;background:#493729;color:#f3eee5;border:1px solid #7a5c44;font-size:12px;font-weight:600;cursor:pointer}
.filterChip.active{background:#c69a61;color:#241508;border-color:#efd5aa;font-weight:700}
.familyPanel{margin:-8px 0 14px;padding:12px 14px;border-radius:0 0 14px 14px;background:#382b22;border:1px solid #866548;border-top:0}
.familyMetaRow{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:8px}
.ecoPill,.movesPill,.sidePill,.masteryPill{display:inline-flex;align-items:center;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:700}
.ecoPill{background:#e4c390;color:#2b211b}
.movesPill{background:#2b211b;color:#efd5aa;border:1px solid #6e533d;font-family:monospace}
.sidePill{background:#493729;color:#f3eee5}
.masteryPill{margin-left:auto;background:#2b211b;color:#ddc9b4;border:1px solid #6e533d}
.familyPlanText{margin:6px 0 10px;font-size:13px;line-height:1.45;color:#ddc9b4}
.familyQuickSides{display:flex;gap:8px;margin-bottom:10px}
.sideLaunchBtn{flex:1;min-height:36px;padding:6px 10px;border-radius:8px;background:#493729;color:#efd5aa;border:1px solid #866548;font-size:12px;font-weight:700;cursor:pointer}
.variationGrid,.ecoSubGrid{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.variationChip{padding:7px 10px;min-height:34px;border-radius:8px;background:#4d3a2b;color:#f3eee5;border:1px solid #7c5e46;font-size:12px;text-align:left;cursor:pointer}
.variationChip.completed{border-color:#e4c390;background:#594330;color:#efd5aa}
.variationChip.ecoChip{background:#2e231c;border-color:#684f3a;font-size:11.5px}
.ecoDrawerToggle{width:100%;margin-top:8px;padding:7px 10px;min-height:34px;border-radius:8px;background:#2b211b;color:#ddc9b4;border:1px dashed #7a5c44;font-size:12px;font-weight:600;text-align:left;cursor:pointer}
.ecoCatalogGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px;margin:10px 0}
.ecoLineCard{display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:10px 12px;border-radius:10px;background:#382b22;border:1px solid #7a5c44}
.ecoLineMeta{display:flex;flex-direction:column;gap:4px}
.ecoLineMeta strong{font-size:13px;color:#f3eee5}
.ecoLineMeta small{font-size:11px;color:#ddc9b4;font-family:monospace}
.ecoLineActions{display:flex;gap:6px}
.ecoLineActions .variationChip{flex:1;text-align:center}
.lessonHeading #lessonVariationSelect{max-width:136px;padding:5px 6px;border-radius:8px;background:#382b22;color:#f3eee5;border:1px solid #777;font-size:12px;flex:0 1 136px;min-width:0;text-overflow:ellipsis}
.lessonCoach .ecoBadge{margin-left:auto;padding:2px 6px;border-radius:6px;background:#e4c390;color:#2b211b;font-size:11px;font-weight:700;white-space:nowrap}
.bookBranches{display:inline-flex;gap:4px;margin-left:auto;max-width:62%;overflow:hidden}
.branchPill{padding:2px 6px;min-height:22px;border-radius:6px;background:#594330;color:#fffaf1;border:1px solid #866548;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.lessonVoiceRow #lessonDrillToggle{min-height:36px;font-size:12px;padding:7px 10px;flex:none}

/* 3.76-Exp Smart Coach Banner, Repertoire Star, Plan & Spar Controls */
.smartCoachBanner{display:flex;flex-direction:column;gap:8px;margin:8px 0 14px;padding:12px 14px;border-radius:12px;background:linear-gradient(135deg,#493729,#35281f);border:1px solid #b17e4c}
.smartBannerRow{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;font-size:12.5px;line-height:1.4;color:#f3eee5}
.smartBannerRow span{flex:1 1 200px}
.smartBannerRow .sideLaunchBtn{flex:0 0 auto;background:#e4c390;color:#2b211b;border-color:#efd5aa}
.lessonHeading .starBtn{min-width:32px;height:32px;padding:2px 6px;border-radius:8px;font-size:16px;line-height:1;flex:none}
.lessonHeading .starBtn.starred{color:#ffd66b;border-color:#e4c390}
.lessonVoiceRow button{min-height:34px;font-size:11.5px;padding:6px 8px;flex:none}
.lessonActive .playActions #lessonPrevStep{flex:0 0 38px;padding:8px 4px}

/* 3.76 Mobile Header Declutter & Segmented Controls */
.lessonWorkspaceHeader{display:flex;flex-direction:column;gap:6px;width:100%;min-width:0}
.lessonTitleBand{display:flex;align-items:center;gap:8px;width:100%;min-width:0}
.titleTextWrap{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.titleTextWrap #lessonTitle{font-size:15px;line-height:1.2;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lessonSubTitle{font-size:11.5px;color:#ddc9b4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lessonControlsBand{display:flex;align-items:center;gap:6px;width:100%;overflow-x:auto;padding-bottom:2px}
.segmentedControl{display:inline-flex;border-radius:8px;background:#241912;border:1px solid #6e533d;overflow:hidden;flex:none}
.segBtn{padding:4px 9px;min-height:30px;font-size:11.5px;font-weight:700;color:#ddc9b4;background:transparent;border:0;cursor:pointer;white-space:nowrap}
.segBtn.active{background:#e4c390;color:#241508}
.lessonControlsBand #lessonVariationSelect{max-width:140px;padding:4px 6px;border-radius:8px;background:#382b22;color:#f3eee5;border:1px solid #777;font-size:11px;flex:1 1 auto;min-width:100px;text-overflow:ellipsis}

/* My Games Hub Card Styles */
.myGamesTopActions{margin:4px 0 12px}
.myGamesTopActions button{width:100%;min-height:42px;font-size:13.5px}
.emptyGamesCard{padding:16px;border-radius:12px;background:#35281f;border:1px dashed #7a5c44;margin:8px 0;text-align:center}
.gameDevCard{border-left:4px solid #e4c390}
.gameDevDiagnostic{font-size:12px;color:#ddc9b4;margin:6px 0 2px;line-height:1.4}
.gameDevDiagnostic .devAlert{color:#ffd66b;font-weight:700}

.learnNavGroup{display:flex;align-items:center;gap:6px}
.learnNavGroup button{padding:8px 11px;font-size:13px;min-height:36px;margin:0}
.lessonCoach .bubbleFooter{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:4px}
.lessonCoach #lessonExpandCoach{margin-left:auto;padding:3px 9px;min-height:24px;font-size:11px;font-weight:700;border-radius:6px;background:#efd5aa;color:#231b14;border:1px solid #80624a;cursor:pointer}
.lessonActive .lessonCoach.coachOverlayOpen{position:relative;z-index:45;overflow:visible!important}
.lessonActive .lessonCoach.coachOverlayOpen .coachBubble{position:absolute;top:0;left:0;right:0;height:auto!important;min-height:110px;max-height:250px!important;z-index:45;box-shadow:0 14px 32px rgba(0,0,0,0.55);border:1px solid #80624a;overflow:hidden}
.lessonActive .lessonCoach.coachOverlayOpen #lessonNotes{max-height:180px;overflow-y:auto!important;white-space:normal}

/* 3.80 Multi-Screen Responsive Layout, Single-Row Header Grid, Coach Bubble & Progress Bar */
@media(orientation:portrait) and (min-height:601px){
  #learnScreen.lessonActive{--lesson-board:min(460px,calc(100vw - 16px),max(160px,calc(100dvh - 438px - env(safe-area-inset-bottom,0px))))}
  .lessonActive #lessonWorkspace{grid-template-rows:36px minmax(98px,128px) 34px var(--lesson-board) minmax(36px,52px) 38px 42px;align-content:space-between;gap:5px}
}
@media(orientation:portrait) and (max-height:600px){
  .lessonActive #lessonWorkspace{grid-template-rows:32px minmax(92px,1fr) 30px var(--lesson-board) 30px 34px 38px;gap:4px}
}
@media(max-width:380px){
  .segBtn{padding:4px 7px;font-size:11px;min-height:28px}
  .lessonControlsBand #lessonVariationSelect{max-width:112px;min-width:82px;font-size:10.5px}
  .learnNavGroup{gap:4px}
  .learnNavGroup button,.playHeading #playHome{padding:6px 8px;font-size:12px;min-height:34px}
}
#playScreen .learnNavGroup,#onlinePanel .learnNavGroup{grid-column:1;grid-row:1;justify-self:start;flex:none}
.playHeading #playHome{min-width:0;padding:8px 11px;min-height:38px;font-size:13.5px}
.lessonActive .lessonCoach .coachBubble{padding:8px 12px!important;display:flex;flex-direction:column;justify-content:space-between}
.lessonActive .lessonCoach .bubbleHeading{display:flex;align-items:center;gap:6px;min-height:22px;flex-wrap:nowrap}
.lessonActive .lessonCoach .bubbleHeading strong{font-size:13.5px!important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.lessonActive .lessonCoach #lessonEcoBadge{margin-left:0;flex:none}
.lessonCoach #lessonExpandCoach{margin-left:4px;padding:2px 8px;min-height:22px;font-size:11px;font-weight:700;border-radius:6px;background:#efd5aa;color:#231b14;border:1px solid #80624a;cursor:pointer;flex:none}
.lessonActive .lessonCoach #lessonNotes{margin:4px 0 3px!important;font-size:13.5px!important;line-height:1.34!important;min-height:52px!important;flex:1 1 auto;overflow-y:auto}
.lessonActive .lessonCoach .bubbleFooter{display:flex!important;flex-wrap:nowrap!important;align-items:center;justify-content:space-between;gap:6px;min-height:18px!important;max-height:20px!important;margin-top:2px!important;overflow:hidden}
.lessonActive .lessonCoach #lessonProgress{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.lessonActive .lessonCoach .bookBranches{display:flex;gap:4px;flex-wrap:nowrap;flex:none}
.lessonActive .lessonCoach .branchPill{padding:1px 6px!important;font-size:10px!important;min-height:18px!important;line-height:1.1;border-radius:999px;white-space:nowrap}
#reviewBackButton[hidden]{display:none!important}
body>header:has(#reviewBackButton:not([hidden])){grid-template-columns:auto auto minmax(0,1fr) 44px auto;gap:5px}
body>header #reviewBackButton{grid-column:1;grid-row:1;min-height:42px;padding:8px 10px;font-size:13.5px;white-space:nowrap}
body>header:has(#reviewBackButton:not([hidden])) #homeButton{grid-column:2;grid-row:1;min-width:0;min-height:42px;padding:8px 10px;font-size:14px}
body>header:has(#reviewBackButton:not([hidden])) .reviewPageTitle{grid-column:3;grid-row:1;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body>header:has(#reviewBackButton:not([hidden])) #flip{grid-column:4;grid-row:1;min-width:42px;min-height:42px;width:42px}
body>header:has(#reviewBackButton:not([hidden])) #importToggle{grid-column:5;grid-row:1;min-height:42px;padding:8px 9px;font-size:13.5px;white-space:nowrap}
@media(max-width:390px){
  body>header:has(#reviewBackButton:not([hidden])){gap:4px;padding:0 6px}
  body>header #reviewBackButton,body>header:has(#reviewBackButton:not([hidden])) #homeButton,body>header:has(#reviewBackButton:not([hidden])) #importToggle{padding:7px 7px;font-size:12.5px;min-height:38px}
  body>header:has(#reviewBackButton:not([hidden])) .reviewPageTitle{font-size:13.5px}
}
progress,#gameOverview .overviewProgress progress,#reviewPanel #progress{width:100%;height:10px!important;border-radius:999px;overflow:hidden;-webkit-appearance:none;appearance:none;background:rgba(20,14,10,0.6);border:1px solid rgba(228,195,144,0.38);box-shadow:inset 0 1px 3px rgba(0,0,0,0.5)}
progress::-webkit-progress-bar{background:rgba(20,14,10,0.6);border-radius:999px}
progress::-webkit-progress-value{background:linear-gradient(90deg,#c69a61,#f3dcaf);border-radius:999px;transition:width .22s ease}

/* 3.81 Unified Navigation, Flip Buttons & Confirmation Sheets */
.mistakeReviewHeader{grid-template-columns:auto auto minmax(0,1fr) 44px;gap:5px}
.mistakeReviewHeader #mistakeBack{grid-column:1;grid-row:1;min-height:42px;padding:8px 10px;font-size:13.5px;white-space:nowrap}
.mistakeReviewHeader #mistakeHome{grid-column:2;grid-row:1;min-width:0;min-height:42px;padding:8px 10px;font-size:14px;white-space:nowrap}
.mistakeReviewHeader .reviewPageTitle{grid-column:3;grid-row:1;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mistakeReviewHeader #mistakeFlip{grid-column:4;grid-row:1;min-width:42px;min-height:42px;width:42px}
.playHeading #playFlip,.playHeading #onlineFlip,.playHeading #lessonFlip{min-width:42px;min-height:42px;width:42px;padding:6px;font-size:20px;line-height:1;border:1px solid #80624a;border-radius:10px;flex:none}
html[data-theme="green"] .playHeading :is(#playFlip,#onlineFlip,#lessonFlip){border-color:#556348}
#learnScreen>.playHeading #learnTopHeading{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#playSetup>.playHeading,#savedGamesPage>.playHeading{margin-bottom:8px;flex:none}
.confirmSheet{max-width:min(440px,90vw);padding:20px;border-radius:16px}
.confirmSheet h3{margin:0 0 10px;font-size:19px}
.confirmSheet p{margin:0 0 16px;font-size:14.5px;line-height:1.45}

@media(max-width:599px){
  .lessonVoiceRow{justify-content:space-between}
  .lessonVoiceRow .lessonVoiceMessages{display:none}
}

/* Miss classification: consistent with other errors in both themes. */
.badge.miss{background:#63522e;color:#ffe19c}.moveMark.miss{background:#d6a851;color:#241b0c}
