:root{color-scheme:light;--ink:#233e35;--cream:#f9f5e8;--muted:#69796a;--orange:#bd593a;--gold:#efc66f;--stroke:#c0cab4;font-family:ui-rounded,"Avenir Next","Trebuchet MS",system-ui,sans-serif}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}body{background:#dce6d5;color:var(--ink)}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:focus-visible{outline:3px solid #e3a643;outline-offset:4px}button:disabled{opacity:.45;cursor:default}[hidden]{display:none!important}#game{position:relative;width:100%;height:100vh;height:100dvh;overflow:hidden;isolation:isolate}#world{position:absolute;inset:0;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}.screen{position:absolute;inset:0;background:linear-gradient(90deg,#f5f2eaf5 0%,#f5f2eae8 38%,#f5f2ea00 75%);display:flex;align-items:center;padding:clamp(22px,5vw,76px);overflow:auto}.welcome{max-width:560px;width:49%;padding:10px 0 38px}.eyebrow{font-size:10px;letter-spacing:2.2px;font-weight:800;display:flex;align-items:center;gap:9px}.eyebrow i{background:#abbd82;width:7px;height:7px;border-radius:50%}h1{font-size:clamp(58px,7.8vw,116px);font-family:Georgia,serif;font-weight:400;line-height:.88;letter-spacing:-5px;margin:30px 0 24px}h1 span{display:block;font-style:italic;color:var(--orange)}.lead{line-height:1.6;font-size:clamp(15px,1.6vw,20px);color:#607061;margin:0 0 28px}.menu-actions{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}.primary,.secondary{border-radius:11px;min-height:51px;padding:14px 22px;font-weight:750;font-size:14px;display:flex;align-items:center;justify-content:space-between;gap:24px;border:1px solid transparent}.primary{background:var(--ink);color:var(--cream);box-shadow:0 7px 20px #233e3520}.primary:hover{background:#365947}.primary span{font-size:21px;font-weight:400}.secondary{background:#ffffff42;border-color:#bbc6b0;color:var(--ink)}.secondary:hover{background:#fff9}.how{margin:30px 0 0;border-top:1px solid #bcc7b199;display:grid;gap:15px;padding-top:21px}.how p{display:flex;align-items:center;gap:16px;font-size:13px;margin:0}.how b{font-size:10px;font-weight:500;color:#8a9b82;font-variant-numeric:tabular-nums}.how span{font-weight:700}.how small{display:block;font-size:11px;line-height:1.7;color:#75826d;font-weight:400}.menu-footer{display:flex;gap:20px;align-items:center;margin-top:24px;font-size:10px;color:#7d8978}.text-button{border:0;border-bottom:1px solid #a6b49b;background:none;color:#3f5545;font-size:11px;padding:7px 0}.hero-caption{position:absolute;right:6%;bottom:7%;display:flex;align-items:center;gap:10px;font-size:11px;color:#334c3c}.tiny-marble{width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 32% 25%,white,#66baa8 20%,#305b4d 80%);border:1px solid #ffffffb0}.topbar{position:absolute;top:max(12px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));display:flex;align-items:center;gap:14px;pointer-events:none}.topbar button{pointer-events:auto}.icon-button{display:grid;place-items:center;width:43px;height:43px;background:#faf7ecdc;box-shadow:0 3px 14px #203b3510;border:1px solid #fff7;border-radius:13px;color:var(--ink)}svg{fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round;width:22px;height:22px}.level-label span{display:block;font-size:9px;letter-spacing:1.8px;font-weight:750;color:#677d62}.level-label strong{font-size:14px;font-weight:750;line-height:1.7}.counters{margin-left:auto;display:flex;align-items:center;gap:18px;padding:12px 18px;background:#faf7ece6;border:1px solid #fff8;border-radius:14px;box-shadow:0 4px 18px #203b350a;font-size:15px}.hearts{color:#b95e45;font-size:17px;letter-spacing:2px}.ammo,.gems{display:flex;align-items:center;gap:8px}.ammo i{width:17px;height:17px;border-radius:50%;background:radial-gradient(circle at 32% 25%,white,#72c7ca 25%,#31879b 70%,#235561);border:1px solid #277f84}.gems>span{color:#bf8925;font-size:24px}.counters b{font-size:16px;font-weight:750;min-width:18px;font-variant-numeric:tabular-nums}.controls{position:absolute;inset:auto max(20px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));display:flex;align-items:flex-end;justify-content:space-between;pointer-events:none;user-select:none;-webkit-user-select:none}.controls .walk,.controls .actions{display:flex;gap:12px;pointer-events:auto}.controls button{width:76px;height:76px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fbf8e9e8;border:1.5px solid #b8c2a4;border-radius:22px;color:var(--ink);box-shadow:0 5px 0 #97aa8b66;touch-action:none}.controls button.held,.controls button:active{transform:translateY(3px);box-shadow:0 2px 0 #97aa8b66;background:#e0e9ce}.controls svg{width:30px;height:30px}.controls small{font-size:10px;font-weight:750;margin-top:3px}.controls .jump{background:#bd593a;border-color:#ab4f34;color:#fff7df;box-shadow:0 5px 0 #7d412f77;width:90px}.controls .jump.held{background:#a74b30}.controls .throw{background:#edf3e5}.marble-symbol{font-size:30px;line-height:28px;color:#398c8d;text-shadow:-4px -2px 0 #a9d6bd}.control-hint{font-size:11px;color:#61775a;align-self:center;letter-spacing:.2px;opacity:.9}.boost{position:absolute;top:max(78px,calc(env(safe-area-inset-top) + 65px));left:50%;transform:translateX(-50%);background:#f7df9aeF;color:#5a512b;border:1px solid #d9b962;padding:8px 15px;border-radius:30px;font-size:12px;font-weight:750;white-space:nowrap}.boost span{display:inline-block;margin-right:5px}.toast{position:absolute;bottom:118px;left:50%;transform:translateX(-50%);max-width:80%;border-radius:12px;background:#233e35eb;color:#fff8e5;padding:12px 20px;font-size:13px;line-height:1.5;text-align:center;pointer-events:none;box-shadow:0 4px 25px #233e3525}.corner-tools{position:absolute;right:max(15px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:10px;z-index:3}.corner-tools button{background:none;border:0;padding:9px 5px;color:#405941;font-size:10px}.corner-tools #fullscreen{font-size:23px}body.playing .corner-tools{bottom:auto;top:70px;right:20px}body.playing #sound{font-size:0}body.playing #sound:before{content:'♪';font-size:22px}body.playing #sound[aria-pressed=false]{opacity:.45}.dialog-layer{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#17362b68;backdrop-filter:blur(7px);padding:20px;z-index:5;overflow:auto}.dialog{background:#faf6e9;border:1px solid #fffc;border-radius:26px;width:min(100%,460px);padding:34px;box-shadow:0 18px 80px #15342840;max-height:100%;overflow:auto;outline:none}.dialog h2{font-family:Georgia,serif;font-weight:400;font-size:42px;letter-spacing:-1.5px;line-height:1.05;margin:20px 0 14px}.dialog p{font-size:14px;line-height:1.75;color:#63745e;white-space:pre-line}.dialog-buttons{display:grid;gap:10px;margin-top:24px}.dialog .primary,.dialog .secondary{width:100%;justify-content:center}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:25px}.level-grid button{border:1px solid #bcc9b0;border-radius:13px;background:#f0f1e3;min-height:68px;color:var(--ink);font-size:20px;font-family:Georgia,serif}.level-grid small{display:block;font:10px system-ui;color:#9c7935;margin-top:5px}.level-grid button:disabled{opacity:.4}.level-grid button:hover:not(:disabled){background:#e3ebd6}
@media(min-width:1100px) and (pointer:coarse){.controls button{width:92px;height:86px}.controls .jump{width:108px}.controls .walk,.controls .actions{gap:16px}}
@media(max-height:600px) and (orientation:landscape){.screen{padding:24px 5vw}.welcome{width:53%;max-width:500px;padding:0 0 10px}h1{font-size:68px;margin:18px 0 15px}.eyebrow{font-size:9px;letter-spacing:1.4px}.lead{font-size:14px;line-height:1.4;margin:0 0 18px}.how{display:none}.menu-footer{margin-top:16px}.primary,.secondary{min-height:45px;padding:10px 16px;font-size:12px}.controls{bottom:12px;left:max(15px,env(safe-area-inset-left));right:max(15px,env(safe-area-inset-right))}.controls button{height:60px;width:67px;border-radius:18px}.controls .jump{width:80px}.controls .walk,.controls .actions{gap:10px}.topbar{top:10px;gap:10px}.counters{padding:7px 12px;gap:12px}.control-hint{display:none}.toast{bottom:88px;font-size:11px;padding:8px 14px}.boost{top:62px;font-size:11px;padding:6px 12px}body.playing .corner-tools{top:53px}.dialog{padding:24px;max-width:410px}.dialog h2{font-size:32px;margin-top:12px}.dialog p{font-size:12px}.dialog-buttons{margin-top:15px}.hero-caption{bottom:11%}}
@media(orientation:portrait){.screen{align-items:flex-start;padding:38px 26px;background:linear-gradient(#f5f2eaf5 0%,#f5f2eaf5 42%,#f5f2ea22 78%)}.welcome{width:100%;max-width:none;padding:0}h1{font-size:75px;margin-top:24px}h1 span{display:inline;margin-left:3px}.lead{font-size:16px;margin-bottom:22px}.how{display:none}.menu-actions{flex-wrap:nowrap}.primary,.secondary{padding:13px 16px;font-size:12px;gap:15px}.menu-footer{margin-top:16px}.hero-caption{bottom:18%;left:26px;right:auto}.level-label strong{font-size:12px}.level-label span{font-size:8px}.topbar{gap:8px;left:10px;right:10px}.counters{gap:8px;padding:9px 10px}.hearts{font-size:13px;letter-spacing:0}.counters b{font-size:13px}.ammo i{width:14px;height:14px}.gems>span{font-size:19px}.icon-button{width:38px;height:40px;border-radius:11px}.controls{left:12px;right:12px;bottom:max(25px,env(safe-area-inset-bottom))}.controls button{width:61px;height:69px;border-radius:19px}.controls .jump{width:72px}.controls .walk,.controls .actions{gap:8px}.control-hint{display:none}.boost{top:75px;font-size:11px}.toast{font-size:12px;bottom:118px;width:max-content;max-width:calc(100% - 36px)}.hero-caption{font-size:10px}.corner-tools{bottom:4px}}
@media(max-width:360px){.screen{padding:25px 18px}h1{font-size:62px}.level-label strong{font-size:10px}.counters{gap:6px;padding:8px}.controls button{width:54px}.controls .jump{width:64px}.controls .walk,.controls .actions{gap:6px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.carry-button{position:absolute;left:50%;bottom:110px;transform:translateX(-50%);border:1px solid #ae8e50;border-radius:12px;background:#f5df9c;color:#56482e;font-weight:700;font-size:13px;padding:12px 22px;box-shadow:0 4px 16px #243c3622;touch-action:manipulation}.round-tabs{display:flex;gap:8px;margin:20px 0 8px}.round-tabs button{flex:1;min-height:36px;border:1px solid #bcc9b0;border-radius:9px;background:transparent;color:#52674a;font-size:13px}.round-tabs .selected{background:#294c3c;color:#fff9e9;border-color:#294c3c}.level-grid{grid-template-columns:repeat(2,1fr);gap:8px;margin-top:12px}.level-grid button{display:grid;grid-template-columns:26px 1fr;align-items:center;column-gap:8px;padding:10px;min-height:66px;text-align:left;font-family:inherit}.level-grid b{grid-row:span 2;font-family:Georgia,serif;font-size:23px;font-weight:400;color:#779069}.level-grid span{font-size:11px;font-weight:700}.level-grid small{font-size:9px;margin:0}.dialog .eyebrow{font-size:9px}.level-label{min-width:0}.gems>span{font-size:20px}body.playing .controls{z-index:2}
@media(orientation:portrait){h1{font-size:clamp(60px,17vw,85px);letter-spacing:-3px}h1 span{display:block;margin-left:0}.screen{padding-top:30px}.hero-caption{bottom:12%}.carry-button{bottom:110px;padding:11px 17px;font-size:12px}.dialog{padding:24px}.level-grid{gap:7px}.level-grid button{padding:8px}.level-grid span{font-size:10px}}
@media(max-height:600px) and (orientation:landscape){.carry-button{bottom:88px;padding:9px 18px;font-size:11px}.dialog{max-height:calc(100dvh - 24px)}.level-grid button{min-height:55px}.level-label span{font-size:8px}}
@media(max-height:600px) and (orientation:landscape){.hero-caption{display:none}}

/* V3: gestures belong to the game, not browser page zoom. */
html,body,#game{touch-action:pan-y} body.playing #game{touch-action:none} .screen,.dialog-layer,.dialog{touch-action:pan-y}

.dialog h2.celebrate{font-family:inherit;font-size:clamp(34px,6vw,58px);font-weight:900;letter-spacing:-1px;color:#ae4d2d;text-align:center;text-shadow:0 3px 0 #efdca5;padding:12px 0}
@media(orientation:portrait){.hearts{max-width:55px;line-height:1.4}.counters{gap:6px}}

.difficulty{border:0;padding:0;margin:18px 0 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.difficulty legend{font-size:11px;font-weight:750;margin-bottom:8px}.difficulty label{display:flex;align-items:center;gap:7px;border:1px solid #bbc6b0;border-radius:10px;padding:10px 7px;min-height:58px;background:#ffffff42;cursor:pointer;font-size:13px;font-weight:750}.difficulty label:has(input:checked){border-color:#294c3c;background:#e1e9d7;box-shadow:inset 0 0 0 1px #294c3c}.difficulty input{accent-color:#294c3c;width:18px;height:18px;flex:none;margin:0}.difficulty small{display:block;font-size:9px;line-height:1.5;color:#62745e;font-weight:400;margin-top:3px}.difficulty p{grid-column:1/-1;margin:1px 0 0;font-size:10px;color:#69796a;line-height:1.5}@media(max-height:600px) and (orientation:landscape){.difficulty{margin-top:12px}.difficulty label{padding:8px 5px;font-size:11px;gap:5px;min-height:48px}.difficulty small{font-size:8px}.difficulty legend{margin-bottom:5px}}.hearts{max-width:150px;white-space:normal;line-height:1.3}@media(orientation:portrait){.hearts{max-width:55px;font-size:12px;letter-spacing:0}}

@media(max-height:600px) and (orientation:landscape){.screen{align-items:flex-start}.welcome{margin:auto 0}.difficulty{margin-top:8px;gap:5px}.difficulty label{min-height:40px;padding:6px}.difficulty p{font-size:9px}.menu-footer{margin-top:10px}}

.site-links{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}.site-links button{font-size:12px}.site-links #save-status{font-weight:400;text-align:right;max-width:280px}

/* Keep the start of a tall menu reachable on every viewport. */
#menu{align-items:flex-start}#menu .welcome{margin-block:auto}#menu .site-links{position:sticky;top:0;z-index:4;background:#f5f2ea;padding:8px 0 12px}#site-home{border:2px solid #ae4d2d;background:#faf6e9;min-height:48px;font-weight:800;justify-content:center}
