/* ===== hud.css v1 — glass-bubble game HUD (mobile + PC) ===== */
:root{--v:clamp(3.4px,1vmin,5px);--stick:calc(var(--v)*30);--jump:calc(var(--v)*14);--hand:max(52px,calc(var(--v)*15));--bagw:max(48px,calc(var(--v)*14));--slot:max(38px,calc(var(--v)*9));--hammer:calc(var(--v)*24);--runb:calc(var(--v)*13.5);--phoneb:calc(var(--v)*14);--ctxb:calc(var(--v)*13);--gearb:calc(var(--v)*12);--dropb:calc(var(--v)*10);--by:calc(var(--v)*4);--sx:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px);--sb:env(safe-area-inset-bottom,0px);--st:env(safe-area-inset-top,0px)}
@media (orientation:portrait) and (pointer:coarse){:root{--by:calc(var(--hand) + var(--v)*7)}}

/* ---------- glass bubble ---------- */
body :is(#jump,#useBtn,#breakBtn,#runBtn,#phoneBtn,#packBtn,#dropBtn,#menuBtn,#chestBtn,#craftBtn,#tradeBtn,#ferryBtn,#feedBtn,#bridgeBtn,#talkBtn,#pirateBtn,#boatBtn,#stBtn,#shopBtn,#opBtn){
  background:radial-gradient(120% 120% at 28% 16%,rgba(255,255,255,.62) 0,rgba(255,255,255,.16) 26%,rgba(255,255,255,0) 50%),radial-gradient(90% 80% at 50% 108%,rgba(140,235,255,.42),rgba(255,255,255,0) 62%),rgba(205,232,238,.2)!important;
  border:1.5px solid rgba(255,255,255,.62)!important;color:#fff;
  box-shadow:inset 0 0 calc(var(--v)*3.2) rgba(255,255,255,.5),inset 0 calc(var(--v)*-2) calc(var(--v)*4) rgba(110,215,235,.32),0 calc(var(--v)*.8) calc(var(--v)*3) rgba(0,0,0,.4),0 0 calc(var(--v)*3.5) rgba(170,245,255,.28)!important;
  border-radius:50%!important;padding:0!important;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:filter .08s,transform .08s;
}
body :is(#jump,#useBtn,#breakBtn,#runBtn,#phoneBtn,#packBtn,#dropBtn,#menuBtn,#chestBtn,#craftBtn,#tradeBtn,#ferryBtn,#feedBtn,#bridgeBtn,#talkBtn,#pirateBtn,#boatBtn,#stBtn,#shopBtn,#opBtn):active{filter:brightness(1.25) saturate(1.1)}
body :is(#jump,#useBtn,#breakBtn,#runBtn,#phoneBtn,#packBtn,#dropBtn,#menuBtn,#boatBtn,#ferryBtn){font-size:0!important;display:flex;align-items:center;justify-content:center;overflow:visible}
body :is(#jump,#useBtn,#breakBtn,#runBtn,#phoneBtn,#packBtn,#dropBtn,#menuBtn,#boatBtn,#ferryBtn)::before{content:'';position:absolute;inset:17%;background:var(--ic) center/contain no-repeat;filter:drop-shadow(0 1.5px 1.5px rgba(0,0,0,.45));pointer-events:none}
#jump svg,#menuBtn i{display:none!important}
#jump::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolyline points='13,30 32,13 51,30' fill='none' stroke='url(%23g)' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolyline points='13,50 32,33 51,50' fill='none' stroke='url(%23g)' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}#useBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'%3E%3Crect x='17' y='11' width='7.5' height='28' rx='3.7'/%3E%3Crect x='26' y='6' width='7.5' height='32' rx='3.7'/%3E%3Crect x='35' y='8' width='7.5' height='30' rx='3.7'/%3E%3Crect x='44' y='15' width='7.5' height='24' rx='3.7'/%3E%3Crect x='15' y='30' width='38' height='25' rx='12'/%3E%3Crect x='6' y='31' width='8' height='21' rx='4' transform='rotate(-32 10 41)'/%3E%3C/g%3E%3C/svg%3E")}#breakBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='rotate(45 32 32)' fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'%3E%3Crect x='28' y='20' width='8' height='38' rx='3.5'/%3E%3Cpath d='M12 9 h32 q8 0 8 7 v4 h-8 q-4 0 -4 -2 h-28 z'/%3E%3Cpath d='M12 9 q-6 2 -7 8 l3 2 q3 -4 6 -4z'/%3E%3C/g%3E%3C/svg%3E");inset:15%}
#runBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='39' cy='11' r='6' fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cg fill='none' stroke='url(%23g)' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M37 21 L30 36'/%3E%3Cpath d='M36 24 L47 29 L52 24'/%3E%3Cpath d='M35 25 L24 27 L19 36'/%3E%3Cpath d='M30 36 L41 43 L38 57'/%3E%3Cpath d='M30 36 L22 47 L10 49'/%3E%3C/g%3E%3C/svg%3E")}#phoneBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(8 8) scale(2)' fill='url(%23g)' stroke='%235d7a8a' stroke-width='.5' stroke-linejoin='round'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/g%3E%3C/svg%3E");inset:20%}#packBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'%3E%3Cpath d='M22 22 q0 -14 10 -14 q10 0 10 14' fill='none' stroke='url(%23g)' stroke-width='5'/%3E%3Crect x='13' y='19' width='38' height='38' rx='13'/%3E%3Crect x='21' y='38' width='22' height='13' rx='5' fill='%23b4c6d0'/%3E%3Cpath d='M16 31 q16 7 32 0' fill='none' stroke='%235d7a8a' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E")}
#dropBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'%3E%3Crect x='25' y='8' width='14' height='7' rx='3'/%3E%3Crect x='11' y='15' width='42' height='9' rx='4.5'/%3E%3Cpath d='M16 26 H48 L45 54 Q44.5 58 41 58 H23 Q19.5 58 19 54 Z'/%3E%3Cpath d='M26 33 V50 M32 33 V50 M38 33 V50' stroke='%235d7a8a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");inset:22%}#menuBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(4 4) scale(2.2)' fill='url(%23g)' stroke='%235d7a8a' stroke-width='.5' stroke-linejoin='round'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/g%3E%3C/svg%3E");inset:14%}#boatBtn::before,#ferryBtn::before{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)' stroke='%235d7a8a' stroke-width='1.2' stroke-linejoin='round'%3E%3Cpath d='M6 40 H58 L50 54 Q49 56 46 56 H18 Q15 56 14 54 Z'/%3E%3Cpath d='M31 8 V36 H11 Z'/%3E%3Cpath d='M35 15 V36 H53 Z'/%3E%3C/g%3E%3C/svg%3E")}
#runBtn.on{box-shadow:inset 0 0 calc(var(--v)*3.2) rgba(255,255,255,.6),0 0 calc(var(--v)*4) rgba(120,255,200,.95),0 0 0 2px rgba(150,255,210,.85)!important}
#runBtn.tired{filter:grayscale(.8) brightness(.8)}

/* ---------- top-left: health + energy ---------- */
#hud{top:calc(var(--st) + var(--v)*2.5)!important;left:calc(var(--sx) + var(--v)*3)!important}
#hpanel{display:flex;flex-direction:column;gap:calc(var(--v)*1.1);width:max(170px,calc(var(--v)*40));padding:calc(var(--v)*1.5) calc(var(--v)*2.2);border-radius:calc(var(--v)*3.2);background:linear-gradient(rgba(255,255,255,.22),rgba(255,255,255,.08));border:1.5px solid rgba(255,255,255,.5);box-shadow:inset 0 0 calc(var(--v)*2.5) rgba(255,255,255,.25),0 3px 12px rgba(0,0,0,.35)}
#hpanel .brow{display:flex;align-items:center;gap:calc(var(--v)*1.6)}
#hpanel .ico{display:block;flex:none;width:max(16px,calc(var(--v)*4.4));height:max(16px,calc(var(--v)*4.4));background:center/contain no-repeat;filter:drop-shadow(0 1px 1px rgba(0,0,0,.5))}
#hpanel .heart{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(4 4) scale(2.2)' fill='%23ff5a6e' stroke='%23fff' stroke-width='.9' stroke-linejoin='round'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3C/svg%3E")}#hpanel .bolt{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(4 4) scale(2.2)' fill='%235fe6ff' stroke='%23fff' stroke-width='.9' stroke-linejoin='round'%3E%3Cpath d='M7 2v11h3v9l7-12h-4l4-8z'/%3E%3C/g%3E%3C/svg%3E")}
#hpanel #hbar,#hpanel #ebar{flex:1;width:auto;height:max(9px,calc(var(--v)*2.6));border:1px solid rgba(255,255,255,.55);border-radius:99px;background:rgba(0,0,0,.28);overflow:hidden;position:relative}
#hfill,#efill{height:100%;border-radius:99px;box-shadow:inset 0 -2px 3px rgba(0,0,0,.2)}
#hfill{background-image:linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,0) 60%)!important}
#efill{width:100%;background:linear-gradient(rgba(255,255,255,.55),rgba(255,255,255,0) 60%),#35d0e6;transition:width .1s}
#ebar.low #efill{background:linear-gradient(rgba(255,255,255,.4),rgba(255,255,255,0) 60%),#e6a135}
#gear{position:static!important;margin-top:calc(var(--v)*1);left:auto!important;top:auto!important}
#hmsg{text-shadow:0 1px 3px #000}

/* ---------- bottom bar: [hand][hotbar][bag] ---------- */
#bar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--sb) + var(--v)*3);z-index:6;display:flex;align-items:flex-end;gap:calc(var(--v)*1.8);pointer-events:none}
#bar>*{pointer-events:auto}
#bar #hotbar{position:static!important;left:auto!important;top:auto!important;bottom:auto!important;transform:none!important;gap:calc(var(--v)*.9);padding:calc(var(--v)*.9);border-radius:calc(var(--v)*2.4);background:rgba(8,22,18,.38);border:1.5px solid rgba(255,255,255,.2);box-shadow:0 3px 12px rgba(0,0,0,.35)}
#bar .hs{width:var(--slot);height:var(--slot);border-radius:calc(var(--slot)*.17);background:linear-gradient(rgba(34,58,48,.7),rgba(14,30,24,.78));border:1.5px solid rgba(255,255,255,.16);box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 2px 5px rgba(0,0,0,.35);transform:none;transition:box-shadow .1s,border-color .1s}
#bar .hs.sel{transform:translateY(-3px);border-color:#fff;background:linear-gradient(rgba(70,110,95,.75),rgba(24,50,42,.82));box-shadow:0 0 0 1px rgba(255,255,255,.6),0 0 calc(var(--v)*3) rgba(170,255,235,.75),inset 0 0 8px rgba(255,255,255,.2)}
#bar .hs .ic{font-size:calc(var(--slot)*.58);width:76%;height:76%;display:flex;align-items:center;justify-content:center}
#bar .hs .ic>*{max-width:100%;max-height:100%}
#bar .hs .k{left:4px;top:1px;font-size:max(9px,calc(var(--slot)*.27));font-weight:700;opacity:.9;text-shadow:0 1px 2px #000}
#bar .hs .cnt{right:3px;bottom:1px;font-size:max(10px,calc(var(--slot)*.3));text-shadow:0 1px 2px #000,0 0 3px #000}
#bar #useBtn{position:relative!important;right:auto!important;bottom:auto!important;width:var(--hand)!important;height:var(--hand)!important;flex:none}
#bar #packBtn{position:relative!important;left:auto!important;top:auto!important;transform:none!important;width:var(--bagw);height:var(--bagw);flex:none}
body.touch #bar #packBtn.nopack{display:flex!important;visibility:hidden;pointer-events:none}
#bar #dropBtn{position:absolute!important;left:auto!important;top:auto!important;transform:none!important;right:calc((var(--bagw) - var(--dropb))/2);bottom:calc(var(--bagw) + var(--v)*1.2);width:var(--dropb);height:var(--dropb)}
#selname{bottom:calc(var(--sb) + var(--v)*3 + var(--slot) + var(--v)*3.6)!important;font-size:max(11px,calc(var(--v)*3.1))!important;text-shadow:0 1px 4px #000,0 0 6px #000}
#fsBtn{left:50%!important;background:rgba(255,255,255,.14)!important;border:1.5px solid rgba(255,255,255,.5)!important;border-radius:50%!important}

/* ---------- touch controls ---------- */
#stick{width:var(--stick)!important;height:var(--stick)!important;left:calc(var(--sx) + var(--v)*3)!important;bottom:calc(var(--sb) + var(--by))!important;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0.1' y1='0' x2='0.9' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.45' stop-color='%23c3d3dc'/%3E%3Cstop offset='.7' stop-color='%238fa6b3'/%3E%3Cstop offset='1' stop-color='%23e8f2f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='%23ffffff' fill-opacity='.62'%3E%3Cpath d='M32 7 L40 17 H24Z'/%3E%3Cpath d='M32 57 L40 47 H24Z'/%3E%3Cpath d='M7 32 L17 24 V40Z'/%3E%3Cpath d='M57 32 L47 24 V40Z'/%3E%3C/g%3E%3C/svg%3E") center/78% no-repeat,radial-gradient(circle at 50% 50%,rgba(255,255,255,.06) 55%,rgba(255,255,255,.2) 100%)!important;border:1.5px solid rgba(255,255,255,.55)!important;box-shadow:inset 0 0 calc(var(--v)*3) rgba(255,255,255,.35),0 3px 14px rgba(0,0,0,.35)}
#knob{left:50%!important;top:50%!important;width:38%!important;height:38%!important;margin:-19% 0 0 -19%!important;background:radial-gradient(circle at 35% 28%,#fff 0,rgba(255,255,255,.75) 30%,rgba(190,225,232,.6) 100%)!important;box-shadow:0 2px 8px rgba(0,0,0,.4),inset 0 -3px 6px rgba(110,170,185,.4)}
#jump{width:var(--jump)!important;height:var(--jump)!important;left:calc(var(--sx) + var(--v)*3 + (var(--stick) - var(--jump))/2)!important;bottom:calc(var(--sb) + var(--by) + var(--stick) + var(--v)*2.5)!important;right:auto!important}
#breakBtn{width:var(--hammer)!important;height:var(--hammer)!important;right:calc(var(--sr) + var(--v)*3 + var(--phoneb) + var(--v)*2)!important;bottom:calc(var(--sb) + var(--by))!important;left:auto!important}
#breakBtn{background:radial-gradient(120% 120% at 28% 16%,rgba(255,255,255,.7) 0,rgba(255,255,255,.2) 26%,rgba(255,255,255,0) 50%),radial-gradient(90% 80% at 50% 108%,rgba(150,225,255,.5),rgba(255,255,255,0) 62%),rgba(205,232,238,.26)!important;border-width:2px!important}
#runBtn,#phoneBtn{position:fixed;z-index:7}
#runBtn{display:none;width:var(--runb);height:var(--runb);right:calc(var(--sr) + var(--v)*3 + var(--phoneb) + var(--v)*2 + (var(--hammer) - var(--runb))/2);bottom:calc(var(--sb) + var(--by) + var(--hammer) + var(--v)*2.2)}
body.touch #runBtn{display:flex}
#phoneBtn{display:none;width:var(--phoneb);height:var(--phoneb);right:calc(var(--sr) + var(--v)*3);bottom:calc(var(--sb) + var(--by))}
#menuBtn{width:var(--gearb)!important;height:var(--gearb)!important;top:calc(var(--st) + var(--v)*2.5)!important;right:calc(var(--sr) + var(--v)*3)!important}
body #ctxBox{right:calc(var(--sr) + var(--v)*3 + (var(--phoneb) - var(--ctxb))/2)!important;bottom:calc(var(--sb) + var(--by) + var(--phoneb) + var(--v)*2)!important;gap:calc(var(--v)*1.8)!important}
body #ctxBox>button{width:var(--ctxb)!important;height:var(--ctxb)!important;font-size:calc(var(--ctxb)*.5)!important}
body :is(#chestBtn,#craftBtn,#tradeBtn,#ferryBtn,#feedBtn,#bridgeBtn,#talkBtn,#pirateBtn,#boatBtn,#stBtn,#shopBtn,#opBtn){display:flex;align-items:center;justify-content:center;font-size:calc(var(--ctxb)*.5)}
body :is(#boatBtn,#ferryBtn){font-size:0!important}
@media (orientation:portrait) and (pointer:coarse){body #ctxBox{bottom:calc(var(--sb) + var(--by) + var(--phoneb) + var(--v)*2)!important;right:calc(var(--sr) + var(--v)*3 + (var(--phoneb) - var(--ctxb))/2)!important}}

/* ---------- panels: dark glass ---------- */
.panel,#menu .mp{background:linear-gradient(160deg,rgba(26,48,60,.97),rgba(11,24,32,.98))!important;border:1.5px solid rgba(190,240,255,.5)!important;border-radius:20px!important;box-shadow:0 16px 50px rgba(0,0,0,.7),inset 0 0 30px rgba(120,220,240,.08)!important}
.slot{background:rgba(255,255,255,.06)!important;border:1.5px solid rgba(255,255,255,.2)!important;border-radius:14px!important}
.slot.full{border-color:rgba(130,240,230,.85)!important;background:rgba(110,230,220,.13)!important}
.recipe{background:rgba(255,255,255,.06)!important;border:1.5px solid rgba(255,255,255,.2)!important;border-radius:14px!important}
:is(#invClose,#craftClose,#packClose,#tradeClose,#talkClose,#pirateClose,#menuX){background:radial-gradient(120% 120% at 30% 18%,rgba(255,255,255,.5),rgba(255,255,255,.1) 45%),rgba(200,230,238,.16)!important;border:1.5px solid rgba(255,255,255,.6)!important;color:#fff!important;box-shadow:inset 0 0 6px rgba(255,255,255,.4),0 2px 8px rgba(0,0,0,.4)}
.ptitle{text-shadow:0 2px 6px rgba(0,0,0,.6)}

/* menu / game-over screen pe game controls nahi dikhte */
body.inmenu :is(#touch,#bar,#runBtn,#phoneBtn,#menuBtn,#sfxBtn,#ctxBox,#hud){display:none!important}

/* ===== Game Over screen ===== */
#over{background:radial-gradient(circle at 50% 18%,rgba(255,236,170,.38),rgba(40,150,190,.55) 55%,rgba(8,40,70,.82));-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);gap:0;font-family:'Roboto Condensed','Arial Narrow',system-ui,sans-serif}
#over::before{content:'';display:block;flex:none;width:min(220px,46vw);height:min(24vh,130px);margin-bottom:6px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 130'%3E%3Cdefs%3E%3ClinearGradient id='w' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23b07a48'/%3E%3Cstop offset='.5' stop-color='%238a5a35'/%3E%3Cstop offset='1' stop-color='%235e3b20'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23a8714a'/%3E%3Cstop offset='1' stop-color='%236b4226'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='%233e2412' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M30 108 Q100 92 178 106 L170 118 Q100 112 38 120 Z' fill='url(%23w)'/%3E%3Cpath d='M66 104 Q60 78 68 52 Q72 44 76 40 L82 42 Q76 60 78 80 Q80 94 84 104 Z' fill='url(%23w)'/%3E%3Cpath d='M76 40 Q50 22 24 36 Q50 30 70 44 Z' fill='url(%23l)'/%3E%3Cpath d='M76 40 Q62 14 36 12 Q58 18 72 42 Z' fill='url(%23l)'/%3E%3Cpath d='M78 40 Q86 14 112 8 Q92 20 82 42 Z' fill='url(%23l)'/%3E%3Cpath d='M80 42 Q106 26 128 40 Q104 36 84 46 Z' fill='url(%23l)'/%3E%3Cpath d='M76 44 Q58 52 54 72 Q64 54 78 48 Z' fill='url(%23l)'/%3E%3Ccircle cx='142' cy='34' r='8' fill='none' stroke='%238a5a35' stroke-width='5'/%3E%3Cpath d='M142 42 V98' fill='none' stroke='%238a5a35' stroke-width='7'/%3E%3Cpath d='M128 54 H156' fill='none' stroke='%238a5a35' stroke-width='6'/%3E%3Cpath d='M116 82 Q120 106 142 106 Q164 106 168 82' fill='none' stroke='%238a5a35' stroke-width='7'/%3E%3Cpath d='M108 90 L120 76 L124 92 Z' fill='url(%23w)'/%3E%3Cpath d='M176 90 L164 76 L160 92 Z' fill='url(%23w)'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 4px 6px rgba(0,0,0,.45))}
#over h1{margin:0;font-size:clamp(32px,10vh,60px);font-weight:700;letter-spacing:2px;text-transform:uppercase;text-shadow:0 3px 10px rgba(0,0,0,.5)}
#over p{margin:2px 0 0;opacity:1;font-size:clamp(15px,4.2vh,22px);font-weight:500;text-shadow:0 2px 6px rgba(0,0,0,.5)}
#over #score{font-size:clamp(13px,3.6vh,18px);opacity:.9}
#retryBtn{width:min(15vh,88px)!important;height:min(15vh,88px)!important;margin-top:clamp(8px,3vh,20px);font-size:0!important;position:relative;border:3px solid #f6dc8a!important;background:radial-gradient(circle at 35% 25%,#fff0b8 0,#f0c75a 38%,#c8922c 100%)!important;box-shadow:inset 0 0 0 4px rgba(150,100,20,.35),inset 0 3px 8px rgba(255,255,255,.6),0 6px 18px rgba(0,0,0,.45)!important}
#retryBtn::before{content:'';position:absolute;inset:24%;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%238a5d12' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M47 24 A17 17 0 1 0 49 36'/%3E%3C/g%3E%3Cpath d='M50 10 L50 28 L33 25 Z' fill='%238a5d12' transform='rotate(8 45 20)'/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 1px 0 rgba(255,255,255,.5))}
#reviveBtn{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:clamp(8px,3vh,20px)!important;min-width:min(300px,80vw);padding:clamp(8px,2.4vh,14px) 24px!important;border-radius:999px!important;font-size:clamp(16px,4.4vh,22px)!important;font-weight:500!important;color:#fff!important;font-family:inherit;background:linear-gradient(rgba(255,255,255,.28),rgba(255,255,255,.1))!important;border:1.5px solid rgba(255,255,255,.55)!important;box-shadow:inset 0 0 14px rgba(255,255,255,.25),0 6px 18px rgba(0,0,0,.35)!important;text-shadow:0 1px 3px rgba(0,0,0,.5)}
#reviveBtn::before{content:'';width:1.5em;height:1.5em;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='18' width='48' height='34' rx='6'/%3E%3Cpath d='M22 8 L32 18 L42 8'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
#reviveBtn:active,#retryBtn:active{transform:scale(.96)}
