:root{color-scheme:light;font:16px/1.35 system-ui,sans-serif;color:#243b46;background:#edf5ee}*{box-sizing:border-box}body{margin:0}main{max-width:920px;margin:auto;padding:clamp(8px,2vw,20px)}header{display:flex;align-items:center;justify-content:space-between;gap:8px}h1{font-size:clamp(1.35rem,4vw,2.1rem);margin:3px 0 8px}button,select{font:inherit;font-weight:650;color:inherit;background:#fffdf6;border:1px solid #79909a;border-radius:12px;min-height:44px;padding:8px 12px;cursor:pointer}button:disabled{opacity:.55;cursor:default}button:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #126291;outline-offset:3px}button[aria-pressed=true]{background:#e5f4bc;box-shadow:inset 0 0 0 2px #4c7953}button.primary{background:#d9efbd;border-color:#48734e}.tools,.controls{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:6px 0}.tools label{font-size:.85rem;font-weight:700}.controls button{flex:1 1 90px}.status{margin:6px 0;min-height:2.6em;background:#fffdf6;padding:8px 12px;border-radius:12px;border:1px solid #b2c4ba;font-weight:650}.scene{position:relative;overflow:hidden;border:2px solid #709c89;border-radius:20px;box-shadow:0 4px 0 #c6d9cd;background:#cbe9ef;isolation:isolate}.scene svg{display:block;width:100%;height:auto}.layer{position:absolute;inset:0}.bubble{position:absolute;border-radius:50%;min-width:44px;min-height:44px;padding:0;transform:translate(-50%,-50%);border:2px solid #fff;box-shadow:inset 0 0 0 4px #ffffff65,0 4px 12px #29456b40;background:radial-gradient(circle at 27% 23%,white 0 7%,#fff9 9%,transparent 23%),radial-gradient(circle at 65% 78%,#fdf7a9a0,transparent 52%),linear-gradient(145deg,#fff8,var(--bubble) 70%);font-size:clamp(16px,4vw,27px);color:#25445a;touch-action:manipulation}.bubble.pop{opacity:0;scale:1.35;transition:opacity .15s,scale .15s}.bubble:focus-visible{outline-offset:1px}.track-grid{position:absolute;inset:8% 7% 9%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:4px}.track-grid button{min-width:0;min-height:44px;padding:0;border:1px dashed #aa9b79;background:#fff5d950;border-radius:9px;position:relative}.track-grid button svg{width:100%;height:100%;max-height:100%;pointer-events:none}.track-grid button[data-kind="start"],.track-grid button[data-kind="goal"]{border:2px solid #5a8352;background:#ecf3cf}.track-grid button[data-kind="rock"]{background:#8c827566;border-color:#8c8275}.track-grid button.hint{box-shadow:inset 0 0 0 3px #f1a82b}.marble{position:absolute;z-index:3;pointer-events:none;width:24px;height:24px;border-radius:50%;background:radial-gradient(circle at 28% 24%,white,#fbd65a 28%,#da7c28 70%);border:2px solid #aa5c24;box-shadow:0 3px 5px #0005;transform:translate(-50%,-50%)}.result{margin-top:8px;border:1px solid #b4c6a9;border-radius:15px;padding:10px;background:#fffdf6}.result .controls button{flex:1 1 100px}.progress{font-size:.85rem;font-weight:700;margin:5px 0}.progress progress{accent-color:#578952;width:min(60%,350px);vertical-align:middle}details{margin-top:8px}summary{min-height:44px;padding:10px 0;cursor:pointer;font-weight:700}details p{font-size:.9rem;max-width:70ch}.sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}[hidden]{display:none!important}.dig-controls button{flex:1 1 60px}.dig-controls .primary{flex:2 1 100px}.palette{display:flex;gap:5px;flex-wrap:wrap}.palette button{min-width:48px;padding:5px 9px}.palette button svg{width:34px;height:30px;vertical-align:middle}.scene svg .machine{transition:transform .26s ease}.scene svg .load{transition:opacity .2s}.scene .pop:focus{outline:none}@media(max-width:480px){main{padding:7px}.tools button,.tools select{font-size:.86rem;padding:6px 9px}.status{font-size:.88rem}.track-grid{inset:5% 4% 5%;gap:3px}.track-grid button{min-height:44px}.controls button{font-size:.88rem;padding:7px}.scene{border-radius:14px}}@media(max-height:500px) and (min-width:600px){main{max-width:650px}.scene{max-width:520px;margin:auto}h1{font-size:1.3rem}.status{min-height:0}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.bubble-sample{display:inline-flex;aspect-ratio:1;border:2px solid #fff;box-shadow:0 0 0 1px #658b96;border-radius:50%;background:var(--bubble);align-items:center;justify-content:center;vertical-align:middle;margin-right:9px;color:#234458}.bubble.rise{animation:gentle-rise 1.4s ease-out both}.bubble-burst{position:absolute;width:44px;height:44px;border:3px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;animation:burst .4s ease-out both;z-index:3}.bubble-burst:before,.bubble-burst:after{content:"";position:absolute;inset:5px;border:2px dashed #effff7;border-radius:50%}.bubble-burst:after{inset:-10px;border-color:#fff8}@keyframes gentle-rise{from{transform:translate(-50%,-35%);opacity:.72}to{transform:translate(-50%,-50%);opacity:1}}@keyframes burst{to{transform:translate(-50%,-50%) scale(1.7);opacity:0}}@media(prefers-reduced-motion:reduce){.bubble-burst{display:none}}

/* 4.3: larger construction puzzles, legible stations and ordered deliveries. */
.track-grid{grid-template-columns:repeat(var(--track-size,4),minmax(0,1fr));grid-template-rows:repeat(var(--track-size,4),minmax(0,1fr))}.large-track{min-height:290px;background:#fcf0d7}.large-track>svg{position:absolute;height:100%;width:100%;object-fit:fill}.track-grid button.trace{border:3px solid #33778c;background:#d7eff2}.track-grid button.visited{border-color:#397745;background:#e6f4cf}.track-grid button.station{outline:2px solid #a47721;outline-offset:-3px}.track-star{position:absolute;right:2px;top:2px;font-size:clamp(15px,3vw,25px);line-height:1;color:#83560a;background:#fff2b0;border-radius:50%;padding:2px;pointer-events:none}.visited .track-star{color:#315b32;background:#b8e4a5}.track-grid button.hint{outline:3px solid #b96808;outline-offset:-3px}.station-controls{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.station-controls button{flex:1 1 88px;padding:6px;font-size:.86rem}.delivery-plan{display:flex;flex-wrap:wrap;gap:5px;margin:4px 0 8px}.plan-label{font-size:.86rem;font-weight:700;margin:4px 0}.plan-label:empty{display:none}.material-chip{display:inline-flex;align-items:center;justify-content:center;min-width:34px;min-height:34px;border:2px solid #9a6b40;border-radius:9px;background:#f5d8a4;color:#744716;font-size:1.25rem;font-weight:800}.material-chip[data-material="1"]{background:#d7e4ed;color:#335a77;border-color:#58758b}.material-chip.next{outline:3px solid #287794;outline-offset:1px}.material-chip.delivered{background:#d9efbd;color:#315b32;border-color:#48734e}.large-track .track-grid button{min-height:44px}.large-track .track-grid button svg{max-height:100%}@media(max-width:480px){.large-track{min-height:270px}.large-track .track-grid{inset:5% 4%;gap:3px}.station-controls button{font-size:.78rem}}

/* The target must not shrink when it appears; cancel local effects immediately when disabled. */
html.kpg-rewards-still .bubble.rise{animation:none!important}html.kpg-rewards-still .bubble-burst{display:none!important}@media(prefers-reduced-motion:reduce){.bubble.rise{animation:none!important}}
