/* assets/css/statistiche.css - TEMA 2026 */

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

@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.9);
  --glass-bg: rgba(18, 0, 40, 0.8);
  --border-light: rgba(255, 255, 255, 0.15);
  --border-neon: rgba(255, 25, 255, 0.4);
}

body {
  color: var(--bianco);
  font-family: 'HelveticaBold', sans-serif;
  margin: 0;
  overflow-x: hidden;
  position: relative;
  background-color: #120028 !important;
}

body::before {
  content: "";
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: linear-gradient(rgba(18, 0, 40, 0.5), rgba(18, 0, 40, 0.5)), url('/assets/imm/gradiente26.jpg') center/cover no-repeat;
  z-index: -1; 
  transform: translateZ(0); 
  will-change: transform;
}

.container {
  max-width: 1000px;
  width: 92%;
  margin: 20px auto;
  padding-bottom: 34px;
  /* La base ridotta al 67%: questo scalerà in automatico tutti i testi in 'em' */
  font-size: 0.6rem; 
}


/* Utility Fonts */
.druk-font { font-family: 'DrukWide', sans-serif; font-style: italic; letter-spacing: 0; }
.helvetica-font { font-family: 'HelveticaBold', sans-serif; letter-spacing: 0; }
.upper { text-transform: uppercase; }
.highlight-text { color: var(--rosa-neon); }

/* =========================================
   2. NAVIGAZIONE DROPDOWN
   ========================================= */
.stats-navigation-wrapper {
  position: relative;
  text-align: center;
  margin-bottom: 27px;
  z-index: 100;
}

.stats-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 8px;
  transition: background 0.3s ease;
  user-select: none;
}

.stats-dropdown-trigger:hover { background: rgba(255, 255, 255, 0.05); }

.current-title {
  font-family: 'DrukWide', sans-serif;
  font-style: italic;
  font-size: 2em;
  color: var(--bianco);
  text-transform: uppercase;
  margin: 0;
  text-shadow: none;
  line-height: 1.2;
}

.dropdown-arrow {
  font-size: 1.2em;
  color: var(--rosa-neon);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-navigation-wrapper.open .dropdown-arrow { transform: rotate(180deg); }

.stats-dropdown-menu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-7px);
  width: 215px;
  background: rgba(18, 0, 40, 0.95);
  border: 1px solid var(--border-neon);
  border-radius: 11px;
  padding: 7px;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 7px 27px rgba(18, 0, 40, 0.8);
  backdrop-filter: blur(10px);
}

.stats-navigation-wrapper.open .stats-dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(7px);
}

.stats-option {
  font-family: 'DrukWide', sans-serif;
  font-style: italic;
  font-size: 0.8em;
  color: #aaa;
  padding: 8px 10px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 5px;
  margin-bottom: 1px;
}

.stats-option:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.stats-option.active { background: var(--rosa-neon); color: #fff; box-shadow: 0 0 7px rgba(255, 25, 255, 0.4); }

/* =========================================
   3. IL PODIO (Top 3)
   ========================================= */
.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: end;
  gap: 14px;
  margin-bottom: 27px;
  min-height: 200px;
}

.podium-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 10px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
  transition: transform 0.3s ease, border-color 0.3s;
}

.podium-card:hover { transform: translateY(-3px); border-color: var(--rosa-neon); }

.podium-card.rank-1 {
  order: 2; border-color: var(--rosa-neon);
  box-shadow: 0 0 20px rgba(255, 25, 255, 0.1);
  padding-top: 20px; z-index: 2; transform: scale(1.02);
}
.podium-card.rank-1:hover { transform: scale(1.02) translateY(-3px); }
.podium-card.rank-2 { order: 1; margin-bottom: -7px; }
.podium-card.rank-3 { order: 3; margin-bottom: -14px; }

.podium-img-wrapper img {
  width: 60px; height: 60px;
  border-radius: 7px; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
  margin-bottom: 8px;
}
.rank-1 .podium-img-wrapper img { width: 80px; height: 80px; border-color: var(--rosa-neon); }

.podium-rank-num {
  font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 2.2em;
  position: absolute; top: -8px; color: var(--bianco);
  text-shadow: 0 3px 7px rgba(18, 0, 40, 0.8);
}
.rank-1 .podium-rank-num { left: 50%; transform: translateX(-50%); font-size: 3em; color: var(--rosa-neon); }
.rank-2 .podium-rank-num { left: 7px; }
.rank-3 .podium-rank-num { right: 7px; }

.podium-name {
  font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 0.9em; color: var(--bianco);
  margin-bottom: 4px; line-height: 1.1; text-transform: uppercase;
}

