/* =========================================
   1. FONTS & VARIABILI
   ========================================= */
@font-face {
  font-family: 'DrukWide';
  src: url('/assets/doc/DrukTextWide-MediumItalic-Trial.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'HelveticaBold';
  src: url('/assets/doc/HelveticaBold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

:root {
  --rosa-neon: #ff19ff;
  --viola: #790cfd; 
  --bianco: #ffffff;
  --nero-transp: rgba(18, 0, 40, 0.85); /* Vinaccia semitrasparente */
  --verde: #00ff66;
  --rosso: #ff3333;
}

/* =========================================
   2. BASE GLOBALE
   ========================================= */
body {
  color: var(--bianco);
  font-family: 'HelveticaBold', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #120028; /* Vinaccia */
}

body::before {
  content: "";
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100vh;
  z-index: -1;
  transform: translateZ(0);
  will-change: transform;

  background:
    linear-gradient(rgba(18, 0, 40, 0.5), rgba(18, 0, 40, 0.5)),
    url('/assets/imm/gradiente26.jpg') center/cover no-repeat;
}

/* Utility Classi Font */
.druk-font { 
  font-family: 'DrukWide', sans-serif; 
  letter-spacing: 0; 
  text-transform: uppercase;
}
.helvetica-font { 
  font-family: 'HelveticaBold', sans-serif; 
  letter-spacing: 0; 
  text-transform: uppercase;
}

/* Container principale */
.container {
  max-width: 737px;
  width: 95%;
  margin: 13px auto;
  padding: 0;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(13px); } 
  to { opacity: 1; transform: translateY(0); } 
}

/* =========================================
   3. HEADER GIOCATORE (Info e Foto)
   ========================================= */
.player-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--nero-transp);
  padding: 20px;
  border-radius: 11px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 25, 255, 0.15);
}

.ph-identity {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

/* Gestione Foto e Filtro Rosa */
.ph-image-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 11px;
  flex-shrink: 0;
}

.ph-image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0; 
  background: linear-gradient(
    to bottom, 
    rgba(255, 25, 255, 0.0001) 0%, 
    rgba(255, 25, 255, 0.1) 100%
  );
  z-index: 2;
  pointer-events: none; 
}

.ph-image-wrapper img {
  display: block;
  position: relative;
  z-index: 1;
  width: 134px; 
  height: 134px; 
  object-fit: cover; 
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease; 
}

/* Effetto Hover Foto */
.ph-image-wrapper:hover img { 
  transform: scale(1.04); 
  border-color: var(--rosa-neon); 
}

/* Testi Identità */
.ph-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}

/* Ruolo e Bandiera */
.ph-flag-role {
  display: flex; 
  align-items: center; 
  gap: 5px; 
  margin-bottom: 8px;
  font-size: 0.6rem; 
  text-transform: uppercase; 
  letter-spacing: 0; 
  color: var(--bianco);
}

.ph-flag-role .flag { 
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
}

/* Nomi */
.ph-names { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start; 
  line-height: 1; 
  width: 100%; 
}

.ph-nome {
  font-family: 'DrukWide', sans-serif; 
  font-size: 0.74rem;
  color: var(--bianco);
  margin-bottom: 3px; 
  text-transform: uppercase; 
  letter-spacing: 0;
}

.ph-cognome {
  font-family: 'DrukWide', sans-serif; 
  font-size: 2rem;
  color: var(--rosa-neon);
  text-transform: uppercase; 
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ph-cognome[data-long="true"] {
  font-size: 1.34rem;
}

/* =========================================
   4. STATISTICHE HEADER (Numeri e Voti)
   ========================================= */
.ph-stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100%;
  flex-shrink: 0;
}

.stats-col { 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  gap: 11px; 
  padding: 0 13px; 
}

.stats-col.border-left { 
  border-left: 1px solid rgba(255,255,255,0.2); 
}

.stat-box { 
  text-align: left; 
}

