/* Inter, self-hosted (SIL Open Font License, see assets/fonts/Inter-OFL-LICENSE.txt). No request ever goes to Google. */
@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(assets/fonts/inter-latin-ext-wght-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(assets/fonts/inter-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Chess16 design system. Flat, data-first, one accent (blue). Green/red carry meaning only.
   Single stylesheet for every page. No blur, no gradients, no glow, no decoration. */

/* ---------- tokens ---------- */
:root{
  --bg:#ffffff;--sf:#f6f7f9;--bd:#e2e5ea;--bd2:#c9ced6;
  --tx:#14181f;--mu:#5b6473;
  --br:#1652f0;--bh:#0f43cc;--bi:#ffffff;--lk:#1652f0;
  --up:#0a7a43;--upbg:rgba(10,122,67,.10);--red:#cf2f2f;--dnbg:rgba(207,47,47,.10);
  --ac:#1652f0;--r:10px;--pop:0 4px 16px rgba(0,0,0,.12);
  /* board + pieces (read by the game script) */
  --ls:#ced1b4;--ds:#67824a;--hl:rgba(214,172,64,.42);
  --pw:#ffffff;--ps:#000000;--pb:#000000;--pbs:#ffffff;
  --skb:#e9ebef;--skh:#f2f4f7;
}
[data-theme=dark]{
  --bg:#0b0f17;--sf:#121823;--bd:#1f2937;--bd2:#324056;
  --tx:#e8ecf4;--mu:#8e9ab0;
  --br:#3366f0;--bh:#5380f6;--lk:#8cabff;
  --up:#3dd68c;--upbg:rgba(61,214,140,.12);--red:#ff7b7b;--dnbg:rgba(255,123,123,.12);
  --ac:#8cabff;--pop:0 10px 30px rgba(2,6,14,.6);
  --skb:#161d2a;--skh:#1d2636;
}

/* ---------- base ---------- */
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--tx);font:400 14px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-variant-numeric:tabular-nums;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.01em}
a{color:var(--lk)}
button{font:inherit;font-weight:500;cursor:pointer;border:1px solid var(--bd);background:var(--bg);color:var(--tx);border-radius:8px;padding:8px 14px}
button:hover{border-color:var(--bd2)}
button:disabled{opacity:.45;cursor:not-allowed}
:focus-visible{outline:2px solid var(--ac);outline-offset:2px}
input[type=text],input[type=search]{font:inherit;background:var(--bg);color:var(--tx);border:1px solid var(--bd);border-radius:8px;padding:9px 12px;width:100%}
input:focus{outline:2px solid var(--ac);outline-offset:0;border-color:var(--ac)}
.pri{background:var(--br);border-color:var(--br);color:var(--bi);font-weight:600}
.pri:hover{background:var(--bh);border-color:var(--bh)}
.v{display:none}.v.on{display:block}
.row{display:flex;gap:8px}.row button{flex:1}
.wrap{max-width:1280px;margin:0 auto;padding:0 clamp(12px,3vw,24px)}
.lg-d{display:none}[data-theme=dark] .lg-l{display:none}[data-theme=dark] .lg-d{display:block}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.up{color:var(--up)}.dn{color:var(--red)}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ---------- top bar ---------- */
.top{position:sticky;top:0;z-index:20}
#logo{display:flex;flex:none}#logo img{height:26px}
.tools{display:flex;gap:6px;align-items:center;margin-left:auto}
.wbtn i{width:8px;height:8px;border-radius:50%;background:var(--up)}
#bp,#mu,#th{width:36px;height:36px;display:grid;place-items:center;padding:0;border-radius:8px;position:relative;background:var(--bg)}
#bp svg,#th svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ico{width:18px;height:18px;background:currentColor;-webkit-mask:url(assets/speaker.png) center/contain no-repeat;mask:url(assets/speaker.png) center/contain no-repeat}

[data-theme=dark] .sun,:root:not([data-theme=dark]) .moon{display:none}
.top .wrap.tr{height:auto;gap:0}

/* ---------- hero ---------- */
.hd h1{font-size:clamp(26px,4vw,32px);line-height:1.15;font-weight:700;letter-spacing:-.02em}
.hd p{margin:8px 0 0;color:var(--mu);font-size:16px;max-width:60ch}
.hbtn{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
.hbtn a{display:inline-flex;align-items:center;padding:10px 18px;border-radius:8px;font-weight:600;text-decoration:none;border:1px solid var(--bd2);color:var(--tx)}
.hbtn a:hover{border-color:var(--tx)}
.hbtn a.pri{border-color:var(--br);color:var(--bi)}.hbtn a.pri:hover{background:var(--bh);border-color:var(--bh)}
.stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.chip{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid var(--bd);border-radius:999px;background:var(--sf);color:var(--mu);font-size:13px}
.chip b{color:var(--tx);font-weight:600}
.dot{width:8px;height:8px;border-radius:50%;background:var(--up);flex:none}

/* ---------- popular ---------- */

/* ---------- sections ---------- */
.sec{padding:28px 0 0}
.sh{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
.sh h2{font-size:20px;font-weight:700}
.sh a,.sh button{color:var(--lk);font-size:13px;font-weight:600;text-decoration:none;border:0;background:none;padding:0}
.sh a:hover,.sh button:hover{text-decoration:underline;border:0}
.sub{color:var(--mu);font-size:13px;margin:-6px 0 12px}
.tsw{display:flex;align-items:center;gap:6px;margin:0 0 12px;flex-wrap:wrap}.tsw[hidden]{display:none}
.tsw span{font-size:13px;color:var(--mu);margin-right:4px}
.tsw button{border-radius:999px;padding:6px 14px;font-size:13px;font-weight:600;background:var(--bg)}
.tsw button.on{background:var(--br);border-color:var(--br);color:var(--bi)}

/* ---------- market cards ---------- */
.egrid,.cgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media(max-width:1000px){.egrid,.cgrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.egrid,.cgrid{grid-template-columns:1fr}}
.egrid.cut>.ecard:nth-child(n+7){display:none}
.cban{grid-column:1/-1;margin:0;padding:10px 14px;border-radius:var(--r);font-size:13px;background:var(--dnbg);border:1px solid var(--red)}
.ecard,.mcard{display:flex;flex-direction:column;gap:12px;padding:16px;background:var(--sf);border:1px solid var(--bd);border-radius:var(--r);min-width:0}
.ecard:hover,.mcard:hover{border-color:var(--bd2)}
.mtop{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--mu)}
.live{display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border-radius:999px;background:var(--dnbg);color:var(--red);font-weight:600;font-size:12px}
.live::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.mtit{font-size:16px;font-weight:600;line-height:1.3}
.mr{display:grid;gap:6px}
.mrow{display:flex;align-items:baseline;justify-content:space-between;gap:8px;color:var(--mu);font-size:13px}
.mrow b{color:var(--tx);font-size:24px;font-weight:700;letter-spacing:-.02em;line-height:1.1}
.mrow b.up{color:var(--up)}
.mbar{height:4px;border-radius:2px;background:var(--bd);overflow:hidden}
.mbar i{display:block;height:100%;background:var(--br);border-radius:2px}
.mbar.g i{background:var(--up)}
.mbtns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:auto}
.mbtns button{padding:10px 8px;font-weight:600;border-radius:8px}
.eplay,.mplay{background:var(--upbg);color:var(--up);border:1px solid transparent}
.eplay:hover,.mplay:hover{border-color:var(--up)}
.edet{background:transparent}
.mfoot{margin:0;color:var(--mu);font-size:12px}
.edt{display:none;border-top:1px solid var(--bd);padding-top:10px;font-size:13px;color:var(--mu)}
.ecard.open .edt{display:grid;gap:6px}
.edt div{display:flex;justify-content:space-between}.edt b{color:var(--tx)}
.edt p{margin:4px 0 0;font-size:12px}.edt a{color:var(--lk)}
.mcard label{display:block}
.mcard small.hint{color:var(--mu);font-size:12px}
.lvl{display:flex;gap:3px;align-items:flex-end;height:16px}
.lvl u{width:6px;border-radius:2px;background:var(--bd2);display:block;text-decoration:none}
.lvl u:nth-child(1){height:7px}.lvl u:nth-child(2){height:11px}.lvl u:nth-child(3){height:16px}
.l1 u:nth-child(-n+1),.l2 u:nth-child(-n+2),.l3 u{background:var(--br)}
.mcard .pbtn{background:var(--bg);font-weight:600;padding:10px}
.mcard .pbtn.pri{background:var(--br)}

/* ---------- footer ---------- */
.foot{margin-top:48px;border-top:1px solid var(--bd);padding:32px 0 calc(32px + env(safe-area-inset-bottom));color:var(--mu);font-size:13px}
.fcols{display:grid;grid-template-columns:repeat(4,1fr);gap:24px}
@media(max-width:700px){.fcols{grid-template-columns:repeat(2,1fr)}}
.fcols h4{color:var(--tx);font-size:13px;font-weight:600;margin-bottom:10px}
.fcols a{display:block;color:var(--mu);text-decoration:none;padding:3px 0}.fcols a:hover{color:var(--tx);text-decoration:underline}
.fleg{margin:24px 0 0;padding-top:16px;border-top:1px solid var(--bd);font-size:12px;color:var(--mu)}

/* ---------- mobile bottom bar ---------- */
.mnav{display:none}
@media(max-width:760px){
  .mnav{display:grid;grid-template-columns:repeat(2,1fr);position:fixed;left:0;right:0;bottom:0;z-index:25;background:var(--bg);border-top:1px solid var(--bd);padding-bottom:env(safe-area-inset-bottom)}
  .mnav button{border:0;background:none;border-radius:0;display:grid;justify-items:center;gap:2px;padding:8px 0;font-size:11px;color:var(--mu)}
  .mnav button.on{color:var(--tx)}
  .mnav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  body:not(.ingame) main{padding-bottom:64px}
  body.ingame .mnav{display:none}
}
.hide{display:none!important}

/* ---------- finding a player ---------- */
.center{min-height:60vh;display:grid;place-content:center;text-align:center;gap:16px;justify-items:center;padding:24px}
.radar{width:64px;height:64px;display:grid;place-items:center}
.radar .kn{width:56px;height:56px}.kn .pc{width:100%;height:100%;object-fit:contain}
.tcp{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:8px;background:var(--sf);border:1px solid var(--bd);font-weight:600;font-size:13px;white-space:nowrap}
.tcp img{width:18px;height:18px}
@keyframes sp{to{transform:rotate(360deg)}}
.radar::before{content:"";width:40px;height:40px;border-radius:50%;border:3px solid var(--bd);border-top-color:var(--br);animation:sp 1s linear infinite;position:absolute}
.radar .kn{opacity:0;position:absolute}

