body {
  font-family: 'Montserrat';
  background: #111;
  color: white;
  margin: 0;
  padding: 10px;
}

/* CONTENITORE CENTRATO */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  margin-bottom: 10px;
}

h1 img {
  width: 200px;
  max-width: 80%;
  height: auto;
}

/* NAV */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 900px;
}

nav button.active-btn {
  background: #fff;
  color: #111;

  transform: scale(1.05);
  font-weight: 700;

  box-shadow: 0 0 10px rgba(255,255,255,0.3);
  transition: all 0.2s ease;
}

button {
  padding: 10px 14px;
  font-size: 18px;
  border: none;
  background: #333;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: #555;
}

/* SEZIONI COME "CARD" */
section {
  display: none;
  width: 100%;
  max-width: 900px;
  background: #1a1a1a;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
}

section.active {
  display: block;
}

/* TABELLE */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 10px;
}

th, td {
  border: 1px solid #444;
  padding: 4px 6px;
  text-align: center;
  font-size: 14px;
}

th {
  background: #222;
}

.team-logo {
  width: 70px;
  height: 70px;

  object-fit: contain;

  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  font-weight: bold;
}

.team-cell span {
  font-size: 18px;
  font-weight: 700;
}

table td:not(.team-cell) {
  font-size: 15px;
  font-weight: 600;
}

.risultato {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;

  font-size: 16px;
  font-weight: bold;
}

.team-logo-small {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

.squadra {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;        /* IMPORTANTISSIMO */
  overflow: hidden;
}

.squadre-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 15px;
}

/* 🧩 CARD PIÙ “SPORTIVA” */
.squadra-card {
  background: linear-gradient(145deg, #151515, #0f0f0f);
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* HEADER PIÙ BELLO */
.squadra-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a2a;
}

.squadra-header h3 {
  font-size: 20px;
  margin: 0;
}

/* PRESIDENTE “STILE INFO BAR” */
.presidente {
  margin: 12px 0;
  padding: 6px 10px;
  background: #1f1f1f;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0.9;
}

/* LISTA GIOCATORI PIÙ MODERNA */
.membro {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 8px 10px;
  margin: 6px 0;

  background: #141414;
  border-radius: 8px;

  transition: 0.2s;
}

.info {
  display: flex;
  align-items: center;
  gap: 4px; /* 👈 distanza numero-nome */
}

.membro:hover {
  background: #1e1e1e;
  transform: translateX(3px);
}

/* NOME */
.membro .nome {
  font-weight: 600;
}

/* BADGE RUOLI */
.badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
}

/* 🟡 CAPITANO */
.membro.capitano .badge {
  background: gold;
  color: black;
  font-weight: bold;
}

/* 🧤 PORTIERE */
.membro.portiere .badge {
  background: #4db8ff;
  color: black;
  font-weight: bold;
}

.squadra-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.presidente {
  margin: 10px 0;
  font-size: 14px;
  opacity: 0.8;
}

.membro {
  padding: 4px 0;
}

.membro:has(.capitano) {
  font-weight: bold;
}

.giornata {
  margin-bottom: 25px;
}

.giornata h3 {
  background: #222;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.partita {
  background: #1a1a1a;
  border: 1px solid #2f2f2f;
  border-radius: 12px;

  padding: 15px;
  margin-bottom: 12px;

  box-sizing: border-box;
}

.posizione {
  font-weight: 800;
  font-size: 18px;
  width: 40px;
  text-align: center;
}

.pair-1 {
  background: rgba(255, 215, 0, 0.18); /* oro */
}

.pair-2 {
  background: rgba(0, 255, 0, 0.12); /* verde */
}

.pair-3 {
  background: rgba(0, 150, 255, 0.12); /* blu */
}

.pair-4 {
  background: rgba(255, 0, 150, 0.12); /* viola */
}

.orario {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 10px;
}

.time {
  text-align: center;
  font-size: 18px;
  opacity: 0.7;
}

/* layout squadra vs squadra */
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  gap: 10px;
}