.stat-label {
  font-family: 'HelveticaBold', sans-serif; 
  font-size: 0.47rem; 
  color: var(--rosa-neon);
  letter-spacing: 0; 
  margin-bottom: 3px; 
  text-transform: uppercase;
}

.stat-number { 
  font-family: 'DrukWide', sans-serif;
  font-size: 1.34rem; 
  color: var(--bianco); 
  line-height: 1;
}

.stat-outcome { 
  display: flex; 
  align-items: center; 
  gap: 7px; 
}

/* Pallini Vittoria/Pareggio/Sconfitta */
.dot { 
  width: 5px; 
  height: 5px; 
  border-radius: 50%; 
}
.dot-v { background: var(--verde); }
.dot-n { background: var(--bianco); }
.dot-p { background: var(--rosso); }

/* =========================================
   5. PALMARES
   ========================================= */
.trophies-container {
  position: relative;
  background: rgba(18, 0, 40, 0.7); /* Vinaccia */
  padding: 23px 20px 17px 20px;
  border-radius: 11px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,25,255,0.25);
}

.section-label {
  position: absolute;
  top: 10px;
  left: 13px;
  font-family: 'HelveticaBold', sans-serif;
  font-size: 0.54rem;
  color: var(--bianco);
  text-transform: uppercase;
  letter-spacing: 0;
}

.trophies-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 7px;
}

.trophy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 74px;
  width: 60px;
  transition: transform 0.3s ease;
}

.trophy-card:hover {
  transform: translateY(-2px);
}

.trophy-upper-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.trophy-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

/* Icone Premi (Forzate a bianco puro) */
.trophy-img-std, 
.trophy-img-small {
  filter: brightness(0) invert(1) !important;
}

.trophy-img-std {
  height: 37px;
  width: auto;
  margin-bottom: 3px;
}

.trophy-img-small {
  height: 23px;
  width: auto;
}

.trophy-multiplier {
  font-size: 0.87rem;
  color: var(--rosa-neon);
}

.trophy-year {
  font-size: 0.57rem;
  color: var(--bianco);
  margin-top: 1px;
}

.trophy-label {
  font-family: 'HelveticaBold', sans-serif;
  font-size: 0.4rem;
  color: var(--bianco);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-top: 5px;
  width: 100%;
  line-height: 1.2;
}

/* =========================================
   6. STAGIONI (Riepilogo)
   ========================================= */
.season-box {
  margin-bottom: 11px; 
  border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 8px;
  background: rgba(18, 0, 40, 0.7); /* Vinaccia */
  overflow: hidden; 
  transition: border-color 0.3s;
}

.season-box:hover { 
  border-color: rgba(255, 25, 255, 0.4); 
}

.season-header {
  padding: 11px 13px; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between;
  align-items: center; 
  background: rgba(255, 255, 255, 0.05);
  font-family: 'HelveticaBold', sans-serif;
  font-size: 0.54rem;
  color: var(--bianco);
  text-transform: uppercase;
}

.season-header:hover { 
  background: rgba(255, 255, 255, 0.1); 
}

.season-info-main { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}

.season-team-logo { 
  width: 21px; 
  height: 21px; 
  object-fit: contain; 
}

.season-text-group { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start; 
}

.season-team-name { 
  font-family: 'DrukWide', sans-serif; 
  font-size: 0.6rem; 
  color: var(--bianco); 
  margin-bottom: 2px; 
  letter-spacing: 0; 
}

.season-year { 
  font-family: 'HelveticaBold', sans-serif; 
  font-size: 0.54rem; 
  color: var(--rosa-neon); 
  letter-spacing: 0; 
}

.toggle-icon { 
  color: var(--rosa-neon); 
  transition: transform 0.3s ease; 
}

.active .toggle-icon { 
  transform: rotate(90deg); 
}

.season-content { 
  display: none; 
  padding: 0; 
}

