/* assets/css/giocatore.css
   Carriera giocatore: ritocchi sopra il foglio originale (carrieragiocatore.css).
   La struttura e l'impianto restano quelli originali; qui si sistemano scala, pesi,
   font, testata, palmares e righe partita. */

/* --- Base: sfondo di brand in WebP, niente animazione d'ingresso --- */
body::before {
  background:
    linear-gradient(rgba(18, 0, 40, 0.5), rgba(18, 0, 40, 0.5)),
    url('/assets/imm/gradiente26.webp') center / cover no-repeat;
}
main.container {
  width: 100%;
  max-width: calc(737px + 32px);
  margin: 0 auto;
  padding: 0 16px;
  animation: none;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
main.container .druk-font,
main.container .helvetica-font {
  font-family: var(--font-ui);
  text-transform: none;
}

/* --- Testata: fascia con l'immagine del gradiente, a tutta larghezza --- */
.player-header-grid {
  position: relative;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 24px 0 20px;
  margin-bottom: 0;
  gap: 24px;
}
.player-header-grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background:
    linear-gradient(rgba(18, 0, 40, 0.18), rgba(18, 0, 40, 0.18)),
    url('/assets/imm/gradiente26.webp') center / cover no-repeat;
  border-bottom: 1px solid rgba(244, 240, 250, 0.14);
}
/* Foto: contorno sottile e lieve, senza velatura rosa ne zoom */
.ph-image-wrapper {
  border-radius: 8px;
  outline: 1px solid rgba(244, 240, 250, 0.35);
  outline-offset: 3px;
}
.ph-image-wrapper::after {
  display: none;
}
.ph-image-wrapper img {
  width: 128px;
  height: 128px;
  border: 0;
  border-radius: 8px;
  transition: none;
}
.ph-image-wrapper:hover img {
  transform: none;
}
/* Nome del giocatore: nome e cognome sulla stessa riga, stesso font e stessa misura,
   bianchi, nel font di interfaccia in grassetto. E l'unico elemento forte della pagina. */
.ph-names {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 0.3em;
}
.ph-nome,
.ph-cognome,
.ph-cognome[data-long="true"] {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.12;
  text-transform: none;
  color: var(--text);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  max-width: 100%;
}
.ph-flag-role {
  font-size: 13px;
  text-transform: none;
  gap: 6px;
  margin: 8px 0 0;
}
.ph-flag-role .flag {
  width: 18px;
  height: 13px;
  border-radius: 2px;
}

/* Statistiche: etichetta piccola sopra, numero sotto, nel font di interfaccia */
.stats-col {
  gap: 10px;
  padding: 0 0 0 16px;
}
.stats-col.border-left {
  margin-left: 16px;
}
.stats-col.border-left {
  border-left: 1px solid rgba(244, 240, 250, 0.22);
}
.stat-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(244, 240, 250, 0.78);
  margin-bottom: 1px;
}
.stat-number {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
.dot {
  width: 6px;
  height: 6px;
}

/* --- Palmares: elementi compatti che vanno a capo, icone bianche --- */
.trophies-container {
  display: flex;
  align-items: baseline;
  gap: 6px 20px;
  flex-wrap: wrap;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(244, 240, 250, 0.14);
  border-radius: 0;
  padding: 14px 0;
  margin-bottom: 20px;
}
.section-label {
  position: static;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.trophies-grid {
  justify-content: flex-start;
  gap: 8px 22px;
  margin-top: 0;
  flex: 1;
  min-width: 0;
}
.trophy-card {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  width: auto;
  height: 24px;
  transition: none;
  white-space: nowrap;
}
.trophy-card:hover {
  transform: none;
}
.trophy-upper-content,
.trophy-icon-wrapper {
  display: contents;
}
.trophy-img-std,
.trophy-img-small {
  order: 1;
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin: 0;
}
.trophy-text-white-icon {
  order: 1;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--text);
  border-radius: 3px;
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
}
/* Il riquadro dice gia "MVP": l'etichetta accanto sarebbe un doppione */
.trophy-card:has(.trophy-text-white-icon) .trophy-label {
  display: none;
}
.trophy-label {
  order: 2;
  width: auto;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  line-height: 1.2;
}
.trophy-year,
.trophy-multiplier {
  order: 3;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
}

/* --- Stagioni e partite: effetto vetro sobrio (solo in questa sezione) --- */
.season-box {
  margin-bottom: 10px;
  background: rgba(244, 240, 250, 0.06);
  border: 1px solid rgba(244, 240, 250, 0.16);
  border-radius: 8px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: none;
}
.season-box:hover {
  border-color: rgba(244, 240, 250, 0.16);
}
.season-header {
  min-height: 48px;
  padding: 8px 14px;
  background: rgba(244, 240, 250, 0.05);
  font-family: var(--font-ui);
  font-size: 14px;
  text-transform: none;
}
.season-header:hover {
  background: rgba(244, 240, 250, 0.09);
}
.season-header:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.season-info-main {
  gap: 10px;
  min-width: 0;
}
.season-team-logo {
  width: 24px;
  height: 24px;
}
.season-team-name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0;
  text-transform: none;
}
.season-year {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
}
.season-teams-wrap { display: flex; flex-direction: column; gap: 2px; }
.season-teams-multi { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.season-team-chip { display: inline-flex; align-items: center; gap: 6px; }
.season-team-arrow {
  display: inline-block;
  width: 1px;
  height: 14px;
  background-color: rgba(244, 240, 250, 0.35);
  opacity: 1 !important;
}
.toggle-icon {
  color: var(--text-2);
  font-size: 12px;
  transition: transform 150ms ease;
}
.season-summary {
  padding: 10px 14px;
  background: none;
  font-size: 12px;
  text-transform: none;
  color: var(--text-2);
}
.season-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 20px;
}
.season-summary__item {
  white-space: nowrap;
}
.season-summary .druk-font {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: 4px;
}

