/* =========================================================
   CLASSIFICACIÓ FS PARETS
========================================================= */


/* =========================================================
   TARGETES
========================================================= */

.classificacio-card {
  width: 100%;
  margin-bottom: 30px;
  background: #fff;
  border: none;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.classificacio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}


/* =========================================================
   TÍTOLS DE LES TARGETES
========================================================= */

.classificacio-card h2 {
  padding: 20px;
  margin: 0;

  border-left: 5px solid #c8102e;
  border-bottom: 1px solid #eee;

  font-size: 28px;
  font-weight: 700;
}


/* =========================================================
   ÚLTIM PARTIT
========================================================= */

.resultats-card {
  width: 100%;
}


/* Contenidor del partit */

.partit-resultat {
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  align-items: center;
  gap: 15px;
  padding: 22px 25px;
  text-align: center;
}

/* Equip */

.partit-equip {
  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 12px;

  min-width: 0;
}


/* Nom equip */

.partit-equip span {
  font-size: 16px;

  font-weight: 700;

  line-height: 1.3;

  text-align: center;

  max-width: 260px;
}


/* Escut */

.escut-partit {
  width: 80px;
  height: 80px;

  object-fit: contain;

  flex-shrink: 0;
}


/* Resultat */

.partit-marcador {
  display: flex;

  align-items: center;
  justify-content: center;

  font-size: 38px;

  font-weight: 800;

  line-height: 1;

  white-space: nowrap;
}


/* =========================================================
   ALTRES RESULTATS
========================================================= */

.btn-altres-resultats {
  display: block;

  margin: 0 auto 15px;

  padding: 10px 18px;

  background: #ffd200;

  border: none;

  cursor: pointer;

  font-weight: 700;

  font-size: 12px;

  text-transform: uppercase;
}

.btn-altres-resultats:hover {
  background: #e8c000;
}

.altres-resultats {
  padding: 15px;
}


/* =========================================================
   CLASSIFICACIÓ - TAULA
========================================================= */

.table-responsive {
  width: 100%;

  overflow-x: auto;
}


.standings {
  width: 100%;

  border-collapse: collapse;

  background: #fff;
}


.standings th {
  background: #e1e2e8;

  padding: 12px;

  font-size: 13px;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  text-align: center;
}


.standings td {
  padding: 12px;

  border-bottom: 1px solid #e1e2e8;

  text-align: center;
}


/* Hover */

.standings tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}


/* Equip */

.standings th:nth-child(2),
.standings td:nth-child(2) {
  text-align: left;

  padding-left: 20px;

  font-weight: 400;

  white-space: nowrap;
}


/* Equip + escut */

.standings td.team {
  display: flex;

  align-items: center;

  gap: 10px;
}


/* Escut de la classificació */

.standings .escut {
  width: 36px;
  height: 36px;

  object-fit: contain;

  flex-shrink: 0;
}


/* Destacar Parets */

.standings tr.parets td {
  font-weight: 700;
}


/* =========================================================
   COLORS CLASSIFICACIÓ
========================================================= */

.posicio-amb-color {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 28px;
  min-height: 28px;
  padding: 2px 4px;
  border-radius: 6px;
  background-color: color-mix(in srgb, var(--color-posicio) 20%, white);
  box-shadow: inset 0 -3px var(--color-posicio);
  color: #162137;
  font-weight: 700;
}

.standings tbody tr {
  border-left: 4px solid transparent;
}

/* =========================================================
   CLASSIFICACIÓ MÒBIL
========================================================= */

.classificacio-mobile-wrapper {
  display: none;
}