.season-summary {
  padding: 10px 13px; 
  text-align: right; 
  font-size: 0.57rem; 
  color: var(--bianco);
  background: rgba(18, 0, 40, 0.4); /* Vinaccia */
  text-transform: uppercase; 
  letter-spacing: 0;
}

/* =========================================
   7. RIGA PARTITA (Match Row)
   ========================================= */
.match-row {
  padding: 7px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.match-row:hover { 
  background: rgba(255, 25, 255, 0.08); 
}

.match-link {
  text-decoration: none; 
  color: inherit;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  gap: 8px;
}

.match-meta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.match-phase {
  font-size: 0.5rem; 
  color: var(--rosa-neon); 
  text-transform: uppercase;
  white-space: nowrap; 
  font-weight: bold; 
  letter-spacing: 0;
}

.match-score-block { 
  display: flex; 
  align-items: center; 
  gap: 7px; 
}

.team-side { 
  display: flex; 
  align-items: center; 
  gap: 5px; 
}

.team-side img { 
  width: 16px; 
  height: 16px; 
  object-fit: contain; 
}

.team-sigla {
  font-family: 'HelveticaBold', sans-serif; 
  font-size: 0.6rem; 
  color: var(--bianco);
  text-transform: uppercase; 
  letter-spacing: 0;
}

.score {
  font-family: 'DrukWide', sans-serif; 
  font-size: 0.74rem; 
  color: var(--bianco);
  margin: 0 3px; 
  min-width: 30px; 
  text-align: center; 
  letter-spacing: 0;
}

.match-stats-col {
  display: flex; 
  align-items: center; 
  justify-content: flex-end;
  gap: 10px; 
  flex-shrink: 0;
}

/* Palloni Gol */
.icons-group { 
  display: flex; 
  gap: 1px; 
}

.icon-s {
  width: 15px; 
  height: 15px;
  filter: brightness(0) invert(1);
}

.icon-s.ag {
  filter: none;
}

/* Badge Voti e Icone Speciali */
.voto-badge-wrapper {
  position: relative; 
  width: 27px; 
  height: 27px;
  display: inline-flex; 
  justify-content: center; 
  align-items: center; 
  margin-right: 4px;
}

.voto-num {
  display: inline-flex; 
  justify-content: center; 
  align-items: center;
  width: 23px; 
  height: 23px; 
  border-radius: 4px;
  font-family: 'HelveticaBold', sans-serif;
  font-size: 0.67rem; 
  font-weight: bold;
}

/* Colori Fasce Voto */
.voto-5down { background-color: #cc0000 !important; color: #ffffff !important; }
.voto-5to6 { background-color: #ff6600 !important; color: #ffffff !important; }
.voto-6to65 { background-color: #ffcc00 !important; color: #ffffff !important; }
.voto-65to7 { background-color: #99cc00 !important; color: #ffffff !important; }
.voto-7to75 { background-color: #00cc00 !important; color: #ffffff !important; }
.voto-75to85 { background-color: #00ccff !important; color: #ffffff !important; }
.voto-85to95 { background-color: #0066ff !important; color: #ffffff !important; }
.voto-95to10 { background-color: #ff19ff !important; color: #ffffff !important; }
.voto-neutro { background-color: #444 !important; color: #ffffff !important; }

.extra-icon { 
  width: 24px; 
  height: 24px; 
  object-fit: contain;
}

.corner-icon {
  position: absolute;
  width: 13px; 
  height: 13px;
}

.mp { top: -3px; left: -3px; }
.motn { top: -3px; right: -3px; }

/* Esito Match (V/N/P) */
.result-char {
  font-family: 'DrukWide', sans-serif; 
  font-size: 0.6rem; 
  width: 13px; 
  text-align: center; 
  letter-spacing: 0;
}
.esito-v { color: var(--verde); }
.esito-n { color: var(--bianco); }
.esito-p { color: var(--rosso); }

.no-matches { 
  padding: 13px; 
  color: var(--bianco); 
  text-align: center; 
  font-style: italic; 
}

/* =========================================
   8. RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 515px) {
  .container { width: 98%; margin: 7px auto; }
  
  .player-header-grid {
    flex-direction: column; gap: 14px; padding: 14px;
    border-radius: 8px; margin-bottom: 7px;
  }

  .trophies-container, .season-box { margin-bottom: 7px; }

  /* Identità Mobile */
  .ph-identity { flex-direction: row; align-items: center; gap: 12px; width: 100%; }
  .ph-image-wrapper img { width: 80px; height: 80px; border-radius: 8px; border-width: 1px; }
  .ph-text { flex: 1; }
  .ph-flag-role { font-size: 0.45rem; margin-bottom: 5px; gap: 4px; }
  .ph-flag-role .flag { width: 12px; height: 12px; object-fit: cover; }
  .ph-names { margin-bottom: 4px; }
  .ph-nome { font-size: 0.55rem; margin-bottom: 2px; }
  .ph-cognome { font-size: 1.4rem; line-height: 1; }
  .ph-cognome[data-long="true"] { font-size: 1rem !important; white-space: normal; line-height: 1.1; }

  /* Stats Mobile */
  .ph-stats-container { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 0; }
  .stats-col { flex-direction: row; justify-content: center; align-items: center; gap: 10px; padding: 8px 0; border: none !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
  .stats-col:first-child { border-top: none !important; }
  .stat-box { text-align: center; flex: 1; }
  .stat-label { font-size: 0.42rem; margin-bottom: 3px; }
  .stat-number { font-size: 1rem; }
  .stat-outcome { justify-content: center; gap: 5px; }
  .dot { width: 6px; height: 6px; }

  /* Palmares Mobile */
  .trophies-container { padding: 20px 10px 10px 10px; }
  .section-label { top: 5px; left: 5px; font-size: 0.34rem; }
  .trophies-grid { justify-content: center; gap: 10px; }
  .trophy-card { width: 47px; height: auto; }
  .trophy-img-std { height: 23px; }
  .trophy-img-small { height: 15px; }
  .trophy-multiplier { font-size: 0.67rem; }
  .trophy-label { font-size: 0.3rem; margin-top: 3px; }
  .trophy-year { font-size: 0.4rem; text-align: center; }

  /* Stagioni Mobile */
  .season-header { padding: 8px 10px; }
  .season-team-name { font-size: 0.47rem; }
  .season-year { font-size: 0.44rem; }
  .season-summary { font-size: 0.44rem; padding: 7px 10px; }

  /* Match Row Mobile */
  .match-row { padding: 5px 7px; }
  .match-link { gap: 5px; }
  .match-phase { font-size: 0.4rem; }
  .team-side img { width: 12px; height: 12px; }
  .team-sigla { font-size: 0.44rem; }
  .score { font-size: 0.57rem; margin: 0 2px; min-width: auto; }
  .match-stats-col { gap: 4px; }

  /* Palloni Gol Mobile */
  .icon-s { width: 11px; height: 11px; }
  .icons-group.high-count { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .icons-group.count-5, .icons-group.count-6 { width: 39px; }
  .icons-group.count-7, .icons-group.count-8, .icons-group.count-9 { width: 51px; }

  /* Badge Mobile */
  .voto-badge-wrapper { width: 20px; height: 20px; margin-right: 1px; }
  .voto-num { width: 17px; height: 17px; font-size: 0.57rem; border-radius: 3px; }
  .extra-icon { width: 16px; height: 16px; }
  .corner-icon { width: 8px; height: 8px; }
  .result-char { font-size: 0.47rem; width: 9px; }
}

@media (max-width: 241px) {
  .ph-image-wrapper img { width: 44px; height: 44px; }
  .ph-cognome { font-size: 0.87rem; }
  .stat-number { font-size: 0.67rem; }
}