/* Pagina "Scout" (scout.html): scout manuale nel browser. Come css/video.css vive in un file a
   sé perché serve solo qui. Tutte le classi hanno il prefisso sc-*; il markup è generato da
   js/scout.js. Vedi docs/scout.md. */

[hidden] { display: none !important; }

/* Pagina alta quanto lo schermo, senza scroll del documento: scorrono le singole parti (elenco,
   registro azioni, tabelle). Sotto i 900px si torna allo scroll normale (vedi in fondo). */
body.scout-page {
  background: var(--grey-50);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.scout-page header { flex-shrink: 0; }

/* Durante lo scout lo spazio in verticale conta: da PC/tablet la barra del sito sparisce e si
   torna all'elenco con "‹ Partite". */
@media (min-width: 901px) {
  body.scout-page[data-sc-view="match"] header { display: none; }
}

/* style.css dà "padding: 80px 0" a ogni <section> (le sezioni delle altre pagine): qui creava
   una banda vuota sopra la barra del punteggio e una sotto il campo. */
.sc-app section.sc-match { padding: 0; }

.sc-app {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.sc-muted { color: var(--grey-600); font-size: 0.9rem; }
.sc-note { color: var(--grey-600); font-size: 0.85rem; margin: 2rem 0 0; }

/* ── Pulsanti ─────────────────────────────────────────────────────────── */

.sc-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #d3d8e2;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  touch-action: manipulation;
}
.sc-btn:hover:not(:disabled) { border-color: #aeb6c4; background: #f7f9fc; }
.sc-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sc-btn:disabled { opacity: 0.4; cursor: default; }
.sc-btn.is-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.sc-btn.is-primary:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); }
.sc-btn.is-danger { color: #b91c1c; }
.sc-btn.is-danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.sc-btn.is-danger-solid:hover:not(:disabled) { background: #b91c1c; }
.sc-btn.is-ghost { border-color: transparent; background: transparent; color: var(--grey-600); }
.sc-btn.is-lg { padding: 0.7rem 1.2rem; font-size: 1rem; }
.sc-btn.is-sm { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

.sc-icon-btn {
  border: 0;
  background: none;
  color: var(--grey-600);
  font-size: 1.3rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  cursor: pointer;
}
.sc-icon-btn:hover { background: #fde8e8; color: #b91c1c; }

.sc-seg {
  display: inline-flex;
  flex-wrap: wrap;
  background: #e8ecf3;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.sc-seg button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 0;
  background: none;
  color: var(--grey-600);
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
}
.sc-seg button.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(5, 39, 103, 0.15); }

/* ── Elenco partite ───────────────────────────────────────────────────── */

.sc-list {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.sc-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.sc-list-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); color: var(--navy); margin: 0 0 0.4rem; }
.sc-lead { margin: 0; color: var(--grey-600); max-width: 36rem; }
.sc-list-actions { display: flex; gap: 0.6rem; }

.sc-cards { display: grid; gap: 0.75rem; }

.sc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
}
.sc-card-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
}
.sc-card-main:hover { background: var(--grey-50); }
.sc-card-title { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 1.05rem; flex-wrap: wrap; }
.sc-card-vs { color: var(--grey-600); font-weight: 500; font-size: 0.85rem; margin: 0 0.2rem; }
.sc-card-meta { color: var(--grey-600); font-size: 0.85rem; }
.sc-card-status { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.sc-card-parts { font-weight: 400; color: var(--grey-600); }
.sc-card-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.sc-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--team); display: inline-block; }

.sc-empty {
  text-align: center;
  background: #fff;
  border: 1px dashed #c9cfda;
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
}
.sc-empty p { margin: 0.3rem 0; }
.sc-empty p:first-child { font-weight: 600; font-size: 1.05rem; }

/* ── Rose / dati partita ──────────────────────────────────────────────── */

