.home-mission-metrics span{font-size:12px}
.tower-targeting{order:-1;margin:10px 0;padding:8px;min-width:0}
.tower-targeting legend{padding:0 5px;font-size:12px;letter-spacing:1px}
.tower-targeting>div{display:flex;flex-wrap:wrap;gap:4px}
.tower-targeting button{flex:1 0 auto;cursor:pointer;padding:8px 6px;overflow-wrap:normal;word-break:normal}
.tower-targeting small{display:block;min-height:30px;margin-top:7px;font-size:12px;line-height:1.5}
.mobile-guide-btn,.battle-fit-toggle{display:none}
.battle-fit-toggle[hidden]{display:none}
body.game-active .site-footer{display:none}

@media(max-width:760px){
  #topbar{padding:6px 8px;gap:5px;min-height:0}
  #topbar .stats{width:100%;display:flex;justify-content:space-between;min-height:25px;padding:0;gap:3px}
  #topbar .sitem{padding:0 3px;font-size:12px;width:auto;min-width:0;flex:1 1 0}
  #topbar .sval{font-size:15px;font-variant-numeric:tabular-nums}
  #topbar .topbtns,#topbar .topbtns:has(.mobile-more-toggle:checked),#topbar .topbtns.mobile-more-open{display:grid;grid-template-columns:1fr 1.35fr 1fr .75fr;gap:5px;width:100%;position:static}
  #topbar .topbtns>.btn,#topbar .mobile-more-toggle{width:100%;margin:0}
  #topbar .mobile-more-toggle{display:block;grid-column:4;grid-row:1}
  #topbar #pbtn{grid-column:1;grid-row:1}
  #topbar #wbtn{grid-column:2;grid-row:1}
  #topbar .battle-audio-btn{grid-column:3;grid-row:1}
  #topbar .topbtns .speed-control{display:none;grid-column:1/-1;grid-row:2;min-height:40px;width:100%;padding:6px 8px}
  #topbar .topbtns:has(.mobile-more-toggle:checked) .speed-control{display:flex}
  #topbar .topbtns .top-secondary,#topbar .topbtns:focus-within .top-secondary{display:none}
  #topbar .topbtns:has(.mobile-more-toggle:checked) .top-secondary{display:flex;grid-column:auto}
  #guide-quick-tab,#support-quick-tab{display:none!important}
  #fps-display{display:none}
  #side-inner{height:calc(100% - 20px)}
  .mobile-panel-tabs{height:48px;padding:4px 8px;gap:6px}
  .tower-categories{gap:4px;padding:4px 6px;min-height:52px;flex-shrink:0}
  .tower-category-btn{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;gap:2px}
  .tower-category-btn span:last-child{display:inline}
  #tower-scroll{padding:2px 6px 6px}
  .tcards{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:0}
  .tcard{min-height:94px;grid-template-rows:42px auto auto;padding:5px 3px}
  .tcname{font-size:12px;line-height:1.3;white-space:normal}
  .tccost{font-size:12px;font-variant-numeric:tabular-nums}
  #infopanel{font-size:12px;line-height:1.5}
  #infopanel .irow{min-height:24px}
  .battle-fit-toggle{display:block;position:sticky;float:left;left:8px;bottom:8px;margin-top:-52px;margin-left:8px;z-index:8;cursor:pointer}
}
@media(max-height:600px) and (max-width:760px){
  .tower-categories{min-height:42px}
}

/* GAME-06: automatic boss-warning slow-down is visible on the speed control. */
.speed-control[data-assist="warning"]::after{content:"!";display:inline-grid;place-items:center;width:16px;height:16px;margin-left:4px;font-weight:700;font-size:12px;}
.debrief-boss-skill{margin:.5rem 0 0;font-size:max(12px,.85rem);}

/* Short landscape: dock only in an empty header. Selected tower tabs use that header. */
@media(min-width:761px) and (max-width:1080px) and (max-height:500px) and (orientation:landscape){
  #main:not(:has(#side.collapsed)):not(:has(#side .tower-action-bar)) #battle-stage{overflow:visible}
  #main:not(:has(#side.collapsed)):not(:has(#side .tower-action-bar)) #battle-stage .battle-fit-toggle{
    position:absolute;left:calc(100% + 45px);top:0;bottom:auto;
    width:calc(min(330px,32vw) - 45px);
    margin:0;z-index:9;
  }
  #side #collapse-btn{width:44px}
  #side.collapsed{width:44px}
  /* Non-modal tip text stays over the map; its close action uses HUD space. */
  @supports(top:anchor(top)){
    #wave-preview{anchor-name:--d4-wave-preview}
    body:has(#tutorial-hint[data-guidance-kind="tip"]:not([style*="display: none"])) #wave-preview{padding-right:64px}
    #tutorial-hint[data-guidance-kind="tip"]{animation:none;transform:none;overflow:visible}
    #tutorial-hint[data-guidance-kind="tip"] .th-close{
      position:fixed;position-anchor:--d4-wave-preview;top:anchor(top);bottom:auto;
      right:14px;left:auto;width:44px;
    }
  }
}

/* Short landscape (e.g. 844x390): the drawer header row plus a separate tab row left the tower
   panel only ~84px, smaller than the upgrade/sell bar. Tabs share the collapse-button row
   so the stats panel and its actions fit. */
@media(min-width:761px) and (max-width:1080px) and (max-height:600px){
  #side:not(.collapsed){position:relative}
  #side:not(.collapsed) #collapse-btn{width:44px}
  #side:not(.collapsed) #collapse-btn .field-drawer-label{display:none}
  #main #side:not(.collapsed) .mobile-panel-tabs{position:absolute;top:0;left:44px;right:0;height:44px;padding:0 6px;gap:6px}
  #side:not(.collapsed) .tower-action-bar{position:sticky;bottom:0}
}
/* The sticky action bar must sit flush with the bottom of the scroller; reserved bottom padding let details show under it. */
#side #infopanel:has(.tower-action-bar),#side[data-mobile-panel="details"] #infopanel:has(.tower-action-bar){padding-bottom:0}
/* Details scroll underneath the sticky actions; an opaque footer keeps them readable. */
.tower-action-bar{background:var(--ui-solid-surface,#111d30)}
