:root{font-family:Inter,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;color:#26364b;background:#f5f6f8;font-synthesis:none;--blue:#426a97;--muted:#8a929e;--line:#e5e8ed;--board-size:min(60vh,536px)}
*{box-sizing:border-box}body{margin:0}button,a,input{-webkit-tap-highlight-color:transparent}button,input{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button{color:inherit}button:disabled{cursor:default;opacity:.42}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #e2a331;outline-offset:3px}button{transition:background .15s,transform .15s,opacity .15s}button:not(:disabled):active{transform:translateY(1px)}button[hidden],[hidden]{display:none!important}a{color:inherit;text-decoration:none}.site-header{height:90px;max-width:1240px;padding:0 48px;margin:auto;display:flex;align-items:center;border-bottom:1px solid var(--line);gap:65px}.brand{display:flex;gap:11px;align-items:center}.brand-mark{width:43px;height:43px;border-radius:13px;background:#486f96;display:grid;place-items:center;box-shadow:0 3px 0 #345571}.brand-mark img{width:35px;height:35px}.brand strong{font-size:21px;letter-spacing:2px;display:block}.brand small{font-size:8px;letter-spacing:2.15px;font-weight:700;color:#8a929e;display:block;margin-top:4px}.site-header nav{display:flex;gap:34px;align-items:center;height:100%;font-size:13px}.nav-current{height:100%;display:flex;align-items:center;position:relative;font-weight:650}.nav-current:after{content:"";position:absolute;bottom:-1px;left:10px;right:10px;height:3px;background:#426a97;border-radius:4px}.text-button{padding:0;background:none;border:0;font-size:13px;color:#7d8796}.text-button:hover{color:var(--blue)}.question{border:1px solid #9fa7b1;border-radius:50%;width:15px;height:15px;display:inline-grid;place-items:center;font-size:10px;margin-left:4px}.header-note{margin-left:auto;font-size:11px;color:#88939a;display:flex;align-items:center;gap:8px}.green-dot,.blue-dot{width:6px;height:6px;border-radius:50%;background:#74a18c;display:inline-block;flex:none}.blue-dot{background:#658aad}main{max-width:1100px;margin:auto;padding:32px 40px 0}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.eyebrow{font-size:9px;letter-spacing:2.3px;font-weight:700;color:#8a99a7;margin:0 0 9px}h1{font-size:27px;letter-spacing:1px;font-weight:650;margin:0 0 10px}h1>span{color:#7597b7}.intro{margin:0;font-size:12px;letter-spacing:.25px;color:#8a929d}.mode-tag{font-size:11px;color:#728478;background:#eaf0ec;border:1px solid #dfe7e1;border-radius:20px;padding:8px 12px;white-space:nowrap}.mode-tag>span{margin-right:5px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:38px;align-items:start}.play-area{min-width:0;max-width:calc(var(--board-size) + 16px);width:100%;justify-self:center}.player-row{display:flex;align-items:center;gap:10px;height:57px;padding:0 4px}.avatar{height:37px;width:37px;border-radius:11px;display:grid;place-items:center;flex:none}.bot-avatar{background:#e0e6ee}.bot-avatar img{width:30px;height:30px}.you-avatar{background:#dce8dc;color:#6c856b;font-size:15px;font-weight:600}.player-info{display:flex;flex-direction:column;gap:4px}.player-info strong{font-size:13px;font-weight:650}.player-info>span{font-size:10px;color:#8b929b}.bot-tag{font-weight:400;font-size:9px;color:#8694a7;margin-left:5px}.side-badge{margin-left:auto;background:#e9edf2;color:#7c8795;padding:5px 10px;font-size:10px;border-radius:5px}.thinking{margin-left:auto;font-size:11px;color:#6a87a4}.thinking span{animation:blink 1s infinite}.board-shell{padding:8px;background:white;border:1px solid #e4e8ed;border-radius:10px;box-shadow:0 5px 24px #2b466310}.board{display:grid;grid-template-columns:repeat(8,1fr);width:100%;aspect-ratio:1;overflow:hidden;border-radius:3px;touch-action:none}.square{padding:0;border:0;display:grid;place-items:center;position:relative;aspect-ratio:1;min-width:0;min-height:0;border-radius:0;background:#edf0f3;user-select:none}.square.dark{background:#7b9ab5}.square img{height:87%;width:87%;position:absolute;z-index:2;filter:drop-shadow(0 2px 1px #20304930);user-select:none;-webkit-user-drag:element}.square:disabled{opacity:1}.square.last:before{content:"";position:absolute;inset:0;background:#e6d18866;z-index:1}.square.selected{background:#e2c779}.square.legal:after{content:"";position:absolute;width:25%;height:25%;border-radius:50%;background:#22394b36;z-index:3;pointer-events:none}.square.legal.has-piece:after{width:87%;height:87%;border:5px solid #22394b40;background:none}.square.hint:before{content:"";position:absolute;inset:3px;border:3px solid #e9b53e;border-radius:3px;z-index:4;pointer-events:none}.square.in-check{background:#d97c74}.square:focus-visible{outline-offset:-4px;z-index:4}.coord{position:absolute;font-size:9px;font-weight:650;z-index:5;pointer-events:none;color:#6988a3;line-height:1}.dark .coord{color:#f1f4f7}.rank{top:5px;left:4px}.file{bottom:4px;right:5px}.you{height:62px}.turn-badge{font-size:9px;font-weight:500;color:#6e8d77;background:#e6efe7;border-radius:4px;padding:3px 6px;margin-left:6px}.you>.icon-button{margin-left:auto}.captured{display:flex;max-width:180px;overflow:hidden;margin-left:auto;gap:0}.captured img{width:18px;height:22px;margin-left:-4px;opacity:.65}.icon-button{border:0;background:transparent;border-radius:5px;font-size:23px;line-height:1;width:30px;height:30px;color:#8493a3;display:inline-grid;place-items:center}.icon-button:not(:disabled):hover{background:#e5eaf0;color:#365c86}.board-toolbar{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:12px 3px 6px}.switch-label{display:flex;align-items:center;gap:7px;cursor:pointer;font-size:10px;color:#7f8994}.switch-label input{position:absolute;opacity:0;width:30px;height:18px}.switch{width:26px;height:15px;background:#ced3da;border-radius:10px;padding:3px;display:inline-block;transition:background .2s}.switch:after{content:"";display:block;width:9px;height:9px;background:white;border-radius:50%;transition:transform .2s}.switch-label input:checked+.switch{background:#6e91ae}.switch-label input:checked+.switch:after{transform:translateX(11px)}.switch-label input:focus-visible+.switch{outline:3px solid #e2a331;outline-offset:3px}.replay-controls{display:flex;align-items:center;gap:3px}.replay-controls .icon-button{width:25px;height:27px}.replay-controls>span{font-size:10px;color:#8c96a1;min-width:63px;text-align:center;margin:0 3px}.board-note{font-size:10px;color:#97a0a9;display:flex;align-items:center;justify-content:center;gap:6px;margin:10px 0 0}.board-note .green-dot{height:5px;width:5px}.note-separator{margin:0 2px}.sidebar{display:flex;flex-direction:column;gap:13px;padding-top:7px}.status-card{background:#eaf0f6;border:1px solid #dfe7f0;border-radius:12px;padding:19px 20px 17px}.section-label{display:flex;align-items:center;gap:7px;color:#7390aa;font-size:10px;font-weight:500}.move-counter{margin-left:auto;font-size:10px;color:#96a4b2}.status-card h2{font-size:22px;font-weight:600;margin:13px 0 8px;letter-spacing:.5px}.status-card p{font-size:11px;color:#7e90a1;line-height:1.8;margin:0}.status-card .text-button{margin-top:10px;color:#426a97;font-size:11px}.difficulty-card{padding:6px 2px 3px}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:6px}.card-heading h2{font-size:12px;font-weight:600;margin:0;display:flex;align-items:center;gap:6px}.small-label{font-size:9px;color:#9aa2ab}.difficulty-options{display:grid;grid-template-columns:repeat(4,1fr);background:#e9edf1;padding:4px;border-radius:8px;gap:3px;margin:11px 0 8px}.difficulty-options button{border:0;background:transparent;border-radius:5px;padding:7px 0;color:#8a939f;font-size:11px}.difficulty-options button[aria-pressed=true]{background:white;color:#416787;font-weight:650;box-shadow:0 1px 4px #273d4d12}.difficulty-options button:not(:disabled):hover{background:#f8fafb}.difficulty-card p{color:#949ca5;font-size:10px;margin:0;line-height:1.7}.hint-card{background:#faf4e7;border:1px solid #eee4cf;border-radius:11px;padding:16px 17px 13px}.hint-card h2{color:#8a7656}.spark{color:#c3a05e;font-size:20px;line-height:1}.hint-step{font-size:9px;color:#b3a488}.hint-card>p{font-size:11px;color:#92836d;line-height:1.9;min-height:39px;margin:10px 0 11px}.hint-button{display:flex;align-items:center;gap:8px;width:100%;border:1px solid #e4d9c2;background:#fffdf7;border-radius:7px;padding:8px 10px;text-align:left;color:#8b7857;font-size:11px}.hint-button:hover{background:#fff}.hint-button>span:first-child{font-size:17px}.button-arrow{margin-left:auto;font-size:16px}.moves-card{background:#fff;border:1px solid var(--line);border-radius:11px;overflow:hidden}.moves-card>.card-heading{padding:12px 16px 9px}.export-link{font-size:19px;color:#a1aab4;line-height:1}.export-link:hover{color:#456d97}.moves-header,.move-row{display:grid;grid-template-columns:42px 1fr 1fr;align-items:center}.moves-header{font-size:9px;color:#a1aab4;padding:5px 15px;background:#fafbfc;border-top:1px solid #f1f3f5;border-bottom:1px solid #f1f3f5}.move-list{height:99px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#d7e0e9 transparent}.move-row{padding:1px 15px;font-size:11px;min-height:29px}.move-row:nth-child(even){background:#fafbfc}.move-row>span{color:#a0a8b2;font-size:10px}.move-row>button{background:transparent;border:0;text-align:left;font-size:12px;letter-spacing:.4px;font-family:"Segoe UI",sans-serif;border-radius:4px;padding:5px 6px}.move-row>button:hover{background:#ecf1f6}.move-row>button.active{color:#426a97;background:#eaf0f6;font-weight:650}.empty-moves{text-align:center;color:#aeb6bd;padding:12px 0}.empty-moves>span{font-size:25px;color:#bcc8d3}.empty-moves p{font-size:10px;margin:4px 0}.game-actions{display:flex;gap:10px}.primary-button,.secondary-button{display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;font-weight:500;border-radius:8px;border:1px solid transparent;padding:11px 15px;white-space:nowrap}.primary-button{background:#426a97;color:#fff;border-color:#426a97;box-shadow:0 2px 2px #38577b0a}.primary-button:not(:disabled):hover{background:#345a86}.secondary-button{background:white;border-color:#dfe5eb;color:#8592a1}.secondary-button:not(:disabled):hover{background:#eef2f6;color:#456584}.game-actions .secondary-button{flex:1}.game-actions .primary-button{flex:1.4}.game-actions button>span{font-size:17px;line-height:1}.sidebar-note{font-size:9px;color:#a4acb4;text-align:center;margin:-2px 0 0;letter-spacing:.2px}footer{border-top:1px solid var(--line);padding:18px 0 20px;margin-top:26px;display:flex;justify-content:space-between;color:#a4abb3;font-size:10px}footer>span:last-child{font-size:8px;letter-spacing:2px}.error-box{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#fff7ed;border:1px solid #ecc5a0;box-shadow:0 8px 32px #22334420;border-radius:10px;padding:13px 16px;display:flex;align-items:center;gap:14px;z-index:20;font-size:12px;max-width:calc(100vw - 32px);width:max-content}.error-box button{border:0;background:transparent;color:#99642f;white-space:nowrap}.error-box button:last-child{font-size:20px}dialog{border:1px solid #e1e6ec;border-radius:18px;box-shadow:0 20px 100px #1b2e4c25;width:430px;max-width:calc(100vw - 30px);padding:30px;color:#304156;background:#fafbfd}dialog::backdrop{background:#1d2d4650;backdrop-filter:blur(4px)}dialog h2{font-size:22px;margin:8px 0 12px;letter-spacing:.4px}dialog p{font-size:12px;line-height:1.9;color:#84909e}dialog .eyebrow{font-size:9px}.dialog-illustration{font-size:46px;color:#698daf;display:block;margin-bottom:12px}.dialog-description{margin-bottom:23px}fieldset{padding:0;border:0;margin:0 0 24px}legend{font-size:12px;margin-bottom:12px}.color-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.color-options label{position:relative}.color-options input{position:absolute;inset:0;opacity:0;cursor:pointer}.color-options label>span{display:flex;align-items:center;flex-direction:column;padding:12px;border:2px solid #e3e8ee;border-radius:10px;gap:5px;background:white}.color-options input:checked+span{border-color:#668db2;background:#eef4f9}.color-options input:focus-visible+span{outline:3px solid #e2a331}.color-options img{width:48px;height:48px}.color-options strong{font-size:12px}.color-options small{font-size:10px;color:#929daa}.dialog-actions{display:flex;gap:12px;justify-content:flex-end}.dialog-close{position:absolute;right:17px;top:14px;border:0;background:transparent;color:#929daa;font-size:25px}.help-items p{padding:11px 0;margin:0;border-bottom:1px solid #e9edf1;font-size:11px}.help-items strong{display:block;color:#526d8a;font-size:12px;margin-bottom:4px}.help-footnote{font-size:10px!important}.promotion-options{display:flex;gap:10px;margin:22px 0}.promotion-options button{border:1px solid #dfe6ee;border-radius:9px;background:white;flex:1;padding:9px 4px;font-size:12px}.promotion-options button:hover{background:#eaf1f7;border-color:#6b8fae}.promotion-options img{display:block;width:48px;height:48px;max-width:100%;margin:0 auto 5px}@keyframes blink{50%{opacity:.3}}@media(min-height:850px){:root{--board-size:min(61vh,572px)}.move-list{height:142px}.sidebar{gap:17px}.status-card{padding-top:24px;padding-bottom:24px}.hint-card{padding-top:19px;padding-bottom:17px}.sidebar-note{margin-top:0}}@media(max-width:1000px){.site-header{padding:0 28px;gap:40px}main{padding:27px 28px 0}.game-layout{gap:25px;grid-template-columns:minmax(0,1fr) 285px}.header-note{font-size:10px}.page-heading{margin-bottom:17px}h1{font-size:24px}}@media(max-height:760px) and (min-width:850px){:root{--board-size:min(61vh,510px)}.site-header{height:70px}main{padding-top:22px}.page-heading{margin-bottom:12px}h1{font-size:24px}.eyebrow{margin-bottom:6px}.intro{font-size:11px}.sidebar{gap:10px}.status-card{padding:14px 17px}.status-card h2{margin:10px 0 5px;font-size:20px}.hint-card{padding:13px 15px 11px}.move-list{height:83px}.player-row{height:50px}.you{height:54px}footer{margin-top:17px;padding-top:14px}.board-toolbar{padding-top:8px}}@media(max-width:740px){.site-header{height:73px;padding:0 20px;gap:0;justify-content:space-between}.site-header nav{gap:24px}.header-note{display:none}.brand strong{font-size:19px}.brand small{font-size:7px}.brand-mark{width:37px;height:37px}main{padding:24px 18px 0}.page-heading{margin-bottom:15px}.mode-tag{display:none}h1{font-size:23px}.intro{font-size:11px;line-height:1.7}.game-layout{display:flex;flex-direction:column;gap:22px}.play-area{max-width:540px;margin:auto}.sidebar{width:100%;max-width:540px;margin:auto;display:grid;grid-template-columns:1fr 1fr;gap:14px}.status-card,.difficulty-card{grid-column:span 1}.status-card{padding:16px}.status-card h2{font-size:19px}.move-counter{display:none}.hint-card,.moves-card,.game-actions,.sidebar-note{grid-column:span 2}.difficulty-card{align-self:center}.difficulty-options{gap:0}.difficulty-options button{font-size:10px}.card-heading h2{font-size:11px}.small-label{display:none}.hint-card>p{min-height:0}.move-list{height:120px}.board-note{font-size:9px}footer{margin-top:26px}.board-toolbar{gap:8px}.board-toolbar .switch-label{font-size:9px}.replay-controls{gap:0}.replay-controls>span{font-size:9px;min-width:56px}.replay-controls .icon-button{width:23px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* Laptop layout: reserve room for the controls, including at 125% scaling. */
@media (min-width:741px){
  :root{--board-size:min(560px,calc(100dvh - 325px))}
  .site-header{height:64px;max-width:1120px;padding:0 30px}
  main{max-width:1040px;padding:16px 28px 0}
  .page-heading{margin-bottom:10px;min-height:56px}
  .page-heading .eyebrow{display:none}
  h1{font-size:24px;margin-bottom:5px}.intro{font-size:12px}
  .game-layout{grid-template-columns:minmax(0,calc(var(--board-size) + 16px)) 310px;gap:28px;justify-content:center}
  .play-area{justify-self:end}
  .player-row,.you{height:42px}.avatar{width:31px;height:31px;border-radius:9px}.bot-avatar img{width:27px;height:27px}
  .player-info{gap:2px}.player-info>span{font-size:11px}
  .board-toolbar{padding:6px 2px 0}.board-note{margin-top:6px}
  .sidebar{padding-top:4px;gap:10px}.status-card{padding:12px 16px}.status-card h2{font-size:22px;margin:8px 0 5px}.status-card p{font-size:12px;line-height:1.6}
  .card-heading h2{font-size:13px}.difficulty-card{padding:2px}.difficulty-options{margin:8px 0 6px}.difficulty-options button{font-size:12px;padding:6px 0}.difficulty-card p{font-size:11px}
  .hint-card{padding:12px 14px}.hint-card>p{font-size:12px;line-height:1.7;min-height:0;margin:8px 0}.hint-button{font-size:12px;padding:7px 9px}
  .move-list{height:68px}.moves-card>.card-heading{padding:10px 14px 8px}.moves-header{font-size:10px}.move-row>button{font-size:13px}
  .sidebar-note{display:none}.game-actions button{padding:10px 12px;font-size:13px}
  footer{margin-top:16px;padding:12px 0}
}
@media (min-width:741px) and (max-height:800px){footer{display:none}}
@media (min-width:741px) and (max-height:680px){
  :root{--board-size:min(460px,calc(100dvh - 275px))}
  .site-header{height:50px}.brand-mark{width:34px;height:34px}.brand-mark img{width:29px;height:29px}.brand strong{font-size:18px}.brand small{font-size:7px}
  main{padding-top:10px}.page-heading{min-height:34px;margin-bottom:8px}h1{font-size:21px;margin:0}.intro{display:none}
  .sidebar{gap:8px}.status-card{padding:9px 14px}.status-card h2{font-size:20px;margin:5px 0 3px}.status-card p{font-size:11px}
  .hint-card{padding:10px 12px}.hint-card>p{font-size:11px;margin:6px 0;line-height:1.6}.hint-step{display:none}
  .move-list{height:49px}.empty-moves{padding:5px 0}.empty-moves p{display:none}.moves-card>.card-heading{padding:8px 12px 6px}.game-actions button{padding:8px 10px}
}
@media (min-width:741px) and (max-height:600px){
  .site-header{height:44px}main{padding-top:6px}.page-heading{min-height:24px;margin-bottom:4px}
  .sidebar{gap:6px}.move-list{height:41px}
}

.license-link{display:block;text-align:center;font-size:10px;color:#8290a0;padding:12px}
