﻿:root{--bg:#f5f4ed;--ink:#233b32;--green:#37664d;--muted:#758076;--line:#dcdfd3}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 system-ui,sans-serif}header{display:flex;align-items:center;gap:32px;max-width:1240px;margin:auto;padding:24px 32px;border-bottom:1px solid var(--line)}a{color:inherit;text-decoration:none}.brand{font-size:24px;font-weight:800}nav{display:flex;gap:24px;flex:1}nav a:hover{color:#62914c}#xp,.tag{background:#e7edda;border-radius:30px;padding:5px 15px;font-weight:700}main{max-width:1180px;margin:auto;padding:48px 32px}h1{font-size:clamp(32px,5vw,56px);line-height:1.15;letter-spacing:-2px;margin:16px 0}h2{line-height:1.3}p{color:var(--muted)}.eyebrow{font-size:12px;font-weight:800;letter-spacing:3px;text-transform:uppercase;color:var(--green)}.hero{display:grid;grid-template-columns:1.4fr 1fr;gap:40px;align-items:center;margin-bottom:40px}.hero-art{font-size:130px;text-align:center;background:#e8ebdd;border-radius:100px 100px 28px 28px;letter-spacing:-24px;color:var(--green)}button,.button{cursor:pointer;display:inline-block;border:1px solid var(--line);background:white;border-radius:12px;padding:12px 19px;color:var(--ink);font:inherit;font-weight:650}button:hover,.button:hover{background:#e8eddf}button:disabled{opacity:.45;cursor:not-allowed}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#284d39}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin:28px 0}.card,.panel{border:1px solid var(--line);border-radius:20px;background:#fffefa;padding:24px}.stats strong{display:block;font-size:30px}.stats span{color:var(--muted);font-size:14px}.layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);gap:32px}.path{display:grid;gap:14px}.lesson{display:flex;align-items:center;gap:20px}.step{flex-shrink:0;width:52px;height:52px;display:grid;place-items:center;border-radius:50%;background:#e7edda;font-size:22px}.lesson h3{margin:0}.lesson p{margin:3px 0;font-size:14px}.lesson .button{margin-left:auto}.board{display:grid;grid-template-columns:repeat(8,1fr);border:8px solid #344e3e;border-radius:8px;overflow:hidden;aspect-ratio:1}.square{position:relative;border:0;border-radius:0;padding:0;aspect-ratio:1;background:#eee9d6;display:grid;place-items:center;font-family:'Segoe UI Symbol','Arial Unicode MS',serif;font-size:clamp(26px,5vw,58px);line-height:1;color:#172b23}.square.dark{background:#85a080}.square:hover{background:#c5d193}.square.white-piece{color:#fffdf4;text-shadow:0 2px 2px #253a29,-1px 0 #253a29,0 -1px #253a29,1px 0 #253a29}.square.selected{background:#e4c563}.square.last{box-shadow:inset 0 0 0 4px #d5bc6980}.square.legal:after{content:'';position:absolute;width:24%;height:24%;background:#253e4570;border-radius:50%}.coord{position:absolute;left:4px;bottom:2px;font:10px system-ui;color:#243c2d;text-shadow:none}.player{display:flex;justify-content:space-between;align-items:center;padding:12px 0}.clock{font-size:24px;font-variant-numeric:tabular-nums;font-weight:750}.active-clock{color:var(--green);background:#e3ebd7;border-radius:8px;padding:0 8px}label{display:block;font-size:14px;margin:14px 0 5px}select{width:100%;padding:10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit}.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.status{background:#edf1e6;border-radius:12px;padding:15px;margin:18px 0;font-weight:650}.history{max-height:150px;overflow:auto;font-family:monospace;word-spacing:8px}.small{font-size:13px;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:20px;max-width:380px}dialog::backdrop{background:#182c2870}dialog button{font-size:30px;margin:4px}:focus-visible{outline:3px solid #c49a35;outline-offset:2px}footer{margin-top:40px;font-size:13px;color:var(--muted)}@media(max-width:760px){header{padding:18px;gap:16px;flex-wrap:wrap}.brand{font-size:21px}nav{order:3;width:100%}main{padding:28px 16px}.layout,.hero{grid-template-columns:1fr}.hero-art{display:none}.lesson{gap:10px;padding:16px}.lesson .button{padding:8px;font-size:13px}.square{font-size:9vw}.stats{gap:8px}.stats .card{padding:14px}h1{letter-spacing:-1px}}

/* Sculpted pieces and game controls */
.board{overflow:visible;isolation:isolate;box-shadow:0 10px 0 #233b32,0 18px 28px #233b3226}.square{overflow:visible;touch-action:manipulation}.square .piece{position:relative;z-index:2;width:94%;height:94%;pointer-events:none;overflow:visible;filter:drop-shadow(1px 3px 1px #14221945)}.piece-body{stroke-width:1.5;stroke-linejoin:round;paint-order:stroke fill}.piece-w .piece-body{fill:#f0e3c4;stroke:#756449}.piece-b .piece-body{fill:#354740;stroke:#101f1c}.piece-w .piece-body>path:not(.piece-detail):not(.piece-shine){filter:drop-shadow(0 2px 0 #b5a17a)}.piece-b .piece-body>path:not(.piece-detail):not(.piece-shine){filter:drop-shadow(0 2px 0 #14251e)}.piece-shadow{fill:#14261e35;stroke:none}.piece-detail{fill:none;stroke:#8d7957;stroke-width:3;stroke-linecap:round}.piece-b .piece-detail{stroke:#86958b}.piece-eye{fill:#24362f;stroke:none}.piece-b .piece-eye{fill:#e3d8ba}.piece-shine{fill:none;stroke:#fff8dd;stroke-width:2;stroke-linecap:round;opacity:.8}.piece-b .piece-shine{stroke:#8eaa98;opacity:.6}.square.selected .piece{filter:drop-shadow(0 5px 2px #14221960);transform:translateY(-3px)}.square.legal:after{z-index:3;pointer-events:none}.square.capture-target:after{width:85%;height:85%;background:transparent;border:4px solid #8a493d99}.square.in-check{background:#d9987c;box-shadow:inset 0 0 0 3px #a34937}.board-tools{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.board-tools button,.compact{font-size:13px;padding:8px 12px}.captured{font-size:14px;color:var(--muted);min-height:30px;margin-top:12px}.thinking{display:flex;align-items:center;gap:12px;background:#e8eddf;border:1px solid #d0ddc8;border-radius:12px;padding:12px;margin-top:18px;font-weight:650}.thinking-knight{font-size:32px;animation:bot-nod 1.4s ease-in-out infinite}.thinking-dots{display:inline-flex;gap:4px;margin-left:8px}.thinking-dots i{width:5px;height:5px;border-radius:50%;background:var(--green);animation:bot-dot 1.2s infinite}.thinking-dots i:nth-child(2){animation-delay:.2s}.thinking-dots i:nth-child(3){animation-delay:.4s}.bot-clock-thinking{box-shadow:0 0 0 2px #a5b58a}.history-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.history{word-spacing:normal;max-height:220px}.move-row{display:grid;grid-template-columns:35px 1fr 1fr;padding:6px 10px;border-radius:5px}.move-row:nth-child(odd){background:#edf0e6}.move-row>span:first-child{color:var(--muted)}.move-row:last-child{font-weight:750;color:var(--green)}.board-reversed{display:flex;flex-direction:column}.board-reversed>.player:first-child{order:2}.board-reversed>#board{order:1}.board-reversed>.player:nth-child(3){order:0}.board-reversed>.board-tools{order:3}.board-reversed>.captured{order:4}@keyframes bot-nod{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(7deg) translateY(-3px)}}@keyframes bot-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){.thinking-knight,.thinking-dots i{animation:none}}

/* Minimal welcome */
[hidden]{display:none!important}.minimal-welcome{min-height:calc(100svh - 190px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px 0 64px;animation:welcome-in .6s ease-out both}.minimal-welcome h1{font-size:clamp(34px,5vw,60px);line-height:1.15;letter-spacing:-2px;margin:16px 0}.minimal-description{max-width:400px;margin:4px 0 24px;font-size:17px;line-height:1.7}.minimal-mark{width:112px;height:112px;position:relative;display:grid;place-items:center;margin-bottom:28px}.minimal-ring{position:absolute;inset:0;border-radius:50%;background:#e7ecde}.minimal-knight{position:relative;font-family:'Segoe UI Symbol',serif;font-size:78px;line-height:1;color:var(--green);text-shadow:0 5px 0 #c7d3bf;animation:knight-breathe 4s ease-in-out infinite}.welcome-cta{padding:15px 24px;transition:transform .2s,box-shadow .2s}.welcome-cta span{margin-left:14px}.welcome-cta:hover{transform:translateY(-2px);box-shadow:0 8px 20px #233b3215}.on-welcome #xp{display:none}.on-welcome header{border-bottom-color:transparent}.on-welcome nav{justify-content:flex-end}.learning-heading{margin:24px 0 35px}.learning-view{animation:welcome-in .35s ease-out both}@keyframes welcome-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes knight-breathe{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-5px) rotate(3deg)}}@media(max-width:760px){.minimal-welcome{min-height:calc(100svh - 190px);padding:20px 0 44px}.minimal-welcome h1{letter-spacing:-1px}.minimal-description{font-size:16px;max-width:290px}.on-welcome nav{justify-content:flex-start}.minimal-mark{width:96px;height:96px;margin-bottom:22px}.minimal-knight{font-size:68px}}@media(prefers-reduced-motion:reduce){.minimal-welcome,.minimal-knight,.learning-view{animation:none}.welcome-cta{transition:none}.welcome-cta:hover{transform:none}}
/* Keep the bot notification visible while watching the board. */
.thinking{position:fixed;bottom:24px;right:24px;z-index:30;margin:0;min-width:220px;padding:14px 20px;background:#f2f6e9;border-color:#a5b58a;box-shadow:0 8px 30px #233b3226;pointer-events:none}
@media(max-width:760px){.thinking{bottom:16px;right:16px;min-width:0;max-width:calc(100vw - 32px);padding:10px 16px}}

/* Wooden board: raised frame, inset playing surface and beveled squares. */
.board{
 position:relative;
 padding:clamp(9px,2vw,18px);
 border:2px solid #5c3825;
 border-top-color:#c59662;
 border-left-color:#997047;
 border-radius:14px;
 background:
  linear-gradient(125deg,#ffffff16,transparent 35%,#130d0826),
  repeating-linear-gradient(3deg,#24110930 0 1px,#bb875517 2px 3px,transparent 4px 9px),repeating-linear-gradient(176deg,transparent 0 18px,#deab7020 19px 20px,transparent 21px 37px),
  linear-gradient(110deg,#825238,#462b20 45%,#71452e);
 grid-template-rows:repeat(8,minmax(0,1fr));
 box-shadow:
  inset 0 2px 1px #f6dfb580,
  inset 2px 0 1px #f6dfb535,
  inset 0 -3px 2px #38241680,
  0 3px 0 #6c472e,
  0 7px 0 #573a27,
  0 11px 0 #422e21,
  0 13px 2px #2f211b,
  0 22px 24px -9px #36281966,
  0 35px 45px -17px #233b3240;
 margin-bottom:16px;
}
.board:before{
 content:'';
 position:absolute;
 inset:clamp(7px,calc(2vw - 2px),16px);
 border:2px solid #433323;
 border-bottom-color:#d6bb8e;
 border-right-color:#bd9866;
 box-shadow:0 0 0 1px #d3b47b66,inset 0 2px 5px #241a1933;
 border-radius:2px;
 pointer-events:none;
 z-index:4;
}
.board .square{
 min-width:0;
 min-height:0;
 aspect-ratio:auto;
 background:
  repeating-linear-gradient(3deg,#8051240d 0 1px,transparent 2px 6px),repeating-linear-gradient(177deg,transparent 0 14px,#fff2d327 15px 17px,transparent 18px 29px),linear-gradient(125deg,#c0a98d,#ad9275 65%,#9f8367);
 box-shadow:inset 0 1px 0 #fff8e9a6,inset 1px 0 0 #fff8e94d,inset 0 -1px 0 #92734e33,inset -1px 0 0 #92734e26;
 transition:background-color .18s;
}
.board .square.dark{
 background:
  repeating-linear-gradient(2deg,#321a0c20 0 1px,transparent 2px 6px),repeating-linear-gradient(178deg,transparent 0 13px,#d99d611c 14px 16px,transparent 17px 28px),linear-gradient(125deg,#a3724b,#8a5837 65%,#76472e);
 box-shadow:inset 0 1px 0 #f6c99040,inset 1px 0 0 #f6c99026,inset 0 -1px 0 #41251940,inset -1px 0 0 #41251926;
}
.board .square:hover{background:linear-gradient(135deg,#f2d39a,#c89c5f)}
.board .square.last{background:linear-gradient(135deg,#e4c07d,#b68845);box-shadow:inset 0 0 0 2px #ac944f80}
.board .square.selected{background:linear-gradient(135deg,#f1dc96,#d0b367);box-shadow:inset 0 0 0 3px #ac8339,inset 0 2px 8px #78592526}
.board .square.in-check{background:radial-gradient(ellipse at center,#e9b59c,#c77d66);box-shadow:inset 0 0 0 3px #a34937}
.board .square:focus-visible{outline:3px solid #f4cf71;outline-offset:-4px;z-index:5}
.board .coord{color:#625039;left:4px;bottom:3px;font-size:10px;font-weight:650;opacity:.9;z-index:3;pointer-events:none}
.board .dark .coord{color:#f4ecd6}
.board .square.last .coord,.board .square.selected .coord{color:#4c3c25}
.board .square .piece{filter:drop-shadow(2px 5px 2px #17241b55)}
.board .square.selected .piece{filter:drop-shadow(2px 7px 3px #17241b66)}
.board .square.legal:after{background:#49311dcc;box-shadow:0 1px 2px #f8efcf55}
.board .square.capture-target:after{background:transparent;border-color:#a64e3abb;box-shadow:none}
@media(max-width:760px){
 .board{border-radius:10px;box-shadow:inset 0 2px 1px #f6dfb580,inset 0 -2px 2px #38241680,0 3px 0 #6c472e,0 6px 0 #422e21,0 8px 1px #2f211b,0 16px 24px -8px #36281966;margin-bottom:10px}
 .board .coord{font-size:8px;left:2px;bottom:2px}
}

/* Soft overhead light on the polished wooden surface. */
.board:after{content:'';position:absolute;inset:clamp(9px,2vw,18px);pointer-events:none;z-index:1;background:linear-gradient(125deg,#fff7df14,transparent 40%,#30180b12);box-shadow:inset 0 3px 12px #30180b35,inset 0 -2px 7px #30180b18}
.board .square:nth-child(3n){background-position:0 3px,0 -8px,0 0}
.board .square:nth-child(5n){background-position:0 -4px,0 11px,0 0}
.game-analysis{margin-top:40px;scroll-margin-top:24px}.analysis-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:32px;margin-top:24px}.analysis-layout>div{min-width:0}.review-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));width:100%;min-width:0;aspect-ratio:1 / 1;border:8px solid #765135;border-radius:6px;overflow:hidden}.review-square{position:relative;min-width:0;min-height:0;overflow:hidden;background:#e9d8b5}.review-square.dark{background:#547354}.review-square .piece{position:absolute;inset:3%;display:block;width:94%;height:94%;pointer-events:none}.review-square.dark .coord{color:#f4ecd6}.review-controls{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:14px}.review-controls button{padding:8px 12px}.review-controls span{font-size:14px;text-align:center}.analysis-table-wrap{overflow-x:auto}.analysis-table{border-collapse:collapse;width:100%;font-size:14px}.analysis-table th,.analysis-table td{text-align:left;padding:10px;border-bottom:1px solid var(--line)}.analysis-table td{font-variant-numeric:tabular-nums}.analysis-table tbody th{font-weight:500}@media(max-width:760px){.analysis-layout{grid-template-columns:1fr;gap:24px}.game-analysis{padding:18px}.review-controls button{padding:8px 10px}}

/* Course chapters and practice modes */
.course-progress{height:8px;border-radius:10px;background:#e0e6d8;margin:22px 0 30px;overflow:hidden}.course-progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#91b477,#37664d);transition:width .6s ease}.chapter{margin-bottom:26px}.chapter-heading{display:flex;align-items:center;gap:14px;padding:17px 20px;background:#e8eddf;border:1px solid #d9e2cf;border-radius:17px;margin-bottom:16px}.chapter-heading h3{margin:0;font-size:20px}.chapter-heading .eyebrow{font-size:10px;letter-spacing:2px}.chapter-number{font-size:32px;line-height:1;color:#86a176;font-weight:800}.chapter-count{margin-left:auto;font-size:13px;color:var(--green);font-weight:700;white-space:nowrap}.chapter-stages{position:relative;display:grid;gap:12px;padding-left:16px}.chapter-stages:before{content:'';position:absolute;left:40px;top:20px;bottom:20px;width:2px;background:#d0dcc5}.chapter-stages .lesson{position:relative;padding:18px;gap:16px;animation-delay:var(--stage-delay)}.lesson-copy{min-width:0;flex:1}.lesson-meta{display:block;font-size:10px;text-transform:uppercase;letter-spacing:1.2px;color:var(--muted);margin-bottom:3px}.lesson h3{font-size:17px}.lesson .step{border:3px solid #fffefa;box-shadow:0 3px 0 #c4d1b6;width:48px;height:48px;font-family:'Segoe UI Symbol',system-ui,sans-serif}.lesson.is-current{border-color:#8fac7c;box-shadow:0 5px 18px #37664d0d}.lesson.is-current .step{background:#37664d;color:#f5f2dc;box-shadow:0 3px 0 #233b32}.lesson.is-complete .step{background:#dcebcf;color:#37664d}.lesson.is-locked{background:#f0f1ea;border-color:#e1e4da}.lesson.is-locked .step{background:#e0e4d9;color:#9aa48e;box-shadow:0 3px 0 #d2d8ca}.lesson.is-locked h3{color:#798674}.locked-label{font-size:11px;color:#8c9586;padding:6px 10px;border:1px solid #dce0d5;border-radius:20px}.mode-sidebar{align-self:start;position:sticky;top:24px}.mode-sidebar h2{margin-top:8px}.mode-card{display:flex;align-items:center;gap:15px;padding:24px 18px;border-radius:19px;border:1px solid #d7dfcb;margin-bottom:14px;background:#e8eddf;transition:transform .2s,box-shadow .2s,border-color .2s}.mode-card strong{display:block;font-size:18px}.mode-card small{display:block;color:#66775e;font-size:12px;margin-top:3px;line-height:1.5}.mode-icon{font-size:34px;font-family:'Segoe UI Symbol',serif;flex-shrink:0}.mode-arrow{margin-left:auto;font-size:21px}.mode-friend{background:#f0e8d8;border-color:#e2d8c6}.mode-puzzle{background:#e4eae7;border-color:#d2ddd7}.mode-card:hover{transform:translateY(-4px);box-shadow:0 10px 20px #233b3212;border-color:#a2b392}.course-note{padding:18px 6px}.course-note p{font-size:14px}.mode-card:hover .mode-arrow{transform:translate(2px,-2px)}.mode-arrow{transition:transform .2s}
/* Small motion throughout the interface; chess move animation remains independent. */
header{animation:ui-arrive .45s ease-out both}main{animation:ui-arrive .5s ease-out both}.card,.panel,.mode-card,.chapter-heading{animation:ui-arrive .45s ease-out both}button,.button,select,a{transition:background-color .18s,color .18s,border-color .18s,box-shadow .18s,transform .18s}button:not(.square):not(:disabled):hover,.button:hover{transform:translateY(-2px);box-shadow:0 5px 12px #233b3212}button:not(.square):not(:disabled):active,.button:active{transform:translateY(1px) scale(.98)}select:focus{box-shadow:0 0 0 3px #8fac7c30}a.brand:hover{transform:translateY(-1px)}.lesson:hover{box-shadow:0 6px 16px #233b3210}.status{transition:background-color .2s;animation:ui-arrive .3s ease-out both}.thinking:not([hidden]){animation:ui-arrive .25s ease-out both}dialog[open]{animation:ui-arrive .2s ease-out both}.move-row{animation:ui-arrive .2s ease-out both}.review-square .piece{animation:piece-appear .2s ease-out both}.square{transition:box-shadow .16s,background-color .16s}.square:hover .coord{opacity:1}@keyframes ui-arrive{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}@keyframes piece-appear{from{opacity:.5}to{opacity:1}}
@media(max-width:760px){.mode-sidebar{position:static}.chapter-stages{padding-left:5px}.chapter-stages:before{left:27px}.chapter-stages .lesson{padding:12px;gap:9px}.lesson .step{width:38px;height:38px;font-size:19px}.lesson h3{font-size:15px}.lesson p{font-size:12px}.lesson-meta{font-size:9px}.locked-label{font-size:10px;padding:4px 6px}.chapter-heading{padding:14px}.chapter-heading h3{font-size:18px}.mode-card{padding:18px}.lesson .button{white-space:nowrap}.chapter-stages .lesson .button{font-size:12px;padding:8px}.layout>section{min-width:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}button:not(.square):hover,.button:hover,button:active,.button:active,.mode-card:hover{transform:none}}

/* Release entrance transforms so fixed notifications stay anchored to the viewport. */
main,.card,.panel,.mode-card,.chapter-heading{animation-fill-mode:backwards}

/* Match setup and physical clock workflow. */
.game-settings{margin-top:22px}.setting-section{border:0;padding:0;margin:0 0 22px;min-width:0}.setting-section legend{font-size:12px;text-transform:uppercase;letter-spacing:1.4px;font-weight:750;margin-bottom:10px;color:var(--muted)}.opponent-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.opponent-choices button{display:grid;text-align:left;gap:3px;padding:14px;min-width:0}.choice-symbol{font-size:30px;line-height:1.2;font-family:'Segoe UI Symbol',serif}.game-settings button small{font-weight:400;font-size:11px;line-height:1.4;color:var(--muted)}.game-settings button strong{font-size:13px;line-height:1.3}.game-settings button[aria-pressed="true"]{border-color:#638451;background:#e7eddf;box-shadow:inset 0 0 0 1px #638451,0 4px 10px #233b320a}.difficulty-choices{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.difficulty-choices button{display:flex;flex-direction:column;align-items:flex-start;padding:10px 12px;gap:5px}.difficulty-bars{letter-spacing:2px;color:var(--green);font-size:15px}.time-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.time-choices button{display:flex;flex-direction:column;align-items:center;padding:10px 5px;gap:3px}.time-choices button strong{font-size:23px;font-variant-numeric:tabular-nums}.time-choices button:last-child{grid-column:span 2}.custom-time{display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:10px;margin-top:12px;background:#e7eddf80;padding:12px;border-radius:12px}.custom-time label{margin:0;font-size:12px}.custom-time input{display:block;width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:#fffefa;padding:10px;font:600 18px system-ui;color:var(--ink);margin-top:5px}.custom-time>span{padding-bottom:9px;font-size:20px}.custom-time>small{grid-column:1/-1;font-size:11px;color:var(--muted)}.clock-help{font-size:12px;line-height:1.65;padding:12px 14px;background:#e8eddf80;border-radius:10px}.clock-button{min-width:104px;padding:8px 14px;line-height:1.3;font-size:25px;border-radius:12px;border:1px solid var(--line);font-variant-numeric:tabular-nums}.clock-button:disabled{opacity:1;cursor:default}.clock-button.awaiting-press{background:#37664d;color:white;border-color:#37664d;box-shadow:0 0 0 4px #63845126;animation:clock-call 1.7s ease-in-out infinite}.clock-button.awaiting-press:after{content:'Нажми после хода';display:block;font-size:10px;font-weight:500;line-height:1.8}.clock-instruction{font-size:13px;color:var(--green);padding:10px 12px;background:#e5edda;border-radius:9px;margin-top:8px}.board-reversed>.clock-instruction{order:3}.board-reversed>.board-tools{order:4}.board-reversed>.captured{order:5}@keyframes clock-call{0%,100%{box-shadow:0 0 0 3px #63845120}50%{box-shadow:0 0 0 7px #63845135}}@media(prefers-reduced-motion:reduce){.clock-button.awaiting-press{animation:none}}

/* The arrow is part of each mode link and shares its destination. */
.mode-arrow{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border-radius:50%;border:1px solid #9aac8e80;background:#fffefa80;font:22px/1 system-ui;transition:transform .2s,background-color .2s,border-color .2s}
.mode-card:hover .mode-arrow,.mode-card:focus-visible .mode-arrow{transform:translateX(3px);background:#fffefa;border-color:#638451}
@media(prefers-reduced-motion:reduce){.mode-card:hover .mode-arrow,.mode-card:focus-visible .mode-arrow{transform:none}}

/* Persistent piece appearance, shared by board, previews and review. */
svg.piece-w linearGradient stop:nth-child(1){stop-color:var(--piece-w-light,#ffffff)}svg.piece-w linearGradient stop:nth-child(2){stop-color:var(--piece-w-base,#ffffff)}svg.piece-w linearGradient stop:nth-child(3){stop-color:var(--piece-w-shade,#b3b3b3)}svg.piece-b linearGradient stop:nth-child(1){stop-color:var(--piece-b-light,#4f4f4f)}svg.piece-b linearGradient stop:nth-child(2){stop-color:var(--piece-b-base,#141414)}svg.piece-b linearGradient stop:nth-child(3){stop-color:var(--piece-b-shade,#0e0e0e)}
svg.piece-w .piece-body{stroke:#777;fill:var(--piece-w-base,#fff)}svg.piece-b .piece-body{stroke:#080808;fill:var(--piece-b-base,#141414)}svg.piece-w .piece-detail{stroke:#777}svg.piece-b .piece-detail{stroke:#999}svg.piece-w .piece-shine{stroke:#fff}svg.piece-b .piece-shine{stroke:#aaa}
.piece-customizer{border:1px solid var(--line);border-radius:14px;margin-top:16px;background:#fffefa;order:5}.piece-customizer summary{padding:14px 16px;cursor:pointer;font-weight:650;font-size:14px}.piece-customizer summary>span{float:right;font-size:12px;color:var(--muted);font-weight:400}.piece-customizer-content{padding:0 16px 16px}.piece-customizer fieldset{margin:12px 0 20px;padding:0;border:0;min-width:0}.piece-customizer legend{font-size:12px;font-weight:650;margin-bottom:10px;color:var(--muted)}.piece-style-options{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.piece-style-options button{min-width:0;padding:10px 5px;display:grid;gap:5px;justify-items:center}.piece-style-options strong{font-size:11px}.piece-preview{display:flex;justify-content:center;height:66px;pointer-events:none}.piece-preview .piece{width:50%;max-width:58px;height:66px}.piece-palette-options{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.piece-palette-options button{display:flex;align-items:center;gap:10px;text-align:left;font-size:11px;padding:10px}.palette-swatches{display:flex;flex-shrink:0}.palette-swatches i{width:19px;height:19px;border-radius:50%;border:1px solid #7778;box-shadow:0 2px 2px #0002}.palette-swatches i+i{margin-left:-5px}.piece-customizer button[aria-pressed="true"]{border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green);background:#e8eedf}.piece-color-inputs{display:flex;align-items:end;gap:14px;flex-wrap:wrap}.piece-color-inputs label{font-size:12px;margin:0;display:grid;gap:5px}.piece-color-inputs input{width:58px;height:36px;padding:3px;border:1px solid var(--line);background:transparent;border-radius:7px;cursor:pointer}.piece-color-inputs button{font-size:12px;padding:8px 12px;margin-left:auto}.board-reversed>.piece-customizer{order:5}.board-reversed>.captured{order:6}@media(max-width:450px){.piece-style-options{gap:5px}.piece-style-options strong{font-size:10px}.piece-customizer-content{padding:0 10px 12px}.piece-palette-options button{gap:6px;font-size:10px}.piece-preview{height:56px}.piece-preview .piece{height:56px}}
svg.piece-w .piece-body>path:not(.piece-detail):not(.piece-shine){filter:drop-shadow(0 2px 0 #999)}svg.piece-b .piece-body>path:not(.piece-detail):not(.piece-shine){filter:drop-shadow(0 2px 0 #080808)}

/* High-contrast move markers on both wood tones. */
.board .square.legal:after{width:28%;height:28%;background:#53dfc0;box-shadow:0 0 0 2px #18392f,0 1px 4px #0006}
.board .square.capture-target:after{width:85%;height:85%;background:transparent;border:4px solid #53dfc0;box-shadow:0 0 0 2px #18392f}
.piece-color-inputs #piece-apply-colors{margin-left:0}.piece-color-inputs #piece-defaults{margin-left:auto}
