/* Compact tactical canvas, 360 × 370; the enlarged preview uses the full card. */
.lineup-stadium-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-radius: 16px; }
.lineup-stadium-scroll:focus-visible { outline: 2px solid var(--lime); outline-offset: -3px; }
.lineup-stadium-scroll > .lineup-stadium {
  position: relative; isolation: isolate; box-sizing: border-box;
  min-width: 320px; width: 100%; height: 480px; min-height: 320px;
  margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 16px;
  background: #10221e url("images/lineup-stadium.2d7c06d8e82d.svg") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 40px #020d0a70;
}
.lineup-stadium-scroll > .lineup-stadium::before,
.lineup-stadium-scroll > .lineup-stadium::after,
.lineup-stadium > .pitch-markings,
.lineup-stadium > .lineup-compare-pitch-markings { display: none; }
:root .lineup-stadium-scroll .lineup-stadium > .lineup-card-slot {
  position: absolute; left: var(--lineup-left, var(--x)); top: var(--lineup-top, var(--y));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: var(--lineup-card-width); min-width: 0; max-width: none; height: auto;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  color: #f6f7ec; background: none; box-shadow: none;
  transform: translate(-50%, -50%); text-align: center;
}
.lineup-stadium > .lineup-card-slot::before {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 20px; height: 20px;
  z-index: -1; border-radius: 50%; background: #001710aa; filter: blur(7px); transform: skewX(-18deg);
}
.lineup-card-host { display: block; position: relative; width: 100%; min-width: 0; aspect-ratio: 36 / 37; padding: 0; border: 0; background: none; }
/* Geometry must update synchronously during fitting. The site's reduced-motion
   rule sets a tiny transition duration globally, so explicitly exclude size. */
