/* Square artwork roots preserve measured visible-alpha centering. */
body.pieces-ready .piece,body.pieces-ready .piece.golden{position:absolute;inset:0;margin:0;width:100%!important;height:100%!important;display:block;transform:none}
body.pieces-ready .sq.selected .piece{transform:none}
body.pieces-ready[data-theme] .piece{filter:drop-shadow(0 1.5px 1px #14233665)}
body.pieces-ready[data-theme] .piece[data-type="n"]{filter:drop-shadow(0 2px 1px #10222b55) drop-shadow(0 0 2px #e9fbff88)}
body.pieces-ready[data-theme] .piece.golden{filter:drop-shadow(0 1px .7px #362005d9) drop-shadow(0 0 1.4px #fff6cfe8) drop-shadow(0 0 3.4px #e4b84ea6)}
.piece.golden:before{content:none}
.piece.golden:after{content:'';position:absolute;left:39%;top:35%;width:2px;height:2px;z-index:1;pointer-events:none;border-radius:50%;background:#fffef2;box-shadow:0 0 0 1px #ffe6a58c,0 0 2px #e7b74b9e;animation:knight-pinlight 4.8s ease-in-out -2.4s infinite}
.drag-ghost .piece.golden{filter:drop-shadow(0 2px 1px #362005bf) drop-shadow(0 0 1.6px #fff7d9ef) drop-shadow(0 0 3.8px #e4b84eb0)!important}
.gold-star{display:grid;place-items:center;right:5%;top:5%;width:clamp(11px,1.08vw,17px);height:clamp(11px,1.08vw,17px);font:700 clamp(9px,.9vw,14px)/1 Georgia,serif;color:#fff4b9;background:linear-gradient(145deg,#5a4624,#211c16);border:1px solid #f5d476;border-radius:50%;box-shadow:0 1px 2px #33240877,0 0 5px #ffda6780;text-shadow:0 0 3px #ffe398}
.gold-star:after{content:'✦';position:absolute;right:140%;top:145%;font-size:8px;color:#fff8df;text-shadow:0 0 2px #d8a13b;animation:knight-glint 4.8s ease-in-out infinite}
@keyframes knight-glint{0%,65%,100%{opacity:.12;scale:.7}35%{opacity:.95;scale:1.15}}
@keyframes knight-pinlight{0%,58%,100%{opacity:.18;scale:.72}30%{opacity:.92;scale:1}}
body.pieces-ready .sq.press-held>.piece{transform:translateY(-4px) scale(1.045)!important}
.drag-ghost .piece{position:absolute;inset:0}

/* Marble: carved ivory and graphite tiles in a champagne/navy frame. */
body[data-theme="marble"]:not(.gold-world){--light:#eef2ec;--dark:#53697a}
body[data-theme="marble"]:not(.gold-world) .board-wrap{
  background:linear-gradient(145deg,#fff7d4 0,#c6a761 9%,#f8e4aa 17%,#26394c 34%,#0e2134 58%,#546b7c 76%,#d8ba70 91%,#fff1bd);
  border-color:#f8e8b7;box-shadow:0 2px 0 #fff9dc,0 7px 0 #ad8b45,0 13px 0 #263b50,0 21px 0 #102438,0 28px 35px #172c4555,inset 0 2px 2px #fffbe6;
}
body[data-theme="marble"]:not(.gold-world) .board{
  background:#22394c url('assets/marble-world-hd.webp') center/cover;border-color:#101e2b;box-shadow:0 2px 1px #fff5c899,0 -2px 4px #07121d,inset 0 0 0 1px #d9bd744d;
}
body[data-theme="marble"]:not(.gold-world) .sq{
  background:linear-gradient(145deg,#ffffffb8 0,transparent 42%,#b9a87818 54%,#fffdf1a6 100%),#edf1ebe8;
  box-shadow:inset 0 1px 1px #fff,inset 0 -1px 0 #89969c44,inset 1px 0 0 #ffffff45;
}
body[data-theme="marble"]:not(.gold-world) .sq.dark{
  background:linear-gradient(145deg,#8fa1ae59 0,transparent 40%,#162a3a38 54%,#92a4b03d 100%),#536b7de8;
  box-shadow:inset 0 1px 1px #dce7ea55,inset 0 -1px 0 #101e2d73,inset 1px 0 0 #edf5f525;
}
body[data-theme="marble"]:not(.gold-world) .board-drops{opacity:.24;mix-blend-mode:screen}
body[data-theme="marble"]:not(.gold-world) .sq.last{background:#cdd8d5e8}
body[data-theme="marble"]:not(.gold-world) .sq.dark.last{background:#758b98e8}
body[data-theme="marble"] .world:before{background-image:url('assets/marble-world-hd.webp')}
body[data-theme="marble"] .world:after{background-image:url('assets/gold-world-hd.webp')}
body[data-theme="marble"]:not(.gold-world) .world:before{filter:saturate(.82) contrast(1.04) brightness(.98)}
body[data-theme="forest"] .world:before{background-image:url('assets/forest-world-hd.webp')}
body[data-theme] .ambient-drops:before{content:'';position:fixed;inset:0;pointer-events:none;background:url('assets/gilded-knight-ornaments.svg') center/contain no-repeat;opacity:.82;z-index:-1}
body[data-theme="forest"] .ambient-drops:before{opacity:.52;filter:saturate(.9) brightness(1.08)}
body[data-theme="marble"] .ambient-drops:before{display:none}
body[data-theme="forest"] .section-heading h1{
  display:inline-block;max-width:100%;margin-top:4px;padding:5px 12px 7px;
  color:#fff9df;background:linear-gradient(135deg,#102f25e8,#244d36dc);
  border:1px solid #ead9a46b;border-radius:10px;
  box-shadow:0 2px 10px #071b1370,inset 0 1px 0 #ffffff20;
  text-shadow:0 1px 2px #071711;
  -webkit-box-decoration-break:clone;box-decoration-break:clone;
}
.knight-stickers{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none}
.knight-sticker{position:absolute;display:block;width:var(--sticker-size);height:var(--sticker-size);transform:rotate(var(--sticker-rotation));transform-origin:50% 55%;opacity:.94;filter:drop-shadow(0 3px 1px #412d1655) drop-shadow(0 12px 13px #332b2780) drop-shadow(0 0 11px #ffe8a95c)}
.knight-sticker[hidden]{display:none}
.knight-sticker svg{display:block;width:100%;height:100%}
body[data-theme="forest"] .knight-stickers{display:none}

/* Gold-world treatment remains solid, filled and materially distinct. */
body.gold-world[data-theme="marble"]{--light:#fff9e9;--dark:#88703b}
body.gold-world[data-theme="marble"] .board{background:#8b723e url('assets/gold-world-hd.webp') center/cover;border-color:#4a371b;box-shadow:0 2px 1px #fff0b5aa,0 -2px 4px #342207}
body.gold-world[data-theme="marble"] .sq{background:linear-gradient(132deg,#ffffff80,#fff9e728 38%,#d1b66b20 51%,#fffdf57d 68%),#fff7e4e6;box-shadow:inset 0 1px 1px #fffdfbd4,inset 0 -1px 0 #b5934433}
body.gold-world[data-theme="marble"] .sq.dark{background:linear-gradient(126deg,#ffe8a33d,transparent 34%,#38230b24 51%,#f1d58030 78%),#806530d6;box-shadow:inset 0 1px 1px #f8e3a96e,inset 0 -1px 0 #44301461}
body.gold-world[data-theme="marble"] .sq.last{background-color:#c3a345}
body.gold-world[data-theme="marble"] .sq.checked{background:#cf8176!important}
body.gold-world[data-theme="marble"] .board-wrap{background:linear-gradient(145deg,#fff0b5 0,#b49448 12%,#f9e4a1 22%,#5d482a 45%,#b89647 72%,#ffefb5 91%,#917133);border-color:#dec780;box-shadow:0 2px 0 #fff1bf,0 6px 0 #9b7734,0 13px 0 #6d5025,0 22px 0 #4b371c,0 26px 0 #312413,0 37px 35px #61482055,inset 0 2px 1px #fff8d6b8}
body.gold-world[data-theme="marble"] .world:after{filter:brightness(.94) saturate(.92) contrast(1.04)}
.gold-world .ambient-drops:after{content:'';position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 7% 28%,#fffbe4 0 1px,transparent 3px),radial-gradient(circle at 88% 16%,#fffbe4 0 1px,transparent 3px),radial-gradient(circle at 94% 72%,#fffbe4 0 1.5px,transparent 4px),radial-gradient(circle at 18% 87%,#fffbe4 0 1px,transparent 3px),radial-gradient(circle at 75% 94%,#fffbe4 0 1px,transparent 3px);animation:marble-glints 5s ease-in-out infinite}
@keyframes marble-glints{0%,100%{opacity:.25}50%{opacity:1}}

/* Premove intent is visible without displacing centered piece artwork. */
.sq.premove-source{box-shadow:inset 0 0 0 4px #6f3cc9,inset 0 0 16px #6f3cc955!important}
.sq.premove-target{box-shadow:inset 0 0 0 4px #f0ad32,inset 0 0 18px #ffbf3f88!important}
.sq.premove-option:after{content:'';position:absolute;z-index:7;width:18%;height:18%;border-radius:50%;background:#f0ad32;border:2px solid #fff6d5;box-shadow:0 0 0 2px #6f3cc999,0 2px 5px #35204d88;pointer-events:none}
.sq.premove-target:before{content:'›';position:absolute;z-index:8;right:6%;top:2%;font:900 clamp(12px,1.2vw,18px)/1 Georgia,serif;color:#fff6d5;text-shadow:0 1px 3px #513414;pointer-events:none}

@media(max-width:480px){.gold-star{width:12px;height:12px;font-size:10px}.gold-star:after{font-size:7px}}
@media(max-width:900px),(max-height:600px){body[data-theme] .ambient-drops:before{display:none}}
@media(prefers-reduced-motion:reduce){body.pieces-ready .sq.press-held>.piece{transform:none!important}.piece.golden:after,.gold-star:after,.gold-world .ambient-drops:after{animation:none;opacity:.65}}
@media(min-width:801px) and (max-height:711px){:root{--board-size:420px}main{grid-template-columns:minmax(0,var(--board-size)) minmax(280px,310px);gap:clamp(16px,2vw,28px);align-items:start}}
/* #475 beta label beside the logo */
.beta-tag{display:inline-block;margin-left:10px;padding:3px 8px 2px;border:1.5px solid #d4a53a;border-radius:999px;color:#9a6f12;background:#fff7e0;font:800 11px/1.1 system-ui,'Segoe UI',sans-serif;letter-spacing:.14em;vertical-align:middle;align-self:center;white-space:nowrap}
