@font-face{font-family:Laserian;src:url('/fonts/LASER4.TTF') format('truetype');font-display:swap}
:root{color-scheme:dark;font-family:Arial,Helvetica,sans-serif;color:#f4fff7;background:#091915;font-synthesis:none}
*{box-sizing:border-box;letter-spacing:0}body{margin:0;min-height:100svh;display:grid;place-items:center}button,input{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.6}[hidden]{display:none!important}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #fff;outline-offset:3px}button svg,a svg{width:22px;height:22px;flex:none}button{touch-action:manipulation}
#game-shell{width:min(1440px,calc((100svh - 48px)*1.6),calc(100vw - 16px))}#stage{position:relative;isolation:isolate;aspect-ratio:8/5;background:#163e32 url('assets/city.png') center/cover no-repeat;overflow:hidden}#stage::before{content:'';position:absolute;inset:0;background:#051d191a;pointer-events:none;z-index:-1}.overlay{position:absolute;inset:0;z-index:5}.loading-screen{display:flex;align-items:center;justify-content:center;flex-direction:column;background:#081e19;gap:20px}.loading-screen h1{font-size:40px;margin:0}.loading-screen p{font-size:12px}.loading-screen progress{width:min(280px,70%);height:9px;accent-color:#8bf22a}
.menu{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#0316111c}.menu h1{font-family:Arial Black,Arial,sans-serif;font-size:88px;font-weight:900;line-height:1;margin:0;color:#f6ffe1;text-shadow:0 3px 0 #355b38,0 6px 0 #102d29,0 8px 24px #062b21}.menu h1 span{color:#c4ffe6}.menu-gems{width:44%;height:40%;position:relative;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 8px 10px #051a1699)}.menu-gems img{position:absolute;width:38%;object-fit:contain}.menu-gems img:first-child{left:0;bottom:5%;transform:rotate(-12deg)}.menu-gems img:nth-child(2){width:61%;z-index:1}.menu-gems img:last-child{right:0;bottom:4%;transform:rotate(12deg)}.menu-actions{display:flex;gap:14px}.primary,.secondary{min-height:44px;border:2px solid #d9ffc0;border-radius:5px;padding:10px 22px;display:flex;align-items:center;justify-content:center;gap:10px;font-family:Laserian,Arial,sans-serif;font-size:18px;text-align:center}.primary{background:#65cf00;color:#fff;text-shadow:1px 1px 0 #193e00,-1px -1px 0 #193e00;box-shadow:0 3px 0 #244d16}.secondary{background:#133f35;color:#fff;border-color:#9ccab4;box-shadow:0 3px 0 #08251f}.primary:hover{background:#7be215}.secondary:hover{background:#205848}.menu-actions button{min-width:180px}
.icon-button{border:1px solid #c3e8cf88;border-radius:4px;background:#0d332ce8;color:#fff;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;text-decoration:none}.icon-button:hover{background:#286347}.game-toolbar{height:42px;display:flex;align-items:center;justify-content:space-between;padding:3px 0}.game-toolbar span{font-size:10px;font-weight:bold;color:#9eafa7}.game-toolbar .icon-button{width:32px;height:32px}.game-toolbar svg{width:18px;height:18px}
#play-screen{position:absolute;inset:0;display:grid;grid-template-rows:72px minmax(0,1fr) 58px;justify-items:center}.hud{width:100%;display:flex;align-items:center;gap:22px;padding:8px 20px;background:#0b2a24e8;border-bottom:1px solid #c9e9bd44}.hud h2{font-size:22px;font-family:Laserian,Arial,sans-serif;margin:0 auto;color:#ebffcf}.stat{min-width:70px;display:grid;gap:4px}.stat>span,.next-stat>span{font-size:10px;font-weight:bold;color:#bcd7c9}.stat strong{font-size:25px;line-height:1;font-variant-numeric:tabular-nums}.star-stat strong{display:flex;align-items:center;gap:7px;color:#f7eeb1}.star-stat svg{width:20px;height:20px;fill:#e1cf70}.star-stat b{font-weight:700}.next-stat{height:54px;display:flex;align-items:center;gap:5px}.next-stat img{width:53px;height:53px;object-fit:contain}
#board-wrap{height:100%;max-width:calc(100% - 24px);aspect-ratio:1;position:relative;min-height:0;filter:drop-shadow(0 7px 12px #031f1988)}#board{position:absolute;inset:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:4px;padding:8px;background:#0b2724f2;border:2px solid #b6cdab;border-radius:6px;box-shadow:inset 0 0 0 3px #355c4b;touch-action:none;user-select:none}.gem{display:grid;place-items:center;position:relative;min-width:0;min-height:0;border:1px solid #659e8e55;border-radius:4px;background:#214e416e;padding:3px;touch-action:none;user-select:none;overflow:visible}.gem img{width:100%;height:100%;min-height:0;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none;filter:drop-shadow(0 3px 2px #030c0a88);transition:transform .12s,opacity .12s}.gem:hover{background:#3c6c5966}.gem.selected{border:3px solid #f9f8c1;background:#527458}.gem.selected img{transform:scale(1.04)}.gem.valid{box-shadow:inset 0 0 0 2px #9aec85}.gem.invalid{box-shadow:inset 0 0 0 3px #ff6b73;background:#733a45}.gem.target{border-color:#f6ffd2;background:#44735b}.gem.dragging img{opacity:.14}.gem.empty img{opacity:0}.gem.merged img{animation:gem-pop .3s ease-out}.gem.star{z-index:2;border-color:#ffe2a6;background:#416e5c}.gem.star img{animation:star-pop .6s ease-out;filter:drop-shadow(0 0 12px #fff9c3)}.gem.hinted{box-shadow:inset 0 0 0 3px #ffe387}.gem.rejected{animation:shake .2s linear}.board-footer{display:flex;align-items:center;gap:14px;width:min(620px,calc(100% - 24px));justify-content:space-between;background:#0b2a24ec;padding:7px 12px;border-radius:0 0 5px 5px}.board-footer>span{font-size:11px;color:#c4d8cc;min-width:74px}.board-footer output{font-weight:700;font-size:18px;text-align:center;color:#f4ffe0;min-width:100px}.board-footer output.bad{color:#ff9a9e}.board-footer .icon-button{width:34px;height:34px}
#drag-ghost{position:fixed;z-index:40;pointer-events:none;object-fit:contain;transform:translate(-50%,-50%);filter:drop-shadow(0 8px 8px #0008)}#effects{position:absolute;inset:0;pointer-events:none;z-index:4;overflow:visible}.spark{position:absolute;width:6px;height:6px;background:var(--color);clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);animation:spark-flight .65s ease-out forwards}.reward{position:absolute;transform:translate(-50%,-50%);font-size:22px;color:#fff9be;font-weight:900;text-shadow:0 2px 3px #06261e;animation:reward-rise .7s ease-out forwards;white-space:nowrap}
.shaded{background:#021710bc;display:grid;place-items:center;padding:16px;backdrop-filter:blur(3px)}.dialog{width:min(400px,100%);max-height:100%;overflow:auto;background:#051b13f7;border:2px solid #80ff00;border-radius:6px;padding:22px;color:#fff;box-shadow:0 0 28px #69dc0020}.dialog h2{font-family:Laserian,Arial,sans-serif;font-size:26px;text-align:center;margin:0 0 18px;color:#c4ff85}.dialog .primary,.dialog .secondary{width:100%;font-size:17px}.pause-dialog{display:grid;gap:16px}.pause-dialog h2{margin:0 0 4px}.slider-label{display:flex;justify-content:space-between;font-size:13px}.pause-dialog input{width:100%;accent-color:#8bf22a}.score-dialog{width:min(430px,100%);padding:18px 22px}.score-dialog h2{font-size:24px;margin:0 0 14px}.score-dialog h2.game-over{color:#ff2929}#run-summary{text-align:center;display:grid;gap:6px;margin-bottom:14px}#run-summary>span,#score-form>label{font-family:Laserian,Arial,sans-serif;font-size:12px}#final-score{font-family:Laserian,Arial,sans-serif;font-size:28px}#run-details{font-size:12px;color:#b8d0bf}#score-form{text-align:center}#score-form>label{display:block;margin-bottom:5px}.name-row{display:flex;gap:8px}.name-row input{width:100%;min-width:0;min-height:40px;text-transform:uppercase;text-align:center;background:#06100b;border:1px solid #c7ffb1;border-radius:3px;color:#fff;font-size:23px}.name-row .primary{width:44px;min-width:44px;min-height:40px;padding:5px}#top10-label{font-family:Laserian,Arial,sans-serif;text-align:center;color:#83ff00;font-size:17px;margin:12px 0 8px}#leaderboard{list-style:none;padding:0;margin:0}#leaderboard li{display:grid;grid-template-columns:30px 1fr auto;gap:10px;align-items:center;min-height:25px;border-bottom:1px solid #a9e99915;color:#e2ffbf;font-size:14px}#leaderboard .rank{color:#99b9a6;font-size:12px}#leaderboard .name{text-align:left}#score-status{font-size:11px;min-height:13px;text-align:center;color:#bbd6c1;margin:12px 0}#fade{position:absolute;inset:0;z-index:50;opacity:0;background:#000;pointer-events:none;transition:opacity .35s}#fade.active{opacity:1;pointer-events:auto}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes gem-pop{0%{transform:scale(.75)}55%{transform:scale(1.12)}100%{transform:scale(1)}}@keyframes star-pop{0%{transform:scale(.65) rotate(-10deg)}40%{transform:scale(1.25) rotate(5deg)}100%{transform:scale(1)}}@keyframes shake{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}@keyframes spark-flight{to{transform:translate(var(--dx),var(--dy)) rotate(100deg);opacity:0}}@keyframes reward-rise{to{translate:0 -50px;opacity:0}}
#game-shell:fullscreen{width:100vw;height:100svh;background:#091915;display:flex;align-items:center;justify-content:center;flex-direction:column}#game-shell:fullscreen #stage{width:min(100vw,calc((100svh - 42px)*1.6));flex:none}#game-shell:fullscreen .game-toolbar{width:min(1440px,100%)}
@media(max-width:1000px){.menu h1{font-size:64px}.menu-actions button{font-size:16px;min-width:150px}.hud{gap:12px;padding:6px 12px}.hud h2{font-size:18px}.stat{min-width:58px}.stat strong{font-size:22px}#play-screen{grid-template-rows:62px minmax(0,1fr) 48px}.next-stat img{width:45px;height:45px}.board-footer{padding:5px 9px}.board-footer output{font-size:16px}}
@media(max-width:650px) and (orientation:portrait){#game-shell{width:calc(100vw - 12px)}#stage{aspect-ratio:3/4}#play-screen{grid-template-rows:66px minmax(0,1fr) 52px;padding-bottom:10px}#board-wrap{width:calc(100% - 16px);height:auto;align-self:center;max-width:none}#board{padding:5px;gap:3px}.gem{padding:2px}.hud{gap:10px;padding:7px 10px}.hud h2{display:none}.star-stat{margin-right:auto}.stat>span,.next-stat>span{font-size:9px}.stat{min-width:53px}.stat strong{font-size:22px}.next-stat{gap:1px}.next-stat img{width:44px;height:44px}.hud .icon-button{width:34px;height:34px}.board-footer{width:calc(100% - 16px)}.board-footer>span{font-size:9px;min-width:56px}.board-footer output{font-size:16px}.menu h1{font-size:43px}.menu-gems{width:82%;height:36%}.menu-actions{flex-direction:column;width:64%;gap:12px}.menu-actions button{font-size:16px;min-width:0}.loading-screen h1{font-size:29px}.shaded{position:fixed;z-index:60}.score-dialog{max-height:calc(100svh - 24px)}#drag-ghost{z-index:45}#game-shell:fullscreen #stage{width:min(100vw,calc((100svh - 42px)*.75))}}
@media(max-height:600px) and (orientation:landscape){.menu h1{font-size:40px}.menu{gap:8px}.menu-actions button{min-height:34px;padding:5px 15px;font-size:13px;min-width:120px}#play-screen{grid-template-rows:43px minmax(0,1fr) 37px}.hud{padding:3px 10px;gap:10px}.hud h2{font-size:16px}.stat{gap:2px;min-width:50px}.stat>span,.next-stat>span{font-size:8px}.stat strong{font-size:18px}.star-stat svg{width:15px;height:15px}.next-stat{height:37px}.next-stat img{width:34px;height:34px}.hud .icon-button{width:30px;height:30px}.board-footer .icon-button{width:28px;height:28px}.board-footer{padding:3px 9px;gap:7px}.board-footer output{font-size:13px}.board-footer>span{font-size:9px}#board{padding:5px;gap:2px}.gem{padding:1px}.shaded{position:fixed;z-index:60}.dialog{max-height:calc(100svh - 20px)}.score-dialog{width:400px}.loading-screen h1{font-size:25px}.loading-screen{gap:10px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}.spark{display:none}}
