/* FM27 V10.72.4 — frontend-only polish.  Native OWS click/drag targets stay intact. */
/* Keep search, position filter and all three actions on one horizontal line
   where the content area is wide enough.  The V10.70 JS groups the buttons
   into .fm27-v70-roster-actions; override its inherited margin/overflow. */
@media (min-width:760px) {
  body.fm27-squad-page .fm27-roster-panel-head.fm27-context-band-secondary {
    display:flex;flex-wrap:nowrap;align-items:center;
    gap:0;padding:.55rem .75rem;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-context-band-caption {
    display:none; /* redundant beside the Kaderkennzahlen and table */
  }
  body.fm27-squad-page .fm27-roster-panel-head.fm27-context-band-secondary .fm27-roster-controls {
    display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;
    gap:.5rem;width:100%;min-width:0;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-roster-search {
    min-width:120px;flex:1 1 210px;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-roster-search input {
    width:100%;max-width:none;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls #fm27RosterPosition {
    flex:0 0 155px;width:155px;max-width:155px;min-width:0;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-v70-roster-actions {
    display:flex;flex:0 0 auto;align-items:center;flex-wrap:nowrap;
    gap:.4rem;width:auto;max-width:none;min-width:0;
    margin-left:0!important;overflow:visible!important;padding-bottom:0!important;
    white-space:nowrap;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-v70-roster-actions .btn {
    height:34px;display:inline-flex;align-items:center;justify-content:center;
    gap:.3rem;white-space:nowrap;
  }
}
/* Deliberately allow wrapping on narrow/mobile layouts, rather than
   shrinking inputs to unusable widths or clipping the Spalten dropdown. */
@media (max-width:759.98px) {
  body.fm27-squad-page .fm27-roster-panel-head .fm27-context-band-caption {display:none}
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls {
    display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;gap:.45rem;width:100%;
  }
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-roster-search {flex:1 1 170px;min-width:145px}
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls #fm27RosterPosition {flex:1 1 145px;max-width:none;min-width:135px}
  body.fm27-squad-page .fm27-roster-panel-head .fm27-roster-controls .fm27-v70-roster-actions {
    display:flex;align-items:center;flex-wrap:nowrap;gap:.4rem;
    margin-left:0!important;width:auto;max-width:100%;overflow-x:auto;padding-bottom:2px;
  }
}
/* OWS creates a REAL .positionPlayerRemove link directly under each occupied
   .position. Move only that existing visual click target into the right part
   of the magenta position ribbon (without duplicating or rerouting an action).
   Header centre: slot centre + face height + pitch-card top offset. */
body.fm27-squad-page.fm27-v72-ready #formationForm #pitch .position.fm27-v72-pitch-occupied > .positionPlayerRemove {
  position:absolute!important;z-index:30;
  top:15px!important;left:calc(50% + 24px)!important;right:auto!important;
  width:15px;height:15px;margin:0;padding:0;
  display:flex;align-items:center;justify-content:center;
  border:0;border-radius:3px;line-height:1;
  color:#f8eafa!important;background:rgba(22,15,35,.16);
  text-shadow:0 1px 2px rgba(0,0,0,.45);text-decoration:none;
  cursor:pointer;pointer-events:auto;
}
body.fm27-squad-page.fm27-v72-ready #formationForm #pitch .position.fm27-v72-pitch-occupied > .positionPlayerRemove i {
  color:inherit!important;font-size:10px;line-height:1;
}
body.fm27-squad-page.fm27-v72-ready #formationForm #pitch .position.fm27-v72-pitch-occupied > .positionPlayerRemove:is(:hover,:focus-visible) {
  background:rgba(255,255,255,.22);color:#fff!important;
  outline:1px solid rgba(255,255,255,.7);outline-offset:0;
}
@media (max-width:550px) {
  body.fm27-squad-page.fm27-v72-ready #formationForm #pitch .position.fm27-v72-pitch-occupied > .positionPlayerRemove {
    top:11px!important;left:calc(50% + 18px)!important;
  }
}

/* V10.72.5: search & position stay compact at LEFT; grouped actions RIGHT.
   Restore the original 205px search width instead of stretching it across
   the green toolbar. Mobile retains the existing wrapping behavior. */
@media (min-width:760px) {
  body.fm27-squad-page .fm27-roster-panel-head.fm27-context-band-secondary .fm27-roster-controls .fm27-roster-search {
    flex:0 0 205px!important;width:205px!important;max-width:205px!important;min-width:0;
  }
  body.fm27-squad-page .fm27-roster-panel-head.fm27-context-band-secondary .fm27-roster-controls .fm27-v70-roster-actions {
    margin-left:auto!important;
  }
}
/* Obsolete drag instructions ONLY for adult lineups; retain the underlying
   native OWS pitch/bench drop targets and empty-bench placeholder nodes. */
body.fm27-squad-page.fm27-v72-ready #formationForm .fm27-v69-pitch-head>span {display:none!important}
body.fm27-squad-page.fm27-v72-ready #formationForm .benchposition .benchPlaceholder {display:none!important}
