/* Breakpoints for the base HUD layout */
@media (max-width:520px){#top{gap:4px;padding:0 5px}#shield{height:36px}#res{gap:4px;justify-content:flex-start}.chip{font-size:12.5px;gap:2px;padding:2px 5px 2px 2px;flex:1 1 auto;max-width:none}.chip img{width:19px;height:19px}#ageB{padding:3px 7px 3px 5px}#ageB small{display:none}#ageB b{font-size:15px;opacity:1}.ib{width:32px;height:32px}.tab{height:min(28px,calc((100vw - 30px)/15.8))}.ib.dk{display:none}.ib.mb{display:block}#ibs .ib:not(.mb){display:none}}
@media (min-width:521px) and (max-width:859px){#ibs .ib.dk{display:block}}
@media (min-width:860px){
  #top{height:54px;padding:0 14px 0 8px}
  #logo{display:block;height:68px}#shield{display:none}
  #res{gap:12px}
  .chip{font-size:15px;max-width:140px;padding:2px 12px 2px 4px}.chip img{width:26px;height:26px}
  #ageB{padding:4px 16px 4px 10px}#ageB svg{width:21px;height:21px}#ageB small{font-size:17px}#ageB b{display:none}
  #ibs{gap:10px}.ib{width:40px;height:40px}#ibs .ib{display:block}
  #miniw{top:auto;bottom:10px;right:10px;width:244px;z-index:4}
  #mf{border-width:12px;border-image-width:12px}
  #panel{padding:17px 272px 10px 12px;min-height:176px;flex-direction:row;align-items:flex-end;gap:14px}
  #selrow{width:300px;flex:none;align-self:stretch;margin-top:22px;padding:6px 10px 6px 12px;border:14px solid transparent;border-image:var(--u-panel) 44 fill / 14px stretch;min-height:0}
  #portrait{width:64px;height:64px}
  #selname{font-size:21px}#hpbar{height:14px}#hpbar span{font-size:12px;line-height:13px}
  #center{flex:1}
  .tab{height:36px}
  #actsw{border-width:12px;border-image-width:12px}
  #acts{min-height:110px;gap:9px;padding:2px 6px 4px}
  .ab{width:92px;height:104px;border-width:9px;border-image-width:9px}
  .ab img.ic{width:48px;height:48px}.ab .nm{font-size:12.5px}.ab .co{font-size:13px}.ab .co img{width:14px;height:14px}
  #quick{flex-direction:row;bottom:196px;gap:9px;left:12px}.qb{width:54px;height:54px}
  #toast{max-width:420px;top:70px}
}
@media (min-width:860px) and (max-width:1279px){#miniw{width:176px}#mf{border-width:9px;border-image-width:9px}#panel{padding-right:200px;gap:8px;min-height:148px}#selrow{width:200px;margin-top:18px}#portrait{width:48px;height:48px}#selname{font-size:17px}#quick{bottom:200px}.qb{width:48px;height:48px}.tab{height:clamp(22px,calc((100vw - 520px)/14),34px)}#res{gap:5px;min-width:0}.chip{font-size:13px;padding:2px 9px 2px 3px;flex:0 0 auto;max-width:none;overflow:visible}#logo{transform-origin:left center;transform:scale(.72);margin-right:-50px}.chip img{width:22px;height:22px}#ageB{padding:3px 10px 3px 6px}#ageB small{font-size:16px}#ibs{gap:6px}.ib{width:40px;height:40px}.ab{width:84px;height:100px;border-width:8px;border-image-width:8px}.ab img.ic{width:44px;height:44px}.ab .nm{font-size:12px}.ab .co{font-size:11.5px}#acts{min-height:104px}}

@media (max-height:500px) and (orientation:landscape){
  #top{height:38px;padding:0 6px 0 4px;gap:4px}
  #logo{display:none}#shield{display:block;height:32px}
  #res{gap:4px;justify-content:flex-start;min-width:0}.chip{font-size:12.5px;padding:1px 6px 1px 2px;max-width:none;flex:0 1 auto}.chip img{width:18px;height:18px}
  #ageB{padding:2px 7px 2px 4px}#ageB small{font-size:13px}#ageB b{font-size:13px}
  #ibs{gap:4px}.ib{width:30px;height:30px}#ibs .ib.dk{display:none}#ibs .ib.mb{display:block}
  #miniw{top:42px;bottom:auto;right:6px;width:118px;z-index:4}#mf{border-width:6px;border-image-width:6px}
  #panel{flex-direction:row;align-items:flex-end;gap:8px;padding:4px 8px 5px;min-height:0}
  #selrow{width:176px;flex:none;align-self:stretch;margin-top:0;min-height:0;gap:6px}
  #portrait{width:40px;height:40px}#selname{font-size:14px}#hpbar{height:11px}#hpbar span{font-size:10px;line-height:10px}
  #center{flex:1;min-width:0}
  .tab{height:22px}
  #actsw{border-width:6px;border-image-width:6px}
  #acts{min-height:62px;gap:5px}
  .ab{width:62px;height:68px;border-width:6px;border-image-width:6px}.ab img.ic{width:30px;height:30px}.ab .nm{font-size:10px}.ab .co{font-size:10.5px}.ab .co img{width:11px;height:11px}
  .ab .nm{font-size:9.5px;word-break:break-word}.ab.lk .co{font-size:8.5px;white-space:normal;text-align:center;line-height:1}
  #quick{top:42px!important;bottom:auto!important;left:6px;flex-direction:column;gap:6px}.qb{width:40px;height:40px}
  #toast{top:42px;max-width:50vw}
  #overlay{padding:6px}
}
#rot{display:none;position:fixed;inset:0;z-index:100;background:#1c120a;color:#f6e7b9;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;font-family:var(--display);font-size:22px;padding:24px}
#rot .ph{width:46px;height:78px;border:4px solid #d9a441;border-radius:9px;animation:rotp 2.2s ease-in-out infinite}
@keyframes rotp{0%,25%{transform:rotate(0)}60%,100%{transform:rotate(-90deg)}}
#rot button{font:700 16px var(--body);color:#f6e7b9;background:#3a2618;border:2px solid #d9a441;border-radius:8px;padding:8px 16px;cursor:pointer}
@media (orientation:portrait) and (pointer:coarse) and (max-width:700px){#rot:not(.off){display:flex}}

@media (max-height:500px) and (orientation:landscape){
  #panel{padding:3px 6px 3px;gap:6px;align-items:center}
  #selrow{width:150px;gap:5px;align-self:center}
  #portrait{width:34px;height:34px;border-width:1px}#selname{font-size:12px}#hpbar{height:16px}#hpbar span{font-size:10px!important;line-height:11px!important}#info{display:none}
  #center{display:flex;flex-direction:row;gap:5px;align-items:stretch}
  #tabs{display:grid;grid-template-columns:44px 44px;grid-auto-rows:26px;gap:3px;padding:0;margin:0;flex:none}
  .tab{height:26px!important;width:44px;aspect-ratio:auto!important;background:linear-gradient(#5a3a1c,#33200f)!important;border:1px solid #d9a441;border-radius:5px;font-size:15px;line-height:1;filter:none!important;padding:0;display:flex;align-items:center;justify-content:center;color:#fff1c8}
  .tab.on{background:linear-gradient(#a8541c,#6a2d0c)!important}
  #t0::after{content:'Build'}#t1::after{content:'Units'}#t2::after{content:'Upgr.'}#t3::after{content:'More'}.tab::after{font:700 10px/1 var(--body);letter-spacing:0}.tab::before{display:none!important}
  #actsw{flex:1;min-width:0;border-width:4px;border-image-width:4px}
  #acts{min-height:0;gap:4px;padding:0}
  .ab{width:58px;height:50px;border-width:4px;border-image-width:4px;gap:0;padding:0}.ab img.ic{width:18px;height:18px}.ab .nm{font-size:8.5px;line-height:1}.ab .co{font-size:9px}.ab .co img{width:9px;height:9px}
  .ab.lk .co{font-size:7px}
  #selrow{border:0!important;border-image:none!important;padding:0!important;background:none!important;width:150px!important;margin:0!important}#selinfo{justify-content:center}#hpbar{max-width:none;width:100%}#selname{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #quick{top:42px!important;max-height:calc(100vh - 42px - 66px);max-height:calc(100dvh - 42px - 66px);overflow-y:auto;overflow-x:hidden;padding:6px 8px 4px 2px;margin:-6px -8px 0 -2px;left:8px;scrollbar-width:none;touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;pointer-events:auto}#quick::-webkit-scrollbar{display:none}.qb{flex:none}#qDesel{order:-1}
}