/* squadra */
.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team img {
  width: 150px;
  height: 150px;

  object-fit: contain;
  background: none;

  padding: 0;

  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

.team span {
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.marcatori-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.marcatori-box {
  max-height: 0;
  overflow: hidden;
  opacity: 0;

  display: flex;
  justify-content: space-between;

  transition: max-height 0.4s ease, opacity 0.3s ease;

  font-size: 13px;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
}

.marcatori-box.open {
  max-height: 200px; /* abbastanza grande per contenuto */
  opacity: 1;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #333;
}

.toggle-btn {
  margin-top: 10px;
  padding: 6px 10px;
  background: #333;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.giornata-btn {
  width: 100%;
  padding: 10px;

  background: #222;
  color: white;

  border: none;
  border-radius: 8px;

  font-size: 14px;
  font-weight: bold;

  cursor: pointer;
  margin-bottom: 10px;
}

.giornata-box {
  max-height: 0;
  overflow: hidden;

  opacity: 0;

  transition: max-height 0.5s ease, opacity 0.3s ease;
}

.giornata-box.open {
  max-height: 3000px;
  opacity: 1;
}

.giornata-box.open .partita {
  margin-bottom: 14px;
  transform: translateY(0);
  transition: all 0.2s ease;
}

.sponsors-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;

  padding: 10px;
  flex-wrap: wrap;

  background: #111;
}

.sponsors-bar img {
  height: 100px;
  object-fit: contain;
  filter: brightness(1.1);
  
}

#calendario .team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 60px;
  justify-content: center;
}

#calendario .team span {
  font-size: 16px;
  font-weight: 700;
}

#calendario .score {
  font-size: 30px;
  font-weight: 800;
}

#calendario .giornata-btn {
  font-size: 16px;
}

#calendario .orario {
  font-size: 14px;
}

.top1 {
  background: gold;
  font-weight: bold;
}

.top2 {
  background: silver;
  font-weight: bold;
}

.top3 {
  background: #cd7f32;
  font-weight: bold;
  color: white;
}

.top-red {
  background: #ff4d4d;
  color: white;
  font-weight: bold;
}

/* TESTI */
p {
  font-size: 14px;
  line-height: 1.5;
}

@keyframes glow-red {
  0% {
    box-shadow: 0 0 5px #ff4d4d;
  }
  50% {
    box-shadow: 0 0 20px #ff4d4d, 0 0 30px #ff4d4d;
  }
  100% {
    box-shadow: 0 0 5px #ff4d4d;
  }
}

.top-red {
  background: #ff4d4d;
  color: white;
  font-weight: bold;
  animation: glow-red 1.5s infinite ease-in-out;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px gold;
  }
  50% {
    box-shadow: 0 0 20px gold, 0 0 30px gold;
  }
  100% {
    box-shadow: 0 0 5px gold;
  }
}

.top1 {
  background: gold;
  font-weight: bold;
  animation: glow 1.5s infinite ease-in-out;
  position: relative;
}

.top2 {
  background: silver;
  font-weight: bold;
}

.top3 {
  background: #cd7f32;
  font-weight: bold;
  color: white;
}

