:root {
  --bg0: #060a12;
  --bg1: #0b1220;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #52ffa8;
  --accent2: #67a3ff;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      900px 500px at 20% 10%,
      rgba(103, 163, 255, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 80% 20%,
      rgba(82, 255, 168, 0.12),
      transparent 55%
    ),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(
      circle at 30% 20%,
      rgba(82, 255, 168, 0.08),
      transparent 35%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(103, 163, 255, 0.08),
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 90%,
      rgba(255, 255, 255, 0.05),
      transparent 45%
    );
  opacity: 1;
}

.header {
  padding: 24px 18px 8px;
}

.container {
  width: min(1400px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: 26px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Telegram CTA in header */
.tg-cta {
  margin-left: auto;
  margin-right: auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.tg-cta:hover {
  filter: brightness(1.08);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    rgba(82, 255, 168, 0.18),
    rgba(103, 163, 255, 0.18)
  );
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 20px;
}

.title {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}
.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: linear-gradient(180deg, var(--card), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
}

.card-title {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding-top: 2px;
}

/* FORM */
.form {
  display: grid;
  gap: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

input[type="text"],
select {
  width: 100%;
  padding: 12px 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: rgba(82, 255, 168, 0.55);
  box-shadow: 0 0 0 4px rgba(82, 255, 168, 0.1);
}

.btn {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.06s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  user-select: none;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: linear-gradient(
    135deg,
    rgba(82, 255, 168, 0.2),
    rgba(103, 163, 255, 0.16)
  );
  border-color: rgba(82, 255, 168, 0.3);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  padding-top: 4px;
}
.opt {
  display: flex;
  gap: 10px;
  align-items: center;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
ul {
  margin: 10px 0 0;
  padding-left: 18px;
}
li {
  margin: 6px 0;
}

.muted {
  color: var(--muted);
}
.bad {
  color: var(--danger);
}

/* pills / kv */
.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}

.teamline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  object-fit: cover;
}

.kv {
  display: grid;
  gap: 8px;
}
.kv-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.k {
  color: var(--muted);
  font-size: 12px;
}
.v {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

/* ===== DASHBOARD LAYOUT ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* tablet: 2 colonne */
@media (min-width: 920px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* desktop grande: 3 colonne + "tutte a colpo d'occhio" */
@media (min-width: 1280px) {
  .grid {
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    align-items: stretch;
  }

  /* le card della dashboard non devono “spingere” la pagina in basso:
     se hanno molto contenuto, scroll dentro la card */
  .grid .card {
    min-height: 290px;
  }

  .grid .card .content {
    max-height: 320px;
    overflow: auto;
    padding-right: 6px;
  }

  /* scrollbar più pulita */
  .grid .card .content::-webkit-scrollbar {
    width: 10px;
  }
  .grid .card .content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
  }
}

/* footer */

/* Skeleton (resta, ma ora lo useremo più avanti se vuoi) */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 1.15s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
.skel-line {
  height: 12px;
  margin: 10px 0;
}
.skel-line.sm {
  width: 35%;
}
.skel-line.md {
  width: 60%;
}
.skel-line.lg {
  width: 85%;
}

/* ===== TOP SPLIT (Ricerca + Indicatori) ===== */
.top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 1100px) {
  .top-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .top-grid .card {
    min-height: 220px;
  }

  .top-grid .card .content {
    max-height: 240px;
    overflow: auto;
  }
  /* Indicatori: un filo più “pro” */
  #indicatorsPanel .kv-row {
    background: rgba(255, 255, 255, 0.045);
  }
  #indicatorsPanel .pill {
    font-weight: 600;
  }
}
/* ===== INDICATORI (tile compatti, tutto a vista) ===== */

#indicatorsPanel .ind-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* su schermi medi/grandi -> 2 colonne */
@media (min-width: 780px) {
  #indicatorsPanel .ind-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#indicatorsPanel .ind-tile {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
}

#indicatorsPanel .ind-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#indicatorsPanel .ind-title {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

#indicatorsPanel .ind-ico {
  width: 22px;
  display: inline-flex;
  justify-content: center;
}

#indicatorsPanel .ind-score {
  min-width: 52px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 800;
}