.podium-meta { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 5px; }
.meta-flag { width: 11px; height: auto; border-radius: 1px; }
.meta-role {
  font-family: 'HelveticaBold', sans-serif; font-size: 0.7em; color: var(--rosa-neon);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.podium-stat-box { margin-top: 5px; }
.podium-stat-val { font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 2em; color: var(--rosa-neon); line-height: 1; }
.podium-stat-label { font-family: 'HelveticaBold', sans-serif; font-size: 0.65em; text-transform: uppercase; opacity: 1; }
.podium-sub-stat { font-size: 0.65em; color: #ccc; margin-top: 3px; }
.team-history { display: flex; gap: 3px; justify-content: center; margin-top: 5px; flex-wrap: wrap; }
.team-mini-logo { width: 11px; height: 11px; object-fit: contain; opacity: 0.8; }

/* =========================================
   4. LA LISTA
   ========================================= */
.stats-list-container {
  background: var(--nero-transp);
  border-radius: 9px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  padding: 3px 0;
  min-height: 134px; 
  position: relative;
}

.stats-list-container:empty {
    background: var(--nero-transp) !important;
}

.tab-content { 
    display: none; 
    opacity: 0; 
    background: transparent;
}

.stat-row {
  display: flex; align-items: center;
  padding: 10px 14px;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none; color: white;
  transition: background 0.2s;
}
.stat-row:last-child { border-bottom: none; }
.stat-row:hover { background: rgba(255, 25, 255, 0.08); }

.row-rank {
  font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 1.1em; color: rgba(255,255,255,0.5);
  width: 27px; text-align: center; flex-shrink: 0;
}

.row-avatar img {
  width: 32px; height: 32px; border-radius: 5px; object-fit: cover;
  margin-right: 10px; border: 1px solid rgba(255,255,255,0.2);
}

.row-info { flex: 1; min-width: 0; }

.row-name { 
    font-family: 'HelveticaBold', sans-serif; 
    font-size: 1.05em; 
    margin-bottom: 3px; 
    font-weight:0!important;
    text-transform: uppercase; 
}

.row-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.row-flag { width: 10px; height: auto; border-radius: 1px; }
.row-role { font-family: 'HelveticaBold', sans-serif; font-size: 0.65em; color: var(--rosa-neon); text-transform: uppercase; }
.row-teams { display: flex; align-items: center; gap: 3px; margin-left: 5px; border-left: 1px solid rgba(255,255,255,0.2); padding-left: 5px; }

.row-stat-group { text-align: right; min-width: 47px; margin-left: auto; }
.val-main { font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 1.45em; color: var(--rosa-neon); display: block; }
.val-sub { font-family: 'HelveticaBold', sans-serif; font-size: 0.72em; color: #fff; opacity: 1; display: block; margin-top: 1px; }
.val-label { font-size: 0.5em; text-transform: uppercase; opacity: 1; display: block; margin-top: 1px; }

/* =========================================
   5. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  
   .container {
      font-size: 0.54rem; /* Modificato: Base in scala al 67% per mobile */
      margin-top: 14px; 
      width: 96%;  
  }
  .stats-navigation-wrapper { margin-bottom: 17px; }
  .current-title { font-size: 1.3em; }
  .stats-dropdown-menu { width: 90%; }
  .dropdown-arrow { font-size: 1em; }

  /* PODIO MOBILE */
  .podium-grid {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 14px; min-height: auto;
  }
  
  .podium-card {
    flex-direction: row; align-items: center; 
    padding: 5px 8px; gap: 7px; margin: 0 !important;
    transform: none !important; text-align: left;
  }

  .podium-card.rank-1 { order: 0; padding: 8px; }
  .podium-card.rank-2 { order: 1; }
  .podium-card.rank-3 { order: 2; }

  .podium-rank-num { position: static; transform: none; font-size: 1.1em; width: 12px; text-align: center; margin-right: 3px; }
  .rank-1 .podium-rank-num { font-size: 1.4em; color: var(--rosa-neon); }

  .podium-img-wrapper img { width: 30px; height: 30px; margin: 0; border-width: 1px; }
  .rank-1 .podium-img-wrapper img { width: 37px; height: 37px; }

  .podium-content { flex: 1; min-width: 0; }
  .podium-name { font-size: 0.8em; margin-bottom: 1px; }

  .podium-meta { margin: 0; justify-content: flex-start; gap: 3px; }
  .meta-role { font-size: 0.55em; }
  .meta-flag { width: 8px; }
  
  .team-history { margin-top: 1px; justify-content: flex-start; gap: 1px; }
  .team-mini-logo { width: 8px; height: 8px; }

  .podium-stat-box { 
    margin: 0; text-align: right; min-width: 40px;
    display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  }
  .podium-stat-val { font-size: 1.2em; }
  .podium-sub-stat { font-size: 0.45em; margin-top: 1px; }

  /* LISTA MOBILE */
  .stat-row { padding: 7px 5px; gap: 5px; }
  .row-rank { font-size: 0.8em; width: 12px; margin: 0; }
  .row-avatar img { width: 24px; height: 24px; margin: 0; margin-right: 4px; }
  .row-info { padding-right: 1px; }
  
  .row-name { 
    font-size: 0.82em; 
    margin-bottom: 1px; 
    white-space: normal; 
    line-height: 1.2;
    letter-spacing: 0; 
  }
  
  .row-meta { gap: 3px; }
  .row-flag { width: 7px; }
  .row-role { font-size: 0.5em; }
  .row-teams { gap: 1px; margin-left: 3px; padding-left: 3px; }
  .row-teams .team-mini-logo { width: 7px; height: 7px; }
  
  .row-stat-group { min-width: 34px; }
  .val-main { font-size: 1.1em; }
  .val-sub { font-size: 0.55em; }
}

/* =========================================
   6. ANIMAZIONI & UTILS
   ========================================= */
.tab-content { display: none; opacity: 0; transition: opacity 0.3s ease-in-out; }
.tab-content.active { display: block; opacity: 1; }
.real-content { animation: fadeIn 0.5s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}