/* ==========================================================================
   SQUAD BUILDER – Spielfeld, Slots, Chemie, Werte, Bank, Spielerauswahl
   ========================================================================== */
.squad { padding: 1.5rem 0 3rem; }
.squad-bar { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; padding: 1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.field-inline { display: grid; gap: .3rem; }
.field-inline span { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field-inline select, .field-inline input { min-height: 42px; padding: .5rem .8rem; width: auto; min-width: 150px; }
.squad-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.squad-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.4rem; margin-top: 1.2rem; align-items: start; }

/* ---------------------------------------------------------------- Spielfeld */
.pitch-wrap { border-radius: 24px; padding: clamp(.6rem, 2vw, 1.2rem); background: var(--surface); border: 1px solid var(--line); }
.pitch-field {
  position: relative; width: 100%; max-width: 640px; margin-inline: auto; aspect-ratio: 68 / 88;
  border-radius: 18px; overflow: hidden; container-type: inline-size;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(57, 255, 143, .18), transparent 55%),
    repeating-linear-gradient(180deg, #0f3a24 0 8%, #0d331f 8% 16%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .55);
}
.pitch-lines { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(220, 255, 235, .22); }

.slot {
  position: absolute; transform: translate(-50%, -50%); width: 17cqw; min-width: 54px; max-width: 104px;
  display: grid; justify-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--text);
  transition: left .45s cubic-bezier(.2, .8, .2, 1), top .45s cubic-bezier(.2, .8, .2, 1);
}
.slot-empty {
  width: 72%; aspect-ratio: 3 / 4; border-radius: 10px 10px 16px 16px; border: 2px dashed rgba(220, 255, 235, .4);
  display: grid; place-items: center; background: rgba(0, 0, 0, .25); transition: border-color .2s, background .2s, transform .2s;
}
.slot-empty svg { width: 40%; height: 40%; color: rgba(220, 255, 235, .7); }
.slot:hover .slot-empty, .slot:focus-visible .slot-empty { border-color: var(--accent); background: rgba(57, 255, 143, .12); transform: scale(1.05); }
.slot .pcard { width: 72%; font-size: clamp(9px, 2.5cqw, 17px); transition: transform .2s; }
.slot:hover .pcard { transform: translateY(-3px) scale(1.04); }
.slot-pos { font-size: clamp(.58rem, 1.9cqw, .74rem); font-weight: 800; letter-spacing: .08em; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); }
.slot-pos.off { background: var(--danger); color: #fff; }
.chem { display: flex; gap: 2px; }
.chem i { width: clamp(6px, 1.6cqw, 9px); aspect-ratio: 1; transform: rotate(45deg); background: rgba(255, 255, 255, .18); border-radius: 1px; }
.chem i.on { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.slot-price { font-size: clamp(.55rem, 1.7cqw, .72rem); font-weight: 700; color: var(--gold); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .slot.placed .pcard { animation: place .45s cubic-bezier(.2, .9, .3, 1.3); }
}
@keyframes place { from { transform: translateY(-30px) scale(.6); opacity: 0; } }

/* ---------------------------------------------------------------- Werte */
.squad-side { display: grid; gap: 1rem; position: sticky; top: calc(var(--nav-h) + 12px); }
.squad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stat { padding: 1rem; border-radius: 16px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.stat span { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat strong { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-wide { grid-column: 1 / -1; }
.stat-wide strong { color: var(--gold); display: flex; align-items: center; gap: .4rem; }
.stat small { display: block; color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.stat .coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe28a, #c9971d); box-shadow: inset 0 0 0 2px #a8790f; flex: none; }
.stat strong.pulse { animation: bump .4s ease; }
#sq-chem.full { color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }

.squad-links { padding: 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; }
.squad-links h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.link-group { margin-bottom: .6rem; }
.link-group b { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.link-group span { display: inline-flex; gap: .3rem; align-items: center; margin: 0 .3rem .3rem 0; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-3); font-size: .78rem; }
.link-group span em { font-style: normal; color: var(--accent); font-weight: 800; }

.saved { padding: 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.saved h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.saved ul { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .4rem; }
.saved li { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border-radius: 10px; background: var(--surface-2); }
.saved li button.load { flex: 1; text-align: left; background: none; border: 0; padding: 0; font-weight: 700; }
.saved li small { color: var(--muted); display: block; font-weight: 400; }
.saved li .del { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .2rem .4rem; }
.saved li .del:hover { color: var(--danger); }

/* ---------------------------------------------------------------- Bank */
.bench { margin-top: 1.2rem; padding: 1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.bench h3 { font-size: 1.2rem; margin-bottom: .7rem; }
.bench-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; container-type: inline-size; }
.bench-row .slot { position: static; transform: none; width: auto; max-width: none; min-width: 0; }
.bench-row .slot .pcard, .bench-row .slot-empty { width: min(100%, 86px); font-size: clamp(9px, 1.6cqw, 15px); }

/* ---------------------------------------------------------------- Spielerauswahl */
.pick-tools { padding: 1rem 1.3rem; display: grid; gap: .6rem; border-bottom: 1px solid var(--line); }
.pick-tools .check { margin: 0; }
.pick-list { padding: .8rem 1rem 1.2rem; display: grid; gap: .45rem; overflow-y: auto; max-height: 56svh; }
.pick-item { display: grid; grid-template-columns: 52px 1fr auto; gap: .8rem; align-items: center; padding: .5rem .7rem .5rem .5rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.pick-item:hover, .pick-item:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.pick-item .pcard { width: 52px; font-size: 12px; }
.pick-item strong { display: block; }
.pick-item span { color: var(--muted); font-size: .8rem; }
.pick-item .price-val { font-size: 1rem; }
.pick-item.in-squad { opacity: .45; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1020px) {
  .squad-layout { grid-template-columns: 1fr; }
  .squad-side { position: static; grid-template-columns: 1fr 1fr; }
  .squad-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .stat-wide { grid-column: auto; }
}
@media (max-width: 640px) {
  .squad-side { grid-template-columns: 1fr; }
  .squad-stats { grid-template-columns: 1fr 1fr; }
  .stat-wide { grid-column: 1 / -1; }
  .stat strong { font-size: 2rem; }
  .squad-actions { margin-left: 0; }
  .bench-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot-price { display: none; }
}
