:root{--ink:#082f48;--muted:#6b7f8d;--blue:#00a5dc;--line:#d9e6ec}*{box-sizing:border-box}body{margin:0;background:#f3f8fb;color:var(--ink);font:14px/1.7 Manrope,Arial,sans-serif}a{color:inherit;text-decoration:none}button,select{font:inherit}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;color:inherit}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #f1b849;outline-offset:3px}[hidden]{display:none!important}.chess-header{display:flex;gap:25px;align-items:center;justify-content:space-between;padding:17px 5%;background:#fff;border-bottom:1px solid var(--line)}.chess-header>a:first-child{display:flex;gap:12px;align-items:center}.chess-header img{width:45px;height:45px;border-radius:6px}.chess-header>a:first-child>span{font-weight:800;font-size:13px;letter-spacing:1px;line-height:1.25}.chess-header small{display:block;font-size:8px;letter-spacing:3px;margin-top:5px;color:#008fc0}.chess-header>a:nth-child(2){font-size:10px;font-weight:700;padding:10px}.chess-header>span{font-size:9px;color:var(--muted);max-width:230px;text-align:right}main{max-width:1250px;margin:auto;padding:38px 4% 60px}.chess-intro>p{font-size:8px;font-weight:800;letter-spacing:1.6px;color:#008bbd}.chess-intro h1{font-size:clamp(32px,3.6vw,48px);letter-spacing:-2px;line-height:1.08;margin:16px 0 18px}.chess-intro>span{font-size:12px;color:var(--muted)}.chess-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:38px;margin-top:35px;align-items:start}.board-panel{min-width:0}.player-line{display:flex;align-items:center;gap:11px;min-height:54px;padding-bottom:13px}.player-avatar{display:grid;place-items:center;width:37px;height:37px;border-radius:50%;background:#082f48;color:#fff;font-size:26px}.player-avatar.blue{background:#bfefff;color:#0089bc}.player-line b{display:block;font-size:12px;line-height:1.3}.player-line div>span{display:block;font-size:9px;color:var(--muted);margin-top:4px}.player-line>#eval-text{margin-left:auto;font-size:16px;font-weight:800;color:#0087b8}.board-wrap{padding:10px;background:#082f48;border-radius:7px;box-shadow:0 18px 40px #05324d1a}.chessboard{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1;position:relative}.square{border:0;border-radius:0;aspect-ratio:1;padding:0;position:relative;display:grid;place-items:center;min-width:0;overflow:hidden;background:#d9eef1;transition:background .1s}.square.dark{background:#58a8b4}.square.last{background:#a6d8a5}.square.dark.last{background:#71b99b}.square.selected{background:#ffe28b}.square.dark.selected{background:#dbcb74}.square img{width:87%;height:87%;position:relative;z-index:2;filter:drop-shadow(0 3px 1px #001e3c30);pointer-events:none}.square .coord{position:absolute;z-index:3;font-size:8px;font-weight:800;line-height:1;color:#086477}.square.dark .coord{color:#d6f4fa}.square .rank{left:3px;top:3px}.square .file{right:3px;bottom:3px}.square.legal:after{content:'';position:absolute;width:22%;height:22%;border-radius:50%;background:#06364a44;z-index:4}.square.legal:has(img):after{width:90%;height:90%;background:transparent;border:4px solid #06364a66}.square.hint{box-shadow:inset 0 0 0 4px #ffe27a}.square.check{background:#f38b77}.bottom-player{padding:16px 0 0}.board-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:17px}.board-actions button{background:#fff;border:1px solid var(--line);min-height:44px;padding:10px 6px;font-size:9px;font-weight:700}.board-actions #hint-move{background:var(--ink);border-color:var(--ink);color:#fff}.chess-tabs{display:flex;gap:7px;margin-bottom:20px}.chess-tabs button{flex:1;min-height:44px;padding:12px;background:#e7f0f5;font-size:11px;font-weight:700}.chess-tabs button.active{background:#00a4da;color:#fff}.chess-sidebar label{font-size:10px;font-weight:700;display:block}.chess-sidebar select{display:block;width:100%;margin-top:8px;border:1px solid var(--line);background:#fff;padding:12px;color:var(--ink);font-size:12px;border-radius:0;min-height:46px}.chess-sidebar #play-settings>p,.chess-sidebar #lesson-settings>p{font-size:9px;color:var(--muted);line-height:1.8;margin:12px 0 0}.coach-box{background:#fff;border:1px solid var(--line);padding:24px;margin-top:23px}.coach-box>p:first-child{font-size:7px;letter-spacing:1.2px;color:#008bbc;font-weight:800;margin:0 0 13px}.coach-box h2{font-size:23px;letter-spacing:-.7px;line-height:1.25;margin:0 0 16px}.coach-box #coach-message{font-size:11px;color:var(--muted);line-height:1.9}.engine-line{font-size:10px;color:#0085b2;line-height:1.8;margin:16px 0 0;overflow-wrap:anywhere}.move-panel{border:1px solid var(--line);margin-top:20px;background:#fff;padding:18px 20px}.move-panel>div{display:flex;justify-content:space-between;gap:12px;align-items:center}.move-panel b{font-size:11px}.move-panel button{background:transparent;font-size:9px;color:#007daa;padding:8px 0;min-height:35px}.move-panel ol{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;margin:12px 0 0;padding-left:22px;max-height:180px;overflow-y:auto;font-size:12px}.move-panel li{padding-left:4px}.move-panel li::marker{font-size:9px;color:#78909b}.move-panel #chess-notice{font-size:9px;color:#0082b0;line-height:1.8}.chess-principles{margin-top:22px;display:flex;flex-direction:column;gap:8px;font-size:10px;color:var(--muted);padding:0 4px}.chess-principles b{font-size:12px;color:var(--ink);margin-bottom:4px}footer{padding:25px 5%;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:20px;font-size:8px;color:var(--muted);background:#fff}footer>div{display:flex;gap:18px}footer a{color:#007eab}dialog{border:0;background:#fff;color:var(--ink);padding:30px;max-width:94vw;box-shadow:0 20px 100px #00243d60}dialog::backdrop{background:#052f49aa;backdrop-filter:blur(4px)}dialog h2{font-size:21px;line-height:1.4;margin:0 0 20px}#promotion-choices{display:flex;gap:10px}#promotion-choices button{width:64px;height:74px;background:#e9f5fb;border:1px solid var(--line)}#promotion-choices img{width:55px;height:55px}@media(max-width:760px){.chess-header{padding:12px 5%;gap:12px;flex-wrap:wrap}.chess-header img{width:40px;height:40px}.chess-header>a:first-child>span{font-size:11px}.chess-header>a:nth-child(2){margin-left:auto;font-size:9px;padding:10px 0}.chess-header>span{font-size:8px;flex-basis:100%;max-width:none;text-align:left;margin-left:52px}main{padding:28px 5% 40px}.chess-intro h1{font-size:33px;letter-spacing:-1.4px}.chess-intro>span{font-size:11px;line-height:1.8;display:block}.chess-layout{grid-template-columns:minmax(0,1fr);gap:30px;margin-top:26px}.board-wrap{padding:6px}.player-line b{font-size:11px}.player-line div>span{font-size:9px}.player-avatar{height:32px;width:32px;font-size:22px}.player-line>#eval-text{font-size:14px}.square .coord{font-size:6px}.board-actions{gap:5px}.board-actions button{font-size:8px;min-height:46px;padding:8px 4px}.chess-tabs button{min-height:47px;font-size:12px}.chess-sidebar select{font-size:16px;min-height:48px}.coach-box{padding:22px}.coach-box h2{font-size:24px}.coach-box #coach-message{font-size:12px}.engine-line{font-size:10px}.chess-sidebar #play-settings>p,.chess-sidebar #lesson-settings>p{font-size:10px}.move-panel ol{max-height:200px}.chess-principles{font-size:11px}footer{display:block;font-size:8px;line-height:1.9;padding:23px 5%}footer>div{flex-wrap:wrap;gap:12px;margin-top:15px}footer a{min-height:35px;display:flex;align-items:center}dialog{padding:22px}dialog h2{font-size:19px}#promotion-choices{gap:5px}#promotion-choices button{width:53px;height:65px}#promotion-choices img{width:47px;height:47px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.chess-layout {
  grid-template-areas: "board setup" "board sidebar";
  grid-template-rows: auto 1fr;
  row-gap: 16px;
}
.board-panel { grid-area: board; }
.chess-sidebar { grid-area: sidebar; min-width: 0; }
.chess-setup {
  grid-area: setup;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--theme-line, var(--line));
  background: var(--theme-surface, #fff);
}
.chess-setup .chess-tabs { margin-bottom: 14px; }
.chess-setup label { display: block; font-weight: 700; }
.chess-setup select {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--theme-line, var(--line));
  background: var(--theme-bg, #fff);
  color: var(--theme-ink, var(--ink));
  font-size: 16px;
}
.chess-setup p { margin: 8px 0 0; color: var(--theme-muted, var(--muted)); }
.chess-sidebar .coach-box { margin-top: 0; }
.lesson-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.lesson-progress button {
  min-height: 44px;
  padding: 8px 12px;
  background: #00638b;
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
}
.lesson-progress button:disabled { opacity: .55; cursor: default; }
.board-actions button:disabled { opacity: .6; cursor: default; }
@media (max-width: 760px) {
  .chess-layout {
    grid-template-areas: "setup" "board" "sidebar";
    grid-template-rows: auto;
    gap: 16px;
  }
  .chess-setup { padding: 12px; }
}