/* ---------- game page ---------- */
.game{max-width:1260px;margin:0 auto;padding:16px 12px 24px;display:flex;gap:16px;justify-content:center;flex-wrap:wrap;align-items:stretch}
.bw{width:min(100%,max(calc(100vh - 170px),520px),780px);min-width:280px}
.bar{display:flex;justify-content:space-between;align-items:center;padding:8px 0;font-weight:600}
.nm{display:flex;align-items:center;gap:8px}
.cp{display:flex;align-items:center;padding-left:6px;font-size:13px;color:var(--mu)}.cp b{margin-left:10px;font-weight:600}
.mini{width:20px;height:20px;margin-right:-6px;object-fit:contain}
.mini.w{--f:var(--pw);--s:var(--ps)}.mini.b{--f:var(--pb);--s:var(--pbs)}.mini *{fill:var(--f);stroke:var(--s);stroke-width:2.2;stroke-linejoin:round}
.clock{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:700;background:var(--sf);border:1px solid var(--bd);border-radius:8px;padding:0 12px;font-variant-numeric:tabular-nums}
.clock.act{border-color:var(--tx);background:var(--bg)}
.clock.low{color:var(--red)}
.clock .cic{width:.85em;height:.85em;flex:none;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.clock .mh{transform-box:view-box;transform-origin:12px 13px;stroke-width:1.8}
.bdw{position:relative;min-width:0}
#bd{display:grid;grid-template:repeat(8,1fr)/repeat(8,1fr);aspect-ratio:1;border-radius:4px;overflow:hidden;border:1px solid var(--bd);user-select:none;touch-action:none}
#bd.rv{box-shadow:0 0 0 2px var(--br)}
.sq{position:relative;cursor:pointer}.lt{background:var(--ls)}.dk{background:var(--ds)}
.sq.last::before,.sq.sel::before{content:"";position:absolute;inset:0;background:var(--hl)}
.sq.chk{background:radial-gradient(circle,var(--red) 20%,transparent 75%),var(--ls)}
.sq i{position:absolute;font:700 11px Inter,Arial;font-style:normal;opacity:.95;pointer-events:none}.sq i.r{top:2px;left:3px}.sq i.f{bottom:1px;right:3px}
.sq.lt i{color:var(--ds)}.sq.dk i{color:var(--ls)}
.sq.hint::after{content:"";position:absolute;inset:36%;border-radius:50%;background:rgba(0,0,0,.24)}
.sq.cap::after{content:"";position:absolute;inset:4%;border-radius:50%;border:4px solid rgba(0,0,0,.26)}
.pc{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;object-fit:contain}
#bd .pc{inset:3%;width:94%;height:94%}
.pc.w{--f:var(--pw);--s:var(--ps)}.pc.b{--f:var(--pb);--s:var(--pbs)}.pc *{fill:var(--f);stroke:var(--s);stroke-width:1.6;stroke-linejoin:round}.pc .d{fill:none;stroke-width:1.2;opacity:.6}
.side{display:flex;flex-direction:column;gap:12px;width:300px;background:var(--sf);border:1px solid var(--bd);border-radius:var(--r);padding:16px}
.st{font-weight:600;font-size:16px}
.gtool{display:flex;align-items:center;gap:6px}.gtool .st{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gtool button{width:32px;height:32px;padding:0;display:grid;place-items:center;border-radius:8px}
.gtool svg,.ctl svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.gtool button.on{border-color:var(--br);color:var(--lk)}
.gline{border-bottom:1px solid var(--bd);margin:0 -4px}
#mv{flex:1;min-height:180px;overflow:auto;font-size:14px;display:grid;grid-template-columns:28px 1fr 1fr;gap:2px 8px;align-content:start;color:var(--mu)}
#mv b{color:var(--tx);font-weight:500;cursor:pointer;display:flex;justify-content:space-between;align-items:baseline;gap:6px;padding:1px 6px;border-radius:6px}
#mv b:hover{background:var(--bg)}
#mv b.cur{background:color-mix(in srgb,var(--br) 14%,transparent);box-shadow:inset 0 0 0 1px var(--br)}
#mv b small{font-size:11px;font-weight:400;color:var(--mu)}
.em{grid-column:1/-1;margin:0;color:var(--mu);font-size:14px;text-align:center;align-self:center;padding:40px 0}
.ctl{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.ctl button{display:grid;place-items:center;padding:8px 0}.ctl button:disabled{opacity:.4}
.rvb{display:none;font-size:12px;color:var(--mu);text-align:center;margin:-4px 0 0}.rvb.on{display:block}.rvb a{color:var(--lk);cursor:pointer}
#rp{background:none;border:0;color:var(--mu);font-size:13px;padding:2px 0;text-align:left;display:flex;gap:6px;align-items:center;width:max-content}#rp:hover{color:var(--red)}
#rp svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#ng{width:100%;white-space:nowrap}#post{display:flex}#lv button{flex:1}
.stk{display:flex;border:1px solid var(--bd);border-radius:8px;background:var(--bg);overflow:hidden}
.stk>div{flex:1;display:flex;flex-direction:column;gap:2px;padding:8px 12px;min-width:0}.stk>div+div{border-left:1px solid var(--bd)}
.stk small{font-size:12px;color:var(--mu)}.stk b{font-size:19px;line-height:1.1}.stk .w b{color:var(--up)}
.dng{background:var(--red);border-color:var(--red);color:#fff}
.dng-o{background:transparent;border-color:var(--red);color:var(--red);font-weight:600}.dng-o:hover{background:var(--dnbg)}
/* game view fits one screen */
:root{--hdr:49px;--bar:38px}
body.ingame{height:100dvh;overflow:hidden;display:flex;flex-direction:column}
body.ingame .top{flex:none}

body.ingame #logo img{height:22px}
body.ingame .foot{display:none}
body.ingame main{flex:1;min-height:0;display:flex;flex-direction:column}
body.ingame #gm_.on{flex:1;min-height:0;display:flex}
body.ingame .game{--bs:max(240px,min(calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--hdr) - 2*var(--bar) - 16px),calc(100vw - 340px - 48px)));flex:1;min-height:0;max-width:none;width:100%;margin:0;padding:0 12px 8px;gap:16px;flex-wrap:nowrap;align-items:center;justify-content:center}
body.ingame .bw{width:var(--bs);min-width:0;flex:none}
body.ingame .bar{height:var(--bar);padding:0}
body.ingame .nm{font-size:15px}
body.ingame .clock{font-size:20px;line-height:30px;padding:0 10px}
body.ingame .side{width:300px;flex:none;height:calc(var(--bs) + 2*var(--bar));overflow:hidden}
body.ingame #mv{height:auto;min-height:0;flex:1}
body.ingame.theater{--hdr:0px}body.ingame.theater .top{display:none}
body.ingame.focus{--hdr:0px}body.ingame.focus .top{display:none}body.ingame.focus .side{display:none}
@media(max-width:760px){
  .bw{width:100%}.side{width:100%}
  body.ingame .game{--bs:max(240px,min(calc(100vw - 16px),calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--hdr) - 2*var(--bar) - 200px)));flex-direction:column;gap:8px;padding:0 8px 8px;justify-content:flex-start;overflow-y:auto}
  body.ingame .side{width:100%;height:auto;flex:none;padding:12px;gap:8px}
  body.ingame #mv{flex:none;height:52px}body.ingame #mi{display:none}
  body.ingame .st{font-size:15px}body.ingame .bar .clock{font-size:18px}
}
@media(min-width:761px){
  body.ingame{--bar:0px}
  body.ingame .game{--lc:150px;--bs:max(240px,min(calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--hdr) - 16px),calc(100vw - 340px - 48px - var(--lc) - 12px)))}
  body.ingame .bw{width:calc(var(--bs) + var(--lc) + 12px);display:grid;grid-template-columns:var(--lc) var(--bs);grid-template-rows:1fr 1fr;column-gap:12px}
  body.ingame #bd{width:100%}
  body.ingame .bw>.bar:first-child{grid-area:1/1;align-self:start}
  body.ingame .bw>.bar:last-child{grid-area:2/1;align-self:end}
  body.ingame .bar{height:auto;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px}
  body.ingame .bw>.bar:last-child{flex-direction:column-reverse;justify-content:flex-end}
  body.ingame .nm{flex-direction:column;align-items:flex-start;gap:2px;max-width:var(--lc)}
  body.ingame .nm>span:first-child{max-width:var(--lc);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.ingame .cp{padding-left:0;flex-wrap:wrap;min-height:20px}
  body.ingame .clock{font-size:24px;line-height:36px;padding:0 14px}
  body.ingame.focus .game{--bs:max(240px,min(calc(100dvh - 16px),calc(100vw - 12vw - 48px - var(--lc) - 12px - 100px - 16px)));justify-content:center;padding-left:0;padding-right:12vw;gap:16px}
}
body.ingame .bdw{grid-area:1/2/3/3}
.rail{display:none}
body.ingame.focus .rail{display:flex;flex-direction:column;justify-content:space-between;align-items:center;height:var(--bs);width:100px;flex:none}
.rail button{width:44px;height:44px;padding:0;display:grid;place-items:center;border-radius:8px}.rail button:disabled{opacity:.4}
.rail svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rnav{display:flex;gap:8px}#rfl{color:var(--red)}.rsp{width:0;height:0}
@media(max-width:760px){body.ingame.focus .rail{flex-direction:row;height:auto;width:var(--bs)}}
#fx{position:fixed;top:calc(10px + env(safe-area-inset-top,0px));right:12px;z-index:8;width:36px;height:36px;padding:0;display:none;place-items:center;border-radius:8px}
body.ingame.focus #fx{display:grid}#fx svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
/* overlays anchored to the board */
.abn,.endw{position:absolute;inset:0;display:none;place-items:center;pointer-events:none}.abn.on,.endw.on{display:grid}
.abn{z-index:8}.endw{z-index:9}body:not(.ingame) .abn{display:none!important}
.abn>div{background:#16181d;color:#fff;border:1px solid #2a2f38;border-radius:8px;padding:10px 16px;text-align:center;font-weight:600;font-size:14px;max-width:88%}
.abn b{display:block;color:#ff6b6b;font-size:20px;margin-top:2px}
.endc{pointer-events:auto;position:relative;width:min(300px,86%);background:#16181d;color:#fff;border:1px solid #2a2f38;border-radius:var(--r);box-shadow:var(--pop);display:flex;flex-direction:column;align-items:center;padding:24px 20px;text-align:center}
.endc h2{margin:0;font-size:clamp(24px,3.2vw,30px);font-weight:700;line-height:1.1}
.endc .esb{margin:8px 0 14px;font-size:13px;font-weight:500;color:#c8ccd4}
.etc{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;margin-bottom:16px}.etc img{width:20px;height:20px}
.endx{position:absolute;top:8px;right:8px;width:28px;height:28px;padding:0;border:0;background:transparent;color:#c8ccd4;border-radius:6px;display:grid;place-items:center}.endx:hover{color:#fff}
.endc .pri{background:var(--br);color:#fff;border:0;padding:12px 0;width:min(180px,100%);font-weight:600;white-space:nowrap}
.endc .tlink{background:none;border:0;color:#a4abb8;font-size:13px;margin-top:10px;padding:4px 8px}.endc .tlink:hover{color:#fff;text-decoration:underline}
.epay{width:100%;margin:0 0 16px;padding:12px 14px;border-radius:8px;background:#0d0f13;border:1px solid #2a2f38;text-align:center}
.epay .am{font-size:26px;font-weight:700;line-height:1.1}.epay .am.win{color:#34c77b}.epay .am.loss{color:#ff6b6b}
.epay .pl{display:inline-block;margin:6px 0 2px;font-size:12px;font-weight:600;padding:2px 10px;border-radius:999px}
.pl.ok{color:#34c77b;background:rgba(52,199,123,.14)}.pl.wait{color:#f5b942;background:rgba(245,185,66,.14)}
.epay p{margin:4px 0 0;font-size:13px;line-height:1.45;color:#b4bac5}.epay a{color:#7aa2ff}

/* ---------- popovers, dialogs, menus, toasts ---------- */
.pop{position:fixed;top:calc(env(safe-area-inset-top,0px) + 60px);right:12px;width:min(300px,calc(100vw - 24px));background:var(--bg);border:1px solid var(--bd);border-radius:var(--r);padding:16px;z-index:30;display:none;box-shadow:var(--pop)}
.pop.on{display:block}.pop h4{margin:0 0 12px;font-size:15px}
#bpop{max-height:calc(100dvh - 72px);overflow:auto}
.sw{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.swb{display:grid;gap:6px;justify-items:center;padding:8px 4px;font-size:13px;border-radius:8px;background:transparent}
.swb[aria-pressed=true]{border-color:var(--br);box-shadow:0 0 0 1px var(--br);color:var(--lk);font-weight:600}
.swp{width:54px;height:54px;border-radius:6px;border:1px solid var(--bd);background:conic-gradient(var(--b) 25%,var(--a) 0 50%,var(--b) 0 75%,var(--a) 0) 0 0/50% 50%}
.swp.tx{display:grid;grid-template:1fr 1fr/1fr 1fr;overflow:hidden;background:none}.swp.tx i{display:block;background-size:cover;background-position:center}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;place-items:center;z-index:50}.modal.on{display:grid}
.modal>div{background:var(--bg);border:1px solid var(--bd);border-radius:var(--r);padding:24px;text-align:center;display:grid;gap:12px;min-width:280px;box-shadow:var(--pop)}
.modal>.dlg{width:min(92vw,360px);max-width:360px;padding:24px 20px 20px;gap:8px;justify-items:center}
.dlg-ic{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;margin-bottom:4px;background:var(--dnbg);color:var(--red)}
.dlg-ic.ok{background:var(--upbg);color:var(--up)}
.dlg-ic svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dlg h3{font-size:20px}.dlg p,#cf p{margin:0;color:var(--mu);font-size:14px;line-height:1.45;max-width:32ch}
.dlg-btns{display:grid;gap:8px;width:100%;margin-top:12px}.dlg-btns button{padding:11px 16px;font-size:15px}
#cf>div{max-width:340px}
.toast{position:fixed;left:50%;top:calc(env(safe-area-inset-top,0px) + 68px);transform:translateX(-50%);display:flex;align-items:center;gap:12px;width:max-content;max-width:min(92vw,380px);padding:10px 16px 10px 12px;border-radius:var(--r);background:var(--bg);color:var(--tx);border:1px solid var(--bd);box-shadow:var(--pop);opacity:0;visibility:hidden;pointer-events:none;z-index:70}
.toast.on{opacity:1;visibility:visible}
.toast .ti{flex:none;width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:var(--c);background:color-mix(in srgb,var(--c) 14%,transparent)}
.toast .ti svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.toast .tx{display:grid;gap:1px;text-align:left;min-width:0}.toast .tx b{font-size:14px;font-weight:600}.toast .tx small{font-size:12px;color:var(--mu)}
.toast .tp{display:none}
.toast.ok{--c:var(--up)}.toast.info{--c:var(--br)}.toast.err{--c:var(--red)}
.wmenu{position:fixed;z-index:60;top:60px;right:14px;min-width:220px;background:var(--bg);border:1px solid var(--bd);border-radius:var(--r);padding:8px;box-shadow:var(--pop);display:none}
.wmenu.on{display:grid;gap:2px}.wmenu div{padding:8px 10px;font-size:13px;color:var(--mu)}.wmenu b{color:var(--tx)}
.wmenu button{text-align:left;padding:9px 10px;border-radius:6px;font-size:14px;background:transparent;border:0;color:var(--tx)}.wmenu button:hover{background:var(--sf)}

/* ---------- wallet + deposit dialogs ---------- */
#wmod>div,#dmod>div{max-width:420px;width:calc(100% - 28px);max-height:90vh;overflow:auto}
.wh{display:flex;align-items:center;justify-content:space-between;gap:10px}.wh h3{margin:0;flex:1;text-align:center}
.wh button{width:32px;height:32px;border-radius:8px;font-size:20px;line-height:1;padding:0;background:transparent;border:0;color:var(--mu)}
.wck{display:flex;gap:9px;text-align:left;font-size:13px;color:var(--mu);align-items:flex-start;padding:10px;border-radius:8px;border:1px solid transparent}.wck input{margin-top:3px;width:auto}
.wck.bad{border-color:var(--red);background:var(--dnbg)}
.wl{display:grid;gap:8px}
.wrow{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:8px;font-weight:600;font-size:15px;text-align:left;background:var(--bg);border:1px solid var(--bd);color:var(--tx);text-decoration:none}
.wrow:hover{border-color:var(--br)}.wrow .wn{flex:1}.wrow .ch{color:var(--mu);font-size:20px}
.wic{flex:none;width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:#fff;font-weight:700;font-size:15px;overflow:hidden;background:var(--mu)}.wic img{width:100%;height:100%;object-fit:cover}
.wbd{display:inline-flex;align-items:center;gap:5px;font-style:normal;font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px;color:var(--up);background:var(--upbg)}
.wbd b{width:6px;height:6px;border-radius:50%;background:currentColor}.wbd.i{color:var(--mu);background:var(--sf)}
.dtag{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;background:var(--sf);color:var(--mu)}
.wqr{background:#fff;border-radius:8px;padding:12px;width:260px;height:260px;margin:0 auto;display:grid;place-items:center;border:1px solid var(--bd)}.wqr svg{width:100%;height:100%}
.wcen{text-align:center;color:var(--mu);font-size:14px;margin:0}.wcen b{color:var(--tx)}
.wsm{color:var(--mu);font-size:12px;line-height:1.45;margin:0}
.dpool{display:grid;border:1px solid var(--bd);border-radius:8px;padding:2px 14px;font-size:14px;background:var(--sf)}.dpool div{display:flex;justify-content:space-between;padding:8px 0}.dpool div+div{border-top:1px solid var(--bd)}.dpool .w{font-weight:700}.dpool .w b{color:var(--up)}
.dst{list-style:none;margin:0;padding:0;display:grid;gap:6px;text-align:left;font-size:14px}.dst li{display:flex;justify-content:space-between}
.dst em{font-style:normal;color:var(--mu)}.dst em.ok{color:var(--up);font-weight:600}
.cxl{text-align:center;display:grid;gap:8px;justify-items:center}.cxl h3{margin:0;font-size:20px}.cxl p{margin:0;color:var(--mu);font-size:14px;line-height:1.45;max-width:30ch}
.cxi{width:48px;height:48px;border-radius:50%;margin-bottom:4px;display:grid;place-items:center;font-size:0;--c:#b7791f;color:var(--c);background:color-mix(in srgb,var(--c) 14%,transparent)}
.cxi.mute{--c:var(--mu)}.cxi svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cxr{width:100%;padding:10px 12px;border-radius:8px;border:1px solid var(--bd);font-size:14px;font-weight:600}.cxr.ok{color:var(--up);background:var(--upbg);border-color:var(--up)}
.cxsum{width:100%;margin:8px 0;border:1px solid var(--bd);border-radius:8px;padding:2px 14px;text-align:left;font-size:14px;background:var(--sf)}
.cxsum>div{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0}.cxsum>div+div{border-top:1px solid var(--bd)}
.cxsum span{color:var(--mu)}.cxsum b{display:inline-flex;align-items:center;gap:6px;font-weight:600}.cxsum b.ok{color:var(--up)}.cxsum b svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.cxl .pri{width:100%;padding:12px 16px;font-size:15px}
.cxb2{width:100%;padding:11px 16px;font-size:15px;background:transparent;font-weight:600}
.cxl .tlink2{background:none;border:0;color:var(--mu);font-size:14px;padding:4px}
.cxcard{width:min(92vw,380px);max-width:380px;padding:24px 20px 20px}

/* ---------- boot screen + skeletons (calm, static) ---------- */
#boot{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:#fff;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility 0s .2s}
[data-theme=dark] #boot{background:var(--bg)}
html.booting #boot{opacity:1;visibility:visible;pointer-events:auto;transition:none}
#boot .bt{display:grid;justify-items:center;gap:12px;width:min(150px,44vw)}
#boot .bt img{width:100%;height:auto;display:block}
#boot .bt .lg-d{display:none}[data-theme=dark] #boot .bt .lg-l{display:none}[data-theme=dark] #boot .bt .lg-d{display:block}
#boot .ldbar{position:relative;width:88%;height:3px;border-radius:2px;background:#e2e5ea;overflow:hidden}
[data-theme=dark] #boot .ldbar{background:var(--bd)}
#boot .ldbar i{position:absolute;top:0;bottom:0;left:0;width:50%;background:#1652f0;animation:ldslide 1.3s ease-in-out infinite}
@keyframes ldslide{0%{transform:translateX(-100%)}100%{transform:translateX(200%)}}
.sk-b,.sk-board::after,.sk-side i,.sk-bar i{background:var(--skb);animation:skp 1.6s ease-in-out infinite}
@keyframes skp{50%{background:var(--skh)}}
.sk-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ecard.sk{pointer-events:none;min-height:272px}
.ecard.sk .sk-b{display:block;border-radius:6px}
.sk-t{width:40%;height:14px}.sk-h{width:70%;height:20px}.sk-r{width:100%;height:36px}.sk-bt{width:100%;height:40px;margin-top:auto}
.wbtn:not(.rdy){pointer-events:none;color:transparent!important;border-color:transparent!important;background:var(--skb)!important}
.wbtn:not(.rdy) *{visibility:hidden}
.stats:not(.ok) b{display:inline-block;min-width:26px;color:transparent;border-radius:6px;vertical-align:middle;background:var(--skb)}
#gsk{display:none}
html.hasGame.booting #home{display:none}
html.hasGame.booting #gsk{display:grid;grid-template-columns:minmax(0,560px) 300px;gap:16px;justify-content:center;align-items:start;padding:14px clamp(12px,3vw,24px)}
.sk-wrap{display:grid;gap:10px;min-width:0}
.sk-bar{display:flex;align-items:center;justify-content:space-between;height:40px}
.sk-bar i{display:block;height:16px;width:38%;border-radius:6px}.sk-bar i+i{width:76px;height:30px}
.sk-board{position:relative;width:100%;aspect-ratio:1;border-radius:4px;overflow:hidden;border:1px solid var(--bd);background:conic-gradient(var(--skb) 25%,transparent 0 50%,var(--skb) 0 75%,transparent 0) 0 0/25% 25%}
.sk-board::after{content:"";position:absolute;inset:0;opacity:.4}
.sk-side{display:grid;gap:12px;align-content:start;padding:16px;border:1px solid var(--bd);border-radius:var(--r);background:var(--sf)}
.sk-side i{display:block;height:14px;border-radius:6px}.sk-side i:nth-child(1){width:55%;height:20px}.sk-side i:nth-child(3n){width:80%}
@media(max-width:760px){html.hasGame.booting #gsk{grid-template-columns:minmax(0,1fr);padding:8px}.sk-side{padding:12px}}

/* ---------- board textures ---------- */
html[data-board=forest]{--ls:#ced1b4;--ds:#67824a}
html[data-board=green]{--ls:#d4d6d0;--ds:#5b8539}
html[data-board=pink]{--ls:#d9cfd3;--ds:#c47f8e}
html[data-board=blue]{--ls:#cecdb9;--ds:#426587}
html[data-board=wood]{--ls:#d4b592;--ds:#a5592c}
html[data-board=sand]{--ls:#d1bc98;--ds:#a07454}
html[data-board=oak]{--ls:#c8a975;--ds:#835c38}
html[data-board=skymarble]{--ls:#d3e0e4;--ds:#789bb0}
html[data-board=blush]{--ls:#ffffff;--ds:#fbd8dd}
html[data-board=slate]{--ls:#d6d7db;--ds:#484a50}
html[data-board] .lt{background:var(--ls)}html[data-board] .dk{background:var(--ds)}
html[data-board=oak] .lt.v0{--tile:url(assets/boards/wood-l0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=oak] .lt.v1{--tile:url(assets/boards/wood-l1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=oak] .dk.v0{--tile:url(assets/boards/wood-d0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=oak] .dk.v1{--tile:url(assets/boards/wood-d1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=skymarble] .lt.v0{--tile:url(assets/boards/marble-l0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=skymarble] .lt.v1{--tile:url(assets/boards/marble-l1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=skymarble] .dk.v0{--tile:url(assets/boards/marble-d0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=skymarble] .dk.v1{--tile:url(assets/boards/marble-d1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=slate] .lt.v0{--tile:url(assets/boards/slate-l0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=slate] .lt.v1{--tile:url(assets/boards/slate-l1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=slate] .dk.v0{--tile:url(assets/boards/slate-d0.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board=slate] .dk.v1{--tile:url(assets/boards/slate-d1.jpg);background:var(--tile) 0 0/100% 100%}
html[data-board] .sq.chk.lt,html[data-board] .sq.chk.dk{background-image:radial-gradient(circle,var(--red) 20%,transparent 75%),var(--tile,none);background-size:100% 100%;background-color:var(--ls)}
html[data-board] .sq.chk.dk{background-color:var(--ds)}
html[data-board=oak] .sq.lt i{color:#835c38}html[data-board=oak] .sq.dk i{color:#f1e2c6}
html[data-board=skymarble] .sq.lt i{color:#4f7488}html[data-board=skymarble] .sq.dk i{color:#eef5f7}
html[data-board=blush] .sq.lt i{color:#d98a97}html[data-board=blush] .sq.dk i{color:#fff}
html[data-board=slate] .sq.lt i{color:#45474d}html[data-board=slate] .sq.dk i{color:#e8e9ec}
.mbtns.one{grid-template-columns:1fr}
.sec,body{scroll-margin-top:112px}
html{scroll-behavior:auto}
@media(max-width:560px){
  .top .wrap{gap:8px}.tools{gap:4px}.top .wbtn{padding:0 12px}
  body:not(.ingame) #bp{display:none}
  body:not(.ingame) .top .nav{padding:0 10px;gap:6px}
  body:not(.ingame) .top .tools{gap:6px}
  body:not(.ingame) .top .wbtn{height:38px;padding:0 12px;font-size:13px;box-shadow:none}
  body:not(.ingame) .top #mu,body:not(.ingame) .top #th{width:38px;height:38px}
  body.ingame .top .wbtn{display:none}
  #logo img{height:22px}
}

/* ---------- pricing-tier cards (entry tiers, free game, bots) ---------- */
.ecard,.mcard{gap:0;padding:28px 28px 24px;border-radius:16px}
.ptop{display:flex;align-items:center;justify-content:space-between;min-height:24px}
.pname{font-size:16px;font-weight:600}
.pprice{display:flex;align-items:baseline;gap:6px;margin-top:20px}
.pprice b{font-size:36px;font-weight:700;letter-spacing:-.03em;line-height:1.1}
.pprice span{color:var(--mu);font-size:14px}
.pdesc{margin:10px 0 0;color:var(--mu);font-size:14px;line-height:1.5}
.pl{list-style:none;margin:20px 0 24px;padding:0;display:grid;gap:12px;font-size:14px}
.pl li{display:flex;gap:12px;align-items:flex-start}
.pl li::before{content:"";flex:none;width:6px;height:11px;margin:1px 5px 0 4px;border:solid var(--tx);border-width:0 2px 2px 0;transform:rotate(45deg)}
.pl b{font-weight:600}
.eplay,.mplay,.pbtn{margin-top:auto;width:100%;padding:14px 16px;border-radius:12px;background:var(--tx);color:var(--bg);border:1px solid var(--tx);font-weight:600;font-size:14px}
.eplay:hover,.mplay:hover,.pbtn:hover{opacity:.88;border-color:var(--tx)}
.mcard .fld{margin:16px 0 12px}.mcard .pdesc{margin-bottom:auto}.mcard .pbtn{margin-top:20px}
.enote{margin:14px 0 0;font-size:12px;color:var(--mu);line-height:1.5}.enote a{color:var(--lk)}
.ecard.sk{min-height:430px}.sk-r{height:22px;margin-top:12px}
.ecard.sk .sk-h{margin-top:20px;height:36px}

/* ---------- match tier cards: plan-card look, $1 card content ---------- */
.ecard{--cb:#fafaf8;--cbd:#e8e8e4;--cin:#fff;--cink:#14181f;--cmu:#6b6f76;--cpill:rgba(20,24,31,.09);
  padding:28px;border-radius:22px;background:var(--cb);border:1px solid var(--cbd);color:var(--cink)}
:root[data-theme=dark] .ecard{--cb:#0f1520;--cbd:#222c3d;--cin:#161e2c;--cink:#e8ecf4;--cmu:#8e9ab0;--cpill:rgba(140,171,255,.12)}
.ecard:hover{border-color:var(--cbd)}
.ecard .ptop{min-height:26px}
.ecard .pname{font-size:17px;font-weight:600;letter-spacing:-.01em}
.ecard .pprice{margin-top:22px;gap:8px;justify-content:center}
.ecard .pprice b{font-size:44px;font-weight:700;letter-spacing:-.04em;line-height:1}
.ecard .pprice span,.ecard .pdesc,.ecard .enote{color:var(--cmu)}
.ecard .pdesc{margin:12px 0 0;text-align:center}
.etime{display:inline-flex;align-items:center;gap:7px;align-self:center;margin:18px 0 22px;padding:7px 12px 7px 10px;border-radius:999px;background:var(--cpill);font-size:13px;font-weight:500}
.etime svg,.estat svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.etime svg{width:15px;height:15px}
.estat,.efee{margin:0;background:var(--cin);border-radius:16px}
.estat{display:grid;grid-template-columns:1fr 1fr;padding:16px 0}
.estat div{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.estat div+div{border-left:1px solid var(--cbd)}
.estat svg{width:20px;height:20px;margin-bottom:4px;color:var(--cmu)}
.estat dd{order:1;margin:0;font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.estat dt{order:2;font-size:13px;color:var(--cmu)}
.efee{margin-top:10px;padding:6px 16px}
.efee div{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:9px 0;font-size:14px}
.efee div+div{border-top:1px solid var(--cbd)}
.efee dt{color:var(--cmu)}.efee dd{margin:0;font-weight:500}
.efee .win dt{color:var(--cink);font-weight:600}
.efee .win dd{color:var(--up);font-weight:700;font-size:16px}
.ecard .eplay{margin-top:22px;height:50px;padding:0 20px;border-radius:999px;background:var(--br);border-color:var(--br);color:#fff;font-size:15px;font-weight:600}
.ecard .eplay:hover:not(:disabled){background:var(--bh);border-color:var(--bh);opacity:1}
.ecard .eplay:disabled{opacity:.4;cursor:not-allowed}
.ecard .enote{margin-top:16px;text-wrap:pretty}
.ecard .enote a{color:inherit;text-underline-offset:2px}
.ecard.sk{min-height:560px;background:var(--cb)}
@media(max-width:560px){.ecard{padding:24px}.ecard .pprice b{font-size:40px}}

/* ---------- connect wallet (redesign) ---------- */
#wmod{background:rgba(8,11,17,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
#wmod>.wm{display:flex;flex-direction:column;gap:0;padding:0;text-align:left;width:calc(100% - 24px);max-width:420px;max-height:min(88vh,700px);overflow:hidden;border-radius:22px;border:1px solid var(--bd);box-shadow:0 24px 60px rgba(0,0,0,.28)}
.wm .wh{flex:none;padding:18px 16px 10px 16px;gap:8px}
.wm .wh h3{font-size:17px;font-weight:700;letter-spacing:-.01em}
.wm .wh button,.wm .wsp{width:34px;height:34px;flex:none}
.wm .wh button{border-radius:50%;background:var(--sf);color:var(--tx);font-size:20px;display:grid;place-items:center}
.wm .wh button:hover{background:var(--bd)}
.wm .wbody{flex:1;min-height:0;overflow-y:auto;padding:4px 16px 14px;display:grid;gap:12px;align-content:start}
.wm .wintro{display:flex;align-items:center;justify-content:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--sf);font-size:13px;color:var(--mu);text-align:left}
.wm .wlock{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--br) 14%,transparent);color:var(--br)}
.wm .wlock svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wm .wlab{font-size:11px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--mu);margin:2px 2px -4px}
.wm .wl{display:grid;gap:8px}
.wm .wrow{display:flex;align-items:center;gap:14px;width:100%;padding:12px 14px;border-radius:14px;background:var(--bg);border:1px solid var(--bd);color:var(--tx);text-decoration:none;text-align:left;transition:border-color .15s,background .15s,transform .15s}
.wm .wrow:hover:not(:disabled){border-color:var(--br);background:var(--sf)}
.wm .wrow:active:not(:disabled){transform:scale(.99)}
.wm .wt{flex:1;min-width:0;display:grid;gap:1px}
.wm .wn{font-size:15px;font-weight:600;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wm .wt small{font-size:12px;font-weight:400;color:var(--mu);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wm .ch{flex:none;color:var(--mu);font-size:20px;line-height:1}
.wm .wic{width:42px;height:42px;border-radius:12px;flex:none;box-shadow:0 0 0 1px rgba(0,0,0,.07)}
.wm .wic img{width:100%;height:100%;object-fit:cover;display:block}
.wm .wmi{background:#000}
.wm .wstack{display:flex;flex:none;padding-right:2px}
.wm .wstack img{width:22px;height:22px;border-radius:50%;object-fit:cover;border:2px solid var(--bg);margin-left:-8px;background:var(--bg)}
.wm .wrow:hover .wstack img{border-color:var(--sf)}
.wm .wgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.wm .wtile{display:grid;justify-items:center;gap:8px;padding:12px 4px 10px;border-radius:14px;border:1px solid var(--bd);background:var(--bg);color:var(--tx);text-decoration:none;font-size:12px;font-weight:600;text-align:center;transition:border-color .15s,background .15s}
.wm .wtile:hover{border-color:var(--br);background:var(--sf)}
.wm .wtile .wic{width:48px;height:48px;border-radius:14px}
.wm .wbd{font-size:10.5px;letter-spacing:.03em}
.wm .wqr{width:min(260px,100%);height:auto;aspect-ratio:1;border-radius:16px;margin:4px auto}
.wm .wcen{font-size:14px}
.wm .wsm{padding:0 2px}
.wm .wfoot{flex:none;display:grid;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--bd);background:var(--bg)}
.wm .wck{position:relative;display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:12px;background:var(--sf);border:1px solid transparent;font-size:12.5px;line-height:1.45;color:var(--mu);cursor:pointer}
.wm .wck a{color:var(--tx);text-underline-offset:2px}
.wm .wck input{position:absolute;opacity:0;pointer-events:none}
.wm .wbx{flex:none;width:20px;height:20px;margin-top:1px;border-radius:6px;border:1.5px solid var(--bd2);background:var(--bg);display:grid;place-items:center;transition:background .15s,border-color .15s}
.wm .wbx svg{width:13px;height:13px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;opacity:0;transform:scale(.6);transition:.15s}
.wm .wck input:checked+.wbx{background:var(--br);border-color:var(--br)}
.wm .wck input:checked+.wbx svg{opacity:1;transform:none}
.wm .wck input:focus-visible+.wbx{outline:2px solid var(--ac);outline-offset:2px}
.wm .wck.bad{border-color:var(--red);background:var(--dnbg)}
.wm .wfoot .wsm:empty{display:none}
@media(max-width:420px){.wm .wgrid{grid-template-columns:repeat(2,1fr)}.wm .wstack{display:none}}

/* =====================================================================
   Chess16 floating navbar, hero, finding page, footer  (blue theme)
   ===================================================================== */
body:not(.ingame){background-image:radial-gradient(900px 420px at 50% -140px,rgba(22,82,240,.11),transparent 70%),radial-gradient(600px 300px at 100% 0,rgba(22,82,240,.06),transparent 70%);background-repeat:no-repeat}
[data-theme=dark] body:not(.ingame){background-image:radial-gradient(1100px 520px at 50% -200px,rgba(70,110,255,.17),transparent 70%),radial-gradient(700px 360px at 100% -40px,rgba(120,90,255,.07),transparent 70%)}

.top{padding:12px 0 0}
.top .wrap{padding-top:0}
.nav{display:flex;align-items:center;gap:20px;height:60px;padding:0 10px 0 22px;border-radius:999px;border:1.5px solid transparent;
  background:linear-gradient(var(--bg),var(--bg)) padding-box,linear-gradient(90deg,rgba(22,82,240,.25),#1652f0 50%,rgba(22,82,240,.25)) border-box;
  box-shadow:0 10px 34px rgba(22,82,240,.12),0 1px 2px rgba(0,0,0,.04)}
[data-theme=dark] .nav{box-shadow:0 10px 34px rgba(0,0,0,.5)}
.nlinks{display:flex;align-items:center;gap:6px;margin:0 auto 0 12px}
.nlinks a{padding:8px 14px;border-radius:999px;font-weight:600;font-size:14px;color:var(--mu);text-decoration:none;white-space:nowrap;transition:color .15s,background .15s}
.nlinks a:hover{color:var(--tx);background:var(--sf)}
.nlinks a.on{color:var(--br);background:color-mix(in srgb,var(--br) 10%,transparent)}
[data-theme=dark] .nlinks a.on{color:var(--lk)}
.nbtn{display:inline-flex;align-items:center;justify-content:center;height:42px;padding:0 20px;border-radius:999px;border:1px solid var(--bd2);background:var(--bg);color:var(--tx);font-weight:600;font-size:14px;text-decoration:none;white-space:nowrap;transition:border-color .15s,background .15s,transform .15s}
.nbtn:hover{border-color:var(--tx)}
.nbtn.pri{background:var(--br);border-color:var(--br);color:#fff}.nbtn.pri:hover{background:var(--bh);border-color:var(--bh)}
.top .tools{gap:8px}
.top .wbtn{height:42px;padding:0 22px;border-radius:999px;font-weight:600;background:var(--br);border:1px solid var(--br);color:#fff;display:flex;gap:8px;align-items:center;white-space:nowrap;box-shadow:0 6px 16px rgba(22,82,240,.28)}
.top .wbtn:hover{background:var(--bh);border-color:var(--bh)}
.top .wbtn.on{background:var(--bg);color:var(--tx);border-color:var(--bd);box-shadow:none}
.top #bp,.top #mu,.top #th{width:42px;height:42px;border-radius:50%}

/* in a game the bar goes back to a slim strip so the board keeps its exact size */
body.ingame .top{padding:0}
body.ingame .top .wrap{padding:0}
body.ingame .nav{height:var(--hdr);border-radius:0;border-width:0 0 1px;border-color:var(--bd);background:var(--bg);box-shadow:none;padding:0 14px}

body.ingame .top .wbtn{height:34px;box-shadow:none}
body.ingame .top #bp,body.ingame .top #mu,body.ingame .top #th{width:34px;height:34px}

@media(max-width:900px){.nlinks{display:none}.nav{margin-left:0}.nbtn:not(.pri){display:none}.top .tools{margin-left:auto}}
@media(max-width:760px){.top{padding-top:8px}.nav{height:54px;padding:0 8px 0 16px}.top .wbtn{height:38px;padding:0 16px}}

/* ---------- home hero ---------- */
.hero2{display:grid;grid-template-columns:1.15fr .85fr;align-items:center;gap:24px;margin-top:22px;padding:34px 40px;border-radius:28px;border:1px solid var(--bd);overflow:hidden;position:relative;
  background:radial-gradient(520px 320px at 85% 50%,rgba(22,82,240,.16),transparent 70%),linear-gradient(135deg,color-mix(in srgb,var(--br) 7%,var(--bg)),var(--bg) 70%)}
.hcopy{position:relative;z-index:1}
.eyebrow{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;font-size:12.5px;font-weight:600;color:var(--br);background:color-mix(in srgb,var(--br) 11%,transparent)}
[data-theme=dark] .eyebrow{color:var(--lk)}
.eyebrow i{width:7px;height:7px;border-radius:50%;background:currentColor}
.hero2 h1{margin-top:16px;font-size:clamp(32px,5vw,52px);line-height:1.05;font-weight:800;letter-spacing:-.035em}
.hero2 p{margin:14px 0 0;color:var(--mu);font-size:17px;max-width:46ch}
.hero2 .stats{margin-top:20px}
.hcta{display:flex;gap:10px;margin-top:22px;flex-wrap:wrap}.hcta .nbtn{height:46px;padding:0 24px;font-size:15px}
.hart{position:relative;display:grid;place-items:center}
.hart img{width:min(100%,380px);height:auto;filter:drop-shadow(0 26px 30px rgba(10,30,90,.28));animation:flo 6s ease-in-out infinite}
@keyframes flo{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-10px) rotate(1deg)}}
@media(max-width:820px){.hero2{grid-template-columns:1fr;padding:26px 22px;border-radius:22px}.hart{display:none}}

/* ---------- finding a player ---------- */
#find.v.on{display:block}
.fwrap{display:grid;grid-template-columns:1.05fr .95fr;align-items:center;gap:20px;margin:28px auto;max-width:1000px;min-height:min(520px,calc(100vh - 220px));padding:44px 48px;border-radius:32px;border:1px solid var(--bd);overflow:hidden;position:relative;
  background:radial-gradient(520px 360px at 82% 52%,rgba(22,82,240,.2),transparent 70%),linear-gradient(135deg,color-mix(in srgb,var(--br) 8%,var(--bg)),var(--bg) 72%);box-shadow:0 24px 60px rgba(22,82,240,.12)}
.fcopy{display:grid;gap:14px;justify-items:start;position:relative;z-index:1}
.fchip{display:inline-flex;align-items:center;gap:9px;padding:7px 14px;border-radius:999px;font-size:12.5px;font-weight:600;color:var(--br);background:color-mix(in srgb,var(--br) 11%,transparent)}
[data-theme=dark] .fchip{color:var(--lk)}
.pulse{width:8px;height:8px;border-radius:50%;background:var(--br);box-shadow:0 0 0 0 rgba(22,82,240,.55);animation:pls 1.6s infinite}
@keyframes pls{70%{box-shadow:0 0 0 10px rgba(22,82,240,0)}100%{box-shadow:0 0 0 0 rgba(22,82,240,0)}}
#find h2{font-size:clamp(30px,4.6vw,46px);line-height:1.08;font-weight:800;letter-spacing:-.035em;text-align:left}
.fsub{margin:0;color:var(--mu);font-size:16px;max-width:38ch}
#find .tcp{border-radius:999px;padding:8px 16px;background:var(--bg)}
.fbar{width:min(100%,360px);height:6px;border-radius:99px;background:color-mix(in srgb,var(--br) 14%,transparent);overflow:hidden;margin-top:4px}
.fbar i{display:block;height:100%;width:40%;border-radius:99px;background:linear-gradient(90deg,transparent,var(--br),transparent);animation:fb 1.5s ease-in-out infinite}
@keyframes fb{0%{transform:translateX(-110%)}100%{transform:translateX(260%)}}
.fsteps{list-style:none;margin:0;padding:0;display:grid;gap:9px;font-size:14px;color:var(--mu);font-weight:500}
.fsteps li{display:flex;align-items:center;gap:10px}
.fsteps b{width:18px;height:18px;border-radius:50%;border:2px solid var(--bd2);flex:none;display:block}
.fsteps li.d{color:var(--tx)}.fsteps li.d b{border-color:var(--br);background:var(--br) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/70% no-repeat}
.fsteps li:not(.d):last-child b{border-style:dashed;animation:sp 2.4s linear infinite}
.fbtns{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.fbtns button{height:46px;padding:0 24px;border-radius:999px;font-weight:600;font-size:15px}
#bot{background:var(--br);border-color:var(--br);color:#fff}#bot:hover{background:var(--bh);border-color:var(--bh)}
#cancel{background:var(--bg);border-color:var(--bd2)}
.fart{position:relative;display:grid;place-items:center;min-height:260px}
.fart img{position:relative;width:min(118%,490px);height:auto;filter:drop-shadow(0 30px 34px rgba(10,30,90,.32));animation:flo 5s ease-in-out infinite}
.fart .glow{position:absolute;width:78%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgba(22,82,240,.3),transparent 68%);filter:blur(10px);animation:pls2 3s ease-in-out infinite}
@keyframes pls2{50%{transform:scale(1.12);opacity:.75}}
@media(max-width:820px){.fwrap{grid-template-columns:1fr;padding:28px 22px;border-radius:24px;gap:6px;margin:14px auto}.fart{order:-1;min-height:0}.fart img{width:min(86%,340px)}#find h2{font-size:30px}}

/* ---------- footer ---------- */
.foot{margin-top:56px;border-top:0;padding:0 0 calc(28px + env(safe-area-inset-bottom));font-size:14px}
.fcard{display:grid;grid-template-columns:minmax(220px,.9fr) 2fr;gap:36px;padding:34px 40px;border-radius:28px;border:1px solid var(--bd);
  background:radial-gradient(500px 260px at 0 0,rgba(22,82,240,.12),transparent 70%),var(--sf)}
.fbrand{display:grid;gap:14px;align-content:start;justify-items:start}
.fbrand img{height:28px}.fbrand p{margin:0;color:var(--mu);font-size:14px;line-height:1.55;max-width:34ch}
.fbrand .nbtn{height:44px;padding:0 24px}
.fcols{grid-template-columns:repeat(4,1fr);gap:20px}
.fcols h4{font-size:12px;letter-spacing:.07em;text-transform:uppercase;color:var(--tx);margin-bottom:12px}
.fcols a{padding:5px 0;font-size:14px;transition:color .15s,transform .15s}
.fcols a:hover{color:var(--br);text-decoration:none;transform:translateX(2px)}
[data-theme=dark] .fcols a:hover{color:var(--lk)}
.fleg{margin:18px 4px 0;padding:0;border:0;text-align:center}
@media(max-width:900px){.fcard{grid-template-columns:1fr;padding:26px 22px;gap:24px;border-radius:22px}}
@media(max-width:560px){.fcols{grid-template-columns:repeat(2,1fr)}}

/* ---------- in-game text fixes: no more clipped status / player names (board, pieces, clocks untouched) ---------- */
.gtool .st{white-space:normal;overflow:visible;text-overflow:clip;font-size:14px;line-height:1.25;min-width:0}
@media(min-width:761px){body.ingame .nm>span:first-child{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.25}}

/* ---------- footer pages (support, terms, privacy ...) ---------- */
body.pg{max-width:none;margin:0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);background:var(--bg);color:var(--tx);font:400 16px/1.7 Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
[data-theme=dark] body.pg{background:var(--bg);color:var(--tx)}
body.pg:not(.ingame){background-image:radial-gradient(900px 420px at 50% -140px,rgba(22,82,240,.11),transparent 70%)}
[data-theme=dark] body.pg:not(.ingame){background-image:radial-gradient(1100px 520px at 50% -200px,rgba(70,110,255,.17),transparent 70%),radial-gradient(700px 360px at 100% -40px,rgba(120,90,255,.07),transparent 70%)}
.pg .doc{max-width:900px;margin:26px auto 0;padding:0 clamp(12px,3vw,24px)}
/* legal pages: same theme + Inter type as "How it works" (surface cards, blue number badges) */
.pg .doc>.lg{padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.pg .doc h1{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:clamp(24px,3.4vw,32px);font-weight:700;letter-spacing:-.02em;line-height:1.2;margin:6px 0 8px;color:var(--tx)}
.pg .doc .lead,.pg .doc .lead p{color:var(--mu);font-size:15px;line-height:1.6;margin:0 0 4px}
.pg .doc .lead{margin-bottom:18px}
.pg .doc .dcs{display:grid;gap:16px}
.pg .doc .dc{background:var(--sf);border:1px solid var(--bd);border-radius:18px;padding:22px 24px;font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;min-width:0}
.pg .doc .dc .hn{display:grid;place-items:center;width:fit-content;min-width:34px;height:34px;padding:0 11px;border-radius:999px;background:var(--br);color:var(--bi,#fff);font-size:13.5px;font-weight:700;margin-bottom:12px}
.pg .doc .dc h2{margin:0 0 8px;font-size:17px;font-weight:700;letter-spacing:0;line-height:1.35;color:var(--tx)}
.pg .doc .dc p,.pg .doc .dc li{margin:0 0 8px;color:var(--mu);font-size:14.5px;line-height:1.6}
.pg .doc .dc>:last-child,.pg .doc .dc li>:last-child{margin-bottom:0}
.pg .doc .dc ul,.pg .doc .dc ol{margin:0 0 8px;padding-left:20px}
.pg .doc .dc li{margin:6px 0}.pg .doc .dc li>p{margin:0}
.pg .doc .dc li ul,.pg .doc .dc li ol{margin:6px 0 0}
.pg .doc .dc strong{color:var(--tx);font-weight:600}
.pg .doc .dc li::marker{color:var(--bd2)}
.pg .doc .dc blockquote{margin:0;padding:14px 18px;border-left:3px solid var(--br);border-radius:0 12px 12px 0;background:color-mix(in srgb,var(--br) 8%,transparent)}
.pg .doc .dc blockquote p{color:var(--tx);font-size:16px;margin:0}
@media(max-width:640px){.pg .doc .dcs{gap:12px}.pg .doc .dc{padding:18px 16px;border-radius:16px}}
.pg .doc .upd{display:inline-block;padding:3px 12px;border-radius:999px;font-size:13px;background:color-mix(in srgb,var(--br) 10%,transparent);color:var(--br);margin:0 0 20px}
[data-theme=dark] .pg .doc .upd{color:var(--lk)}
.pg .doc a{color:var(--br);text-underline-offset:3px}[data-theme=dark] .pg .doc a{color:var(--lk)}
.pg .doc table{width:100%;border-collapse:collapse;display:block;overflow-x:auto}
.pg .doc th,.pg .doc td{padding:8px 12px;border:1px solid var(--bd);text-align:left}
/* legal-page nav: same card theme + Inter type as "How it works" */
.pg .doc .lgtop{display:flex;flex-wrap:wrap;gap:10px;padding:0 0 20px;margin-bottom:24px;border-bottom:1px solid var(--bd)}
.pg .doc .lgtop a,[data-theme=dark] .pg .doc .lgtop a{display:inline-flex;align-items:center;padding:9px 16px;border-radius:14px;border:1px solid var(--bd);background:var(--sf);color:var(--tx);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:14.5px;font-weight:600;line-height:1.3;letter-spacing:-.005em;text-decoration:none;transition:border-color .15s,background .15s,color .15s,transform .15s}
.pg .doc .lgtop a:hover,[data-theme=dark] .pg .doc .lgtop a:hover{border-color:var(--br);color:var(--br);text-decoration:none;transform:translateY(-1px)}
[data-theme=dark] .pg .doc .lgtop a:hover{color:var(--lk)}
.pg .doc .lgtop a:focus-visible{outline:2px solid var(--br);outline-offset:2px}
.pg .doc .lgtop a.on,[data-theme=dark] .pg .doc .lgtop a.on,.pg .doc .lgtop a.on:hover{background:var(--br);border-color:var(--br);color:var(--bi,#fff);transform:none}
@media(max-width:640px){.pg .doc .lgtop{gap:8px}.pg .doc .lgtop a{padding:8px 13px;font-size:14px;border-radius:12px}}
.pg .nbtn.on{border-color:var(--br);color:var(--br)}
/* footer pages: keep navbar/footer colours when the page-level link colour is applied */
.pg .nlinks a{color:var(--mu)}.pg .nlinks a:hover{color:var(--tx)}.pg .nlinks a.on{color:var(--br)}[data-theme=dark] .pg .nlinks a.on{color:var(--lk)}
.pg .nbtn{color:var(--tx)}.pg .nbtn.pri{color:#fff}.pg .nbtn.on{color:var(--br)}
.pg .fcols a{color:var(--mu)}.pg .fcols a:hover{color:var(--br)}[data-theme=dark] .pg .fcols a:hover{color:var(--lk)}
.pg .fcols h4{color:var(--tx)}

/* ---------- game info panel (new look, same features) ---------- */
.side{--sd:340px;background:linear-gradient(180deg,color-mix(in srgb,var(--br) 8%,var(--bg)),color-mix(in srgb,var(--br) 3%,var(--bg)));border:1px solid color-mix(in srgb,var(--br) 14%,var(--bd));border-radius:24px;padding:12px 16px 16px;gap:14px;box-shadow:0 10px 32px color-mix(in srgb,var(--br) 10%,transparent)}
.gtabs{gap:8px;align-items:center}
.gtab{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:16px 16px 4px 4px;background:var(--bg);color:var(--lk);font-weight:600;font-size:15px;border-bottom:3px solid var(--br);box-shadow:0 2px 10px color-mix(in srgb,var(--br) 8%,transparent)}
.gtab svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.gbtns{display:flex;gap:6px}
.gtool .gbtns button{width:36px;height:36px;border-radius:12px;background:var(--bg)}
.gstat{display:flex;align-items:center;gap:8px;padding:2px 2px 0}
.gstat .st{font-weight:700;font-size:15px;line-height:1.25;white-space:normal}
.gstat .bolt{width:20px;height:20px;flex:none;fill:#f5a000;stroke:#f5a000;stroke-width:1.5;stroke-linejoin:round}
.stk{gap:10px;border:0;background:none;overflow:visible}
.stk>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:8px;row-gap:4px;background:var(--bg);border:1px solid var(--bd)!important;border-radius:16px;padding:12px;box-shadow:0 2px 10px color-mix(in srgb,var(--br) 7%,transparent)}
.stk small{font-size:13px}.stk b{grid-column:1/-1;font-size:24px}
.gi{display:grid;place-items:center;width:24px;height:24px}.gi svg{width:22px;height:22px;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gi.tr svg{stroke:#e8a000;fill:color-mix(in srgb,#f5b400 35%,transparent)}.gi.gf svg{stroke:#ef6a3a;fill:color-mix(in srgb,#ff8a50 30%,transparent)}
.gline{margin:0}
#mv{font-size:14px}
.em{display:flex;align-items:center;justify-content:center;gap:10px;padding:36px 4px}
.em svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.ctl{gap:8px}
.ctl button{padding:12px 0;border-radius:14px;background:color-mix(in srgb,var(--br) 5%,var(--bg))}
.ctl svg{stroke-width:2.6}.ctl #rb1 svg,.ctl #rb3 svg,.ctl #rb5 svg{fill:currentColor}
#rs{width:100%;display:flex;justify-content:center;align-items:center;gap:10px;padding:13px;border-radius:14px;font-weight:600;background:color-mix(in srgb,var(--br) 5%,var(--bg))}
#rs svg{width:20px;height:20px;fill:currentColor;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#rp{font-size:14px;color:var(--tx);gap:8px;padding:2px 4px}#rp svg{width:18px;height:18px}
body.ingame .side{width:var(--sd);overflow:auto}
@media(min-width:761px){body.ingame .game{--bs:max(240px,min(calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--hdr) - 16px),calc(100vw - 340px - 80px - var(--lc) - 12px)))}}
@media(max-width:760px){.side{padding:10px 12px 12px;gap:10px}body.ingame .side{width:100%}.stk b{font-size:20px}}

/* ---------- how it works ---------- */
.how{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.how li{background:var(--sf);border:1px solid var(--bd);border-radius:18px;padding:20px}
.how .hn{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--br);color:var(--bi);font-weight:700;margin-bottom:12px}
.how h3{margin:0 0 6px;font-size:17px}.how p{margin:0;color:var(--mu);font-size:14px;line-height:1.5}
@media(max-width:900px){.how{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.how{grid-template-columns:1fr}}
.stk small{white-space:nowrap;font-size:12.5px}

/* ---------- flat header + flat "Choose Your Entry" card (no rounded borders) ---------- */
body:not(.ingame) .top{padding:0;background:var(--bg)}
body:not(.ingame) .nav{border:0;border-radius:0;box-shadow:none;background:var(--bg)}
[data-theme=dark] body:not(.ingame) .nav{box-shadow:none}
.hero2{border:0;border-radius:0}
@media(max-width:820px){.hero2{border-radius:0}}

/* ---------- landing page: one continuous soft shade, no card edges ---------- */
body:has(#home.on){background:radial-gradient(760px 460px at 80% 250px,rgba(22,82,240,.14),transparent 72%) no-repeat,linear-gradient(180deg,color-mix(in srgb,var(--br) 8%,var(--bg)) 0,var(--bg) 760px) no-repeat,var(--bg)}
body:has(#home.on) .hero2{background:none;border:0;border-radius:0;box-shadow:none;overflow:visible}
body:not(.ingame) .top{background:color-mix(in srgb,var(--bg) 55%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
body:not(.ingame) .nav{background:none}

/* header: same shade as the page, sits a little lower with room around the buttons */
body:not(.ingame) .top{padding:16px 0 8px;background:color-mix(in srgb,color-mix(in srgb,var(--br) 8%,var(--bg)) 45%,transparent)}
@media(max-width:760px){body:not(.ingame) .top{padding:10px 0 6px}}

/* in-game header: same shade and breathing room as the landing page; only Home + Match tiers links */
body.ingame{--hdr:68px}
@media(max-width:760px){body.ingame{--hdr:58px}}
body.ingame .top{background:color-mix(in srgb,var(--br) 8%,var(--bg))}
body.ingame .nav{border:0;background:none;box-shadow:none;padding:0 24px}
body.ingame .nlinks a:nth-child(n+3),body.ingame .nbtn{display:none}

/* in-game header: exactly the landing-page header size and spacing */
body.ingame{--hdr:84px}
@media(max-width:760px){body.ingame{--hdr:70px}}
body.ingame .top{padding:16px 0 8px}
body.ingame .top .wrap{padding:0 clamp(12px,3vw,24px)}
body.ingame .nav{height:60px;padding:0 10px 0 22px}
@media(max-width:760px){body.ingame .top{padding:10px 0 6px}body.ingame .nav{height:54px;padding:0 8px 0 16px}}

/* game page: same continuous shade as the landing page so header and page match */
body.ingame{background:linear-gradient(180deg,color-mix(in srgb,var(--br) 8%,var(--bg)) 0,var(--bg) 760px) no-repeat,var(--bg)}
body.ingame .top{background:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.nm .cp{padding-left:0}

/* Match Tier / Winner receives cards: icon sits right next to its label */
.stk>div{display:flex;flex-wrap:wrap;align-items:center;gap:6px 6px;padding:12px 12px}
.stk .gi{flex:none;width:20px;height:20px}.stk .gi svg{width:20px;height:20px}
.stk small{flex:1;min-width:0;font-size:12.5px}
.stk b{flex:0 0 100%}
.stk>div{flex-direction:row;align-content:center}
.stk>div .w b,.stk .w b{color:var(--up)}

/* board icon button */
#bp img{width:24px;height:24px;object-fit:contain;display:block;border-radius:5px}
body.ingame .top #bp img{width:22px;height:22px}

/* header: soft fade instead of a hard bottom edge (no visible line) */
body:not(.ingame) .top{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;transition:background .15s,box-shadow .15s}
/* once scrolled the header turns solid so content never shows behind the nav; at the very top it stays transparent, so no shaded band */
body:not(.ingame) .top.stuck{background:var(--bg);box-shadow:0 8px 18px -14px rgba(10,20,40,.35)}

/* hero motion: entrance, float, glow pulse, pointer tilt */
.hart{perspective:900px}
.hart>img{transform-style:preserve-3d;animation:hrise .9s cubic-bezier(.2,.8,.2,1) both,flo2 5.5s ease-in-out .9s infinite;transform-origin:50% 70%}
.hart::before{content:"";position:absolute;inset:8% 6%;border-radius:50%;background:radial-gradient(closest-side,rgba(22,82,240,.28),transparent 72%);animation:glw 5.5s ease-in-out infinite;z-index:0}
.hart>img{position:relative;z-index:1}
.hart{transform:rotateY(var(--rx,0deg)) rotateX(var(--ry,0deg));transition:transform .18s ease-out}
@keyframes hrise{from{opacity:0;transform:translateY(40px) scale(.9) rotate(-4deg)}to{opacity:1;transform:none}}
@keyframes flo2{0%,100%{transform:translateY(0) rotate(-1.4deg) scale(1)}50%{transform:translateY(-16px) rotate(1.6deg) scale(1.025)}}
@keyframes glw{0%,100%{opacity:.55;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.hart>img,.hart::before{animation:none}.hart{transform:none}}

/* ===== result (winner) card: shown when a game ends ===== */
.modal>.endc{width:min(340px,92vw);min-width:0;padding:28px 22px 18px;gap:0;display:flex;flex-direction:column;align-items:center;background:#16181d;color:#fff;border:1px solid #2a2f38;text-align:center}
.endx svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.endi{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;margin:0 0 12px;background:rgba(255,255,255,.08);color:#c8ccd4}
.endi svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#end[data-r=win] .endi{background:rgba(52,199,123,.16);color:#34c77b}#end[data-r=win] h2{color:#34c77b}
#end[data-r=loss] .endi{background:rgba(255,107,107,.14);color:#ff6b6b}
.endc .esb{margin:8px 0 16px}
.endc .epay{margin:0 0 16px}
.endc .pri{width:100%;padding:12px 16px;font-size:15px;border-radius:8px}
.endc .tlink{width:100%;margin-top:8px;padding:10px 8px;font-size:14px}

/* ===== in-game "Match Tier" / "Winner receives" cards: icon, label and amount line up the same in both ===== */
.side .stk{display:flex;gap:10px;border:0;background:none;overflow:visible}
.side .stk>div{flex:1 1 0;min-width:0;display:grid;grid-template-columns:20px minmax(0,1fr);grid-template-rows:20px auto;align-items:center;column-gap:5px;row-gap:6px;padding:12px 10px;text-align:left}
.side .stk .gi{width:20px;height:20px;justify-self:start;align-self:center}
.side .stk .gi svg{width:20px;height:20px;display:block}
.side .stk small{display:block;margin:0;padding:0;line-height:20px;font-size:12px;white-space:nowrap;overflow:visible;text-align:left}
.side .stk b{grid-column:1/-1;justify-self:start;margin:0;padding:0;line-height:1.1;font-size:22px;text-align:left}


/* images are artwork, not draggable files: no ghost-image drag, no blue selection flash */
img{-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;user-drag:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.hart,.fart{-webkit-user-select:none;user-select:none}


/* ===== dark theme refinement: ink-navy surfaces, hairline borders, soft depth ===== */
[data-theme=dark] body{color-scheme:dark}
[data-theme=dark] ::selection{background:rgba(83,128,246,.35)}
[data-theme=dark] .nav{background:linear-gradient(var(--bg),var(--bg)) padding-box,linear-gradient(90deg,rgba(83,128,246,.18),rgba(83,128,246,.55) 50%,rgba(83,128,246,.18)) border-box;box-shadow:0 12px 36px rgba(2,6,14,.55),inset 0 1px 0 rgba(255,255,255,.03)}
[data-theme=dark] .hero2{background:radial-gradient(520px 320px at 85% 50%,rgba(70,110,255,.18),transparent 70%),linear-gradient(135deg,#101828,var(--bg) 72%)}
[data-theme=dark] .fwrap{border-color:#222c3d;background:radial-gradient(520px 360px at 82% 52%,rgba(70,110,255,.22),transparent 70%),linear-gradient(135deg,#111a2b,var(--bg) 72%);box-shadow:0 28px 70px rgba(2,6,14,.55),inset 0 1px 0 rgba(255,255,255,.04)}
[data-theme=dark] .fart img,[data-theme=dark] .hart img{filter:drop-shadow(0 28px 34px rgba(2,6,14,.7))}
[data-theme=dark] .fart .glow,[data-theme=dark] .hart::before{background:radial-gradient(circle,rgba(83,128,246,.32),transparent 68%)}
[data-theme=dark] .fcard{border-color:#1f2937;background:radial-gradient(500px 260px at 0 0,rgba(70,110,255,.13),transparent 70%),var(--sf);box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}
[data-theme=dark] .nbtn{background:#0f1520;border-color:var(--bd2)}
[data-theme=dark] .nbtn:hover{border-color:var(--lk)}
[data-theme=dark] .nbtn.pri,[data-theme=dark] .top .wbtn{background:linear-gradient(180deg,#4574f4,#3366f0);border-color:#3b6cf2;box-shadow:0 8px 22px rgba(51,102,240,.32),inset 0 1px 0 rgba(255,255,255,.16)}
[data-theme=dark] .nbtn.pri:hover,[data-theme=dark] .top .wbtn:hover{background:linear-gradient(180deg,#5a85f7,#4574f4);border-color:#5380f6}
[data-theme=dark] .top .wbtn.on{background:var(--sf);border-color:var(--bd2);box-shadow:none}
[data-theme=dark] #cancel,[data-theme=dark] #find .tcp{background:#0f1520}
[data-theme=dark] .eyebrow,[data-theme=dark] .fchip{background:rgba(83,128,246,.13);color:var(--lk)}
[data-theme=dark] .fcols h4{color:#c9d2e3}

/* ---------- sound: round speaker button + volume slider ---------- */
#mu{background:var(--bg);border:1px solid var(--bd);color:var(--tx);border-radius:50%}
#mu:hover{border-color:var(--bd2)}
#mu .sico{display:grid;place-items:center}
#mu svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.vpop{padding:20px;display:none}
.vhead{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.vic{width:40px;height:40px;border-radius:50%;background:var(--tx);color:var(--bg);display:grid;place-items:center;flex:none}
.vic.off{background:var(--sf);color:var(--mu);border:1px solid var(--bd)}
.vic svg,.vrow svg,#vmi svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.vic svg{width:20px;height:20px}
.vtt{display:grid;gap:2px;flex:1;min-width:0}.vtt b{font-size:16px;line-height:1}.vtt small{font-size:12px;color:var(--mu)}
.vbadge{font-size:11px;font-weight:600;letter-spacing:.03em;padding:5px 9px;border-radius:999px;border:1px solid var(--bd);background:var(--sf);color:var(--mu);white-space:nowrap}
.vrow{display:flex;align-items:center;gap:14px}
.vrow button{width:40px;height:40px;padding:0;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--bg);border:1px solid var(--bd);color:var(--tx)}
.vrow button:hover{border-color:var(--bd2)}.vrow button:active{transform:scale(.94)}
#vu{background:var(--tx);border-color:var(--tx);color:var(--bg)}
.vrow button svg{width:18px;height:18px;stroke-width:1.9}
.vtrack{position:relative;flex:1;height:8px;margin:0 14px;border-radius:999px;background:var(--sf);border:1px solid var(--bd);cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;outline:none}
.vtrack:before{content:"";position:absolute;inset:-18px -14px}
.vfill{position:absolute;left:0;top:-1px;bottom:-1px;border-radius:999px;background:var(--br);transition:width .15s ease-out}
.vthumb{position:absolute;top:50%;width:28px;height:28px;margin-top:-14px;border-radius:50%;background:#fff;border:1px solid var(--bd2);box-shadow:0 1px 4px rgba(0,0,0,.18);display:grid;place-items:center;transition:left .15s cubic-bezier(.32,.72,0,1),transform .15s}
.vthumb i{width:10px;height:10px;border-radius:50%;background:var(--br)}
.vtrack:hover .vthumb{transform:scale(1.08)}.vthumb.drag{transform:scale(1.15);transition:transform .15s}
.vtrack:has(.vthumb.drag) .vfill{transition:none}
.vtrack:focus-visible .vthumb{box-shadow:0 0 0 3px rgba(22,82,240,.3)}
.vthumb.max{box-shadow:0 0 0 4px rgba(22,82,240,.16),0 1px 4px rgba(0,0,0,.18)}
.vpop.muted .vfill{background:var(--bd2)}.vpop.muted .vthumb i{background:var(--bd2)}
.vticks{display:flex;justify-content:space-between;margin:12px 54px 0;font-size:10px;color:var(--mu)}
.vfoot{display:flex;justify-content:space-between;align-items:center;margin-top:16px;padding-top:14px;border-top:1px solid var(--bd);color:var(--tx)}
.vnum{display:flex;align-items:baseline;gap:2px}.vnum b{font-size:30px;line-height:1;font-weight:600;font-variant-numeric:tabular-nums}.vnum em{font-style:normal;font-size:16px;color:var(--mu)}
.vpop.muted .vnum b{color:var(--bd2)}
.vfoot button{display:flex;align-items:center;gap:8px;height:40px;padding:0 16px;border-radius:999px;font-size:14px;font-weight:600}
#vmi svg{width:16px;height:16px}


/* ===== v6: new hero pawn, ending page (pieces only), sound Mute alignment ===== */
.hart img{width:auto;height:min(470px,62vh);max-width:100%;object-fit:contain}
:root{--endbg:var(--bg);--endsh:rgba(70,40,15,.22)}
[data-theme=dark]{--endsh:rgba(0,0,0,.65)}
body.ingame .endpg{display:none}
.vfoot{align-items:center}
.vfoot button{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;line-height:1;white-space:nowrap;margin:0}
#vmi{display:inline-grid;place-items:center;width:16px;height:16px;flex:none}
#vmi svg{display:block;width:16px;height:16px}
#vml{display:block;line-height:1}
.vnum{align-items:center}

/* v7: crisp hero pawn - no 3D tilt / scale resampling (these made the image look blurry) */
.hart{perspective:none;transform:none!important;transition:none}
.hart>img{transform-style:flat;image-rendering:auto;will-change:auto}
@keyframes flo2{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-14px) rotate(1deg)}}



/* ===== v10: footer chess pieces (all classes prefixed ep- so nothing clashes with the board or the hero) ===== */
.endpg{background:transparent;display:block;padding:clamp(4px,1vw,12px) clamp(14px,3vw,48px) calc(28px + env(safe-area-inset-bottom))}
.ep{width:min(100%,1500px);margin:0 auto;container-type:inline-size}
.ep-in{--sq:12.5cqw;--u:.02532cqw;padding-top:2cqw;display:grid;row-gap:2.6cqw}
.ep-row{display:grid;grid-template-columns:repeat(8,1fr);align-items:end}
.ep-sq{display:flex;justify-content:center;align-items:flex-end;cursor:pointer;position:relative;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.ep-sq img{display:block;height:calc(var(--h)*var(--u));width:auto;max-width:none;filter:drop-shadow(0 1.2cqw 1.4cqw var(--endsh));transition:filter .35s;-webkit-user-select:none;user-select:none;pointer-events:none}
.ep-sq.ep-fl img{transform:scaleX(-1)}
.ep-pc,.ep-px{transition:transform .55s cubic-bezier(.3,.7,.2,1)}
.ep-pc{position:relative;z-index:1}
.ep-sq:hover,.ep-sq.ep-go{z-index:5}
/* each piece's real chess move, in board squares (x right, y up) */
.ep-sq.ep-p{--mx:0;--my:-.45}      /* pawn: one step forward */
.ep-sq.ep-r{--mx:0;--my:-1.6}      /* rook: straight line */
.ep-sq.ep-b.ep-l{--mx:-1.6;--my:-1.6}   /* bishop: diagonal */
.ep-sq.ep-b.ep-rt{--mx:1.6;--my:-1.6}
.ep-sq.ep-q{--mx:-2;--my:-2}       /* queen: long diagonal */
.ep-sq.ep-k{--mx:0;--my:-1}        /* king: one step */
.ep-sq.ep-n{--my:-2}               /* knight: two forward, one sideways (an L) */
.ep-sq.ep-n.ep-l{--kx:1}.ep-sq.ep-n.ep-rt{--kx:-1}
@media(hover:hover){
.ep-sq:hover .ep-pc{transform:translate(calc(var(--mx,0)*var(--sq)),calc(var(--my)*var(--sq)))}
.ep-sq:hover .ep-px{transform:scale(1.05)}
.ep-sq:hover img{filter:drop-shadow(0 2.4cqw 2.2cqw var(--endsh))}
.ep-sq.ep-n:hover .ep-pc{transform:translateY(calc(var(--my)*var(--sq)))}
.ep-sq.ep-n:hover .ep-px{transform:translateX(calc(var(--kx)*var(--sq))) scale(1.05);transition-delay:.45s}}
.ep-sq.ep-go .ep-pc{transform:translate(calc(var(--mx,0)*var(--sq)),calc(var(--my)*var(--sq)))}
.ep-sq.ep-go .ep-px{transform:scale(1.05)}
.ep-sq.ep-go img{filter:drop-shadow(0 2.4cqw 2.2cqw var(--endsh))}
.ep-sq.ep-n.ep-go .ep-pc{transform:translateY(calc(var(--my)*var(--sq)))}
.ep-sq.ep-n.ep-go .ep-px{transform:translateX(calc(var(--kx)*var(--sq))) scale(1.05);transition-delay:.45s}
.ep-leg{margin:clamp(14px,2vw,24px) 4px 0;text-align:center;font-size:12px;line-height:1.5;color:var(--mu)}
@media(max-width:700px){.endpg{padding-bottom:calc(76px + env(safe-area-inset-bottom))}}
body.ingame .endpg{display:none}
@media(prefers-reduced-motion:reduce){.ep-pc,.ep-px{transition-duration:.01s;transition-delay:0s!important}}

/* ===== v12: landing hero - a wooden rook on each side, the copy in the middle ===== */
.hero2{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr);align-items:end;gap:clamp(12px,3vw,40px);min-height:clamp(280px,36vw,470px)}
.hero2 .hcopy{grid-column:2;grid-row:1;align-self:center;justify-self:center;width:100%;max-width:520px}
.hrook{grid-row:1;display:flex;align-items:flex-end;position:relative;-webkit-user-select:none;user-select:none}
.hrook-l{grid-column:1;justify-content:flex-start}
.hrook-r{grid-column:3;justify-content:flex-end}
.hrook::before{content:"";position:absolute;inset:6% -8% 0;background:radial-gradient(closest-side,rgba(22,82,240,.12),transparent 72%);pointer-events:none}
[data-theme=dark] .hrook::before{background:radial-gradient(closest-side,rgba(83,128,246,.24),transparent 72%)}
.hrook img{position:relative;display:block;height:clamp(240px,32vw,440px);width:auto;max-width:100%;object-fit:contain;filter:drop-shadow(0 22px 24px var(--endsh));transition:transform .45s cubic-bezier(.3,.7,.2,1),filter .45s;animation:hrk .9s cubic-bezier(.2,.8,.2,1) both}
.hrook-r img{animation-delay:.12s}
.hrook:hover img{transform:translateY(-14px);filter:drop-shadow(0 34px 30px var(--endsh))}
@keyframes hrk{from{opacity:0;transform:translateY(44px)}to{opacity:1;transform:none}}
@media(max-width:820px){
.hero2{grid-template-columns:1fr 1fr;align-items:end;gap:8px 12px;min-height:0}
.hero2 .hcopy{grid-column:1/-1;grid-row:1;max-width:none}
.hrook{grid-row:2}.hrook-l{grid-column:1;justify-content:center}.hrook-r{grid-column:2;justify-content:center}
.hrook img{height:clamp(170px,44vw,300px)}}
@media(prefers-reduced-motion:reduce){.hrook img{animation:none;transition:none}}

/* ===== v13: hero refinement - big rooks near the edges, centred copy, soft floor reflection ===== */
.hero2{padding:clamp(18px,3vw,36px) clamp(0px,.8vw,12px) clamp(40px,7vw,92px);min-height:clamp(340px,41vw,560px);gap:clamp(8px,2vw,32px)}
.hero2 .hcopy{max-width:500px}
.hero2 h1{font-size:clamp(34px,5.2vw,60px)}
.hero2 p{max-width:40ch}
.hrook img{height:clamp(250px,35vw,480px);-webkit-box-reflect:below -1px linear-gradient(to bottom,transparent 80%,rgba(0,0,0,.26))}
.hrook::after{content:"";position:absolute;left:6%;right:6%;bottom:-8px;height:clamp(14px,2vw,26px);background:radial-gradient(closest-side,rgba(20,30,60,.28),transparent);filter:blur(7px);pointer-events:none}
[data-theme=dark] .hrook::after{background:radial-gradient(closest-side,rgba(0,0,0,.55),transparent)}
@media(max-width:820px){.hero2{padding:20px 0 44px;min-height:0}.hrook img{height:clamp(170px,46vw,310px)}}


/* ===== v26: pill buttons everywhere (matches the landing-page Play / Pick a tier button) ===== */
button,.nbtn,.pri,.dng-o,.tlink,.wbtn,.pbtn,.eplay,.mplay,.wrow,.swb,.endx,
.rail button,.ctl button,.gtool .gbtns button,#bp,#mu,#th,#fx,#rs,#rp,
.dlg-btns button,.endc .pri,.cxl .pri,#pb button,input[type=button],input[type=submit],[role=button]{border-radius:999px !important}
/* custom icons: resign flag, report mark, result trophy */
.ic-flag{width:22px;height:22px;object-fit:contain;display:block;flex:none;pointer-events:none}
#rs .ic-flag{width:20px;height:20px}
.ic-rep{width:18px;height:18px;object-fit:contain;display:block;flex:none;pointer-events:none}
#rp:hover{color:var(--tx)}
.endi{width:64px;height:64px}
.endi img{width:38px;height:38px;object-fit:contain;display:block}

/* v27: timeout clock + cancel cross icons */
.cxi img{width:28px;height:28px;object-fit:contain;display:block}
.cxi.mute{background:none}.cxi.mute img{width:48px;height:48px}

/* dialog icons (image-based) */
.dlg-ic img{width:26px;height:26px;object-fit:contain;display:block;pointer-events:none}
.dlg-ic.bare{background:none}.dlg-ic.bare img{width:48px;height:48px}
.cxi.warn{background:none}.cxi.warn img{width:48px;height:48px}

/* ===== landing page: board-colors picker styled as rounded cards =====
   Scoped to the landing (body:not(.ingame)) and to #bpop only: the chess board, its colors and
   the in-game picker are untouched. */
body:not(.ingame) #bpop{width:min(300px,calc(100vw - 24px));padding:18px 16px 16px;border-radius:18px}
body:not(.ingame) #bpop h4{margin:0 0 14px;font-size:15px;font-weight:700}
body:not(.ingame) #bpop .sw{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
body:not(.ingame) #bpop .swb{gap:8px;padding:10px 4px 8px;border:1px solid var(--bd);border-radius:12px !important;background:var(--bg);font-size:12px;font-weight:500;line-height:1.2;text-align:center;align-content:start}
body:not(.ingame) #bpop .swb:hover{border-color:var(--bd2)}
body:not(.ingame) #bpop .swb[aria-pressed=true]{border-color:var(--br);box-shadow:0 0 0 1px var(--br);color:var(--lk);font-weight:600}
body:not(.ingame) #bpop .swp{width:50px;height:50px;border-radius:4px;border:0}

/* ---------- challenge a friend (paid tiers) ---------- */
.ecard .echal{margin-top:10px;width:100%;height:46px;padding:0 20px;border-radius:999px;background:transparent;border:1px solid var(--cbd);color:var(--cink);font-size:14px;font-weight:600}
.ecard .echal:hover:not(:disabled){border-color:var(--cink)}
.ecard .echal:disabled{opacity:.4;cursor:not-allowed}
#cmod>div{max-height:90vh;overflow:auto}
.cxl .dpool{width:100%;text-align:left}
.clink{display:flex;gap:8px;width:100%}
.clink input{flex:1;min-width:0;font-size:13px;text-overflow:ellipsis}
.cxl .clink button{flex:none;width:auto;padding:0 20px;border-radius:999px}
.clink input{height:44px;border-radius:999px;padding:0 16px}
.cxl .cxb2{background:none;border:0;color:var(--mu);font-size:14px;padding:6px}
.cxl .cxb2:hover{color:var(--tx);border:0}

/* ---------- leaderboard (top 100, last 24 hours) ---------- */
.lbtabs{display:flex;gap:6px;flex-wrap:wrap}
.lbtabs button{border-radius:999px;padding:6px 14px;font-size:13px;font-weight:600;background:var(--bg);color:var(--tx);border:1px solid var(--bd)}
.lbtabs button.on{background:var(--br);border-color:var(--br);color:var(--bi)}
.lbsub{margin:-2px 0 12px;color:var(--mu);font-size:13px}
.lb{border:1px solid var(--bd);border-radius:18px;background:var(--sf);overflow:hidden}
.lbempty{margin:0;padding:32px 20px;text-align:center;color:var(--mu);font-size:14px}
.lbscroll{max-height:560px;overflow:auto;overscroll-behavior:contain}
.lbt{width:100%;border-collapse:collapse;font-size:14px}
.lbt th{position:sticky;top:0;z-index:1;background:var(--sf);text-align:left;font-size:12px;font-weight:600;color:var(--mu);padding:12px 16px;border-bottom:1px solid var(--bd);white-space:nowrap}
.lbt td{padding:12px 16px;border-bottom:1px solid var(--bd);white-space:nowrap}
.lbt tbody tr:last-child td{border-bottom:0}
.lbt .r{width:64px}.lbt .n{text-align:right}
.lbt .p{font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.lbt .usd{font-weight:700;color:var(--up)}
.lbt .rk{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 6px;border-radius:999px;font-weight:700;font-size:13px}
.lbt .top1 .rk{background:#f5c542;color:#4a3500}.lbt .top2 .rk{background:#cfd5de;color:#2b3340}.lbt .top3 .rk{background:#d9a06b;color:#4a2a0a}
.lbt .p em{font-style:normal;margin-left:8px;padding:2px 8px;border-radius:999px;background:var(--br);color:var(--bi);font-size:11px;font-weight:700;font-family:Inter,system-ui,sans-serif}
.lbt tr.you td{background:color-mix(in srgb,var(--br) 9%,transparent)}
@media(max-width:560px){.lbt th,.lbt td{padding:11px 10px}.lbt .r{width:48px}.lbscroll{max-height:480px}}

/* ---------- Challenge a friend section ---------- */
.fchal{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:26px 28px;border:1px solid var(--bd);border-radius:20px;background:var(--sf)}
.fchal h3{margin:0;font-size:17px;font-weight:700;letter-spacing:-.01em}
.fchal p{margin:8px 0 0;max-width:560px;color:var(--mu);line-height:1.55;text-wrap:pretty}
.fctl{display:flex;align-items:flex-end;gap:12px;flex:none}
.ffld{display:grid;gap:6px;font-size:12px;font-weight:600;color:var(--mu)}
.ffld select{font:inherit;font-size:14px;font-weight:600;color:var(--tx);background:var(--bg);border:1px solid var(--bd2);border-radius:999px;height:46px;padding:0 16px;min-width:140px;cursor:pointer}
.ffld select:disabled{opacity:.5;cursor:not-allowed}
.fchal .nbtn{height:46px;padding:0 24px;white-space:nowrap}
.fchal .nbtn:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:760px){.fchal{flex-direction:column;align-items:stretch;padding:22px}.fctl{flex-direction:column;align-items:stretch}.ffld select{width:100%}}

/* ---------- Challenge a friend: entry-fee picker (paid tiers only, $1 to $100) ---------- */
.fchal{align-items:flex-start}
.fctl{flex-direction:column;align-items:stretch;gap:18px;flex:0 1 460px;min-width:0}
.ftiers{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ftier{height:46px;padding:0;border-radius:999px;background:var(--bg);border:1px solid var(--bd2);color:var(--tx);font:inherit;font-size:15px;font-weight:600;cursor:pointer;transition:border-color .15s,background .15s,color .15s,box-shadow .15s}
.ftier:hover:not(:disabled):not(.on){border-color:var(--br);color:var(--lk)}
.ftier.on{background:var(--br);border-color:var(--br);color:var(--bi);box-shadow:0 4px 14px color-mix(in srgb,var(--br) 35%,transparent)}
.ftier:focus-visible{outline:2px solid var(--br);outline-offset:2px}
.ftier:disabled{opacity:.4;cursor:not-allowed}
.fgo{display:grid;gap:12px}
.fsum{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--mu)}
.fsum b{color:var(--tx);font-weight:700}
.fchal .fbtn{width:100%;height:52px;font-size:15px}
@media(max-width:760px){.fctl{flex:none;width:100%}.ftiers{grid-template-columns:repeat(4,1fr)}}
@media(max-width:380px){.ftiers{grid-template-columns:repeat(3,1fr)}}

/* live traffic pill on each match tier */
.elive{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--cbd);border-radius:999px;background:var(--cin);color:var(--cmu);font-size:12px;font-weight:600;white-space:nowrap}
.elive svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.elive b{color:inherit;font-weight:700;font-variant-numeric:tabular-nums}
.elive.on{color:#0f8a5f;border-color:currentColor}
.elive.on::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;order:-1}

/* referrals */
.rcard{max-height:92vh;overflow:auto}
.rstat{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
.rstat div{display:grid;gap:2px;border:1px solid var(--bd);border-radius:8px;background:var(--sf);padding:10px 8px}
.rstat span{font-size:12px;color:var(--mu)}.rstat b{font-size:18px}
.rlist{list-style:none;margin:0;padding:0;width:100%;display:grid;border:1px solid var(--bd);border-radius:8px;text-align:left;font-size:13px}
.rlist li{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;padding:8px 12px}.rlist li+li{border-top:1px solid var(--bd)}
.rlist em{font-style:normal;font-size:11px;color:var(--mu)}.rlist em.ok{color:#1a9d55}
.rlist .rnone{display:block;color:var(--mu);text-align:center}
.rtwrap{margin-top:12px;overflow-x:auto;border:1px solid var(--bd);border-radius:12px}
.rtbl{width:100%;border-collapse:collapse;font-size:14px;text-align:right}
.rtbl th,.rtbl td{padding:9px 14px;white-space:nowrap}.rtbl th{font-size:12px;font-weight:600;color:var(--mu);background:var(--sf)}
.rtbl th:first-child,.rtbl td:first-child{text-align:left}.rtbl tr+tr td{border-top:1px solid var(--bd)}
/* play the bot */
.botc{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:24px;border:1px solid var(--bd);border-radius:20px;background:var(--sf);padding:24px}
.botcc h3{margin:10px 0 8px;font-size:20px}.botcc p{margin:0;color:var(--mu);line-height:1.55}
.botbadge{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.02em;padding:4px 10px;border-radius:999px;background:rgba(26,157,85,.12);color:#1a9d55}
.botctl{display:grid;gap:16px;align-content:start}.botctl .ffld{display:grid;gap:8px}.botctl .ffld>span{font-size:13px;font-weight:600;color:var(--mu)}
.blvls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.blv{display:grid;gap:2px;text-align:left;padding:10px 12px;border-radius:12px;background:var(--bg)}.blv b{font-size:14px}.blv small{font-size:11px;color:var(--mu);font-weight:400;line-height:1.3}
.blv.on,.bcl.on{border-color:var(--tx);box-shadow:0 0 0 1px var(--tx)}
.bcols{display:flex;gap:8px}.bcl{flex:1;padding:10px;border-radius:12px;background:var(--bg);font-weight:600}
@media (max-width:820px){.botc{grid-template-columns:1fr;padding:18px}.blvls{grid-template-columns:1fr 1fr}.blv:last-child{grid-column:1/-1}}

/* ---------- header v16: rounded-square controls, fits without sideways scrolling ---------- */
html{overflow-x:clip}                                                  /* safety net: the page itself never scrolls sideways */
.nav{position:relative;min-width:0;gap:12px;padding-left:16px;padding-right:10px}
body:not(.ingame) .top{border-bottom:0}   /* no hairline under the header */
#logo img{height:25px;width:auto}
.nlinks{display:flex;align-items:center;gap:2px;margin:0 auto 0 8px;min-width:0}
.nlinks a{padding:9px 10px;border-radius:11px;font-weight:600;font-size:14px;color:var(--mu);text-decoration:none;white-space:nowrap;transition:color .15s,background .15s}
.nlinks a:hover{color:var(--tx);background:color-mix(in srgb,var(--tx) 6%,transparent)}
.nlinks a.on{color:var(--br);background:color-mix(in srgb,var(--br) 12%,transparent)}
[data-theme=dark] .nlinks a.on{color:var(--lk)}
.nlinks a:focus-visible,.nmenu a:focus-visible,.top button:focus-visible{outline:2px solid var(--br);outline-offset:2px}
.top .tools{display:flex;align-items:center;gap:6px;flex:none;min-width:0;margin-left:auto}
.top .wbtn{height:42px;padding:0 14px;border-radius:11px!important;font-size:14px;font-weight:600;min-width:0;max-width:100%}
.top .wbtn .wa{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.top .wbtn.on{background:var(--bg);border-color:var(--bd2);box-shadow:0 1px 2px rgba(16,24,40,.06)}
.top #bp,.top #mu,.top #th,.top .nmb{width:42px;height:42px;border-radius:11px!important;background:var(--bg);border:1px solid var(--bd);padding:0}
.top #bp:hover,.top #mu:hover,.top #th:hover,.top .nmb:hover{background:var(--sf);border-color:var(--bd2)}
.nmb{display:none;place-items:center;cursor:pointer}
.nmb svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.nmb[aria-expanded=true]{background:color-mix(in srgb,var(--br) 12%,var(--bg))!important;border-color:var(--br)!important;color:var(--br)}
.nmenu{display:none;position:absolute;right:0;top:calc(100% + 8px);z-index:40;min-width:230px;padding:8px;border-radius:16px;border:1px solid var(--bd);background:var(--bg);box-shadow:0 20px 44px -12px rgba(16,24,40,.3)}
.nmenu.on{display:grid;gap:2px}
.nmenu a{padding:11px 14px;border-radius:11px;font-weight:600;font-size:15px;color:var(--tx);text-decoration:none}
.nmenu a:hover{background:var(--sf)}
.nmenu a.on{color:var(--br);background:color-mix(in srgb,var(--br) 12%,transparent)}
[data-theme=dark] .nmenu a.on{color:var(--lk)}
body.ingame .nmb,body.ingame .nmenu{display:none!important}
body.ingame .top #bp,body.ingame .top #mu,body.ingame .top #th{width:34px;height:34px;border-radius:9px!important}
body.ingame .top .wbtn{border-radius:9px!important}

/* roomy window: a little more air between links */
@media(min-width:1380px){.nlinks a{padding:9px 13px}.nlinks{gap:4px}}
/* medium window: tighter links so the whole row still fits */
@media(max-width:1279px){.nlinks a{padding:8px 8px;font-size:13px}.nlinks{gap:0}.top .tools{gap:5px}}
/* narrower than that: the links move into the Menu button */
@media(max-width:1199px){.nlinks{display:none}.nmb{display:grid}body:not(.ingame) .top .tools{margin-left:auto}}
@media(min-width:1200px){.nmenu{display:none!important}}
@media(max-width:700px){.top .wbtn .wb{display:none}}                  /* balance stays in the wallet menu; the button keeps just the address */
@media(max-width:560px){.top .nmb{width:38px;height:38px}body:not(.ingame) .top #mu{display:none}#logo img{height:22px}}

/* ---------- Play the bot: rounded-square choices ---------- */
.botctl .blvls .blv,.botctl .bcols .bcl{border-radius:14px!important;border:1px solid var(--bd);transition:border-color .15s,background .15s,box-shadow .15s}
.botctl .blvls .blv{padding:12px 14px;min-height:66px}
.botctl .blvls .blv:hover,.botctl .bcols .bcl:hover{border-color:var(--bd2);background:var(--sf)}
.botctl .blvls .blv.on,.botctl .bcols .bcl.on{border-color:var(--br);background:color-mix(in srgb,var(--br) 9%,var(--bg));box-shadow:0 0 0 1px var(--br)}
.botctl .blv.on b{color:var(--br)}[data-theme=dark] .botctl .blv.on b{color:var(--lk)}
.botctl .bcols .bcl{padding:12px 10px}
#bgo{border-radius:14px!important}
/* very small phones: slightly tighter so logo, wallet, menu and theme buttons all fit on one line */
@media(max-width:400px){
  body:not(.ingame) .top .nav{gap:6px;padding:0 8px 0 12px}#logo img{height:20px}
  body:not(.ingame) .top .tools{gap:4px}
  body:not(.ingame) .top .wbtn{padding:0 10px;font-size:12.5px;gap:6px;height:36px}
  body:not(.ingame) .top .nmb,body:not(.ingame) .top #th{width:36px;height:36px}
}
body:not(.ingame){overflow-x:clip}                                     /* decorative rooks may bleed past the screen edge; nobody can scroll sideways because of them */
@media(max-width:400px){body:not(.ingame) .top .tools{flex:0 1 auto}body:not(.ingame) .top .wbtn{flex:0 1 auto;min-width:0}}   /* tiniest phones: the address shortens with "…" rather than pushing the bar wider */

/* ---------- "add funds" dialog (shown when the wallet cannot cover a tier) ---------- */
#fmod{background:rgba(8,11,17,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
#fmod>div{max-height:90vh;overflow:auto;border-radius:20px}
.fdlg .cxl{gap:10px}
.fdlg .fl{margin-top:2px;font-weight:600;color:var(--tx);font-size:14px}
.fbal{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
.fbal div{display:grid;gap:2px;border:1px solid var(--bd);border-radius:12px;background:var(--sf);padding:10px 8px}
.fbal span{font-size:12px;color:var(--mu)}.fbal b{font-size:20px}
.fbal div:last-child b{color:var(--br)}[data-theme=dark] .fbal div:last-child b{color:var(--lk)}
#fmod .clink input{border-radius:12px;height:44px;font-size:12.5px}
#fmod .pri,#fmod .fopt{border-radius:999px!important}
#fmod .clink .pri{height:44px;padding:0 18px}
#fmod .cxb2{border:0;background:none;color:var(--mu);font-size:14px;padding:8px}
.fopts{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;width:100%}
.fopt{flex:1;min-width:92px;padding:11px 14px;font-weight:600;background:var(--bg);border:1px solid var(--bd2)}
.fopt:hover{border-color:var(--br);background:color-mix(in srgb,var(--br) 8%,var(--bg))}

/* ---------- all buttons fully rounded, except the Bot level choices ---------- */
html body button:not(.blv):not(.bcl):not(.wrow):not(.swb),
html body .top .wbtn,html body .top #bp,html body .top #mu,html body .top #th,html body .top .nmb,
html body.ingame .top #bp,html body.ingame .top #mu,html body.ingame .top #th,html body.ingame .top .wbtn,
html body #bgo,html body .hbtn a,html body .nbtn,html body a.pri,html body a.nbtn{border-radius:999px!important}
/* tall two-line cards keep a soft but smaller radius so text doesn't hit the curve */
html body .wrow,html body a.wrow,html body .wtile,html body .swb,html body button.wrow{border-radius:20px!important}
html body .wmenu button{border-radius:999px!important}
/* the Bot level choices (and the colour choices next to them) stay as they were */
html body .botctl .blvls .blv,html body .botctl .bcols .bcl{border-radius:14px!important}

/* ---------- header links, Play-as choices, add-funds dialog ---------- */
html body .nlinks a,html body .nmenu a{border-radius:999px!important}
html body .nlinks a.on,html body .nmenu a.on{border-radius:999px!important}
html body .botctl .bcols .bcl{border-radius:999px!important}
/* Add USDC / ETH dialog: its own card (it no longer borrows the footer's two-column .fcard layout) */
html body #fmod>div.fdlg{display:block;width:min(92vw,400px);max-width:400px;min-width:0;padding:28px 24px 22px;border-radius:28px;background:var(--bg);border:1px solid var(--bd);text-align:center;overflow:auto;max-height:90vh}
html body #fmod .fdlg .clink{display:flex;gap:8px;width:100%;align-items:center}
html body #fmod .fdlg .clink input{flex:1;min-width:0;border-radius:999px;padding:0 16px;height:44px}
html body #fmod .fdlg .clink .pri{width:auto;flex:none;height:44px;padding:0 22px}
html body #fmod .fdlg .fbal div{border-radius:20px}
html body #fmod .fdlg .cxb2{border-radius:999px!important}
[data-theme=dark] html body #fmod>div.fdlg{background:var(--bg)}

/* referral share buttons */
html body .rshare{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
html body .rshare a,html body .rshare button{display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 16px;border-radius:999px!important;border:1px solid var(--bd);background:var(--bg);color:var(--tx);font:600 13px/1 inherit;font-family:inherit;text-decoration:none;cursor:pointer}
html body .rshare a:hover,html body .rshare button:hover{background:var(--sf);border-color:var(--bd2)}


/* ---------- modal close (X) button: light + dark ---------- */
.modal>div{position:relative}
.mx{position:absolute;top:14px;right:14px;width:40px;height:40px;padding:0;display:grid;place-items:center;border:1px solid var(--bd);border-radius:50%!important;background:var(--bg);color:var(--mu);cursor:pointer;z-index:2;line-height:0;
  box-shadow:0 1px 2px rgba(15,23,42,.08),0 4px 12px rgba(15,23,42,.10);
  transition:transform .18s cubic-bezier(.2,.8,.2,1),background .15s,color .15s,border-color .15s,box-shadow .15s}
.mx svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;transition:transform .25s cubic-bezier(.2,.8,.2,1)}
.mx:hover{background:var(--sf);color:var(--tx);border-color:var(--bd2);box-shadow:0 2px 4px rgba(15,23,42,.10),0 8px 18px rgba(15,23,42,.14)}
.mx:hover svg{transform:rotate(90deg)}
.mx:active{transform:scale(.92)}
.mx:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--br) 35%,transparent),0 0 0 1px var(--br)}
[data-theme=dark] .mx{background:#232832;border-color:#3a414d;color:#c3c9d4;box-shadow:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.45)}
[data-theme=dark] .mx:hover{background:#2f3642;border-color:#566070;color:#fff}
[data-theme=dark] .mx:focus-visible{border-color:var(--lk);box-shadow:0 0 0 3px rgba(140,171,255,.4)}
@media(prefers-reduced-motion:reduce){.mx,.mx svg{transition:none}.mx:hover svg{transform:none}}
html body #fmod>div.fdlg,html body #cmod>div.rcard{padding-top:36px}

/* referral window: one compact card, no scrolling (same look as the Add USDC window) */
html body #cmod>div.rcard{display:block;width:min(92vw,400px);max-width:400px;min-width:0;max-height:none;overflow:visible;padding:34px 22px 16px;border-radius:28px;background:var(--bg);border:1px solid var(--bd)}
.rcard .cxl{gap:8px}.rcard .cxl p{max-width:none}.rcard .cxl h3{font-size:19px}
.rcard .rstat div{padding:8px 6px;border-radius:16px}.rcard .rstat b{font-size:17px}
.rcard .clink{display:flex;gap:8px;width:100%}.rcard .clink input{flex:1;min-width:0;height:40px;border-radius:999px;padding:0 14px;font-size:12.5px}.rcard .clink .pri{height:40px;padding:0 18px}
.rcard .rshare a,.rcard .rshare button{height:34px}
.rcard .wsm{font-size:12px;line-height:1.35}
.rcard .cxb2{display:none}                                  /* the X replaces the bottom button */
@media(max-height:620px){html body #cmod>div.rcard,html body #fmod>div.fdlg{max-height:94vh;overflow:auto}}   /* only on very short screens */


/* ---------- "Not now" button (Add USDC window): proper outlined pill, light + dark ---------- */
html body #fmod .fdlg .cxb2#fclose{display:flex;align-items:center;justify-content:center;width:100%;height:46px;margin-top:4px;padding:0 20px;border:1.5px solid var(--bd2)!important;border-radius:999px!important;background:var(--bg);color:var(--tx);font-size:15px;font-weight:600;cursor:pointer}
html body #fmod .fdlg .cxb2#fclose:hover{background:var(--sf);border-color:var(--mu)!important}
html body #fmod .fdlg .cxb2#fclose:focus-visible{outline:2px solid var(--br);outline-offset:2px}
[data-theme=dark] html body #fmod .fdlg .cxb2#fclose,[data-theme=dark] #fmod .fdlg .cxb2#fclose{background:#1c2028;border-color:#3a414d!important;color:#fff}
[data-theme=dark] #fmod .fdlg .cxb2#fclose:hover{background:#2a2f38;border-color:#566070!important}


/* ---------- Connect wallet window: same close (X) / back buttons as the other windows ---------- */
.wm .wh{position:relative}
.wm .wh button.mx,.wm .wh .wsp{width:40px;height:40px}
.wm .wh button.mx{position:static;flex:none;padding:0;font-size:0;border-radius:50%!important;background:var(--bg);color:var(--mu);border:1px solid var(--bd)}
.wm .wh button.mx:hover{background:var(--sf);color:var(--tx);border-color:var(--bd2)}
.wm .wh button.mx#wbk:hover svg{transform:translateX(-2px)}
.wm .wh button.mx#wcl:hover svg{transform:rotate(90deg)}
[data-theme=dark] .wm .wh button.mx{background:#232832;border-color:#3a414d;color:#c3c9d4}
[data-theme=dark] .wm .wh button.mx:hover{background:#2f3642;border-color:#566070;color:#fff}


/* ---------- daily streak: header button, panel, flame motion ---------- */
.dstk{--fo:#ff5a1f;--fm:#ff9a1f;--fi:#ffd23f;display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 12px 0 8px;border:0;border-radius:999px!important;background:transparent;color:var(--tx);font-weight:800;font-size:15px;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;flex:none}
.dstk:hover{background:var(--sf);border:0}
.dstk:focus-visible{outline:2px solid var(--ac);outline-offset:2px}
.dstk .dstt{display:inline-flex;gap:4px;align-items:baseline}.dstk .dstt b{font-weight:800;font-variant-numeric:tabular-nums}
.dstk.on .dstt b{color:#f0620f}[data-theme=dark] .dstk.on .dstt b{color:#ff9a3d}
.dstf{display:grid;place-items:center;width:28px;height:30px}.dstf .dfl{width:26px;height:30px}
@media(max-width:1699px){.dstk .dstt span{display:none}}               /* narrower windows: flame + number only */

/* the flame: three morphing layers + pawn + embers (the outline morph itself is SVG, see streak.js) */
.dfl{display:block;overflow:visible}
.dfl .dfl-a,.dfl .dfl-b,.dfl .dfl-c,.dfl .dfl-p{transform-box:fill-box;transform-origin:50% 100%}
.dfl .dfl-p *{fill:var(--dfp)}
.dfl .dfl-s circle{fill:var(--e1);opacity:0}
.dfl.lit{--o1:#ff6a1a;--o2:#e5300a;--m1:#ffb21f;--m2:#ff7a14;--i1:#fff3a8;--i2:#ffcf3a;--e1:#ffc24a;--dfp:#7a2400}
.dfl.off{--o1:#dfe3ea;--o2:#c3c9d3;--m1:#cdd2db;--m2:#b3bac6;--i1:#bcc3ce;--i2:#a3abb8;--e1:transparent;--dfp:#ffffff}
[data-theme=dark] .dfl.off{--o1:#5a5955;--o2:#42413e;--m1:#68675f;--m2:#53524d;--i1:#7b7a74;--i2:#64635e;--dfp:#1b1a18}

/* motion on top of the morph: sway, lift, glow, flicker and embers */
@keyframes dfA{0%,100%{transform:translateX(0) scale(1,1) skewX(0)}30%{transform:translateX(-1px) scale(1.03,1.06) skewX(-3deg)}60%{transform:translateX(1px) scale(.98,.96) skewX(2.500deg)}}
@keyframes dfB{0%,100%{transform:scale(1,1) skewX(0)}35%{transform:scale(.96,1.08) skewX(4deg)}70%{transform:scale(1.04,.94) skewX(-3.500deg)}}
@keyframes dfC{0%,100%{transform:scale(1,1);opacity:1}25%{transform:scale(1.08,1.16) skewX(-4deg);opacity:.92}55%{transform:scale(.92,.88) skewX(4deg);opacity:1}80%{transform:scale(1.04,1.08);opacity:.88}}
@keyframes dfS{0%{transform:translate(0,0) scale(1);opacity:0}12%{opacity:1}100%{transform:translate(var(--dx,0),-62px) scale(.15);opacity:0}}
@keyframes dfG{0%,100%{filter:drop-shadow(0 0 3px rgba(255,110,20,.5)) brightness(1)}50%{filter:drop-shadow(0 0 10px rgba(255,150,30,.95)) brightness(1.12)}}
.dfl.lit .dfl-a{animation:dfA 1.9s ease-in-out infinite}
.dfl.lit .dfl-b{animation:dfB 1.3s ease-in-out infinite .15s}
.dfl.lit .dfl-c{animation:dfC .9s ease-in-out infinite .05s}
.dfl.lit{animation:dfG 1.5s ease-in-out infinite}
.dfl.lit .dfl-s circle{animation:dfS 2.4s ease-out infinite}
.dfl.off .dfl-a{animation:dfA 4.2s ease-in-out infinite}.dfl.off .dfl-b{animation:dfB 3.4s ease-in-out infinite .2s}.dfl.off .dfl-c{animation:dfC 2.6s ease-in-out infinite .1s}   /* calm, slow flicker before the first game */
.dstk.pop .dstf{animation:dsPop .9s cubic-bezier(.2,.9,.3,1.4)}
@keyframes dsPop{0%{transform:scale(1)}30%{transform:scale(1.55) rotate(-8deg)}60%{transform:scale(.9) rotate(4deg)}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.dfl,.dfl *,.dstk.pop .dstf{animation:none!important}}

/* panel */
.dstp{position:fixed;z-index:45;top:60px;left:0;width:300px;padding:20px 18px 20px;border:1px solid var(--bd);border-radius:20px;background:var(--bg);color:var(--tx);box-shadow:0 18px 50px rgba(8,11,17,.28);text-align:center;opacity:0;transform:translateY(-6px) scale(.98);transform-origin:top right;transition:opacity .16s ease,transform .16s ease}
.dstp.on{opacity:1;transform:none}
.dstp[hidden]{display:none}
.dstp::before{content:"";position:absolute;top:-7px;left:calc(var(--ax,250px) - 7px);width:14px;height:14px;background:var(--bg);border-left:1px solid var(--bd);border-top:1px solid var(--bd);transform:rotate(45deg);border-radius:3px 0 0 0}
[data-theme=dark] .dstp{background:#181a1f;border-color:#2b2f38;box-shadow:0 18px 50px rgba(0,0,0,.6)}[data-theme=dark] .dstp::before{background:#181a1f;border-color:#2b2f38}
.dsbig{display:grid;place-items:center;margin:2px auto 6px}.dsbig .dfl{width:96px;height:112px}
.dstp h3{margin:0 0 14px;font-size:22px;font-weight:800;letter-spacing:-.02em}
.dsdays{list-style:none;margin:0 0 16px;padding:0;display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.dsdays li{display:grid;justify-items:center;gap:6px}
.dsdays .dl{font-size:12px;font-weight:800;color:var(--mu);letter-spacing:.02em}
.dsdays .db{display:grid;place-items:center;width:100%;max-width:34px;aspect-ratio:1;border:2px solid var(--bd2);border-radius:8px;background:transparent;transition:background .2s,border-color .2s}
.dsdays .db svg{width:62%;fill:none;stroke:#fff;stroke-width:3.400;stroke-linecap:round;stroke-linejoin:round}
.dsdays .fut .db{opacity:.55}
.dsdays .td .dl{color:var(--tx)}
.dsdays .td .db{border-color:#ff7a1a;box-shadow:0 0 0 3px rgba(255,122,26,.18)}
.dsdays .did .db{background:linear-gradient(160deg,#ffa31a,#ff4d12);border-color:transparent;box-shadow:0 2px 8px rgba(255,90,20,.4)}
.dsdays .did .dl{color:var(--tx)}
.dstp p{margin:0;color:var(--mu);font-size:14px;line-height:1.45}
@media(min-width:1700px){.top .nlinks a{padding:8px 10px}.top .nlinks{margin-left:4px}.dstk{padding:0 10px 0 6px;gap:4px}}   /* room for the full "Day Streak" label next to the nav links */
@media(max-width:560px){.dstk{height:38px;padding:0 6px 0 2px;gap:2px;font-size:14px}.dstf{width:24px}.dstf .dfl{width:22px;height:26px}}
@media(max-width:400px){.dstk{padding:0 4px 0 0}.dstf{width:22px}}
@media(max-width:380px){.dstk .dstt{display:none}.dstk{padding:0;min-width:0}.dstf{width:20px}.dstf .dfl{width:18px;height:22px}}   /* very small phones: flame only (grey = no streak yet, lit = streak); the number is in the panel */

/* ---- streak: same typeface as the "Monetize Your Chess Skills" heading (Inter, extra-bold, tight tracking) ---- */
.dstk,.dstp,.dstp h3,.dsdays .dl,.dstp p{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
.dstk{font-weight:800;letter-spacing:-.035em}
.dstp h3{font-size:26px;font-weight:800;letter-spacing:-.035em;line-height:1.05}
.dsdays .dl{font-weight:800;letter-spacing:-.02em}
.dstp p{font-weight:500;letter-spacing:-.01em}
/* ---- same typeface as the "Monetize Your Chess Skills" heading: abort banner, streak numbers and days ---- */
.abn,.abn>div,.abn b{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;letter-spacing:-.035em}
.abn>div{font-weight:800}.abn b{font-weight:800}
.dstk .dstt,.dstk .dstt b,.dsdays .dl{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-weight:800;letter-spacing:-.035em}

/* streak panel text = exactly the "Monetize Your Chess Skills" heading style */
html body .dstp h3,html body .dstp .dsdays .dl,html body .dstk .dstt,html body .dstk .dstt b,html body .dstk .dstt span{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif!important;font-weight:800!important;letter-spacing:-.035em!important;line-height:1.05}
html body .dstp .dsdays .dl{line-height:1.2}

/* streak button: number vertically centred on the flame; no pop animation when a game ends */
html body .dstk{align-items:center}
html body .dstk .dstt{align-items:center;line-height:1;height:100%}
html body .dstk .dstt b{line-height:1;display:block}
html body .dstk .dstf{align-self:center}
.dstk.pop .dstf{animation:none!important}
.dstp[hidden]{display:none!important}

/* streak: number sits a little lower; panel title uses the exact "Monetize Your Chess Skills" heading style */
html body .dstk .dstt b{position:relative;top:3px}
html body .dstp h3{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif!important;font-size:28px!important;font-weight:800!important;letter-spacing:-.035em!important;line-height:1.05!important;font-variant-numeric:normal;font-optical-sizing:auto;-webkit-font-smoothing:antialiased}

/* connection-lost bar: shown while the socket is down so the board never looks live when it is not */
.netbar{position:fixed;left:0;right:0;top:0;z-index:90;padding:calc(env(safe-area-inset-top,0px) + 8px) 12px 8px;text-align:center;font:600 14px Inter,Arial,sans-serif;background:#c62828;color:#fff}.netbar[hidden]{display:none}