/* Riga partita: voto ed esito in colonne fisse, nessun testo a capo sotto di loro */
.match-row {
  padding: 0 14px;
  border-bottom: 0;
  border-top: 1px solid rgba(244, 240, 250, 0.12);
  transition: none;
}
.match-row:hover {
  background: rgba(244, 240, 250, 0.06);
}
.match-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 0;
}
.match-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.match-meta-col {
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
}
.match-phase {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.match-score-block {
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.team-side {
  gap: 6px;
  min-width: 0;
}
.team-side img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.team-sigla,
.team-full {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
}
.team-sigla {
  text-transform: uppercase;
}
/* Sigle di base; nome intero solo dove ci sta davvero */
.team-full {
  display: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@container (min-width: 500px) {
  .team-full { display: inline; }
  .team-sigla { display: none; }
}
.score {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  margin: 0 2px;
  min-width: 34px;
  flex-shrink: 0;
}
.match-stats-col {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
}
.row-text-mvp {
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  color: var(--text) !important;
  text-shadow: none !important;
  margin-right: 0 !important;
  padding: 2px 5px;
  border: 1px solid rgba(244, 240, 250, 0.3);
  border-radius: 3px;
}
.icons-group {
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 62px;
}
.icon-s {
  width: 12px;
  height: 12px;
}
.voto-badge-wrapper {
  width: 36px;
  height: 24px;
  margin-right: 0;
  gap: 0;
}
.voto-num {
  width: 34px;
  height: 20px;
  border-radius: 4px;
  font-family: var(--font-ui) !important;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}
/* Voto per fascia (regola di CLAUDE.md): cinque colori */
.voto-5down { background-color: var(--voto-1) !important; color: #ffffff !important; }
.voto-5to6 { background-color: var(--voto-2) !important; color: var(--voto-testo-scuro) !important; }
.voto-6to65 { background-color: var(--voto-3) !important; color: var(--voto-testo-scuro) !important; }
.voto-65to7 { background-color: var(--voto-4) !important; color: var(--voto-testo-scuro) !important; }
.voto-7to75 { background-color: var(--voto-5) !important; color: var(--voto-testo-scuro) !important; }
.voto-75to85 { background-color: var(--voto-6) !important; color: var(--voto-testo-scuro) !important; }
.voto-85to95 { background-color: var(--voto-7) !important; color: #ffffff !important; }
.voto-95to10 { background-color: var(--voto-8) !important; color: var(--voto-testo-scuro) !important; }
.voto-neutro { background-color: var(--voto-neutro) !important; color: #ffffff !important; }
.corner-icon {
  width: 11px;
  height: 11px;
  filter: brightness(0) invert(1);
}
.mp { top: -5px; left: -4px; }
.motn { top: -5px; right: -4px; }
.result-char {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  width: 14px;
}
.esito-v { color: var(--win); }
.esito-n { color: var(--text-2); }
.esito-p { color: var(--loss); }
.no-matches {
  padding: 14px;
  font-style: normal;
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
}

/* --- Mobile --- */
@media (max-width: 515px) {
  main.container {
    width: 100%;
    margin: 0 auto;
  }
  .player-header-grid {
    gap: 12px;
    padding: 16px 0 12px;
    border-radius: 0;
    margin-bottom: 0;
  }
  .ph-image-wrapper img {
    width: 84px;
    height: 84px;
    border-radius: 6px;
  }
  .ph-image-wrapper {
    border-radius: 6px;
    margin-left: 4px;
  }
  .ph-nome,
  .ph-cognome,
  .ph-cognome[data-long="true"] { font-size: 22px !important; }
  .ph-flag-role { font-size: 12px; margin: 6px 0 0; }
  .ph-flag-role .flag { width: 18px; height: 13px; }
  .ph-stats-container { gap: 0; }
  .stats-col {
    padding: 8px 0 0;
    gap: 8px;
    border-top: 1px solid rgba(244, 240, 250, 0.18) !important;
  }
  .stats-col:first-child { border-top: 1px solid rgba(244, 240, 250, 0.18) !important; }
  .stats-col.border-left { border-top: 0 !important; margin-left: 0; }
  .stat-box { text-align: left; }
  .stat-label { font-size: 11px; margin-bottom: 0; }
  .stat-number { font-size: 18px; }
  .stat-outcome { justify-content: flex-start; }
  .trophies-container { padding: 12px 0; margin-bottom: 14px; }
  .section-label { font-size: 11px; }
  .trophies-grid { gap: 6px 16px; justify-content: flex-start; }
  .trophy-card { width: auto; height: 22px; }
  .trophy-img-std, .trophy-img-small { width: 16px; height: 16px; }
  .trophy-label, .trophy-year, .trophy-multiplier { font-size: 12px; margin: 0; }
  .season-box { margin-bottom: 8px; }
  .season-header { padding: 8px 12px; }
  .season-team-name { font-size: 14px; }
  .season-year { font-size: 12px; }
  .season-summary { font-size: 12px; padding: 9px 12px; }
  .match-row { padding: 0 12px; }
  .match-link { gap: 8px; }
  .match-phase { font-size: 12px; }
  .team-side img { width: 16px; height: 16px; }
  .team-sigla { font-size: 13px; }
  .score { font-size: 14px; min-width: 30px; }
  .match-stats-col { gap: 6px; }
  .icon-s { width: 11px; height: 11px; }
  .icons-group.count-5, .icons-group.count-6,
  .icons-group.count-7, .icons-group.count-8, .icons-group.count-9 { width: auto; max-width: 52px; }
  .voto-badge-wrapper { width: 36px; height: 24px; margin-right: 0; }
  .voto-num { width: 34px; height: 20px; font-size: 12px; border-radius: 4px; }
  .corner-icon { width: 10px; height: 10px; }
  .result-char { font-size: 12px; width: 14px; }
}

/* Posizione all time accanto all'etichetta (es. "GOL IN CARRIERA (#4)"): non va a capo da sola e non e animata */
.stat-label .stat-pos {
  white-space: nowrap;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  /* Con la posizione accanto, l'etichetta resta su una riga */
  .ph-stats-container .stat-label {
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
}

/* Stesso spazio tra la testata (con o senza palmares) e il primo box stagione.
   Il palmares, quando c'e, resta attaccato alla testata. */
.player-header-grid {
  margin-bottom: 20px !important;
}
.player-header-grid + .trophies-container {
  margin-top: -20px !important;
}
@media (max-width: 767px) {
  .player-header-grid {
    margin-bottom: 14px !important;
  }
  .player-header-grid + .trophies-container {
    margin-top: -14px !important;
  }
}

/* Correzione giro 3: l'elenco dei titoli sta sotto la scritta "Palmares", a tutte le larghezze */
.trophies-container {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px;
}
.trophies-container .trophies-grid {
  flex: 0 0 auto;
  width: 100%;
}

/* Stemmi delle squadre della carriera, sotto bandiera e ruolo: piccoli, in riga, a capo se sono tanti */
.ph-squadre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 10px 0 0;
}
.ph-squadre a {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 3px;
}
.ph-squadre a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.ph-squadre img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}
@media (max-width: 767px) {
  .ph-squadre {
    gap: 5px 7px;
    margin-top: 8px;
  }
  /* Su mobile gli stemmi sono piu piccoli del 10% (da 22 a 20px) */
  .ph-squadre a,
  .ph-squadre img {
    width: 20px;
    height: 20px;
  }
}

/* Pulsante "Confronta" nella testata: secondario, discreto (bordo da 1px, nessun fondo) */
.ph-confronta {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid rgba(244, 240, 250, 0.28);
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text) !important;
  text-decoration: none !important;
}
.ph-confronta:hover {
  border-color: var(--text);
}
.ph-confronta:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Andamento stagione per stagione (templates/carriera_andamento.php): media voto come linea, gol come barre.
   Niente riquadro: sta sul fondo come il palmares, chiuso da una riga sottile. */
.andamento {
  border-bottom: 1px solid rgba(244, 240, 250, 0.14);
  padding: 14px 0 10px;
  margin-bottom: 20px;
}
.player-header-grid + .andamento,
.trophies-container + .andamento {
  margin-top: -20px;
}
.andamento__testa {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.andamento__legenda {
  display: flex;
  gap: 16px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-2);
}
.andamento__chiave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.andamento__chiave::before {
  content: "";
  display: block;
}
.andamento__chiave--linea::before {
  width: 14px;
  height: 2px;
  background: var(--text);
}
.andamento__chiave--barra::before {
  width: 8px;
  height: 10px;
  border-radius: 2px;
  background: rgba(244, 240, 250, 0.3);
}
.andamento__grafico {
  display: block;
  width: 100%;
  overflow: visible;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.an-linea {
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.an-base {
  stroke: rgba(244, 240, 250, 0.14);
  stroke-width: 1;
}
.an-tocco {
  fill: transparent;
}
.an-col {
  cursor: default;
  outline: none;
}
.an-barra {
  fill: rgba(244, 240, 250, 0.22);
}
.an-punto {
  fill: var(--text);
}
.an-val,
.an-anno {
  text-anchor: middle;
  font-size: 12px;
  font-weight: 400;
  fill: var(--text-2);
}
/* Stagione attiva (l'ultima all'apertura, poi quella toccata o puntata): valori in evidenza */
.an-col.is-attiva .an-val,
.an-col.is-attiva .an-anno {
  font-weight: 700;
  fill: var(--text);
}
.an-col.is-attiva .an-barra {
  fill: rgba(244, 240, 250, 0.5);
}
.an-col.is-attiva .an-punto {
  r: 4px;
}
.an-col:focus-visible .an-tocco {
  stroke: var(--focus);
  stroke-width: 2;
}
@media (max-width: 767px) {
  .andamento {
    padding: 12px 0 8px;
    margin-bottom: 14px;
  }
  .player-header-grid + .andamento,
  .trophies-container + .andamento {
    margin-top: -14px;
  }
  .ph-confronta {
    margin-top: 10px;
  }
}

/* Eta accanto al ruolo: stessa riga, separata da un filo sottile */
.ph-flag-role .ph-eta {
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid rgba(244, 240, 250, 0.28);
  font-variant-numeric: tabular-nums;
}

/* Blocco dei grafici sotto il palmares: andamento e profilo Hall of Fame (esagono).
   Affiancati quando c'e spazio, uno sotto l'altro su telefono. La riga di chiusura e i margini stanno qui. */
.carriera-grafici {
  border-bottom: 1px solid rgba(244, 240, 250, 0.14);
  padding: 14px 0 12px;
  margin-bottom: 20px;
}
.player-header-grid + .carriera-grafici,
.trophies-container + .carriera-grafici {
  margin-top: -20px;
}
.carriera-grafici .andamento {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.carriera-grafici .profilo-hof {
  max-width: 340px;
}
.carriera-grafici--due {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px; /* 320 = larghezza del disegno: i testi restano a misura piena */
  gap: 24px;
  align-items: start;
}
@media (max-width: 767px) {
  .carriera-grafici {
    padding: 12px 0 10px;
    margin-bottom: 14px;
  }
  .player-header-grid + .carriera-grafici,
  .trophies-container + .carriera-grafici {
    margin-top: -14px;
  }
  .carriera-grafici--due {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .carriera-grafici .profilo-hof {
    margin: 0 auto;
    width: 100%;
  }
}

/* Compagni piu frequenti: cinque voci compatte in riga (a capo su telefono), con il numero di partite insieme */
.compagni {
  border-bottom: 1px solid rgba(244, 240, 250, 0.14);
  padding: 14px 0;
  margin-bottom: 20px;
}
.player-header-grid + .compagni,
.trophies-container + .compagni,
.carriera-grafici + .compagni {
  margin-top: -20px;
}
.compagni__testa {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.compagni__rete {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px;
}
.compagni__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.compagni__lista a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text) !important;
  text-decoration: none !important;
}
.compagni__lista a:hover .compagni__nome {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.compagni__lista a:focus-visible,
.compagni__rete:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.compagni__lista img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(244, 240, 250, 0.08);
}
.compagni__n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  .compagni {
    padding: 12px 0;
    margin-bottom: 14px;
  }
  .player-header-grid + .compagni,
  .trophies-container + .compagni,
  .carriera-grafici + .compagni {
    margin-top: -14px;
  }
  .compagni__lista {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .compagni__lista a {
    min-height: 36px;
  }
  .compagni__n {
    margin-left: auto;
  }
}
