/* tactics page */
.squad-top {
  display: grid;
  grid-template-columns: minmax(320px, 360px) 1fr;
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.squad-side {
  display: flex;
  flex-direction: column;
}

.pitch-panel {
  padding: var(--s4);
}

.panel h3,
.role-head {
  text-transform: none;
}

.panel h3 {
  color: var(--text);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pitch-panel h3 > .tag {
  margin-left: var(--s2);
  vertical-align: middle;
}

.tactics-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.tactics-note {
  color: var(--text-2);
  font-size: var(--fs-cap);
  line-height: 1.5;
}

.tactics-note-tight {
  margin-bottom: var(--s3);
}

.tactics-inline-note {
  color: var(--text-2);
  font-size: var(--fs-cap);
  font-weight: 500;
}

.tactics-section-title {
  margin-top: var(--s4);
  margin-bottom: var(--s3);
}

.chip-selected {
  outline: 2px solid rgba(227, 183, 101, 0.9) !important;
  outline-offset: 2px;
  animation: pulseSel 1.2s ease-in-out infinite;
}

@keyframes pulseSel {
  50% {
    outline-color: rgba(227, 183, 101, 0.36);
  }
}

.bench-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.bench-chip {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding: var(--s2) var(--s3) var(--s2) var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.bench-chip:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 82%, white);
  transform: translateY(-1px);
}

.bench-chip-meta {
  font-size: var(--fs-cap);
  line-height: 1.35;
}

.cand-list {
  display: flex;
  flex-direction: column;
}

.role-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-top: var(--s2);
  padding: var(--s3) var(--s3) var(--s2);
  border-bottom: 1px solid;
  background: color-mix(in srgb, var(--glass) 92%, transparent);
  font-size: var(--fs-cap);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.role-head:first-child {
  margin-top: 0;
}

.role-count {
  color: var(--text-2);
}

.cand-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

/* The club captain reads at a glance: faint accent wash + right-edge accent
   bar (the left border still carries his role colour). The (C) badge backs it
   up. Declared before :hover/.is-here so those still win when they co-apply. */
.cand-row.is-captain {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: inset -3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
}

.cand-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
}

.cand-row.is-here {
  background: rgba(67, 209, 124, 0.09);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08), inset 3px 0 0 var(--good);
}

.cand-row.is-dis {
  opacity: 0.48;
}

.cand-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.cand-name {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cand-pos {
  font-weight: 700;
}

.cand-bars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
}

/* gear column inside a candidate row (shares .eq-chip styling from squad.css) */
.cand-gear {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: 2px;
}
.cand-gear .eq-chip { width: 1.5rem; height: 1.5rem; font-size: 0.85rem; }

.cb {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-width: 0;
  font-size: var(--fs-cap);
}

.cb i {
  color: var(--text-3);
  font-style: normal;
}

.cb .cb-track {
  display: inline-block;
  width: 38px;
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
}

.cb .cb-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.cb .cb-val {
  color: var(--text);
  font-size: var(--fs-cap);
  font-weight: 600;
}

/* Gear-boosted stat: green value + label so equipped charms read at a glance. */
.cb.cb-up i,
.cb.cb-up .cb-val {
  color: var(--good);
}

.fit {
  min-width: 30px;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cand-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s1);
  align-items: center;
}

.cand-info {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: var(--r-pill);
}

.preset-bar {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.preset-chip {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.preset-chip .preset-load {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 600 var(--fs-cap) / 1.2 var(--font);
  padding: 10px 14px;
}

.preset-chip .preset-load i {
  color: var(--text-2);
  font-style: normal;
  font-weight: 500;
}

.preset-chip .preset-load:hover {
  color: var(--gold);
}

.preset-chip .preset-del {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font: 600 var(--fs-cap) / 1 var(--font);
  padding: 0 12px;
}

.preset-chip .preset-del:hover {
  color: var(--bad);
}

.preset-input {
  width: min(220px, 100%);
}

.instr-group {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.instr-label {
  color: var(--gold);
  font-size: var(--fs-cap);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.instr-opts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.btn.instr {
  min-height: 32px;
  padding: 8px 12px;
}

.tactics-role-note {
  margin-top: var(--s1);
}

@media (max-width: 860px) {
  .squad-top,
  #instrPanel,
  #rolesPanel {
    grid-template-columns: 1fr;
  }
}

/* match-prep header (default plan vs a specific game) */
.prep-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  margin-bottom: var(--s4);
}
.prep-back,
.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.prep-back:hover,
.link:hover { text-decoration: underline; }
.prep-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.prep-title { margin: 2px 0 4px; font-size: 20px; }
.prep-sub { font-size: 12px; color: var(--dim); }
