/* Pre-rendered 3D jewels + lit, extruded tray. Motion uses compositor transforms. */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
body{background-image:radial-gradient(ellipse at 35% 15%,#43877b55,transparent 65%),linear-gradient(145deg,#144e46,#062824);background-attachment:fixed}
.game{isolation:isolate;gap:12px;padding-bottom:max(16px,env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 40%,#39796a20,transparent 75%);perspective:1100px}
.game>header{height:46px}.brand{font-size:18px;letter-spacing:1.8px}.brand small{font-size:7px;letter-spacing:2.6px}
.balance{box-shadow:0 3px 0 #76512d66,0 6px 9px #001a1a55;border-radius:13px}.balance img{filter:drop-shadow(0 2px 1px #46371644)}
.level-row{margin:5px 0 0;padding-right:43px;min-height:60px}.level-link{font-size:11px;color:#fff1c4;min-width:64px}.level-link strong{font-size:27px;text-shadow:0 3px 0 #092e29}
.target{flex:0 0 auto;min-width:95px;max-width:130px;gap:10px;justify-content:center;padding:7px 14px;box-shadow:0 4px 0 #ad824f,0 7px 12px #001c2555;border-radius:15px}.target img{width:48px;height:48px;filter:drop-shadow(0 4px 2px #533a2855)}.target #target-progress{font-size:13px;font-weight:800;margin-left:0}
.daily-btn{margin-left:auto;filter:drop-shadow(0 4px 2px #001d2277)}
.progress-row{min-height:7px;margin:0 6px}.progress-track{height:7px;box-shadow:inset 0 1px 3px #0008}.progress-track span{background:linear-gradient(#fff0b0,#d7ad54);box-shadow:0 0 9px #f9da79;transition:width .5s ease}
.board{position:relative;isolation:isolate;transform:perspective(1100px) rotateX(3deg);transform-origin:50% 60%;background:linear-gradient(130deg,#fff6d700,#c7a16b22),url('assets/panel.webp') center/100% 100%;border:1px solid #fbe8b6;border-radius:24px;padding:17px 13px 19px;gap:8px;box-shadow:0 2px 0 #fff1ce inset,0 -3px 2px #a87a44 inset,0 5px 0 #d4ad73,0 9px 0 #a77b49,0 13px 0 #745235,0 18px 0 #563d2c,0 27px 28px #001d21aa;max-height:560px;min-height:280px;aspect-ratio:.84;margin-bottom:14px}
.board:before{content:'';position:absolute;inset:5px;border:1px solid #fff6dc8c;border-radius:20px;pointer-events:none;z-index:-1}
.slot{background:linear-gradient(100deg,#021f2299,transparent 30%,#2c665233 70%,#031b2499),url('assets/slot.webp') center/100% 100%;border-radius:10px;border:1px solid #987344;box-shadow:inset 0 5px 6px #001f25cc,inset 2px 0 4px #052928aa,inset -2px 0 3px #051b26aa,0 1px 0 #fff8d8;transition:box-shadow .16s,filter .16s}
.slot:before{content:'';position:absolute;inset:4px 3px 5px;border-radius:7px;box-shadow:inset 0 -1px #98b9a322,inset 0 1px 3px #001c20aa;pointer-events:none}
.slot .gem{width:88%;height:auto;aspect-ratio:1;left:6%;object-fit:contain;transform-origin:50% 65%;filter:drop-shadow(0 1px 0 #182f30) drop-shadow(0 3px 1px #001c20a0);transition:none;will-change:auto}
.slot .gem:last-of-type{filter:drop-shadow(0 1px 0 #153d37) drop-shadow(0 5px 2px #00161cad) brightness(1.06)}
.slot .gem.covered{filter:brightness(.16) saturate(.15) drop-shadow(0 2px 1px #001520);opacity:1}
.slot.selected{box-shadow:inset 0 5px 7px #001b1fba,0 0 0 2px #f7dd8b,0 0 17px #f4d57660;filter:none}
.slot.selected .gem:last-of-type{transform:translateY(-6px) scale(1.02);filter:drop-shadow(0 8px 3px #001a1b9c) brightness(1.17)}
.slot.valid{box-shadow:inset 0 0 0 2px #baf7bc,0 0 10px #bdf38b40;filter:none}
.slot.merging{box-shadow:inset 0 0 0 2px #ffeab2,0 0 18px #ffdb7190}
.slot .run-count{left:50%;bottom:4px;transform:translateX(-50%);border-radius:6px;background:#032e2bba;padding:2px 5px;color:#ffedb8;font-size:8px;z-index:18;opacity:0;transition:opacity .15s;white-space:nowrap}
.slot.selected .run-count,.slot.valid .run-count{opacity:1}
.slot.locked{background:linear-gradient(125deg,#fff1cf70,#bc945555);box-shadow:inset 0 2px 4px #89633933,0 1px 0 #ffefca;opacity:.55;border-color:#b99766}
.slot.add-slot{opacity:1;background:linear-gradient(140deg,#518678,#285c50);box-shadow:inset 0 2px 0 #aad3a88a,0 2px 0 #73583d}
.lock-content{gap:5px;font-weight:700;min-height:70px;justify-content:center}.lock-content>img{width:24px;height:28px}.lock-content small{display:flex;align-items:center;gap:2px;font-size:9px}.lock-content small img{width:13px;height:14px}
.deal-row{min-height:64px}.deal-row .primary{height:66px;min-width:220px;box-shadow:0 5px 9px #001b1e77;border-radius:22px}.primary{transition:filter .12s}.primary:active:not(:disabled){transform:translateY(3px) scale(.98);filter:brightness(.96)}
#deal{position:relative;overflow:visible}#deal>img{width:44px;height:44px;filter:drop-shadow(0 3px 2px #001d24a0)}#deck-count{position:absolute;left:34px;bottom:7px;background:#164b3c;border:1px solid #ecd194;border-radius:8px;min-width:23px;padding:1px 4px;font-size:9px;font-weight:bold}#deck-count:empty{display:none}
.toolbar{gap:3px;padding:4px 0 0;min-height:49px}.tool .square{width:clamp(36px,10.4vw,48px);height:clamp(36px,10.4vw,48px);box-shadow:0 4px 0 #8a623e,0 7px 7px #001c2260;border-radius:13px}.square img{filter:drop-shadow(0 2px 1px #453b2850)}.tool:active:not(:disabled){transform:translateY(3px)}.tool b{bottom:-3px;right:-2px;box-shadow:0 1px 2px #0008}
.game>footer{position:absolute;top:calc(max(12px,env(safe-area-inset-top)) + 65px);right:16px;margin:0;z-index:4}
.question,.game>footer button{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #d2bc7e;background:#f3e6c7;color:#5e684c;width:25px;height:25px;min-width:25px;padding:0;font:bold 15px Georgia;text-decoration:none;box-shadow:0 2px 0 #927440;cursor:pointer;letter-spacing:0}
.game>footer button{width:31px;height:31px;font-size:19px;color:#f4dfa0;background:#275d50;box-shadow:0 3px 0 #092f2c}
#motion-layer{position:fixed;inset:0;pointer-events:none;z-index:25;overflow:hidden;perspective:900px}.motion-sprite{position:absolute;object-fit:contain;pointer-events:none;will-change:transform,opacity;backface-visibility:visible}.flying-jewel{filter:drop-shadow(0 8px 3px #00222788)}.light-effect{mix-blend-mode:screen}.combo-pop{position:absolute;white-space:nowrap;color:#ffe07e;font-size:24px;font-weight:900;letter-spacing:-.5px;text-shadow:0 3px 0 #9e5c1a,0 5px 8px #092322a0;-webkit-text-stroke:.5px #ffe8aa}
#overlay{background:#041f29bf;backdrop-filter:blur(4px);z-index:30}.sheet{border:1px solid #fcebc0;box-shadow:0 7px 0 #aa7d48,0 12px 0 #64492f,0 27px 75px #0009}.sheet h1{font-size:26px}.sheet .hero-gem{width:145px;height:145px;animation:celebrate 1.8s ease-in-out infinite alternate}.win .stats{gap:13px;font-size:10px}.coin-reward{font-weight:800}.daily-card>img{filter:drop-shadow(0 8px 3px #746b4c66)}
.shop-row strong{display:flex;gap:7px;align-items:center}.shop-row .question{width:22px;height:22px;min-width:22px;font-size:12px}.shop-row p img{width:15px;height:15px;vertical-align:middle}.collection-info{display:flex;margin:14px auto 0}.jewel-card img{filter:drop-shadow(0 5px 3px #6a644755)}
.mini-rules{display:grid;grid-template-columns:1fr;gap:8px}.mini-rules>div{display:flex;gap:12px;align-items:center}.mini-rules .recipe{width:135px;min-width:135px;padding:5px;margin:0;gap:3px}.mini-rules .recipe img{width:36px;height:36px}.mini-rules .recipe span{font-size:13px}.mini-rules strong{font-size:12px}.help-tools{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin-top:22px}.help-tools button{position:relative;display:flex;flex-direction:column;align-items:center;background:#dfd6bd;border-radius:12px;padding:8px 2px;gap:6px;color:#385949}.help-tools img{width:35px;height:35px;object-fit:contain}.help-tools span{font-size:8px}.help-tools .question{position:absolute;right:-3px;top:-5px;min-width:18px;width:18px;height:18px;font-size:10px}.help-details{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.help-details button{background:none;color:#476554;font-size:10px;display:flex;gap:5px;align-items:center}.help-details .question{width:20px;height:20px;min-width:20px;font-size:12px}
#toast{z-index:40;font-size:12px;bottom:95px;max-width:88vw;text-align:center}
@media(min-height:850px){.game{gap:15px;padding-top:max(22px,env(safe-area-inset-top))}.game>footer{top:calc(max(22px,env(safe-area-inset-top)) + 70px)}}
@media(max-height:730px){.game{gap:9px;min-height:580px}.game>header{height:37px}.level-row{min-height:48px;margin:0}.target{height:50px}.target img{width:38px;height:38px}.daily-btn{width:43px;height:43px}.board{padding:13px 10px 15px;gap:6px;min-height:245px;margin-bottom:10px}.deal-row,.deal-row .primary{min-height:54px;height:54px}.game>footer{top:calc(max(12px,env(safe-area-inset-top)) + 54px)}.toolbar{min-height:42px}.tool .square{width:37px;height:37px}}
@media(max-width:370px){.game{padding-left:10px;padding-right:10px}.brand{font-size:15px}.brand small{font-size:6px}.level-row{padding-right:35px}.game>footer{right:10px}.target{min-width:85px;padding:5px 9px}.board{gap:6px}.tool .square{width:36px;height:36px}.mini-rules .recipe{width:115px;min-width:115px}.mini-rules strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){.board{transform:none}.slot.selected .gem:last-of-type{transform:none}.motion-sprite,.combo-pop{display:none}.progress-track span{transition:none}}
.unlock-art{position:relative;display:grid;place-items:center;height:180px}.unlock-art .hero-gem{position:relative;z-index:1;width:120px;height:130px}.unlock-rays{position:absolute;width:210px;height:210px;object-fit:contain;opacity:.7;animation:unlockSpin 12s linear infinite}.unlock h2{margin-top:0}.unlock>.question{margin:0 auto 7px}@keyframes unlockSpin{to{transform:rotate(360deg)}}
/* Native faceted geometry takes over only after both WebGL contexts initialize. */
.jewel-webgl{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none}
.native-3d [data-native-gem]{visibility:hidden!important}
body{background-image:radial-gradient(ellipse at 48% 28%,#337f70 0,#194b43 46%,#082b29 100%)}
.board{border:2px solid #ffe7b3;background:linear-gradient(145deg,#fff4dc 0%,#e4d1a9 35%,#f7e7c6 54%,#ceb388 100%);box-shadow:inset 0 3px 0 #fff9e9,inset 0 -4px 0 #b58e59,0 5px 0 #e4c18a,0 10px 0 #b18a56,0 16px 0 #876138,0 21px 0 #59432e,0 29px 32px #041e24b8}
.slot{background:radial-gradient(ellipse at 55% 70%,#326c61,#174b43 60%,#082e2d 100%);border-color:#a78b5b;box-shadow:inset 0 7px 8px #001819bf,inset 3px 0 4px #082824a0,inset -3px 0 4px #082824a0,0 2px 0 #fff7de}
.slot:after{content:'';position:absolute;inset:8px 5px;border-radius:6px;background:repeating-linear-gradient(0deg,transparent,transparent 8px,#b7dab707 9px);pointer-events:none}
.slot .gem{filter:drop-shadow(0 3px 1px #001619aa)}
.slot.locked{background:linear-gradient(145deg,#fff0d0aa,#c6aa7b80)}
.slot.add-slot{background:linear-gradient(145deg,#649782,#326758)}
.sound-slider{width:130px;accent-color:#2e7962;touch-action:pan-x}.toggle-row output{font-size:11px;min-width:30px}.jewel-card{cursor:pointer;border:1px solid #b9a16f;background:linear-gradient(135deg,#f5ebd4,#ddd0b0)}.jewel-card img{height:76px;width:76px}.collection-grid .jewel-card strong{font-size:9px}.stone-detail{text-align:center}.stone-detail>img{width:160px;height:160px;object-fit:contain}.stone-detail h2{margin:5px}.stone-detail p{margin:7px 0}.stone-detail .tag{font-size:10px;color:#6b775c}.level-grid{max-height:58svh;overflow:auto;padding:3px}
/* Keep a full 15-stone stack inside its pocket even on short screens. */
.slot .gem{height:36%;width:88%;aspect-ratio:auto;object-fit:contain}
