/* MarketSystems · Trading-Mannschaft als Taktiktafel (Stand 23.11.2026)
   Ersetzt auf betriebssystem-optionen.html das frühere KI-Bild der Mannschaft (bis Commit 6f530fe).
   Rückennummern und Rollen: Strategy Archive App v3, data/customer_layer.json (role_title, jersey).
   Mannschaftsteile 5 · 3 · 2 und Abwehrchef („Prüfung vor jeder Order, keine elfte Strategie“):
   GLOSSAR_Sprache_Betriebssystem_Optionen. Reines CSS, kein Skript; die Hervorhebung folgt
   der aktiven Rollenkarte (.zone.is-active aus main.js). */

.squad-board {
  --sb-night: #0f1714;
  --sb-stripe: rgba(255, 253, 247, .028);
  --sb-chalk: rgba(243, 234, 216, .26);
  --sb-text: #f3ead8;
  --sb-muted: #b9b2a4;
  --sb-def: #6fb0d9;
  --sb-mid: #e3b23f;
  --sb-att: #ee9277;
  position: relative;
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(227, 178, 63, .26);
  border-radius: var(--radius-lg, 18px);
  background: rgba(255, 255, 255, .045);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .22);
}

.sb-eyebrow {
  margin: 0;
  font: 600 13px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sb-mid);
}

/* ---------- Spielfeld ---------- */
.sb-pitch {
  position: relative;
  aspect-ratio: 6 / 7;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(61, 139, 110, .16), transparent 70%),
    var(--sb-night);
  box-shadow: inset 0 0 0 1px rgba(243, 234, 216, .08), inset 0 -60px 90px rgba(0, 0, 0, .35);
}
.sb-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.sb-stripe { fill: var(--sb-stripe); }
.sb-chalk { fill: none; stroke: var(--sb-chalk); stroke-width: 2; }
.sb-dot { fill: var(--sb-chalk); }
.sb-arrow { fill: none; stroke: rgba(227, 178, 63, .45); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-pass {
  fill: none;
  stroke: rgba(243, 234, 216, .30);
  stroke-width: 1.6;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  transition: stroke .2s ease, opacity .2s ease;
}

.sb-player {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max-content;
  --sb-lift: -27px;
  transform: translate(-50%, var(--sb-lift));
  transition: opacity .2s ease, transform .2s ease;
}
.sb-player b {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--sb-c);
  border-radius: 50%;
  background: #12120f;
  box-shadow: 0 0 0 5px rgba(18, 18, 15, .55), 0 10px 24px rgba(0, 0, 0, .45);
  color: var(--sb-c);
  font: 600 22px/1 var(--serif);
  font-variant-numeric: tabular-nums;
}
.sb-player > span {
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(12, 12, 10, .72);
  color: var(--sb-text);
  font: 500 13px/1.35 var(--mono);
}
.sb-def { --sb-c: var(--sb-def); }
.sb-mid { --sb-c: var(--sb-mid); }
.sb-att { --sb-c: var(--sb-att); }

.sb-p11 { left: 20%; top: 13%; }
.sb-p9 { left: 50%; top: 9%; }
.sb-p7 { left: 80%; top: 13%; }
.sb-p10 { left: 50%; top: 32%; }
.sb-p17 { left: 83%; top: 39%; }
.sb-p14 { left: 17%; top: 42%; }
.sb-p8 { left: 64%; top: 52%; }
.sb-p6 { left: 36%; top: 58%; }
.sb-p4 { left: 32%; top: 77%; }
.sb-p5 { left: 68%; top: 77%; }

/* ---------- Abwehrchef ---------- */
.sb-chef {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(227, 178, 63, .30);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(227, 178, 63, .10), transparent 60%), rgba(12, 12, 10, .45);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sb-chef h3, .sb-unit h3 {
  margin: 0;
  font: 600 13px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sb-mid);
}
.sb-chef p { margin: 0; color: var(--sb-text); font-size: 16px; line-height: 1.5; }
.sb-gates { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; counter-reset: gate; }
.sb-gates li {
  counter-increment: gate;
  padding: 4px 10px;
  border: 1px solid rgba(243, 234, 216, .18);
  border-radius: 99px;
  color: var(--sb-text);
  font: 500 13px/1.4 var(--mono);
}
.sb-gates li::before { content: counter(gate) " · "; color: var(--sb-mid); }

