/* V3: the board is the stage; illustration and copy live in the home dialog. */
:root{--cell:clamp(34px,calc((100svh - 500px)/10),64px)}
.page-shell{padding:0 24px}.topbar{height:64px;max-width:1060px;margin:auto}.brand{font-size:30px}.brand img{width:38px;height:38px}.topbar-note{font-size:8px;background:#fff8ecc9}.game-layout{display:block;width:auto;max-width:none;margin:9px auto 14px}.play-area{width:min(calc(var(--cell)*6 + 34px),calc(100vw - 28px));margin:auto}.intro,.side-notes,.page-footer{display:none}.art-world-ready .world-scenery{background-image:linear-gradient(#fff8ec66,#fff8ec25),url('assets/sweet-world-v2.png')}.world-scenery{background-position:center bottom}.scoreboard{gap:9px;margin-bottom:10px}.scoreboard>div{padding:4px 5px 5px;border-radius:15px}.scoreboard strong{font-size:24px;line-height:1.05}.stat-label{font-size:8px}.low-moves .scoreboard>div:last-child{background:#ffe4cd;border-color:#ffe7ad}.low-moves #placed{color:#b74d57}.mission-panel{padding:0 12px 8px;border-radius:18px}.mission-top{display:grid;grid-template-columns:1fr auto auto;gap:12px}.mission-top button{font-size:11px;min-height:44px}.mission-top .next-block{height:38px;gap:4px;padding:0 3px 0 6px;box-shadow:none;background:#ffffff80;align-self:center;border-width:1px}.queue-label{font-size:7px;letter-spacing:0}.mini-piece{height:38px}.mission-target{display:flex;align-items:center;gap:9px}.mission-panel .goal-candy{position:relative;flex-shrink:0;width:28px;height:28px;right:auto;bottom:auto;transform:none;font-size:17px;border-radius:25%;z-index:0}.mission-panel .goal-candy.big-number{font-size:13px}.mission-target>strong{font-size:13px;font-weight:900;line-height:1.15}.mission-bottom{margin-top:5px}.mission-meter{height:8px}.piece-strip{height:19px;margin:5px 5px 2px}.tempo{font-size:8px}.tempo-dot{width:6px;height:6px}.touch-guide{display:none}.jar-wrap{padding-top:23px}.jar-lid{height:28px}.jar{padding:10px 13px 11px;border-radius:28px 28px 35px 35px}.jar-lid span{font-size:8px}.board{background:#a0cbd144}.grid-cells>div{background:#effaf647;box-shadow:inset 0 2px 2px #568d9d18,inset 0 -1px #fff7}.game-status{height:22px;font-size:10px;margin:5px 0 5px}.piece-controls{gap:9px}.piece-controls button{height:48px;border-radius:15px}.piece-controls button>small{font-size:10px}.power-controls{gap:10px;margin-top:10px}.power-button{min-height:55px;padding:7px 11px;gap:8px}.power-button strong{font-size:12px}.power-button small{font-size:10px}.power-art{width:34px;height:34px}.power-stock{position:static;min-width:21px;height:24px;font-size:14px}.power-hint{font-size:9px;margin:7px 0 0;min-height:12px}.confirm-actions{min-height:55px;margin-top:10px}.board-overlay{background:#f2fbf0b5;padding:22px}.board-overlay>div{max-width:280px;padding:17px 19px 19px}.board-overlay h2{font-size:34px}.board-overlay p{font-size:12px}.board-overlay .overlay-strategy{font-size:10px;font-weight:800;line-height:1.5;color:#aa7d62;background:#fff6da;border-radius:11px;padding:8px;margin:0 0 12px}.pause-art{width:96px;height:96px;margin-top:-44px}.board-overlay .primary-button{font-size:17px}.rescue-overlay{padding:8px}.rescue-overlay>div{padding:12px}.rescue-overlay h2{font-size:23px}.rescue-overlay .overlay-strategy{display:none}.preview-badge{top:8px}.brand{cursor:pointer}.busy .brand{opacity:.65}

/* Authored SVG materials share the same square cell and upper-left light. */
.candy-label{position:relative;z-index:1;line-height:1;pointer-events:none}.candy-skin{position:absolute;inset:0;width:100%;height:100%;color:var(--candy);pointer-events:none;filter:drop-shadow(0 2px 1px #5830472c)}
:is(.tile,.little-candy,.goal-candy,.mini-tile):not(.shape-cube){background:transparent!important;box-shadow:none!important}
.tile{font-size:clamp(22px,calc(var(--cell)*.50),33px);transition:top .20s ease-out,left .14s ease-out,opacity .15s}.tile.big-number{font-size:calc(var(--cell)*.32)}.tile.huge-number{font-size:calc(var(--cell)*.25)}.shape-heart .candy-label{transform:translateY(-2%)}.shape-flower .candy-label{transform:translateY(1%)}.sugar-candy::after{content:'';position:absolute;width:5px;height:5px;border-radius:50%;top:13%;right:13%;background:#fff9;box-shadow:-6px 1px #ffffff70;pointer-events:none}.mini-tile.sugar-candy::after{display:none}.tile.falling-tile{outline:2px solid #543655;outline-offset:1px;border-radius:26%;box-shadow:0 3px 4px #59395030!important}.tile.landing-tile{background:transparent!important;color:#486c7d;border:2px dashed #618597;box-shadow:none!important;font-size:calc(var(--cell)*.38)}.landing-tile .candy-skin{opacity:.10;filter:none}.tile.landing-tile::after{display:none}.mini-tile{font-size:9px;isolation:isolate}.little-candy{position:relative}.tile.fusing{z-index:9;opacity:.45;transition:transform .18s cubic-bezier(.5,0,.9,.6),opacity .18s!important}.tile.fusing.consumed{opacity:0}.tile.merge-target{filter:brightness(1.16);transform:scale(.96);transition:transform .16s}.tile.merged{animation:candy-birth .19s ease-out}.tile.preview-merge{filter:drop-shadow(0 0 5px #fff6a2) brightness(1.12)}.tile.preview-merge::after{content:'✦';background:none;width:auto;height:auto;top:-5px;right:-3px;font-size:13px;color:#f0a444;text-shadow:0 1px #fff;box-shadow:none}.cascade-readout{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:10;pointer-events:none;font-size:9px;letter-spacing:1px;font-weight:900;background:#fff4cf;color:#986444;border:2px solid #fff9e6;border-radius:20px;padding:5px 10px;white-space:nowrap;box-shadow:0 2px 0 #ba907b32}.combo-burst{font-size:35px;text-shadow:2px 2px #b24368,-1px -1px #b24368,0 4px 0 #ad456830}.cell-pulse{border-width:3px}.merge-pulse::before{font-size:19px}.merge-pulse::after{font-size:16px}.particle{box-shadow:inset 0 2px #fff8}.bomb-pulse{box-shadow:0 0 20px #f68896;width:50%}.score-flight{position:fixed;z-index:1;font:19px var(--display);color:#c5486f;text-shadow:0 2px #fff,1px 0 #fff,-1px 0 #fff;pointer-events:none}#ui-effects{position:fixed;inset:0;z-index:25;pointer-events:none;overflow:hidden}.earned-star,.empty-star{display:inline-block;margin:0 4px}.earned-star{animation:earned-star .5s ease-out both;animation-delay:var(--delay)}.world-reward{padding:11px 14px;margin:17px 0;background:#e8f3d6;border:2px solid #fff;border-radius:15px;color:#5b8050;font-weight:900;font-size:12px}.win-art{width:145px;height:145px}.win-stars{font-size:29px}
@keyframes candy-birth{0%{transform:scale(.75,.88);filter:brightness(1.4)}60%{transform:scale(1.13,1.07);filter:brightness(1.05)}100%{transform:scale(1);filter:none}}@keyframes earned-star{0%{opacity:0;transform:translateY(12px) scale(.3) rotate(-30deg)}65%{opacity:1;transform:translateY(-3px) scale(1.2) rotate(8deg)}100%{opacity:1;transform:none}}

/* The home is separate from the playable screen. */
.welcome-dialog{max-width:520px;padding:32px}.welcome-dialog .intro{display:block;max-width:none;padding:0}.welcome-dialog .intro::before{display:none}.welcome-dialog h1{font-size:48px;margin-top:22px;letter-spacing:-1px}.welcome-dialog .intro-copy{font-size:13px}.welcome-dialog .candy-trail{margin:22px 0}.welcome-dialog .quick-guide{gap:10px}.welcome-dialog .keyboard-note{margin:10px 0 15px}.welcome-dialog .primary-button{width:100%}.home-art{float:right;width:115px;height:115px;margin:17px -12px 0 0}.welcome-dialog .intro>.eyebrow{font-size:8px;transform:none}.welcome-dialog .slow-note{margin-top:18px}

/* A continuous recipe trail through three confectionery worlds. */
.levels-dialog{max-width:550px;padding:24px 24px 18px}.levels-dialog .map-art{width:65px;height:65px;margin:0 0 -5px}.levels-dialog .dialog-close{position:sticky;top:0;float:right;margin:-7px -7px 0 0;z-index:4}.levels-dialog .primary-button{position:sticky;bottom:0;z-index:3;box-shadow:0 4px 0 #ad294f,0 -8px 18px #fff4e1c9}.level-map{display:block;margin:12px 0 18px;padding:0}.map-world{position:relative;isolation:isolate;display:grid;grid-template-columns:1fr 1fr;gap:19px 18px;margin:15px 0 23px;padding:15px 13px 19px;border:2px solid #fff;border-radius:26px;background:linear-gradient(150deg,#fff3dd,#ffe4d4);box-shadow:0 4px 0 #dfc4b132;overflow:hidden}.map-world:nth-child(2){background:linear-gradient(150deg,#eff9e6,#d5eddf)}.map-world:nth-child(3){background:linear-gradient(150deg,#fff3ce,#f9dfcf)}.world-heading{grid-column:1/-1;display:flex;align-items:center;gap:10px;min-height:36px;z-index:1}.world-heading svg{width:31px;height:31px;fill:none;stroke:#bb6582;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.map-world:nth-child(2) .world-heading svg{stroke:#699f78}.map-world:nth-child(3) .world-heading svg{stroke:#c59646}.world-heading strong{font:20px/1.1 var(--display);display:block}.world-heading small{font-size:9px;line-height:1.4;color:#937078;display:block;margin-top:3px}.route-line{position:absolute;top:58px;bottom:22px;left:0;width:100%;height:calc(100% - 80px);z-index:-1;pointer-events:none;overflow:visible}.route-line path{fill:none;stroke-linecap:round;vector-effect:non-scaling-stroke}.route-border{stroke:#dcbb9f;stroke-width:13px}.route-road{stroke:#fff9ec;stroke-width:10px}.route-dots{stroke:#dbb799;stroke-width:2px;stroke-dasharray:1 8}.map-world .level-stop{min-height:88px;transform:none;padding:10px 9px 21px;gap:7px;grid-template-columns:38px 1fr;z-index:1}.route-left{grid-column:1}.route-right{grid-column:2}.map-world .level-number{width:36px;height:36px;font-size:23px}.map-world .level-stop strong{font-size:12px}.map-world .level-stop small{font-size:9px}.map-world .map-stars{left:54px;bottom:5px;font-size:12px;letter-spacing:1px}.map-world .level-stop:disabled{opacity:.77;filter:saturate(.25)}.map-world .level-stop.current{border-color:#fff;box-shadow:0 4px 0 #bd7694,0 0 0 2px #ef88a7}.stars-guide{margin-top:6px}.map-world.locked .world-heading{opacity:.6}

@media(max-width:900px){
 :root{--cell:clamp(30px,calc((100svh - 460px)/10),62px)}.page-shell{padding:env(safe-area-inset-top,0px) max(12px,env(safe-area-inset-right,0px)) max(5px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}.topbar{height:56px;max-width:440px;gap:7px}.brand{font-size:25px;gap:4px}.brand img{width:30px;height:30px}.utilities{gap:4px}.game-layout{margin:7px auto 0}.play-area{width:min(calc(var(--cell)*6 + 34px),100%)}.scoreboard{gap:7px;margin-bottom:8px}.scoreboard>div{padding:3px 3px 4px}.scoreboard strong{font-size:23px}.mission-panel{padding:0 10px 6px}.mission-top{gap:8px}.mission-top button{font-size:10px}.mission-top .next-block{height:36px;padding-left:5px;gap:3px}.mission-target{gap:7px}.mission-panel .goal-candy{width:24px;height:24px;font-size:15px}.mission-target>strong{font-size:12px}.mission-bottom{margin-top:4px}.piece-strip{height:15px;margin:4px 3px 2px}.tempo{font-size:7px}.touch-guide{display:none}.jar-wrap{padding-top:22px}.jar{padding:9px 12px 10px}.jar-lid{height:26px}.jar-lid span{font-size:7px}.game-status{height:21px;margin:4px 0;font-size:9px}.piece-controls{gap:8px}.piece-controls button{height:46px}.power-controls{gap:9px;margin-top:9px}.power-button{min-height:55px;gap:6px;padding:7px 8px}.power-art{width:31px;height:31px}.power-button strong{font-size:11px}.power-button small{font-size:9px}.power-stock{min-width:18px;font-size:13px}.power-hint{font-size:8px;margin-top:6px}.confirm-actions{margin-top:9px;min-height:55px}.board-overlay{padding:16px}.board-overlay>div{max-width:250px;padding:15px 15px 17px}.pause-art{width:83px;height:83px;margin-top:-36px}.board-overlay h2{font-size:29px;margin:8px 0 10px}.board-overlay p{font-size:11px;margin-bottom:12px}.board-overlay .primary-button{font-size:16px}.board-overlay .overlay-strategy{font-size:10px;padding:7px}.tile{font-size:clamp(21px,calc(var(--cell)*.49),30px)}.tile.big-number{font-size:calc(var(--cell)*.33)}.combo-burst{font-size:30px}.levels-dialog{padding:22px 17px 18px}.map-world{padding:14px 9px 18px;gap:18px 13px}.map-world .level-stop{grid-template-columns:30px 1fr;padding:9px 6px 20px;gap:5px;min-height:87px}.map-world .level-number{width:30px;height:30px;font-size:20px}.map-world .level-stop strong{font-size:11px}.map-world .level-stop small{font-size:9px}.map-world .map-stars{left:41px;font-size:11px}.world-heading strong{font-size:18px}.welcome-dialog{padding:27px 22px}.welcome-dialog h1{font-size:43px}.home-art{width:90px;height:90px;margin-top:17px}.welcome-dialog .intro>.eyebrow{font-size:7px}.welcome-dialog .intro-copy{font-size:12px}
}
@media(max-width:370px){.topbar{gap:4px}.brand{font-size:21px}.brand img{display:none}.utilities{gap:3px}.mission-top{gap:6px}.mission-top button{font-size:9px}.mission-target>strong{font-size:11px}.mission-top .queue-label{display:none}.power-art{width:26px;height:26px}.power-button{gap:4px;padding:7px 5px}.power-button strong{font-size:9px}.power-button small{font-size:8px}.power-stock{position:static;height:20px;min-width:15px;font-size:11px}.map-world .level-stop{grid-template-columns:27px 1fr;gap:4px}.map-world .level-number{width:26px;height:26px;font-size:18px}.map-world .level-stop strong{font-size:10px}.map-world .level-stop small{font-size:8px}.map-world .map-stars{left:36px;font-size:10px}.home-art{width:80px;height:80px}.welcome-dialog h1{font-size:37px}.board-overlay h2{font-size:26px}.board-overlay .overlay-strategy{font-size:9px}.pause-art{width:70px;height:70px}}
@media(max-width:1000px) and (orientation:landscape) and (max-height:550px){.topbar{height:52px;max-width:720px}.game-layout{margin:5px auto 8px;width:100%;max-width:720px}.play-area{width:100%;display:grid;grid-template-columns:calc((100svh - 116px)*.6 + 30px) minmax(235px,1fr);gap:4px 20px;align-items:start}.play-area>*{grid-column:2;margin-top:0;margin-bottom:0}.play-area>.jar-wrap{grid-column:1;grid-row:1/9;padding-top:22px}.scoreboard strong{font-size:22px}.mission-panel{padding-bottom:6px}.piece-strip{height:19px}.game-status{height:23px}.piece-controls button{height:44px}.power-button{min-height:53px}.power-hint{display:none}.jar{padding:9px 12px}.pause-art{width:55px;height:55px;margin-top:-24px}.board-overlay{padding:8px}.board-overlay>div{padding:12px 9px}.board-overlay h2{font-size:23px}.board-overlay p{font-size:10px}.board-overlay .overlay-strategy{display:none}.board-overlay .primary-button{font-size:13px}.tile{font-size:21px}}
@media(prefers-reduced-motion:reduce){.tile.fusing{transform:none!important}.score-flight,.cell-pulse,.particle{display:none}.earned-star{opacity:1;transform:none}.tile.merged,.tile.landed{transform:none;filter:none}}

@media(max-width:900px) and (max-height:700px) and (orientation:portrait){.board-overlay .overlay-strategy{display:none}.board-overlay h2{font-size:24px}.board-overlay>div{padding:12px 11px 14px}.pause-art{width:60px;height:60px;margin-top:-24px}}

body[data-world='2'] .jar-lid{background:repeating-linear-gradient(90deg,#a0d7bd 0 5px,#bde8cf 5px 10px);box-shadow:inset 0 3px #e8fff0,0 3px 0 #71a790}body[data-world='3'] .jar-lid{background:repeating-linear-gradient(90deg,#edc678 0 5px,#f6dfa0 5px 10px);box-shadow:inset 0 3px #fff3cd,0 3px 0 #bd9358}

/* The trail is the campaign entrance; compound pieces are its visual signature. */
.pieces-showcase{display:flex;justify-content:center;align-items:center;gap:12px;margin:18px 0;isolation:isolate}
.pieces-showcase svg{width:92px;height:64px;overflow:visible;filter:drop-shadow(0 3px 0 #cfa79655)}
.pieces-showcase rect{rx:6;stroke:#ffffff99;stroke-width:2}
.pieces-showcase text{font:19px var(--display);text-anchor:middle;fill:#62334b;pointer-events:none}
.piece-demo-frame{fill:none;stroke:#fff9e9;stroke-width:34;stroke-linecap:round;stroke-linejoin:round}
.demo-v2 rect{fill:#ef8eae}.demo-v4 rect{fill:#f5ca69}.demo-v8 rect{fill:#a7d6b5}.demo-v16 rect{fill:#c9b2e9}
.map-piece-intro{display:flex;align-items:center;gap:12px;padding:8px 10px;background:#fff0d8;border:2px solid #fff;border-radius:20px;margin:12px 0}
.map-piece-intro .pieces-showcase{gap:3px;margin:0;flex:0 0 auto}.map-piece-intro .pieces-showcase svg{width:53px;height:40px}
.map-piece-intro p{font-size:10px;line-height:1.55;margin:0}.map-piece-intro strong{font-size:12px;color:#783e58}
.levels-dialog h2{font-size:34px;line-height:1.05;margin:13px 0}.levels-dialog #levels-summary{font-size:11px;line-height:1.5;margin:13px 0}
.map-featured{background:linear-gradient(130deg,#fce4ee,#fff4e4);border:2px solid #fff;border-radius:22px;padding:14px 16px;box-shadow:0 4px 0 #e3c1c633;margin:16px 0 23px}
.map-featured>.eyebrow{display:block;font-size:8px;letter-spacing:1px}.map-featured>strong{display:block;font:19px/1.2 var(--display);margin-top:5px}.map-featured>p{font-size:11px;margin:6px 0 12px}
.levels-dialog .map-featured .primary-button{position:static;min-height:46px;margin:0;font-size:16px;box-shadow:0 4px 0 #ad294f}
.map-world .level-stop{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;justify-self:center;gap:7px;width:100%;max-width:178px;min-height:144px;padding:7px 4px;background:transparent!important;border:0;box-shadow:none!important;transform:none;text-align:center}
.map-world .level-stop:enabled:hover{transform:translateY(-2px)}.map-world .level-stop:focus-visible{outline:3px solid #ad294f;outline-offset:4px;border-radius:18px}
.map-world .level-number{display:grid;place-items:center;flex-shrink:0;width:64px;height:64px;font-size:34px;background:#f6a5c0!important;background-image:none!important;color:#893652;border:4px solid #fff7ee;border-radius:50%;transform:none;box-shadow:inset 0 4px #ffffff77,inset 0 -6px #d76e963d,0 5px 0 #c77593,0 8px 12px #83535426}
.map-world .completed .level-number{background:#a5d8bd!important;color:#356d56;box-shadow:inset 0 4px #ffffff77,inset 0 -6px #639f7538,0 5px 0 #79ad89,0 8px 12px #547d5e26}
.map-world .current .level-number{outline:3px solid #e76f9b;outline-offset:5px}.map-world .level-stop:disabled .level-number{background:#d8d6cc!important;color:#8c8981;box-shadow:inset 0 4px #ffffff55,inset 0 -6px #999b9820,0 5px 0 #bcb7ad}
.map-world .map-stars{position:static;display:block;min-height:17px;color:#b97b27;font-size:16px;line-height:1;letter-spacing:2px;margin-top:3px}
.map-world .level-stop:disabled .map-stars{font-size:9px;letter-spacing:0;color:#8a7c7d}.map-world .level-stop-copy{display:block;max-width:155px;padding:4px 6px;border-radius:12px;background:#fff9ecc7}.map-world .level-stop strong{font:13px/1.15 var(--display);display:block}.map-world .level-stop small{display:block;font-size:9px;line-height:1.35;margin-top:3px}
@media(max-width:900px){.map-piece-intro{gap:8px;padding:8px}.map-piece-intro .pieces-showcase svg{width:43px;height:34px}.map-piece-intro strong{font-size:11px}.map-piece-intro p{font-size:9px}.levels-dialog h2{font-size:30px}.map-featured{padding:12px;margin-bottom:20px}.map-featured>strong{font-size:17px}.map-world .level-number{width:58px;height:58px;font-size:30px}.map-world .level-stop{min-height:136px}.map-world .level-stop strong{font-size:12px}}
@media(max-width:370px){.map-piece-intro{display:block;text-align:center}.map-piece-intro .pieces-showcase{margin:0 0 6px}.map-piece-intro .pieces-showcase svg{width:52px;height:37px}.map-piece-intro strong{font-size:12px}.map-piece-intro p{font-size:10px}.map-world .level-stop strong{font-size:11px}.map-world .level-number{width:54px;height:54px;font-size:29px}.pieces-showcase{gap:5px}.pieces-showcase svg{width:76px;height:54px}}
@media(prefers-reduced-motion:reduce){.map-world .level-stop:enabled:hover{transform:none}}
