/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #D4AF37;
  --gold-light: #F5D76E;
  --gold-dark: #A07E10;
  --gold-glow: rgba(212, 175, 55, 0.45);
  --gold-glow-strong: rgba(212, 175, 55, 0.7);
  --bg: #050505;
  --bg-card: rgba(18, 14, 6, 0.85);
  --text-main: #F0E6C8;
  --text-muted: #7B6A3E;
}

html, body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* ===========================
   BACKGROUND CANVAS (grid)
=========================== */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body.loaded #bg-canvas {
  opacity: 1;
}

/* ===========================
   BACKGROUND ORBS
=========================== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0;
  transition: opacity 1.8s ease;
}

.bg-orb.visible {
  opacity: 1;
}

/* Orb 1 — top-left, grande, ambra profondo */
.bg-orb--1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -160px;
  background: radial-gradient(circle, rgba(180, 120, 20, 0.13) 0%, transparent 70%);
  animation: orb-drift-1 18s ease-in-out infinite alternate;
}

/* Orb 2 — bottom-right, medio, oro chiaro */
.bg-orb--2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.10) 0%, transparent 70%);
  animation: orb-drift-2 22s ease-in-out infinite alternate;
}

/* Orb 3 — centro, piccolo, pulsante */
.bg-orb--3 {
  width: 260px;
  height: 260px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  animation: orb-pulse 6s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 60px) scale(1.1); }
}

@keyframes orb-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-50px, -40px) scale(1.08); }
}

@keyframes orb-pulse {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
  to   { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}



/* ===========================
   ANIMATED BACKGROUND
=========================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212,175,55,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(212,175,55,0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* Floating particles */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: float-particle linear infinite;
  /* Fix iOS Safari: mantiene lo stato opacity:0 durante l'animation-delay */
  animation-fill-mode: backwards;
}

@keyframes float-particle {
  0%   { transform: translateY(110vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ===========================
   PAGE WRAPPER
=========================== */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;       /* fallback */
  min-height: 100dvh;      /* iOS Safari 15.4+: esclude la barra indirizzi */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 20px 64px;
}

/* ===========================
   LOADING OVERLAY
=========================== */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-crown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  /* Isolation previene che l'animazione crei un layer con sfondo bianco su iOS */
  isolation: isolate;
  will-change: transform;
  animation: loader-pulse 1.2s ease-in-out infinite alternate;
}

.loader-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  /* Nessun filter qui: il parent animato su iOS Safari causa compositing su bianco */
  /* Il glow è gestito con un ::after sul loader-crown */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  image-rendering: -webkit-optimize-contrast;
}

.loader-bar {
  width: 120px;
  height: 2px;
  background: rgba(212,175,55,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  animation: loader-fill 1.2s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes loader-fill {
  to { width: 100%; }
}

@keyframes loader-pulse {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(1.06); opacity: 1; }
}

/* ===========================
   HEADER / LOGO AREA
=========================== */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;

  /* Slide-up animation */
  opacity: 0;
  transform: translateY(40px);
  animation: slide-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo container — niente cerchio, immagine libera */
.logo-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
 * ==========================================
 * DEVELOPER NOTE:
 * Replace the src in the <img> below with your own logo PNG.
 * ==========================================
 */
.logo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
}

.logo-wrapper img:hover {
  transform: translateZ(0) scale(1.03);
  opacity: 0.9;
}

/* Gold glow halo behind logo */
.logo-halo {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: halo-pulse 3s ease-in-out infinite alternate;
}

@keyframes halo-pulse {
  from { opacity: 0.4; transform: scale(0.95); }
  to   { opacity: 0.9; transform: scale(1.08); }
}

/* Name & tagline */
.profile-name {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 40%, var(--gold-light) 70%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px var(--gold-glow));
  line-height: 1.15;
}

/* ===========================
   FOOTBALL CURSOR
=========================== */
#football-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translate(-50%, -50%);
  will-change: transform;
  font-size: 26px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
}

#football-cursor.visible {
  opacity: 1;
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  background: var(--gold);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  will-change: transform, opacity;
}

