:root{--gold:#ffd447;--wood:#672500;--cream:#fff5d3}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}body{margin:0;color:#fff;font-family:Arial,sans-serif;background:#00191f;overscroll-behavior:none}button,input,summary{touch-action:manipulation}button{font-family:inherit;color:inherit;cursor:pointer}button:disabled{filter:saturate(.25);opacity:.45;cursor:default}[hidden]{display:none!important}button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid white;outline-offset:3px}#app{max-width:540px;min-height:100dvh;margin:auto;background:radial-gradient(ellipse at 50% 45%,#005d53 0%,#003b3b 34%,#00191f 75%);display:flex;flex-direction:column;box-shadow:0 0 70px #0009}.wood{background:repeating-radial-gradient(ellipse at 10% -80%,transparent 0 18px,#ab4b151c 20px 23px,transparent 26px 50px),repeating-linear-gradient(178deg,#572000 0,#783005 11px,#6a2600 17px,#813608 23px,#622100 29px);box-shadow:inset 0 2px 5px #ffb83433,inset 0 -6px 8px #200b00a6,0 5px 0 #381400,0 8px 15px #0006}header{height:108px;border-bottom:5px solid var(--gold);border-radius:0 0 20px 20px;display:flex;align-items:center;padding:16px 19px;gap:16px;position:relative}.profile{font-family:Georgia,serif;font-size:45px;text-shadow:0 2px 3px black;line-height:1;width:66px;height:66px;flex-shrink:0;border:4px solid #ffd24c;border-radius:50%;background:radial-gradient(circle at 35% 25%,#b3bde3,#223c75 50%,#101c39);box-shadow:0 0 0 3px #622800,0 3px 6px #0009}#heading{flex:1;text-align:center;padding-right:30px}#heading b{display:block;font-size:16px;color:#ffdf67;text-shadow:0 2px 2px #0009}#heading small{font-size:8px;display:block;margin-top:9px;letter-spacing:1px}.ribbon{position:absolute;right:17px;top:0;width:43px;height:74px;border:0;clip-path:polygon(0 0,100% 0,100% 85%,50% 100%,0 85%);background:linear-gradient(90deg,#750000,#e00000 45%,#a70000);color:#ffdf4f;font-size:29px;padding-top:20px;text-shadow:0 2px #6c2a00}main{padding:0 10px;flex:1}.screen{padding-bottom:16px}.titlebar{height:80px;display:flex;align-items:center;position:relative;justify-content:center;text-align:center;padding:10px 40px}.titlebar h1{font-size:17px;line-height:1.4;margin:0}.titlebar p{font-size:12px;margin:5px 0 0;color:#f8dc76}.back{position:absolute;left:0;top:16px;width:40px;height:47px;border:0;background:transparent;color:#ffd353;font-size:39px;text-shadow:1px 3px 0 #a25a00,0 3px 5px black}.hero{height:230px;display:flex;align-items:flex-end;justify-content:center;padding-top:40px}.hero img{width:120px;height:174px;filter:drop-shadow(0 10px 8px #0009)}.hero img+img{margin-left:-25px;transform:translateY(-8px)}#home{text-align:center;padding:0 22px 30px}#home h1{font-size:25px;text-shadow:0 3px 2px #0008;margin:20px 0 7px}.subtitle{font-size:12px;color:#b1c6bb;margin-bottom:28px}.big{width:100%;min-height:59px;margin:10px 0;border-radius:13px;font-size:clamp(17px,5vw,23px);font-weight:bold;text-shadow:0 2px 2px #003000;border:2px solid #5bff00;box-shadow:inset 0 2px 3px #e5ff81aa,inset 0 -4px 4px #003600aa,0 5px 0 #022b12,0 8px 8px #0008;padding:12px 8px}.green{background:linear-gradient(#7fff00 0%,#30dd00 20%,#009b00 45%,#007400 80%,#05bd00 100%);color:white;border:2px solid #67ea00;text-shadow:0 2px 2px #003000}.blue{background:linear-gradient(#29f6ef,#00a9d1 35%,#00638a 80%,#0099bd);border-color:#00d5f6;text-shadow:0 2px 2px #002a3c;box-shadow:inset 0 2px 4px #b7ffffaa,inset 0 -3px 4px #003746,0 5px 0 #002c3a,0 8px 8px #0008}.autosave{font-size:11px;color:#a9c1b6;text-align:center;line-height:1.7;margin:22px 0}.setupspace{height:clamp(12px,6vh,80px)}.panel{border:3px solid #eac849;outline:1px solid #9f7414;border-radius:12px;padding:15px 11px;margin:13px 0;box-shadow:inset 0 0 0 3px #893f00,0 5px 0 #604300,0 8px 10px #0006}h2{font-size:15px;text-align:center;margin:2px 0 17px;text-shadow:0 2px 2px #0007}.colors{display:flex;gap:12px;justify-content:space-between;padding:12px 6px 2px}.colors button{border:3px solid #4b1900;box-shadow:0 0 0 1px #a65716,inset 0 1px 6px #0007,0 3px 3px #301000;border-radius:12px;background:#4c19009c;flex:1;min-width:0;padding:0 1px 9px;color:#dca36c;font-weight:bold;font-size:12px}.colors button.chosen{border-color:#ffe154;box-shadow:0 0 0 2px #bd8200,inset 0 0 9px #f9c40088,0 3px 5px #240a00;color:#ffe45d}.colors img{display:block;width:100%;height:91px;margin-top:-12px;filter:drop-shadow(0 3px 2px #0008)}.splitpiece{display:block;height:91px;margin-top:-12px;position:relative;overflow:hidden}.splitpiece img{margin:0;position:absolute;inset:0}.splitpiece img:first-child{clip-path:inset(0 50% 0 0)}.splitpiece img:last-child{clip-path:inset(0 0 0 50%)}#levelLabel{text-align:center;font-size:18px;color:var(--gold);margin:26px 0 19px;text-shadow:0 2px 2px #0008}input[type=range]{width:100%;height:8px;border-radius:10px;background:#391000;box-shadow:inset 0 2px 5px black,0 2px #af5818;appearance:none;margin:13px 0 15px}input[type=range]::-webkit-slider-thumb{appearance:none;width:28px;height:28px;border:2px solid #fff1a0;transform:rotate(45deg);border-radius:3px;background:linear-gradient(135deg,#ffef7d,#cd8000 45%,#f5c329 60%,#ffff91);box-shadow:2px 2px 4px #190900}.ticks{display:flex;justify-content:space-between;font-size:10px;color:#e0b165;margin:0 2px}.goldtext{color:var(--gold);font-size:11px;line-height:1.6;text-align:center}.record{display:flex;justify-content:space-around;gap:5px;border-top:1px solid #a85419;padding-top:12px;font-size:10px;color:#f7cb5d}.record b{display:inline-block}.opponentLine,.underboard{display:flex;justify-content:space-between;font-size:11px;padding:6px 3px 9px;color:#c4d6cc;gap:8px}.opponentLine{margin-top:clamp(8px,2vh,25px)}#engineState{color:#ecd26a}.boardFrame{padding:5px;border:2px solid #9f500f;box-shadow:0 4px 0 #3f1700,0 8px 13px #0009}#board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1}.sq{aspect-ratio:1;min-width:0;position:relative;border:0;border-radius:0;padding:1px;background:radial-gradient(ellipse at 20% 30%,#fff8e9,#ead1ae);display:grid;place-items:center}.sq.dark{background:repeating-linear-gradient(25deg,#181917 0,#20211e 3px,#151614 6px,#1c1d1b 12px)}.sq img{width:96%;height:96%;position:absolute;pointer-events:none;filter:drop-shadow(0 2px 1px #0008);z-index:1}.sq.last{box-shadow:inset 0 0 0 3px #fff000;background:#b18b1b}.sq.selected{background:#c6aa12;box-shadow:inset 0 0 0 3px #ffff3e}.sq.check{background:#c54327}.sq.hinted{box-shadow:inset 0 0 0 4px #32e8ff}.sq.legal:after{content:'';position:absolute;width:24%;height:24%;background:#3f692fa0;border-radius:50%;z-index:2}.sq.capture:after{width:85%;height:85%;border:3px solid #d2e742;background:transparent}.sq.movable:before{content:'';position:absolute;bottom:4px;right:4px;width:6px;height:6px;background:#3ef386;border-radius:50%;z-index:2}.coord{position:absolute;top:2px;left:2px;font-size:8px;font-weight:bold;z-index:3;color:#25231b}.dark .coord{color:#f6e3c4}.coord.file{top:auto;left:auto;bottom:1px;right:2px}.underboard{padding-top:11px}#saved{font-size:10px;color:#9bc8a8}#captured{min-height:22px;font-size:11px;color:#a8c2b4;text-align:center;line-height:1.6}.gameActions{display:flex;justify-content:space-evenly;gap:6px;margin:clamp(22px,5vh,65px) 0 12px}.gameActions>button{background:none;border:0;font-size:11px;font-weight:bold;display:flex;align-items:center;flex-direction:column;gap:12px;min-width:64px;text-shadow:0 2px 1px #0008}.round{width:66px;height:66px;border:3px solid #ffe77f;border-radius:50%;display:grid;place-items:center;color:#ffde4a;font-family:Georgia,serif;font-size:39px;background:repeating-linear-gradient(173deg,#6a2900 0 7px,#8c3c03 9px 15px,#662300 17px 23px);box-shadow:inset 0 0 0 3px #c48c0c,inset 0 0 12px #281000,0 4px 0 #8c4900,0 6px 7px #0009;text-shadow:1px 3px #7f4100}.message{text-align:center;color:#bbd0c4;font-size:11px;min-height:29px;line-height:1.6}.historybox{border-radius:7px;border:1px solid #986c19;font-size:11px;padding:12px;margin:20px 0}.historybox summary{cursor:pointer;color:#edce70;letter-spacing:1px}.historybox summary span{float:right}#history{max-height:150px;overflow:auto;padding-top:10px}.move{display:grid;grid-template-columns:30px 1fr 1fr;padding:7px;border-bottom:1px solid #ffffff15}.settingrow{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #c6762b55;padding:12px 1px;font-size:13px;font-weight:bold}.settingrow:last-child{border:0}.settingrow label{line-height:1.5;max-width:68%}.settingrow input{appearance:none;width:77px;height:39px;flex-shrink:0;border:2px solid #814200;border-radius:24px;box-shadow:inset 0 2px 5px #0008;background:#461600;position:relative}.settingrow input:checked{background:linear-gradient(#005100,#119000)}.settingrow input:after{content:'';position:absolute;width:33px;height:33px;top:1px;left:1px;border:3px solid #ffdf60;border-radius:50%;background:radial-gradient(circle at 35% 20%,#ffed96,#d88700 55%,#b96900);box-shadow:0 2px 4px #0008;transition:left .15s}.settingrow input:checked:after{left:38px}.small{font-size:15px;font-weight:bold;padding:10px 24px;border-radius:9px}.credits{color:#a9c1b6;font-size:11px;padding:10px;line-height:1.7}.credits a{color:#f3ce60}footer{font-size:9px;color:#d4ae58;border-top:1px solid #a16b21;padding:14px 16px;background:#032529;letter-spacing:1px}footer span{float:right;color:#8fae9e;letter-spacing:0}dialog{background:radial-gradient(ellipse at top,#075247,#002129);border:3px solid #eac54f;border-radius:14px;color:#fff;width:min(92vw,400px);padding:23px;box-shadow:0 10px 40px #0009}dialog::backdrop{background:#001316c9}dialog p{font-size:13px;color:#c6d8cb;line-height:1.6}.dialogActions{display:flex;gap:12px;margin-top:23px}.dialogActions button{flex:1;padding:12px;border-radius:8px;background:#123c38;border:1px solid #6f9880;font-weight:bold}.dialogActions .green{background:linear-gradient(#42dc00,#008200);border-color:#8ee840}#promotionChoices{display:flex;gap:8px}#promotionChoices button{width:25%;padding:4px;background:#713000;border:2px solid #e9c854;border-radius:8px}#promotionChoices img{width:100%}@media(max-width:360px){header{height:90px}.profile{width:54px;height:54px;font-size:36px}#heading b{font-size:14px}.titlebar h1{font-size:14px}.round{width:57px;height:57px}.hero{height:190px}.big{font-size:17px}.settingrow{font-size:12px}}@media(min-height:850px){.hero{height:290px}.gameActions{margin-top:70px}.setupspace{height:10vh}}

/* Version 1.1: packaged art, compact mobile spacing, readable update controls. */
.hero{height:230px;padding-top:22px;align-items:center;gap:0}.hero img{width:155px;height:210px;object-fit:contain;filter:drop-shadow(0 10px 9px #0008)}.hero img+img{margin-left:-30px;transform:translateY(-7px)}
.sq img{width:95%;height:95%;object-fit:contain;filter:drop-shadow(0 2px 1px #0006)}.colors img{object-fit:contain;height:99px}.splitpiece{height:99px}.splitpiece img{height:99px}.colors button{padding-bottom:11px}
.wood{background:repeating-radial-gradient(ellipse at 15% -180%,transparent 0 28px,#db8a3012 30px 32px,transparent 34px 73px),linear-gradient(177deg,#7a310b,#502006 22%,#75300b 48%,#552107 72%,#7b350e);}
.sq.dark{background:linear-gradient(140deg,#242521,#11130f)}.sq.last{background:#9d811c}.sq.selected{background:#baa128}
.gameActions{margin-top:clamp(16px,3vh,38px)}.gameActions>button{min-height:95px}.setupspace{height:clamp(10px,4vh,45px)}
#home{padding-bottom:20px}.screen{padding-bottom:24px}footer{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
.updatesPanel{margin-top:24px}.versionline{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:5px}.versionline b{color:#ffe394;letter-spacing:1px}
#updateStatus{font-size:14px;line-height:1.6;color:#ffe39b;margin:17px 0 8px}#updateNotes{font-size:12px;line-height:1.6;color:#e9d1a8;white-space:pre-line}.updateHelp{font-size:11px;line-height:1.7;color:#d3b990}.updatesPanel .big{font-size:15px;min-height:49px}.updateNotice{background:#13463b;border:1px solid #d1b650;color:#ffe38c;padding:12px;border-radius:8px;font-size:12px;margin-top:15px;width:100%}.settingrow label{max-width:64%}
@media(min-height:850px){.hero{height:270px}.gameActions{margin-top:42px}.setupspace{height:6vh}}
@media(max-height:760px){.hero{height:180px}.hero img{height:170px;width:130px}header{height:92px}.titlebar{height:67px}.setupspace{height:4px}.panel{padding-top:12px;padding-bottom:12px}.gameActions{margin-top:12px}.round{width:59px;height:59px}.gameActions>button{gap:9px;min-height:83px}#home h1{margin-top:7px}.subtitle{margin-bottom:18px}}

.gameResult{margin:14px 0 18px;padding:17px 12px}.gameResult h2{font-size:18px;color:#ffe393;margin:0 0 8px}.gameResult p{text-align:center;font-size:12px;line-height:1.6;color:#ead5af;margin:7px 0 12px}.resultActions{display:flex;gap:10px}.resultActions .big{flex:1;margin:0;font-size:13px;min-height:51px;padding:11px 6px;border-radius:10px}#resultTitle:focus{outline:none}

/* Front-facing ivory / gunmetal atlas: six equal square cells, two rows. */
.pieceSprite{display:block;background-image:url('pieces-atlas.png');background-repeat:no-repeat;background-size:600% 200%;pointer-events:none;width:100%;height:100%}
.pieceSprite[data-piece="wp"]{background-position:0% 0%}
.pieceSprite[data-piece="wn"]{background-position:20% 0%}
.pieceSprite[data-piece="wb"]{background-position:40% 0%}
.pieceSprite[data-piece="wr"]{background-position:60% 0%}
.pieceSprite[data-piece="wq"]{background-position:80% 0%}
.pieceSprite[data-piece="wk"]{background-position:100% 0%}
.pieceSprite[data-piece="bp"]{background-position:0% 100%}
.pieceSprite[data-piece="bn"]{background-position:20% 100%}
.pieceSprite[data-piece="bb"]{background-position:40% 100%}
.pieceSprite[data-piece="br"]{background-position:60% 100%}
.pieceSprite[data-piece="bq"]{background-position:80% 100%}
.pieceSprite[data-piece="bk"]{background-position:100% 100%}
.sq .pieceSprite{position:absolute;inset:0;z-index:1;filter:drop-shadow(0 1px 1px #0004)}
.hero .pieceSprite{width:170px;height:170px;flex-shrink:0;filter:drop-shadow(0 10px 8px #0007)}.hero .pieceSprite+.pieceSprite{margin-left:-30px;transform:translateY(-7px)}
.colors button>.pieceSprite{width:100%;height:auto;aspect-ratio:1;max-width:100px;margin:-12px auto 0}.splitpiece .pieceSprite{position:absolute;inset:0;width:100%;height:100%;margin:0}.splitpiece .pieceSprite:first-child{clip-path:inset(0 50% 0 0)}.splitpiece .pieceSprite:last-child{clip-path:inset(0 0 0 50%)}
#promotionChoices .pieceSprite{width:100%;height:auto;aspect-ratio:1}.hero{padding-top:15px}
@media(max-height:760px){.hero .pieceSprite{width:140px;height:140px}}
