/* Game controls designed for fingers first; the desktop keeps the same readable language. */
button img{image-rendering:pixelated;object-fit:contain;pointer-events:none}.hud-icon{width:56px;height:64px;background:linear-gradient(#466765,#1d3e48);border:2px solid #acba8a;border-radius:14px;box-shadow:inset 0 2px #dae5b944,0 4px #132b35,0 5px 15px #071c3044;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}.hud-icon img{width:30px;height:30px}.hud-icon small{font-size:14px;line-height:17px}.icons{max-width:445px;gap:7px}.pet-hud{padding:8px;gap:9px;min-width:220px;min-height:70px;border:2px solid #b8c595;border-radius:16px;background:linear-gradient(#1c3d49ed,#17323ee8);box-shadow:inset 0 2px #eef0c125,0 4px 16px #13252b66}.portrait{width:48px;height:48px}.pet-hud b{font-size:16px;letter-spacing:.03em}.pet-hud small{font-size:14px;margin-top:3px}.meters{gap:4px;margin-top:6px}.meter{width:39px;height:7px}.supply-hud{width:44px;height:49px;position:relative;border:0;background:#162e38;border-radius:10px;padding:6px;color:#f7e5bb;pointer-events:auto}.supply-hud img{width:29px;height:29px}.supply-hud span{position:absolute;right:3px;bottom:0px;min-width:17px;text-align:center;border-radius:50%;background:#e7d5a3;color:#213c42;font-size:14px;font-weight:700}.objective{top:16px;color:#fff3ce;font-size:16px;line-height:1.5;text-shadow:0 2px 4px #153e44}.objective small{font-size:14px;margin-top:4px}.bottom{left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom))}.actions{grid-template-columns:repeat(2,68px);gap:11px;align-items:end;justify-items:center}.action{width:68px;height:68px;min-width:68px;border-radius:50%;background:radial-gradient(circle at 35% 20%,#507379,#20444c 80%);border:2px solid #aabc8e;box-shadow:inset 0 2px #d5e8bc66,0 4px #112a34,0 7px 13px #071c3055;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0}.action img{width:36px;height:36px;filter:drop-shadow(0 2px #152a33)}.action span{font-size:14px;line-height:18px;font-weight:600;letter-spacing:.04em}.action.primary{width:78px;height:78px;border:3px solid #e2e6ab;background:radial-gradient(circle at 35% 20%,#e2d89e,#9eab65 85%);color:#253d37;box-shadow:inset 0 3px #fff4c777,0 5px #314d3d,0 7px 15px #10283666}.action.primary img{width:42px;height:42px}.action.held{filter:brightness(1.22)}.controls-platform .action.primary{grid-column:1 / -1;width:92px;height:76px;border-radius:40px}.controls-puzzle .actions{grid-template-columns:repeat(2,64px)}.controls-puzzle .action{width:64px;min-width:64px;height:64px}.controls-puzzle [data-action=reset]{grid-column:1 / -1;width:128px;height:44px;flex-direction:row;border-radius:24px}.controls-puzzle [data-action=reset] img{width:28px;height:28px}.joystick{width:132px;height:132px;background:radial-gradient(#2445505e,#1b3a4288);border:2px solid #b1ca9888;box-shadow:inset 0 2px #d5e5b533,0 4px 17px #17303755}.stick{width:54px;height:54px;left:37px;top:37px;background:radial-gradient(circle at 30% 25%,#dbe7b4,#8fad7f);border:3px solid #dbe4b2;box-shadow:0 3px 7px #16363c77}.joystick:after{font-size:14px;bottom:6px;color:#eef0cf}.dpad{width:156px;height:156px;grid-template-columns:repeat(3,52px);grid-template-rows:repeat(3,52px)}.dpad button{font-size:26px;border:2px solid #b9c390;background:linear-gradient(#4b6c71,#25454e);border-radius:14px;box-shadow:inset 0 2px #d5e8bc33,0 4px #142e38}.context{font-size:15px;line-height:1.65;bottom:200px;padding:9px 13px;background:#163642e8;border:1px solid #aec89888;border-radius:12px;max-width:70%;box-shadow:0 3px 12px #112a3433}.context.interactable{background:transparent;border:0;box-shadow:none;padding:0;pointer-events:none;max-width:90%;width:min(470px,90%)}.context-action{pointer-events:auto;width:100%;min-height:56px;padding:9px 16px;display:flex;align-items:center;justify-content:center;gap:12px;background:linear-gradient(#d9dba3,#a3b078);color:#263e36;border:2px solid #edecb7;border-radius:30px;box-shadow:0 4px #435b42;font-size:16px;font-weight:700;line-height:1.45}.context-action img{width:32px;height:32px}.context.home{font-size:16px;bottom:27px}.toast{top:150px;font-size:16px;line-height:1.6;max-width:90%;padding:12px 18px;border-radius:13px}.save-note{font-size:11px;left:14px;bottom:3px}.menu-nav{display:flex;gap:4px;position:sticky;top:-1px;background:#213b43f2;padding:0 0 13px;z-index:2;margin-bottom:12px}.menu-nav button{flex:1;min-height:46px;border:1px solid #9cad8188;background:#17323e;border-radius:9px;color:#dfe8c8;font-size:16px;white-space:nowrap}.menu-nav button.active{background:#708767;color:#fff4d0;border-color:#ecdfb0;box-shadow:inset 0 2px #fff7c433}.menu-body{padding:20px;max-height:calc(100dvh - 126px)}dialog{border-width:4px;border-radius:18px;background:#243e45}dialog header{padding:12px 18px;background:#16313c;border-bottom:2px solid #9eaf8288}dialog h2{font-size:22px}dialog .close{border-radius:50%;min-width:48px;min-height:48px;background:linear-gradient(#4e6a69,#294c53);border:2px solid #9eaf82}.intro{font-size:16px;line-height:1.85}.muted{font-size:14px;line-height:1.75}.button{font-size:16px;min-height:48px;padding:12px 17px;border:2px solid #bfcb95;border-radius:12px;background:linear-gradient(#8d9f73,#647e61);box-shadow:inset 0 2px #e5e8b444,0 3px #112d36;line-height:1.45}.button.secondary{background:linear-gradient(#45676b,#25454f);color:#e8edd0;border-color:#829b80}.button.wide{margin-top:14px}.chapter h3{font-size:20px;line-height:1.5}.chapter p{font-size:16px;line-height:1.8}.chapter .route{font-size:14px;gap:5px;flex-wrap:wrap}.route span{padding:9px;border-radius:10px;background:#132d39}.pet-panel{grid-template-columns:150px 1fr;gap:18px}.pet-panel img{width:150px;filter:drop-shadow(0 5px 15px #0b263977)}.pet-panel h3{font-size:24px}.pet-panel input{min-height:44px;font-size:16px}.skill-choice{gap:10px}.skill-choice button{padding:12px 8px;min-height:96px;font-size:16px;border:2px solid #718e79;border-radius:14px;background:linear-gradient(#294e57,#163542)}.skill-choice button.selected{background:linear-gradient(#607e67,#395c55);border-color:#ead8a5}.skill-choice img{display:block;width:48px;height:48px;margin:0 auto 5px;image-rendering:pixelated}.talent b{font-size:18px}.talent p{font-size:16px;line-height:1.75}.recipe{padding:18px 0;gap:14px}.recipe h3{font-size:18px}.recipe p{font-size:16px;line-height:1.75}.recipe small{font-size:14px}.recipe .equipment-icon{width:58px;height:58px;flex:none;image-rendering:pixelated;object-fit:contain;background:#142e3b;border-radius:14px;padding:5px;border:1px solid #8aa58577}.resources{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.resources span{display:flex;flex-direction:column;align-items:center;gap:5px;border:2px solid #84998188;background:#173440;border-radius:12px;padding:8px 5px;font-size:14px;position:relative}.resources img{width:42px;height:42px;image-rendering:pixelated;object-fit:contain}.resources b{font-size:18px;color:#f2dfa8}.history{font-size:16px;line-height:1.85;padding:18px 0}.history b{color:#ecddae;font-size:18px}.offer{padding:16px;border:2px dashed #859a7f;border-radius:14px}.offer b{font-size:18px}.offer p,.offer small{font-size:16px;line-height:1.75}.offer button{font-size:14px;min-height:48px}.setting label{font-size:16px}.setting small{font-size:14px;line-height:1.7}.setting input[type=checkbox]{width:28px;height:28px}.setting input[type=range]{height:40px}.guide h4{font-size:18px}.guide p{font-size:16px;line-height:1.8}.guide section{padding:16px;border:1px solid #6f8a7888;border-radius:14px}.story p{font-size:16px;line-height:1.9}.story h3{font-size:26px}.pause-note{font-size:16px;line-height:1.85}.mini-sky{height:210px}.mini-sky p{font-size:16px}.mini-orb{width:56px;height:56px}.pause-links .button{min-width:125px}
@media(max-width:680px){.hud{padding:10px}.top{gap:5px}.pet-hud{min-width:0;padding:6px;gap:5px;max-width:calc(100% - 170px);min-height:68px}.portrait{width:36px;height:42px}.pet-hud b{font-size:15px;white-space:nowrap}.pet-hud small{font-size:13px;white-space:nowrap}.meter{width:25px;height:7px}.supply-hud{width:36px;min-width:36px;height:47px;padding:3px}.supply-hud img{width:27px;height:27px}.icons{max-width:170px;gap:5px}.hud-icon{width:50px;min-width:50px;height:64px;min-height:64px;border-radius:13px}.hud-icon img{width:28px;height:28px}.hud-icon small{font-size:14px;line-height:18px}.objective{top:90px;width:calc(100% - 28px);max-width:calc(100% - 28px);font-size:16px;background:#183743cc;padding:6px 10px;border-radius:10px;line-height:1.5}.objective small{font-size:14px;line-height:1.45;margin-top:2px}.bottom{left:14px;right:14px;bottom:max(22px,env(safe-area-inset-bottom))}.actions{grid-template-columns:repeat(2,68px);gap:10px}.joystick{width:116px;height:116px}.stick{left:29px;top:29px}.context{bottom:193px;max-width:95%;font-size:15px;padding:8px 11px;width:calc(100% - 28px)}.context.interactable{bottom:197px;width:calc(100% - 28px)}.toast{top:160px;font-size:16px}.menu-body{padding:16px;max-height:calc(100dvh - 118px)}dialog header{padding:9px 13px}dialog h2{font-size:21px}.pet-panel{grid-template-columns:98px 1fr;gap:12px}.pet-panel img{width:98px}.pet-panel h3{font-size:21px}.pet-panel input{width:110px}.pet-panel .row{gap:7px}.skill-choice{gap:7px}.skill-choice button{padding:9px 5px;min-height:90px}.talent{align-items:flex-start}.talent p{max-width:210px}.recipe{flex-wrap:wrap;gap:9px}.recipe>div{flex:1;min-width:180px}.recipe>.button{margin-left:auto;width:100%;margin-top:3px}.resources{grid-template-columns:repeat(3,1fr)}.resources img{width:40px;height:40px}.chapter .row .button{flex:1;min-width:125px}.story h3{font-size:23px}.story img{height:120px}.guide{grid-template-columns:1fr}.menu-nav{gap:4px}.menu-nav button{font-size:15px}.controls-puzzle .actions{gap:9px}}
@media(max-width:350px){.pet-hud{max-width:calc(100% - 140px)}.portrait{display:none}.pet-hud b{font-size:15px}.icons{max-width:135px;gap:3px}.hud-icon{width:44px;min-width:44px}.hud-icon img{width:25px;height:25px}.hud-icon small{font-size:14px}.supply-hud{width:36px;min-width:36px}.objective{top:87px}.actions{grid-template-columns:repeat(2,63px);gap:7px}.action{width:63px;min-width:63px;height:65px}.action.primary{width:70px;height:74px}.joystick{width:108px;height:108px}.stick{left:25px;top:25px}.dpad{width:144px;height:144px;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(3,48px)}.controls-puzzle .actions{grid-template-columns:repeat(2,59px);gap:5px}.controls-puzzle .action{width:59px;min-width:59px;height:60px}.controls-puzzle [data-action=reset]{width:121px}.context{font-size:14px}.menu-body{padding:12px}.menu-nav button{font-size:14px}.pet-panel{grid-template-columns:74px 1fr;gap:9px}.pet-panel img{width:74px}.skill-choice button{font-size:16px}.setting input[type=range]{max-width:115px}}
@media(max-height:500px){.hud{padding:7px 12px}.pet-hud{min-height:56px;max-width:230px;min-width:185px}.portrait{width:34px;height:35px}.pet-hud b{font-size:15px}.pet-hud small{font-size:13px}.supply-hud{height:42px}.icons{max-width:220px;gap:6px}.hud-icon{height:52px;min-height:52px;width:52px;min-width:52px}.hud-icon small{display:block;font-size:14px}.hud-icon img{width:24px;height:24px}.icons [data-menu=craft],.icons [data-menu=pet],.icons [data-menu=journal],.icons [data-menu=settings]{display:none}.objective{top:10px;max-width:32%;width:auto;background:transparent;font-size:16px;padding:0}.objective small{display:none}.bottom{bottom:12px;left:13px;right:13px}.actions{grid-template-columns:repeat(2,58px);gap:7px}.action{width:58px;min-width:58px;height:58px}.action.primary{width:66px;height:66px}.action img{width:27px;height:27px}.action span{font-size:14px}.action.primary img{width:31px;height:31px}.joystick{width:104px;height:104px}.stick{left:24px;top:24px}.controls-platform .action.primary{width:92px;height:62px}.context{bottom:12px;max-width:48%;width:auto;font-size:14px;line-height:1.5;padding:6px 10px;left:48%}.context.interactable{bottom:15px;width:44%;left:48%}.context-action{font-size:14px;min-height:52px;padding:5px 9px;gap:5px}.context-action img{width:25px;height:25px}.controls-puzzle .actions{grid-template-columns:repeat(2,54px);gap:6px}.controls-puzzle .action{width:54px;min-width:54px;height:56px}.controls-puzzle [data-action=reset]{width:116px;height:44px}.dpad{width:144px;height:144px;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(3,48px)}.toast{top:75px;max-width:75%;font-size:16px;padding:8px 13px}.menu-body{max-height:calc(100dvh - 93px);padding:13px 18px}.story{display:grid;grid-template-columns:75px 1fr;gap:15px;align-items:center}.story img{height:75px;width:75px;grid-row:span 2}.story h3{font-size:22px;text-align:left}.story p{font-size:16px;margin:0}.context.home{bottom:20px;font-size:16px}.save-note{display:none}}
/* The portrait wrapper owns width; inner HUD must not subtract navigation twice. */
#pet-hud{flex:0 1 260px;min-width:0}.pet-hud{width:100%;max-width:none}.icons{flex:0 0 auto}@media(max-width:680px){#pet-hud{flex:1;max-width:210px}.pet-hud{max-width:none;width:100%}}@media(max-width:350px){#pet-hud{max-width:170px}.pet-hud{max-width:none}}@media(max-height:500px){#pet-hud{max-width:205px;flex:0 1 205px}.pet-hud{min-width:0;max-width:none}}

.supply-hud{width:44px;min-width:44px;height:49px}#pet-hud .meters .meter{position:relative} .action.skill{position:relative}.action.skill .energy-number{position:absolute;right:-3px;top:-6px;background:#b8e1dd;color:#183e48;border:2px solid #37626b;border-radius:50%;font-style:normal;font-size:14px;min-width:26px;height:26px;display:grid;place-items:center}

.pet-hud b{display:block;max-width:135px;overflow:hidden;text-overflow:ellipsis}.hud .icons{flex-wrap:nowrap}@media(max-width:350px){.icons{max-width:138px}.pet-hud b{max-width:90px}}

.action.unready{filter:saturate(.3);opacity:.68}.action:active{animation:control-press .15s ease-out}@keyframes control-press{from{box-shadow:0 0 0 6px #e4e8ae77}to{box-shadow:0 0 0 0 #e4e8ae00}}
.setting label,button,.menu-nav,.skill-choice,.resources{-webkit-user-select:none;user-select:none}

/* Labels activate controls across the complete settings row. */
.setting label{cursor:pointer;min-height:44px}.setting input[type=checkbox]{width:44px;height:44px;min-width:44px;accent-color:#a1bf87}.setting input[type=range]{height:44px}.pet-hud small{font-size:14px}