/* badge colorati */
#indicatorsPanel .score-high {
  background: rgba(82, 255, 168, 0.18);
  border-color: rgba(82, 255, 168, 0.35);
}
#indicatorsPanel .score-mid {
  background: rgba(103, 163, 255, 0.16);
  border-color: rgba(103, 163, 255, 0.3);
}
#indicatorsPanel .score-low {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.28);
}
#indicatorsPanel .score-neutral {
  background: rgba(255, 255, 255, 0.06);
}

#indicatorsPanel .ind-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
#indicatorsPanel .ind-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 10px;
}

#indicatorsPanel .ind-lines {
  display: grid;
  gap: 8px;
}

#indicatorsPanel .ind-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#indicatorsPanel .ind-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#indicatorsPanel .ind-team-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

#indicatorsPanel .ind-val {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}
/* ===== INDICATORI: progress + summary ===== */

#indicatorsPanel .ind-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 12px;
}

#indicatorsPanel .ind-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

#indicatorsPanel .ind-bar {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 8px 0 8px;
}
#indicatorsPanel .ind-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(82, 255, 168, 0.55),
    rgba(103, 163, 255, 0.55)
  );
  width: 0%;
}

#indicatorsPanel .ind-minirow {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Indicatori: un pelo più aria, ma senza diventare gigantesco */
@media (min-width: 1100px) {
  .top-grid #indicatorsPanel.content {
    max-height: 320px; /* prima era 240 */
  }
}
/* Summary pills in alto (stile bookmaker) */
#indicatorsPanel .ind-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

#indicatorsPanel .ind-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
}
/* ✅ NO SCROLL nella card indicatori (override della top-grid)
@media (min-width: 1100px){
  #indicatorsPanel.content{
    max-height: none !important;
    overflow: visible !important;
  }
}*/
/* ===== Bookmaker style box ===== */
/* ===== Bookmaker compact ===== */
.bet-box {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.bet-head2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.bet-row2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.7fr;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bet-row2:first-of-type {
  border-top: none;
}

.bet-market {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

.bet-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 8px;
}

.bet-avg {
  justify-content: center;
}

.bet-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.bet-num {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.bet-pct {
  font-size: 14px;
  font-weight: 800;
}

.bet-frac {
  font-size: 11px;
  opacity: 0.75;
}
.bet-details {
  margin-top: 8px;
}
.bet-summary {
  cursor: pointer;
  font-weight: 700;
  opacity: 0.85;
}
.bet-select {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
}

.searchRow {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.searchGrow {
  flex: 1;
  min-width: 260px;
}

.searchGrow input {
  width: 100%;
}

.gamesPick {
  width: 120px;
  min-width: 120px;
}

.gamesPick select {
  width: 100%;
}

.hint {
  display: block;
  margin-top: 6px;
  opacity: 0.75;
  font-size: 0.9em;
}

/* Se su schermi piccoli va a capo in modo elegante */
@media (max-width: 900px) {
  .searchRow {
    flex-direction: column;
    align-items: stretch;
  }
  .gamesPick {
    width: 100%;
    min-width: 0;
  }
}
/* ===== TOP BAR (badge + login/logout) ===== */
#topBar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 20px;
  margin-left: auto;
}

.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.statusBadge.trial {
  border-color: rgba(255, 200, 0, 0.35);
  background: rgba(255, 200, 0, 0.1);
}

.statusBadge.pro {
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.1);
}

.statusBadge.expired {
  border-color: rgba(255, 0, 0, 0.35);
  background: rgba(255, 0, 0, 0.1);
}

.hidden {
  display: none;
}

#btnOpenAuth {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
/* FIX: quando una modale ha anche "hidden", deve sparire davvero */
.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  padding: 30px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1c1c1c;
  color: white;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

/* PayPal button (modal) */
.btn.paypal {
  width: 100%;
}

/* Footer support */
.footer {
  padding: 16px 18px 22px;
  text-align: center;
  color: var(--muted);
}
.footer a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

.close {
  cursor: pointer;
  align-self: flex-end;
  font-size: 20px;
}
#btnOpenAuth.pro-active {
  border: 1px solid rgba(0, 255, 0, 0.4);
}
#btnOpenAuth.trial-active {
  border: 1px solid rgba(255, 200, 0, 0.5);
}
#btnOpenAuth.expired {
  border: 1px solid rgba(255, 0, 0, 0.5);
}

