/* Each shirt, attached event tray and name form one player-owned unit. */
#tpcMatchCentreTacticalBoard .tpc-mc-event-list {
  position:relative; display:grid; grid-template-columns:repeat(2,16px); grid-auto-rows:16px; grid-auto-flow:row dense;
  justify-content:center; align-content:start; align-items:center;
  box-sizing:border-box; gap:4px; width:40px; min-width:0; margin:44px auto 0; padding:1px;
  border:1px solid #ffffff50; border-radius:7px; background:#052e29cc; font-style:normal; pointer-events:none;
}
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge[data-event-lane="left"] { grid-column:1; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge[data-event-lane="right"] { grid-column:2; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-list:empty { display:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-list:not(:has([data-event-lane="left"])),
#tpcMatchCentreTacticalBoard .tpc-mc-event-list:not(:has([data-event-lane="right"])) { width:20px; grid-template-columns:16px; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-list:not(:has([data-event-lane="left"])) .tpc-mc-event-badge { grid-column:1; }
/* A short stem meets the shirt hem. No event can float below its owner's name. */
#tpcMatchCentreTacticalBoard .tpc-mc-event-list::before { content:""; position:absolute; bottom:100%; left:calc(50% - .5px); width:1px; height:5px; background:#ffffff80; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge {
  display:inline-flex; flex:0 0 16px; align-items:center; justify-content:center;
  position:relative; box-sizing:border-box; width:16px; min-width:16px; height:16px; padding:1px; border:0; grid-row:auto;
  border-radius:50%; background:#fff; color:#173151;
  font-size:11px; font-style:normal; font-weight:850; line-height:1;
}
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge svg { width:14px; height:14px; flex:0 0 14px; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge em { position:absolute; top:-3px; right:-1px; min-width:9px; padding:0 1px; border-radius:3px; color:#173151; background:#fff; font:850 8px/9px system-ui,sans-serif; font-variant-numeric:tabular-nums; box-shadow:0 0 0 1px #53647b; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge.is-yellow-card { color:#977000; background:transparent; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge.is-yellow-card svg { color:var(--cup-yellow,#f1c30b); filter:drop-shadow(0 0 .4px #6c5500); }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge:is(.is-red-card,.is-sub-off,.is-penalty-miss,.is-own-goal) { color:#b42333; background:#fff; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge.is-red-card { color:#ff5964; background:transparent; filter:drop-shadow(0 0 .4px #38202a); }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge.is-sub-on { color:#087746; background:#fff; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-badge:is(.is-penalty-goal,.is-direct-free-kick-goal,.is-penalty-save) { color:var(--cup-blue,#001e8e); background:#fff3af; }
/* The captain mark sits on the jersey edge, not in the event grid: selecting a
   captain never changes the size of a tile or crowds out a match-event icon. */
#tpcMatchCentreTacticalBoard .tpc-mc-captain-badge { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; flex:0 0 13px; width:13px; height:13px; padding:0; border:1px solid #fff; border-radius:50%; background:var(--cup-blue,#001e8e); color:var(--cup-yellow,#f1c30b); font:900 9px/1 system-ui,sans-serif; pointer-events:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-player-kit > .tpc-mc-captain-badge { position:absolute; left:calc(50% + 9px); top:29px; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend { margin:0 0 1rem; border:1px solid #ced9ef; border-radius:12px; background:#f4f7fd; color:#253759; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend summary { cursor:pointer; display:list-item; width:fit-content; min-height:44px; padding:.7rem .9rem; color:var(--cup-blue,#001e8e); font-size:.8rem; font-weight:800; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend ul { display:flex; flex-wrap:wrap; gap:.6rem 1rem; padding:0 .9rem .65rem; margin:0; list-style:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend li { display:flex; align-items:center; gap:.4rem; font-size:.75rem; line-height:1.4; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend p { max-width:80ch; margin:0; padding:0 .9rem .8rem; font-size:.75rem; line-height:1.6; color:#526580; }
#tpcMatchCentreTacticalBoard .tpc-mc-event-legend summary:focus-visible { outline:3px solid var(--cup-yellow,#f1c30b); outline-offset:2px; border-radius:8px; }
body.tpc-site-dark-mode #tpcMatchCentreTacticalBoard .tpc-mc-event-legend { background:#111d39; color:#e5edff; border-color:#344970; }
body.tpc-site-dark-mode #tpcMatchCentreTacticalBoard .tpc-mc-event-legend summary { color:var(--cup-yellow,#f1c30b); }
body.tpc-site-dark-mode #tpcMatchCentreTacticalBoard .tpc-mc-event-legend p { color:#bdcbe2; }
/* Keep badges touching the same shirt on every screen, before its name.
   In-flow trays grow with event counts, so names and neighbouring rows never
   share their space. Empty trays reserve no space beyond the shirt itself. */
#tpcMatchCentreTacticalBoard { --tpc-mc-kit-height:44px; --tpc-mc-extra-event-rows:var(--tpc-mc-event-rows,0); --tpc-mc-card-height:calc(82px + var(--tpc-mc-extra-event-rows) * 20px); }
#tpcMatchCentreTacticalBoard .tpc-mc-side {
  container-type:inline-size; padding:12px; border-radius:22px;
  --tpc-mc-card-gap:clamp(4px,calc((100cqw - var(--tpc-mc-formation-columns,5) * 58px) / 8),20px);
  --tpc-mc-card-width:min(112px,calc((100cqw - 22px - (var(--tpc-mc-formation-columns,5) - 1) * var(--tpc-mc-card-gap)) / var(--tpc-mc-formation-columns,5)));
}
#tpcMatchCentreTacticalBoard .tpc-mc-pitch { min-height:calc(var(--tpc-mc-formation-rows,4) * var(--tpc-mc-card-height) + (var(--tpc-mc-formation-rows,4) - 1) * 16px + 30px); padding:12px 8px; gap:16px; border-radius:18px; }
/* A single shared boundary joins every marking. Only the goal-line edge of
   each box is omitted, never its midfield-facing edge. Centre circles retain
   their round shape when the formation makes a pitch taller or wider. */
#tpcMatchCentreTacticalBoard .tpc-mc-lines { position:absolute; inset:0; z-index:0; pointer-events:none; --tpc-mc-line:rgba(255,255,255,.42); }
#tpcMatchCentreTacticalBoard .tpc-mc-field { position:absolute; inset:12px; border:1.5px solid var(--tpc-mc-line); border-radius:0; }
#tpcMatchCentreTacticalBoard .tpc-mc-field > i { position:absolute; display:block; box-sizing:border-box; margin:0; pointer-events:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-halfway { top:50%; left:0; right:0; border-top:1.5px solid var(--tpc-mc-line); }
#tpcMatchCentreTacticalBoard .tpc-mc-centre-circle { top:50%; left:50%; width:27%; aspect-ratio:1; border:1.5px solid var(--tpc-mc-line); border-radius:50%; transform:translate(-50%,-50%); }
#tpcMatchCentreTacticalBoard :is(.tpc-mc-centre-spot,.tpc-mc-penalty-spot) { left:50%; width:4px; height:4px; border-radius:50%; background:var(--tpc-mc-line); transform:translate(-50%,-50%); }
#tpcMatchCentreTacticalBoard .tpc-mc-centre-spot { top:50%; }
#tpcMatchCentreTacticalBoard :is(.tpc-mc-penalty-area,.tpc-mc-goal-area,.tpc-mc-penalty-arc,.tpc-mc-goal) { left:50%; transform:translateX(-50%); border:1.5px solid var(--tpc-mc-line); }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-area { width:62%; height:18%; }
#tpcMatchCentreTacticalBoard .tpc-mc-goal-area { width:28%; height:7%; }
#tpcMatchCentreTacticalBoard :is(.tpc-mc-penalty-area,.tpc-mc-goal-area).is-top { top:0; border-top:0; }
#tpcMatchCentreTacticalBoard :is(.tpc-mc-penalty-area,.tpc-mc-goal-area).is-bottom { bottom:0; border-bottom:0; }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-spot.is-top { top:12%; }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-spot.is-bottom { top:88%; }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-arc { width:27%; aspect-ratio:2.8; }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-arc.is-top { top:18%; border-top:0; border-radius:0 0 50% 50% / 0 0 100% 100%; }
#tpcMatchCentreTacticalBoard .tpc-mc-penalty-arc.is-bottom { bottom:18%; border-bottom:0; border-radius:50% 50% 0 0 / 100% 100% 0 0; }
#tpcMatchCentreTacticalBoard .tpc-mc-goal { width:14%; height:7px; }
#tpcMatchCentreTacticalBoard .tpc-mc-goal.is-top { top:-7px; border-bottom:0; }
#tpcMatchCentreTacticalBoard .tpc-mc-goal.is-bottom { bottom:-7px; border-top:0; }
#tpcMatchCentreTacticalBoard .tpc-mc-corner-arc { width:10px; height:10px; border:1.5px solid var(--tpc-mc-line); }
#tpcMatchCentreTacticalBoard .tpc-mc-corner-arc.is-top-left { top:0; left:0; border-top:0; border-left:0; border-radius:0 0 100% 0; }
#tpcMatchCentreTacticalBoard .tpc-mc-corner-arc.is-top-right { top:0; right:0; border-top:0; border-right:0; border-radius:0 0 0 100%; }
#tpcMatchCentreTacticalBoard .tpc-mc-corner-arc.is-bottom-left { bottom:0; left:0; border-bottom:0; border-left:0; border-radius:0 100% 0 0; }
#tpcMatchCentreTacticalBoard .tpc-mc-corner-arc.is-bottom-right { bottom:0; right:0; border-bottom:0; border-right:0; border-radius:100% 0 0 0; }
#tpcMatchCentreTacticalBoard .tpc-mc-row,
#tpcMatchCentreTacticalBoard .tpc-mc-pitch .tpc-mc-row { gap:var(--tpc-mc-card-gap); align-items:start; justify-content:space-evenly; }
#tpcMatchCentreTacticalBoard .tpc-mc-row.row-1 { grid-template-columns:repeat(1,var(--tpc-mc-card-width)); }
#tpcMatchCentreTacticalBoard .tpc-mc-row.row-2 { grid-template-columns:repeat(2,var(--tpc-mc-card-width)); }
#tpcMatchCentreTacticalBoard .tpc-mc-row.row-3 { grid-template-columns:repeat(3,var(--tpc-mc-card-width)); }
#tpcMatchCentreTacticalBoard .tpc-mc-row.row-4 { grid-template-columns:repeat(4,var(--tpc-mc-card-width)); }
#tpcMatchCentreTacticalBoard .tpc-mc-row.row-5 { grid-template-columns:repeat(5,var(--tpc-mc-card-width)); }
#tpcMatchCentreTacticalBoard .tpc-mc-player,
#tpcMatchCentreTacticalBoard .tpc-mc-bench-list .tpc-mc-player { box-sizing:border-box; display:grid; flex:0 0 var(--tpc-mc-card-width); width:var(--tpc-mc-card-width); min-width:0; max-width:none; height:auto; min-height:var(--tpc-mc-card-height); padding:4px 0; border-width:0; border-radius:5px; background:transparent !important; grid-template-rows:auto auto; gap:2px; align-content:start; box-shadow:none; transform:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-player-kit { position:relative; display:flow-root; width:min(84px,100%); height:auto; min-height:var(--tpc-mc-kit-height); font-style:normal; --tpc-mc-shirt:var(--cup-blue,#001e8e); --tpc-mc-shirt-ink:#fff; }
#tpcMatchCentreTacticalBoard .tpc-mc-side.away .tpc-mc-player-kit { --tpc-mc-shirt:var(--cup-yellow,#f1c30b); --tpc-mc-shirt-ink:#102750; }
#tpcMatchCentreTacticalBoard .tpc-mc-side.home .is-goalkeeper .tpc-mc-player-kit { --tpc-mc-shirt:#f3adbd; --tpc-mc-shirt-ink:#242035; }
#tpcMatchCentreTacticalBoard .tpc-mc-side.away .is-goalkeeper .tpc-mc-player-kit { --tpc-mc-shirt:#a1ead5; --tpc-mc-shirt-ink:#073d2c; }
#tpcMatchCentreTacticalBoard .tpc-mc-jersey { position:absolute; top:0; left:calc(50% - 21px); display:block; width:42px; height:40px; overflow:visible; }
#tpcMatchCentreTacticalBoard .tpc-mc-jersey-shape { fill:var(--tpc-mc-shirt); stroke:#fff; stroke-width:1.1; stroke-linejoin:round; }
#tpcMatchCentreTacticalBoard .tpc-mc-jersey-neck { fill:none; stroke:var(--tpc-mc-shirt-ink); stroke-width:1.5; opacity:.65; }
#tpcMatchCentreTacticalBoard .tpc-mc-player .tpc-mc-shirt-number { position:absolute; top:13px; left:0; width:100%; padding:0; margin:0; color:var(--tpc-mc-shirt-ink); font:900 12px/14px Manrope,system-ui,sans-serif; font-variant-numeric:tabular-nums; }
body:not([data-page="admin"]):not([data-page="manager"]) #tpcMatchCentreTacticalBoard .tpc-mc-side .tpc-mc-player > strong,
#tpcMatchCentreTacticalBoard .tpc-mc-player > strong { display:grid; grid-template-rows:repeat(2,14px); overflow:visible; text-overflow:clip; white-space:normal; width:100%; min-width:0; height:28px; min-height:28px; margin:0; color:#fff !important; font-size:11px; line-height:14px; font-weight:800; overflow-wrap:normal; text-shadow:0 1px 2px #002b22; }
/* The fit routine shrinks both lines equally to preserve the complete name.
   Explicitly override the older bench b styling without changing event badges. */
#tpcMatchCentreTacticalBoard .tpc-mc-player > strong > .tpc-mc-name-line { display:block; width:100%; min-width:0; margin:0; padding:0; color:inherit; font:inherit; line-height:14px; white-space:nowrap; overflow-wrap:normal; word-break:normal; }
#tpcMatchCentreTacticalBoard .tpc-mc-player > small { display:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-player:hover,
#tpcMatchCentreTacticalBoard .tpc-mc-player:focus-visible { transform:none; background:transparent !important; box-shadow:0 0 0 2px var(--cup-yellow,#f1c30b); }
#tpcMatchCentreTacticalBoard .tpc-mc-player:hover::after,
#tpcMatchCentreTacticalBoard .tpc-mc-player:focus-visible::after { display:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-player:hover > .tpc-mc-player-kit,
#tpcMatchCentreTacticalBoard .tpc-mc-player:focus-visible > .tpc-mc-player-kit { animation:none; transform:none; }
#tpcMatchCentreTacticalBoard .tpc-mc-bench { padding:10px 8px; border-radius:14px; }
#tpcMatchCentreTacticalBoard .tpc-mc-bench-list { justify-content:center; gap:12px var(--tpc-mc-card-gap); }
@media(max-width:720px) {
  #tpcMatchCentreTacticalBoard.tpc-match-centre-tactical-board { padding:8px; }
  #tpcMatchCentreTacticalBoard .tpc-mc-side { padding:8px; }
  #tpcMatchCentreTacticalBoard .tpc-mc-event-legend ul { gap:.5rem .8rem; }
}
