/* Teamazo · Banc de touche : TOUTES ses règles. */

/* --- Banc de touche (7 octobre 2026) : TOUTES les règles du banc sont ici. ---
   Des places avec chasuble neutre (BENCH_SHIRT), au moins 4, les libres en pointillés.
   3 dispositions : sous le terrain, ligne qui défile en Mode match, colonne à droite en Mode match large.
   Pas de color-mix() ni de clip-path (html2canvas). */
.bench {
  position: relative;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--raised), var(--panel));
  transition: box-shadow 0.18s var(--ease-out);
}
.bench-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font: 800 italic 18px/1 var(--display);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.bench-title .icon {
  width: 18px;
  height: 18px;
  color: var(--lime);
}
.bench-title .count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  margin-left: 2px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: var(--lime);
  color: var(--accent-ink);
  font: 800 italic 15px/1 var(--display);
  transform: skewX(-12deg);
}
.bench-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 14px 8px;
  margin-top: 12px;
}
.bench-token,
.bench-seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 98px;
  padding: 8px 4px 10px;
  border-radius: 10px 10px 4px 4px;
}
.bench-token {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--white);
  font: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform 0.15s var(--ease-snap),
    border-color 0.15s,
    box-shadow 0.15s;
}
.bench-seat {
  border: 2px dashed var(--line);
}
/* L’assise : une latte inclinée sous chaque place. */
.bench-token::after,
.bench-seat::after {
  content: '';
  position: absolute;
  right: 4%;
  bottom: -8px;
  left: 4%;
  height: 5px;
  border-radius: 2px;
  background: var(--line);
  transform: skewX(-14deg);
}
.seat-shirt {
  display: block;
  width: 44px;
  height: 41px;
  filter: drop-shadow(0 3px 3px #00000059);
  transition: transform 0.15s var(--ease-snap);
}
.seat-shirt svg {
  display: block;
  width: 100%;
  height: 100%;
}
.seat-name {
  max-width: 100%;
  overflow: hidden;
  font: 700 italic 15px/1.1 var(--display);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.seat-rating {
  min-width: 30px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #c9d1d8;
  color: #1b2227;
  font: 800 italic 13px/1 var(--display);
  text-align: center;
}
.seat-rating.tier-gold {
  background: #f2c14e;
  color: #2b1d02;
}
.seat-rating.tier-bronze {
  background: #cf8e59;
  color: #2a1407;
}
.bench-empty {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.bench-empty .icon {
  width: 15px;
  height: 15px;
}
@media (hover: hover) {
  .bench-token:hover {
    border-color: var(--muted);
    transform: translateY(-2px);
  }
}
.bench-token:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
.bench-token.dragging {
  opacity: 0.35;
}
/* Remplaçant choisi pour un changement (2 touchers) : il se lève, chasuble à l’accent. */
.bench-token.sub-selected {
  border-color: var(--lime);
  box-shadow:
    0 0 0 2px var(--lime),
    0 8px 22px -8px var(--lime);
}
.bench-token.sub-selected .seat-shirt {
  transform: translateY(-4px) scale(1.08);
}
.bench-token.sub-selected .shirt-fill {
  fill: var(--lime);
}
.bench-token.sub-selected::after {
  background: var(--lime);
}
/* Un joueur glissé au-dessus : le banc s’allume, les places libres aussi. */
.bench.drag-over {
  box-shadow:
    inset 0 0 0 2px var(--lime),
    0 0 28px -8px var(--lime);
}
.bench.drag-over .bench-seat {
  border-color: var(--lime);
}
.bench.drag-over .bench-seat::after {
  background: var(--lime);
}
.bench-token.drag-ghost {
  width: 86px;
  border-color: var(--lime);
  background: var(--raised);
  box-shadow: 0 14px 30px #0009;
}
.bench-token.drag-ghost::after {
  display: none;
}
.sub-hint {
  margin: 8px 0 0;
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 760px) {
  .bench {
    padding: 12px 14px 16px;
  }
  .bench-content {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  }
  .bench-token,
  .bench-seat {
    min-height: 90px;
  }
}
/* Grand écran : une ligne de places qui défile (glisser à l’horizontale = défiler, vers le terrain = sortir). */
.field-expanded .field-panel .bench {
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.field-expanded .field-panel .bench-title {
  font-size: 16px;
}
.field-expanded .field-panel .bench-content {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.field-expanded .field-panel .bench-token,
.field-expanded .field-panel .bench-seat {
  flex: none;
  flex-direction: row;
  gap: 6px;
  min-width: 96px;
  max-width: 150px;
  min-height: 46px;
  padding: 4px 9px 4px 6px;
  border-radius: 9px 9px 4px 4px;
}
.field-expanded .field-panel .bench-token::after,
.field-expanded .field-panel .bench-seat::after {
  bottom: -7px;
  height: 4px;
}
.field-expanded .field-panel .bench-token {
  touch-action: pan-x;
}
.field-expanded .field-panel .seat-shirt {
  flex: none;
  width: 32px;
  height: 30px;
}
.field-expanded .field-panel .seat-name {
  flex: 1;
  font-size: 14px;
  text-align: left;
}
.field-expanded .field-panel .seat-rating {
  min-width: 26px;
  padding: 2px 4px;
  font-size: 12px;
}
.field-expanded .field-panel .bench.is-empty .bench-seat:nth-of-type(n + 3) {
  display: none;
}
.field-expanded .field-panel .bench-empty {
  flex: none;
  margin: 0 0 0 4px;
  white-space: nowrap;
}
/* Grand écran sur ordinateur large : le banc sous la feuille de match, compact (places couchées en
   2 colonnes), à sa hauteur ; il défile s’il est trop long. */
@media (min-width: 1200px) and (min-aspect-ratio: 4/3) {
  .field-expanded .field-panel .bench {
    grid-area: bench;
    min-height: 0;
    padding: 10px 12px;
    overflow-y: auto;
  }
  .field-expanded .field-panel .bench-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 8px;
    padding: 2px 0 8px;
    overflow: visible;
  }
  .field-expanded .field-panel .bench-token,
  .field-expanded .field-panel .bench-seat {
    min-width: 0;
    max-width: none;
  }
  .field-expanded .field-panel .bench-token {
    touch-action: pan-y;
  }
  .field-expanded .field-panel .bench-empty {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    white-space: normal;
  }
}
/* Avant-match sur ordinateur (≥ 1100 px, hors Grand écran) : une rangée basse, le titre à gauche,
   des places couchées (chasuble, prénom, note) qui défilent, le texte d’aide à côté. */
@media (min-width: 1100px) {
  body:not(.field-expanded) .field-panel .bench {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 14px;
    padding: 5px 10px;
  }
  body:not(.field-expanded) .field-panel .bench-title {
    font-size: 16px;
  }
  body:not(.field-expanded) .field-panel .sub-hint {
    grid-column: 1 / -1;
    margin: 0;
  }
  body:not(.field-expanded) .field-panel .bench-content {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 1px 2px 7px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  body:not(.field-expanded) .field-panel .bench-token,
  body:not(.field-expanded) .field-panel .bench-seat {
    flex: none;
    flex-direction: row;
    gap: 6px;
    width: auto;
    min-width: 104px;
    max-width: 160px;
    min-height: 36px;
    padding: 2px 9px 2px 6px;
    border-radius: 8px 8px 4px 4px;
  }
  body:not(.field-expanded) .field-panel .bench-token::after,
  body:not(.field-expanded) .field-panel .bench-seat::after {
    bottom: -6px;
    height: 4px;
  }
  body:not(.field-expanded) .field-panel .seat-shirt {
    flex: none;
    width: 26px;
    height: 24px;
  }
  body:not(.field-expanded) .field-panel .seat-name {
    flex: 1;
    font-size: 15px;
    text-align: left;
  }
  body:not(.field-expanded) .field-panel .seat-rating {
    min-width: 28px;
    padding: 2px 4px;
    font-size: 13px;
  }
  body:not(.field-expanded) .field-panel .bench.is-empty .bench-seat:nth-of-type(n + 3) {
    display: none;
  }
  body:not(.field-expanded) .field-panel .bench-empty {
    flex: none;
    margin: 0 0 0 4px;
    font-size: 14px;
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bench,
  .bench-token,
  .seat-shirt {
    transition: none;
  }
  .bench-token:hover,
  .bench-token.sub-selected .seat-shirt {
    transform: none;
  }
}