/* ===== PRO LOCK (sfoca contenuto, CTA cliccabile) ===== */
.pro-locked {
  position: relative;
  opacity: 0.92;
}

/* sfoca SOLO il contenuto della card */
.pro-locked > * {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

/* badge/CTA sempre leggibile */
.pro-locked::after {
  content: "SOLO PRO";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
}
/* =========================
   TABS (sticky) + single view
   ========================= */
.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  width: min(1400px, calc(100% - 28px));
  margin: 6px auto 0;
  padding: 10px 6px;
  display: flex;
  gap: 10px;
  overflow: auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}
.tabs::before,
.tabs::after {
  content: "";
  position: sticky;
  top: 0;
  width: 18px;
  flex: 0 0 18px;
  pointer-events: none;
}
.tabs::before {
  left: 0;
  background: linear-gradient(90deg, rgba(6, 10, 18, 1), rgba(6, 10, 18, 0));
}
.tabs::after {
  right: 0;
  background: linear-gradient(270deg, rgba(6, 10, 18, 1), rgba(6, 10, 18, 0));
}

.tab {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.06s ease,
    filter 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}
.tab:hover {
  filter: brightness(1.08);
  border-color: rgba(255, 255, 255, 0.22);
}
.tab:active {
  transform: translateY(1px);
}
.tab.is-active {
  background: linear-gradient(
    135deg,
    rgba(82, 255, 168, 0.22),
    rgba(103, 163, 255, 0.18)
  );
  border-color: rgba(82, 255, 168, 0.35);
  box-shadow:
  0 10px 26px rgba(0, 0, 0, 0.35),
  0 0 0 1px rgba(82, 255, 168, 0.22) inset;
}

/* Modalità: mostra SOLO una card selezionata */
body[data-view-mode="single"] .top-grid,
body[data-view-mode="single"] .grid {
  grid-template-columns: 1fr !important;
}

body[data-view-mode="single"] .top-grid .card,
body[data-view-mode="single"] .grid .card {
  display: none;
}

/* la card selezionata torna visibile e diventa “hero” */
body[data-view-mode="single"] .card.is-focus {
  display: block !important;
  padding: 16px 16px 14px;
}

/* =========================
   LOADER overlay “pallone”
   ========================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.loader.hidden {
  display: none;
}

.loader-card {
  width: min(520px, calc(100% - 32px));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(17, 17, 17, 0.72);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.ball-track {
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: absolute;
  top: 7px;
  left: -40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0.15) 55%,
      rgba(0, 0, 0, 0.35) 100%
    ),
    repeating-conic-gradient(
      from 0deg,
      rgba(0, 0, 0, 0.45) 0 12deg,
      rgba(255, 255, 255, 0.08) 12deg 24deg
    );
  animation: ball-roll 1.15s linear infinite;
}

@keyframes ball-roll {
  0% {
    transform: rotate(0deg);
    left: -40px;
  }
  100% {
    transform: rotate(360deg);
    left: calc(100% + 40px);
  }
}

.loader-text {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.loader-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
.loader-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

/* tabs sotto ricerca (non sticky sopra tutto) */
.tabs-under-search {
  position: relative;
  top: auto;
  margin-top: 10px;
}

/* hero match più “importante” */
.card-hero {
  padding: 18px;
}

/* stage card grande */
.card-stage {
  min-height: 380px;
}

/* vista a pannelli: uno alla volta */
.stageView.hidden {
  display: none;
}

/* box verde formazioni */
.lineupsBox {
  margin-top: 14px;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(82, 255, 168, 0.28);
  /* stacca il box dal campo (niente verde su verde) */
  background: rgba(0, 0, 0, 0.22);
}
.lineupsBox.hidden {
  display: none;
}
.lineupsHead {
  font-weight: 900;
  margin-bottom: 8px;
}

.matchHero {
  display: grid;
  gap: 14px;
}

.mh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mh-league {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 14px;
}

