:root{color-scheme:dark;--bg:#152c39;--panel:#203b49;--line:#3a505a;--ink:#f7f0dc;--muted:#b1c0c4;--gold:#eab273;--gold-d:#da9956;--serif:"Baskervville","Georgia",serif;--sans:"DM Sans","Segoe UI",Arial,sans-serif}
*{box-sizing:border-box}body{margin:0;min-height:100svh;font:16px/1.45 var(--sans);color:var(--ink);background:radial-gradient(ellipse at 24% 24%,#203b48 0,transparent 53%),var(--bg)}
body:before{content:"";position:fixed;inset:0;pointer-events:none;background-image:url("grain.svg");opacity:.15;z-index:-1}
button,a,input{font:inherit}button{cursor:pointer;color:inherit;border:0;background:none}button:disabled{cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #83c1ef;outline-offset:3px}button:not(:disabled){transition:background .16s,color .16s,border-color .16s,box-shadow .16s}button:not(:disabled):hover{color:white}button svg,i svg{width:19px;height:19px;flex:none}i[data-icon]{display:inline-flex;align-items:center;justify-content:center;font-style:normal}
.masthead{height:69px;background:#112633ee;border-bottom:1px solid #354a54}.nav-wrap{height:100%;max-width:1250px;padding:0 44px;margin:auto;display:flex;align-items:center}.brand{display:flex;align-items:center;gap:12px;white-space:nowrap;font:600 23px/1 var(--serif);letter-spacing:-.8px}.brand img{width:33px;height:33px}
nav{display:flex;align-self:stretch;gap:24px;margin-left:clamp(34px,6vw,90px)}.nav-link{position:relative;display:flex;align-items:center;gap:8px;font-size:14px;font-weight:550;color:#4d5e50;padding:0 2px}.nav-link svg{width:16px}.nav-link.active{color:var(--gold)}.nav-link.active:after{position:absolute;content:"";height:3px;background:var(--gold);bottom:-1px;left:1px;right:1px;border-radius:3px 3px 0 0}
.nav-tools{margin-left:auto;display:flex;align-items:center;gap:7px}.nav-tools>span,.panel-actions>span{height:18px;width:1px;background:var(--line)}.icon-btn{width:40px;height:42px;display:grid;place-items:center;border-radius:6px;color:#4d5e50}.icon-btn:hover,.close:hover{background:#ffffff0c}
main{width:min(1050px,calc(100% - 64px));margin:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;margin:31px 0 20px;gap:16px}.page-heading h1{font:normal clamp(44px,4.5vw,65px)/1.04 var(--serif);letter-spacing:-3.2px;margin:0}.page-heading h1 em{color:#4d5e50;font-weight:400}.page-heading p{margin:9px 0 0;color:#4d5e50;font-size:15px;letter-spacing:.1px}.page-heading p b{font-size:14px;margin:0 8px;color:#7e939c}
.primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:700;border:1px solid #ecc193;background:#e7ad70;color:#1c2e35;border-radius:7px;min-height:43px;padding:0 19px;box-shadow:0 2px 3px #0002}.primary:not(:disabled):hover{background:#f4c38b;color:#192b34}.primary:disabled{opacity:.4}
.game-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);gap:30px;align-items:start}.table-area{min-width:0}.player{min-height:52px;display:flex;gap:10px;align-items:center}.player:first-child{padding:0 3px 10px}.player:nth-child(3){padding:11px 3px 0}.player-icon{height:32px;width:32px;display:grid;place-items:center;border-radius:8px;background:#293f49;border:1px solid #49606a;color:#4d5e50}.player-icon.self{background:#3a403a;border-color:#675b45;color:var(--gold)}.player-name{font-weight:650;font-size:15px}.player-side{font-size:12px;color:var(--muted);padding:2px 8px;border:1px solid #435861;border-radius:15px}.player-count{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font:500 13px var(--sans);color:#4d5e50}.player-count svg{width:19px;height:19px;color:#4d5e50}.turn-chip{display:flex;gap:7px;align-items:center;color:#4d5e50;font-size:12px;font-weight:600}.turn-chip:before{content:"";width:7px;height:7px;border-radius:50%;background:#e9ad67}.player-count+.turn-chip{padding-left:12px;border-left:1px solid var(--line)}
.frame{--rim:4.3%;width:100%;aspect-ratio:1;position:relative;border-radius:7px;background:linear-gradient(110deg,#8b6244,#704c32 40%,#64432d 85%,#845c3f);box-shadow:0 9px 22px #07121857,0 3px 3px #060c0f70,inset 0 0 0 1px #ac8260,inset 0 0 0 3px #876043,inset 0 0 0 4px #543e2f;isolation:isolate;container-type:inline-size;touch-action:manipulation}.frame:before{content:"";position:absolute;inset:2px;pointer-events:none;border-radius:6px;background-image:url("wood.svg");background-size:260px 170px;opacity:.5}.frame:after{content:"";position:absolute;inset:var(--rim);border:1px solid #543a26;box-shadow:0 0 0 2px #c59d725e,0 0 0 3px #54382285;pointer-events:none}
.rim-x,.rim-y{position:absolute;display:grid;align-items:center;text-align:center;color:#4d5e50;font:600 2.1cqw/1 var(--serif);text-shadow:0 1px 1px #3b2b20}.rim-x{left:var(--rim);right:var(--rim);height:var(--rim);grid-template-columns:repeat(10,1fr)}.rim-y{top:var(--rim);bottom:var(--rim);width:var(--rim);grid-template-rows:repeat(10,1fr)}.rim-top{top:0}.rim-bottom{bottom:0}.rim-left{left:0}.rim-right{right:0}.inlay{position:absolute;width:1.1%;height:1.1%;background:#d5ad78;transform:rotate(45deg);box-shadow:0 0 0 1px #503722}.nw{top:1.6%;left:1.6%}.ne{top:1.6%;right:1.6%}.sw{bottom:1.6%;left:1.6%}.se{bottom:1.6%;right:1.6%}
.board{position:absolute;inset:var(--rim);display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(10,1fr);overflow:hidden}.tile{position:relative;display:grid;place-items:center;min-width:0;padding:0;border:0;border-radius:0;isolation:isolate;touch-action:manipulation;background-color:#e4c99c;background-image:url("wood.svg");background-size:380% 290%;background-position:var(--wood-x) var(--wood-y)}.tile.playable{background-color:#996a47}.tile.playable:nth-child(3n){background-color:#976746}.tile.playable:nth-child(7n){background-color:#9d704c}.tile:before{content:"";position:absolute;inset:0;pointer-events:none}.tile.selected:before{box-shadow:inset 0 0 0 3px #a7d7ea;background:#7bb7cb59}.tile.last:before{background:#ffda583b}.tile.selected:before{z-index:1}.tile.playable:focus-visible{outline:3px solid #9ad0ec;outline-offset:-3px;z-index:2}.tile-number{position:absolute;left:4%;top:2%;color:#4d5e50;font:500 1.65cqw var(--sans);z-index:5;text-shadow:0 1px 2px #392511}
.stone{width:79%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;position:relative;pointer-events:none;box-sizing:border-box;transform:translateY(-2%);z-index:2}.stone.light{background:radial-gradient(ellipse at 35% 20%,#fff3ce 0%,#eedbb4 59%,#dbc29b 88%);border:1px solid #a88862;box-shadow:0 2.8px 0 #ac8a63,0 4px 1px #4c342a80,0 5px 5px #51341b66,inset 0 1.5px 1px #fffcdd,inset 0 -1.5px 2px #b39870}.stone.dark{background:radial-gradient(ellipse at 38% 16%,#454947,#2c3030 58%,#222727 90%);border:1px solid #222725;box-shadow:0 2.8px 0 #171b1a,0 4px 1px #46301fb0,0 5px 5px #48301f77,inset 0 1.6px 1px #6d7068,inset 0 -1.5px 2px #202321}
.stone:before,.stone:after{position:absolute;content:"";border-radius:50%;pointer-events:none}.stone.light:before{inset:11%;border:1px solid #bba27e;box-shadow:0 1px 0 #fff2ca,inset 0 1px 1px #ffedc6}.stone.light:after{inset:17%;border:1px solid #d5bd95;box-shadow:inset 0 1px 1px #eedcb4}.stone.dark:before{inset:10%;border:1px solid #191f20;box-shadow:0 .9px 0 #666a60,inset 0 1px 0 #62665f}.stone.dark:after{inset:20%;border:1px solid #232827;box-shadow:0 .8px 0 #53574f,inset 0 1px 0 #53564e}.stone.king{outline:2px solid #d7a65f;outline-offset:-2px}.stone.king svg{width:52%;height:52%;color:#4d5e50;fill:#ddb16b;stroke:#614522;z-index:1}.stone.marked{opacity:.4}.stone.marked:after{content:"×";inset:0;display:grid;place-items:center;border:0;box-shadow:none;font:700 5cqw var(--sans);color:#a43427}
.target:after{content:"";position:absolute;inset:36%;border-radius:50%;background:#244f63c2;box-shadow:0 0 0 2px #f2e0b99c;z-index:3}.mandatory .stone{outline:3px solid #f2a353;outline-offset:1px}.board-message{font-size:13px;color:#4d5e50;text-align:center;min-height:1.2em;margin-top:7px}.board-message:empty{display:none}
aside{display:flex;flex-direction:column;gap:16px;padding-top:2px}.panel,.guide-panel{border-radius:10px;border:1px solid #3b515b;overflow:hidden;background:linear-gradient(125deg,#233e4c,#203946);box-shadow:0 3px 8px #07151c14}.panel h2{margin:0;display:flex;align-items:center;gap:11px;padding:18px 20px 14px;font:400 24px/1.15 var(--serif);letter-spacing:-.55px}.panel-icon{color:#4d5e50;display:inline-flex}.panel-icon svg{width:20px;height:20px}.panel-body{padding:0 20px 18px}.label,.guide-label,.history-labels{font:650 11px/1.25 var(--sans);letter-spacing:1.6px;text-transform:uppercase;color:#4d5e50}.label{margin:13px 0 8px}.seg{display:flex;border-radius:6px;border:1px solid #425964;background:#182e3a;padding:3px;gap:3px}.seg button{flex:1;min-height:34px;padding:5px 3px;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:4px;font-size:14px;font-weight:550;color:#4d5e50}.seg button svg{width:16px;height:16px}.seg button:hover{background:#314b58}.seg button.on{background:#3b5562;box-shadow:inset 0 0 0 1px #58707a,0 1px 3px #0d202766;color:var(--ink)}.levels{background:transparent;border:0;padding:0;gap:7px}.levels button{border:1px solid #48616b;background:#253f4d;min-height:33px;font-size:13px}.levels button.on{color:#4d5e50;border:1px solid #aa865c;background:#4c4a3e;box-shadow:none}.panel-actions{display:grid;grid-template-columns:1fr 1px 1fr;align-items:center;min-height:47px;border-top:1px solid #3b515b;background:#152c372b}.panel-actions button,.end-actions button{display:inline-flex;justify-content:center;align-items:center;gap:8px;color:#4d5e50;font-size:13px;min-height:43px}.panel-actions button:disabled{color:#4d5e50}.panel-actions button svg,.end-actions button svg{width:15px;height:15px}.panel-actions button:not(:disabled):hover{background:#ffffff08}.panel-actions>span{height:17px}
.history-panel h2{padding-bottom:16px}.count{font:600 12px var(--sans);border:1px solid #4a626c;border-radius:5px;padding:1px 8px;color:#4d5e50;margin-left:auto}.history-labels,.history-row{display:grid;grid-template-columns:18% 41% 41%;padding:0 20px;align-items:center}.history-labels{min-height:29px;background:#162f3b73;border-top:1px solid #36505a;border-bottom:1px solid #36505a;color:#4d5e50;font-size:10px}.history-labels>span{display:flex;gap:6px;align-items:center}.tiny-disc{display:inline-block;width:8px;height:8px;border-radius:50%}.tiny-disc.light{background:#e5d3b3}.tiny-disc.dark{background:#252b2c;border:1px solid #9ca8a6}.history-scroll{height:89px;overflow:auto;scrollbar-width:thin;scrollbar-color:#60737a transparent}.empty-history{height:100%;display:flex;gap:8px;align-items:center;justify-content:center;color:#4d5e50;font-size:13px}.empty-history svg{width:17px;height:17px;color:#4d5e50}.history-row{min-height:30px;font:13px/1.3 ui-monospace,Consolas,monospace;border-bottom:1px solid #ffffff0c}.history-row>span:first-child{color:#4d5e50}.history-row:last-child{background:#ffffff07}
.guide-panel{position:relative;min-height:140px;background:radial-gradient(ellipse at right bottom,#3c514f 0,transparent 70%),#283e44;border-color:#53615c;isolation:isolate}.guide-content{position:relative;z-index:1;padding:17px 20px}.guide-label{display:flex;align-items:center;gap:7px;color:#4d5e50;font-size:10px;margin:0 0 8px}.guide-label svg{width:14px;height:14px}.guide-content h2{font:400 27px/1.1 var(--serif);margin:0 0 5px;letter-spacing:-.75px}.guide-link{display:inline-flex;align-items:center;gap:8px;padding:6px 0 3px;color:#4d5e50;font-size:13px;border-bottom:1px solid #a18765}.guide-link svg{width:14px;height:14px}.guide-art{position:absolute;right:-1%;bottom:-6%;height:108%;width:53%;pointer-events:none}.guide-art svg{width:100%;height:100%}.end-actions{display:flex;align-items:center;justify-content:center;gap:17px;margin-top:-9px}.end-actions button{color:#4d5e50}.end-actions b{font-weight:400;color:#6e858c}
footer{border-top:1px solid #3a4e57;margin:28px 0 16px;padding:13px 0;display:flex;align-items:center;justify-content:space-between;color:#4d5e50}footer span,footer button{display:inline-flex;align-items:center;gap:7px;font-size:12px}footer svg,footer i svg{height:14px;width:14px}
dialog{color:var(--ink);background:#203b48;border:1px solid #5a6a6c;border-radius:13px;width:min(450px,calc(100% - 26px));padding:0;max-height:92svh;box-shadow:0 18px 90px #07111699}dialog::backdrop{background:#061720b8;backdrop-filter:blur(4px)}.dialog-wrap{padding:27px;position:relative}.dialog-wrap h2{font:400 34px/1.1 var(--serif);letter-spacing:-1px;margin:0 32px 16px 0}.dialog-wrap p{color:#4d5e50;font-size:15px}.dialog-wrap .label{font-size:11px;color:#4d5e50}.close{position:absolute;right:14px;top:13px;width:36px;height:36px;display:grid;place-items:center;border-radius:6px;color:#4d5e50}.dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:22px;flex-wrap:wrap}.secondary{min-height:41px;background:#294450;border:1px solid #4d6570;border-radius:6px;padding:7px 14px;font-size:14px;font-weight:550}.secondary:hover{background:#38535e}.dialog-wrap .seg{margin-bottom:14px}.switch-row{display:flex;align-items:center;justify-content:space-between;min-height:48px;border-bottom:1px solid #455860;font-size:15px;cursor:pointer}.switch-row input{width:36px;height:20px;accent-color:var(--gold);cursor:pointer}.switch-row input[role=switch]{appearance:none;border-radius:20px;background:#142c37;border:1px solid #62757a;position:relative}.switch-row input[role=switch]:before{position:absolute;content:"";inset:3px auto 3px 3px;width:12px;background:#a9b6b8;border-radius:50%}.switch-row input[role=switch]:checked{background:var(--gold);border-color:var(--gold)}.switch-row input[role=switch]:checked:before{left:18px;background:#283d43}.toast{position:fixed;z-index:9;bottom:24px;left:50%;transform:translate(-50%,8px);background:#efe1c6;color:#223642;box-shadow:0 4px 14px #07121855;padding:10px 18px;border-radius:7px;opacity:0;transition:.15s;pointer-events:none;font-size:14px;max-width:90vw}.toast.show{opacity:1;transform:translate(-50%,0)}.steps{display:flex;gap:4px;margin-bottom:14px}.steps i{height:3px;flex:1;border-radius:2px;background:#48606a}.steps i.done{background:var(--gold)}.tutorial-frame{width:min(100%,32svh);margin:0 auto 14px}.tutorial-frame .tile{cursor:default}.tutorial-frame .playable{cursor:pointer}.tutorial-copy{min-height:42px}.tutorial-step{color:var(--gold)!important;margin:0 0 5px}.tutorial-actions{justify-content:space-between}.end-symbol{color:var(--gold);margin:0 0 10px}.end-symbol svg{width:38px;height:38px}.mode-note{font-size:13px;margin:12px 0 0;color:var(--muted)}.hidden,[hidden]{display:none!important}.room-url{width:100%;border:1px solid #586d74;border-radius:5px;background:#142c37;color:var(--ink);padding:9px}
@media(min-width:900px) and (max-height:850px){main{width:min(940px,calc(100% - 64px))}.page-heading{margin:22px 0 13px}.page-heading h1{font-size:52px}.game-layout{grid-template-columns:minmax(0,1.48fr) minmax(310px,1fr);gap:25px}.masthead{height:59px}.panel h2{padding-top:15px}.guide-panel{min-height:119px}.guide-content{padding-top:14px}.player{min-height:46px}}
@media(max-width:850px){.nav-wrap{padding:0 26px}main{width:calc(100% - 40px)}.game-layout{grid-template-columns:minmax(0,1.35fr) minmax(260px,1fr);gap:18px}.panel h2{padding-left:15px}.panel-body{padding-left:14px;padding-right:14px}.player-side{display:none}.guide-art{opacity:.8}}
@media(max-width:700px){.masthead{height:56px}.nav-wrap{padding:0 16px}.brand{font-size:19px;gap:8px}.brand img{width:29px;height:29px}nav{margin-left:auto;gap:0}.nav-tools{margin-left:7px;gap:0}.nav-tools>span{display:none}.nav-link{font-size:0;width:37px;justify-content:center}.nav-link svg{width:17px;height:17px}.nav-link.active{display:none}.icon-btn{width:36px}.game-layout{grid-template-columns:1fr;gap:20px}.page-heading{margin:23px 0 12px}.page-heading h1{font-size:clamp(36px,8vw,49px);letter-spacing:-2px}.page-heading p{font-size:12px;margin:5px 0 0}.page-heading p b{margin:0 3px}.primary.new-game{min-height:36px;padding:0 10px;font-size:12px;gap:3px}.new-game svg{width:15px;height:15px}main{width:min(100% - 28px,550px)}.player{min-height:45px}.player-name{font-size:14px}.player-side{display:inline}.player-count{font-size:12px}.player-icon{width:29px;height:29px}.player-icon svg{width:16px}.turn-chip{font-size:11px}.frame{border-radius:5px}.panel h2{font-size:23px}.panel-actions button,.seg button{min-height:41px}aside{padding:0;gap:13px}.history-scroll{height:90px}.guide-art{width:42%;opacity:1}.guide-panel{min-height:128px}.panel-body{padding:0 16px 16px}.panel h2{padding:16px}.dialog-wrap{padding:22px}.tutorial-frame{width:min(100%,37svh)}footer{margin-top:18px}}
@media(min-width:900px){
  main{width:min(1050px,calc(100% - 64px),max(825px,calc(150svh - 380px)))}
  .game-layout{grid-template-columns:minmax(0,1.47fr) minmax(300px,1fr);gap:27px}
  .page-heading{margin:22px 0 15px}.page-heading h1{font-size:clamp(47px,6.5svh,63px)}
  .page-heading p{margin-top:6px}.player{min-height:44px}
  footer{margin-top:18px}
}
@media(min-width:900px) and (max-height:760px){
  .masthead{height:55px}.page-heading{margin:14px 0 10px}.page-heading h1{font-size:44px}
  .panel h2{font-size:22px;padding-top:13px;padding-bottom:10px}.panel-body{padding-bottom:13px}
  .label{margin-top:9px}.history-scroll{height:58px}aside{gap:12px}.guide-panel{min-height:105px}
  .guide-content{padding-top:12px;padding-bottom:12px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}body.reduced *,body.reduced *:before,body.reduced *:after{animation:none!important;transition:none!important}
.new-game{white-space:nowrap;flex-shrink:0}
@media(max-width:430px){
  .page-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;margin-top:17px;margin-bottom:7px}
  .page-heading>div{display:contents}.page-heading h1{grid-column:1/-1;font-size:40px}
  .page-heading p{margin:0;font-size:12px;align-self:center}
  .page-heading .new-game{min-height:34px}
}