.lineup-stadium,
.lineup-stadium .lineup-card-slot,
.lineup-stadium .pitch-player-hitbox,
.lineup-stadium .pitch-slot-avatar,
.lineup-stadium .lineup-card-host { transition-property: none !important; }
/* Tactical artwork is the shared compact renderer, never a separate payload. */
.lineup-card-host > .cup-card-canvas { filter: drop-shadow(0 6px 6px #041a1759); }
.lineup-card-host[data-lineup-interactive="false"] > .cup-card-canvas { pointer-events: none; }
.lineup-card-host .cup-card-frame-glint { animation: none !important; }
.lineup-card-host.has-player-details { cursor: pointer; transition: filter .16s ease; }
.lineup-card-host.has-player-details:hover { filter: brightness(1.065); }
.lineup-card-host.has-player-details:focus-visible { outline: 3px solid #d3ff80; outline-offset: 2px; border-radius: 12px; }
/* Neutralize legacy pitch strong labels while letting the shared renderer
   own the internal name typography and background. */
.lineup-card-host .cup-card-canvas .cup-card-rating { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--cup-ink); text-shadow: none; }
/* Legacy pitch labels style every strong descendant. Preserve the catalog's
   rating size inside the proportional card canvas, including selected slots. */
.lineup-card-host:not(.cup-player-card-lineup) .cup-card-canvas .cup-card-rating { font-size: 48px; }
/* Legacy pitch portrait rules must not add dark tiles behind transparent crests. */
.lineup-card-host .cup-card-canvas img { margin: 0; box-shadow: none; background: transparent; }
.lineup-card-fallback { display: grid; min-height: 0; aspect-ratio: 36 / 37; padding: 6px; place-items: center; color: #554522; background: #edda9d; }
.lineup-empty-card {
  display: flex; position: relative; box-sizing: border-box; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; width: 100%; aspect-ratio: 36 / 37; color: #b8ddd0;
  background: linear-gradient(145deg,#163d32ec,#102a23e8);
  clip-path: polygon(50% 2%,90% 9%,96% 14%,95% 89%,86% 95%,50% 100%,14% 95%,5% 89%,4% 14%,10% 9%);
  box-shadow: inset 0 0 0 2px #95bbae80;
}
.lineup-empty-card::before { content: ""; position: absolute; inset: 8%; border: 1px dashed #c0e6d45c; border-radius: 40% 40% 18% 18% / 5% 5% 8% 8%; }
.lineup-empty-card > b { padding: 0; color: #c8f5b7; font: 300 32px/1 sans-serif; background: none; }
.lineup-empty-card > span { max-width: 90%; overflow: hidden; color: #d5e9df; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
:root .lineup-stadium .lineup-card-slot > :is(.pitch-position-badge,.lineup-compare-slot-label,.lineup-slot-label) {
  position: relative; inset: auto; transform: none; align-self: center;
  display: flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto;
  max-width: calc(100% + 10px); min-height: 20px; margin: 2px 0 0; padding: 2px 9px;
  border: 1px solid #9abdab66; border-radius: 999px; background: #09231fef;
  color: #f4f8f2; font: 800 12px/1.2 "Segoe UI","Microsoft YaHei",sans-serif; white-space: nowrap;
}
.lineup-card-flags { position: absolute; z-index: 3; left: 0; right: 0; top: 4px; display: flex; justify-content: space-between; pointer-events: none; }
:root .lineup-stadium .lineup-card-slot:has(.lineup-captain-badge) > :is(.pitch-position-badge,.lineup-compare-slot-label) { min-height: 28px; }
.lineup-card-flags :is(.lineup-captain-badge,.player-availability-badge) { position: static; transform: none; margin: 0; }
/* Captaincy is a gold shield, separate from the centered position label and
   the player's face. The same artwork also marks compact roster portraits. */
:root body :is(.lineup-card-slot,.lineup-bench-card,.lineup-compare-bench-slot) > .lineup-card-flags { inset: 0; align-items: flex-start; }
:root body .lineup-captain-badge,
:root body .lineup-card-slot.is-captain .pitch-slot-role::after,
:root body .team-squad-row.is-captain .team-squad-avatar::after {
  display: inline-grid; place-items: center; position: absolute; box-sizing: border-box;
  width: 24px; min-width: 24px; height: 28px; min-height: 0; padding: 0 0 3px; margin: 0;
  border: 0; border-radius: 0; transform: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cdefs%3E%3ClinearGradient id='g' x2='.85' y2='1'%3E%3Cstop stop-color='%23fff4c5'/%3E%3Cstop offset='.42' stop-color='%23edc96d'/%3E%3Cstop offset='1' stop-color='%23b88930'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12 1 23 4v9c0 6-5 11-11 14C6 24 1 19 1 13V4Z' fill='url(%23g)' stroke='%23fff0b2' stroke-width='1.1'/%3E%3Cpath d='m12 3 9 2.6V13c0 5-4 9.4-9 11.8C7 22.4 3 18 3 13V5.6Z' fill='none' stroke='%23795b20' stroke-opacity='.65' stroke-width='.8'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  color: #332207; box-shadow: none; filter: drop-shadow(0 2px 2px #00170b80);
  font: 900 14px/1 "Segoe UI",sans-serif; text-shadow: 0 1px #fff1b780;
  pointer-events: none;
}
:root body :is(.lineup-card-slot,.lineup-bench-card,.lineup-compare-bench-slot) > .lineup-card-flags > .lineup-captain-badge {
  top: auto; bottom: 0; left: calc(50% + 28px); right: auto;
}
:root body .lineup-card-slot.is-captain .pitch-slot-role::after {
  content: "C"; left: calc(100% + 5px); right: auto; top: 50%; bottom: auto; transform: translateY(-50%);
}
:root body .roster-player-avatar > .lineup-captain-badge,
:root body .team-squad-row.is-captain .team-squad-avatar::after {
  width: 20px; min-width: 20px; height: 24px; font-size: 12px;
  top: auto; bottom: 0; left: 0; right: auto;
}
:root body .team-squad-row.is-captain .team-squad-avatar::after {
  content: "C"; top: 1px; bottom: auto; left: -8px;
}
:root body .lineup-card-slot.is-captain .pitch-slot-avatar::after { content: none; }
.lineup-bench-card .lineup-card-host,
.lineup-compare-bench-slot .lineup-card-host { max-width: 160px; margin-inline: auto; }
.lineup-bench-card .lineup-empty-card,
.lineup-compare-bench-slot .lineup-empty-card { max-width: 160px; margin-inline: auto; }
/* Retire the legacy light-theme !important flat-turf override on these pages. */
html[data-theme] body .lineup-stadium-scroll > .lineup-stadium {
  background: #10221e url("images/lineup-stadium.2d7c06d8e82d.svg") center / 100% 100% no-repeat !important;
}
html[data-theme="light"] .lineup-stadium-scroll > .lineup-stadium { box-shadow: inset 0 0 40px #173b2026; }
@media (prefers-reduced-motion: reduce) { .lineup-card-host { transition: none; } }

/* One width token covers both the pitch and the bench on each team surface. */
:is(.team-pitch-editor,.lineup-public-card,.lineup-compare-team-card) { --lineup-card-width: 100px; }
.lineup-bench-reveal { width: var(--lineup-card-width); }
.lineup-bench-window {
  display: block; position: relative; box-sizing: border-box; flex: 0 0 auto;
  width: var(--lineup-card-width); height: calc(var(--lineup-card-width) * 37 / 36);
  overflow: visible; border-radius: 7px;
}
.lineup-bench-window :is(.lineup-card-host,.lineup-empty-card) { width: var(--lineup-card-width); max-width: none; }
.lineup-hover-preview {
  position: fixed; z-index: 1000; pointer-events: none; overflow: visible;
  filter: drop-shadow(0 8px 16px #03150fc0);
}
.lineup-hover-preview[hidden] { display: none; }
.lineup-hover-preview-card { display: block; width: 100%; aspect-ratio: 3 / 4; }
.lineup-hover-preview * { pointer-events: none !important; }
/* Move artwork only: click/drag targets and every surrounding row stay still. */
:is(.lineup-card-slot,.lineup-bench-reveal):focus-within .lineup-card-host { translate: 0 -4px; }
@media (hover: hover) {
  :is(.lineup-card-slot,.lineup-bench-reveal):hover .lineup-card-host { translate: 0 -4px; }
}
@media (prefers-reduced-motion: no-preference) {
  :is(.lineup-card-slot,.lineup-bench-reveal) .lineup-card-host { transition: translate .14s ease !important; }
}
.lineup-bench-reveal:has(:focus-visible) { outline: 2px solid var(--lime); outline-offset: 3px; }
.lineup-pitch-formation {
  position: absolute; z-index: 2; left: 16px; bottom: 12px;
  display: flex; align-items: center; gap: 8px; max-width: 180px; min-height: 32px;
  padding: 5px 10px; border: 1px solid #badca34d; border-radius: 6px;
  background: #09271eea; color: #effce3; font-size: 12px; font-weight: 800;
}
.lineup-pitch-formation small { color: #bbd6bf; font-size: 10px; font-weight: 700; }
:root .lineup-stadium .lineup-card-slot > :is(.pitch-position-badge,.lineup-compare-slot-label,.lineup-slot-label) {
  border-color: #bce88e70; background: linear-gradient(180deg,#164333f2,#08291ff5);
  color: #f1ffe5; box-shadow: 0 0 9px #a7e87824, inset 0 1px #d8fac512;
}

/* Empty bench slots retain their add target without numbered SUB labels. */
.lineup-bench-window .lineup-empty-card > span { display: none; }