/* ---------- Aufstellungsbogen ---------- */
.sb-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sb-unit h3 { display: flex; justify-content: space-between; color: var(--sb-c); padding-bottom: 6px; border-bottom: 1px solid rgba(243, 234, 216, .14); }
.sb-unit h3 span { color: var(--sb-muted); }
.sb-unit ol { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.sb-unit li { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; align-items: baseline; transition: opacity .2s ease; }
.sb-unit li b { grid-row: span 2; color: var(--sb-c); font: 600 18px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.sb-unit li span { color: var(--sb-text); font: 500 14px/1.35 var(--mono); }
.sb-unit li small { color: var(--sb-muted); font-size: 14px; line-height: 1.35; }

.squad-board figcaption { color: rgba(255, 253, 247, .74); font-size: 15px; line-height: 1.45; }

/* ---------- Rolle antippen: Mannschaftsteil hervorheben ----------
   Präfix html … .squad-board hebt die Spezifität über die Auftrittsregeln unten. */
html .squad-layout:has(.zone.is-active) .squad-board .sb-player,
html .squad-layout:has(.zone.is-active) .squad-board .sb-unit li { opacity: .3; }
html .squad-layout:has(.zone.is-active) .squad-board .sb-pass { opacity: .35; }
html .squad-layout:has(.zone:nth-child(1).is-active) .squad-board .sb-def,
html .squad-layout:has(.zone:nth-child(2).is-active) .squad-board .sb-mid,
html .squad-layout:has(.zone:nth-child(3).is-active) .squad-board .sb-att,
html .squad-layout:has(.zone:nth-child(1).is-active) .squad-board .sb-unit.sb-def li,
html .squad-layout:has(.zone:nth-child(2).is-active) .squad-board .sb-unit.sb-mid li,
html .squad-layout:has(.zone:nth-child(3).is-active) .squad-board .sb-unit.sb-att li { opacity: 1; }
html .squad-layout:has(.zone:nth-child(1).is-active) .squad-board .sb-player.sb-def,
html .squad-layout:has(.zone:nth-child(2).is-active) .squad-board .sb-player.sb-mid,
html .squad-layout:has(.zone:nth-child(3).is-active) .squad-board .sb-player.sb-att { transform: translate(-50%, var(--sb-lift)) scale(1.1); }
html .squad-layout:has(.zone:nth-child(4).is-active) .squad-board .sb-player,
html .squad-layout:has(.zone:nth-child(4).is-active) .squad-board .sb-unit li { opacity: .55; }
html .squad-layout:has(.zone:nth-child(4).is-active) .squad-board .sb-chef {
  border-color: rgba(227, 178, 63, .8);
  box-shadow: 0 0 0 3px rgba(227, 178, 63, .18);
}

/* ---------- Auftritt: Verteidigung, Mittelfeld, Angriff ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .squad-board .sb-player { opacity: 0; transform: translate(-50%, calc(var(--sb-lift) + 10px)); }
  html.js .squad-board .sb-pass { opacity: 0; }
  html.js .squad-board.is-visible .sb-player { opacity: 1; transform: translate(-50%, var(--sb-lift)); transition: opacity .28s ease, transform .28s ease; }
  html.js .squad-board.is-visible .sb-player.sb-mid { transition-delay: .12s; }
  html.js .squad-board.is-visible .sb-player.sb-att { transition-delay: .24s; }
  html.js .squad-board.is-visible .sb-pass { opacity: 1; transition: opacity .6s ease .45s; }
}

/* ---------- Mittlere und kleine Breiten ---------- */
@media (max-width: 1180px) {
  .sb-sheet { grid-template-columns: 1fr 1fr; }
  .sb-unit.sb-mid { grid-row: span 2; }
}
@media (max-width: 640px) {
  .squad-board { padding: 14px; gap: 14px; }
  .sb-player { --sb-lift: -21px; }
  .sb-player b { width: 42px; height: 42px; font-size: 18px; box-shadow: 0 0 0 4px rgba(18, 18, 15, .55), 0 8px 18px rgba(0, 0, 0, .45); }
  .sb-player > span { display: none; }
  .sb-sheet { grid-template-columns: 1fr; }
  .sb-unit.sb-mid { grid-row: auto; }
}