.sc-setup {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.sc-setup h1 { color: var(--navy); margin: 0 0 1.25rem; font-size: clamp(1.5rem, 3vw, 2rem); }

.sc-setup-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.sc-field { display: grid; gap: 0.3rem; }
.sc-field.is-inline { display: inline-flex; align-items: center; gap: 0.5rem; }
.sc-field-label { font-size: 0.78rem; font-weight: 700; color: var(--grey-600); text-transform: uppercase; letter-spacing: 0.04em; }
.sc-field input, .sc-field select,
.sc-setup input[type="text"], .sc-setup select, .sc-paste, .sc-modal select {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #cfd5df;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
.sc-field input:focus, .sc-setup input:focus, .sc-setup select:focus, .sc-paste:focus, .sc-modal select:focus {
  outline: 2px solid var(--blue-light);
  outline-offset: 0;
  border-color: var(--blue);
}

.sc-setup-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }

.sc-team-card {
  background: #fff;
  border: 1px solid var(--grey-200);
  border-top: 4px solid var(--team);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sc-team-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.sc-setup select.sc-saved-team { font-size: 0.85rem; padding: 0.35rem 0.5rem; max-width: 60%; }
.sc-team-label { font-size: 0.78rem; font-weight: 700; color: var(--team); text-transform: uppercase; letter-spacing: 0.05em; }
.sc-setup .sc-team-name { font-size: 1.15rem; font-weight: 700; }

.sc-roster-head, .sc-roster-row {
  display: grid;
  grid-template-columns: 2rem 3.2rem minmax(0, 1fr) auto 2rem;
  gap: 0.4rem;
  align-items: center;
}
.sc-roster-head > span:nth-child(4) { width: 10.4rem; }

/* Stella dei titolari */
.sc-star {
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: #c9ced8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.sc-star:hover { color: #f59e0b; background: #fffbeb; }
.sc-star.is-on { color: #f59e0b; }
.sc-roster-row.is-starter .sc-in-num, .sc-roster-row.is-starter .sc-in-name { background: #fffbeb; border-color: #fcd34d; }

/* Ruoli: interruttori, più di uno acceso per giocatore */
.sc-roles { display: flex; gap: 3px; }
.sc-role {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  width: 1.9rem;
  height: 2rem;
  border: 1px solid #cfd5df;
  border-radius: 6px;
  background: #fff;
  color: #8a93a3;
  cursor: pointer;
}
.sc-role:hover { border-color: var(--team); color: var(--team); }
.sc-role.is-on { background: var(--team); border-color: var(--team); color: #fff; }
.sc-roles-legend { margin: 0; font-size: 0.8rem; }

.sc-starter-status { margin: 0; font-size: 0.85rem; color: #15803d; font-weight: 600; }
.sc-starter-status.is-bad { color: #b45309; }
.sc-roster-head { font-size: 0.75rem; font-weight: 700; color: var(--grey-600); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0.1rem; }
.sc-roster { display: grid; gap: 0.35rem; }
.sc-setup .sc-in-num { text-align: center; font-weight: 700; }
.sc-roster-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.sc-check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.88rem; color: var(--grey-600); cursor: pointer; }
.sc-check input { margin-top: 0.2rem; }

.sc-setup-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.sc-setup-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }

.sc-paste { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }

/* ── Finestre ─────────────────────────────────────────────────────────── */

.sc-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sc-modal-veil { position: absolute; inset: 0; background: rgba(18, 29, 53, 0.55); }
.sc-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(5, 20, 50, 0.35);
  width: min(460px, 100%);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
}
.sc-modal-box.is-wide { width: min(880px, 100%); }
.sc-modal-head { padding: 1rem 1.25rem 0.25rem; }
.sc-modal-head h2 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.sc-modal-body { padding: 0.5rem 1.25rem 1rem; overflow: auto; }
.sc-modal-body > p:first-child { margin-top: 0.25rem; }
.sc-modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.8rem 1.25rem 1rem; border-top: 1px solid var(--grey-200); }
.sc-modal-foot .is-ghost { margin-right: auto; }

.sc-lineups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.sc-lu-team { border: 1px solid var(--grey-200); border-top: 4px solid var(--team); border-radius: 10px; padding: 0.8rem; display: grid; gap: 0.55rem; }
.sc-lu-team h3 { margin: 0; font-size: 1.05rem; }
.sc-lu-net {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-600);
  border-bottom: 3px double #9aa3b2;
  padding-bottom: 0.15rem;
}
.sc-lu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.sc-lu-cell { display: grid; gap: 0.15rem; background: #fdf1e6; border-radius: 8px; padding: 0.4rem; }
.sc-lu-cell.is-setter { background: #fde7cf; box-shadow: inset 0 0 0 2px var(--team); }
.sc-lu-zone { font-size: 0.72rem; font-weight: 700; color: #9a4a0c; display: flex; justify-content: space-between; gap: 0.3rem; white-space: nowrap; }
.sc-lu-zone em { font-style: normal; font-weight: 600; color: #6b7280; }
.sc-lu-sz { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; }
.sc-lu-sz .sc-seg button { min-width: 2.1rem; }
.sc-lu-hint { margin: 0 0 0.8rem; }
.sc-lu-side { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.9rem; padding: 0.55rem 0.7rem; background: var(--grey-50); border-radius: 10px; }
.sc-lu-side.is-deciding { background: #fff7ed; box-shadow: inset 0 0 0 1px #fdba74; }
.sc-lu-side-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-600); }
.sc-pl-btn small { font-size: 0.72rem; color: #8a93a3; font-weight: 600; }
.sc-pl-btn.is-sel small { color: rgba(255, 255, 255, 0.8); }
.sc-lu-cell select { width: 100%; font-size: 0.85rem; padding: 0.35rem; }
.sc-lu-tools { display: flex; gap: 0.4rem; }
.sc-lu-lib { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; font-weight: 600; }
.sc-lu-lib select { flex: 1; }
.sc-radio { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }

.sc-sub h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-600); margin: 1rem 0 0.4rem; }
.sc-pick-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.sc-menu {
  position: fixed;
  z-index: 150;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(5, 20, 50, 0.18);
  padding: 0.35rem;
  min-width: 250px;
  display: grid;
}
.sc-menu button {
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  border: 0;
  background: none;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.sc-menu button:hover:not(:disabled) { background: var(--grey-50); }
.sc-menu button:disabled { opacity: 0.4; cursor: default; }
.sc-menu button.is-danger { color: #b91c1c; }
.sc-menu hr { border: 0; border-top: 1px solid var(--grey-200); margin: 0.3rem 0; }

.sc-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--navy-dark);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 9px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: calc(100vw - 2rem);
}

/* ── Partita: barra in alto ───────────────────────────────────────────── */

.sc-match { height: 100%; display: flex; flex-direction: column; }

.sc-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem;
  background: var(--navy-dark);
  color: #fff;
  flex-shrink: 0;
}

.sc-top-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.sc-top-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.sc-top-btn:disabled { opacity: 0.35; cursor: default; }
.sc-top-tools { display: flex; gap: 0.4rem; }

.sc-sb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}
.sc-sb-team { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; max-width: 15rem; }
.sc-sb-team.is-left { align-items: flex-end; text-align: right; }
.sc-sb-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 3px solid var(--team);
  padding-bottom: 0.1rem;
}
.sc-sb-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-sb-sub { display: flex; gap: 0.4rem; align-items: center; }
.sc-to-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  cursor: pointer;
}
.sc-to-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.sc-to-btn:disabled { opacity: 0.4; cursor: default; }
.sc-to-btn.is-plus { font-weight: 800; border-color: color-mix(in srgb, var(--team) 70%, #fff); }

.sc-fs-btn { display: inline-grid; place-items: center; padding: 0.4rem 0.55rem; }
.sc-fs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sc-sb-rot { font-size: 0.72rem; font-weight: 700; color: #fbbf24; }

.sc-sb-sets {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  flex-shrink: 0;
}
.sc-sb-score { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.3ch; text-align: center; line-height: 1; }
.sc-sb-mid { display: flex; flex-direction: column; align-items: center; min-width: 5.5rem; }
.sc-sb-set { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #fbbf24; white-space: nowrap; }
.sc-sb-partials { font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); white-space: pre; }

.sc-ball {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #facc15;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.sc-tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.9rem;
  background: #fff;
  border-bottom: 1px solid var(--grey-200);
  flex-shrink: 0;
  overflow-x: auto;
}
.sc-tab {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--grey-600);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.85rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}
.sc-tab:hover { color: var(--navy); }
.sc-tab.is-active { color: var(--navy); border-bottom-color: var(--orange); }

.sc-body { flex: 1; min-height: 0; overflow: auto; }

/* ── Scheda Scout ─────────────────────────────────────────────────────── */

/* Una riga di indicazioni in alto, poi il campo che si prende tutto il resto. Nessuna colonna
   laterale: gli esiti si scelgono dai fumetti sopra i giocatori. */
.sc-scout {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sc-prompt {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem 0.8rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid var(--grey-200);
  min-height: 2.6rem;
}
.sc-prompt .is-ghost { margin-left: auto; }
.sc-prompt-text { margin: 0; font-size: 0.95rem; line-height: 1.35; }
.sc-team-tag { font-weight: 700; color: var(--team); }
.sc-rally { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }

.sc-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: #fff;
  border: 1px solid #d6dbe4;
  border-left: 3px solid var(--team);
  padding: 0.05rem 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}
.sc-chip-code { color: var(--g); }

/* Il riquadro del campo ha le proporzioni della viewBox (22,8 × 12,4) e la dimensione massima che
   ci sta nello spazio disponibile (unità cq* del contenitore): così i fumetti, posizionati in
   percentuale, cadono esattamente sopra i gettoni. */
.sc-court-wrap {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  padding: 0.4rem;
}
.sc-court-box {
  position: relative;
  width: min(100cqw, calc(100cqh * 22.8 / 12.4));
  aspect-ratio: 22.8 / 12.4;
}

.sc-court { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; touch-action: none; }
.sc-court.is-clickable { cursor: crosshair; }
.sc-c-free { fill: #2e5c99; }
.sc-c-floor { fill: #e98c3f; }
.sc-c-line { stroke: #fff; stroke-width: 0.08; fill: none; }
.sc-c-net { stroke: #fff; stroke-width: 0.22; stroke-linecap: round; }
.sc-c-guide { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.04; stroke-dasharray: 0.25 0.25; }
.sc-c-label { font-size: 0.62px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 0.18px; }

.sc-tok-hit { fill: transparent; }
.sc-tok-c { fill: #fff; stroke: var(--team); stroke-width: 0.15; }
.sc-tok-n { font-size: 0.78px; font-weight: 800; text-anchor: middle; fill: #111827; pointer-events: none; }
.sc-tok-name {
  font-size: 0.44px;
  font-weight: 600;
  text-anchor: middle;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.12px;
  pointer-events: none;
}
.sc-tok.is-lib .sc-tok-c { fill: #fde68a; }
.sc-tok.is-idle { opacity: 0.55; }
.sc-tok.is-pick { cursor: pointer; }
.sc-tok.is-pick .sc-tok-c { stroke-width: 0.22; filter: drop-shadow(0 0 0.18px rgba(255, 255, 255, 0.9)); }
.sc-tok.is-pick:hover .sc-tok-c { fill: #eef4ff; }
.sc-tok.is-sel .sc-tok-c { fill: var(--team); stroke: #fff; }
.sc-tok.is-sel .sc-tok-n { fill: #fff; }
.sc-tok-ball { fill: #facc15; stroke: #1f2937; stroke-width: 0.06; }
/* "L" sul bordo del cerchio del libero */
.sc-tok-lib circle { fill: #111827; stroke: #fde68a; stroke-width: 0.07; }
.sc-tok-lib text { font-size: 0.5px; font-weight: 800; text-anchor: middle; fill: #fde68a; pointer-events: none; }

/* Possibili attaccanti: anello giallo che pulsa finché non se ne sceglie uno */
.sc-tok-ring { fill: none; stroke: #facc15; stroke-width: 0.16; animation: sc-ring 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes sc-ring { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: 0.45; } }

/* "Seleziona attaccante" sopra la metà campo di chi attacca */
.sc-court-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #facc15;
  color: #1f2937;
  font-weight: 800;
  font-size: clamp(11px, 1cqw, 16px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.sc-traj.is-past { opacity: 0.85; }
.sc-mark-from { fill: none; stroke: #111827; stroke-width: 0.1; stroke-dasharray: 0.15 0.1; }
.sc-mark-line { stroke: #111827; stroke-width: 0.08; stroke-dasharray: 0.3 0.2; pointer-events: none; }
.sc-mark-line.is-drag { stroke: #fff; stroke-width: 0.12; stroke-dasharray: none; stroke-linecap: round; }
.sc-mark-to circle { fill: #111827; stroke: #fff; stroke-width: 0.08; }
.sc-mark-to path { stroke: #fff; stroke-width: 0.09; stroke-linecap: round; }

/* Fumetti sopra i giocatori. Il livello copre il campo ma lascia passare tocchi e trascinamenti;
   solo i fumetti li intercettano. La dimensione del testo segue quella del campo (cqw). */
.sc-bubbles { position: absolute; inset: 0; pointer-events: none; }
.sc-bub {
  --tx: -50%;
  --ty: calc(-100% - 4px);
  position: absolute;
  transform: translate(var(--tx), var(--ty));
  pointer-events: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(10, 25, 60, 0.35), 0 0 0 1px rgba(10, 25, 60, 0.08);
  padding: 0.35em;
  font-size: clamp(11px, 0.9cqw, 15px);
  max-width: 26em;
  z-index: 2;
  animation: sc-bub-in 0.14s ease-out;
}
.sc-bub.is-below { --ty: 4px; }
.sc-bub.is-l { --tx: -12%; }
.sc-bub.is-r { --tx: -88%; }
@keyframes sc-bub-in { from { opacity: 0; } to { opacity: 1; } }

.sc-bub-title {
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-600);
  padding: 0.1em 0.35em 0.3em;
}
.sc-bub-btns { display: flex; flex-wrap: wrap; gap: 0.3em; }
.sc-bub.is-att .sc-bub-btns, .sc-bub.is-rec .sc-bub-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sc-bub-btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.6em 0.4em 0.4em;
  border: 1px solid #d3d8e2;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.sc-bub-btn:hover { border-color: var(--g, #aeb6c4); background: #f7f9fc; }
.sc-bub-btn.is-hidden, .sc-bub-more.is-hidden { display: none; }
.sc-bub-btn.is-plain { padding-left: 0.6em; }
.sc-bub-btn.is-muted { color: var(--grey-600); }
.sc-bub-btn.is-dig { --g: #0e7490; grid-column: 1 / -1; background: #ecfeff; border-color: #a5f3fc; }
.sc-bub-btn.is-block { background: #7c3aed; border-color: #7c3aed; color: #fff; padding: 0.3em 0.7em; }
.sc-bub.is-mini { padding: 0.2em; border-radius: 8px; }
.sc-bub-more {
  font: inherit;
  font-size: 0.85em;
  grid-column: 1 / -1;
  border: 0;
  background: none;
  color: var(--blue-hover);
  cursor: pointer;
  padding: 0.2em;
}

.sc-g-sym {
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 5px;
  background: var(--g);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
  font-size: 0.95em;
  flex-shrink: 0;
}

/* Prima del set / tra un set e l'altro */
.sc-court-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 29, 53, 0.35);
  border-radius: 6px;
}
.sc-overlay-card {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sc-pl-btn { border-left: 4px solid var(--team); padding-left: 0.55rem; }
.sc-pl-btn b { font-size: 1rem; }
.sc-pl-btn.is-lib { background: #fffbeb; }
.sc-pl-btn.is-sel { background: var(--team); border-color: var(--team); color: #fff; }
.sc-pl-btn.is-sel:hover:not(:disabled) { background: var(--team); }

/* Registro azioni (scheda "Azioni") */
.sc-log-pane { max-width: 760px; }
.sc-log {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.sc-log-time { font-size: 0.72rem; color: #8a93a3; font-variant-numeric: tabular-nums; }
.sc-log-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-600);
  margin: 0;
  padding: 0.7rem 0.9rem 0.5rem;
  border-bottom: 1px solid var(--grey-200);
}
.sc-log-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.sc-log-empty { padding: 0.9rem; margin: 0; flex: 1; }
.sc-log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.45rem 0.9rem;
  border-bottom: 1px solid #eef1f5;
  font-size: 0.83rem;
}
.sc-log-item.has-point { background: #fafbfd; }
.sc-log-body { flex: 1; min-width: 0; display: grid; gap: 0.2rem; }
.sc-log-touch { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.sc-log-touch > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-log-grade { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; }
.sc-log-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--team);
  white-space: nowrap;
  padding-top: 0.05rem;
}
.sc-log-del {
  border: 0;
  background: none;
  color: #b3bac6;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}
.sc-log-del:hover { color: #b91c1c; background: #fde8e8; }
.sc-log-set {
  padding: 0.4rem 0.9rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.sc-log-keys { margin: 0; padding: 0.6rem 0.9rem; font-size: 0.75rem; color: var(--grey-600); border-top: 1px solid var(--grey-200); }

/* ── Statistiche, direzioni, rotazioni ────────────────────────────────── */

.sc-pane { padding: 1rem 1.1rem 2rem; max-width: 1280px; margin: 0 auto; }
.sc-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9rem; }

.sc-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.sc-sum-card { background: #fff; border: 1px solid var(--grey-200); border-top: 4px solid var(--team); border-radius: var(--radius); padding: 0.8rem 1rem; }
.sc-sum-card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.sc-sum-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem 1rem; }
.sc-sum-card dt { font-size: 0.72rem; color: var(--grey-600); font-weight: 600; }
.sc-sum-card dd { margin: 0; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.sc-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); margin-bottom: 0.6rem; }
.sc-table-wrap.is-narrow { max-width: 420px; margin-top: 1.2rem; }
.sc-table { border-collapse: collapse; width: 100%; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.sc-table th, .sc-table td { padding: 0.42rem 0.5rem; text-align: center; white-space: nowrap; border-bottom: 1px solid #eef1f5; }
.sc-table thead th { background: #f3f5f9; font-size: 0.74rem; font-weight: 700; color: var(--grey-600); }
.sc-table .sc-th-group th { background: var(--team, var(--navy)); color: #fff; letter-spacing: 0.04em; text-transform: uppercase; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.sc-table .sc-th-group th:first-child { background: #f3f5f9; }
.sc-td-num { font-weight: 800; }
.sc-td-name { text-align: left !important; }
.sc-td-strong { font-weight: 700; }
.sc-table tr.is-total td { font-weight: 800; background: #f3f5f9; border-top: 2px solid #d6dbe4; }
.sc-table tr.is-muted td { color: var(--grey-600); font-style: italic; }
.sc-table td.is-pos { color: #15803d; font-weight: 700; }
.sc-table td.is-neg { color: #b91c1c; font-weight: 700; }
.sc-legend-note { font-size: 0.8rem; color: var(--grey-600); margin: 0.4rem 0 0; }

.sc-mini {
  display: inline-grid;
  grid-template-columns: repeat(3, 1.6rem);
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
}
.sc-mini span { background: #fdf1e6; border-radius: 3px; padding: 0.05rem 0; }
.sc-mini span.is-setter { background: var(--team); color: #fff; }

.sc-dir { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.sc-dir-court { background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 0.5rem; }
.sc-dir-court .sc-court { height: auto; }
.sc-dir-side { display: grid; gap: 0.8rem; }
.sc-dir-count { margin: 0; }
.sc-dir-legend { display: grid; gap: 0.35rem; }
.sc-legend-item {
  font: inherit;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  text-align: left;
}
.sc-legend-item b { margin-left: auto; }
.sc-legend-item.is-off { opacity: 0.4; }
.sc-zone-heat { fill: #1e3a8a; }
.sc-zone-txt { font-size: 0.85px; font-weight: 800; text-anchor: middle; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.45); stroke-width: 0.12px; }
.sc-zone-lbl { font-size: 0.45px; font-weight: 700; fill: rgba(255, 255, 255, 0.75); }

/* ── Schermi stretti ──────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .sc-sb-score { font-size: 1.6rem; }
}

@media (max-width: 900px) {
  body.scout-page { height: auto; overflow: visible; display: block; }
  .sc-app { overflow: visible; }
  .sc-match { height: auto; }
  .sc-body { overflow: visible; }
  .sc-scout { height: auto; }
  /* Qui l'altezza non è fissata: il campo si adatta alla sola larghezza. */
  .sc-court-wrap { container-type: inline-size; padding: 0.3rem; }
  .sc-court-box { width: 100%; }
  .sc-top { flex-wrap: wrap; justify-content: space-between; }
  .sc-sb { order: 3; flex-basis: 100%; }
  .sc-setup-teams, .sc-lineups, .sc-sum { grid-template-columns: minmax(0, 1fr); }
  .sc-dir { grid-template-columns: minmax(0, 1fr); }
  .sc-card { flex-direction: column; align-items: stretch; padding: 0.4rem; }
  .sc-card-tools { justify-content: flex-start; padding: 0 0.8rem 0.6rem; }
}

@media (max-width: 560px) {
  .sc-sum-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-roster-head { display: none; }
  .sc-roster-row { grid-template-columns: 2rem 3rem minmax(0, 1fr) 2rem; }
  .sc-roster-row .sc-roles { grid-column: 2 / 4; }
  .sc-sb-team { max-width: 8rem; }
  .sc-sb-score { font-size: 1.4rem; }
  .sc-list-head { align-items: stretch; }
}
