/* STELLAR EMPIRE 0.4.2 – one-viewport colony bridge.
   Scoped to the HOME tab; all resource, trading, research, fleet and dialog
   panels keep their independent normal scrolling.
*/
.game .main:has(> .screen.empire-dashboard){
  overflow:hidden!important;
  min-height:0;
}
.game .screen.empire-dashboard{
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-height:0!important;
  max-width:1680px;
  margin:0 auto;
  padding:10px 16px 12px!important;
  overflow:hidden!important;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:8px;
}
/* Hide old hero when stale markup is cached or future templates accidentally emit it. */
.game .screen.empire-dashboard>.home-hero,
.game .screen.empire-dashboard>.home-metrics,
.game .screen.empire-dashboard>.home-quick-links{display:none!important}
.game .screen.empire-dashboard>.planet-tabs{
  flex:0 0 auto;
  min-height:0;
  max-height:52px;
  margin:0!important;
  padding:0 0 2px;
  gap:6px;
}
.game .screen.empire-dashboard>.planet-tabs .planet-pill{
  min-height:0;
  height:43px;
  padding:4px 10px;
  border-radius:9px;
  gap:6px;
}
.game .screen.empire-dashboard>.planet-tabs .mini-planet{
  width:26px;
  height:26px;
}
.game .screen.empire-dashboard>.planet-tabs .planet-tab-title{font-size:11px}
.game .screen.empire-dashboard>.planet-tabs .planet-tab-title small{
  font-size:9px;
  margin-top:1px;
}
/* Always one compact planet bar instead of the giant header with repeated figures. */
.game .screen.empire-dashboard>.home-planetline{
  margin:0!important;
  padding:9px 13px!important;
  background:linear-gradient(102deg,#192341d9,#102439cf 70%,#161d37c9);
  border:1px solid #536588;
  border-radius:10px;
  box-shadow:inset 0 1px #ffffff19;
  min-height:53px;
  max-height:84px;
  flex:0 0 auto;
  display:flex;
  flex-wrap:nowrap;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.game .screen.empire-dashboard .home-planet-title{
  display:flex;
  flex:0 1 auto;
  min-width:0;
  align-items:center;
  gap:10px;
}
.game .screen.empire-dashboard .compact-planet-icon{
  display:grid;
  place-items:center;
  flex:none;
  width:34px;height:34px;
  color:#bcf0fc;
  font-size:24px;
  text-shadow:0 0 16px #58a8fb;
  border:1px solid #6475b2;
  border-radius:50%;
  background:radial-gradient(circle at 32% 32%,#589ba9,#182553 75%);
}
.game .screen.empire-dashboard .home-planet-copy{
  display:flex;flex-direction:column;
  min-width:0;
  gap:1px;
}
.game .screen.empire-dashboard .home-planet-copy small{
  font-size:10px;
  letter-spacing:.04em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.game .screen.empire-dashboard .home-planetline h2{
  margin:0;
  font-size:clamp(17px,1.5vw,24px);
  line-height:1.04;
  letter-spacing:.055em;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.game .screen.empire-dashboard .home-planet-controls{
  display:flex;
  flex:none;
  justify-content:flex-end;
  gap:7px;
  align-items:center;
  min-width:0;
}
.game .screen.empire-dashboard .home-survey-count{
  display:inline-flex;
  align-items:center;
  white-space:nowrap;
  font-size:10px;
  font-weight:800;
  padding:7px 9px;
  color:#b5dfee;
  border-radius:20px;
  border:1px solid #4d7591;
  background:#152e46bc;
}
.game .screen.empire-dashboard .home-planet-controls .soft-btn,
.game .screen.empire-dashboard .home-planet-controls .pill{
  min-width:0;
  padding:7px 10px;
  height:auto;
  font-size:10px;
  border-radius:8px;
}
.game .screen.empire-dashboard .home-mobile-hud{display:none}
/* Keep animated colony panorama fluid: consumes all remaining vertical pixels. */
.game .screen.empire-dashboard>.colony-scene{
  flex:1 1 0!important;
  width:100%;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  align-self:stretch;
  border-radius:11px;
  overflow:hidden;
}
.game .screen.empire-dashboard>.colony-scene canvas{
  width:100%!important;height:100%!important;display:block;
}
.game .screen.empire-dashboard .scene-overlay{
  top:10px;left:12px;
  padding:7px 10px;
  border-radius:7px;
}
.game .screen.empire-dashboard .scene-overlay strong{
  font-size:18px;
}
.game .screen.empire-dashboard .scene-overlay small{font-size:9px}
.game .screen.empire-dashboard .scene-bottom{
  left:10px;right:10px;bottom:8px;
}
.game .screen.empire-dashboard .scene-bottom span{
  padding:4px 7px;font-size:10px;
}
/* Popup-launching HUD tiles: 5 in one row on desktop / laptop. */
.game .screen.empire-dashboard>.home-action-grid{
  margin:0!important;
  padding:0;
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
  align-items:stretch;
}
.game .screen.empire-dashboard>.home-action-grid .home-action{
  min-width:0;
  min-height:61px!important;
  height:clamp(61px,8vh,76px)!important;
  margin:0;
  padding:7px 10px;
  border-radius:9px;
  display:grid;
  grid-template-columns:25px minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  align-content:center;
  align-items:center;
  column-gap:7px;
  row-gap:0;
}
.game .screen.empire-dashboard .home-action .home-action-icon{
  grid-row:1/3;
  grid-column:1;
  font-size:22px;
  line-height:1;
}
.game .screen.empire-dashboard .home-action strong{
  grid-column:2;
  grid-row:1;
  font-size:clamp(10px,1vw,13px);
  line-height:1.15;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.game .screen.empire-dashboard .home-action small{
  grid-column:2;
  grid-row:2;
  max-width:100%;
  line-height:1.2;
  font-size:10px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.game .screen.empire-dashboard .home-action .home-action-arrow{display:none!important}
/* Keep panels readable at shorter/laptop viewport sizes without any page scroll. */
@media (max-height:820px) and (min-width:761px) {
  .game .screen.empire-dashboard{padding:7px 12px 8px!important;gap:6px}
  .game .screen.empire-dashboard>.home-planetline{
    padding:6px 10px!important;min-height:45px;max-height:60px;
  }
  .game .screen.empire-dashboard>.home-action-grid .home-action{
    min-height:54px!important;height:59px!important;padding:5px 7px;
  }
  .game .screen.empire-dashboard .home-action .home-action-icon{font-size:19px}
  .game .screen.empire-dashboard .home-action small{font-size:9px}
  .game .screen.empire-dashboard>.planet-tabs .planet-pill{height:35px}
  .game .screen.empire-dashboard>.planet-tabs{max-height:41px}
}
@media (max-width:1050px) and (min-width:761px){
  .game .screen.empire-dashboard{padding:8px!important}
  .game .screen.empire-dashboard>.home-action-grid{gap:4px}
  .game .screen.empire-dashboard>.home-action-grid .home-action{
    grid-template-columns:20px minmax(0,1fr);
    column-gap:4px;padding:6px 5px;
  }
  .game .screen.empire-dashboard .home-action strong{font-size:10px}
  .game .screen.empire-dashboard .home-action small{font-size:9px}
  .game .screen.empire-dashboard .home-survey-count{display:none}
}
/* Mobile: keep the navigation bar clear and still fit the full start screen.
   At least some image always remains visible; if space is tiny the image shrinks,
   not the popup buttons or navigation. */
@media(max-width:760px){
  .game .main:has(> .screen.empire-dashboard){
    overflow:hidden!important;
    padding:0 0 64px!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
  }
  .game .screen.empire-dashboard{
    width:100%;
    max-width:100%;
    height:100%!important;
    min-height:0!important;
    padding:6px 7px 8px!important;
    gap:5px;
    overflow:hidden!important;
  }
  .game .screen.empire-dashboard>.home-planetline{
    flex:0 0 auto;
    gap:4px 8px;
    flex-wrap:wrap;
    min-height:58px;
    max-height:95px;
    padding:5px 8px!important;
  }
  .game .screen.empire-dashboard .home-planet-title{gap:6px}
  .game .screen.empire-dashboard .compact-planet-icon{width:23px;height:23px;font-size:15px}
  .game .screen.empire-dashboard .home-planet-copy small{
    font-size:9px;
  }
  .game .screen.empire-dashboard .home-planetline h2{
    font-size:17px;
  }
  .game .screen.empire-dashboard .home-planet-controls{
    gap:4px;
  }
  .game .screen.empire-dashboard .home-survey-count{display:none}
  .game .screen.empire-dashboard .home-planet-controls .soft-btn{
    padding:4px 6px;font-size:9px;
  }
  .game .screen.empire-dashboard .home-planet-controls .pill{
    display:none;
  }
  .game .screen.empire-dashboard .home-mobile-hud{
    display:flex;
    flex:1 0 100%;
    justify-content:space-around;
    min-width:0;
    gap:4px;
    padding-top:4px;
    border-top:1px solid #63779a52;
  }
  .game .screen.empire-dashboard .home-mobile-hud span{
    font-size:9px;
    font-weight:750;
    color:#b8daec;
    white-space:nowrap;
  }
  .game .screen.empire-dashboard>.planet-tabs{
    max-height:39px;
    margin:0!important;
    padding:0;
    min-height:0;
  }
  .game .screen.empire-dashboard>.planet-tabs .planet-pill{
    min-height:0;height:34px;padding:3px 6px;
  }
  .game .screen.empire-dashboard>.planet-tabs .mini-planet{width:20px;height:20px}
  .game .screen.empire-dashboard>.planet-tabs .planet-tab-title{font-size:10px}
  .game .screen.empire-dashboard>.planet-tabs .planet-tab-title small{display:none}
  .game .screen.empire-dashboard>.colony-scene{
    border-radius:9px;
    flex:1 1 0!important;
    min-height:0!important;height:auto!important;
  }
  .game .screen.empire-dashboard .scene-overlay{left:6px;top:6px;padding:4px 6px}
  .game .screen.empire-dashboard .scene-overlay strong{font-size:14px}
  .game .screen.empire-dashboard .scene-overlay small{font-size:8px}
  .game .screen.empire-dashboard .scene-bottom{left:6px;right:6px;bottom:5px}
  .game .screen.empire-dashboard .scene-bottom span{padding:3px 5px;font-size:9px}
  .game .screen.empire-dashboard>.home-action-grid{
    flex:0 0 auto;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:4px;
    margin:0!important;
  }
  .game .screen.empire-dashboard>.home-action-grid .home-action{
    min-height:61px!important;height:61px!important;
    display:flex;flex-direction:column;
    justify-content:center;
    align-items:center;text-align:center;
    padding:4px 2px;
    gap:3px;
  }
  .game .screen.empire-dashboard .home-action .home-action-icon{
    font-size:19px;
    line-height:1.1;
  }
  .game .screen.empire-dashboard .home-action strong{
    font-size:clamp(8px,2.05vw,10px);
    line-height:1.1;
    overflow:hidden;
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    max-width:100%;
    text-overflow:ellipsis;
  }
  .game .screen.empire-dashboard .home-action small{display:none}
  .game .screen.empire-dashboard .home-action .home-action-arrow{display:none}
}
@media(max-width:760px) and (max-height:720px){
  .game .screen.empire-dashboard>.home-action-grid .home-action{
    min-height:49px!important;height:49px!important;gap:1px;
  }
  .game .screen.empire-dashboard .home-action .home-action-icon{font-size:17px}
  .game .screen.empire-dashboard>.home-planetline{
    min-height:48px;max-height:79px;
  }
  .game .screen.empire-dashboard .scene-overlay small:first-child{display:none}
}
@media(max-width:760px) and (max-height:600px){
  .game .screen.empire-dashboard>.home-planetline{min-height:40px}
  .game .screen.empire-dashboard .home-mobile-hud{display:none}
  .game .screen.empire-dashboard>.home-action-grid .home-action{
    min-height:39px!important;height:39px!important;
  }
  .game .screen.empire-dashboard .home-action .home-action-icon{font-size:14px}
  .game .screen.empire-dashboard .home-action strong{font-size:8px}
}
