:root{--paper:#f7f7f2;--surface:#fff;--ink:#253029;--muted:#788078;--line:#dfe3db;--accent:#3f604a;--accent-light:#e6eee5;--light-square:#edf0e3;--dark-square:#839c83;--error:#a44336;--radius:8px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button{color:inherit}button,input,select{border-radius:var(--radius)}button{min-height:44px;border:0;background:none;padding:10px 14px;font-size:14px;font-weight:550}button:hover{background:#e9ede5}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #719572;outline-offset:3px}input:focus,select:focus{outline:2px solid #719572;outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:18px;height:18px;flex:none;cursor:pointer}a{color:inherit}h1,h2,p{margin:0}h1{font-weight:580;letter-spacing:-1.2px}h2{font-size:16px;font-weight:600}p{line-height:1.55}[hidden]{display:none!important}.muted{color:var(--muted);font-size:14px}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:650;color:var(--muted)}.mono{font:12px ui-monospace,SFMono-Regular,Menlo,monospace}.primary{background:var(--accent);color:#fff;display:inline-flex;gap:14px;align-items:center;justify-content:center}.primary:hover{background:#304e3b}.outline-button{border:1px solid var(--line);background:transparent;white-space:nowrap}.text-button{padding:8px 4px;color:var(--accent);font-size:12px}.icon-button{min-width:44px;font-size:24px;padding:4px 8px;line-height:1}.wide{width:100%}
.auth-screen{min-height:100svh;display:flex;flex-direction:column}.auth-intro{padding:40px 28px 25px;position:relative;overflow:hidden}.auth-knight{width:56px;height:56px;margin-bottom:12px}.auth-intro h1{font-size:43px;margin:9px 0}.auth-description{font-size:19px;line-height:1.4;color:#667369}.auth-board{position:absolute;right:-36px;top:55px;transform:rotate(-12deg);opacity:.2;width:176px;aspect-ratio:1;background:conic-gradient(var(--dark-square) 25%,transparent 0 50%,var(--dark-square) 0 75%,transparent 0);background-size:44px 44px;z-index:-1}.auth-form-wrap{padding:12px 28px 40px}.auth-form{max-width:350px;margin:0 auto}.auth-form h2{font-size:24px;letter-spacing:-.6px;margin-bottom:6px}.auth-form>p{margin-bottom:24px}.auth-form label{display:block;font-size:13px;margin:18px 0 8px}.auth-form input{width:100%;padding:13px 14px;border:1px solid var(--line);background:#fff;min-height:48px;font-size:16px}.auth-form .form-error{color:var(--error);font-size:13px;margin:12px 0}.auth-form .primary{margin-top:9px;justify-content:space-between}.auth-form .text-button{margin-top:12px}
.app-header{height:64px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:0 14px;background:var(--paper);position:relative;z-index:12}.brand{display:flex;align-items:center;gap:6px;text-decoration:none;font-size:18px;font-weight:650;letter-spacing:-.6px}.brand img{width:28px;height:28px}.main-nav{margin-left:auto;display:flex;align-self:stretch;gap:2px}.nav-button{border-radius:0;font-size:12px;padding:9px 8px;position:relative}.nav-button.active:after{content:"";position:absolute;height:2px;background:var(--accent);bottom:0;left:9px;right:9px}.account{display:none;align-items:center;gap:18px}.sync-status{font-size:11px;color:var(--muted);white-space:nowrap}.sync-status:before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:#779376;margin-right:6px}.sync-status.pending{color:#a67d35}.sync-status.pending:before{background:#a67d35}.sync-status.failed{color:var(--error)}.sync-status.failed:before{background:var(--error)}
.workspace{display:block}.library{position:fixed;top:0;left:0;bottom:0;width:min(360px,calc(100vw - 28px));z-index:30;background:var(--paper);transform:translateX(-105%);transition:transform .2s ease;display:flex;flex-direction:column;padding:22px 18px 14px;border-right:1px solid var(--line)}.library.open{transform:translateX(0)}.drawer-overlay{position:fixed;inset:0;background:#1c2a2466;z-index:29;animation:fade-in .2s ease}.library-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;min-height:30px}.library-heading h2{font-size:18px;letter-spacing:-.4px}.book-tabs{display:flex;gap:6px;border:1px solid var(--line);padding:4px;border-radius:8px}.book-tabs button{flex:1;font-size:13px;min-height:38px;padding:6px}.book-tabs button.active{background:white;box-shadow:0 1px 3px #26352b12;color:var(--accent)}.piece-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:7px;vertical-align:0}.piece-dot.white{background:#fff;border:1px solid #adb5aa}.piece-dot.black{background:#344239;border:1px solid #344239}.book-subtitle{font-size:11px;color:var(--muted);margin:11px 0 17px}.search-field{border:1px solid var(--line);background:#fff;border-radius:6px;display:flex;align-items:center;gap:8px;padding:0 10px}.search-field span{font-size:24px;color:#7c867c}.search-field input{width:100%;background:none;border:0;min-height:42px;font-size:13px;padding:4px 0}.library-kind{display:flex;gap:16px;margin:12px 0 2px;border-bottom:1px solid var(--line)}.small-tab{padding:8px 0;border-radius:0;font-size:12px;position:relative}.small-tab.active{color:var(--accent)}.small-tab.active:after{content:"";height:2px;background:var(--accent);position:absolute;bottom:-1px;left:0;right:0}.chapter-list{overflow-y:auto;flex:1;overscroll-behavior:contain;scrollbar-width:thin;min-height:120px}.chapter{border-bottom:1px solid var(--line)}.chapter summary{list-style:none;cursor:pointer;padding:16px 2px;display:flex;align-items:baseline;gap:8px;font-size:12px;font-weight:600;line-height:1.5}.chapter summary::-webkit-details-marker{display:none}.chapter summary:before{content:"›";font-size:16px;font-weight:400;transition:transform .15s}.chapter[open] summary:before{transform:rotate(90deg)}.chapter summary .chapter-count{margin-left:auto;font:10px ui-monospace,monospace;color:var(--muted)}.chapter-actions{text-align:right;padding:0 4px 4px}.chapter-actions button{min-height:30px;font-size:10px}.line-row{display:flex;align-items:center;gap:7px;padding:4px 0 4px 8px;border-radius:5px;margin:1px 0}.line-row.active{background:#e6ece2}.line-row input{margin:0 3px;width:17px;height:17px}.line-play{display:block;flex:1;min-width:0;text-align:left;font-size:11px;font-weight:450;padding:7px 8px;line-height:1.55;border-radius:4px}.line-play:hover{background:#e7ece3}.line-play .line-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.line-meta{display:block;color:var(--muted);font-size:10px;margin-top:3px}.line-meta .line-error{color:var(--error)}.selection-controls{padding-top:14px;border-top:1px solid var(--line);margin-top:10px}.selection-caption{display:flex;align-items:center;justify-content:space-between;font-size:11px}.selection-caption .text-button{min-height:32px;font-size:10px}.selection-settings{margin:4px 0 9px}.selection-settings select{width:100%;background:none;border:1px solid var(--line);padding:9px;font-size:12px}.selection-controls .primary{font-size:12px;justify-content:space-between}.library-footer{display:flex;gap:4px;font-size:9px;color:#8d948b;margin-top:17px}.library-footer a{text-decoration:none}
.practice-main{padding:14px 12px 0;min-width:0}.practice-topline{display:flex;gap:9px;align-items:center;justify-content:space-between;margin-bottom:18px;min-height:34px}.practice-topline .outline-button{font-size:12px;padding:7px 9px;min-height:38px}.practice-topline>.eyebrow{display:none}.count-badge{background:var(--accent-light);padding:3px 6px;margin-left:5px;border-radius:4px;color:var(--accent);font:11px ui-monospace,monospace}.session-heading{display:flex;align-items:flex-start;gap:12px;margin-bottom:15px}.session-heading>div:first-child{flex:1;min-width:0}.session-heading h1{font-size:21px;line-height:1.25;letter-spacing:-.6px;max-width:640px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.session-heading .muted{font-size:11px;margin-top:7px;line-height:1.5}.error-counter{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:42px;padding-left:12px;border-left:1px solid var(--line)}.error-counter strong{font:24px ui-monospace,SFMono-Regular,monospace;line-height:1}.error-counter span{font-size:10px;color:var(--muted);margin-top:6px}.error-counter.has-errors strong{color:var(--error)}.board-wrap{max-width:590px;margin:0 auto}.player-strip{display:flex;justify-content:space-between;align-items:center;font-size:12px;padding:9px 2px 10px;color:var(--muted)}.own-player{color:var(--ink);padding-top:12px;padding-bottom:11px}.own-player strong{font-size:12px;font-weight:550}.own-player>span:last-child{font-size:11px;color:var(--muted)}.board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:100%;border-radius:3px;overflow:hidden;box-shadow:0 2px 9px #2c382916;position:relative;user-select:none;touch-action:manipulation}.square{min-height:0;min-width:0;aspect-ratio:1;position:relative;display:flex;align-items:center;justify-content:center;border:0;border-radius:0;padding:0;background:var(--light-square);transition:background-color .12s}.square.dark{background:var(--dark-square)}.square:hover{background:var(--light-square)}.square.dark:hover{background:var(--dark-square)}.square.selected{background:#cbd579}.square.last-move{background:#d4dfa3}.square.dark.last-move{background:#a9bd77}.square.hint-square{box-shadow:inset 0 0 0 4px #b39b3b}.square.wrong-square{background:#c78372}.square img{width:88%;height:88%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 1px 1px #0002);z-index:2;animation:piece-in .12s ease-out}.square .coord{position:absolute;font:550 10px ui-monospace,monospace;color:#73866e;z-index:3;line-height:1}.square.dark .coord{color:#edf0e3}.square .rank-coord{top:4px;left:4px}.square .file-coord{right:4px;bottom:3px}.square.legal-target:after{content:"";width:20%;height:20%;border-radius:50%;position:absolute;background:#293e3138;z-index:4}.square.legal-target:has(img):after{width:89%;height:89%;background:none;border:4px solid #293e3138}.board.busy{cursor:progress}.feedback{display:flex;align-items:center;gap:8px;min-height:43px;font-size:12px;line-height:1.45;color:var(--muted);border-top:1px solid var(--line);padding:9px 1px}.feedback-dot{height:5px;width:5px;background:#8d998d;border-radius:50%;flex:none}.feedback.success{color:var(--accent)}.feedback.success .feedback-dot{background:var(--accent)}.feedback.error{color:var(--error)}.feedback.error .feedback-dot{background:var(--error)}.board-controls{display:flex;justify-content:space-between;gap:8px;padding:11px 0 14px}.history-buttons{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;flex:1;max-width:208px;justify-content:space-between}.history-buttons .icon-button{font-size:24px;min-width:32px;min-height:40px;border-radius:0;padding:0 5px;flex:1}.board-controls>.outline-button{font-size:12px;padding:7px 12px;min-height:42px}.practice-options{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:6px 0 16px}.switch-label{display:flex;align-items:center;gap:6px;font-size:10px;color:#606e60;cursor:pointer;min-height:30px}.switch-label input{margin:0;width:15px;height:15px}.completion{border-top:1px solid var(--line);padding:22px 0 18px;animation:fade-in .25s ease}.completion h2{font-size:22px;margin:8px 0;letter-spacing:-.6px}.completion p{font-size:13px;color:var(--muted)}.completion-actions{display:flex;justify-content:space-between;gap:10px;margin-top:18px}.completion-actions button{font-size:12px;padding:10px 12px}
.context-panel{padding:18px 15px 30px;border-top:1px solid var(--line);min-width:0}.context-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.context-heading h2{font-size:14px}.context-heading .mono{color:var(--muted)}.move-list{display:flex;flex-wrap:wrap;gap:4px;max-height:215px;overflow:auto;scrollbar-width:thin}.move-pair{display:grid;grid-template-columns:24px 1fr 1fr;align-items:center;width:calc(50% - 3px);font:13px ui-monospace,monospace;gap:3px}.move-pair .move-number{font-size:10px;color:#8e978b}.move-pair button{font:13px ui-monospace,monospace;min-height:34px;padding:5px 6px;text-align:left;border-radius:4px}.move-pair button.current{background:var(--accent-light);color:var(--accent);font-weight:700}.move-pair button.future{color:#a1a79c}.hidden-moves{font-size:11px;color:var(--muted);padding:15px 0;width:100%}.empty-note{font-size:12px;color:var(--muted);line-height:1.6;padding:6px 0}.book-notes{margin-top:23px;padding-top:20px;border-top:1px solid var(--line)}.book-notes summary{font-size:12px;cursor:pointer;min-height:30px;font-weight:550}.comment-text{font-size:12px;line-height:1.8;color:#626f62;white-space:pre-wrap;max-height:360px;overflow:auto;padding-top:8px}.position-stat{font-size:11px;color:var(--muted);line-height:1.7;margin-top:23px}.position-stat strong{color:var(--ink);font-weight:550}.resume-banner{border-top:1px solid var(--line);margin-top:22px;padding-top:17px;font-size:12px;color:var(--muted)}
.stats-view{max-width:1050px;padding:30px 20px;margin:auto}.stats-heading{display:flex;flex-direction:column;gap:18px;margin-bottom:35px}.stats-heading h1{font-size:29px;letter-spacing:-1px;margin-top:10px}.stats-heading>.primary{align-self:flex-start;font-size:12px}.stats-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:22px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:23px 0}.metric strong{display:block;font:32px ui-monospace,monospace;letter-spacing:-2px}.metric span{display:block;font-size:11px;color:var(--muted);margin-top:7px}.stats-section{margin-top:36px}.stats-section>h2,.section-heading{margin-bottom:18px}.section-heading{display:flex;justify-content:space-between;align-items:center}.stats-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:14px 0}.stats-row .row-text{min-width:0}.stats-row h3{font-size:12px;font-weight:550;line-height:1.6;margin:0}.stats-row p{font-size:11px;color:var(--muted);margin-top:4px}.stats-row button{font-size:12px;flex:none}.daily-table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}.daily-table th{color:var(--muted);font-weight:450;padding:12px 6px;border-bottom:1px solid var(--line);font-size:10px}.daily-table td{padding:14px 6px;border-bottom:1px solid var(--line)}.daily-table td:not(:first-child){font-family:ui-monospace,monospace}.stats-empty{padding:22px 0;font-size:13px;color:var(--muted)}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#25372e;color:#fff;padding:13px 18px;border-radius:8px;z-index:100;font-size:13px;max-width:min(90vw,480px);line-height:1.5;box-shadow:0 6px 20px #0002;animation:fade-in .2s ease}dialog{border:1px solid var(--line);border-radius:12px;padding:28px;max-width:min(450px,calc(100vw - 32px));color:var(--ink);background:var(--paper)}dialog::backdrop{background:#18241d66}dialog h2{font-size:23px;margin:12px 0}dialog p{font-size:13px;color:var(--muted)}.dialog-actions{display:flex;justify-content:space-between;gap:12px;margin-top:24px}.dialog-actions button{font-size:12px}.promotion-choices{display:flex;gap:5px;margin:14px 0}.promotion-choices button{padding:4px}.promotion-choices img{width:54px;height:54px}
@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes piece-in{from{opacity:.6;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
@media(min-width:680px){.auth-screen{flex-direction:row;align-items:center;justify-content:center;gap:clamp(50px,12vw,180px)}.auth-intro{padding:40px 20px;flex:0 1 370px;overflow:visible}.auth-intro h1{font-size:57px}.auth-knight{width:72px;height:72px}.auth-description{font-size:24px}.auth-board{top:auto;bottom:-55px;right:24px;width:220px;background-size:55px 55px}.auth-form-wrap{width:350px;padding:20px;flex-shrink:0}.auth-form{padding:22px 0}.practice-main{padding:22px 30px 0}.session-heading{max-width:650px;margin:0 auto 22px}.session-heading h1{font-size:26px}.context-panel{max-width:650px;margin:0 auto;padding:25px 30px}.app-header{padding:0 24px;gap:26px}.brand{font-size:21px}.main-nav{margin-left:25px}.nav-button{font-size:13px;padding:12px 15px}.account{display:flex;margin-left:auto}.sync-status{display:none}.stats-view{padding:45px 35px}.stats-summary{grid-template-columns:repeat(4,1fr);gap:40px}.stats-heading{flex-direction:row;align-items:center;justify-content:space-between}.stats-heading>.primary{align-self:center}.stats-heading h1{font-size:34px}.stats-row h3{font-size:14px}.stats-row p{font-size:12px}.switch-label{font-size:11px}.practice-topline>.eyebrow{display:block}}
@media(min-width:1050px){.app-header{height:74px;padding:0 30px}.brand{width:255px;flex:none}.main-nav{margin-left:0}.sync-status{display:inline}.workspace{display:grid;grid-template-columns:280px minmax(420px,1fr);min-height:calc(100svh - 74px)}.library{position:sticky;top:0;transform:none;z-index:1;grid-row:1/3;width:auto;height:calc(100svh - 74px);padding:27px 20px 16px}.mobile-only{display:none!important}.practice-main{padding:27px 35px 0;min-width:0}.practice-topline{margin-bottom:25px;max-width:680px;margin-left:auto;margin-right:auto}.practice-topline>.eyebrow{display:block}.session-heading{max-width:680px}.session-heading h1{font-size:25px}.board-wrap{max-width:min(590px,calc(100svh - 315px));min-width:370px}.context-panel{grid-column:2;padding:22px 35px;max-width:660px;width:100%;border-top:0}.move-list{max-height:135px}.book-notes{margin-top:15px;padding-top:15px}}
@media(min-width:1350px){.workspace{grid-template-columns:280px minmax(490px,1fr) 270px}.practice-main{padding:28px 42px 32px}.context-panel{grid-column:3;grid-row:1;margin:0;padding:32px 25px 25px 10px;max-width:none;border:0}.context-heading{margin-top:94px}.context-panel .move-list{display:block;max-height:340px}.move-pair{width:100%;grid-template-columns:28px 1fr 1fr}.move-pair button{min-height:34px}.board-wrap{max-width:min(610px,calc(100svh - 315px))}.book-notes{margin-top:26px;padding-top:24px}.session-heading h1{font-size:26px}}
@media(max-width:370px){.brand{font-size:16px}.brand img{width:24px;height:24px}.app-header{gap:5px;padding:0 10px}.nav-button{font-size:11px;padding:7px}.practice-options{flex-direction:column;gap:0}.board-controls{gap:5px}.board-controls>.outline-button{padding:7px 9px}.board-controls>#restart span{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.library-footer{align-items:center;justify-content:space-between}.library-footer .text-button{font-size:10px;padding:4px;min-height:35px}#settings-form label{display:block;font-size:12px;margin:20px 0 8px}#settings-form select{width:100%;padding:11px 8px;border:1px solid var(--line);background:white;font-size:12px}#settings-form>p{margin:14px 0;font-size:12px}
body.library-open{overflow:hidden}
@media(min-width:1050px){.practice-main{padding-top:20px;padding-bottom:24px}.practice-topline{margin-bottom:12px}.session-heading{margin-bottom:12px}.board-wrap{max-width:min(610px,calc(100svh - 480px));min-width:320px}.context-heading{margin-top:78px}}
@media(min-width:1050px) and (max-height:850px){.practice-main{padding-top:12px;padding-bottom:12px}.practice-topline{margin-bottom:6px}.session-heading{margin-bottom:4px}.board-controls{padding-top:8px;padding-bottom:8px}.practice-options{padding-top:4px;padding-bottom:10px}}
.line-select{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;cursor:pointer}.line-row{padding-left:0}.switch-label{min-height:44px}.line-play{font-size:12.5px}.chapter-actions button,.library-footer .text-button{min-height:44px}
@media(min-width:1050px){.line-select{min-width:30px}.line-play{font-size:11px}.switch-label{min-height:30px}.chapter-actions button{min-height:30px}}
