/* FM27 V10.83.4 – targeted display fixes; V10.83.3 remains the design baseline. */
/* Profile + match: no unused right column; intentionally not modifying their data/components. */
body.fm27-midnight .fm27-clubsite {max-width:none;width:100%;margin-left:0;margin-right:0;min-width:0}
body.fm27-midnight .fm27-p2-match {width:100%;max-width:none;min-width:0}
body.fm27-midnight .fm27-p2-match .fm27-r833-grid {grid-template-columns:minmax(0,2.5fr) minmax(250px,.9fr);max-width:100%}
/* Keep the field usable on ultrawide monitors: content fills the panel but pitch is not distorted. */
body.fm27-midnight .fm27-p2-match .fm27-r833-pitch{width:100%;max-width:1250px;justify-self:center}
/* Event column anchored directly left of player portrait, independent of row width. */
body.fm27-midnight .fm27-r833-roster a.fm27-r833-player{
  display:grid;grid-template-columns:19px 64px;column-gap:3px;align-items:center;
  justify-content:center;justify-items:center;width:min(112px,19.8%);gap:3px;min-width:0;
}
body.fm27-midnight .fm27-r833-roster .fm27-r833-player-events{
  grid-column:1;grid-row:1;justify-self:end;align-self:center;
  flex:none;width:19px;min-width:19px;max-width:19px;padding:0;
  align-items:flex-end;gap:2px;
}
body.fm27-midnight .fm27-r833-roster .fm27-r833-player-body{
  grid-column:2;grid-row:1;min-width:0;width:64px;max-width:64px;flex:none;
}
body.fm27-midnight .fm27-r833-roster .fm27-r833-player-events>span{white-space:nowrap;max-width:22px;line-height:1.2}
/* Rotate compass positions for landscape field: south left, north right, west top, east bottom. */
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map{
  height:auto;min-height:330px;max-height:none;
  grid-template-columns:minmax(76px,.86fr) minmax(145px,2.9fr) minmax(76px,.86fr);
  grid-template-rows:minmax(68px,auto) minmax(148px,1fr) minmax(68px,auto);
  grid-template-areas:'. west .' 'south pitch north' '. east .';
  gap:8px;align-items:stretch;
}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand{
  min-height:0;min-width:0;padding:8px 5px;overflow:visible;
  line-height:1.25;gap:2px;justify-content:center;
}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand span{font-size:.65rem;line-height:1.25}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand strong{font-size:.97rem;line-height:1.25}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand small{
  font-size:.57rem;line-height:1.3;color:#e4f6ff;overflow-wrap:anywhere;
}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-pitch{
  min-height:148px;background:repeating-linear-gradient(90deg,#1b704a 0 28px,#27825a 28px 56px);
}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-pitch:before{
  inset:0 50% 0 0;border-bottom:0;border-right:2px solid #d5fffab0;
}
body.fm27-midnight .fm27-s74 .fm27-r834-stadium-legend{justify-content:flex-end;margin-top:7px}
/* Nested grids never force the main club/match page wider than its parent. */
body.fm27-midnight .fm27-clubsite .fm27-clubsite-dashboard,
body.fm27-midnight .fm27-p2-match .tab-content{min-width:0;max-width:100%}
@media (max-width:980px){
  body.fm27-midnight .fm27-p2-match .fm27-r833-grid{grid-template-columns:1fr}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map{min-height:315px;grid-template-columns:minmax(66px,.85fr) minmax(140px,2.9fr) minmax(66px,.85fr)}
}
@media (max-width:610px){
  body.fm27-midnight .fm27-r833-roster a.fm27-r833-player{grid-template-columns:13px 40px;column-gap:1px;width:min(76px,19%)}
  body.fm27-midnight .fm27-r833-roster .fm27-r833-player-events{width:13px;min-width:13px;max-width:13px;font-size:.55rem}
  body.fm27-midnight .fm27-r833-roster .fm27-r833-player-body{width:40px;max-width:40px}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map{
    min-height:288px;grid-template-columns:minmax(55px,.8fr) minmax(110px,2.8fr) minmax(55px,.8fr);
    grid-template-rows:minmax(65px,auto) minmax(115px,1fr) minmax(65px,auto);gap:4px;padding:7px;
  }
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand{padding:5px 2px}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand small{font-size:.48rem}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand strong{font-size:.78rem}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-stadium-stand span{font-size:.53rem}
  body.fm27-midnight .fm27-s74 .fm27-r834-stadium-map .fm27-r83-pitch{min-height:115px}
}
