/* assets/css/totw.css
   Team of the Week (totw.php). Pagina costruita da zero: Team of the Tournament in fila, settimane sul campo con i sondaggi,
   classifica dei piu votati. Foto giocatore come nel resto del sito (Hall of Fame, compagni in carriera):
   quadrate, raggio --r-1, object-fit cover, fondo --surface-2, senza bordo. Superfici piene e bordi da 1px; colori, spaziature e raggi dalle variabili di main.css. */

main.tw-pagina {
    width: 100%;
    min-width: 0;
    max-width: calc(1120px + var(--sp-4) * 2);
    margin: 0 auto;
    padding: 27px var(--sp-4) 0;
    box-sizing: border-box;
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    color: var(--text);
}
main.tw-pagina a {
    color: inherit;
    text-decoration: none;
}
main.tw-pagina a:focus-visible,
.tw-scheda:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
.tw-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.tw-etichetta {
    font-size: var(--fs-label);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
}
.tw-nota {
    font-size: var(--fs-min);
    color: var(--text-2);
}
.tw-vuoto {
    margin: 0;
    padding: var(--sp-4);
    font-size: var(--fs-small);
    color: var(--text-2);
}
.tw-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
    flex: none;
}
.tw-voto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 20px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 4px;
    font-size: var(--fs-min);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Edizioni */
.tw-anni {
    display: flex;
    gap: var(--sp-1);
    margin-bottom: var(--sp-4);
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
}
.tw-anni::-webkit-scrollbar { display: none; }
.tw-anni a {
    flex: none;
    margin-bottom: -1px;
    padding: 10px 12px;
    font-size: var(--fs-small);
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
}
main.tw-pagina .tw-anni a.is-attivo {
    color: var(--text);
    font-weight: 700;
    border-bottom-color: var(--text);
}

/* Contenitori */
.tw-blocco {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.tw-blocco__testa {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--line);
}
.tw-blocco__titolo {
    margin: 0;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text);
}

/* Team of the Tournament */
.tw-tott {
    margin-bottom: var(--sp-6, 32px);
}
.tw-tott__fila {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tw-tg {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: var(--sp-4) 6px;
    text-align: center;
    border-left: 1px solid var(--line);
}
.tw-tg:first-child { border-left: 0; }
.tw-tg__foto {
    width: 88px;
    height: 88px;
    border-radius: var(--r-1);
    object-fit: cover;
    background: var(--surface-2);
}
.tw-tg__ruolo { margin-top: 10px; }
.tw-tg__ruolo .tw-corto { display: none; }
.tw-tg__nome {
    max-width: 100%;
    margin-top: 2px;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tw-tg__info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: var(--fs-min);
    color: var(--text-2);
}
.tw-tg__gol { font-variant-numeric: tabular-nums; }

/* Schede delle settimane */
.tw-schede {
    display: flex;
    gap: var(--sp-1);
    margin-bottom: var(--sp-4);
    overflow-x: auto;
    scrollbar-width: none;
}
.tw-schede::-webkit-scrollbar { display: none; }
.tw-scheda {
    flex: none;
    padding: 7px 12px;
    font: inherit;
    font-size: var(--fs-small);
    color: var(--text-2);
    background: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
}
.tw-scheda.is-attivo {
    font-weight: 700;
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--surface-2);
}
/* Senza script le schede non servono: si vedono tutte le settimane una sotto l'altra */
.tw-schede { display: none; }
.tw-js .tw-schede { display: flex; }
.tw-griglia + .tw-griglia { margin-top: var(--sp-4); }
.tw-js .tw-griglia + .tw-griglia { margin-top: 0; }
.tw-griglia[hidden] { display: none; }

.tw-griglia {
    display: grid;
    gap: var(--sp-4);
}
@media (min-width: 900px) {
    .tw-griglia {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        align-items: start;
    }
}

