@charset "UTF-8";
:root{color-scheme:dark;--bg:#16191e;--rail:#121519;--panel:#20252c;--surface:#2a3039;--surface-hover:#343d48;--line:#343b45;--text:#edf0f2;--muted:#929da9;--accent:#e6ad63;--accent-dim:#4b3c2b;--green:#83ab59;--button:#7fa853;--button-hover:#92ba65;--light-square:#b6c1c9;--dark-square:#5e7386;--last-light:#cace8c;--last-dark:#a0ac56;--selected-light:#ead28a;--selected-dark:#b0ab54;--dot:#15212b35;--shadow:#0004}
:root[data-theme=classic]{--bg:#262522;--rail:#201f1c;--panel:#302e2b;--surface:#3d3934;--surface-hover:#49443e;--line:#49443c;--muted:#afa99f;--accent:#e6b66b;--accent-dim:#51412b;--light-square:#eeeed2;--dark-square:#769656;--last-light:#f2f17e;--last-dark:#bbca48;--selected-light:#f2e98b;--selected-dark:#baca44}
:root[data-theme=light]{color-scheme:light;--bg:#e9edf1;--rail:#f5f7f9;--panel:#f9fbfc;--surface:#e2e8ed;--surface-hover:#d4dce3;--line:#d4dce3;--text:#26333f;--muted:#697786;--accent:#95642a;--accent-dim:#f0dfc7;--green:#597d37;--button:#5d853d;--button-hover:#6d974a;--light-square:#f0f1e3;--dark-square:#8aa471;--last-light:#f2e4a0;--last-dark:#bcc663;--selected-light:#f1dc82;--selected-dark:#b9bd59;--shadow:#23324218}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,"Segoe UI",system-ui,sans-serif;font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button,select,a{-webkit-tap-highlight-color:transparent}button,a,select{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:default;opacity:.4}button,select,input,textarea{color:var(--text)}button{border:0}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}a{color:inherit;text-decoration:none}svg{width:22px;height:22px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}h1,h2,p{margin:0}h1,h2{font-size:14px;font-weight:650;letter-spacing:-.2px}[hidden]{display:none!important}
.rail{position:fixed;inset:0 auto 0 0;width:76px;display:flex;align-items:center;flex-direction:column;gap:12px;padding:24px 10px 20px;background:var(--rail);border-right:1px solid var(--line);z-index:20}.rail-brand{display:grid;place-items:center;width:48px;height:48px;margin-bottom:31px}.rail-item{display:grid;place-items:center;width:46px;height:46px;border-radius:12px;background:transparent;color:var(--muted);transition:background .15s,color .15s}.rail-item:hover{background:var(--surface);color:var(--text)}.rail-item.active{color:var(--accent);background:var(--accent-dim)}.rail-spacer{flex:1}.connection{display:grid;place-items:center;width:40px;height:32px}.connection span{height:7px;width:7px;border-radius:50%;background:var(--green)}.connection.offline span{background:#dc8a63}
.app-shell{margin-left:76px;padding:0 36px 20px}.page-header{max-width:1260px;height:94px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:24px}.wordmark{display:flex;align-items:center;gap:21px;font-size:23px;font-weight:720;letter-spacing:-.7px}.wordmark-divider{width:1px;height:22px;background:var(--line)}.page-location{font-size:13px;font-weight:450;letter-spacing:0;color:var(--muted)}.preferences{display:flex;align-items:center;gap:13px}.select-wrap{display:flex;align-items:center;gap:7px}.select-wrap svg{width:17px;height:17px;color:var(--muted)}select{border:1px solid transparent;background:transparent;padding:7px 22px 7px 5px;cursor:pointer;font-size:12px;border-radius:7px}select:hover{background:var(--surface)}select option{background:var(--panel);color:var(--text)}.theme-select select{max-width:142px}.language-select select{max-width:110px}
.game-layout{max-width:1260px;margin:0 auto;display:grid;grid-template-columns:minmax(320px,1fr) 344px;gap:30px;align-items:start}.board-column{max-width:760px;min-width:0;margin:0 auto;width:100%}.player-bar{display:flex;align-items:center;gap:11px;max-width:min(100%,calc(100dvh - 300px));margin-left:auto;margin-right:auto;height:57px}.opponent-bar{margin-bottom:12px}.avatar{width:44px;height:44px;display:grid;place-items:center;border-radius:11px;flex-shrink:0}.bot-avatar{background:transparent}.you-avatar{background:var(--surface)}.player-identity{display:flex;flex-direction:column;gap:3px}.player-identity strong{font-size:15px;font-weight:650}.player-subtitle{font-size:11px;color:var(--muted)}.rating-badge{margin-left:auto;padding:5px 10px;border:1px solid var(--line);border-radius:6px;color:var(--accent);font-size:11px;font-weight:750;letter-spacing:.5px}.turn-badge{margin-left:auto;color:var(--green);font-size:12px;font-weight:600}.turn-badge.waiting{color:var(--muted)}.you-bar{margin-top:12px}
.board-shell{width:min(100%,calc(100dvh - 300px));min-width:0;margin:0 auto;box-shadow:0 14px 35px var(--shadow);border-radius:5px;overflow:hidden}.chessboard{position:relative;aspect-ratio:1;isolation:isolate;touch-action:none;user-select:none;-webkit-user-select:none;background:var(--dark-square);cursor:pointer}.chessboard:focus-visible{outline-offset:4px;outline:2px solid var(--accent)}.squares{position:absolute;inset:0;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr)}.square{position:relative;display:block;min-width:0;padding:0;background:var(--dark-square);border:0;border-radius:0;color:var(--light-square)}.square.light{background:var(--light-square);color:var(--dark-square)}.square.last{background:var(--last-dark)}.square.light.last{background:var(--last-light)}.square.selected{background:var(--selected-dark)}.square.light.selected{background:var(--selected-light)}.square.check{background:radial-gradient(ellipse at center,#f05d54 0,#db7568 48%,var(--dark-square) 100%)}.square.light.check{background:radial-gradient(ellipse at center,#f05d54 0,#db7568 48%,var(--light-square) 100%)}.square.legal::after{content:"";position:absolute;width:26%;height:26%;top:37%;left:37%;border-radius:50%;background:var(--dot)}.square.capture::after{width:89%;height:89%;top:5.5%;left:5.5%;background:none;border:6px solid var(--dot)}.square .rank{position:absolute;top:3px;left:5px;font-size:clamp(9px,1vw,12px);font-weight:700}.square .file{position:absolute;bottom:2px;right:5px;font-size:clamp(9px,1vw,12px);font-weight:700}.pieces{position:absolute;inset:0;pointer-events:none;z-index:2}.piece{position:absolute;inset:0 auto auto 0;width:12.5%;height:12.5%;display:grid;place-items:center;transition:transform .2s cubic-bezier(.2,.7,.25,1),opacity .14s;transform-origin:center;pointer-events:none;filter:drop-shadow(0 2px 1px #0002)}.piece img{width:91%;height:91%;display:block;-webkit-user-drag:none;user-select:none}.piece.dragging{transition:none!important;z-index:10;will-change:transform;filter:drop-shadow(0 7px 6px #0004)}.piece.removing{opacity:0}.hint-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;display:none;color:var(--accent)}.hint-arrow.visible{display:block}.hint-arrow line{stroke:var(--accent);stroke-width:10;opacity:.78}.hint-arrow marker path{fill:var(--accent);stroke:none}
.board-toolbar{display:flex;align-items:center;gap:14px;justify-content:space-between;margin:12px auto 0;max-width:min(100%,calc(100dvh - 300px))}.board-help{font-size:11px;color:var(--muted);max-width:320px}.toolbar-actions{display:flex;gap:3px}.icon-button{display:grid;place-items:center;flex-shrink:0;width:35px;height:35px;background:transparent;color:var(--muted);border-radius:8px;transition:background .15s,color .15s}.icon-button:hover{background:var(--surface);color:var(--text)}.icon-button svg{width:18px;height:18px}
.game-panel{background:var(--panel);border:1px solid var(--line);border-radius:15px;overflow:hidden;margin-top:5px;min-width:0;box-shadow:0 8px 28px #0000000b}.panel-section{padding:19px 19px 16px}.panel-section+.panel-section{border-top:1px solid var(--line)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.level-name{font-size:11px;color:var(--muted)}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.level-button{border:1px solid transparent;background:var(--surface);border-radius:7px;padding:8px 0;font-size:12px;font-weight:600;transition:background .15s,border-color .15s}.level-button:hover{background:var(--surface-hover)}.level-button.selected{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}.maximum-button{display:flex;align-items:center;gap:7px;width:100%;border:1px solid transparent;border-radius:8px;background:var(--surface);padding:9px 11px;margin-top:8px;font-size:12px;font-weight:600;color:var(--muted);text-align:left}.maximum-button svg{width:16px;height:16px}.maximum-button .max-label{margin-left:auto;font-size:9px;letter-spacing:.8px}.maximum-button.selected{background:var(--accent-dim);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 30%,transparent)}.settings-line{display:flex;justify-content:space-between;align-items:center;gap:7px;margin:8px 0 10px}.elo-note{font-size:10px;color:var(--muted)}.settings-line select{font-size:10px;padding-right:12px;max-width:140px}.color-options{display:grid;grid-template-columns:1fr 1.14fr 1fr;padding:3px;border:1px solid var(--line);border-radius:8px;gap:3px}.color-options button{padding:5px 1px;background:transparent;color:var(--muted);border-radius:5px;font-size:10px;display:flex;align-items:center;justify-content:center;gap:5px}.color-options button.selected{background:var(--surface);color:var(--text)}.color-dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0}.white-dot{background:#eee9df;border:1px solid #b8b3a5}.black-dot{background:#242a2e;border:1px solid #797f84}.random-dot{background:linear-gradient(90deg,#eee9df 50%,#242a2e 50%);border:1px solid #8b8c84}.primary-button{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;padding:11px 14px;background:var(--button);color:#fff;border-radius:8px;font-size:12px;font-weight:650;box-shadow:0 2px 0 #0002;transition:background .15s,transform .1s}.primary-button:hover{background:var(--button-hover)}.primary-button:active{transform:translateY(1px)}.primary-button svg{width:16px;height:16px}.new-game{margin-top:11px}.text-button{padding:0;background:none;color:var(--muted);font-size:10px}.text-button:hover{color:var(--text)}.history-section{padding-top:16px;padding-bottom:10px}.move-table-head,.move-row{display:grid;grid-template-columns:32px 1fr 1fr;align-items:center}.move-table-head{color:var(--muted);font-size:10px;margin-bottom:6px}.move-table-head span{text-align:center}.move-history{height:115px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--surface-hover) transparent}.empty-history{text-align:center;color:var(--muted);font-size:11px;padding-top:31px}.move-row{border-radius:5px;min-height:30px;font-size:12px}.move-row:nth-child(even){background:color-mix(in srgb,var(--surface) 35%,transparent)}.move-row.active{background:var(--surface)}.move-number{text-align:center;color:var(--muted);font-size:10px}.move-cell{background:transparent;color:var(--text);text-align:left;padding:6px 17px;font-size:12px;font-weight:500;border-radius:5px;min-height:29px}.move-cell:hover{color:var(--accent);background:var(--accent-dim)}.panel-status{display:flex;align-items:center;gap:7px;padding:10px 19px 14px;font-size:10px;color:var(--muted);min-height:39px}.status-dot{height:5px;width:5px;background:var(--green);border-radius:50%;flex-shrink:0}.status-dot.thinking{background:var(--accent);animation:pulse 1.4s ease-in-out infinite}.status-dot.error{background:#e58c6b}.toast{position:fixed;bottom:25px;left:calc(50% + 30px);transform:translateX(-50%);background:var(--panel);border:1px solid var(--line);padding:12px 20px;border-radius:10px;box-shadow:0 8px 28px var(--shadow);font-size:12px;z-index:100;max-width:90vw}
.modal{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:17px;padding:25px;width:min(440px,calc(100vw - 30px));box-shadow:0 30px 100px #0007}.modal::backdrop{background:#080c1280;backdrop-filter:blur(4px)}.modal-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}.modal-heading h2{font-size:18px}.eyebrow{display:block;font-size:10px;color:var(--accent);margin-bottom:5px}.promotion-modal{width:min(420px,calc(100vw - 30px))}.promotion-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.promotion-choice{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:10px 3px 8px;color:var(--muted);font-size:10px}.promotion-choice:hover{background:var(--accent-dim);border-color:var(--accent)}.promotion-choice img{display:block;width:100%;aspect-ratio:1}.field-label{display:block;font-size:11px;color:var(--muted);margin-bottom:8px}.full-select,.text-input{width:100%;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-size:12px}.text-input{margin-top:9px}.archive-fields{display:flex;gap:12px;margin-top:12px}.archive-fields label{flex:1;font-size:11px;color:var(--muted)}.archive-fields input{width:100%;display:block;background:var(--surface);border:1px solid var(--line);padding:9px 11px;border-radius:7px;margin-top:4px}.muted{color:var(--muted);font-size:11px;line-height:1.7}.import-help{margin:13px 0 17px;min-height:35px}.or-divider{height:1px;background:var(--line);margin:19px 0}.secondary-button{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;background:var(--surface);border-radius:8px;font-size:12px}.secondary-button svg{width:17px;height:17px}.secondary-button:hover{background:var(--surface-hover)}.fen-input{resize:vertical;margin:0 0 15px;font:12px/1.7 ui-monospace,monospace}.modal .muted{margin-top:12px}
@keyframes pulse{50%{opacity:.35}}@media(min-width:1500px){.page-header{height:110px}.game-layout{gap:42px;grid-template-columns:minmax(320px,1fr) 360px}.panel-section{padding-left:22px;padding-right:22px}.move-history{height:135px}.player-bar,.board-toolbar{max-width:min(100%,calc(100dvh - 316px))}.board-shell{width:min(100%,calc(100dvh - 316px))}}
@media(max-height:850px) and (min-width:981px){.page-header{height:76px}.player-bar{height:46px}.avatar{height:38px;width:38px}.avatar img{width:33px;height:33px}.board-shell{width:min(100%,calc(100dvh - 260px))}.player-bar,.board-toolbar{max-width:min(100%,calc(100dvh - 260px))}.panel-section{padding-top:12px;padding-bottom:11px}.section-heading{margin-bottom:9px}.level-button{padding:6px 0}.maximum-button{padding:7px 10px}.settings-line{margin:5px 0 6px}.new-game{margin-top:8px;padding:9px}.move-history{height:82px}.panel-status{padding-bottom:11px}.board-help{font-size:10px}.game-layout{gap:23px}}
@media(max-width:1100px){.app-shell{padding-left:23px;padding-right:23px}.game-layout{gap:22px;grid-template-columns:minmax(300px,1fr) 320px}.page-location,.wordmark-divider{display:none}.panel-section{padding-left:16px;padding-right:16px}.board-help{max-width:200px}.wordmark{font-size:21px}.preferences{gap:6px}}
@media(max-width:980px){.rail{width:58px;padding:17px 6px;gap:8px}.rail-brand{width:40px;height:40px;margin-bottom:20px}.rail-brand img{width:34px;height:34px}.rail-item{width:40px;height:40px}.app-shell{margin-left:58px;padding:0 22px 28px}.page-header{height:83px}.game-layout{grid-template-columns:minmax(0,1fr);gap:25px;max-width:650px}.board-column{max-width:650px}.board-shell{width:100%}.player-bar,.board-toolbar{max-width:100%}.game-panel{display:grid;grid-template-columns:1fr 1fr}.opponent-settings{border-right:1px solid var(--line)}.history-section{border-top:0!important}.panel-status{grid-column:1/-1;border-top:1px solid var(--line)}.move-history{height:95px}.board-help{max-width:360px}}
@media(max-width:600px){.rail{display:none}.app-shell{margin:0;padding:0 12px 20px}.page-header{height:71px;gap:12px}.wordmark{font-size:21px}.preferences{gap:0}.select-wrap{gap:2px}.theme-select svg{display:none}.select-wrap select{font-size:11px;padding-right:17px;padding-left:4px}.theme-select select{max-width:125px}.language-select select{max-width:99px}.language-select svg{width:14px;height:14px}.game-layout{gap:20px}.board-column{padding:0 1px}.player-bar{height:44px;gap:9px}.opponent-bar{margin-bottom:9px}.you-bar{margin-top:9px}.avatar{height:36px;width:36px;border-radius:9px}.avatar img{width:32px;height:32px}.player-identity strong{font-size:13px}.player-subtitle{font-size:10px}.rating-badge{font-size:10px}.turn-badge{font-size:11px}.board-toolbar{gap:8px;margin-top:9px}.board-help{font-size:10px;max-width:210px}.toolbar-actions{gap:0}.icon-button{width:31px;height:32px}.game-panel{display:flex;flex-direction:column}.opponent-settings{border-right:0}.panel-section{padding:17px}.history-section{border-top:1px solid var(--line)!important}.move-history{height:130px}.square.capture::after{border-width:4px}.modal{padding:21px}.modal-heading h2{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
