/* Home and play share the mountain-blue visual language. */
body.app-shell{background:radial-gradient(ellipse at 60% 5%,#174b80 0,#073467 42%,#031b39 100%);color:#ecf5ff}
body.app-shell header.top{height:82px;min-height:82px;padding:10px 20px;background:linear-gradient(0deg,#05254ee8,#092b5760),url('/images/mountain-knight.webp') center 40%/cover;border-bottom:1px solid #93c8ff35}
body.app-shell .top .brand-logo{width:54px;height:54px;border:1px solid #b4d9ff85;border-radius:13px;box-shadow:0 3px 14px #0006}
body.app-shell .screen-signin,body.app-shell .site-menu-toggle{background:linear-gradient(145deg,#123c66e0,#08264bd9);border:1px solid #97c3f875;color:#f3f8ff;box-shadow:inset 0 1px 1px #b9dcff30,0 3px 10px #00132940;border-radius:14px;min-height:44px}
body.home-screen{position:relative;isolation:isolate;background:#061d38;height:auto;min-height:100dvh;overflow-y:auto}
body.home-screen::before{content:'';position:fixed;inset:0;z-index:-2;background:url('/images/mountain-knight.webp') 83% center/cover;transform:scaleX(-1)}
body.home-screen::after{content:'';position:fixed;inset:0;z-index:-1;background:linear-gradient(#041a3250,transparent 35%,#031a3770 63%,#011128bd)}
body.home-screen header.top{background:linear-gradient(#071f3bf5,#0a315ca0);border-bottom:0}
.home-screen .home-dashboard{max-width:1000px;display:flex;flex-direction:column;gap:22px;padding:20px 24px 44px;min-height:calc(100dvh - 82px)}
.home-screen .home-scene{display:flex;align-items:flex-end;justify-content:flex-end;min-height:300px;flex:1;background:none;border:0;padding:16px 0;overflow:visible}
.home-scene>div{width:60%;text-align:center}.home-screen .home-scene h1{font:italic 48px/1.04 Georgia,serif;letter-spacing:-.025em;color:#fff;text-shadow:0 3px 18px #00162f;margin:0}
.home-screen .scene-quote{position:static;font:12px/2 'Segoe UI',Arial,sans-serif;letter-spacing:.28em;text-transform:uppercase;color:#e4effe;margin:18px 0 0}.scene-quote::before{content:'';display:block;width:56px;height:2px;background:#eef5ff;margin:0 auto 12px}.scene-quote strong{font-weight:500}
.home-shortcuts>a{grid-area:auto;min-width:0;width:100%}.home-shortcuts{display:grid;grid-template-columns:1fr 1fr;gap:14px;flex:none}
.home-screen .home-play-card,.home-screen .home-lesson{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:25px 15px;border-radius:23px;min-height:205px;position:relative;text-align:center}
.home-screen .home-play-card{color:white;background:linear-gradient(135deg,#1768d1eb,#063886f5);border:1px solid #5cb5ff;box-shadow:inset 0 1px 2px #caeaff55,0 6px 22px #001a3880,0 0 12px #1589ff38}
.home-screen .home-lesson{background:linear-gradient(140deg,#f6fbfff5,#d6ebfff7);border:1px solid #e3f2ff;box-shadow:0 6px 22px #001a3880;color:#06264f}
.home-screen .mini-checker{width:48px;border:3px solid #f3f9ff;background:conic-gradient(#fff 25%,#164983 0 50%,#fff 0 75%,#164983 0) 0 0/50% 50%;box-shadow:none}
.home-screen .home-icon{width:55px;height:55px;stroke:#082d61;fill:#082d61;stroke-width:1.4}
.home-screen .home-play-card h2,.home-screen .home-tile h2{margin:0;font-size:25px;line-height:1.12;letter-spacing:-.035em}
.home-screen .home-play-card p,.home-screen .home-tile p{font-size:16px;line-height:1.35;margin:0}.home-screen .tile-arrow{right:15px;bottom:40px;font-size:32px;color:inherit}
.home-screen .home-quote{margin:0 auto;max-width:600px;background:none;border:0;box-shadow:none;border-radius:0;color:#eef5ff;gap:14px;padding:2px 8px;text-align:center;flex:none}
.home-screen .home-quote>span{font-size:50px;color:#c3d3e3;align-self:flex-start;margin-top:10px}.home-screen .home-quote p{font:italic 23px/1.25 Georgia,serif;margin:0 0 12px;text-shadow:0 2px 8px #001329}.home-screen .home-quote cite{font-size:14px;color:#c7d8e8}
.home-continue{display:flex;align-items:center;justify-content:center;gap:16px;margin:0 auto;max-width:440px;width:90%;min-height:56px;color:#fff;font-weight:700;font-size:17px;text-decoration:none;border:1px solid #b8d4f178;border-radius:22px;background:#31557780;box-shadow:inset 0 1px 1px #e0f0ff30;backdrop-filter:blur(10px)}.home-continue>span:not(.sr-only){font:700 38px/.7 Georgia,serif;margin-top:9px}
/* Three summary cards free up horizontal space for the board. */
.play-screen .screen-stats{grid-template-columns:1.25fr .85fr 1fr;height:64px;gap:8px}.play-screen .stat{background:linear-gradient(135deg,#edf8ff,#cfe6fb);border-color:#a3d1ef;border-radius:13px;box-shadow:inset 0 1px 1px #fff9,0 3px 10px #00162c40}
.play-screen .engine-stat{padding-left:28px!important}.play-screen .engine-light{left:10px;top:15px}.play-screen #engine-status{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
.play-screen .engine-stat .strength-stat{border:0;padding:0;background:none;box-shadow:none;height:auto;min-height:0;display:flex;flex-direction:row;align-items:center;gap:5px;width:100%;color:#214568;text-align:left;cursor:pointer;margin-top:3px;border-radius:3px}.play-screen .strength-stat strong{font-size:12px;font-weight:400}.play-screen .strength-stat span{font-size:12px;width:auto;margin:0}.play-screen .strength-stat::after{content:'⚙';margin-left:auto;font-size:18px;color:#173e67}
.play-screen .screen-actions{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.play-screen .screen-actions button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:55px!important;background:linear-gradient(145deg,#0b4079,#073166);border:1px solid #3984c276;color:#f4f9ff;border-radius:13px;box-shadow:inset 0 1px 1px #71baff18;font-size:11px!important;padding:7px 3px!important;white-space:normal}
.screen-actions svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}.play-screen #best-moves-toggle{font-size:11px!important}.play-screen #best-moves-toggle::after{display:none}.play-screen #best-moves-toggle[aria-pressed=true]{background:#1762aa}
.play-screen #tutor-panel{color:#edf6ff;background:linear-gradient(125deg,#174c7fbd,#0b305bdd);border:1px solid #5499d283;border-radius:18px;box-shadow:inset 0 1px 1px #b6dfff20,0 5px 20px #00152f40;gap:10px;padding:13px}
.play-screen .screen-coach-heading h2{color:#f4f9ff;font-size:20px}.play-screen .coach-symbol{width:40px;height:40px;object-fit:contain;background:#062b50;border:1px solid #68a0d175;border-radius:11px}
.screen-mode-group{display:flex;align-items:center;gap:0;border:1px solid #6392c265;border-radius:30px;background:#072b56;flex:none;padding:2px}.play-screen .screen-mode-group button{background:none;border:0;color:#eaf4ff;border-radius:24px;padding:9px 13px;min-height:38px;font-size:13px}.play-screen .screen-mode-group button[aria-pressed=true]{background:linear-gradient(120deg,#159cff,#0649ff);box-shadow:0 2px 8px #008dff55}
.play-screen .screen-coach-body{gap:8px}.play-screen #tutor-status{color:#d4e8fb;font-size:12px;line-height:1.35;max-height:34px;text-align:center}.play-screen #voice-speaking-controls{justify-content:center;padding:2px 0!important;flex-wrap:wrap}.play-screen:not(.screen-voice) #voice-speaking-controls{display:none!important}
.play-screen #voice-hold{border:0;border-radius:40px;background:linear-gradient(110deg,#1aa9ff,#0752ff);color:#fff;min-height:54px;padding:12px 32px;font-size:18px;font-weight:700;min-width:65%;box-shadow:0 4px 20px #007aff55, inset 0 1px 1px #b9e6ff70}.play-screen #voice-hold[aria-pressed=true]{background:linear-gradient(110deg,#21c98b,#078153);box-shadow:0 0 18px #20d69060}.play-screen #voice-hold:disabled{opacity:.55}.play-screen #voice-input-help{display:none}
.play-screen .chat-message{color:#eef6ff;background:#234f7d80;border:1px solid #538ecc70;border-radius:15px;padding:11px 14px;box-shadow:inset 0 1px 1px #c5e3ff12}.play-screen .chat-message strong{color:#99c8ef;letter-spacing:.12em}.play-screen .chat-message.user{background:#1457a0aa}.play-screen #chat-input{background:#133c64;color:#fff;border-color:#689dcc}.play-screen #chat-input::placeholder{color:#b6cce0}
.play-screen .board{box-shadow:0 6px 20px #00122870;border:1px solid #8dc5f775;border-radius:10px}.play-screen .square{background:#dfedfa}.play-screen .square.dark{background:#58a4e9}.play-screen .square img{width:91%;height:91%}
@media(max-width:760px){
 body.app-shell header.top{height:70px;min-height:70px;padding:8px 10px;gap:7px}body.app-shell .top .brand-logo{width:42px;height:42px}body.app-shell .top .brand>span{font-size:19px}body.app-shell .top .brand-caption{font-size:6px!important;letter-spacing:.14em!important}.app-shell .screen-signin{font-size:11px;padding:8px 9px;min-height:39px}body.app-shell .site-menu-toggle{font-size:12px;min-height:39px;padding:8px 10px}
 .home-screen .home-dashboard{min-height:calc(100dvh - 70px);gap:20px;padding:12px 16px 35px}.home-screen .home-scene{min-height:260px;padding:5px 0 8px}.home-screen .home-scene h1{font-size:clamp(29px,8.4vw,39px)}.home-screen .scene-quote{font-size:9px;letter-spacing:.23em;margin-top:15px}.home-shortcuts{gap:12px}.home-screen .home-play-card,.home-screen .home-lesson{min-height:164px;gap:10px;padding:20px 10px;border-radius:20px}.home-screen .home-play-card h2,.home-screen .home-tile h2{font-size:21px}.home-screen .home-play-card p,.home-screen .home-tile p{font-size:13px}.home-screen .mini-checker{width:40px}.home-screen .home-icon{width:44px;height:44px}.home-screen .tile-arrow{font-size:28px;right:9px;bottom:34px}.home-screen .home-quote{padding:4px 0;gap:9px}.home-screen .home-quote p{font-size:18px}.home-screen .home-quote cite{font-size:12px}.home-screen .home-quote>span{font-size:40px}.home-continue{min-height:50px;font-size:15px}
 body.play-screen>main{padding:8px 9px 12px;gap:9px}.play-screen .screen-stats{height:58px;gap:6px}.play-screen .stat{padding:7px 8px}.play-screen .stat strong{font-size:13px}.play-screen .stat span,.play-screen .stat p{font-size:11px}.play-screen .engine-stat{padding-left:23px!important}.play-screen .engine-light{top:13px;left:8px;width:8px;height:8px}.play-screen .strength-stat strong,.play-screen .strength-stat span{font-size:10px}.play-screen .strength-stat::after{font-size:15px}
 .play-screen:not(.review-active) .screen-board-zone{flex:1;min-height:0;container-type:size;gap:7px}.play-screen:not(.review-active) .board-frame{width:min(100%,max(0px,calc(100cqh - 62px)));grid-template-columns:15px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 17px;aspect-ratio:1}.play-screen.show-best-moves:not(.review-active) .board-frame{width:min(100%,max(0px,calc(100cqh - 106px)))}
 .play-screen:not(.review-active) .screen-coach-zone{flex:0 0 clamp(210px,29dvh,270px);min-height:0}.play-screen #tutor-panel{padding:10px;gap:7px}.play-screen .screen-coach-heading{gap:7px}.play-screen .screen-coach-heading h2{font-size:16px}.play-screen .coach-symbol{width:34px;height:34px}.play-screen .screen-mode-group button{font-size:12px;padding:8px 10px;min-height:34px}.play-screen #voice-hold{min-height:48px;font-size:16px;padding:10px 24px}.play-screen #tutor-status{font-size:11px;max-height:30px}.play-screen .chat-message{font-size:13px;line-height:1.4}.play-screen .board-ranks span,.play-screen .board-files span{font-size:11px}
}
@media(max-width:380px){body.app-shell .top .brand>span{font-size:16px}body.app-shell .top .brand-logo{width:35px;height:35px}.app-shell .screen-signin{font-size:10px;padding:8px 6px}.play-screen .screen-coach-heading h2{font-size:14px}.play-screen .screen-mode-group button{padding:7px 8px}.home-screen .home-tile h2{font-size:18px}}
@media(max-height:700px) and (max-width:760px){.home-screen .home-scene{min-height:210px}.home-screen .home-dashboard{gap:15px}.home-screen .home-play-card,.home-screen .home-lesson{min-height:145px}.play-screen:not(.review-active) .screen-coach-zone{flex-basis:195px}.play-screen #voice-hold{min-height:44px}.play-screen .screen-actions button{min-height:49px!important}}
@media(min-width:761px){.home-screen .home-dashboard{padding-top:30px}.home-screen .home-scene{min-height:300px}.home-shortcuts{max-width:640px;width:100%;align-self:center}.home-screen .home-scene>div{width:55%;max-width:550px}.play-screen .screen-board-zone{container-type:size}.play-screen .board-frame{width:min(100%,calc(100cqh - 76px))}.play-screen.show-best-moves .board-frame{width:min(100%,calc(100cqh - 120px))}.play-screen .screen-game-layout{gap:24px}.play-screen #tutor-panel{padding:18px}.play-screen .screen-actions button{min-height:60px!important;font-size:13px!important}}
@media(max-height:560px) and (min-width:600px){.play-screen:not(.review-active) .screen-coach-zone{flex:1}.play-screen .screen-game-layout{display:grid;grid-template-columns:1fr 1fr}.play-screen .screen-board-zone{container-type:size}.play-screen .board-frame{width:min(100%,calc(100cqh - 65px))}}
/* Trainer message spans keep the coach card's light text. */
.play-screen .chat-message>span{color:inherit}
.play-screen #best-moves-toggle svg{display:none}
.play-screen #best-moves-toggle::before{content:'';display:block;width:23px;height:23px;background:linear-gradient(currentColor,currentColor) left bottom/4px 12px no-repeat,linear-gradient(currentColor,currentColor) center bottom/4px 22px no-repeat,linear-gradient(currentColor,currentColor) right bottom/4px 17px no-repeat;flex:none}

/* Portrait phones prioritise a full-width board over squeezing the whole session into one viewport. */
.screen-desktop-nav,.desktop-header-quote,.desktop-quick-options{display:none}
@media(max-width:760px) and (min-height:561px),(max-width:599px){
 body.play-screen header.top{height:60px;min-height:60px}
 body.play-screen>main{padding:6px 7px 10px;gap:7px;min-height:0}
 .play-screen .screen-stats{height:50px}
 .play-screen .screen-game-layout,.play-screen:not(.review-active) .screen-game-layout{overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;gap:10px;scrollbar-width:thin;display:flex;flex-direction:column}
 .play-screen .screen-board-zone,.play-screen:not(.review-active) .screen-board-zone{flex:none;container-type:normal;min-height:auto;gap:7px;width:100%;overflow:visible}
 .play-screen .board-frame,.play-screen:not(.review-active) .board-frame,.play-screen.show-best-moves:not(.review-active) .board-frame,.play-screen.review-active .board-frame{width:100%;max-width:none;aspect-ratio:1;flex:none;grid-template-columns:14px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 17px;margin:0}
 .play-screen .screen-actions button{min-height:46px!important;gap:4px;padding:5px 2px!important;font-size:10px!important}
 .play-screen .screen-actions svg{width:20px;height:20px}
 .play-screen .screen-coach-zone,.play-screen:not(.review-active) .screen-coach-zone,.play-screen.review-active .screen-coach-zone{flex:1 0 210px;min-height:210px;height:auto;width:100%}
 .play-screen #tutor-panel{min-height:210px}
}

/* Wide computer workspace: navigation, board, and a dedicated coach column. */
@media(min-width:1100px){
 body.play-screen{display:grid;grid-template-columns:clamp(170px,16vw,245px) minmax(0,1fr);grid-template-rows:100px minmax(0,1fr);background:radial-gradient(ellipse at 55% 0,#123d6c,#061d38 70%)}
 body.play-screen header.top{grid-column:1/-1;grid-row:1;height:100px;min-height:100px;padding:12px 22px;gap:14px;background:linear-gradient(90deg,#02162dd9,#05275050,#02152cce),url('/images/mountain-knight.webp') center 40%/cover}
 body.play-screen .top .brand-logo{width:72px;height:72px;border-radius:17px}
 body.play-screen .top .brand>span{font-size:clamp(26px,2.6vw,38px)!important}
 body.play-screen .top .brand-caption{font-size:11px!important}
 body.play-screen .screen-signin,body.play-screen .site-menu-toggle{min-height:52px;padding:12px 18px;font-size:15px}
 body.play-screen .desktop-header-quote{display:block;order:5;width:250px;flex:none;margin-left:14px;color:#f0f6ff}
 .desktop-header-quote p{font:italic 23px/1.08 Georgia,serif;margin:0 0 6px}.desktop-header-quote span{font-size:11px;color:#c2d5ed}
 .play-screen #analytics-choice{position:fixed;bottom:12px;left:12px;z-index:20;width:min(500px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}
 .play-screen .screen-desktop-nav{display:flex;grid-column:1;grid-row:2;min-height:0;flex-direction:column;padding:25px 12px 20px;border-right:1px solid #6999cf40;background:linear-gradient(#031b36b8,#03162be6);overflow-y:auto}
 .screen-desktop-nav nav{display:flex;flex-direction:column;gap:9px}
 .screen-desktop-nav nav a,.screen-desktop-nav nav button{display:flex;align-items:center;gap:15px;width:100%;min-height:55px;padding:12px;color:#e5f1ff;text-decoration:none;text-align:left;font:500 15px/1.2 Inter,'Segoe UI',Arial,sans-serif;border:1px solid transparent;border-radius:12px;background:none;box-shadow:none}
 .screen-desktop-nav nav svg{width:28px;height:28px;fill:none;stroke:#b6d5f7;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
 .screen-desktop-nav nav a.active{background:linear-gradient(100deg,#096cff,#07387b);border-color:#3f8adb66;color:white}.screen-desktop-nav nav a.active::after{content:'›';margin-left:auto;font-size:26px}.screen-desktop-nav nav a:hover,.screen-desktop-nav nav button:hover{background-color:#20538580}
 .desktop-sidebar-quote{margin:auto 0 0;padding:28px 5px 0;text-align:center;color:#e3efff}.desktop-sidebar-quote img{width:60px;height:60px;opacity:.6}.desktop-sidebar-quote p{font:italic 21px/1.3 Georgia,serif;margin:12px 0}.desktop-sidebar-quote cite{font:12px/1.4 Inter,'Segoe UI',Arial,sans-serif;color:#b7cbe2}
 body.play-screen>main{grid-column:2;grid-row:2;margin:0;max-width:none;width:100%;padding:18px 18px 16px;min-height:0}
 .play-screen .screen-game-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(340px,1fr);gap:18px;overflow:hidden;width:100%}
 .play-screen .screen-board-zone{container-type:size;min-height:0;gap:10px;justify-content:flex-start}
 .play-screen .screen-stats{width:100%;height:66px;gap:10px}
 .play-screen .stat{padding:10px 12px}.play-screen .stat strong{font-size:16px}.play-screen .stat span,.play-screen .stat p{font-size:13px}
 .play-screen .board-frame{width:min(100%,max(0px,calc(100cqh - 146px)));grid-template-columns:20px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 20px}
 .play-screen.show-best-moves .board-frame{width:min(100%,max(0px,calc(100cqh - 192px)))}
 .play-screen .screen-actions{min-height:60px;max-width:100%}
 .play-screen .screen-coach-zone{display:flex;flex-direction:column;gap:14px;padding-top:42px;min-height:0;overflow:hidden}
 .play-screen #tutor-panel{flex:1;min-height:0;height:auto;padding:16px}
 .play-screen .screen-coach-heading h2{font-size:clamp(16px,1.4vw,22px)}
 .play-screen .screen-coach-heading .screen-mode-group button{padding:10px 13px;font-size:15px}
 .play-screen .screen-coach-body{position:relative;gap:12px}
 .play-screen #chat-log{order:1}.play-screen #voice-speaking-controls{order:2;margin-top:4px}.play-screen #tutor-status{order:3;max-height:48px;font-size:13px}.play-screen #chat-form{order:4}
 .play-screen .chat-message{font-size:16px;line-height:1.5;padding:15px 17px;margin-bottom:12px}
 .play-screen #voice-hold{min-height:62px;min-width:90%;font-size:21px;padding:14px 24px}
 .play-screen .desktop-quick-options{display:block;flex:none;padding:14px;border:1px solid #5499d283;border-radius:17px;background:linear-gradient(125deg,#164674b0,#0b305be0);color:#eef6ff}
 .desktop-quick-options h3{font-size:14px;font-weight:500;margin:0 0 12px}.desktop-quick-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .desktop-quick-buttons button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;min-height:78px;padding:10px 4px;border:1px solid #4a8ac078;border-radius:14px;background:linear-gradient(140deg,#153f6c,#0b2f58);color:#eef6ff;font-size:12px}
 .desktop-quick-buttons button[aria-pressed=true]{background:#1762aa}.desktop-quick-buttons svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
 .play-screen.review-active .screen-board-zone{container-type:normal;overflow-y:auto}.play-screen.review-active .board-frame{width:min(100%,500px)}
}
@media(min-width:1100px) and (max-width:1250px){body.play-screen .desktop-header-quote{width:180px;margin-left:0}.desktop-header-quote p{font-size:21px}.play-screen .screen-coach-heading{flex-wrap:wrap}.play-screen .screen-mode-group{margin-left:auto}}
@media(min-width:1100px) and (max-height:720px){.play-screen .screen-coach-zone{padding-top:0}.play-screen .desktop-quick-options{padding:10px}.desktop-quick-buttons button{min-height:56px}.desktop-sidebar-quote{display:none}}
