/* Calcolo fantavoto: campi in griglia con l'etichetta sopra, sezioni apribili, casella s.v. e "+ difensore" */
.cq-fantavoto .cq-sentence.cq-fv-form { display: block; }

.cq-fantavoto .cq-fv-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: end;
}
.cq-fantavoto .cq-fv-grid--lega { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cq-fantavoto .cq-fv-more .cq-fv-grid { margin-top: 14px; }

.cq-fantavoto .cq-fv-cell { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; }
.cq-fantavoto .cq-fv-cell[hidden] { display: none; }
.cq-fantavoto .cq-fv-cell--w2 { grid-column: span 2; }
.cq-fantavoto .cq-fv-lab { color: var(--cq-text); font-size: .95rem; font-weight: 600; line-height: 1.2; }
.cq-fantavoto .cq-fv-labrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

.cq-fantavoto .cq-fv-cell .cq-field { display: flex; width: 100%; }
.cq-fantavoto .cq-fv-cell .cq-field[hidden] { display: none; }
.cq-fantavoto .cq-fv-cell .cq-input,
.cq-fantavoto .cq-fv-cell .cq-select { width: 100%; min-width: 0; }
.cq-fantavoto .cq-fv-cell .cq-select { padding-left: 14px; padding-right: 34px; text-overflow: ellipsis; }

/* Senza voto: casellina accanto all'etichetta "Voto" e riquadro "s.v." al posto del numero */
.cq-fantavoto .cq-fv-sv {
  display: inline-flex; align-items: center; gap: 4px; margin: 0;
  color: var(--cq-muted); font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cq-fantavoto .cq-fv-sv input { width: 16px; height: 16px; margin: 0; accent-color: var(--cq-primary); cursor: pointer; }
.cq-fantavoto .cq-fv-svbox {
  display: flex; align-items: center; height: 54px; padding: 0 14px;
  border: 2px dashed var(--cq-line-strong); border-radius: 12px; background: var(--cq-surface);
  color: var(--cq-muted); font-size: 1.15rem; font-weight: 700;
}
.cq-fantavoto .cq-fv-svbox[hidden] { display: none; }

/* Sezioni apribili sotto i campi */
.cq-fantavoto .cq-fv-more { margin-top: 18px; font-size: 1rem; font-weight: 400; }
.cq-fantavoto .cq-fv-more summary { font-size: 1.02rem; }
.cq-fantavoto .cq-fv-reset { margin-top: 14px; }

/* "+ difensore" */
.cq-fantavoto .cq-fv-cell--btn { justify-content: center; }
.cq-fantavoto .cq-fv-add {
  min-height: 44px; margin: 0; padding: 0 4px; border: 0; background: none; box-shadow: none;
  color: var(--cq-primary); font: inherit; font-size: .95rem; font-weight: 600; text-align: left; cursor: pointer;
}
.cq-fantavoto .cq-fv-add { white-space: nowrap; }
.cq-fantavoto .cq-fv-add:hover { text-decoration: underline; background: none; }
.cq-fantavoto .cq-fv-add:focus-visible { outline: 3px solid var(--cq-focus); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 600px) {
  .cq-tool.cq-fantavoto { padding-left: 14px; padding-right: 14px; }
  .cq-fantavoto .cq-panel { padding: 16px 12px; }
  .cq-fantavoto .cq-fv-grid,
  .cq-fantavoto .cq-fv-grid--lega { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .cq-fantavoto .cq-fv-grid--fasce { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-fantavoto .cq-fv-lab { font-size: .85rem; }
  .cq-fantavoto .cq-fv-add { font-size: .88rem; }
  .cq-fantavoto .cq-fv-cell .cq-input,
  .cq-fantavoto .cq-fv-cell .cq-select,
  .cq-fantavoto .cq-fv-svbox { height: 48px; min-height: 48px; padding-left: 12px; font-size: 1.05rem; }
  .cq-fantavoto .cq-fv-cell .cq-select { padding-left: 10px; padding-right: 24px; font-size: .98rem; text-overflow: clip; background-position: right 15px center, right 9px center; }
  /* Riga 1: ruolo largo e voto; riga 2: gol e assist stretti, cartellino più largo */
  .cq-fantavoto .cq-fv-grid--main { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .cq-fantavoto .cq-fv-grid--main > .cq-fv-cell { grid-column: span 3; }
  .cq-fantavoto .cq-fv-grid--main > .cq-fv-cell--w2 { grid-column: span 6; }
  .cq-fantavoto .cq-fv-grid--main > .cq-fv-cell:nth-child(2),
  .cq-fantavoto .cq-fv-grid--main > .cq-fv-cell:nth-child(5) { grid-column: span 4; }
  .cq-fantavoto .cq-panel[data-mode="difesa"] .cq-fv-grid--main > .cq-fv-cell { grid-column: auto; }
  .cq-fantavoto .cq-panel[data-mode="difesa"] .cq-fv-grid--main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cq-fantavoto .cq-fv-more summary { font-size: 1rem; }
  .cq-fantavoto .cq-fv-reset { width: 100%; }
}