.cursor-trail.visible {
  opacity: 0.55;
}

.profile-tagline {
  font-size: clamp(0.7rem, 3vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

/* Decorative separator */
.separator {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 8px;

  opacity: 0;
  transform: translateY(30px);
  animation: slide-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.separator i {
  font-size: 10px;
  color: var(--gold);
  filter: drop-shadow(0 0 6px var(--gold-glow));
  animation: separator-spin 8s linear infinite;
}

@keyframes separator-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===========================
   LINKS / BUTTONS CONTAINER
=========================== */
.links-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===========================
   SINGLE LINK BUTTON
=========================== */
.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 14px;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(0.78rem, 3.5vw, 0.88rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: var(--bg-card);
  color: var(--text-main);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;

  /* Individual slide-up with JS-set delay */
  opacity: 0;
  transform: translateY(40px);
}

.link-btn.animated {
  animation: slide-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Shimmer overlay on hover */
.link-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(212,175,55,0) 0%,
    rgba(212,175,55,0.12) 50%,
    rgba(212,175,55,0) 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: inherit;
}

/* Gold inner-glow pulse on hover */
.link-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s ease;
}

.link-btn:hover,
.link-btn:focus-visible {
  transform: scale(1.04) translateY(0);
  box-shadow:
    0 0 28px var(--gold-glow),
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
  border-color: rgba(212, 175, 55, 0.55);
}

.link-btn:hover::before { opacity: 1; }
.link-btn:hover::after  { opacity: 1; }

.link-btn:active {
  transform: scale(0.98) translateY(0);
}

/* Icon badge */
.btn-icon-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.15);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.link-btn:hover .btn-icon-wrap {
  background: rgba(212,175,55,0.18);
  box-shadow: 0 0 12px var(--gold-glow);
}

.btn-text-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-label {
  font-size: clamp(0.78rem, 3.5vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.btn-sublabel {
  font-size: clamp(0.62rem, 2.5vw, 0.72rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.btn-arrow {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s ease, color 0.3s ease;
}

.link-btn:hover .btn-arrow {
  transform: translateX(4px);
  color: var(--gold);
}

/* ===========================
   HIGHLIGHTED BUTTON (Telegram)
   Pulsating gold border effect
=========================== */
.link-btn.highlight {
  border-color: rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, rgba(14,11,3,0.9), rgba(25,19,5,0.9));
  animation: slide-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             pulse-border 2.8s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(212,175,55,0.2),
      0 0 22px rgba(212,175,55,0.05);
  }
  50% {
    box-shadow:
      0 0 22px rgba(212,175,55,0.55),
      0 0 45px rgba(212,175,55,0.15);
  }
}

.link-btn.highlight .btn-icon-wrap {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.35);
}

.link-btn.highlight .btn-label {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* "UNISCITI" badge */
.badge {
  position: absolute;
  top: -1px;
  right: 14px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  color: #000;
  border-radius: 0 0 6px 6px;
}

/* ===========================
   FOOTER
=========================== */
.footer {
  margin-top: 44px;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  opacity: 0;
  animation: slide-up 0.6s ease 1.5s forwards;
}

.footer span {
  color: var(--gold-dark);
}

/* ===========================
   HAMBURGER MENU
=========================== */
#hamburger-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 500;
}

#menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(18, 14, 6, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease;
  padding: 0;
}

#menu-toggle:hover {
  background: rgba(30, 22, 6, 0.92);
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
  transform: scale(1.06);
}

#menu-toggle:active {
  transform: scale(0.95);
}

.ham-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease,
    width 0.3s ease;
  transform-origin: center;
}

/* Animated X when open */
#menu-toggle[aria-expanded="true"] .ham-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] .ham-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
#menu-toggle[aria-expanded="true"] .ham-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Dropdown panel */
#nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  background: rgba(14, 10, 2, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(212, 175, 55, 0.08);
  overflow: hidden;

  /* Animation */
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
  transform-origin: top left;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