.numero {
  font-weight: 800;
  color: gold;
  margin-right: 8px;
  width: 32px;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.valore {
  width: 28px;
  color: gold;
  text-align: left;
  margin-left: -10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}


.bracket-container{
    display:flex;
    justify-content:space-between;
    gap:30px;

    overflow-x:auto;

    padding:20px 0;
}

.bracket-round{

    min-width:280px;

    display:flex;
    flex-direction:column;

    gap:25px;
}

.bracket-round h2{

    text-align:center;

    margin-bottom:10px;
}

.bracket-match{

    background:#111;

    border:1px solid #333;

    border-radius:12px;

    padding:12px;
}

.bracket-team{

    display:grid;

    grid-template-columns:45px 1fr 30px;

    align-items:center;

    gap:10px;

    padding:6px 0;
}

.bracket-team img{

    width:38px;

    height:38px;

    object-fit:contain;
}

.bracket-team span{

    font-weight:600;
}

.bracket-team strong{

    text-align:right;

    font-size:18px;
}


/* Bottone Fase Finale */
button[data-target="faseFinale"]{
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #111;
  font-weight: 700;

  animation: finaleGlow 2s ease-in-out infinite;

  box-shadow:
    0 0 8px rgba(255,215,0,.5),
    0 0 18px rgba(255,215,0,.35);

  transition: .2s;
}

button[data-target="finale"]:hover{
  transform: scale(1.06);
}

@keyframes finaleGlow{
  0%{
    box-shadow:
      0 0 6px rgba(255,215,0,.4),
      0 0 12px rgba(255,215,0,.3);
  }

  50%{
    box-shadow:
      0 0 16px rgba(255,215,0,.9),
      0 0 35px rgba(255,215,0,.7);
  }

  100%{
    box-shadow:
      0 0 6px rgba(255,215,0,.4),
      0 0 12px rgba(255,215,0,.3);
  }
}

.rigori{
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: gold;
  margin: 6px 0;
}


.champions-banner{
    width:100%;
    max-width:900px;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:20px;

    margin:10px 0 20px;

    padding:15px;

    background:linear-gradient(90deg,#1b1b1b,#2b2b2b,#1b1b1b);

    border:2px solid gold;
    border-radius:14px;

    box-shadow:0 0 20px rgba(255,215,0,.35);
}

.champions-logo{
    width:90px;
    height:90px;
    object-fit:contain;
}

.champions-title{
    font-size:15px;
    color:gold;
    font-weight:700;
    letter-spacing:2px;
}

.champions-team{
    font-size:28px;
    font-weight:800;
}

.cup{
    font-size:34px;
}


#winnerIntro{

    position:fixed;
    inset:0;

    background:#111;

    display:flex;
    justify-content:center;
    align-items:center;

    z-index:99999;

    animation:introFade 4s forwards;
}

.intro-content{

    text-align:center;

    animation:introZoom 3s ease;
}

.intro-content img{

    width:180px;
    margin:20px 0;

    filter:drop-shadow(0 0 18px gold);
}

.intro-cup{

    font-size:70px;
}

.intro-content h2{

    color:gold;

    letter-spacing:4px;
}

.intro-content h1{

    font-size:48px;

    margin:10px 0;
}

.intro-content p{

    font-size:20px;
}

@keyframes introZoom{

    from{
        transform:scale(.7);
        opacity:0;
    }

    to{
        transform:scale(1);
        opacity:1;
    }

}

@keyframes introFade{

    0%,80%{
        opacity:1;
        visibility:visible;
    }

    100%{
        opacity:0;
        visibility:hidden;
    }

}

/* 📱 MOBILE FIX */
@media (max-width: 600px) {
 
  nav {
    gap: 8px;
  }

  nav button {
    flex: 0 0 calc(50% - 8px);
  }

  button {
    width: 100%;
  }

  section {
    border-radius: 0;
    max-width: 100%;
  }

  table {
    font-size: 12px;
  }

  .sponsors-bar {
    gap: 8px;
    padding: 6px 4px;
  }

  .sponsors-bar img {
    height: 80px;      /* più piccoli */
    max-width: 300px;
    object-fit: contain;
  }

   table {
    font-size: 12px;
  }

  .team-logo {
    width: 40px;
    height: 40px;
    padding: 0 !important;
  }

  td, th {
    padding: 4px;
  }

  nav button.active-btn {
    transform: none;
  }

  .team-cell span {
    font-size: 12px;
  }

  table td {
    font-size: 13px;
  }

  #calendario .team span {
    font-size: 14px;
  }

  #calendario .score {
    font-size: 30px;
  }

  #calendario .giornata-btn {
    font-size: 14px;
  }
  
  .bracket-container{

    justify-content:flex-start;

    gap:25px;
}

.bracket-round{

    min-width:240px;
}

@media(max-width:600px){

.champions-banner{
    gap:10px;
    padding:10px;
}

.champions-logo{
    width:60px;
    height:60px;
}

.champions-team{
    font-size:18px;
}

.champions-title{
    font-size:11px;
}

.cup{
    font-size:24px;
}

}


}