:root{--paper:#f5f1e7;--ink:#263e3d;--muted:#87918a;--water:#438e90;--water-soft:#72b5b5;--pink:#de8291;--line:#d7dcd0;--hud:rgba(245,241,231,.94)}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--paper);color:var(--ink);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;overscroll-behavior:none}button,input{font:inherit}button{border:0;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,input:focus-visible{outline:3px solid var(--water);outline-offset:5px}button:disabled{cursor:default;opacity:.35}[hidden]{display:none!important}#game{position:relative;width:100%;height:100%;isolation:isolate}#garden{display:block;width:100%;height:100%;touch-action:none;user-select:none;cursor:crosshair}.vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 110px 30px rgba(245,241,231,.25)}.hud{position:absolute;z-index:3;user-select:none}.top-left{top:max(27px,env(safe-area-inset-top));left:max(27px,env(safe-area-inset-left));display:flex;gap:13px;align-items:center}.garden-heading{font-size:16px;font-weight:650;letter-spacing:-.3px}.week-line{display:flex;align-items:center;gap:9px;font-size:10px;color:#8a958b;font-weight:500;margin-top:4px;letter-spacing:.5px}.week-track{display:block;height:2px;width:40px;background:#d9dfd2}.week-track i{display:block;height:100%;width:0;background:#7e9a8c}.top-center{top:27px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center}.score-label{font-size:10px;color:#91a093;letter-spacing:1px}.top-center strong{font:400 38px/1.15 Georgia,serif;font-variant-numeric:tabular-nums;letter-spacing:-1px;margin:3px 0}.flower-count{font-size:10px;color:#7f9386}.top-right{top:max(29px,env(safe-area-inset-top));right:max(28px,env(safe-area-inset-right));display:flex;gap:20px;align-items:center}.weather-indicator{display:flex;gap:6px;align-items:center;font-size:11px;color:#8a978b}.weather-indicator span:first-child{font-size:24px;color:#bbab78}.weather-indicator.drought{color:#bf7d51}.time-controls{display:flex;gap:5px;align-items:center}.time-button{width:37px;height:37px;border-radius:50%;background:transparent;color:#8e9b91;font-size:13px;font-weight:600}.time-button:hover{background:#e8eadd}.time-button.selected{background:var(--ink);color:#f5f1e7}.time-button svg{width:15px;height:15px;display:block;margin:auto}.icon-button{height:44px;width:44px;display:flex;align-items:center;justify-content:center;background:transparent;border-radius:50%;font-size:24px;line-height:1;color:var(--ink)}.icon-button:hover{background:#e8eadd}.icon-button svg{height:23px;width:23px;stroke-width:1.7}.icon-button.small{width:38px;height:38px;font-size:22px}.icon-button.small svg{height:20px;width:20px}.pause-label{position:absolute;top:118px;left:50%;transform:translateX(-50%);text-align:center;font-size:11px;letter-spacing:2px;color:#84958a;pointer-events:none;z-index:2}.pause-label span{display:block;font-size:10px;letter-spacing:0;margin-top:4px;color:#a0aa9c}.bottom-left{bottom:max(26px,env(safe-area-inset-bottom));left:25px;display:flex;align-items:center;gap:2px}.supply-summary{font-size:10px;color:#7e9589;margin-left:9px;max-width:135px;line-height:1.7}.tool-dock{bottom:max(25px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;padding:9px 13px;background:var(--hud);border-radius:40px;box-shadow:0 3px 24px #4f6f5510;border:1px solid #e3e4d8;max-width:calc(100vw - 380px)}.tool-button{position:relative;background:transparent;min-width:46px;height:48px;border-radius:16px;display:flex;align-items:center;justify-content:center;color:#82978d;flex-direction:column;gap:1px}.tool-button svg{width:26px;height:26px;stroke-width:1.8}.tool-button .tool-count{font:500 10px/1 sans-serif;min-height:10px}.tool-button:hover{background:#e9eadf;color:var(--ink)}.tool-button.selected{background:var(--water);color:#f4f4e9}.tool-button .tool-tooltip{position:absolute;bottom:65px;white-space:nowrap;border-radius:7px;padding:7px 10px;background:var(--ink);color:#f5f1e7;font-size:11px;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .12s,transform .12s}.tool-button:hover .tool-tooltip,.tool-button:focus-visible .tool-tooltip{opacity:1;transform:translateY(0)}.tool-divider{width:1px;height:27px;background:#dce0d2;margin:0 3px}.zoom-controls{bottom:max(33px,env(safe-area-inset-bottom));right:25px;display:flex;gap:1px;align-items:center}.hint{position:absolute;bottom:114px;left:50%;transform:translateX(-50%);max-width:90%;text-align:center;font-size:12px;letter-spacing:.15px;color:#7b9285;pointer-events:none;z-index:3;white-space:nowrap}.hint b{font-weight:600;color:#417d74}.toast{position:absolute;left:50%;top:125px;transform:translateX(-50%);padding:9px 16px;border-radius:30px;background:#314e46;color:#faf7ea;font-size:12px;box-shadow:0 5px 20px #28403915;z-index:15;max-width:90%;text-align:center;pointer-events:none}.toast.warning{background:#a77455}.inspection{left:30px;bottom:107px;width:210px;padding:16px 17px;border-radius:14px;background:var(--hud);border:1px solid #e3e4d8;font-size:11px;line-height:1.9}.inspection h3{font-size:14px;margin:0 0 8px}.inspection .inspect-close{position:absolute;right:8px;top:6px;background:transparent;font-size:21px;color:#8b9b8f}.inspection p{margin:5px 0;color:#718778}.inspect-meter{height:4px;border-radius:3px;background:#e1e5d8;margin:8px 0}.inspect-meter i{display:block;height:100%;background:var(--water);border-radius:3px}.inspection .danger{color:#b78052}.inspect-action{background:#e7ecdf;padding:5px 9px;border-radius:5px;margin-top:9px;font-size:11px}.point-controls{bottom:104px;left:50%;transform:translateX(-50%);display:flex;gap:3px;background:var(--hud);border-radius:22px;padding:5px;border:1px solid var(--line)}.point-controls button{min-width:38px;height:38px;border-radius:50%;background:transparent;font-size:12px}.point-controls button:hover{background:#dce6d8}.offscreen-alerts{position:absolute;inset:105px 16px 130px;pointer-events:none}.edge-alert{position:absolute;width:36px;height:36px;border-radius:50%;background:#dfb879;color:#fff9e9;font-size:15px;pointer-events:auto;border:3px solid var(--paper)}.edge-alert.danger{background:#cf7e6e}.title-screen{position:absolute;z-index:5;left:clamp(45px,9vw,160px);top:50%;transform:translateY(-50%);width:440px;max-width:85vw;user-select:none}.title-mark{color:#d8979a;font-size:41px;line-height:1;margin-bottom:25px}.eyebrow{font-size:9px;font-weight:600;letter-spacing:2.7px;color:#8ea18e;margin:0 0 16px}.title-screen h1{font-size:66px;font-weight:650;letter-spacing:-4.5px;line-height:1.2;margin:0 0 23px}.title-description{font-size:15px;line-height:1.9;color:#8a9c8e;letter-spacing:.2px;margin-bottom:31px}.map-picker{display:flex;gap:15px;margin:0 0 13px}.map-choice{position:relative;width:48px;height:49px;background:transparent;display:flex;align-items:center;justify-content:center;border-bottom:2px solid transparent;color:#a6b09d}.map-choice.selected{border-color:#438e90;color:#397d76}.map-choice svg{height:30px;width:30px}.map-choice:hover{color:#397d76}.map-choice .map-name-tip{position:absolute;white-space:nowrap;bottom:-25px;font-size:10px;display:none}.map-choice:hover .map-name-tip{display:block}.map-description{font-size:12px;line-height:1.7;color:#879d8b;min-height:40px;margin:24px 0}.title-actions{display:flex;gap:22px;align-items:center;margin-top:22px}.start-button{padding:14px 27px;background:#3d7771;color:#f8f6ea;border-radius:29px;font-size:14px;letter-spacing:.4px;min-width:175px;transition:background .15s,transform .15s}.start-button:hover{background:#2c605a;transform:translateY(-1px)}.start-button span{margin-left:24px;font-size:19px}.text-button{background:transparent;font-size:12px;color:#869b8b;padding:11px 5px}.text-button:hover{color:#355d4f}.title-foot{font-size:10px;color:#a6afa0;letter-spacing:.1px;margin-top:35px}.dialog-shade{position:absolute;inset:0;background:rgba(245,241,231,.62);backdrop-filter:blur(3px);z-index:10}.game-panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:360px;max-width:calc(100vw - 36px);max-height:90vh;overflow:auto;text-align:center;background:#f5f1e7;z-index:12;padding:37px 34px 30px;border:1px solid #d9dfd0;border-radius:22px;box-shadow:0 18px 60px #43615114}.game-panel h2{font-size:26px;font-weight:600;letter-spacing:-1px;margin:0 0 15px}.game-panel>p:not(.eyebrow){font-size:12px;line-height:1.9;color:#8a9a8c}.menu-actions{display:flex;flex-direction:column;gap:10px;margin:25px 0 19px}.solid-button,.outline-button{border-radius:25px;padding:12px 24px;min-height:44px;font-size:13px}.solid-button{background:#3d7771;color:#f8f6ea}.solid-button:hover{background:#2c605a}.outline-button{background:transparent;border:1px solid #c8d4c4;color:#648574}.outline-button:hover{background:#e8eddf}.setting{display:flex;align-items:center;gap:9px;font-size:11px;color:#829382;text-align:left;margin-top:12px}.setting input{accent-color:#438e90;width:16px;height:16px}.help-panel{width:430px;text-align:left}.help-panel h2{font-size:24px}.help-panel .solid-button{width:100%;margin-top:15px}.help-row{display:flex;gap:14px;margin-top:18px}.help-row>span{font:italic 21px Georgia,serif;color:#a8b599}.help-row p{font-size:11px;line-height:1.9;margin:0;color:#8b9d8e}.help-row b{display:block;color:#5d7e6c;font-weight:600}.help-small{font-size:10px!important;margin-top:24px!important;color:#9aa694!important}.reward-panel{position:absolute;z-index:9;right:38px;top:50%;transform:translateY(-50%);width:280px;max-width:calc(100vw - 36px);background:var(--paper);border:1px solid #d9dfd0;padding:26px 24px;border-radius:21px;box-shadow:0 10px 50px #43615112;text-align:center}.reward-panel h2{font-size:24px;font-weight:600;margin:0 0 8px;letter-spacing:-1px}.reward-panel>p{font-size:11px;color:#8b9e8b}.reward-choices{display:flex;flex-direction:column;gap:9px;margin-top:22px}.reward-choice{display:flex;text-align:left;align-items:center;gap:15px;padding:14px 13px;background:#e8eddf;border-radius:13px;min-height:66px}.reward-choice:hover{background:#dbe6d4}.reward-choice svg{height:30px;width:30px;color:#548d82;flex-shrink:0}.reward-choice b{display:block;font-size:13px;font-weight:600}.reward-choice small{display:block;font-size:10px;line-height:1.7;color:#8b9b87;margin-top:3px}.reward-note{font-size:9px!important;line-height:1.7;margin:18px 0 0}.result-score{margin:22px 0}.result-score strong{font:normal 62px/1 Georgia,serif;display:block;color:#39776f}.result-score span{display:block;color:#90a08d;font-size:10px;margin-top:10px}.result-return{position:absolute;right:28px;top:105px;border-radius:20px;background:#3d7771;color:#f8f6ea;padding:10px 18px;font-size:12px;z-index:5}.boot-error{position:absolute;inset:20%;padding:30px;background:var(--paper);z-index:50;font-size:14px}.loading .title-screen{opacity:.5}.tool-hand #garden{cursor:grab}.tool-hand.dragging #garden{cursor:grabbing}.tool-erase #garden{cursor:cell}.title-mode .vignette{background:linear-gradient(90deg,var(--paper) 2%,rgba(245,241,231,.96) 28%,rgba(245,241,231,0) 66%)}
@media(max-width:1050px){.top-center{top:25px}.weather-indicator{display:none}.tool-dock{max-width:calc(100vw - 240px);gap:2px;padding:8px}.tool-button{min-width:40px}.supply-summary{display:none}.bottom-left{left:17px}.zoom-controls{right:17px}.top-right{gap:7px;right:20px}.top-left{left:20px}.title-screen{left:60px;width:380px}.title-screen h1{font-size:59px}.title-mode .vignette{background:linear-gradient(90deg,var(--paper),rgba(245,241,231,.95) 30%,rgba(245,241,231,0) 85%)}}
@media(max-width:650px){.top-left{left:12px;top:16px;gap:5px}.garden-heading{font-size:13px}.week-line{font-size:9px;gap:5px}.week-track{width:24px}.top-left .icon-button{width:34px}.top-center{top:72px}.score-label{font-size:8px}.top-center strong{font-size:29px}.flower-count{display:none}.top-right{right:11px;top:19px}.time-controls{gap:0}.time-button{width:31px;height:34px;font-size:11px}.pause-label{top:136px;font-size:10px}.pause-label span{font-size:9px}.tool-dock{bottom:max(19px,env(safe-area-inset-bottom));max-width:calc(100vw - 20px);padding:6px 8px;gap:1px;border-radius:25px;overflow:visible}.tool-button{min-width:36px;height:45px;border-radius:13px}.tool-button svg{width:23px;height:23px}.tool-count{font-size:9px!important}.tool-divider{margin:0 1px}.zoom-controls{right:8px;bottom:88px;gap:0}.zoom-controls .icon-button{width:32px}.bottom-left{left:8px;bottom:88px}.bottom-left .icon-button{width:32px}.hint{bottom:142px;font-size:10px;white-space:normal;width:88%}.inspection{left:14px;bottom:143px;width:190px}.point-controls{bottom:145px}.point-controls button{min-width:32px}.title-screen{left:28px;top:47%;width:calc(100vw - 56px)}.title-screen h1{font-size:53px}.title-mark{font-size:32px;margin-bottom:20px}.eyebrow{font-size:8px;letter-spacing:2px}.title-description{font-size:13px;margin-bottom:24px}.map-picker{gap:11px}.map-description{max-width:250px}.title-foot{font-size:9px;margin-top:28px}.title-actions{gap:15px}.start-button{min-width:160px;padding:13px 22px}.title-mode .vignette{background:linear-gradient(90deg,rgba(245,241,231,.96),rgba(245,241,231,.85) 40%,rgba(245,241,231,.4))}.reward-panel{right:14px;top:auto;bottom:95px;transform:none;width:calc(100vw - 28px);padding:20px 18px}.reward-choices{flex-direction:row;gap:6px;margin-top:12px}.reward-choice{flex:1;min-width:0;display:block;text-align:center;padding:12px 7px}.reward-choice svg{height:25px;width:25px}.reward-choice b{font-size:11px}.reward-choice small{font-size:9px}.reward-panel h2{font-size:21px}.reward-panel .eyebrow{margin-bottom:7px}.reward-note{margin-top:12px}.toast{top:152px;font-size:11px}.game-panel{padding:30px 24px}.help-row{margin-top:15px}.offscreen-alerts{inset:155px 12px 160px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

#garden:focus{outline:none}
.water-reading{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#718778}
.water-reading b{font-size:15px;font-weight:600;color:var(--ink)}
.inspect-meter.supply{height:5px;margin:10px 0 13px}
.inspect-meter.supply.short i{background:#c9995d}
.inspection .growth-notice{color:#a17c46}
@media(max-width:650px){
  .top-left .icon-button,.time-button{width:44px;height:44px}
  .top-right{top:16px}
  .top-right .weather-indicator{display:flex;position:absolute;top:49px;right:5px;font-size:9px}
  .tool-button{min-width:40px}
  .zoom-controls .icon-button,.bottom-left .icon-button{width:44px;height:44px}
}

/* Quiet game overlays: dates, forecasts, and tools stay close to the map. */
.top-left{align-items:flex-start}
.weather-forecast{display:flex;gap:8px;margin-top:12px;width:max-content;font-weight:400;letter-spacing:0}
.forecast-day{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;width:27px;color:#879b8c;font-size:9px;line-height:1.2}
.forecast-day small{font-size:9px;color:#9aa595}
.forecast-day svg{width:20px;height:20px;color:#8caaa0}
.forecast-day.dry svg,.forecast-day.dry>span{color:#b38b52}
.forecast-day i{position:absolute;right:-3px;top:16px;color:#ba8b50;font-size:10px;font-style:normal}
.threat-indicator{display:flex;align-items:center;gap:5px;margin-top:10px;color:#ab7952;font-size:10px;font-weight:500;letter-spacing:0}
.threat-indicator svg{width:17px;height:17px}
#grid-button[aria-pressed="true"]{background:#e0e8da;color:#397d76}
.inspection .inspect-actions{display:flex;flex-wrap:wrap;gap:5px}
.inspect-action.secondary{color:#8b998c;background:transparent;padding-left:0;font-size:10px}
.inspect-meter.health i{background:#cc916d}
.tool-shovel #garden{cursor:grab}
.tool-shovel.dragging #garden{cursor:grabbing}
.tool-tower #garden{cursor:crosshair}
.tool-button{flex-shrink:0}
.tool-dock{overflow-x:auto;scrollbar-width:none;touch-action:pan-x}
.tool-dock::-webkit-scrollbar{display:none}
@media(max-width:1050px){.weather-forecast{gap:6px}.forecast-day{width:25px}.tool-dock{max-width:calc(100vw - 310px)}}
@media(max-width:650px){
  .weather-forecast{gap:5px;margin-top:9px}
  .forecast-day{width:24px;font-size:8px}
  .forecast-day svg{width:18px;height:18px}
  .forecast-day small{font-size:8px}
  .top-center{left:auto;right:17px;top:95px;transform:none;align-items:flex-end}
  .score-label{display:none}
  .top-center strong{font-size:27px}
  .top-right .weather-indicator{top:48px;right:5px;font-size:8px;white-space:nowrap}
  .top-right .weather-indicator span:first-child{font-size:18px}
  .threat-indicator{font-size:9px;max-width:220px;margin-top:7px}
  .tool-dock{max-width:calc(100vw - 20px);overflow-x:auto;overflow-y:hidden;justify-content:flex-start}
  .tool-button{min-width:42px}
  .tool-button .tool-tooltip{display:none}
}
@media(min-width:1051px){.tool-dock{overflow:visible}}
.practice-badge{position:absolute;right:28px;bottom:92px;font-size:10px;color:#899b8d;pointer-events:none}
@media(max-width:650px){.practice-badge{right:14px;bottom:138px;font-size:8px}}

/* Flow readings stay in the garden; detailed totals appear only when requested. */
#flow-button[aria-pressed="true"]{background:#e3eade;color:#357c78}
.branch-readings{margin-top:11px;border-top:1px solid #dce2d3;padding-top:7px}
.branch-readings>p{font-size:10px!important;color:#8b9b89!important;margin:0 0 4px!important}
.branch-readings>small{display:block;font-size:9px;color:#94a08e;line-height:1.6;margin-top:4px}
.branch-reading{display:grid;grid-template-columns:1fr auto;position:relative;padding:3px 0 7px;font-size:10px;color:#708a7e}
.branch-reading b{font-weight:600;font-variant-numeric:tabular-nums}
.branch-reading i{position:absolute;bottom:3px;left:0;width:100%;height:2px;border-radius:2px;background:linear-gradient(to right,#639c95 var(--fill),#e1e5d8 var(--fill))}
.branch-reading.busy{color:#ad7a46}
.branch-reading.busy i{background:linear-gradient(to right,#bf975c var(--fill),#e1e5d8 var(--fill))}
.capacity-busy i{background:#bf975c}
.inspection{max-height:calc(100vh - 270px);overflow-y:auto;overscroll-behavior:contain}
.supply-summary{position:absolute;bottom:46px;left:3px;margin:0;max-width:260px;white-space:nowrap}
.tool-dock{max-width:calc(100vw - 470px);overflow-x:auto;overflow-y:hidden}
.over-panel,.stats-panel{width:460px}
.over-panel{padding:24px 28px 20px}
.over-panel .eyebrow{margin-bottom:10px}
.over-panel h2{margin-bottom:8px}
.over-panel #failure-reason,.over-panel #final-details{margin:6px 0}
.over-panel .result-score{margin:16px 0 10px}
.over-panel .result-score strong{font-size:46px}
.over-panel .run-stats{margin:14px 0 16px}
.over-panel .record-duration{margin-bottom:12px}
.over-panel .record-grid{gap:10px 18px}
.over-panel .record-grid dd{font-size:18px}
.over-panel .menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0 0}
.over-panel .menu-actions .text-button{grid-column:1 / -1;padding:7px 5px}
.over-panel .menu-actions .solid-button,.over-panel .menu-actions .outline-button{padding:10px 12px}
.run-stats{text-align:left;margin:20px 0 22px}
.record-duration{margin:0 0 18px;text-align:center;color:#829385;font-size:10px}
.record-duration strong{display:block;color:#426f62;font-size:21px;font-weight:500;letter-spacing:-.5px}
.record-duration span{display:block;margin-top:5px}
.record-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px 22px;margin:0}
.record-grid>div{border-top:1px solid #dce1d2;padding-top:10px}
.record-grid dt{font-size:10px;color:#809485}
.record-grid dd{margin:4px 0;color:#345e56;font-size:20px;font-weight:500;font-variant-numeric:tabular-nums}
.record-grid small{display:block;font-size:9px;line-height:1.6;color:#91a08d}
.stats-panel>.solid-button{width:100%;margin-top:4px}
.game-panel,.inspection{scrollbar-width:thin;scrollbar-color:#b9c6b7 transparent}
.game-panel::-webkit-scrollbar,.inspection::-webkit-scrollbar{width:4px}
.game-panel::-webkit-scrollbar-thumb,.inspection::-webkit-scrollbar-thumb{background:#b9c6b7;border-radius:4px}
.game-panel::-webkit-scrollbar-track,.inspection::-webkit-scrollbar-track{background:transparent}
@media(min-width:1300px){.tool-dock{overflow:visible}}
@media(min-width:651px) and (max-width:1050px){.tool-dock{max-width:calc(100vw - 450px)}}
@media(max-width:650px){
  .tool-dock{max-width:calc(100vw - 20px)}
  .inspection{max-height:calc(100vh - 300px);width:200px}
  .over-panel,.stats-panel{padding:23px 21px;max-height:calc(100dvh - 28px)}
  .over-panel h2,.stats-panel h2{font-size:23px}
  .over-panel .result-score strong{font-size:37px}
  .record-grid{gap:13px 15px}
  .record-grid dd{font-size:18px}
  .record-grid small{font-size:9px}
  .record-duration{margin-bottom:14px}
}

/* Compact controls use real 44px targets and keep one clear view of the garden. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
#game,#game *{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#game canvas,#game svg,#game img{-webkit-user-drag:none}
#garden{touch-action:none}
.game-panel,.reward-panel,.inspect-content,.title-screen{touch-action:pan-y}
.inspection{display:flex;flex-direction:column;overflow:hidden;padding:15px}
.inspect-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b9c6b7 transparent;padding-right:3px}
.inspection h3{padding-right:35px}
.inspection .inspect-close{display:flex;align-items:center;justify-content:center;width:44px;height:44px;right:3px;top:3px;z-index:2;border-radius:50%;background:var(--hud)}
.inspection .inspect-actions{flex-shrink:0;gap:6px;padding-top:5px}
.inspect-action,.inspect-action.secondary{min-height:44px;margin-top:0;padding:9px 11px;font-size:12px;line-height:1.4}
.inspect-action.secondary{padding-left:11px}
.point-controls button,.edge-alert{min-width:44px;min-height:44px}
.point-controls{gap:3px;padding:5px}
.point-controls #point-confirm{background:var(--water);color:var(--paper);padding:0 10px;border-radius:18px}
.point-controls #point-cancel{padding:0 9px;border-radius:18px}
.setting{min-height:44px;margin-top:2px;font-size:12px;line-height:1.5}
.setting input{flex-shrink:0;width:19px;height:19px}
.text-button,.result-return{min-height:44px}
.game-panel{max-height:calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));overscroll-behavior:contain}
.reward-panel{max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));overflow-y:auto;overscroll-behavior:contain}
#reward-close{min-height:44px;width:100%;margin-top:10px;padding:10px 12px;background:transparent;color:#718778;border-radius:18px;font-size:12px}
.reward-inbox{top:93px;right:calc(28px + var(--safe-right));display:flex;align-items:center;gap:7px;min-height:44px;padding:8px 13px;border:1px solid #d8e0d0;border-radius:24px;background:var(--hud);color:#4e7f73;font-size:12px;white-space:nowrap}
.reward-inbox svg{width:19px;height:19px}
.tool-dock{scroll-padding-inline:20px;overscroll-behavior-x:contain;touch-action:pan-x}
.tool-dock.has-overflow::before,.tool-dock.has-overflow::after{content:'';position:sticky;align-self:stretch;display:block;flex:0 0 20px;z-index:2;pointer-events:none;background-size:8px 12px,100% 100%;background-position:center;background-repeat:no-repeat;opacity:0}
.tool-dock.has-overflow::before{left:-8px;margin-right:-20px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M6 2 2 6l4 4' fill='none' stroke='%23607f72' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),linear-gradient(90deg,var(--paper) 45%,transparent)}
.tool-dock.has-overflow::after{right:-8px;margin-left:-20px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='m2 2 4 4-4 4' fill='none' stroke='%23607f72' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),linear-gradient(270deg,var(--paper) 45%,transparent)}
.tool-dock.has-overflow:not(.scroll-start)::before,.tool-dock.has-overflow:not(.scroll-end)::after{opacity:1}
#play-ui:has(#point-controls:not([hidden])) .hint{visibility:hidden}

@media(max-width:1050px){
  #play-ui::before{content:'';position:absolute;z-index:1;top:0;left:0;right:0;height:calc(155px + var(--safe-top));pointer-events:none;background:linear-gradient(180deg,rgba(245,241,231,.98),rgba(245,241,231,.94) 55%,rgba(245,241,231,.65) 78%,rgba(245,241,231,0))}
  .bottom-left #help-button,.bottom-left #sound-button{display:none}
  .bottom-left{left:calc(10px + var(--safe-left));bottom:calc(92px + var(--safe-bottom));gap:2px}
  .zoom-controls{right:calc(10px + var(--safe-right));bottom:calc(92px + var(--safe-bottom));gap:2px}
  .bottom-left .icon-button,.zoom-controls .icon-button,.top-left .icon-button,.time-button{width:44px;height:44px;flex-shrink:0}
  .tool-dock{bottom:calc(12px + var(--safe-bottom));max-width:calc(100vw - 20px - var(--safe-left) - var(--safe-right));padding:6px 9px;gap:2px;border-radius:25px;overflow-x:auto;overflow-y:hidden}
  .tool-button{min-width:54px;height:58px;gap:2px;border-radius:15px;padding:3px 5px}
  .tool-button svg{width:23px;height:23px;order:0}
  .tool-button .tool-tooltip{position:static;display:block;order:1;transform:none;opacity:1;background:none;color:inherit;padding:0;border-radius:0;font-size:10px;line-height:1.2;white-space:nowrap}
  .tool-button .tool-count{order:2;font-size:10px!important;line-height:1;min-height:10px}
  .tool-divider{flex:0 0 1px;margin:0 2px}
  .hint{bottom:calc(145px + var(--safe-bottom));font-size:11px;max-width:calc(100% - 28px - var(--safe-left) - var(--safe-right));white-space:normal;line-height:1.5}
  .point-controls{bottom:calc(144px + var(--safe-bottom));max-width:calc(100vw - 16px - var(--safe-left) - var(--safe-right));gap:2px;padding:4px;flex-wrap:wrap;justify-content:center}
  .point-controls button{flex:0 0 44px;height:44px;font-size:12px}
  .point-controls #point-confirm,.point-controls #point-cancel{flex-basis:auto;min-width:48px}
  .inspection{left:calc(12px + var(--safe-left));bottom:calc(148px + var(--safe-bottom));width:224px;max-width:calc(100vw - 24px - var(--safe-left) - var(--safe-right));max-height:calc(100dvh - 320px - var(--safe-top) - var(--safe-bottom));font-size:12px;line-height:1.7}
  .inspection .water-reading{font-size:12px}
  .branch-reading{font-size:11px;padding-bottom:8px}
  .branch-readings>small{font-size:10px}
  #play-ui:has(#point-controls:not([hidden])) .inspection{display:none}
  .practice-badge{bottom:calc(137px + var(--safe-bottom));right:calc(13px + var(--safe-right));font-size:9px}
  .offscreen-alerts{inset:150px calc(12px + var(--safe-right)) calc(164px + var(--safe-bottom)) calc(12px + var(--safe-left))}
  .top-left{left:calc(12px + var(--safe-left));top:calc(12px + var(--safe-top))}
  .top-right{right:calc(12px + var(--safe-right));top:calc(12px + var(--safe-top))}
  .top-center{top:calc(16px + var(--safe-top))}
  .reward-inbox{top:calc(76px + var(--safe-top));right:calc(12px + var(--safe-right))}
}

@media(max-width:650px){
  #play-ui::before{height:calc(205px + var(--safe-top))}
  .top-left{gap:4px}
  .top-center{top:calc(94px + var(--safe-top));right:calc(14px + var(--safe-right))}
  .top-right .weather-indicator{font-size:9px}
  .top-right .weather-indicator span:first-child{font-size:18px}
  .weather-forecast{gap:5px;margin-top:8px}
  .forecast-day,.forecast-day small{font-size:9px}
  .forecast-day svg{width:19px;height:19px}
  .pause-label{top:calc(144px + var(--safe-top));font-size:11px;letter-spacing:1px}
  .pause-label span{font-size:10px}
  .toast{top:calc(178px + var(--safe-top));font-size:12px;max-width:calc(100vw - 28px);padding:9px 13px}
  .reward-inbox{top:calc(134px + var(--safe-top));right:calc(10px + var(--safe-right));min-height:44px;padding:7px 10px;font-size:11px;gap:5px}
  #play-ui:has(#reward-inbox:not([hidden])) .pause-label{left:12px;right:112px;transform:none;width:auto}
  .title-screen{left:calc(24px + var(--safe-left));width:calc(100vw - 48px - var(--safe-left) - var(--safe-right));max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));overflow-y:auto;scrollbar-width:thin}
  .title-actions{flex-wrap:wrap;gap:8px 16px}
  .title-actions .text-button{padding:10px 4px}
  .reward-panel{left:calc(12px + var(--safe-left));right:calc(12px + var(--safe-right));width:auto;bottom:calc(148px + var(--safe-bottom));max-height:calc(100dvh - 180px - var(--safe-top) - var(--safe-bottom));padding:18px 15px}
  .reward-choice small{font-size:10px;line-height:1.5}
  .reward-note{font-size:10px!important}
  .game-panel{max-width:calc(100vw - 24px - var(--safe-left) - var(--safe-right));padding:24px 20px}
}

@media(max-width:360px){
  .top-left{left:calc(8px + var(--safe-left))}
  .top-right{right:calc(8px + var(--safe-right))}
  .garden-heading{max-width:calc(100vw - 244px - var(--safe-left) - var(--safe-right));font-size:12px}
  .week-line{gap:4px;letter-spacing:0;font-size:9px;white-space:nowrap}
  .week-track{display:none}
  .weather-forecast{gap:4px}
  .forecast-day{width:23px;flex-shrink:0}
  .top-center strong{font-size:25px}
  .bottom-left{left:calc(8px + var(--safe-left))}
  .zoom-controls{right:calc(8px + var(--safe-right))}
  .inspection{width:216px}
  .title-screen h1{font-size:45px;letter-spacing:-3px}
  .title-mark{margin-bottom:12px}
  .map-picker{gap:7px}
  .title-description{margin-bottom:16px}
  .title-foot{margin-top:18px}
  .record-grid{gap:10px 12px}
  .record-grid dd{font-size:17px}
}

@media(max-width:340px){
  .point-controls{width:248px;border-radius:18px;gap:3px}
  .point-controls #point-confirm,.point-controls #point-cancel{flex:1 0 78px}
}

@media(min-width:651px) and (max-width:1050px) and (max-height:500px){
  #play-ui::before{height:calc(135px + var(--safe-top))}
  .top-left{left:calc(10px + var(--safe-left));top:calc(8px + var(--safe-top));gap:7px}
  .garden-heading{font-size:13px}
  .week-line{font-size:9px;margin-top:2px}
  .weather-forecast{gap:4px;margin-top:5px}
  .forecast-day{width:22px;font-size:8px;gap:2px}
  .forecast-day small{font-size:8px}
  .forecast-day svg{width:16px;height:16px}
  .threat-indicator{margin-top:4px;font-size:9px}
  .top-center{top:calc(9px + var(--safe-top))}
  .score-label,.flower-count{display:none}
  .top-center strong{font-size:29px}
  .top-right{top:calc(8px + var(--safe-top));right:calc(10px + var(--safe-right))}
  .pause-label{top:calc(55px + var(--safe-top));font-size:10px;letter-spacing:1px}
  .pause-label span{font-size:9px;margin-top:2px}
  .reward-inbox{top:calc(62px + var(--safe-top));right:calc(10px + var(--safe-right));font-size:11px}
  .bottom-left{left:calc(8px + var(--safe-left));bottom:calc(21px + var(--safe-bottom))}
  .zoom-controls{right:calc(8px + var(--safe-right));bottom:calc(21px + var(--safe-bottom))}
  .tool-dock{bottom:calc(10px + var(--safe-bottom));max-width:calc(100vw - 320px - var(--safe-left) - var(--safe-right));padding:4px 7px}
  .tool-button{min-width:53px;height:56px}
  .hint{bottom:calc(83px + var(--safe-bottom));font-size:10px;max-width:66%;line-height:1.3}
  .point-controls{bottom:calc(82px + var(--safe-bottom));flex-wrap:nowrap;max-width:calc(100vw - 28px - var(--safe-left) - var(--safe-right))}
  .inspection{top:calc(100px + var(--safe-top));bottom:calc(88px + var(--safe-bottom));max-height:none;width:230px;padding:12px;font-size:11px}
  .practice-badge{right:calc(10px + var(--safe-right));bottom:calc(77px + var(--safe-bottom));font-size:8px}
  .offscreen-alerts{inset:106px calc(12px + var(--safe-right)) calc(100px + var(--safe-bottom)) calc(12px + var(--safe-left))}
  .toast{top:calc(103px + var(--safe-top));font-size:11px;padding:7px 13px}
  .reward-panel{top:calc(16px + var(--safe-top));bottom:calc(16px + var(--safe-bottom));right:calc(18px + var(--safe-right));transform:none;max-height:none;padding:18px 20px}
  .reward-choices{margin-top:12px;gap:6px}
  .reward-choice{min-height:55px;padding:10px 12px}
  .reward-panel h2{font-size:21px}
  .reward-note{margin-top:10px}
  .title-screen{left:calc(28px + var(--safe-left));width:400px;max-height:calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));overflow-y:auto;scrollbar-width:thin}
  .title-mark{display:none}
  .title-screen h1{font-size:43px;margin-bottom:10px;letter-spacing:-2px}
  .title-screen .eyebrow{margin-bottom:8px}
  .title-description{font-size:13px;line-height:1.6;margin:0 0 10px}
  .map-picker{margin-bottom:5px}
  .map-description{margin:9px 0;min-height:0}
  .title-actions{margin-top:10px}
  .title-foot{margin-top:12px}
  .game-panel{padding:20px 24px}
}

/* Keep the reward heading and dismiss action visible while long cards scroll. */
@media(max-width:420px), (min-width:651px) and (max-width:1050px) and (max-height:500px){
  .reward-panel{display:flex;flex-direction:column;overflow:hidden;padding:16px 14px}
  .reward-panel>p,.reward-panel>h2,#reward-close{flex-shrink:0}
  .reward-panel .eyebrow{margin:0 0 6px}
  .reward-panel h2{margin:0 0 4px;line-height:1.35}
  #reward-subtitle{margin:3px 0 0;font-size:11px;line-height:1.5}
  .reward-choices{flex:1 1 auto;min-height:0;flex-direction:column;gap:6px;margin-top:10px;padding:3px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#b9c6b7 transparent}
  .reward-choice{flex:0 0 auto;display:flex;align-items:center;gap:10px;min-height:66px;padding:10px;text-align:left}
  .reward-choice svg{flex:0 0 26px;width:26px;height:26px}
  .reward-choice>span{flex:1;min-width:0}
  .reward-choice b{font-size:13px;line-height:1.35;word-break:keep-all;overflow-wrap:anywhere}
  .reward-choice small{font-size:11px;line-height:1.5;word-break:keep-all;overflow-wrap:anywhere}
  .reward-choice:focus-visible{outline-offset:0}
  .reward-panel .reward-note{margin:6px 0 0;font-size:10px!important;line-height:1.4}
  #reward-close{margin-top:6px;padding:10px 12px}
}

/* Centered notices may use the full phone width instead of half its viewport. */
.toast{width:max-content;max-width:min(90%,480px);word-break:keep-all;overflow-wrap:anywhere}
