/* assets/css/rete.css
   Rete dei compagni (rete.php). Pagina costruita da zero; i selettori con ricerca e i pulsanti di vista
   sono quelli di confronto.css. Il grafo e in bianco e grigio: nessun colore. */

.cf-scelta--uno {
    grid-template-columns: minmax(0, 1fr);
    max-width: 320px;
    margin: 0 auto;
}

/* --- Gradi di separazione: la catena, dall'alto in basso --- */
.rt-catena {
    margin-top: 32px;
}
.rt-gradi {
    margin: 0;
    font-size: 14px;
    text-align: center;
    color: var(--text-2);
}
.rt-gradi strong {
    display: block;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.rt-gradi-nota {
    margin: 4px 0 24px;
    font-size: 13px;
    text-align: center;
    color: var(--text-2);
}
.rt-passi {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 420px;
}
.rt-nodo a {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas: "foto nome" "foto ruolo";
    column-gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
}
.rt-nodo a:hover {
    background: var(--surface-2);
}
.rt-nodo a:focus-visible,
.rt-elenco a:focus-visible,
.rt-punto:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
.rt-nodo img {
    grid-area: foto;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface-2);
}
.rt-nodo__nome {
    grid-area: nome;
    align-self: end;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}
.rt-nodo.is-estremo .rt-nodo__nome {
    font-weight: 800;
}
.rt-nodo__ruolo {
    grid-area: ruolo;
    align-self: start;
    font-size: 12px;
    color: var(--text-2);
}
/* Il legame tra due giocatori: un tratto verticale con il numero di partite accanto */
.rt-legame {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 31px;
    padding: 10px 0 10px 20px;
    border-left: 1px solid var(--text-2);
}
.rt-legame__n {
    font-size: 13px;
    color: var(--text);
}
.rt-legame__sq {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-2);
}

/* --- Rete di un giocatore --- */
.rt-rete {
    margin-top: 24px;
}
.rt-rete__intro {
    margin: 0 auto 8px;
    max-width: 520px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-2);
}
.rt-rete__intro strong {
    color: var(--text);
    font-weight: 700;
}
.rt-grafo {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
    font-family: var(--font-ui);
}
.rt-filo {
    stroke: var(--text-2);
    opacity: 0.55;
}
.rt-filo--2 {
    stroke: var(--line);
    opacity: 1;
}
.rt-punto {
    cursor: pointer;
}
.rt-punto__tocco {
    fill: transparent;
}
.rt-punto__segno {
    fill: var(--surface-2);
    stroke: var(--text);
    stroke-width: 1.5;
}
.rt-punto--2 .rt-punto__segno {
    fill: var(--bg);
    stroke: var(--text-2);
    stroke-width: 1;
}
.rt-punto:hover .rt-punto__segno,
.rt-punto.is-attivo .rt-punto__segno {
    fill: var(--text);
    stroke: var(--text);
}
.rt-punto__nome,
.rt-centro__nome {
    text-anchor: middle;
    font-size: 11.5px; /* il disegno e largo 360: su un telefono da 390 viene reso al 99%, cosi il testo non scende sotto gli 11px */
    font-weight: 500;
    fill: var(--text);
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 3px;
    stroke-linejoin: round;
}
.rt-centro {
    fill: var(--text);
}
.rt-centro__nome {
    font-size: 12px;
    font-weight: 800;
}
.rt-lettura {
    min-height: 20px;
    margin: 8px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--text-2);
}
.rt-lettura.is-nome {
    color: var(--text);
}
.rt-titoletto {
    margin: 32px 0 8px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text);
}
.rt-elenco {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.rt-elenco li {
    border-top: 1px solid var(--line);
}
.rt-elenco li:first-child {
    border-top: 0;
}
.rt-elenco a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 12px;
    text-decoration: none;
}
.rt-elenco a:hover {
    background: var(--surface-2);
}
.rt-elenco img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface-2);
}
.rt-elenco__nome {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rt-elenco__n {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
