*{box-sizing:border-box}body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#1d1f24;color:#eee;font:14px/1.4 system-ui,Segoe UI,sans-serif}#shell{display:flex;flex-direction:column;gap:8px}#topbar{display:flex;align-items:center;gap:10px;padding:6px 10px;background:#2a2d35;border-radius:6px}#topbar .gold{display:flex;align-items:center;gap:6px;margin-right:auto}#topbar #gold{font-size:18px;font-weight:700;color:#ffd54f}#topbar .gold-icon{font-size:16px}#topbar .buttons{display:flex;gap:6px}#topbar .buttons button{display:flex;align-items:center;gap:6px}#topbar .buttons button[hidden]{display:none}#board{position:relative}canvas#game{display:block;border:3px solid #3a3f4a;border-radius:6px;image-rendering:pixelated}canvas#game.platformer{cursor:crosshair;image-rendering:auto}#modal .box:has(#mapview){max-width:680px}#toasts{position:absolute;left:12px;bottom:12px;transition:bottom .2s;max-width:min(60%,460px);display:flex;flex-direction:column;align-items:flex-start;pointer-events:none;z-index:4}.toast{max-width:100%;max-height:120px;margin-top:6px;overflow:hidden;padding:7px 12px;border-radius:8px;font-size:13px;text-align:left;background:#1d1f24c7;color:#cfd3dc;border:1px solid rgba(255,255,255,.12);box-shadow:0 2px 8px #00000059;transition:background .3s,color .3s,border-color .3s;animation:toast-in .35s ease-out}.toast.last{background:#1d1f24eb;color:#fff;border-color:#ffd54f99}.toast.leaving{animation:toast-out .35s ease-in forwards}@keyframes toast-in{0%{opacity:0;transform:translate(-30px);max-height:0;margin-top:0;padding-block:0}to{opacity:1;transform:none;max-height:120px}}@keyframes toast-out{to{opacity:0;transform:translate(-30px);max-height:0;margin-top:0;padding-block:0;border-width:0}}#modal h3{margin:12px 0 4px;font-size:13px;color:#cfd3dc}#modal .box:has(.help-keys){width:auto;max-width:400px}.help-keys{margin:0;font-size:13px;line-height:1.6;color:#cfd3dc}button{font:inherit;color:#eee;background:#3a3f4a;border:1px solid #555c6b;border-radius:5px;padding:6px 10px;cursor:pointer;text-align:left}button:hover:not(:disabled){background:#4a5160;border-color:#ffd54f}button:disabled{opacity:.4;cursor:default}#modal{--modal-top: 15vh;position:fixed;inset:0;z-index:10;background:#0000008c;display:flex;flex-direction:column;align-items:center;padding:8px}#modal:before{content:"";flex:0 1 var(--modal-top);min-height:0}#modal:after{content:"";flex:1 1 0}#modal[hidden]{display:none}#modal .box{position:relative;flex:none;max-height:100%;overflow-y:auto;background:#2a2d35;border:2px solid #ffd54f;border-radius:10px;padding:18px;max-width:640px}#modal .box>.close{position:absolute;top:8px;right:8px;width:34px;height:34px;padding:0;text-align:center;font-size:16px}#mapview{max-width:100%;height:auto}#modal h2{margin:0 0 12px;color:#ffd54f}.dialog{display:flex;gap:16px}.dialog .portrait{font-size:64px;line-height:1}.dialog .speaker{font-weight:700;color:#ffd54f;margin-bottom:6px}.dialog .text{margin-bottom:12px}.dialog .text .stage{color:#9aa0ab}#modal .box:has(.dialog){width:640px}.dialog .body{flex:1}.options button.end{display:flex;justify-content:space-between;align-items:center;background:#23262d;border:1px dashed #8a90a0;color:#cfd3dc}.options .end-tag{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#1d1f24;background:#b8bdc8;border-radius:3px;padding:2px 6px;margin-left:12px;white-space:nowrap}.options button.trade{display:flex;align-items:center;background:#2c3140;border-color:#6b7896;color:#e6eaf3}.options button.trade .price{margin-left:auto;padding-left:12px;font-weight:700;color:#ffd54f}.options button.act{background:#2e3a30;border-color:#5f7d55;color:#d6e8cf}.options .act-tag{margin-right:6px}.recipe .need{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-right:3px;border-radius:5px;font-size:20px;vertical-align:middle}.recipe .need .item-img{width:26px;height:26px}.recipe .need.have{background:#1d1f24;border:1px solid #9ccc65}.recipe .need.empty{border:1px dashed #555c6b;filter:grayscale(1);opacity:.35}.recipe .plus{margin:0 6px 0 3px;color:#8a90a0}.options{display:flex;flex-direction:column;gap:6px}.options.row{flex-direction:row;justify-content:center}.recipes{display:grid;grid-template-columns:max-content max-content max-content;column-gap:18px;align-items:center}.recipe{display:contents}.recipe>*{padding:8px 0;border-bottom:1px solid #3a3f4a;align-self:stretch;display:flex;flex-direction:column;justify-content:center}.recipe>.needs{flex-direction:row;align-items:center;justify-content:flex-start}.recipe>button{align-self:center;padding:6px 14px;border-bottom:1px solid #444a57}.recipe .out{max-width:240px}#modal .box:has(.recipes){width:auto}.recipe .note{font-size:12px;color:#9aa0ad}.recipe .ok{color:#9ccc65}.recipe .missing{color:#ef9a9a}.hint{font-size:12px;color:#9aa0ad;margin:10px 0 0}.frog{text-align:center}.frog img{display:block;width:auto;height:auto;max-width:min(400px,100%);border-radius:6px;margin:0 auto 14px;max-height:calc(100vh - 140px);max-height:calc(100dvh - 140px)}#modal .box:has(.frog){width:auto}.frog button{min-width:90px;text-align:center;font-size:16px}.ending{text-align:center}#mapview{display:block;border-radius:6px;border:2px solid #8d6e63}.item-img{width:1em;height:1em;vertical-align:middle}#energy{position:absolute;top:10px;right:10px;display:flex;align-items:center;gap:6px;padding:4px 8px;background:#1d1f24b8;border-radius:12px;z-index:4;pointer-events:none}#energy .icon{font-size:13px;line-height:1}#energy .bar{width:90px;height:8px;background:#1d1f24;border:1px solid #444a57;border-radius:4px;overflow:hidden}#energy .fill{height:100%;width:100%;background:#9ccc65;transition:background .2s}#energy .fill.tired{background:#ef9a9a}#eq{position:absolute;top:3px;right:3px;bottom:3px;width:220px;display:flex;flex-direction:column;background:#24272ef0;border-left:1px solid #3a3f4a;border-radius:0 4px 4px 0;z-index:4;animation:eq-in .2s ease-out}#eq[hidden]{display:none}#eq header{display:flex;align-items:center;justify-content:space-between;padding:8px 8px 6px 12px}#eq h2{margin:0;font-size:14px;color:#ffd54f}#eq .close{width:30px;height:30px;padding:0;text-align:center}#inventory{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:4px;padding:0 8px 8px;color:#9aa0ad}.slot{display:flex;align-items:center;gap:8px;width:100%;padding:4px 8px;text-align:left;background:#1d1f24;border:1px solid #444a57;border-radius:6px;cursor:pointer}.slot:hover{border-color:#ffd54f}.slot .icon{font-size:22px;width:28px;text-align:center}.slot .name{flex:1;font-size:13px;color:#e6eaf3}.slot .cnt{font-size:12px;color:#ffd54f;font-weight:700}#topbar #btn-inventory.on{background:#4a5160;border-color:#ffd54f}#board:has(#eq:not([hidden])) #energy{right:236px}@keyframes eq-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:none}}.quests{margin:0;padding-left:18px}.quests li{margin-bottom:8px}.quests li.done{color:#7f8695;text-decoration:line-through}#modal .box:has(.quests),#modal .box:has(.changelog){width:460px;max-width:100%}.changelog{max-height:60vh;overflow-y:auto;font-size:12px;line-height:1.4;color:#b8bdc8}.changelog .entry+.entry{margin-top:10px;padding-top:8px;border-top:1px solid #3a3f4a}.changelog .when{color:#8a90a0;font-size:11px}.changelog .what{color:#e6eaf3;font-weight:700}.changelog ul{margin:2px 0 0;padding-left:16px}#rotate{display:none}body.touch #toasts{top:6px;left:8px;bottom:auto;max-width:min(42%,340px)}body.touch .toast{font-size:11px;line-height:1.3;padding:4px 8px;margin-top:4px;background:#1d1f248c;box-shadow:none}body.touch .toast.last{background:#1d1f24b8}body.touch .toast:not(.last){opacity:.75}body.touch:has(#modal:not([hidden])) #touch{display:none}#touch[hidden]{display:none}body.touch,body.touch *{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}body.touch{touch-action:manipulation}body.touch canvas#game{touch-action:none}#touch{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:12px;padding:4px 2px;touch-action:none}#touch .stick{position:relative;width:132px;height:132px;flex:none;border-radius:50%;background:#ffffff14;border:2px solid rgba(255,255,255,.25);touch-action:none}#touch .knob{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:#ffd54f8c;border:2px solid #ffd54f;pointer-events:none}#touch .tbtns{display:grid;grid-template-columns:repeat(2,64px);gap:10px}#touch .tb{width:64px;height:64px;padding:0;border-radius:50%;text-align:center;font-size:24px;line-height:1;display:flex;flex-direction:column;align-items:center;justify-content:center;touch-action:none;background:#3a3f4ad9;border:2px solid #6b7180}#touch .tb span{font-size:10px;margin-top:3px;color:#cfd3dc}#touch .tb.on{background:#ffd54f;border-color:#ffd54f}#touch .tb.on span{color:#1d1f24}#touch .tb.act{border-color:#9ccc65}#touch .tb.jump{border-color:#64b5f6}body[data-mode=topdown] #touch .jump,body[data-mode=topdown] #touch .hook{visibility:hidden}@media(max-width:860px),(pointer:coarse){body{display:block;padding:6px;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) 6px max(6px,env(safe-area-inset-left))}#shell{max-width:820px;margin:0 auto}canvas#game{width:100%;height:auto}.toast{font-size:12px;padding:5px 10px}#topbar .buttons button{min-height:40px}#modal .box,#modal .box:has(.dialog),#modal .box:has(#mapview){width:100%;max-width:640px}.dialog{gap:10px}.dialog .portrait{font-size:40px}.options button{min-height:44px}}body.touch #topbar .lbl{display:none}body.touch #topbar .buttons button{font-size:18px;padding:2px 10px}@media(orientation:landscape)and (max-height:600px){body.touch{height:100vh;height:100dvh;overflow:hidden;padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left))}body.touch #shell{max-width:none;height:100%;gap:4px;align-items:center}body.touch #topbar{flex:none;align-self:stretch;padding:2px 8px}body.touch #topbar #gold{font-size:15px}body.touch #topbar .buttons button{min-height:32px}body.touch canvas#game{height:auto;margin:0;width:min(100vw - 8px,(100vh - 48px) * 800 / 576);width:min(100vw - 8px,(100dvh - 48px) * 800 / 576)}body.touch.wide #board{align-self:stretch}body.touch.wide canvas#game{width:100%;height:calc(100vh - 48px);height:calc(100dvh - 48px);border:0;border-radius:0}body.touch #eq{width:180px}body.touch #board:has(#eq:not([hidden])) #energy{right:194px}body.touch .slot{min-height:36px}body.touch .options button{min-height:38px}body.touch #touch{position:fixed;inset:auto 0 10px;flex-direction:row-reverse;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));pointer-events:none;z-index:5}body.touch #touch .stick,body.touch #touch .tb{pointer-events:auto;opacity:.85}body.touch #touch .stick{width:120px;height:120px}body.touch #touch .tb{width:58px;height:58px}body.touch #touch .tbtns{grid-template-columns:repeat(2,58px)}}@media(orientation:portrait)and (max-width:700px){body.touch #shell,body.touch #modal{display:none}body.touch #rotate{display:flex;position:fixed;inset:0;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#1d1f24;color:#ffd54f;font-size:22px;font-weight:700;text-align:center}body.touch #rotate .phone{font-size:64px;animation:rotate-hint 2s ease-in-out infinite}}@keyframes rotate-hint{0%,30%{transform:rotate(0)}60%,to{transform:rotate(-90deg)}}