.mh-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mh-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.mh-team {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mh-team.right {
  justify-content: flex-end;
  text-align: right;
}

.mh-logo {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.mh-name {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-vs {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.mh-score {
  font-size: 22px;
  font-weight: 950;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(82, 255, 168, 0.28);
  background: rgba(82, 255, 168, 0.1);
}

.mh-sub {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .mh-main {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 12px;
  }

  .mh-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .mh-name {
    font-size: 18px;
  }

  .mh-team,
  .mh-team.right {
    justify-content: center;
    text-align: center;
  }

  .mh-vs .mh-sub {
    display: none; /* su mobile è rumore */
  }

  .mh-score {
    font-size: 18px;
    padding: 7px 12px;
  }
}

.mh-bottom {
  font-size: 13px;
}

/* colori squadra */
.pitch-player.home .pp-badge {
  border-color: rgba(82, 255, 168, 0.35);
}
.pitch-player.away .pp-badge {
  border-color: rgba(103, 163, 255, 0.35);
}
/* campo più visibile */
.lineupsBox {
  margin-top: 14px;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(82, 255, 168, 0.28);
  /* stacca il box dal campo (niente verde su verde) */
  background: rgba(0, 0, 0, 0.22);
}
.lineupsHead {
  font-weight: 950;
  margin-bottom: 10px;
}

/* pitch */
.pitch {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
  radial-gradient(
    circle at 50% 25%,
    rgba(255, 255, 255, 0.07),
    transparent 58%
  ),
  repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.035) 0 26px,
    rgba(0, 0, 0, 0) 26px 52px
  ),
  linear-gradient(180deg, rgba(0, 255, 140, 0.28), rgba(0, 255, 140, 0.12));
  position: relative;
  overflow: hidden;
  padding: 12px;
  min-height: 360px;
}
.pitch--empty {
  min-height: 220px;
}

.pitch-lines {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  pointer-events: none;
}
.pitch-mid {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-1px);
  pointer-events: none;
}
.pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pitch-teamname {
  position: absolute;
  top: 10px;
  font-weight: 950;
  font-size: 12px;
  opacity: 0.95;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
}
.pitch-teamname.left {
  left: 12px;
}
.pitch-teamname.right {
  right: 12px;
}

.pitch-grid {
  position: relative;
  height: 330px;
  margin-top: 26px;
}

/* player: posizionamento a percentuale */
.pitch-player {
  position: absolute;
  left: calc(var(--x, 50) * 1%);
  top: calc(var(--y, 50) * 1%);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 110px;
  pointer-events: auto;
}
.pitch-player {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.pitch-player:disabled {
  cursor: default;
  opacity: 0.7;
}
.pp-photo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
}

.pitch-player .pp-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
}

.pitch-player .pp-name {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
}

/* accenti */
.pitch-player.home .pp-badge {
  border-color: rgba(82, 255, 168, 0.45);
}
.pitch-player.away .pp-badge {
  border-color: rgba(103, 163, 255, 0.45);
}
.mh-next {
  margin-top: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}
