/* ==========================================================================
   FG-PRO — Classifica (leaderboard.php)
   Stesso stile del resto del sito: niente viola, card pulite, avatar sempre
   tondi, nessun testo tagliato sul telefono, leggibile in modalità scura.
   ========================================================================== */
html.fgc-lb body{ background:var(--fgc-page,#f6f2ee)!important; padding:0!important; font-family:Inter,-apple-system,BlinkMacSystemFont,system-ui,sans-serif; color:var(--fgc-text,#262626); overflow-x:hidden; }
html.fgc-lb .leaderboard-container{ max-width:860px; margin:0 auto!important; padding:20px 16px 40px!important; box-sizing:border-box; width:100%; }
html.fgc-lb .leaderboard-container *{ box-sizing:border-box; min-width:0; }

/* titolo */
html.fgc-lb .leaderboard-container > .header{ background:none!important; color:var(--fgc-text)!important; text-align:center; margin:4px 0 18px!important; padding:0!important; position:static!important; box-shadow:none!important; border:0!important; }
html.fgc-lb .leaderboard-container > .header h1{ font-family:'Pacifico','Playfair Display',serif; font-weight:400; font-size:clamp(1.9rem,6vw,2.6rem)!important; color:var(--fgc-accent,#d4705f)!important; margin:0 0 4px!important; line-height:1.25; }
html.fgc-lb .leaderboard-container > .header p{ font-size:.95rem!important; color:var(--fgc-text2,#8e8e8e)!important; opacity:1!important; margin:0!important; }

/* filtri */
html.fgc-lb .filters{ background:var(--fgc-card,#fff)!important; border:1px solid var(--fgc-line,#e6ddd6); border-radius:var(--fgc-r,18px)!important; padding:12px!important; gap:10px!important; margin-bottom:14px!important; box-shadow:var(--fgc-shadow)!important; display:flex; flex-wrap:nowrap!important; }
html.fgc-lb .filter-group{ flex:1 1 0!important; min-width:0!important; }
html.fgc-lb .filter-label{ font-size:.72rem!important; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--fgc-text2)!important; margin:0 0 6px 4px!important; }
html.fgc-lb .filters select{ width:100%; height:44px; padding:0 34px 0 14px!important; border-radius:12px!important; border:1px solid var(--fgc-line)!important; background:var(--fgc-soft,#fbf3ef) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4705f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center/16px no-repeat!important; color:var(--fgc-text)!important; font:600 .92rem/1 Inter,system-ui,sans-serif!important; -webkit-appearance:none; appearance:none; text-overflow:ellipsis; }

/* la tua posizione */
html.fgc-lb #currentPosition .current-position{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; border-radius:var(--fgc-r,18px)!important; padding:16px 18px!important; margin:0 0 14px!important; box-shadow:0 10px 24px -14px rgba(212,112,95,.9)!important; text-align:center; }
html.fgc-lb #currentPosition h3{ font:700 .75rem/1 Inter,system-ui,sans-serif!important; text-transform:uppercase; letter-spacing:.08em; opacity:.9; margin:0 0 4px!important; color:#fff!important; }
html.fgc-lb #currentPosition .current-position > div[style*="font-size"]{ font-size:2.2rem!important; line-height:1.1; color:#fff!important; }
html.fgc-lb #currentPosition .position-stats{ display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:8px 22px!important; margin-top:8px!important; }
html.fgc-lb #currentPosition .position-stats *{ color:#fff!important; }
html.fgc-lb #currentPosition .position-stats > div > div:first-child{ font-size:1.15rem!important; }
html.fgc-lb #currentPosition .badge{ background:rgba(255,255,255,.22)!important; box-shadow:none!important; }

/* card classifica */
html.fgc-lb .leaderboard-card{ background:var(--fgc-card,#fff)!important; border:1px solid var(--fgc-line); border-radius:var(--fgc-r,18px)!important; box-shadow:var(--fgc-shadow)!important; overflow:hidden; }

/* podio: sempre in fila 2-1-3, anche sul telefono */
html.fgc-lb .podium{ display:flex!important; flex-direction:row!important; justify-content:center!important; }
html.fgc-lb .podium-place.first{ order:2!important; } html.fgc-lb .podium-place.second{ order:1!important; } html.fgc-lb .podium-place.third{ order:3!important; }
html.fgc-lb .filters{ flex-direction:row!important; }
html.fgc-lb .podium{ background:linear-gradient(180deg,var(--fgc-soft,#fbf3ef),var(--fgc-card,#fff))!important; padding:30px 10px 16px!important; gap:6px!important; align-items:flex-end!important; }
html.fgc-lb .podium-place{ flex:1 1 0!important; max-width:180px!important; min-width:0; color:var(--fgc-text)!important; }
html.fgc-lb .podium-avatar{ width:72px!important; height:72px!important; min-width:72px; flex:0 0 auto; aspect-ratio:1/1; border-radius:50%!important; overflow:visible; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2))!important; font:700 1.8rem/1 Inter,system-ui,sans-serif!important; color:#fff!important; box-shadow:0 0 0 3px var(--fgc-card),0 0 0 5px #cfc6bf!important; margin:0 auto 10px!important; }
html.fgc-lb .podium-place.first .podium-avatar{ width:92px!important; height:92px!important; min-width:92px; font-size:2.2rem!important; box-shadow:0 0 0 3px var(--fgc-card),0 0 0 6px #e8b33c!important; }
html.fgc-lb .podium-place.third .podium-avatar{ box-shadow:0 0 0 3px var(--fgc-card),0 0 0 5px #c98a5a!important; }
html.fgc-lb .podium-avatar img{ width:100%!important; height:100%!important; aspect-ratio:1/1!important; object-fit:cover!important; border-radius:50%!important; display:block; }
html.fgc-lb .podium-crown{ top:-26px!important; left:50%; transform:translateX(-50%); font-size:1.5rem!important; line-height:1; }
html.fgc-lb .podium-rank{ font:800 1.05rem/1.2 Inter,system-ui,sans-serif!important; color:var(--fgc-text)!important; margin:0 0 2px!important; }
html.fgc-lb .podium-name{ font-weight:700!important; font-size:.88rem!important; line-height:1.25; color:var(--fgc-text)!important; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; word-break:break-word; }
html.fgc-lb .podium-league{ margin:6px 0 2px!important; }
html.fgc-lb .podium-xp{ color:var(--fgc-accent)!important; font-weight:700!important; font-size:.85rem!important; }
html.fgc-lb .podium-level{ color:var(--fgc-text2)!important; font-size:.75rem!important; }

/* badge lega */
html.fgc-lb .badge{ font-size:.66rem!important; padding:3px 8px!important; border-radius:999px!important; letter-spacing:.04em!important; box-shadow:none!important; margin:0!important; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
html.fgc-lb .league-legend{ animation:none!important; }

/* elenco */
html.fgc-lb .leaderboard-list{ padding:6px 8px 10px!important; }
html.fgc-lb .list-item{ display:flex!important; align-items:center!important; gap:12px; padding:10px 10px!important; margin:0!important; border-radius:14px!important; border:0!important; border-bottom:1px solid var(--fgc-line)!important; background:transparent!important; color:var(--fgc-text)!important; transform:none!important; }
html.fgc-lb .list-item:last-child{ border-bottom:0!important; }
html.fgc-lb .list-item:hover{ background:var(--fgc-soft)!important; }
html.fgc-lb .list-item.current-user{ background:var(--fgc-soft)!important; box-shadow:inset 3px 0 0 var(--fgc-accent)!important; }
html.fgc-lb .item-rank{ flex:0 0 34px!important; min-width:34px!important; width:34px; font:800 .95rem/1 Inter,system-ui,sans-serif!important; color:var(--fgc-text2)!important; text-align:center; }
html.fgc-lb .item-avatar{ flex:0 0 46px!important; width:46px!important; height:46px!important; min-width:46px; aspect-ratio:1/1; border-radius:50%!important; overflow:hidden; margin:0!important; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2))!important; color:#fff!important; font:700 1.05rem/1 Inter,system-ui,sans-serif!important; }
html.fgc-lb .item-avatar img{ width:100%!important; height:100%!important; aspect-ratio:1/1!important; object-fit:cover!important; border-radius:50%!important; display:block; }
html.fgc-lb .item-info{ flex:1 1 auto!important; min-width:0!important; overflow:hidden; }
html.fgc-lb .item-name{ font-size:.95rem!important; font-weight:700!important; color:var(--fgc-text)!important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0 0 3px!important; background:none!important; }
html.fgc-lb .user-stats{ display:flex!important; flex-wrap:wrap; align-items:center; gap:4px 8px!important; margin:0!important; background:none!important; }
html.fgc-lb .user-stats .stat{ font-size:.76rem!important; color:var(--fgc-text2)!important; white-space:nowrap; background:none!important; }
html.fgc-lb .item-stats{ flex:0 0 auto!important; gap:0!important; background:none!important; }
html.fgc-lb .item-stats .stat{ display:flex; flex-direction:column; align-items:center; background:none!important; }
html.fgc-lb .stat-value{ font:800 .95rem/1.1 Inter,system-ui,sans-serif!important; color:var(--fgc-accent)!important; white-space:nowrap; }
html.fgc-lb .stat-label{ font-size:.62rem!important; text-transform:uppercase; letter-spacing:.06em; color:var(--fgc-text2)!important; }

html.fgc-lb .loading{ color:var(--fgc-text2)!important; padding:40px 16px!important; text-align:center; }
html.fgc-lb .spinner{ border-color:var(--fgc-line)!important; border-top-color:var(--fgc-accent)!important; }

/* telefono */
@media (max-width:600px){
  html.fgc-lb .leaderboard-container{ padding:12px 12px 30px!important; }
  html.fgc-lb .filters{ padding:10px!important; gap:8px!important; }
  html.fgc-lb .filters select{ font-size:.85rem!important; height:42px; padding-left:12px!important; }
  html.fgc-lb .podium{ padding:28px 4px 12px!important; gap:2px!important; }
  html.fgc-lb .podium-avatar{ width:62px!important; height:62px!important; min-width:62px; font-size:1.5rem!important; }
  html.fgc-lb .podium-place.first .podium-avatar{ width:78px!important; height:78px!important; min-width:78px; font-size:1.9rem!important; }
  html.fgc-lb .podium-name{ font-size:.8rem!important; }
  html.fgc-lb .podium-xp{ font-size:.78rem!important; }
  html.fgc-lb .item-avatar{ flex-basis:40px!important; width:40px!important; height:40px!important; min-width:40px; }
  html.fgc-lb .list-item{ gap:10px; padding:10px 6px!important; }
  html.fgc-lb .item-rank{ flex-basis:28px!important; width:28px; min-width:28px!important; font-size:.85rem!important; }
}

/* modalità scura: batte la regola nera del vecchio header */
html.fgc-lb.fgc-dark body, html.fgc-lb body.dark-mode{ background:var(--fgc-page,#0e0d0c)!important; }
html.fgc-lb.fgc-dark .leaderboard-container div:not(.podium-avatar):not(.item-avatar):not(.badge):not(.current-position):not(.podium):not(.filters):not(.leaderboard-card):not(.spinner){ background-color:transparent!important; }
html.fgc-lb.fgc-dark .filters, html.fgc-lb.fgc-dark .leaderboard-card{ background:var(--fgc-card,#161412)!important; border-color:var(--fgc-line,#2a2624)!important; }
html.fgc-lb.fgc-dark .podium{ background:linear-gradient(180deg,#221c19,var(--fgc-card,#161412))!important; }
html.fgc-lb.fgc-dark .filters select{ background-color:#1f1b19!important; color:var(--fgc-text)!important; border-color:var(--fgc-line)!important; }
html.fgc-lb.fgc-dark .list-item.current-user{ background:#221c19!important; }
html.fgc-lb.fgc-dark #currentPosition .current-position{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; }
html.fgc-lb.fgc-dark .podium-avatar, html.fgc-lb.fgc-dark .item-avatar{ background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2))!important; }
