/* Stellar Empire 0.6.66 – precise red attacked planet tab.
   Strong contrast even when the selected tab has its normal cyan style. */
.game .planet-tabs .planet-pill.planet-under-attack{
 position:relative!important;isolation:isolate;
 color:#fff!important;border:2px solid #ff6a79!important;
 background:linear-gradient(115deg,#622039,#38172f)!important;
 animation:stellar-attacked-planet 1.25s ease-in-out infinite!important;
 outline-offset:2px;overflow:hidden;
}
.game .planet-tabs .planet-pill.planet-under-attack .planet-tab-title,
.game .planet-tabs .planet-pill.planet-under-attack .planet-tab-title small{
 color:#fff!important;text-shadow:0 1px 3px #000!important;
}
.game .planet-tabs .planet-pill.planet-under-attack:focus-visible{
 outline:3px solid #fff!important;
}
.game .planet-attack-indicator{
 position:absolute;z-index:3;right:4px;top:2px;
 display:grid;place-items:center;width:21px;height:21px;
 font-size:15px;color:#fff;background:#a51d31;border:1px solid #ffd0d7;
 border-radius:50%;text-shadow:0 1px 3px #300;
}
@keyframes stellar-attacked-planet{
 0%,100%{background:linear-gradient(115deg,#622039,#38172f);border-color:#e46574;box-shadow:inset 0 0 6px #d4323f55,0 0 3px #6c1e35}
 50%{background:linear-gradient(115deg,#c32b41,#5d1427);border-color:#ffdbe1;box-shadow:inset 0 0 20px #f8414d99,0 0 19px #ff445eae}
}
@media(prefers-reduced-motion:reduce){
 .game .planet-tabs .planet-pill.planet-under-attack{
  animation:none!important;box-shadow:0 0 0 2px #ff6977!important;
 }
}
.planet-attack-dialog .dialog-body{max-height:75dvh;overflow-y:auto}
.planet-attack-dialog .planet-attack-dialog{display:grid;gap:12px}
.planet-attack-summary{
 display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;
 padding:12px;border-radius:9px;border:1px solid #d76b82;
 background:linear-gradient(115deg,#492135,#271c3f);color:#ffe9ee;
}
.planet-attack-summary strong{font-size:clamp(16px,2vw,22px)}
.planet-attack-summary span{color:#ffd0db;font-size:12px}
.planet-attack-entry{
 margin:12px 0;border:1px solid #bd6378;border-left:4px solid #f2758a;
 background:linear-gradient(135deg,#241e39,#162641);border-radius:9px;padding:13px;
}
.planet-attack-entry>strong{display:block;color:#ffe3ea;font-size:15px}
.planet-attack-entry>small{display:block;margin-top:5px;color:#b7cde3}
.planet-attack-entry.planet-attack-simulation{border-left-color:#f2bc63}
.planet-attack-report-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;margin-top:10px;font-size:13px}
.planet-attack-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:11px 0}
.planet-attack-facts>div{
 display:grid;gap:5px;padding:9px;border:1px solid #516f93;border-radius:8px;
 background:#0d1f39;min-width:0;
}
.planet-attack-facts dt{color:#abcae1;font-size:11px}
.planet-attack-facts dd{margin:0;color:#fff;font-size:13px;font-weight:800;overflow-wrap:anywhere}
.planet-attack-intel{color:#b9d6ee;font-size:12px;line-height:1.6}
.planet-attack-ships{display:flex;flex-wrap:wrap;gap:6px}
.planet-attack-ships>span{background:#143450;padding:7px 10px;border-radius:7px;color:#d5eefb}
@media(max-width:520px){
 .planet-attack-facts{grid-template-columns:1fr 1fr}
 .planet-attack-entry{padding:10px}
}

/* Intermediate portrait tablet size: existing late v064 rules force 10
   side-by-side photos into a 600–800px content panel. Rebalance ONLY this
   width range; keep phone <=760 and PC >=1151 completely unchanged. */
@media(min-width:761px) and (max-width:1150px){
 /* Widen available center space without radically altering sidebar controls. */
 .game.messages-collapsed .layout{
   grid-template-columns:196px minmax(0,1fr) 0px!important;
 }
 .game:not(.messages-collapsed) .layout{
   grid-template-columns:196px minmax(0,1fr) minmax(0,185px)!important;
 }
 /* Put the five status numbers on their OWN full-width row, not squeezed
    between the Koloniezentrale button and command controls. */
 .game .screen.empire-dashboard>.home-planetline{
   display:grid!important;
   grid-template-columns:minmax(0,1fr) auto!important;
   grid-template-areas:"colony controls" "hud hud"!important;
   align-items:center!important;
   height:auto!important;min-height:0!important;max-height:none!important;
   padding:8px 10px!important;gap:6px!important;
   overflow:visible!important;
 }
 .game .screen.empire-dashboard>.home-planetline>.status-planet-btn{
   grid-area:colony!important;
   flex:auto!important;width:auto!important;
   max-width:none!important;min-width:0!important;
   height:42px!important;min-height:42px!important;
   justify-content:flex-start!important;
 }
 .game .screen.empire-dashboard>.home-planetline>.home-planet-controls{
   grid-area:controls!important;width:auto!important;max-width:100%!important;
   justify-content:flex-end!important;
 }
 .game .screen.empire-dashboard>.home-planetline>.home-command-hud{
   grid-area:hud!important;
   display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
   grid-template-rows:1fr!important;gap:6px!important;
   width:100%!important;min-width:0!important;
   height:58px!important;min-height:58px!important;max-height:58px!important;
   overflow:visible!important;
 }
 .game .screen.empire-dashboard .home-command-hud>.hud-chip{
   display:flex!important;flex-direction:row!important;
   align-items:center!important;justify-content:center!important;
   width:100%!important;min-width:0!important;
   height:58px!important;min-height:58px!important;max-height:58px!important;
   gap:5px!important;padding:7px 5px!important;
 }
 .game .screen.empire-dashboard .home-command-hud>.hud-chip .hud-chip-icon{
   width:23px!important;height:23px!important;flex:0 0 23px!important;
 }
 .game .screen.empire-dashboard .home-command-hud>.hud-chip .hud-chip-data{
   display:flex!important;flex-direction:column!important;gap:3px!important;
   flex:1 1 0!important;align-items:flex-start!important;text-align:left!important;
   width:auto!important;min-width:0!important;overflow:hidden!important;
 }
 .game .screen.empire-dashboard .home-command-hud .hud-chip-data small{
   font-size:9px!important;line-height:1.15!important;
   letter-spacing:0!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 .game .screen.empire-dashboard .home-command-hud .hud-chip-data strong{
   font-size:12px!important;line-height:1.25!important;
   overflow:hidden!important;text-overflow:ellipsis!important;
   white-space:nowrap!important;width:100%!important;
 }

 /* Five resources per line = two genuine rows, even after the v064 photo rules. */
 .game .screen.empire-dashboard>#resourceStripInline{
   display:flex!important;flex-direction:column!important;
   height:205px!important;min-height:205px!important;max-height:205px!important;
   flex:0 0 205px!important;
   padding:6px 9px 8px!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline>.resource-rail{
   display:grid!important;
   grid-template-columns:repeat(5,minmax(0,1fr))!important;
   grid-template-rows:repeat(2,minmax(0,1fr))!important;
   grid-auto-flow:row!important;gap:6px!important;
   width:100%!important;min-width:0!important;
   height:auto!important;min-height:0!important;max-height:none!important;
   overflow:hidden!important;
   align-items:stretch!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile{
   display:block!important;min-width:0!important;width:100%!important;
   height:100%!important;min-height:0!important;max-height:100%!important;
   padding:0!important;overflow:hidden!important;border-radius:8px!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile>.res-data{
   position:absolute!important;
   inset:auto 0 0 0!important;
   width:100%!important;max-height:100%!important;height:auto!important;
   display:flex!important;flex-direction:column!important;
   align-items:center!important;justify-content:flex-end!important;
   gap:2px!important;
   padding:6px 4px 7px!important;
   overflow:hidden!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile .res-name{
   font-size:11px!important;line-height:1.2!important;
   white-space:nowrap!important;overflow:hidden!important;
   text-overflow:ellipsis!important;width:100%!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile .res-amount{
   font-size:clamp(12px,1.5vw,16px)!important;line-height:1.25!important;
   white-space:nowrap!important;overflow:hidden!important;
   text-overflow:ellipsis!important;width:100%!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile .res-rate{
   font-size:11px!important;line-height:1.22!important;
   white-space:nowrap!important;overflow:hidden!important;
   text-overflow:ellipsis!important;width:100%!important;
 }
 .game .screen.empire-dashboard>#resourceStripInline .resource-tile .res-capacity{
   font-size:9px!important;line-height:1.1!important;
   max-width:100%!important;overflow:hidden!important;white-space:nowrap!important;
   text-overflow:ellipsis!important;
 }
 /* 10 useful commands: 4 across, instead of five narrow unreadable tiles. */
 .game .screen.empire-dashboard>.home-action-grid{
   display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
   grid-auto-rows:66px!important;gap:7px!important;min-width:0!important;
 }
 .game .screen.empire-dashboard>.home-action-grid>.home-action:nth-child(n){
   height:66px!important;min-height:66px!important;max-height:66px!important;
   padding:7px!important;gap:4px!important;
   grid-template-columns:25px minmax(0,1fr)!important;
   grid-template-rows:auto auto!important;
   justify-items:stretch!important;text-align:left!important;
 }
 .game .screen.empire-dashboard>.home-action-grid .home-action-art .home-action-icon{
   grid-column:1!important;grid-row:1/3!important;
   width:25px!important;height:25px!important;
 }
 .game .screen.empire-dashboard>.home-action-grid .home-action-art strong{
   grid-column:2!important;grid-row:1!important;
   font-size:12px!important;line-height:1.15!important;text-align:left!important;
   white-space:normal!important;overflow:hidden!important;
   overflow-wrap:break-word!important;display:-webkit-box!important;
   -webkit-box-orient:vertical;-webkit-line-clamp:2;
 }
 .game .screen.empire-dashboard>.home-action-grid .home-action-art small{
   grid-column:2!important;grid-row:2!important;
   font-size:10px!important;line-height:1.18!important;text-align:left!important;
   white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;
 }
}