#nav-dropdown:not([hidden]) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Override hidden to keep transition */
#nav-dropdown[hidden] {
  display: block !important;
  visibility: hidden;
}

#nav-dropdown ul {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-main);
  transition:
    background 0.25s ease,
    color 0.25s ease;
  cursor: pointer;
}

.nav-item:not(.soon-item):hover {
  background: rgba(212, 175, 55, 0.08);
}

.nav-item:not(.soon-item):hover .nav-label {
  color: var(--gold-light);
}

.nav-arrow {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item:hover .nav-arrow {
  transform: translateX(4px);
  color: var(--gold);
}

.nav-divider {
  height: 1px;
  margin: 4px 14px;
  background: rgba(212, 175, 55, 0.1);
}

.nav-item.soon-item {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.nav-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 12px;
  color: var(--gold);
}

.nav-label {
  flex: 1;
}

.soon-badge {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  color: #000;
  border-radius: 20px;
}

/* ===========================
   RESPONSIVE TWEAKS
=========================== */
@media (max-width: 400px) {
  .page { padding: 36px 14px 48px; }
  .logo-wrapper { width: 240px; height: 240px; }
}

@media (min-width: 768px) {
  .page { padding: 72px 24px 80px; }
  .logo-wrapper { width: 340px; height: 340px; }
}

/* ===========================
   LIVE DOT (Telegram)
=========================== */
.live-dot {
  position: relative;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-right: 4px;
}

.live-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 6px rgba(61, 220, 132, 0.8);
  animation: live-blink 2s ease-in-out infinite;
}

.live-dot__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(61, 220, 132, 0.5);
  animation: live-ring 2s ease-out infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes live-ring {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}


/* ===========================
   PROFILE TAGLINE DOT
=========================== */
.profile-tagline {
  position: relative;
}

/* ===========================
   SCROLL FADE HINT
=========================== */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  animation: slide-up 0.5s ease 2.2s forwards;
  pointer-events: none;
}

.scroll-hint span {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-hint i {
  font-size: 10px;
  color: var(--text-muted);
  animation: bounce-down 1.6s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* ===========================
   STATS OVERLAY
=========================== */
.stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--bg);
  display: flex;
  flex-direction: column;

  /* Transition: hidden → visible */
  opacity: 0;
  transform: translateX(100%);
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0.38s;
  visibility: hidden;
  pointer-events: none;
}

.stats-overlay[hidden] {
  display: flex !important; /* keep in DOM for transitions */
}

.stats-overlay.open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: all;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

/* ── Header ── */
.stats-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stats-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(18, 14, 6, 0.8);
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.stats-back-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateX(-2px);
}

.stats-title-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-title-wrap i {
  -webkit-text-fill-color: var(--gold);
  font-size: 1rem;
}

.stats-live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff4a4a;
  background: rgba(255, 74, 74, 0.1);
  border: 1px solid rgba(255, 74, 74, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.slive-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4a4a;
  animation: live-blink 1.2s ease-in-out infinite;
}

/* ── Tabs bar ── */
.stats-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  flex-shrink: 0;
  background: rgba(5, 5, 5, 0.6);
}

.stats-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}

.stats-tab:hover {
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--text-main);
}

.stats-tab.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: transparent;
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}

/* ── Scrollable content ── */
.stats-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 60px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.stats-content::-webkit-scrollbar {
  width: 4px;
}
.stats-content::-webkit-scrollbar-track {
  background: transparent;
}
.stats-content::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.25);
  border-radius: 4px;
}

/* ── League group ── */
.league-group {
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  background: rgba(15, 11, 3, 0.7);
  overflow: hidden;
}

.league-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(212, 175, 55, 0.04);
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.league-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

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

