.sheba-dialog{width:min(1050px,calc(100% - 24px));max-height:94svh;padding:24px;color:#fff1d0;border:2px solid #bb9147;border-radius:16px;background:radial-gradient(ellipse at 30% 0,#5b351b,#211009 70%);box-shadow:0 25px 90px #000b}.sheba-header{display:flex;align-items:start;justify-content:space-between;gap:15px}.sheba-header h1{font:34px/1.2 Georgia;color:#f7cf5e;text-shadow:0 3px #6d431d;margin:7px 0}.sheba-header p{font-size:13px}.sheba-eyebrow{font:10px/1.4 system-ui;color:#b3d9cf;letter-spacing:.7px}.sheba-header>button{min-width:44px}.sheba-viewer{margin-top:18px;overflow:hidden;border:1px solid #c79c50;border-radius:12px;background:#180a05}.sheba-viewer canvas{display:block;width:100%;height:240px;touch-action:none;cursor:grab}.sheba-viewer canvas:active{cursor:grabbing}.sheba-caption{display:flex;align-items:center;justify-content:space-between;padding:5px 12px;background:#29160d;font:11px system-ui;color:#d2b98f;gap:8px}.sheba-caption button{font:11px system-ui;padding:8px 12px;border:0;background:none}.sheba-fallback{padding:30px;min-height:90px;text-align:center}.sheba-levelbar{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:15px 18px;margin-top:18px;border:1px solid #c39646;border-radius:9px;background:linear-gradient(110deg,#5a3216,#2b180d);font:15px Georgia}.sheba-levelbar strong{color:#f5cf79}.sheba-progress{display:flex;align-items:center;gap:12px;padding:12px 3px;font:11px system-ui;color:#d2b98f}.sheba-progress progress{flex:1;min-width:30px;height:6px;accent-color:#f2be3a}.sheba-board{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:22px}.sheba-board h2{font:22px Georgia;margin:0 0 7px}.sheba-board p{font:12px/1.5 system-ui;color:#d2b98f}.sheba-wall{margin:18px 0;padding:18px 10px 12px;border:2px solid #c99d4a;border-bottom-width:6px;border-radius:10px;background:linear-gradient(145deg,#4f2d18,#29170d);box-shadow:0 4px #160a04;min-height:160px;display:flex;flex-direction:column;justify-content:end;gap:3px}.sheba-row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:2px;min-height:35px;padding:2px;border:1px solid transparent;border-radius:4px}.sheba-row.lit{border-color:#f2be3a;background:#f2be3a0e;box-shadow:0 0 13px #e5b34a22}.sheba-cell{display:block;min-width:0;min-height:30px;height:34px;border:0;padding:0;background:transparent!important;position:relative}.sheba-cell.dim{opacity:.38}.sheba-cell.filled{opacity:1!important}.sheba-cell.matching{filter:drop-shadow(0 0 5px #ffd571);outline:1px solid #fbe4a2;outline-offset:1px}.sheba-stone{position:relative;display:block;width:100%;height:100%;filter:drop-shadow(0 2px 1px #0006)}.sheba-stone svg{width:100%;height:100%;display:block}.sheba-stone>span{position:absolute;inset:0;display:grid;place-items:center;font:8px/1 system-ui;color:#fff;text-shadow:0 1px 2px #000,1px 0 1px #000}.sheba-crates{display:grid;grid-template-columns:repeat(auto-fit,minmax(54px,1fr));gap:12px 9px;margin:18px 0 6px}.sheba-crate{display:flex;flex-direction:column;gap:3px;padding:7px 5px 4px;border:2px solid #926527;border-top:5px solid #d1a24d;border-radius:5px 5px 9px 9px;background:linear-gradient(90deg,#150c06,#382014,#160e08);min-width:0;box-shadow:0 3px #120902}.sheba-crate .sheba-stone,.sheba-empty{width:100%;height:23px;flex-shrink:0}.sheba-empty{border-bottom:1px solid #ad874118}.sheba-crate small{font:9px system-ui;color:#c7a879;margin-top:4px}.sheba-crate[aria-pressed=true]{border-color:#fff1cd;box-shadow:0 0 14px #eac16955}.sheba-crate[aria-pressed=true] .top-stone{transform:translateY(-8px);filter:drop-shadow(0 0 5px #ffe3a9);z-index:1}.sheba-status{min-height:46px;padding:12px;margin:14px 0 12px;font:13px/1.5 system-ui;color:#ffdf9c;background:#160d0788;border:1px solid #946b3433;border-radius:7px}.sheba-controls{display:flex;gap:10px}.sheba-controls button,.sheba-win button,.sheba-confirm button{flex:1;min-height:46px;border-radius:24px;border:1px solid #e4b34e;border-bottom:4px solid #955c18;background:linear-gradient(#ffe27a,#f5a81f);color:#2a1708;font:600 14px Georgia;box-shadow:0 3px 6px #0004}.sheba-dialog button:active:not(:disabled){transform:translateY(2px)}.sheba-dialog button:focus-visible{outline:2px solid #ffe3a0;outline-offset:3px;z-index:2}.sheba-dialog button:disabled{opacity:.42;cursor:default}.sheba-cell:disabled.filled{opacity:1}.sheba-win{padding:20px;margin-top:18px;border:2px solid #c69a4b;border-bottom-width:5px;border-radius:12px;background:linear-gradient(130deg,#5a3216,#2b180d);display:flex;gap:12px;flex-wrap:wrap}.sheba-win h2,.sheba-win p{width:100%;margin:0}.sheba-win h2{font:27px Georgia;color:#ffdf91}.sheba-win button{margin-top:8px}.sheba-win .sheba-next{background:linear-gradient(#8be35b,#3db82b);border-color:#8cce62;border-bottom-color:#2c7b28}.sheba-save{font:11px/1.6 system-ui;color:#c4ad88;text-align:center;margin:15px 0 0}.sheba-confirm{display:flex;flex-wrap:wrap;gap:10px;padding:16px;margin-top:14px;border:1px solid #c69a4b;border-radius:8px}.sheba-confirm p{width:100%;margin-bottom:5px}
@media(max-width:650px){.sheba-dialog{padding:16px 13px;border-radius:12px;width:calc(100% - 14px);max-height:96svh}.sheba-header h1{font-size:28px}.sheba-header p{font-size:12px}.sheba-eyebrow{font-size:9px;letter-spacing:0}.sheba-viewer{margin-top:14px}.sheba-viewer canvas{height:200px}.sheba-caption{font-size:10px;padding:3px 9px}.sheba-board{grid-template-columns:1fr;gap:16px}.sheba-wall{margin:12px 0 0;min-height:130px;padding:12px 8px}.sheba-row{min-height:31px}.sheba-cell{height:30px;min-height:30px}.sheba-levelbar{font-size:14px;padding:12px;margin-top:12px}.sheba-crates{grid-template-columns:repeat(auto-fit,minmax(49px,1fr));gap:12px 8px;margin-top:13px}.sheba-crate .sheba-stone,.sheba-empty{height:21px}.sheba-crate{padding:6px 4px 4px}.sheba-controls{gap:6px}.sheba-controls button{font-size:12px;padding:8px 7px}.sheba-status{font-size:12px}.sheba-viewer canvas[hidden]{display:none}}
@media(prefers-reduced-motion:reduce){.sheba-dialog *{animation:none!important;transition:none!important}}

.sheba-viewer canvas[hidden]{display:none}
/* Full-screen royal building table. */
body.sheba-open{overflow:hidden}
.sheba-dialog{position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;box-sizing:border-box;border:0;border-radius:0;padding:20px clamp(16px,3vw,48px);overflow:auto;background:radial-gradient(ellipse at 15% 15%,#70401f55,transparent 55%),repeating-linear-gradient(92deg,#ffffff02 0 1px,transparent 1px 12px),linear-gradient(120deg,#25150e,#120c09);color:#f6e7ca}
.sheba-dialog::backdrop{background:#120c09}
.sheba-header{max-width:1480px;margin:auto;align-items:center;border-bottom:1px solid #b78a4244;padding-bottom:14px}
.sheba-header h1{font:clamp(24px,2.6vw,38px)/1.1 Georgia;margin:4px 0 0;letter-spacing:-.5px;color:#f8d78e;text-shadow:0 2px 10px #0008}
.sheba-eyebrow{font:10px system-ui;text-transform:uppercase;letter-spacing:3px;color:#cfa865}
.sheba-header>button{border-radius:50%;width:46px;height:46px;padding:0;background:#2c1d12;border:1px solid #ad854b;color:#f0d7a7;font-size:18px}
.sheba-stage{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(440px,1.3fr);gap:clamp(24px,4vw,64px);max-width:1480px;margin:24px auto 0;align-items:center}
.sheba-viewer{position:relative;margin:0;border:1px solid #b78a4244;border-radius:120px 120px 14px 14px;background:radial-gradient(ellipse at 50% 35%,#825324,#22170e 72%);box-shadow:inset 0 0 70px #0007,0 20px 50px #0004;overflow:hidden}
.sheba-viewer:before{content:'◆';display:block;text-align:center;padding-top:20px;color:#d6ab65;font-size:20px}
.sheba-viewer canvas{height:clamp(300px,52vh,600px);width:100%}
.sheba-caption{background:#21150eb3;border-top:1px solid #b78a4233;min-height:44px;font-size:10px;color:#d6bd95}
#sheba-game{min-width:0;position:relative}
.sheba-levelbar{padding:0;margin:0 0 10px;border:0;background:none;box-shadow:none;font:15px Georgia;color:#e2cba3}
.sheba-levelbar strong{font:11px system-ui;letter-spacing:2px;text-transform:uppercase;color:#d3a85e}
.sheba-progress{padding:0 0 20px;color:#f0d7a7;font:12px system-ui}
.sheba-progress progress{height:7px;border:0;border-radius:6px;overflow:hidden;accent-color:#e5b85e}
.sheba-progress progress::-webkit-progress-bar{background:#080604;border-radius:6px}
.sheba-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#a16e28,#ffe0a0);border-radius:6px;transition:width .4s}
.sheba-board{display:flex;flex-direction:column;gap:22px}
.sheba-board h2{font:11px system-ui;letter-spacing:2px;text-transform:uppercase;color:#cfb88d;margin:0 0 10px}
.sheba-wall{margin:0;min-height:0;padding:18px 12px 14px;gap:5px;border:1px solid #b58a49;border-bottom:5px solid #8c5b2e;border-radius:12px;background:radial-gradient(ellipse at 50% 100%,#74462566,transparent),repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 8px),#302014;box-shadow:inset 0 2px 20px #0006,0 8px 24px #0004}
.sheba-row{height:46px;min-height:46px;gap:3px;padding:3px;box-sizing:border-box}
.sheba-row.lit{border-color:#e9bb67;background:#e9bb6714;box-shadow:0 0 18px #e5b34a28}
.sheba-cell{height:38px;min-height:38px;min-width:0;border-radius:3px}
.sheba-cell.dim{opacity:.65}
.sheba-cell.matching{outline:2px solid #ffe3a1;outline-offset:1px;filter:drop-shadow(0 0 6px #fbcf75)}
.sheba-stone{filter:drop-shadow(0 3px 1px #000a)}
.sheba-stone svg{filter:drop-shadow(0 1px 0 #fff4)}
.sheba-stone>span{font-size:11px;color:#fff4ce;text-shadow:0 1px 2px #000,1px 0 #000;opacity:.9}
.sheba-crates{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;margin:0}
.sheba-crate{padding:8px 6px 3px;gap:3px;border:1px solid #a5814a;border-top:3px solid #e1bf7e;background:linear-gradient(90deg,#322219,#4c3220 50%,#24170f);border-radius:6px 6px 12px 12px;box-shadow:inset 0 0 12px #0007,0 5px 0 #0e0805;transition:box-shadow .15s,border-color .15s}
.sheba-crate .sheba-stone,.sheba-empty{height:25px}
.sheba-crate small{font-size:10px;line-height:16px}
.sheba-crate[aria-pressed=true]{background:linear-gradient(90deg,#573c23,#79542c,#422d1b);border-color:#ffe0a0;box-shadow:0 0 0 2px #ddb57044,0 7px 20px #0007}
.sheba-crate[aria-pressed=true] .top-stone{transform:translateY(-10px) scale(1.06)}
.sheba-status{min-height:22px;padding:0;margin:15px 0;font:12px/1.5 system-ui;text-align:center;background:none;border:0;color:#efd19a}
.sheba-controls{gap:10px}
.sheba-controls button{min-height:46px;border:1px solid #9c7842;border-bottom:3px solid #68441e;background:linear-gradient(#493321,#2a1b11);color:#f5dbaa;font:13px system-ui;border-radius:9px;box-shadow:0 3px 10px #0004}
.sheba-controls button:nth-child(2){background:linear-gradient(#e6bd6d,#b37d32);border-color:#f0cf8b;border-bottom-color:#825020;color:#22140a;font-weight:700}
.sheba-save{margin:12px 0 0;font:9px system-ui;color:#a99372}
.sheba-flying{position:fixed!important;z-index:50;pointer-events:none;filter:drop-shadow(0 10px 7px #0009)!important}
.sheba-spark{position:absolute;inset:0;text-align:center;font:26px Georgia;color:#ffe6a1;pointer-events:none}
.sheba-win,.sheba-confirm{position:absolute;inset:0;z-index:10;margin:auto;height:max-content;padding:30px;background:linear-gradient(135deg,#56351f,#23160d);box-shadow:0 0 0 100vmax #090603bb,0 20px 70px #0009;border-color:#e3ba6f}
.sheba-win h2{font-size:32px}.sheba-win p{font:14px/1.6 system-ui;color:#e2cba3}
@media(max-width:900px){
 .sheba-dialog{padding:12px 16px 16px}.sheba-header{padding-bottom:10px}.sheba-header h1{font-size:25px}.sheba-eyebrow{font-size:8px;letter-spacing:2px}.sheba-header>button{width:44px;height:44px}
 .sheba-stage{display:flex;flex-direction:column;gap:14px;margin:12px auto 0;max-width:600px}.sheba-viewer{width:100%;border-radius:12px;height:155px;flex-shrink:0}.sheba-viewer:before{display:none}.sheba-viewer canvas{height:155px}.sheba-caption{position:absolute;bottom:0;right:0;min-height:30px;border:0;background:#21150eaa;border-radius:8px 0 0 0;padding:0 8px}.sheba-caption>span{display:none}.sheba-caption button{min-height:32px;padding:4px 8px}
 #sheba-game{width:100%}.sheba-levelbar{margin:0 0 8px;font-size:14px}.sheba-levelbar strong{font-size:9px;letter-spacing:1px}.sheba-progress{padding-bottom:12px;font-size:10px}.sheba-board{gap:14px}.sheba-board h2{font-size:9px;letter-spacing:1.6px;margin-bottom:8px}
 .sheba-wall{padding:10px 6px 8px;gap:2px}.sheba-row{height:39px;min-height:39px;gap:2px;padding:2px}.sheba-cell{height:33px;min-height:33px}.sheba-crates{gap:6px}.sheba-crate{padding:5px 3px 2px;gap:2px}.sheba-crate .sheba-stone,.sheba-empty{height:21px}.sheba-crate small{font-size:9px;line-height:12px}.sheba-status{margin:10px 0;min-height:18px;font-size:11px}.sheba-controls{gap:6px}.sheba-controls button{font-size:11px;padding:5px 7px}.sheba-save{margin-top:9px;font-size:8px}
 .sheba-win,.sheba-confirm{padding:22px}
}
@media(max-height:740px) and (max-width:900px){.sheba-viewer,.sheba-viewer canvas{height:110px}.sheba-stage{gap:10px}.sheba-row{height:35px;min-height:35px}.sheba-cell{height:29px;min-height:29px}.sheba-crate .sheba-stone,.sheba-empty{height:18px}.sheba-board{gap:10px}.sheba-save{display:none}}
@media(prefers-reduced-motion:reduce){.sheba-dialog *{animation:none!important;transition:none!important}}
@media(min-width:901px) and (max-height:820px){.sheba-dialog{padding-top:14px;padding-bottom:12px}.sheba-header{padding-bottom:10px}.sheba-header h1{font-size:30px}.sheba-stage{margin-top:16px}.sheba-progress{padding-bottom:14px}.sheba-board{gap:16px}.sheba-row{height:36px;min-height:36px;padding:2px}.sheba-cell{height:30px;min-height:30px}.sheba-wall{padding:12px 9px 10px;gap:3px}.sheba-crate .sheba-stone,.sheba-empty{height:22px}.sheba-status{margin:10px 0}.sheba-save{margin-top:8px}.sheba-viewer canvas{height:420px}}
.sheba-caption button{color:#ecd5ab}.sheba-cell:not(.filled) .sheba-stone svg{filter:none}.sheba-row.lit .sheba-stone{filter:drop-shadow(0 0 2px #e6bc6655)}
.sheba-crate .sheba-stone[data-shape=k],.sheba-crate .sheba-stone[data-shape=w],.sheba-crate .sheba-stone[data-shape=r],.sheba-crate .sheba-stone[data-shape=g]{width:65%;align-self:center}.sheba-crate .sheba-stone[data-shape=s],.sheba-crate .sheba-stone[data-shape=d]{width:85%;align-self:center}
@media(max-width:900px) and (min-height:741px) and (max-height:820px){.sheba-viewer,.sheba-viewer canvas{height:120px}.sheba-stage{gap:12px}.sheba-board{gap:12px}}
/* Isolate the building stage from the home page's main-element spacing. */
.sheba-stage{padding:0;min-height:0;width:100%;box-sizing:border-box}


.sheba-tools{display:flex;gap:7px}.sheba-tools button{min-height:42px;padding:7px 12px;border:2px double #b79761;background:#392415;color:#f4d99d;border-radius:8px}.sheba-dialog>.player-hud{display:none!important}.building-entry-lobby{width:min(720px,calc(100vw - 24px));max-height:90dvh;overflow:auto}.building-entry-lobby>header,.building-blueprint-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.building-entry-card{display:grid;grid-template-columns:1fr 40%;gap:12px;padding:18px;border:1px solid #b4935b;border-radius:12px;background:#25170e}.building-entry-card canvas{width:100%;height:150px}.building-blueprint-row{padding:15px;border:1px solid #b4935b;border-radius:10px;margin-top:10px}.building-blueprint-row small{display:block;opacity:.7}.sheba-info{max-width:440px}
.sheba-header{padding:10px 14px;border:3px double #b59355;border-radius:12px;background:linear-gradient(110deg,#49301c,#21160e)}
@media(max-width:900px){.sheba-stage{position:relative;padding-top:0}.sheba-viewer{position:absolute;right:0;top:0;width:110px;height:70px;border-radius:9px;background:transparent;border:0;pointer-events:none;box-shadow:none}.sheba-viewer canvas{height:70px}.sheba-caption{display:none}.sheba-levelbar,.sheba-progress{padding-right:120px}.sheba-levelbar{min-height:27px}.sheba-progress{min-height:25px}.sheba-crates{min-height:220px;align-items:stretch}.sheba-crate{display:flex;flex-direction:column;justify-content:flex-end}.sheba-crate .sheba-stone,.sheba-empty{height:30px}.sheba-controls{display:grid;grid-template-columns:1fr 1.3fr 1fr}.sheba-controls button{white-space:nowrap}.sheba-status{min-height:30px}.sheba-wall{border:5px ridge #79502d}}
@media(max-height:700px) and (max-width:900px){.sheba-crates{min-height:160px}.sheba-crate .sheba-stone,.sheba-empty{height:23px}.sheba-status{min-height:18px}}

@media(max-width:900px){.sheba-dialog .sheba-stage .sheba-viewer{width:110px;height:70px;margin:0;top:0;right:0;left:auto;border:0;border-radius:9px}.sheba-dialog .sheba-stage .sheba-viewer canvas{height:70px!important;width:100%!important}}