.mh-next-title {
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 6px;
  opacity: 0.9;
}
.next-line {
  font-size: 12px;
  line-height: 1.25;
}
.next-muted {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}
/* mini-card prossima partita */
.nextMini {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 8px;
}
.nm-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.nm-title {
  font-weight: 950;
  font-size: 12px;
  letter-spacing: 0.2px;
  opacity: 0.9;
}
.nm-date {
  font-size: 12px;
  opacity: 0.85;
}
.nm-mid {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nm-logo {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
}
.nm-opp {
  font-weight: 900;
  font-size: 14px;
}
.nm-comp {
  font-size: 11px;
  opacity: 0.72;
}
.nm-muted {
  font-size: 12px;
  opacity: 0.75;
}
.pitch-player {
  pointer-events: auto !important;
  cursor: pointer;
  border: none;
  background: transparent;
}

.pp-tag {
  font-size: 10px;
  opacity: 0.78;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}
.pitch-badge {
  margin-left: 8px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
}
.pitch-footnote {
  margin-top: 10px;
  font-size: 12px;
}
.st-table {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.st-head,
.st-row {
  display: grid;
  grid-template-columns: 46px 1fr 70px 70px 70px 70px 70px;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.st-head {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
  font-size: 12px;
  opacity: 0.9;
}
.st-rank {
  text-align: center;
  font-weight: 900;
}
.st-team {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.st-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
}
.st-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.st-row.is-focus {
  border-color: rgba(82, 255, 168, 0.35);
  background: rgba(82, 255, 168, 0.08);
}
@media (max-width: 900px) {
  .st-head,
  .st-row {
    grid-template-columns: 40px 1fr 52px 52px 52px;
  }
  .st-head .st-num:nth-child(n + 6),
  .st-row .st-num:nth-child(n + 6) {
    display: none;
  }
}

.mh-nextInline {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: transparent;
  opacity: 0.82;
}

.mh-nextLabel {
  font-size: 11px;
  opacity: 0.7;
}
.mh-nextLine {
  font-size: 12px;
  font-weight: 750;
  opacity: 0.9;
}

@media (max-width: 640px) {
  .mh-main {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }
  .mh-team,
  .mh-team.right {
    justify-content: center;
    text-align: center;
  }

  .mh-vs {
    order: 2;
  }
}

.mh-textCol {
  display: grid;
  gap: 8px;
}
/* =========================
   SUGGERIMENTI TEAM (custom dropdown con logo)
   ========================= */
.searchGrow {
  position: relative;
} /* serve per ancorare la tendina */

.suggestBox {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.suggestItem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
}

.suggestItem:hover {
  background: rgba(255, 255, 255, 0.06);
}

.suggestLogo {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
  flex: 0 0 auto;
}

.suggestText {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.suggestName {
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestMeta {
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* scrollbar dropdown */
.suggestBox::-webkit-scrollbar {
  width: 10px;
}
.suggestBox::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

/* =========================
   MOBILE: header più “smartphone friendly”
   ========================= */
@media (max-width: 720px) {
  .header {
    padding: 16px 14px 8px;
  }

  .brand {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .title {
    font-size: 20px;
  }
  .subtitle {
    font-size: 12px;
  }

  /* CTA e topbar vanno a capo senza spaccare */
  .tg-cta {
    order: 3;
    width: 100%;
    text-align: center;
    margin: 10px 0 0;
  }

  #topBar {
    order: 4;
    width: 100%;
    justify-content: space-between;
    padding: 10px 0 0;
    margin-left: 0;
  }
}
.input-row {
  position: relative;
}
/* Compatta area logo in MatchHero (toglie spazio “vuoto”) */
.mh-team {
  align-items: center;
}

.mh-logoCol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px; /* era troppo alto */
  padding: 0; /* se c’era padding */
  margin: 0; /* se c’era margin */
  min-width: 0; /* evita “colonna larga” */
}

.mh-logo {
  display: block;
  margin: 0; /* toglie margini img */
}

.mh-textCol {
  margin-left: 10px; /* controllato */
}
.suggestLogoFallback {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
/* =========================
   TEAMS TAB (stile screenshot)
   ========================= */
.teamCardsWrap {
  display: grid;
  gap: 16px;
}

.teamCard {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 14px;
  overflow: hidden;
}

.teamCardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.teamTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.teamLogo {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
}

.teamName {
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teamLastN {
  opacity: 0.75;
  font-size: 13px;
}

.teamChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.chip-ok {
  border-color: rgba(0, 255, 170, 0.22);
}
.chip-mid {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.95;
}
.chip-bad {
  border-color: rgba(255, 70, 70, 0.22);
}

.teamTableWrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.teamTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.teamTable th,
.teamTable td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.td-date {
  opacity: 0.85;
  width: 110px;
}
.td-score {
  width: 90px;
  text-align: center;
}
.td-res {
  width: 70px;
  text-align: center;
}
.td-y,
.td-r {
  width: 60px;
  text-align: center;
}
.th-y,
.th-r {
  text-align: center;
}

.opp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.oppLogo {
  width: 18px;
  height: 18px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
}

.oppName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.res-w {
  border-color: rgba(0, 255, 170, 0.25);
}
.res-d {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.9;
}
.res-l {
  border-color: rgba(255, 70, 70, 0.25);
}

@media (max-width: 720px) {
  .td-date {
    width: auto;
  }
  .td-y,
  .td-r {
    width: 46px;
  }
  .td-res {
    width: 56px;
  }
  .td-score {
    width: 70px;
  }
}

/* Header tabella: allineamento colonne */
.teamTable thead th {
  text-align: left;
}

/* Colonne numeriche centrali */
.teamTable thead th:nth-child(3),
.teamTable thead th:nth-child(4) {
  text-align: center;
}

/* "Avv." parte dove parte il nome (dopo il logo) */
.teamTable thead th:nth-child(2) {
  padding-left: 36px; /* logo(18) + gap(10) + padding base(8) */
}
/* PITCH responsive senza ruotare assi */
.pitch-grid {
  height: clamp(260px, 55vw, 330px);
}

.pp-photo-wrapper {
  display: grid;
  justify-items: center;
  gap: 6px;
}

/* =========================
   BADGE ALLENATORI / MODULO
   ========================= */
.coach-badge {
  position: absolute;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 5;
  line-height: 1.4;
}

/* MOBILE: Casa in basso a sx, Trasferta in alto a dx */
.coach-badge.home {
  bottom: 10px;
  left: 10px;
  border-left: 3px solid rgba(82, 255, 168, 0.8);
}
.coach-badge.away {
  top: 10px;
  right: 10px;
  border-right: 3px solid rgba(103, 163, 255, 0.8);
  text-align: right;
}

/* PC DESKTOP: Casa in alto a sx, Trasferta in alto a dx */
@media (min-width: 920px) {
  .coach-badge.home {
    top: 10px;
    bottom: auto;
    left: 10px;
  }
}

/* =========================
   FIX LISTA INDISPONIBILI
   ========================= */
.injRow {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}
.pchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.pimg {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.pname {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}
.injMeta {
  font-size: 12px;
}
.candWrap {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
@media (min-width: 900px) {
  .candWrap {
    grid-template-columns: 1fr 1fr;
  }
}
.candTeam {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.candTitle {
  font-weight: 900;
  margin-bottom: 8px;
}
.candRow {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.candRow:first-child {
  border-top: none;
}
.candRole {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 900;
  padding-top: 6px;
}
.candList {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.candChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}
.candChip:hover {
  filter: brightness(1.08);
}
.candPhoto {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}
.candName {
  font-size: 12px;
  font-weight: 800;
}
.candPct {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 900;
}
/* ===== FIX BADGE NUMERO: MAI SOPRA LA FACCIA ===== */
.pp-photo-wrapper {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 44px;
}

.pp-photo-wrapper .pp-badge {
  position: static !important; /* cancella l'assoluto */
  transform: none !important;
  margin: 0 !important;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 28px;
  height: 18px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 18px;
  border-radius: 999px;
}
/* ===== STIMA: foto SEMPRE sopra i layer del campo ===== */
.pitch-player {
  z-index: 20 !important;
}
.pp-photo-wrapper {
  z-index: 21 !important;
}
.pp-photo {
  display: block !important;
}

html,
body {
  overflow-x: hidden;
}

@media (max-width: 520px) {
  html,
  body {
    overflow-x: hidden;
  }

  .pitch {
    min-height: 420px;
  }
  .pitch-grid {
    height: 380px;
  }
  .pitch-player {
    width: 64px;
    gap: 3px;
  }

  .pp-photo {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }

  .pitch-player .pp-name {
    max-width: 64px;
    font-size: 9px;
    padding: 3px 6px;
  }
  .pitch-player .pp-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  .coach-badge{ font-size:10px; padding:5px 8px; }
  .coach-badge.home{ bottom: 6px; }
  .coach-badge.away{ top: 6px; }
}
/* ===== PITCH: toggle mobile (una squadra alla volta) ===== */
.pitch-toggle{
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
}

.pitch-toggle button{
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.pitch-toggle button.is-active{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
}

@media (max-width: 520px){
  /* di base nascondo la squadra "away" per evitare ammasso */
  #lineupsContent[data-pitch-side="home"] .pitch-player.away{ display:none; }
  #lineupsContent[data-pitch-side="away"] .pitch-player.home{ display:none; }
    /* ===== Mobile: mostra SOLO mezza campo in base al toggle ===== */
  #lineupsContent[data-pitch-side="home"] .pitch{
    overflow: hidden;
  }
  #lineupsContent[data-pitch-side="home"] .pitch-grid{
    width: 200%;
    transform: translateX(0);
    transform-origin: left center;
  }

  #lineupsContent[data-pitch-side="away"] .pitch{
    overflow: hidden;
  }
  #lineupsContent[data-pitch-side="away"] .pitch-grid{
    width: 200%;
    transform: translateX(-50%);
    transform-origin: left center;
  }
/* Toggle più premium su mobile */
.pitch-legend{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

.pitch-toggle{
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

.pitch-toggle button{
  opacity: .85;
}

.pitch-toggle button.is-active{
  opacity: 1;
  background: linear-gradient(135deg, rgba(82,255,168,0.20), rgba(103,163,255,0.16));
  border: 1px solid rgba(82,255,168,0.28);
}
/* ===== Mobile: mezza-campo + animazione ===== */
#lineupsContent .pitch{ overflow:hidden; }

#lineupsContent .pitch-grid{
  width: 200%;
  transition: transform .18s ease;
  will-change: transform;
}

/* Casa = metà sinistra */
#lineupsContent[data-pitch-side="home"] .pitch-grid{ transform: translateX(0); }
/* Trasferta = metà destra */
#lineupsContent[data-pitch-side="away"] .pitch-grid{ transform: translateX(-50%); }

/* Mostra solo coach badge del lato scelto */
#lineupsContent[data-pitch-side="home"] .coach-badge.away{ display:none; }
#lineupsContent[data-pitch-side="away"] .coach-badge.home{ display:none; }

/* Riduci il cerchio centrale su mobile (meno casino visivo) */
.pitch::after{ width: 110px; height: 110px; }
  /* Coach badge: ne mostro solo uno, quello del lato scelto */
  #lineupsContent[data-pitch-side="home"] .coach-badge.away{ display:none; }
  #lineupsContent[data-pitch-side="away"] .coach-badge.home{ display:none; }
  .pitch::after{ width: 110px; height: 110px; }
  /* i coach badge non devono rubare campo */
  .coach-badge{ font-size:10px; padding:5px 8px; }
}

@media (min-width: 900px) {
  #pitchToggle { display: none !important; }
}
/* ===== MATCH HERO: MOBILE PULITO (squadre una sopra l’altra, VS nascosto) ===== */
@media (max-width: 640px) {
  .mh-vs { display: none !important; }

  .mh-main {
    grid-template-columns: 1fr;   /* una colonna */
    gap: 12px;
    text-align: center;
  }

  .mh-team,
  .mh-team.right {
    justify-content: center;
    text-align: center;
  }

  /* nome leggibile: niente ellissi su mobile */
  .mh-name {
    font-size: 18px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
  }

  .mh-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  /* la colonna testo non deve spostarsi a sinistra su mobile */
  .mh-textCol { margin-left: 0; }
}
/* ===== OVERRIDE FINALE MOBILE MATCH HERO (vince su tutto) ===== */
@media (max-width: 640px) {
  .mh-vs { display: none !important; }
  .mh-main { grid-template-columns: 1fr !important; }
  .mh-team, .mh-team.right { justify-content: center !important; text-align: center !important; }
  .mh-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .mh-textCol { margin-left: 0 !important; }
}
/* =========================
   Welcome card + Help toast
   ========================= */

.welcomeCard{
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(135deg, rgba(82,255,168,.08), rgba(103,163,255,.06));
}

.welcomeTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.welcomeGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}

.welcomeItem{
  display:flex;
  gap:10px;
  padding:12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.welcomeIcon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}

.welcomeTitle{
  font-weight: 700;
  margin-bottom: 2px;
}

@media (max-width: 720px){
  .welcomeGrid{ grid-template-columns: 1fr; }
  .welcomeTop{ flex-direction: column; align-items: stretch; }
}

/* Toast */
.crToast{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  border-radius: 16px;
  padding: 12px 12px 10px;
  background: rgba(10,16,28,.92);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
}

.crToast.hidden{ display:none; }

.crToast .tTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.crToast .tTitle{
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.crToast .tText{
  margin: 6px 0 0;
  opacity: .9;
}

.crToast .tActions{
  margin-top: 10px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

.crToast .tLink{
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.78);
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 8px;
}

.crToast .tClose{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
}

.btnUpgrade{
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(82,255,168,.28);
  background: rgba(82,255,168,.10);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}
.btnUpgrade:hover{
  background: rgba(82,255,168,.14);
  border-color: rgba(82,255,168,.40);
}
.btnUpgrade.hidden{ display:none; }

/* Avversaria era in casa (noi fuori) */

.oppHome{
  font-weight: 900 !important;
  text-decoration: underline;
}