.league-name {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-country {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.league-round {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Match card ── */
.match-card {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
  transition: background 0.18s ease;
}

.match-card:last-child {
  border-bottom: none;
}

.match-card:hover {
  background: rgba(212, 175, 55, 0.03);
}

.match-card.match--live {
  background: rgba(255, 60, 60, 0.03);
}

/* Team side */
.match-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.match-team--away {
  flex-direction: row-reverse;
  text-align: right;
}

.team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  transition: color 0.2s;
}

.team-name.winner {
  color: var(--gold);
  font-weight: 700;
}

/* Center: score + status */
.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.match-score {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text-main);
  line-height: 1;
}

.match-score.score--live  { color: #ff4a4a; }
.match-score.score--ft    { color: var(--text-muted); }
.match-score.score--ns    {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}

.match-status {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-status.status--live { color: #ff4a4a; }
.match-status.status--ft   { color: var(--text-muted); }
.match-status.status--ns   { color: var(--gold-dark); }
.match-status.status--pst  { color: #666; }

.match-live-pulse {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff4a4a;
  flex-shrink: 0;
  animation: live-blink 1s ease-in-out infinite;
}

/* ── Loading state ── */
.stats-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.stats-spinner {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(212, 175, 55, 0.12);
  border-top-color: var(--gold);
  border-right-color: var(--gold-light);
  border-radius: 50%;
  animation: stats-spin 0.75s linear infinite;
}

@keyframes stats-spin {
  to { transform: rotate(360deg); }
}

/* ── Empty / Error ── */
.stats-empty,
.stats-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}

.stats-empty i,
.stats-error i {
  font-size: 2.4rem;
  color: var(--gold-dark);
  opacity: 0.5;
}

.stats-empty p,
.stats-error p {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.stats-retry-btn {
  margin-top: 6px;
  padding: 9px 22px;
  border-radius: 22px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: transparent;
  color: var(--gold);
  font-family: 'Poppins', sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-retry-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.55);
}

/* ── Summary bar ── */
.stats-summary {
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 20px 2px;
  text-transform: uppercase;
}

/* ── New summary bar (with cache badge) ── */
.stats-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px 6px;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stats-summary-text {
  flex: 1;
}

.stats-summary-text strong {
  color: var(--gold);
}

.cache-badge {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.cache-badge--hit {
  background: rgba(212, 175, 55, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.cache-badge--fresh {
  background: rgba(61, 220, 132, 0.08);
  color: #3ddc84;
  border: 1px solid rgba(61, 220, 132, 0.2);
}

/* ── Refresh button ── */
.stats-refresh-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(18, 14, 6, 0.7);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.stats-refresh-btn:hover {
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
}

.stats-refresh-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stats-refresh-btn:disabled i {
  animation: stats-spin 0.7s linear infinite;
}

/* ── Date row ── */
.stats-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  background: rgba(5, 5, 5, 0.5);
  animation: slide-up 0.2s ease both;
}

.stats-date-row[hidden] {
  display: none !important;
}

.stats-date-row i {
  color: var(--gold-dark);
  font-size: 13px;
  flex-shrink: 0;
}

.stats-date-row label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}

.stats-date-input {
  flex: 1;
  background: rgba(18, 14, 6, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  color: var(--gold-light);
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.22s ease;
  color-scheme: dark;  /* forza UI picker dark su Chrome/Safari */
  min-width: 0;
}

.stats-date-input:focus {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.08);
}

/* ── Search bar ── */
.stats-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  background: rgba(5, 5, 5, 0.4);
  transition: background 0.22s ease;
}

.stats-search-wrap:focus-within {
  background: rgba(12, 9, 2, 0.7);
  border-color: rgba(212, 175, 55, 0.18);
}

.stats-search-icon {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  transition: color 0.22s ease;
}

.stats-search-wrap:focus-within .stats-search-icon {
  color: var(--gold);
}

.stats-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  caret-color: var(--gold);
  min-width: 0;
  /* rimuovi l'X nativo su webkit */
  -webkit-appearance: none;
}

.stats-search-input::placeholder {
  color: var(--text-muted);
}

/* Rimuovi icona clear nativa di <input type="search"> */
.stats-search-input::-webkit-search-cancel-button {
  display: none;
}

.stats-search-clear {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(212, 175, 55, 0.08);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.stats-search-clear:hover {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold);
}

/* Search highlight */
mark.search-hl {
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-light);
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

