/* IPBA Compact: the original statistics table remains the desktop/print view. */
#eventoPageV2 #statistiche {
  --stats-surface: var(--event-surface, #fff);
  --stats-muted: var(--event-muted-surface, #fafafa);
  --stats-border: var(--event-border, #ddd);
  --stats-text: var(--event-text, #333);
  --stats-secondary: var(--event-muted, #666);
  --stats-accent: var(--event-accent-text, #007f96);
  --stats-focus: var(--event-accent-border, #00acd6);
  --stats-positive: var(--event-success, #087942);
  --stats-negative: var(--event-danger, #ad3027);
  --stats-warning: var(--event-warning, #855600);
}
html[data-ipba-theme="dark"] #eventoPageV2 #statistiche {
  --stats-surface: var(--event-surface, #223038);
  --stats-muted: var(--event-muted-surface, #293840);
  --stats-border: var(--event-border, #3a4a52);
  --stats-text: var(--event-text, #e7eef1);
  --stats-secondary: var(--event-muted, #bac8ce);
  --stats-accent: var(--event-accent-text, #62d7ef);
  --stats-focus: var(--event-accent-border, #29c3e6);
  --stats-positive: var(--event-success, #91e0b3);
  --stats-negative: var(--event-danger, #ffb5ac);
  --stats-warning: var(--event-warning, #f1d893);
}
#eventoPageV2 #statistiche .event-stats-mobile-cards { display: none; }
@media screen and (max-width: 767px) {
  #eventoPageV2 #statistiche .event-stats-mobile-source { display: none !important; }
  #eventoPageV2 #statistiche .event-stats-mobile-cards {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
    width: 100%; min-width: 0; margin: 10px 0;
    color: var(--stats-text); font: 13px/1.4 Arial, Helvetica, sans-serif;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-card {
    box-sizing: border-box; min-width: 0; max-width: 100%; overflow: hidden;
    border: 1px solid var(--stats-border); border-radius: 4px; background: var(--stats-surface);
  }
  #eventoPageV2 #statistiche .event-stats-mobile-header { min-width: 0; padding: 6px 10px; }
  #eventoPageV2 #statistiche .event-stats-mobile-team,
  #eventoPageV2 #statistiche .event-stats-mobile-team .event-stat-team-main {
    display: flex; align-items: center; min-width: 0; min-height: 44px; gap: 8px;
    max-width: 100%; overflow-wrap: anywhere; word-wrap: break-word;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-team .event-stat-team-main { width: 100%; }
  #eventoPageV2 #statistiche .event-stats-mobile-team .event-stat-team-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; min-width: 32px; flex: 0 0 32px;
    padding: 2px; border: 1px solid var(--stats-border); border-radius: 3px; background: #fff;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-team img { display: block; width: 100%; height: 100%; object-fit: contain; }
  #eventoPageV2 #statistiche .event-stats-mobile-team a {
    display: flex; align-items: center; min-width: 0; min-height: 44px;
    color: var(--stats-accent); font: 600 13px/1.4 Arial, Helvetica, sans-serif;
    white-space: normal; overflow-wrap: anywhere; word-wrap: break-word; text-decoration: none;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-team a:hover { text-decoration: underline; }
  #eventoPageV2 #statistiche .event-stats-mobile-series {
    padding: 0 0 4px; color: var(--stats-text); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-series-label { color: var(--stats-secondary); }
  #eventoPageV2 #statistiche .event-stats-mobile-metrics,
  #eventoPageV2 #statistiche .event-stats-mobile-values {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px; margin: 0; padding: 0 10px 10px;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-metric,
  #eventoPageV2 #statistiche .event-stats-mobile-value {
    display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start;
    gap: 3px; min-width: 0; padding: 8px 10px;
    border: 1px solid var(--stats-border); border-radius: 3px; background: var(--stats-muted);
  }
  #eventoPageV2 #statistiche .event-stats-mobile-cards dt {
    min-width: 0; margin: 0; color: var(--stats-secondary); font-size: 11px;
    font-weight: 400; line-height: 1.35; overflow-wrap: anywhere;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-cards dd {
    min-width: 0; margin: 0; color: var(--stats-text); font-size: 20px;
    font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-value dd { font-size: 14px; }
  #eventoPageV2 #statistiche .event-stats-mobile-cards .is-win dd,
  #eventoPageV2 #statistiche .event-stats-mobile-cards .is-positive dd { color: var(--stats-positive); }
  #eventoPageV2 #statistiche .event-stats-mobile-cards .is-loss dd,
  #eventoPageV2 #statistiche .event-stats-mobile-cards .is-negative dd { color: var(--stats-negative); }
  #eventoPageV2 #statistiche .event-stats-mobile-cards .event-stat-penalties { background: var(--stats-muted); }
  #eventoPageV2 #statistiche .event-stats-mobile-cards .event-stat-penalties dd { color: var(--stats-warning); }
  #eventoPageV2 #statistiche .event-stats-mobile-details { border-top: 1px solid var(--stats-border); }
  #eventoPageV2 #statistiche .event-stats-mobile-details summary {
    box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start;
    min-height: 44px; padding: 8px 10px; cursor: pointer; list-style: none;
    color: var(--stats-accent); font-size: 12px; font-weight: 600; touch-action: manipulation;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-details summary::-webkit-details-marker { display: none; }
  #eventoPageV2 #statistiche .event-stats-mobile-open,
  #eventoPageV2 #statistiche .event-stats-mobile-details[open] .event-stats-mobile-close {
    display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-close,
  #eventoPageV2 #statistiche .event-stats-mobile-details[open] .event-stats-mobile-open { display: none; }
  #eventoPageV2 #statistiche .event-stats-mobile-symbol { font-size: 20px; font-weight: 400; line-height: 1; }
  #eventoPageV2 #statistiche .event-stats-mobile-details summary:hover { background: var(--stats-muted); }
  #eventoPageV2 #statistiche .event-stats-mobile-cards a:focus,
  #eventoPageV2 #statistiche .event-stats-mobile-details summary:focus {
    outline: 2px solid var(--stats-focus); outline-offset: -2px; border-radius: 2px;
  }
  #eventoPageV2 #statistiche .event-stats-mobile-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}
@media print {
  #eventoPageV2 #statistiche .event-stats-mobile-cards { display: none !important; }
}
