*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{background:#9ccfdb;font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;color:#494276;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{cursor:default;filter:grayscale(.65);opacity:.55}button:focus-visible{outline:3px solid #fff;outline-offset:3px}svg{width:1em;height:1em;overflow:visible}.svg-library{position:absolute;width:0;height:0;overflow:hidden}.scenery{position:fixed;inset:0;z-index:-2;background:#a5d7e4 url('assets/garden.webp') center center/cover no-repeat}.scenery:after{content:"";position:absolute;inset:0;background:linear-gradient(#96d8ff05,#fff9df08 60%,#253f5814)}.app{width:min(100%,520px);height:100%;height:100svh;margin:auto;padding:max(12px,env(safe-area-inset-top)) 18px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}.topbar{height:48px;flex-shrink:0;display:flex;gap:12px;align-items:center;justify-content:space-between}.square{display:grid;place-items:center;width:46px;height:46px;flex-shrink:0;border-radius:15px;border:1.5px solid #1679c5;box-shadow:inset 0 2px 2px #ffffffbf,inset 0 -3px 3px #0b68b260,0 3px 2px #48789655;color:#fff;font-size:31px;text-shadow:0 2px #3982b8}.square svg{width:29px;height:29px;fill:#f3f9ff;filter:drop-shadow(0 2px 1px #326bba)}.square .cutout{fill:#529ce5}.pill{border-radius:30px;background:linear-gradient(#fffefbed,#e5f0fde8);border:1.5px solid #ffffffe6;box-shadow:0 3px 2px #737a9340,0 5px 9px #527b9120}.top-title{display:grid;place-items:center;flex:1;min-width:0;height:41px;font-size:clamp(13px,3.7vw,20px);font-weight:900;white-space:nowrap}.wallet{height:40px;position:relative;min-width:87px;padding:5px 12px 5px 33px;display:flex;align-items:center;justify-content:center;font-size:23px}.coin{position:absolute;left:-12px;top:-5px;width:46px;height:46px;border-radius:50%;border:2px solid #fff4a3;background:linear-gradient(135deg,#ffe56d,#ffa514);box-shadow:inset 0 0 0 3px #ffbd34,inset 0 0 0 4px #e6941e,0 3px 0 #d28720;display:grid;place-items:center}.coin svg{width:28px;height:28px;fill:#ffe997;stroke:#d38c13;stroke-width:1;filter:drop-shadow(0 2px 1px #dd861a)}.wallet.coin-pop{animation:bounce .4s}.screen{min-height:0;flex:1;width:100%}.screen[hidden],[hidden]{display:none!important}.cream{background:linear-gradient(135deg,#fffefa,#f0ebe5 65%,#fffaf4);border:3px solid #fffef9;box-shadow:inset 0 0 14px #fff,0 5px 0 #bdafa396,0 11px 22px #53606735;border-radius:30px}.wood-sign{position:relative;isolation:isolate;transform:rotate(-5deg);background:repeating-linear-gradient(0deg,transparent 0 37px,#76452b3b 38px 40px),linear-gradient(110deg,#b6835d,#c6966e 40%,#a87552);border:3px solid #d3a77d;border-radius:14px;box-shadow:inset 1px 2px 3px #f5cca4aa,inset -3px -4px 5px #70452d55,0 5px 0 #80583ec9,0 12px 15px #47564c33;color:#ffe4b5;text-align:center;text-shadow:0 3px #79513e,2px 0 #79513e,-2px 0 #79513e,0 -1px #79513e}.wood-sign:before,.wood-sign:after{content:"";position:absolute;width:7px;height:7px;background:#886145;border-radius:50%;box-shadow:inset 0 1px 2px #3e2c25;top:15px;left:9px}.wood-sign:after{left:auto;right:9px;top:auto;bottom:13px}.sign-crown{position:absolute;left:calc(50% - 15px);top:-22px;width:30px;height:30px;fill:#ffd367;stroke:#d99238;stroke-width:1;filter:drop-shadow(0 2px 1px #9d654a)}h1,h2,p{margin:0}.large{width:83%;padding:20px 10px 22px;margin:15px auto 0}.large h1{font-size:clamp(36px,6.5vh,56px);line-height:.99;font-weight:1000;letter-spacing:-2px}.menu{display:flex;flex-direction:column;justify-content:center;gap:18px}.menu-arrows{display:flex;justify-content:center;gap:22px;height:78px;flex-shrink:0}.menu-arrows svg{width:73px;height:73px;filter:drop-shadow(0 7px 4px #335a7150);animation:bob 3s ease-in-out infinite}.menu-arrows svg:nth-child(2){animation-delay:-1s;translate:0 7px}.menu-arrows svg:nth-child(3){animation-delay:-2s}.menu-card{padding:19px;display:flex;flex-direction:column;gap:13px}.menu-stats{display:flex;justify-content:space-evenly;text-align:center;margin-bottom:4px}.menu-stats>div{flex:1}.menu-stats>div+div{border-left:1px solid #dcd5cb}.menu-stats strong{display:block;font-size:28px;line-height:1.1}.menu-stats span{font-size:11px;color:#8b7b84;font-weight:700}.star-number{color:#e9a622}.star-number b{color:#494276}.gloss{position:relative;isolation:isolate;border:2px solid var(--rim);border-radius:23px;color:white;font-weight:900;text-shadow:0 2px 2px var(--shade);background:linear-gradient(var(--top),var(--bottom));box-shadow:inset 0 2px 3px #ffffffc0,inset 0 -4px 4px var(--inner),0 5px 0 var(--edge),0 8px 10px #364e6630;padding:13px 16px;transition:transform .1s;overflow:visible}.gloss:before{content:"";position:absolute;left:8px;top:8px;width:26px;height:13px;border-radius:50%;background:#ffffff45;transform:rotate(-35deg);pointer-events:none}.gloss:active:not(:disabled),.square:active{transform:translateY(3px) scale(.98)}.green{--top:#91eb4c;--bottom:#37b620;--rim:#68c336;--edge:#2f8b28;--inner:#288d3460;--shade:#2d8b26}.blue{background:linear-gradient(#67caff,#2389eb);--top:#67caff;--bottom:#2389eb;--rim:#2898eb;--edge:#176ec2;--inner:#1264c969;--shade:#175daf}.purple{--top:#bf8bff;--bottom:#9142ed;--rim:#9c5ce6;--edge:#7430b7;--inner:#7926c877;--shade:#6530a4}.gold{--top:#ffe779;--bottom:#ffb325;--rim:#efb835;--edge:#d48b1b;--inner:#e8891469;--shade:#c1861e}.main-play{font-size:25px;min-height:61px}.main-play span{font-size:19px;margin-left:10px}.soft-button{border:0;background:#ded9ef70;color:#777093;font-weight:800;border-radius:15px;padding:12px;min-height:44px}.soft-button span{margin-left:10px}.mode-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mode-buttons button{display:flex;flex-direction:column;align-items:center;font-size:13px;padding:10px 5px;gap:3px}.mode-icon{font-size:31px;line-height:1}.mode-buttons small{font-size:10px;color:#fffeec}.menu-caption{font-size:11px;text-align:center;color:#566b75;text-shadow:0 1px #fff}.selection{display:flex;flex-direction:column;justify-content:center;gap:22px}.selection>.wood-sign{margin:10px auto}.compact{padding:13px 17px}.compact h2{font-size:23px}.level-panel{padding:18px}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.level-tile{border:1.5px solid #d5cbbc;min-height:66px;border-radius:15px;background:linear-gradient(#fff,#e8e3db);box-shadow:inset 0 2px #fff,0 3px #c5b9ac;color:#54496f;font-size:23px;font-weight:900;padding:6px 0}.level-tile.current{background:linear-gradient(#c4f79e,#7cda50);border-color:#6ebf45;box-shadow:0 3px #5aa838}.level-tile small{display:block;font-size:13px;letter-spacing:1px;color:#e6a229;text-shadow:0 1px #fff}.level-tile:disabled{font-size:21px;opacity:.5;filter:none}.pagination{display:flex;align-items:center;justify-content:space-between;margin-top:18px;font-size:13px;font-weight:700}.pagination .square{width:42px;height:42px}.back-button{align-self:center;min-width:230px}.game-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.game-heading{width:100%;display:flex;justify-content:space-between;align-items:center;gap:18px;min-height:100px;flex-shrink:0}.game-heading .wood-sign{width:54%;max-width:225px;padding:13px 10px}.compact h1{font-size:clamp(24px,4.5vh,37px);letter-spacing:-1.5px;line-height:.97}.game-heading .sign-crown{top:-19px;width:26px;height:26px}.game-vitals{text-align:center;flex:1}.hearts{display:flex;justify-content:center;gap:3px;line-height:1.2}.heart{font-family:Arial,sans-serif;color:#f54b58;font-size:31px;text-shadow:0 2px #ae3348,0 -1px #ffb4b7;filter:drop-shadow(0 2px 2px #684d5e30)}.heart.lost{color:#c4bdbd;text-shadow:0 1px #fff;opacity:.6}.score-pill{display:flex;align-items:center;justify-content:center;gap:8px;background:#fffbefd9;border-radius:18px;padding:5px 12px;margin-top:4px;box-shadow:0 2px #9f9b9b25}.score-pill small{font-size:9px;color:#89809a;font-weight:900}.score-pill strong{font-size:22px}#mode-detail{font-size:10px;font-weight:700;color:#567383}.board-wrap{position:relative;width:min(100%,calc(100svh - 340px),460px);flex-shrink:0}.board-frame{padding:13px;border-radius:30px}.board{display:grid;grid-template-columns:repeat(var(--size),1fr);gap:4px;aspect-ratio:1}.cell{min-width:0;min-height:0;position:relative;border-radius:19%;background:linear-gradient(130deg,#f3f0ea,#e9e3de);box-shadow:inset 1px 2px 2px #c2b5aa88,0 1px 1px #fff}.arrow{position:absolute;inset:0;width:100%;height:100%;padding:9%;border:0;border-radius:19%;display:grid;place-items:center;background:transparent;transition:transform .1s;touch-action:manipulation}.arrow svg{width:100%;height:100%;filter:drop-shadow(0 2px 1px #53321c4a);pointer-events:none}.arrow:active{transform:scale(1.1)}.arrow.hinted{background:#aaff9a8c;box-shadow:inset 0 0 0 2px #fff,0 0 14px #54ed52;animation:hint 1s infinite}.arrow.blocked{background:#ffaaa3b8;animation:shake .3s}.arrow.obstacle{box-shadow:inset 0 0 0 2px #f56a67;animation:obstacle .35s}.arrow.unlocked{animation:unlock .48s}.board.shuffling .arrow{animation:shuffle .35s}.board-frame.celebrate{animation:bounce .48s}.flying{position:fixed;inset:auto;pointer-events:none;z-index:12;transition:transform .43s cubic-bezier(.3,.1,.7,.45),opacity .43s;will-change:transform}.flying svg{position:relative;z-index:2;filter:drop-shadow(0 0 6px #bffeff)}.flight-trail{position:fixed;z-index:10;pointer-events:none;border-radius:50%;background:linear-gradient(90deg,transparent,#d5ffffbb,#fff);box-shadow:0 0 10px #e4ffff;transform-origin:left center;animation:trail .5s forwards}.feedback{font-size:11px;font-weight:800;text-align:center;color:#6a647b;min-height:27px;max-width:100%;display:flex;align-items:center;justify-content:center;text-shadow:0 1px #ffffffe6;padding:0 4px;line-height:1.15}.boosters{display:grid;grid-template-columns:1fr 1fr;gap:20px;width:100%;max-width:410px;padding:0 10px}.booster{display:flex;flex-direction:column;align-items:center;padding:10px 3px 11px;gap:5px;font-size:15px;border-radius:24px;min-height:87px}.booster>svg{width:37px;height:37px;fill:none;stroke:#fffcf4;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 3px 1px var(--shade))}.booster .solid{fill:#fff8da}.price{position:absolute;right:5px;top:-12px;border:1.5px solid #fff9df;background:var(--bottom);box-shadow:0 2px #67587c3d;border-radius:17px;min-width:35px;padding:4px 7px;font-size:11px;text-shadow:0 1px var(--shade)}.price i{font-style:normal;color:#ffe992;font-size:10px}.remaining{font-size:16px;font-weight:800;padding:5px 27px;margin-top:3px;min-width:190px;text-align:center}.remaining strong{font-size:22px;margin-left:5px}.restart{min-height:49px;padding:9px 29px;font-size:21px;display:flex;align-items:center;gap:11px;border-radius:24px;margin-top:2px}.restart svg{width:28px;height:28px;fill:none;stroke:#fff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 1px #377e36)}.combo{position:absolute;z-index:5;left:50%;top:-14px;transform:translateX(-50%);padding:7px 17px;border-radius:20px;background:linear-gradient(#fff69a,#ffc744);border:2px solid #fff5bc;color:#9d641e;box-shadow:0 3px #d69a26;font-size:15px;font-weight:1000;white-space:nowrap;opacity:0;pointer-events:none}.combo.visible{opacity:1}.combo.bump{animation:bounce .3s}.board-celebration{position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(20px,5vw,30px);text-align:center;font-weight:1000;color:#fff6ca;text-shadow:0 3px #987242,2px 0 #987242,-2px 0 #987242;pointer-events:none;animation:bounce .4s}.particle{position:fixed;z-index:60;pointer-events:none;animation:particle var(--time,.8s) ease-out forwards;color:var(--color);font-size:18px;font-weight:1000;text-shadow:0 1px #fff}.modal{position:fixed;inset:0;z-index:40;background:#3e52765e;backdrop-filter:blur(5px);display:grid;place-items:center;padding:20px}.modal-card{width:min(100%,370px);padding:25px 22px;text-align:center;animation:popup .25s}.modal-card h2{font-size:26px;line-height:1.12;letter-spacing:-.7px}.modal-card>p{font-size:13px;color:#8d8090;margin:9px 0 18px;line-height:1.4}.result-stars{display:flex;justify-content:center;gap:8px;margin-bottom:14px;font-size:43px;line-height:1;color:#d6cec7}.result-stars span{display:inline-block;text-shadow:0 2px #b7a99b}.result-stars .earned{color:#ffca34;text-shadow:0 3px #db911e;animation:star-in .4s backwards;animation-delay:calc(var(--i)*.17s)}.result-stars span:nth-child(2){font-size:54px;margin-top:-8px}.result-stats{background:#eee7dd;border-radius:18px;padding:13px 17px;margin-bottom:18px}.result-stats>div{display:flex;justify-content:space-between;align-items:center;padding:5px 0;font-size:13px;color:#8c7e85}.result-stats strong{color:#554977;font-size:18px}.result-stats .reward strong{color:#d59523}.modal-buttons{display:flex;flex-direction:column;gap:13px}.modal-buttons .gloss{min-height:49px;font-size:16px}.modal-buttons .soft-button{background:transparent;padding:7px}.toggles{margin:16px 0 22px;display:flex;flex-direction:column;gap:10px}.setting-row{display:flex;justify-content:space-between;align-items:center;border:0;border-radius:15px;background:#e8e2db;padding:11px 14px;color:#6c607e;font-weight:800;min-height:48px}.setting-row strong{border-radius:20px;background:#77cf4d;color:white;padding:5px 13px;font-size:12px}.setting-row.off strong{background:#b4acb6}.insufficient{animation:shake .3s!important}.insufficient .price{background:#ef5c57}.app.modal-open{pointer-events:none}.muted-star{color:#cfc4b5!important}@keyframes shake{20%,60%{transform:translateX(-4px) rotate(-3deg)}40%,80%{transform:translateX(4px) rotate(3deg)}}@keyframes hint{50%{transform:scale(.94);box-shadow:inset 0 0 0 2px #fff,0 0 22px #54ed52}}@keyframes unlock{35%{background:#b9f7bb8c;box-shadow:0 0 8px #aeffbd}}@keyframes obstacle{50%{background:#ffaca4}}@keyframes shuffle{50%{transform:scale(.65) rotate(20deg);opacity:.5}}@keyframes bounce{40%{scale:1.07}70%{scale:.97}}@keyframes bob{50%{transform:translateY(-9px) rotate(5deg)}}@keyframes popup{from{opacity:0;transform:translateY(18px) scale(.94)}}@keyframes star-in{from{scale:.2;opacity:0}70%{scale:1.2}}@keyframes trail{0%{opacity:0;scale:.1 1}25%{opacity:.9}100%{opacity:0;scale:1 1}}@keyframes particle{to{transform:translate(var(--dx),var(--dy)) rotate(var(--spin));opacity:0}}
@media(min-width:800px){.scenery{background-size:auto 100%;background-color:#8bbac5}.scenery:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#688c9c88,transparent 28%,transparent 72%,#688c9c88)}.app{padding-top:18px;padding-bottom:18px}.game-screen{gap:11px}.board-wrap{width:min(100%,calc(100svh - 355px),460px)}}
@media(max-width:370px){.app{padding-left:12px;padding-right:12px}.topbar{gap:9px}.top-title{font-size:13px}.wallet{min-width:76px;font-size:20px}.board-frame{padding:10px}.booster{font-size:13px}.game-heading{gap:9px}}
@media(max-height:740px){.app{gap:9px;padding-top:max(8px,env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom))}.game-screen{gap:7px}.game-heading{min-height:83px}.compact h1{font-size:29px}.game-heading .wood-sign{padding:10px}.board-wrap{width:min(100%,calc(100svh - 305px),440px)}.booster{min-height:73px;padding:8px 3px;font-size:13px;gap:2px}.booster>svg{width:32px;height:32px}.boosters{gap:16px}.feedback{font-size:10px;min-height:25px}.remaining{padding:3px 22px;font-size:14px}.remaining strong{font-size:19px}.restart{min-height:43px;font-size:18px;padding:7px 25px}.restart svg{width:24px;height:24px}.menu{gap:14px}.menu-arrows{height:61px}.menu-arrows svg{width:59px;height:59px}.large{padding:16px 8px}.large h1{font-size:40px}.menu-card{padding:16px;gap:11px}.level-grid{gap:9px}.level-tile{min-height:57px}.selection{gap:16px}}
@media(max-height:580px){.menu-arrows,.menu-caption{display:none}.menu{gap:10px}.large{margin-top:6px;padding:10px}.large h1{font-size:32px}.menu-card{gap:9px;padding:12px}.menu-stats strong{font-size:23px}.main-play{min-height:48px;font-size:19px}.mode-buttons button{padding:7px}.mode-icon{font-size:24px}.game-heading{min-height:63px}.compact h1{font-size:23px}.game-heading .wood-sign{width:49%;padding:6px}.game-heading .sign-crown{width:22px;height:22px;top:-14px}.hearts .heart{font-size:24px}.score-pill{padding:2px 8px}.score-pill strong{font-size:19px}.board-wrap{width:min(100%,calc(100svh - 280px),440px)}.board-frame{padding:8px;border-radius:20px}.board{gap:3px}.feedback{min-height:23px}.booster{min-height:64px}.booster>svg{width:26px;height:26px}.level-tile{min-height:43px;font-size:18px}.level-tile small{font-size:10px}.level-panel{padding:12px}.level-grid{gap:7px}.selection{gap:12px}.compact h2{font-size:19px}.pagination{margin-top:10px}.modal-card{padding:18px}.modal-card h2{font-size:23px}.result-stars{font-size:33px}.result-stars span:nth-child(2){font-size:42px}.result-stats{padding:8px 12px;margin-bottom:12px}.modal-buttons{gap:10px}}
@media(max-height:500px) and (min-width:560px){.app{max-width:860px;padding:9px 20px;gap:8px}.topbar{height:42px;max-width:480px;width:100%;align-self:center}.game-screen{display:grid;grid-template-columns:1fr min(68svh,310px) 1fr;grid-template-rows:auto auto auto;align-content:center;gap:10px 16px}.game-heading{grid-column:1;grid-row:1/3;flex-direction:column;justify-content:center;gap:18px}.game-heading .wood-sign{width:100%;max-width:165px}.game-vitals{flex:0}.board-wrap{grid-column:2;grid-row:1/5;width:100%}.feedback{grid-column:1;grid-row:3/5}.boosters{grid-column:3;grid-row:1/3;grid-template-columns:1fr;gap:15px;padding:0}.booster{min-height:65px}.remaining{grid-column:3;grid-row:3;min-width:0;font-size:12px;padding:4px}.restart{grid-column:3;grid-row:4;font-size:14px;padding:8px;justify-content:center}.menu{display:grid;grid-template-columns:1fr 1.3fr;gap:24px;align-content:center}.menu>.wood-sign{grid-column:1;grid-row:1;width:100%}.menu-card{grid-column:2;grid-row:1}.menu .large h1{font-size:42px}.selection{max-width:570px;align-self:center}.selection>.wood-sign{display:none}.level-grid{grid-template-columns:repeat(6,1fr)}.level-tile{min-height:45px}.back-button{padding:9px}.selection{gap:10px}}
@media(prefers-reduced-motion:reduce){*,*:before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Reserve controls first; fit a square board into the remaining space. */
.game-screen{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) 27px auto auto auto;justify-items:center;align-content:stretch;padding-bottom:6px}
.game-heading{min-height:0;padding:22px 6px 7px}
.game-heading .wood-sign{flex-shrink:0}
.game-vitals{min-width:0}
.board-slot{width:100%;height:100%;min-width:0;min-height:0;container-type:size;display:grid;place-items:center}
.game-screen .board-wrap{grid-area:auto;width:min(100cqw,calc(100cqh - 6px),460px);aspect-ratio:1;min-width:0;min-height:0}
.board-frame{width:100%;height:100%}
.board{width:100%;height:100%;grid-template-columns:repeat(var(--size),minmax(0,1fr));grid-template-rows:repeat(var(--size),minmax(0,1fr))}
.arrow svg{display:block;min-width:0;min-height:0}
.feedback{margin:0;min-height:0;width:100%}
@media(max-height:740px){.game-screen{grid-template-rows:auto minmax(0,1fr) 25px auto auto auto}.game-heading{padding-top:20px;padding-bottom:4px}}
@media(max-height:580px){.game-heading{padding-top:16px;padding-bottom:3px}}
@media(max-height:500px) and (min-width:560px){
  .app{width:min(100%,860px);padding:9px 20px;gap:8px}
  .game-screen{grid-template-columns:minmax(130px,1fr) minmax(0,1.5fr) minmax(130px,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr) auto auto;gap:10px 16px}
  .game-heading{grid-column:1;grid-row:1/3;flex-direction:column;justify-content:center;gap:18px;padding:20px 3px 0}
  .game-heading .wood-sign{width:100%;max-width:165px}
  .game-vitals{flex:0}
  .board-slot{grid-column:2;grid-row:1/5}
  .feedback{grid-column:1;grid-row:3/5}
  .boosters{grid-column:3;grid-row:1/3;grid-template-columns:1fr;gap:15px;padding:0}
  .booster{min-height:64px}
  .remaining{grid-column:3;grid-row:3;min-width:0;font-size:12px;padding:4px}
  .restart{grid-column:3;grid-row:4;font-size:14px;padding:8px;justify-content:center}
}
@media(max-height:500px) and (min-width:560px){
  .modal-card{width:min(100%,680px);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 22px;padding:18px}
  .modal-card h2{grid-column:1;grid-row:1}
  .modal-card>p{grid-column:1;grid-row:2;margin:0}
  .result-stars{grid-column:1;grid-row:3;margin:4px 0;font-size:30px}
  .result-stars span:nth-child(2){font-size:38px;margin-top:-5px}
  .result-stats{grid-column:1;grid-row:4;margin:0;padding:7px 10px}
  .result-stats>div{font-size:11px;padding:3px 0}
  .result-stats strong{font-size:14px}
  .toggles{grid-column:1;grid-row:3/5;margin:0}
  .modal-buttons{grid-column:2;grid-row:1/5}
}
@media(max-height:500px) and (min-width:560px){
  .menu{grid-template-columns:minmax(0,.8fr) minmax(0,1.6fr);gap:16px}
  .menu .large h1{font-size:clamp(27px,4.6vw,42px)}
  .menu-card{gap:8px;padding:12px}
  .menu-card .main-play{font-size:16px!important;min-height:44px;padding:10px 4px}
  .menu-card .soft-button{min-height:36px;padding:8px}
  .mode-buttons .gloss{padding:6px 4px}
}
@media(max-height:500px) and (min-width:560px){.menu>.wood-sign{align-self:center}}

/* Keep text inside its own panel at every viewport size. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font-size:16px;line-height:1.25}
.scenery{background-size:cover}
.app{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right))}
.topbar{gap:10px;height:52px}
.top-title{font-size:20px;height:48px;white-space:normal;text-align:center;line-height:1.1;padding:4px 8px}
.wallet{font-size:24px;min-width:88px;max-width:46%;height:48px;padding:4px 9px;gap:5px}
.wallet .coin{position:static;width:34px;height:34px;flex-shrink:0}
.wallet .coin svg{width:24px;height:24px}
.wallet strong{min-width:0;overflow-wrap:anywhere;font-size:clamp(18px,5vw,24px);line-height:1.05}
.wood-sign{transform:none}
.game-heading{gap:12px;padding:20px 0 6px;align-items:center}
.game-heading .wood-sign{width:58%;max-width:260px;padding:12px 8px}
.game-heading h1{font-size:clamp(23px,6.6vw,32px);letter-spacing:-1px;line-height:1.05}
.game-vitals{flex:1;min-width:0}
.score-pill{flex-wrap:wrap;gap:2px 7px;padding:5px 8px;background:#fffdf6}
.score-pill small{font-size:14px;color:#605574}
.score-pill strong{font-size:26px;overflow-wrap:anywhere;max-width:100%;line-height:1.1}
#mode-detail{display:block;font-size:14px;color:#403855;background:#fff8e8e8;border-radius:10px;margin-top:5px;padding:3px 5px;line-height:1.2;overflow-wrap:break-word}
.heart,.hearts .heart{font-size:28px}
.game-screen{grid-template-rows:auto minmax(0,1fr) auto auto auto auto;gap:10px;padding-bottom:10px}
.feedback{font-size:16px;line-height:1.25;min-height:40px;padding:4px 10px;color:#493d62;background:#fffaf0f5;border-radius:12px;text-shadow:none;align-self:center;max-width:460px}
.boosters{padding:0;gap:14px;max-width:460px}
.booster{min-width:0;min-height:88px;padding:9px 4px;gap:4px;font-size:18px;line-height:1.15}
.booster>svg{width:30px;height:30px}
.price{position:static;align-self:center;order:3;font-size:14px;line-height:1.1;min-width:0;padding:3px 9px;background:#fff9e8;color:#5b4373;text-shadow:none;box-shadow:none}
.price i{font-size:13px;color:#936000}
.remaining{font-size:19px;line-height:1.2;padding:5px 20px;margin:0}
.remaining strong{font-size:24px}
.restart{font-size:22px;min-height:48px;margin:0;padding:9px 24px}
.combo{font-size:18px;top:5px;max-width:calc(100% - 16px);padding:5px 12px}
.board-celebration{font-size:clamp(20px,5vw,28px);padding:10px;overflow-wrap:break-word}
.menu{gap:15px}
.menu .large{padding:16px 8px}
.menu .large h1{font-size:clamp(32px,9.5vw,46px);letter-spacing:-1px}
.menu-stats span{display:block;font-size:15px;line-height:1.2;color:#65566e;padding:3px}
.menu-stats strong{font-size:30px}
.menu-card .main-play{font-size:22px!important;line-height:1.2;padding:10px 8px;min-height:52px}
.soft-button{font-size:18px;color:#57466e}
.mode-buttons button{font-size:17px;line-height:1.2;min-width:0;padding:9px 4px}
.mode-buttons small{font-size:14px;line-height:1.2;color:#fff;overflow-wrap:anywhere}
.menu-caption{font-size:14px;line-height:1.3;color:#493d62;background:#fffaf0ed;border-radius:12px;padding:6px}
.level-tile{font-size:26px}
.level-tile small{font-size:14px;letter-spacing:0}
.pagination{font-size:16px}
.back-button{font-size:19px}
.modal-card{padding:22px 18px}
.modal-card h2{font-size:28px;line-height:1.15}
.modal-card>p{font-size:16px;line-height:1.3;color:#665673;margin:10px 0 16px}
.result-stats>div{font-size:16px;gap:10px;line-height:1.25}
.result-stats strong{font-size:19px;text-align:right}
.modal-buttons .gloss,.setting-row{font-size:18px;line-height:1.2}
.setting-row strong{font-size:16px}
@media(max-height:740px){
  .game-screen{gap:7px}
  .game-heading{padding-top:16px;padding-bottom:2px}
  .game-heading .wood-sign{padding:8px}
  .menu-arrows{display:none}
  .menu{gap:12px}
  .menu-card{padding:14px;gap:11px}
  .feedback{font-size:15px;min-height:38px;padding:3px 8px}
  .booster{min-height:82px;font-size:17px;padding:7px 3px;gap:3px}
  .booster>svg{width:24px;height:24px}
  .restart{font-size:20px;padding:8px 20px}
}
@media(max-width:350px){
  .top-title{font-size:18px}
  .game-heading{gap:8px}
  .game-heading .wood-sign{width:57%;padding:8px 5px}
  .game-heading h1{font-size:23px}
  .mode-buttons{gap:8px}
  .mode-buttons button{font-size:16px}
  .menu-stats span{font-size:14px}
  .level-panel{padding:12px}
}
@media(max-height:580px){
  .menu-caption{display:none}
  .menu-card{gap:9px;padding:12px}
  .menu .large{padding:10px 8px;margin-top:16px}
  .menu .large h1{font-size:32px}
  .modal-card{padding:16px}
  .modal-card h2{font-size:25px}
  .modal-card>p{margin:6px 0 10px}
  .toggles{margin:12px 0 16px}
  .result-stats{padding:8px 12px;margin-bottom:12px}
}
@media(max-height:500px) and (min-width:560px){
  .app{padding:9px 16px}
  .topbar{height:48px;max-width:540px}
  .game-screen{grid-template-rows:minmax(0,1fr) minmax(0,1fr) auto auto;gap:8px 12px;grid-template-columns:minmax(138px,1fr) minmax(0,1.5fr) minmax(150px,1fr);padding-bottom:8px}
  .game-heading{padding:18px 0 0;gap:9px}
  .game-heading .wood-sign{width:100%;padding:8px 4px}
  .game-heading h1{font-size:23px}
  .game-vitals{width:100%}
  .hearts .heart{font-size:25px}
  #mode-detail{font-size:14px}
  .feedback{font-size:14px;min-height:0;padding:4px;align-self:stretch}
  .boosters{gap:9px}
  .booster{display:grid;grid-template-columns:24px 1fr;min-height:68px;gap:2px 4px;padding:6px;font-size:16px}
  .booster>svg{grid-column:1;grid-row:1/3;width:24px;height:24px}
  .booster>span:not(.price){grid-column:2;grid-row:1}
  .booster .price{grid-column:2;grid-row:2;padding:2px 4px;font-size:14px;justify-self:center}
  .remaining{font-size:16px;padding:4px 5px}
  .remaining strong{font-size:20px;margin-left:3px}
  .restart{font-size:18px;min-height:44px;padding:6px;gap:5px}
  .restart svg{width:22px;height:22px}
  .menu{grid-template-columns:minmax(0,.7fr) minmax(0,1.7fr);gap:12px}
  .menu .large h1{font-size:26px}
  .menu-card{gap:6px;padding:9px}
  .menu-stats strong{font-size:23px}
  .menu-stats span{font-size:14px;padding:0}
  .menu-card .main-play{font-size:18px!important;min-height:40px;padding:6px}
  .menu-card .soft-button{font-size:16px;min-height:32px;padding:5px}
  .mode-buttons button{font-size:16px;padding:5px 3px;gap:1px}
  .mode-icon{display:none}
  .modal-card{gap:6px 14px;padding:14px}
  .modal-card h2{font-size:24px}
  .modal-card>p{font-size:15px;margin:0}
  .result-stats{padding:6px 8px;margin:0}
  .result-stats>div{font-size:14px;gap:6px}
  .result-stats strong{font-size:16px}
  .modal-buttons .gloss{font-size:17px;padding:10px 6px}
  .toggles{margin:0}
  .level-tile{font-size:22px;min-height:48px}
  .level-tile small{font-size:14px}
}
@media(max-height:500px) and (min-width:560px){.selection{gap:8px}.level-panel{padding:9px}}

/* Reference composition: large illustrated title, full-width board, sculpted controls. */
.app{width:min(100%,560px);padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));gap:8px}
.topbar{padding:0 4px;gap:16px;height:52px}
.top-title{font-size:22px;border-radius:32px;box-shadow:inset 0 2px 2px #fff,0 3px 3px #668cac50}
.square{width:48px;height:48px;border-radius:17px}
.wallet{position:relative;min-width:92px;padding-left:30px;font-size:25px}
.wallet .coin{position:absolute;left:-12px;top:-3px;width:50px;height:50px;border-width:2px}
.wallet .coin svg{width:31px;height:31px}
.wallet strong{font-size:25px}
.game-sign,.menu>.wood-sign{background:none!important;border:0!important;box-shadow:none!important;transform:none!important;padding:0!important;border-radius:0}
.game-sign:before,.game-sign:after,.menu>.wood-sign:before,.menu>.wood-sign:after{display:none}
.title-art{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 5px 3px #634a3420)}
.game-heading{padding:0;gap:10px;min-height:0;height:clamp(108px,16svh,140px)}
.game-heading .game-sign{width:52%;max-width:290px;height:100%;flex-shrink:0}
.game-vitals{padding-right:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
.hearts{gap:5px}.heart,.hearts .heart{font-size:33px}
.score-pill{padding:6px 14px;margin:0;min-width:110px;background:linear-gradient(#fffdf2f5,#fff8e8de);border:1px solid #fff9e8;box-shadow:0 2px 2px #bcb0a050}
.score-pill strong{font-size:28px}
#mode-detail{background:none;color:#493b66;text-shadow:0 1px 2px #fff;padding:0;margin:0}
.game-screen[data-mode="normal"] #mode-detail{display:none}
.game-screen{gap:8px;padding-bottom:7px}
.game-screen .board-wrap{width:min(calc(100cqw - 4px),calc(100cqh - 8px),520px)}
.board-frame{padding:14px;border-radius:32px;border:3px solid #fffef9;background:linear-gradient(130deg,#fffefa,#f4eee9 70%,#fffdf7);box-shadow:inset 0 0 15px #fff,0 6px 0 #b9a79a80,0 12px 16px #5c584f30}
.board{gap:4px}
.cell{border-radius:19%;background:linear-gradient(125deg,#f2efea,#e9e4df);box-shadow:inset 1px 2px 2px #c7bcb6b0,0 1px 1px #fff}
.arrow{padding:8%}
.feedback{min-height:20px;padding:0 4px;background:none;border-radius:0;color:#56466c;font-size:14px;line-height:1.15;text-shadow:0 1px 2px #fff,0 0 5px #fff;max-width:520px}
.boosters{width:100%;max-width:500px;padding:7px 4px 4px;gap:18px}
.booster{display:flex;min-height:96px;border:2px solid var(--rim);border-radius:28px;padding:10px 5px 9px;gap:5px;font-size:21px;line-height:1.15;box-shadow:inset 0 3px 4px #ffffffb0,inset 0 -5px 5px var(--inner),0 5px 0 var(--edge),0 8px 10px #364e6635}
.booster>svg{width:45px;height:45px;stroke-width:3.4;filter:drop-shadow(0 3px 1px var(--shade))}
.gloss:before{width:30px;height:16px;left:10px;top:9px}
.price{position:absolute;top:-10px;right:8px;align-self:auto;order:0;min-width:34px;padding:5px 7px;border:2px solid #fff8e8;border-radius:20px;background:var(--bottom);color:#fff;font-size:16px;text-shadow:0 1px 2px var(--shade);box-shadow:0 2px 1px #68524835}
.price i{font-size:14px;color:#fff2a2}
.remaining{font-size:20px;min-width:210px;padding:5px 25px;box-shadow:inset 0 2px 2px #fff9,0 3px 2px #91818c30}
.remaining strong{font-size:26px}
.restart{font-size:25px;min-height:55px;padding:10px 32px;border-radius:29px;gap:12px;margin-top:2px}
.restart svg{width:32px;height:32px}
.menu>.wood-sign{height:clamp(150px,24svh,230px);width:90%;max-width:380px;margin:0 auto}
.menu{gap:12px}
.menu-arrows{height:62px}
.menu-arrows svg{width:60px;height:60px}
.menu-card{margin:0 8px}
@media(max-height:740px){
  .app{padding-top:8px;padding-bottom:8px;gap:6px}
  .topbar{height:48px}
  .game-screen{gap:6px}
  .game-heading{height:96px}
  .booster{min-height:79px;font-size:19px;padding:7px 4px;gap:3px}
  .booster>svg{width:34px;height:34px}
  .boosters{padding-top:6px;gap:16px}
  .remaining{font-size:18px;padding:4px 22px}
  .remaining strong{font-size:23px}
  .restart{font-size:22px;min-height:48px;padding:8px 26px}
  .restart svg{width:27px;height:27px}
  .menu>.wood-sign{height:135px}
}
@media(max-width:350px){
  .topbar{gap:12px;padding:0 2px}
  .top-title{font-size:19px}
  .wallet{min-width:86px}
  .wallet strong{font-size:22px}
  .wallet .coin{width:44px;height:44px;top:0;left:-10px}
  .game-heading .game-sign{width:53%}
  .booster{font-size:18px}
  .price{font-size:14px;padding:4px 6px}
  .board-frame{padding:10px;border-radius:26px}
}
@media(max-height:580px){
  .game-heading{height:79px}
  .game-heading .game-sign{width:51%}
  .hearts .heart{font-size:27px}
  .score-pill{padding:3px 10px}
  .score-pill strong{font-size:24px}
  .menu>.wood-sign{height:104px}
}
@media(max-height:500px) and (min-width:560px){
  .app{width:min(100%,900px);padding:9px 14px}
  .topbar{height:48px;max-width:540px}
  .game-screen{gap:8px 12px}
  .game-heading{height:100%;gap:6px;padding:0}
  .game-heading .game-sign{width:100%;height:100px;max-width:210px}
  .game-vitals{gap:3px;padding:0}
  .hearts .heart{font-size:26px}
  .score-pill{padding:3px 10px}
  .score-pill strong{font-size:24px}
  .boosters{padding:5px 0 0;gap:15px}
  .booster{min-height:69px;font-size:17px;gap:2px;padding:7px 3px 4px;border-radius:22px}
  .booster>svg{width:29px;height:29px}
  .booster .price{font-size:14px;padding:3px 6px;right:3px;top:-10px;min-width:28px}
  .remaining{min-width:0;font-size:16px;padding:3px 5px}
  .remaining strong{font-size:20px}
  .restart{min-height:44px;font-size:18px;padding:5px;gap:5px;margin:0}
  .restart svg{width:22px;height:22px}
  .feedback{font-size:14px;min-height:0;align-self:center;padding:2px}
  .menu>.wood-sign{height:150px;width:100%}
  .menu-card{margin:0}
}
.wallet{padding-left:42px}
.game-screen{grid-template-rows:auto minmax(0,1fr) auto auto auto}
.game-heading{height:140px}
.game-vitals .feedback{font-size:14px;line-height:1.15;min-height:0;max-width:100%;padding:2px 0;margin:0;text-align:center;grid-area:auto}
.game-vitals:has(.feedback:not([hidden])) #mode-detail{display:none}
@media(max-height:740px){.game-heading{height:96px}.game-vitals .feedback{line-height:1.1}.game-vitals:has(.feedback:not([hidden])) .hearts .heart{font-size:26px}.game-vitals:has(.feedback:not([hidden])){gap:2px}.game-vitals:has(.feedback:not([hidden])) .score-pill{padding:2px 9px}}
@media(max-height:580px){.game-heading{height:84px}.game-vitals:has(.feedback:not([hidden])) .score-pill strong{font-size:21px}.game-vitals:has(.feedback:not([hidden])) .hearts .heart{font-size:22px}}
@media(max-height:500px) and (min-width:560px){
  .game-screen{grid-template-rows:minmax(0,1fr) minmax(0,1fr) auto auto}
  .game-heading{height:100%;grid-row:1/5}
  .game-vitals .feedback{grid-area:auto;align-self:center}
}
.top-title{font-size:clamp(18px,5vw,22px);white-space:nowrap;padding-left:5px;padding-right:5px}
@media(max-height:580px) and (max-width:559px){.game-heading{height:104px}}

.coin-plus{border:2px solid #429523;border-radius:10px;background:linear-gradient(#a0ef6d,#38bd23);color:#fff;font-size:25px;font-weight:900;line-height:1;box-shadow:inset 0 2px 2px #edffbb,0 3px 2px #53794350;text-shadow:0 2px #428d2a;width:30px;height:30px;padding:0;flex-shrink:0}
.wallet{max-width:52%;padding-right:5px;gap:6px}
.boosters{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.booster{font-size:clamp(12px,3.3vw,18px)}
#undo[aria-disabled="true"]{cursor:default}

/* All game coordinates belong to the 941 × 1672 reference scene. */
body.in-game{display:block;background:#8bbac5}
body.in-game .scenery{inset:0;width:100%;height:100%;transform:none;background-position:center;background-size:cover;filter:none}
body.in-game .scenery:before,body.in-game .scenery:after{display:none}
.app.reference-scene{position:fixed;left:50%;top:50%;width:941px;height:1672px;max-width:none;max-height:none;min-width:0;padding:0;margin:0;display:block;container-type:normal;transform:translate(-50%,-50%) scale(var(--scene-scale));transform-origin:center;isolation:isolate;font-family:"Arial Rounded MT Bold","Trebuchet MS",sans-serif}
.reference-scene .topbar{position:absolute;inset:0 0 auto;width:941px;height:110px;max-width:none;padding:0;display:block;z-index:5}
.reference-scene #settings{position:absolute;left:36px;top:21px;width:91px;height:88px;border-radius:27px;border-width:2px;box-shadow:inset 0 3px 3px #c6f2ff,inset 0 -6px 6px #1673ce,0 4px 3px #405f8d66}
.reference-scene #settings svg{width:57px;height:57px;filter:drop-shadow(0 3px 2px #2767b0)}
.reference-scene .top-title{position:absolute;left:314px;top:30px;width:314px;height:70px;padding:0;font-size:40px;font-weight:900;letter-spacing:.3px;border-radius:45px;border:2px solid #e4f4ff;background:linear-gradient(#f4faffef,#deedffef);box-shadow:inset 0 2px 3px #fff,0 4px 5px #527a9d66}
.reference-scene .wallet{position:absolute;left:681px;top:34px;width:222px;height:63px;min-width:0;max-width:none;padding:0 61px 0 35px;gap:0;border-radius:35px;border:0;background:linear-gradient(#fffcf7,#f3f5f6);box-shadow:0 4px 5px #6b82994d}
.reference-scene .wallet strong{font-size:40px;white-space:nowrap;letter-spacing:0}
.reference-scene .wallet .coin{left:-32px;top:-7px;width:76px;height:76px;border:2px solid #fff39b;box-shadow:inset 0 0 0 5px #ffc538,inset 0 0 0 7px #e49b18,inset 0 -9px 8px #ffb018,0 5px 2px #c2821b}
.reference-scene .wallet .coin svg{width:47px;height:47px}
.reference-scene .coin-plus{position:absolute;right:0;top:4px;width:54px;height:54px;border-radius:18px;font-size:51px;line-height:45px;border:2px solid #439c26;box-shadow:inset 0 3px 3px #daffb9,inset 0 -4px 3px #289322,0 3px 3px #73917388}
.reference-scene .game-screen{position:absolute;inset:0;width:941px;height:1672px;display:block;padding:0;margin:0}
.reference-scene .game-heading{position:absolute;left:0;top:104px;width:941px;height:256px;min-height:0;padding:0;display:block}
.reference-scene .game-heading .game-sign{position:absolute;left:-12px;top:0;width:388px;height:274px;max-width:none;padding:0}
.reference-scene .game-sign .title-art{width:100%;height:100%;transform:none;object-fit:fill;filter:drop-shadow(0 5px 4px #66503933)}
.reference-scene .game-vitals{position:absolute;right:70px;top:82px;bottom:auto;width:420px;height:130px;padding:0;display:flex;align-items:center;justify-content:center}
.reference-scene .game-vitals .hearts,.reference-scene .game-vitals .score-pill,.reference-scene .game-vitals #mode-detail{display:none}
.reference-scene .game-vitals .feedback{position:static;width:100%;max-width:none;min-height:0;padding:14px 18px;margin:0;border-radius:22px;font-size:25px;line-height:1.25;color:#494276;background:#fff9eae8;box-shadow:0 3px 6px #65899925;text-shadow:0 1px #fff}
.reference-scene .board-slot{position:absolute;left:71px;top:360px;width:796px;height:797px;min-height:0;display:block;container-type:normal;aspect-ratio:auto}
.reference-scene .board-wrap{position:relative;width:100%;height:100%;max-width:none;aspect-ratio:auto}
.reference-scene .board-frame{width:100%;height:100%;padding:32px 33px 34px;border:4px solid #fffdf7;border-radius:70px;background:linear-gradient(120deg,#fffefa,#f4f0ec 60%,#fffcf7);box-shadow:inset 0 0 19px 6px #fff,0 8px 0 #c7b7aa99,0 14px 15px #70645744}
.reference-scene .board{width:100%;height:100%;gap:6px;grid-template-columns:repeat(var(--size),minmax(0,1fr));grid-template-rows:repeat(var(--size),minmax(0,1fr))}
.reference-scene .cell{border-radius:19px;background:linear-gradient(125deg,#f3efeb,#e9e4e0);box-shadow:inset 1px 2px 3px #c8beb8,0 2px 2px #fff}
.reference-scene .arrow{padding:10%;border-radius:19px}
.reference-scene .arrow svg{filter:drop-shadow(0 4px 2px #61412650)}
.reference-scene .arrow.hinted{background:radial-gradient(#dcffd4,#bbfdb5);box-shadow:inset 0 0 0 4px #fff,0 0 12px 7px #7dff6c;animation:reference-hint 1s ease-in-out infinite}
.reference-scene .arrow.blocked{background:#ffbbb4bb;box-shadow:0 0 18px #ff8a7b}
.reference-scene .arrow.blocked:after{content:"";position:absolute;inset:-3%;border:5px double #ff6962;border-radius:27%;pointer-events:none;mask:conic-gradient(#000 0 35deg,transparent 35deg 55deg,#000 55deg 125deg,transparent 125deg 145deg,#000 145deg 215deg,transparent 215deg 235deg,#000 235deg 305deg,transparent 305deg 325deg,#000 325deg)}
.reference-scene .boosters{position:absolute;left:77px;top:1199px;width:788px;height:150px;max-width:none;padding:0;display:grid;grid-template-columns:240px 224px 234px;gap:45px}
.reference-scene .booster{width:100%;height:150px;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:10px 0 9px;gap:7px;font-size:29px;line-height:1.1;white-space:nowrap;border:3px solid var(--rim);border-radius:49px;box-shadow:inset 0 4px 4px #ffffffbc,inset 0 -8px 8px var(--inner),0 7px 0 var(--edge),0 10px 8px #54628155;text-shadow:0 3px 2px var(--shade)}
.reference-scene .booster>svg{width:82px;height:82px;flex-shrink:0;stroke-width:4;filter:drop-shadow(0 4px 2px var(--shade))}
.reference-scene .booster:before{width:36px;height:23px;left:12px;top:13px}
.reference-scene .booster .price{position:absolute;right:9px;top:-12px;width:55px;height:55px;min-width:0;min-height:0;padding:0;border:3px solid #fff9e9;border-radius:50%;display:grid;place-items:center;font-size:33px;line-height:1;box-shadow:0 3px 2px #7b655744;background:linear-gradient(var(--top),var(--bottom))}
.reference-scene .remaining{position:absolute;left:263px;top:1380px;width:416px;height:60px;min-width:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;gap:10px;border:2px solid #e8dfd8;border-radius:40px;background:linear-gradient(#fffaf6df,#ece5e0ed);font-size:32px;box-shadow:0 4px 5px #8c7c7955}
.reference-scene .remaining strong{font-size:38px;margin:0}
.reference-scene .restart{position:absolute;left:261px;top:1470px;width:421px;height:103px;min-height:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;gap:18px;border:3px solid #61be29;border-radius:49px;font-size:42px;white-space:nowrap;box-shadow:inset 0 5px 5px #d5ffa8,inset 0 -7px 7px #26992080,0 6px 0 #268a25,0 10px 8px #4a665055}
.reference-scene .restart svg{width:57px;height:57px;stroke-width:4}
.reference-scene .restart:before{width:41px;height:21px;left:16px;top:11px}
.reference-scene .combo{font-size:29px;top:-21px;padding:9px 25px;border-radius:29px}
.reference-scene .board-celebration{font-size:49px}
@keyframes reference-hint{50%{box-shadow:inset 0 0 0 4px #fff,0 0 22px 9px #7dff6c}}

/* Supplied artwork; only changing values remain live text. */
.reference-scene #settings{background:url('assets/settings.webp') center/100% 100% no-repeat;border:0;box-shadow:none;border-radius:0}
.reference-scene #settings svg{visibility:hidden}
.reference-scene .top-title{background:url('assets/level-panel.webp') center/100% 100% no-repeat;border:0;box-shadow:none;height:78px;top:26px}
.reference-scene .wallet{left:649px;top:26px;width:200px;height:80px;padding:0 8px 0 81px;background:url('assets/wallet-panel.webp') center/100% 100% no-repeat;border:0;box-shadow:none;border-radius:0}
.reference-scene .wallet .coin{display:none}
.reference-scene .wallet strong{font-size:38px;font-weight:900;letter-spacing:-1px}
.reference-scene .coin-plus{right:-55px;top:12px;width:54px;height:54px;font-size:0;background:url('assets/plus.webp') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;text-shadow:none}
.reference-scene .game-heading .game-sign{left:6px;top:0;width:353px;height:270px}
.reference-scene .game-sign .title-art{object-fit:fill;filter:drop-shadow(0 5px 3px #563b2525)}
.reference-scene .boosters{top:1185px;height:175px}
.reference-scene .booster{height:175px;border:0;border-radius:0;padding:0;box-shadow:none;background-position:center;background-size:100% 100%;background-repeat:no-repeat}
.reference-scene #shuffle{background-image:url('assets/shuffle.webp')}
.reference-scene #hint{background-image:url('assets/hint.webp')}
.reference-scene #undo{background-image:url('assets/undo.webp')}
.reference-scene .booster:before,.reference-scene .restart:before{display:none}
.reference-scene .booster>svg,.reference-scene .booster>span:not(.price){visibility:hidden}
.reference-scene .booster .price{left:calc(85.9% - 27px);top:calc(20.6% - 27px);right:auto;width:54px;height:54px;border:0;border-radius:0;box-shadow:none;background:none;font-size:33px;text-shadow:0 3px 2px var(--shade)}
.reference-scene #hint .price{left:calc(85.1% - 27px);top:calc(20.5% - 27px)}
.reference-scene #undo .price{left:calc(86.4% - 27px);top:calc(20.2% - 27px)}
.reference-scene .remaining{background:url('assets/remaining-panel.webp') center/100% 100% no-repeat;border:0;box-shadow:none;height:66px;top:1377px;font-weight:900}
.reference-scene .restart{background:url('assets/restart.webp') center/100% 100% no-repeat;border:0;box-shadow:none;border-radius:0;height:112px;top:1468px;color:transparent;text-shadow:none}
.reference-scene .restart svg{visibility:hidden}

/* Main menu shares the level scene's fixed dimensions and scale. */
.reference-scene.menu-scene .top-title{display:none}
.reference-scene.menu-scene #settings{left:45px;top:25px;width:107px;height:103px}
.reference-scene.menu-scene .wallet{left:619px;top:32px;width:220px;height:85px;padding-left:85px}
.reference-scene.menu-scene .wallet strong{font-size:43px;color:#111155}
.reference-scene.menu-scene .coin-plus{width:65px;height:65px;top:10px;right:-65px}
.reference-scene #menu{position:absolute;inset:0;width:941px;height:1672px;display:block;padding:0;margin:0;color:#101456}
.reference-scene #menu>.wood-sign{position:absolute;left:168px;top:80px;width:585px;height:452px;max-width:none;padding:0;margin:0}
.reference-scene #menu .title-art{width:100%;height:100%;object-fit:fill;filter:drop-shadow(0 9px 5px #60463133)}
.reference-scene #menu .main-play{position:absolute;left:187px;top:614px;width:555px;height:184px;margin:0;padding:0;display:flex;align-items:center;justify-content:center;gap:27px;border-radius:90px;border:5px solid #eefec9;background:linear-gradient(110deg,#75ee37,#2ace08 52%,#7de52b);box-shadow:inset 0 6px 3px #dfff97,inset 6px 0 7px #bcff60,inset 0 -13px 9px #008f19,0 0 0 4px #288844,0 9px 0 #057220,0 13px 10px #284d5144;text-shadow:0 5px 2px #166c24,2px 0 #318d35,-2px 0 #318d35;font-size:77px;line-height:1}
.reference-scene #menu .main-play span{font-size:77px;margin:0;font-weight:900;letter-spacing:-2px}
.reference-scene #menu .main-play svg{width:105px;height:112px;filter:drop-shadow(0 6px 3px #17693088)}
.reference-scene #menu .main-play:before{width:65px;height:19px;left:32px;top:16px;background:#fff9}
.reference-scene #menu .main-play:after{content:"";position:absolute;right:28px;top:21px;width:43px;height:19px;border-radius:50%;background:#fffc;transform:rotate(42deg)}
.reference-scene .menu-modes{position:absolute;left:127px;top:849px;width:686px;height:205px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px}
.reference-scene .menu-mode{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:18px 4px 10px;border:4px solid #fffdf3;border-radius:49px;background:linear-gradient(125deg,#fffcf1,#f0dfcb);color:#101456;box-shadow:inset 0 0 12px #fff9,0 5px 0 #c5aa91,0 8px 7px #84695344;font-size:29px;font-weight:900;line-height:1.06;letter-spacing:-1px;text-shadow:0 2px #fff}
.reference-scene .menu-mode:active{transform:scale(.97)}
.reference-scene .menu-mode>svg{width:101px;height:101px;flex-shrink:0;filter:drop-shadow(0 5px 2px #8a573b66)}
.reference-scene .menu-mode#levels>svg{width:115px}
.reference-scene .menu-mode#endless>svg{width:133px}
.reference-scene .gold-art{fill:url(#menu-gold);stroke:#d58512;stroke-width:1;stroke-linejoin:round}
.reference-scene #menu .menu-stats{position:absolute;left:159px;top:1099px;width:622px;height:211px;margin:0;padding:27px 5px 13px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:4px solid #fffdfb;border-radius:57px;background:linear-gradient(125deg,#fffdf3de,#f1e7e1c9 55%,#eaf1ffdb);box-shadow:inset 0 0 14px #fff,0 6px 4px #a28c7766;backdrop-filter:blur(3px)}
.reference-scene #menu .menu-stats>div{position:relative;border:0;display:flex;align-items:center;flex-direction:column;gap:0;text-align:center}
.reference-scene #menu .menu-stats>div+div:before{content:"";position:absolute;left:0;top:35px;width:2px;height:75px;background:#bbb7bc;box-shadow:1px 0 #fff}
.reference-scene #menu .menu-stats strong{display:block;color:#111456;font-size:40px;line-height:1.15;margin-top:4px}
.reference-scene #menu .menu-stats>div>span:last-child{font-family:"Trebuchet MS",sans-serif;color:#111456;font-size:25px;font-weight:400;line-height:1.02;margin-top:3px}
.reference-scene #menu .menu-stats svg{width:76px;height:76px;filter:drop-shadow(0 3px 2px #98704d55)}
.reference-scene #menu .menu-coin{display:grid;place-items:center;width:73px;height:76px;border-radius:50%;border:3px solid #fff094;background:linear-gradient(135deg,#ffef66,#ffab08);box-shadow:inset 0 0 0 4px #ffc630,inset 0 0 0 6px #e59c1b,0 4px 1px #c7800e}
.reference-scene #menu .menu-coin svg{width:48px;height:48px;fill:url(#menu-gold);stroke:#db9313;stroke-width:1}
.reference-scene .menu-footer{position:absolute;left:240px;top:1358px;width:465px;display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.reference-scene .menu-option{padding:0;border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:12px;font-size:23px;font-weight:800;color:#111456;text-shadow:0 1px #fff}
.reference-scene .menu-option .square{position:relative;width:111px;height:105px;border:3px solid #087ccc;border-radius:35px;background:linear-gradient(130deg,#51dfff,#1d9eff 60%,#067bea);box-shadow:inset 0 4px 3px #d3ffff,inset 0 -6px 4px #0467c6,0 4px 2px #23478c88}
.reference-scene .menu-option .square svg{width:76px;height:76px;filter:drop-shadow(0 3px 2px #1760b4)}
.reference-scene .menu-option:active .square{transform:scale(.95)}
.reference-scene .menu-option.off .square:after{content:"";position:absolute;width:66px;height:4px;top:49px;left:20px;transform:rotate(-48deg);background:#fff;border-radius:4px;box-shadow:0 1px 2px #085eb6}

/* Supplied menu artwork keeps the existing scene coordinates and hit areas. */
.reference-scene.menu-scene #settings{background-image:url('assets/menu-settings.webp')}
.reference-scene #menu .main-play{background:url('assets/menu-play.webp') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;text-shadow:none}
.reference-scene #menu .main-play:before,.reference-scene #menu .main-play:after{display:none}
.reference-scene #menu .main-play>svg,.reference-scene #menu .main-play>span{visibility:hidden}
.reference-scene .menu-mode{padding:0;border:0;border-radius:0;box-shadow:none;background-position:center;background-size:100% 100%;background-repeat:no-repeat}
.reference-scene #levels.menu-mode{background-image:url('assets/menu-levels.webp')}
.reference-scene #daily.menu-mode{background-image:url('assets/menu-daily.webp')}
.reference-scene #endless.menu-mode{background-image:url('assets/menu-endless.webp')}
.reference-scene .menu-mode>svg,.reference-scene .menu-mode>span{visibility:hidden}
.reference-scene .menu-option .square{border:0;border-radius:0;box-shadow:none;background-position:center;background-size:100% 100%;background-repeat:no-repeat}
.reference-scene #menu-sound .square{background-image:url('assets/menu-sound.webp')}
.reference-scene #menu-vibration .square{background-image:url('assets/menu-vibration.webp')}
.reference-scene #menu-info .square{background-image:url('assets/menu-info.webp')}
.reference-scene .menu-option .square svg{visibility:hidden}

.reference-scene #level-select{position:absolute;inset:0;width:941px;height:1672px;max-width:none;display:block;margin:0;padding:0}
.reference-scene #level-select>.wood-sign{position:absolute;left:220px;top:225px;width:501px;height:112px;display:grid;place-items:center;margin:0;padding:15px;border-radius:25px;border-width:5px;transform:rotate(-3deg);box-shadow:inset 0 4px 5px #f5cca4aa,inset -5px -7px 8px #70452d55,0 9px 0 #80583ec9,0 15px 18px #47564c33}
.reference-scene #level-select h2{font-size:43px;line-height:1.1}
.reference-scene #level-select .level-panel{position:absolute;left:71px;top:390px;width:796px;height:1080px;padding:38px;border:4px solid #fffef9;border-radius:65px;box-shadow:inset 0 0 19px 6px #fff,0 8px 0 #c7b7aa99,0 14px 15px #70645744}
.reference-scene #level-select .level-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,200px);gap:18px}
.reference-scene #level-select .level-tile{min-width:0;min-height:0;padding:12px 3px;border-width:3px;border-radius:28px;font-size:49px;line-height:1.1;box-shadow:inset 0 3px #fff,0 6px #c5b9ac}
.reference-scene #level-select .level-tile.current{box-shadow:inset 0 3px #e3ffb7,0 6px #5aa838}
.reference-scene #level-select .level-tile small{font-size:28px;line-height:1.2;margin-top:9px;letter-spacing:1px}
.reference-scene #level-select .level-tile:disabled{font-size:49px}
.reference-scene #level-select .pagination{height:85px;margin-top:25px;font-size:34px}
.reference-scene #level-select .pagination .square{width:80px;height:80px;border-radius:25px;font-size:60px;border-width:3px}
.reference-scene #level-select .back-button{position:absolute;left:230px;top:1510px;width:481px;height:108px;min-width:0;margin:0;padding:0;border-radius:52px;font-size:39px;box-shadow:inset 0 5px 5px #d5ffa8,inset 0 -7px 7px #26992080,0 6px 0 #268a25,0 10px 8px #4a665055}

.reference-scene.levels-scene .top-title{background-image:url('assets/levels-heading.webp');font-size:0}
.reference-scene #level-select>.wood-sign{left:180px;top:183px;width:581px;height:190px;padding:0;border:0;border-radius:0;transform:none;box-shadow:none;background:url('assets/levels-sign.webp') center/100% 100% no-repeat}
.reference-scene #level-select>.wood-sign:before,.reference-scene #level-select>.wood-sign:after{display:none}
.reference-scene #level-select>.wood-sign h2{visibility:hidden}
.reference-scene #level-select .level-tile{position:relative;padding:0;border:0;border-radius:0;box-shadow:none;background:url('assets/level-stars-0.webp') center/contain no-repeat;opacity:1;filter:none;text-shadow:none}
.reference-scene #level-select .level-tile[data-stars="1"]{background-image:url('assets/level-stars-1.webp')}
.reference-scene #level-select .level-tile[data-stars="2"]{background-image:url('assets/level-stars-2.webp')}
.reference-scene #level-select .level-tile[data-stars="3"]{background-image:url('assets/level-stars-3.webp')}
.reference-scene #level-select .level-tile.current{background-image:url('assets/level-current.webp');box-shadow:none}
.reference-scene #level-select .level-tile:disabled{background-image:url('assets/level-locked.webp');opacity:1;filter:none}
.reference-scene #level-select .level-number{position:absolute;left:8%;top:21%;width:84%;height:42%;display:grid;place-items:center;font-size:53px;line-height:1;font-weight:900;color:#574774;letter-spacing:-2px}
.reference-scene #level-select .level-tile.current .level-number{color:#fffdf3;text-shadow:0 3px 2px #318421}
.reference-scene #level-select .level-tile:active:not(:disabled){transform:scale(.96)}
.reference-scene #level-select .pagination .square{border:0;border-radius:0;box-shadow:none;font-size:0;text-shadow:none;background-position:center;background-size:100% 100%;background-repeat:no-repeat}
.reference-scene #page-prev{background-image:url('assets/levels-prev.webp')}
.reference-scene #page-next{background-image:url('assets/levels-next.webp')}
.reference-scene #level-select .back-button{background:url('assets/levels-home.webp') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;color:transparent;text-shadow:none}
.reference-scene #level-select .back-button:before{display:none}
.reference-scene.levels-scene .wallet{left:649px;top:26px;width:255px;height:80px;padding:0 72px 0 77px;background-image:url('assets/levels-wallet.webp')}
.reference-scene.levels-scene .coin-plus{right:0;top:10px;width:61px;height:61px;background:none;border:0;box-shadow:none}

.reference-scene #menu .menu-stats{height:236px;padding:23px 5px 20px}
.reference-scene #menu .menu-stats>div{min-width:0}
.reference-scene #menu .menu-stats>div>span:last-child{line-height:1.13;margin-top:5px}
.reference-scene #menu .menu-stats>div>svg,.reference-scene #menu .menu-coin{flex-shrink:0}
.modal[aria-busy="true"] .modal-buttons{opacity:.55;pointer-events:none}

html,body{overscroll-behavior:none;-webkit-user-select:none;-webkit-touch-callout:none}
img,svg{-webkit-user-drag:none}
body.booting .app{visibility:hidden}
.boot-loader{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:24px;text-align:center;background:linear-gradient(#c2eaff,#f4f9e8);color:#494276;font-size:22px;font-weight:900}
.boot-loader progress{width:min(280px,80vw);height:18px;accent-color:#49bc24}
.boot-loader p{font-size:16px;max-width:340px}
body:not(.booting) .boot-loader{display:none}
body.platform-paused .app{pointer-events:none}
body.platform-paused *,body.platform-paused *:before,body.platform-paused *:after{animation-play-state:paused!important}
.modal-card{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