/* Campo */
.tw-campo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 640px;
    overflow: hidden;
}
@media (min-width: 900px) {
    .tw-campo { aspect-ratio: auto; height: 560px; }
}
.tw-campo__linee {
    position: absolute;
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    fill: none;
    stroke: rgba(244, 240, 250, 0.13);
    stroke-width: 1;
}
.tw-campo__linee * { vector-effect: non-scaling-stroke; }
.tw-p {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 31%;
    text-align: center;
    transform: translate(-50%, -50%);
}
.tw-p__foto {
    width: 56px;
    height: 56px;
    border-radius: var(--r-1);
    object-fit: cover;
    background: var(--surface-2);
}
.tw-p__nome {
    max-width: 100%;
    margin-top: 6px;
    overflow: hidden;
    font-size: var(--fs-small);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tw-p__info {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    margin-top: 2px;
    font-size: var(--fs-label);
    color: var(--text-2);
}
.tw-p--PIV  { left: 50%; top: 13%; }
.tw-p--LAT1 { left: 21%; top: 37%; }
.tw-p--LAT2 { left: 79%; top: 37%; }
.tw-p--DIF  { left: 50%; top: 61%; }
.tw-p--POR  { left: 50%; top: 87%; }

/* Sondaggi */
.tw-sondaggi {
    margin: 0;
    padding: 0;
    list-style: none;
}
.tw-sondaggi li {
    padding: 10px var(--sp-4);
    border-top: 1px solid var(--line);
}
.tw-sondaggi li:first-child { border-top: 0; }
.tw-duello {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.tw-duello__g {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}
.tw-duello__g img {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: var(--r-1);
    object-fit: cover;
    background: var(--surface-2);
}
.tw-duello__g span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tw-duello__g--perde { color: var(--text-2); }
.tw-duello__g--vince {
    justify-content: flex-end;
    font-weight: 700;
    text-align: right;
}
.tw-duello__m {
    min-width: 44px;
    font-size: var(--fs-min);
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    text-align: center;
}
.tw-barra {
    display: flex;
    gap: 2px;
    height: 3px;
    margin-top: var(--sp-2);
}
.tw-barra i {
    display: block;
    border-radius: 2px;
    background: var(--line);
}
.tw-barra i.is-vince { background: var(--text); }

/* Classifica di sempre */
.tw-classifica { margin-top: 32px; }
.tw-tabella {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.tw-tabella th {
    padding: var(--sp-2);
    font-size: var(--fs-label);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: right;
    color: var(--text-2);
}
.tw-tabella th abbr { text-decoration: none; }
.tw-tabella th:nth-child(1) { width: 28px; }
.tw-tabella th:nth-child(2) { text-align: left; }
.tw-tabella th:nth-child(3),
.tw-tabella th:nth-child(4) { width: 48px; }
.tw-tabella th:nth-child(5) { width: 96px; }
.tw-tabella th:nth-child(6) { width: 88px; }
.tw-tabella td {
    height: 32px;
    padding: 6px var(--sp-2);
    text-align: right;
    border-top: 1px solid var(--line);
}
.tw-tabella__pos { text-align: center !important; color: var(--text-2); }
.tw-tabella__g { text-align: left !important; }
.tw-tabella__g a {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    overflow: hidden;
}
.tw-tabella__g img {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: var(--r-1);
    object-fit: cover;
    background: var(--surface-2);
}
.tw-tabella__g .tw-corto { display: none; }
.tw-tabella__g span {
    overflow: hidden;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tw-forte { font-weight: 700; }
.tw-debole { color: var(--text-2); }
.tw-piede {
    margin: 0;
    padding: 10px var(--sp-4);
    border-top: 1px solid var(--line);
}

@media (max-width: 767px) {
    .tw-ampio { display: none; }
    .tw-tabella__g .tw-lungo { display: none; }
    .tw-tabella__g .tw-corto { display: inline; }
}
@media (max-width: 600px) {
    .tw-tg { padding: var(--sp-3) 2px; }
    .tw-tg__foto { width: 48px; height: 48px; }
    .tw-tg__nome { font-size: var(--fs-min); }
    .tw-tg__ruolo .tw-lungo { display: none; }
    .tw-tg__ruolo .tw-corto { display: inline; }
    .tw-tg__info { flex-direction: column; gap: var(--sp-1); }
    .tw-tg__gol { display: none; }
}
