/* One final layout authority replaces the conflicting historical fixed offsets. */
:root{--tf-gap:clamp(6px,1vw,14px);--tf-side:220px;--tf-dock:100px;--tf-top:58px}
html,body{height:100dvh;min-width:320px}#game,#world3d,#tideforgeOriginalIslandCanvas{inset:0!important;width:100vw!important;height:100dvh!important}
.hud{box-sizing:border-box;left:var(--tf-gap)!important;top:70px!important;bottom:auto!important;width:var(--tf-side)!important;max-height:calc(100dvh - var(--tf-dock) - 90px)!important;overflow:auto;font-size:12px!important}
#profileBar{left:var(--tf-gap)!important;top:var(--tf-gap)!important;width:var(--tf-side)!important;max-width:var(--tf-side)!important;box-sizing:border-box}
#tfResourceStrip{left:calc(var(--tf-side) + 2*var(--tf-gap))!important;right:220px!important;top:var(--tf-gap)!important;height:42px!important;width:auto!important}
.buttons{left:var(--tf-gap)!important;top:auto!important;bottom:calc(var(--tf-dock) + var(--tf-gap))!important;width:var(--tf-side)!important;max-width:var(--tf-side)!important;max-height:90px!important;display:flex!important;flex-flow:row wrap!important;overflow:auto!important;box-sizing:border-box}
.buttons button{flex:0 0 35px!important;width:35px!important;min-width:35px!important;height:33px!important;min-height:33px!important}
.actions{box-sizing:border-box;left:calc(var(--tf-side) + 2*var(--tf-gap))!important;right:168px!important;top:auto!important;bottom:var(--tf-gap)!important;width:auto!important;max-width:none!important;min-height:82px!important;max-height:86px!important;display:flex!important;flex-flow:row nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;justify-content:flex-start!important;align-items:stretch!important;padding:5px!important;gap:5px!important}
.actions button{flex:0 0 72px!important;min-width:72px!important;width:72px!important;height:70px!important;min-height:70px!important;font-size:10px!important;padding:4px!important}.actions #seaAudioToggle{display:block!important}
#cameraCombatButtons{right:var(--tf-gap)!important;bottom:var(--tf-gap)!important;width:144px!important;max-height:86px!important;gap:4px!important}#cameraCombatButtons button{padding:7px!important;min-height:37px!important}
#chatBox{left:auto!important;right:var(--tf-gap)!important;bottom:calc(var(--tf-dock) + var(--tf-gap))!important;width:260px!important;max-width:260px!important}#chatMessages{height:110px!important}
#tfMiniMap{right:var(--tf-gap)!important;top:70px!important;width:160px!important;height:102px!important}#tideforgeAttackFeed{top:185px!important;right:var(--tf-gap)!important;max-width:240px!important}
#tfPositionBadge{left:var(--tf-gap)!important;right:auto!important;bottom:var(--tf-gap)!important;max-width:var(--tf-side)!important;box-sizing:border-box}
#repairTools{right:var(--tf-gap)!important;top:var(--tf-gap)!important;width:198px!important;justify-content:flex-end!important}#repairTools button{min-height:35px}
#navigationStatus{left:50%!important;top:58px!important;max-width:min(40vw,500px);white-space:normal}.help{display:none!important}
#oilPanel,#portPopup{right:calc(280px + var(--tf-gap))!important;bottom:calc(var(--tf-dock) + var(--tf-gap))!important;max-height:50dvh!important;overflow:auto;box-sizing:border-box}
#carrierPanel{left:calc(var(--tf-side) + 2*var(--tf-gap))!important;right:280px!important;bottom:calc(var(--tf-dock) + var(--tf-gap))!important;transform:none!important;width:auto!important;max-height:35dvh;overflow:auto}
.panel{inset:70px max(12px,calc((100vw - 1200px)/2)) calc(var(--tf-dock) + 12px)!important;transform:none!important;box-sizing:border-box;width:auto!important;max-width:none!important;max-height:none!important;z-index:200!important}.panel input,.panel button{max-width:100%;box-sizing:border-box}.panel button{min-height:32px}
@media(min-width:2200px){:root{--tf-gap:18px;--tf-side:248px}.hud{font-size:14px!important}.actions button{flex-basis:82px!important;width:82px!important}.panel{font-size:13px!important}}
@media(max-width:900px){:root{--tf-side:180px;--tf-gap:6px}.hud{font-size:11px!important}#chatBox{width:210px!important;max-width:210px!important}#chatMessages{height:80px!important}#carrierPanel{right:12px!important;bottom:210px!important}#oilPanel,#portPopup{right:228px!important;width:200px!important;min-width:0!important}.actions{left:192px!important}#tfResourceStrip{right:160px!important}#repairTools{width:148px!important;gap:2px}#repairTools button{font-size:10px;padding:5px}#tfMiniMap{width:130px!important;height:83px!important}}
@media(max-width:600px){:root{--tf-side:150px;--tf-dock:132px}.hud{top:105px!important;width:150px!important;max-height:calc(100dvh - 340px)!important;font-size:10px!important}#profileBar{width:150px!important;max-width:150px!important;font-size:10px!important}#tfResourceStrip{left:6px!important;right:6px!important;top:53px!important;height:40px!important}.buttons{left:6px!important;bottom:142px!important;width:150px!important;max-width:150px!important;max-height:76px!important}.buttons button{flex-basis:30px!important;width:30px!important;min-width:30px!important;height:29px!important;min-height:29px!important}#chatBox{right:6px!important;bottom:142px!important;width:calc(100vw - 174px)!important;max-width:240px!important}#chatMessages{height:64px!important}#chatForm{padding:4px!important}#chatInput{width:70px;padding:5px!important}#chatForm button{padding:4px!important}.actions{left:6px!important;right:6px!important;bottom:48px!important;max-height:78px!important;min-height:78px!important}.actions button{height:65px!important;min-height:65px!important;flex-basis:65px!important;width:65px!important;min-width:65px!important}#cameraCombatButtons{bottom:5px!important;right:6px!important;left:174px!important;width:auto!important;flex-direction:row!important;max-height:37px!important}#cameraCombatButtons button{flex:1;font-size:9px!important;min-height:33px!important;padding:3px!important}#tfPositionBadge{bottom:7px!important;left:6px!important;font-size:10px!important;max-width:162px!important}#tfMiniMap{top:105px!important;right:6px!important;width:110px!important;height:70px!important}#navigationStatus{top:95px!important;left:50%!important;font-size:9px!important;max-width:130px;padding:3px!important}#tideforgeAttackFeed{top:185px!important;max-width:calc(100vw - 174px)!important;font-size:10px!important}#oilPanel,#portPopup{left:162px!important;right:6px!important;bottom:310px!important;width:auto!important;max-height:26dvh!important;font-size:10px!important}#carrierPanel{left:6px!important;right:6px!important;bottom:220px!important}.panel{inset:98px 6px 142px!important}#repairTools{width:calc(100vw - 168px)!important;right:6px!important;top:8px!important}.admiralAlert{min-width:0!important;max-width:80vw!important}}
@media(max-height:600px) and (min-width:601px){.hud{max-height:calc(100dvh - 220px)!important}.buttons{max-height:64px!important}#chatMessages{height:45px!important}#tfMiniMap{height:70px!important}#tideforgeAttackFeed{top:150px!important;max-height:80px;overflow:hidden}.panel{inset:58px 12px 108px!important}}
/* Reset surviving transforms and flex directions from earlier HUD generations. */
.actions{transform:none!important}
#repairTools{flex-flow:row nowrap!important;height:35px!important}#repairTools button{flex:1 1 0!important;min-width:0!important;white-space:nowrap!important}
#profileBar{display:flex;gap:5px!important;padding:6px!important;align-items:center!important;overflow:hidden!important;font-size:11px!important}#profileBar span{display:none!important}#profileBar strong{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#profileBar button{flex:0 0 auto;font-size:10px!important;padding:5px!important}
.buttons button:before{content:attr(data-tf-short)!important;font-size:9px!important;font-weight:700!important;letter-spacing:0!important}
.actions button{overflow:hidden!important;overflow-wrap:anywhere!important;font-size:9px!important}
@media(max-width:600px){#navigationStatus{left:auto!important;right:6px!important;top:180px!important;transform:none!important;width:calc(100vw - 174px)!important;max-width:240px!important;box-sizing:border-box}#tideforgeAttackFeed{top:213px!important}#repairTools{top:7px!important}}
.actions #ammoBtn{display:none!important} /* Replaced by the two functional, stock-labelled AP/HE selectors. */
#tfAPBtn,#tfHEBtn{font-size:11px!important}#tfAPCount,#tfHECount{font-size:12px!important;display:block!important}
.actions #seaAudioSlot{display:none!important}
@media(max-width:600px){.buttons{max-height:110px!important}}
@media(min-width:901px){#carrierPanel{right:510px!important}}
@media(max-width:900px){#carrierPanel{left:calc(var(--tf-side) + 2*var(--tf-gap))!important;right:6px!important;top:190px!important;bottom:auto!important;max-height:clamp(70px,calc(100dvh - 540px),180px)!important}#portPopup,#oilPanel{left:6px!important;right:auto!important;top:250px!important;bottom:auto!important;width:var(--tf-side)!important;max-height:max(70px,calc(100dvh - 520px))!important}}
@media(max-width:600px){#carrierPanel{left:162px!important;top:214px!important}}