.equip-mobile {
  background: #fff;
  border: 1px solid #e1e2e8;
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.equip-mobile-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.equip-mobile-posicio {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #5b6472;
}

.equip-mobile-equip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.equip-mobile-escut {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.equip-mobile-equip span {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
  min-width: 0;
  overflow-wrap: anywhere;
}

.equip-mobile-punts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.equip-mobile-punts small {
  font-size: 8px;
  font-weight: 700;
  color: #7a818c;
  letter-spacing: 0.04em;
}

.equip-mobile-punts strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.equip-mobile-toggle {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f2f5;
  color: #c8102e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.equip-mobile-toggle i {
  font-size: 12px;
}

/* PARETS */

.equip-mobile.parets .equip-mobile-header {
  background: transparent;
}

.equip-mobile.parets .equip-mobile-posicio,
.equip-mobile.parets .equip-mobile-punts strong {
  color: inherit;
}

.equip-mobile.parets .equip-mobile-equip span {
  font-weight: 700;
}

/* DETALLS */

.equip-mobile-detalls {
  border-top: 1px solid #e8e9ed;
  padding: 12px;
  background: #fafafa;
}

.equip-mobile-estadistiques {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.equip-mobile-estadistiques > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e1e2e8;
  border-radius: 8px;
  padding: 7px 3px;
}

.equip-mobile-estadistiques span {
  font-size: 9px;
  font-weight: 700;
  color: #7a818c;
}

.equip-mobile-estadistiques strong {
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}

.equip-mobile-ultims {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e1e2e8;
}

.equip-mobile-ultims-titol {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7a818c;
}

.equip-mobile-ultims .ultims-resultats {
  justify-content: flex-end;
}

/* =========================================================
   MÒBIL
========================================================= */

@media (max-width: 768px) {

  /* TARGETES */

  .classificacio-card {
    margin: 0 10px 20px;
    border-radius: 20px;
  }


  /* TÍTOLS */

  .classificacio-card h2 {
    font-size: 20px;
    line-height: 1.3;
    padding: 18px;
  }


  /* =====================================
     ÚLTIM PARTIT
  ===================================== */

  .partit-resultat {
    grid-template-columns: 1fr 80px 1fr;
    gap: 10px;
    padding: 20px 12px;
  }

  .escut-partit {
    width: 60px;
    height: 60px;
  }

  .partit-equip span {
    font-size: 13px;
    line-height: 1.3;
    max-width: 130px;
  }

  .partit-marcador {
    font-size: 28px;
  }


  /* =====================================
     CLASSIFICACIÓ MÒBIL
  ===================================== */

  .table-responsive {
    display: none;
  }

  .classificacio-mobile-wrapper {
    display: block;
  }


  /* =====================================
     ÚLTIMS RESULTATS
  ===================================== */

  .ultims-resultats {
    gap: 5px;
  }

  .ultim {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

}

/* =========================================
   ÚLTIMS RESULTATS
========================================= */

.ultims-resultats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.ultim {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.resultat-g {
  background: #4fc37d;
}

.resultat-e {
  background: #f5b82e;
}

.resultat-p {
  background: #e74c3c;
}

.resultat-buit {
  background: #d9dde2;
}

/* =========================================================
   CAPÇALERA EQUIP I COMPETICIÓ
========================================================= */

.classificacio-capcalera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;

  background: #fff;
  color: #14213d;
  border-radius: 18px;
  padding: 20px 28px;
  margin-bottom: 25px;

  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* NOM EQUIP */

.classificacio-capcalera h2 {
  color: #14213d;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

/* LÍNIA VERMELLA */

.classificacio-capcalera h2::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  background: #c8102e;
  margin: 10px 0 0;
  border-radius: 3px;
}

/* COMPETICIÓ */

.classificacio-competicio {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  text-align: right;
  margin-left: auto;
}

/* GRUP */

.classificacio-grup {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  text-align: right;
}

/* =========================================================
   MÒBIL
========================================================= */

@media (max-width: 768px) {

  .classificacio-capcalera {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 15px;
    margin-bottom: 20px;
    border-radius: 15px;
  }

  .classificacio-capcalera h2 {
    font-size: 22px;
    white-space: normal;
    text-align: center;
  }

  .classificacio-capcalera h2::after {
    margin: 10px auto 0;
  }

  .classificacio-competicio {
    font-size: 13px;
    text-align: center;
    margin-left: 0;
  }

  .classificacio-grup {
    font-size: 12px;
    text-align: center;
  }

}

/* =========================================================
   COMPETICIÓ I GRUP
========================================================= */

.classificacio-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
}

.classificacio-competicio,
.classificacio-grup {
  display: block;
  margin: 0;
  text-align: right;
}

@media (max-width: 768px) {

  .classificacio-info {
    align-items: center;
    margin-left: 0;
  }

  .classificacio-competicio,
  .classificacio-grup {
    text-align: center;
  }

}
