/* Palmarés dinámico de la portada */
.palmares-filters {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: -12px auto 42px;
  padding: 7px;
  gap: 7px;
  overflow-x: auto;
  border: 1px solid rgba(11, 102, 119, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 35px rgba(25, 34, 41, .09);
  scrollbar-width: none;
}

.palmares-filters::-webkit-scrollbar { display: none; }

.palmares-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #52616a;
  font: 800 14px/1.2 "Montserrat", sans-serif;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.palmares-filter:hover {
  color: #0b6677;
  transform: translateY(-1px);
}

.palmares-filter:focus-visible {
  outline: 3px solid rgba(11, 102, 119, .25);
  outline-offset: 2px;
}

.palmares-filter.is-active {
  color: #fff;
  background: linear-gradient(135deg, #0b6677, #16889a);
  box-shadow: 0 8px 20px rgba(11, 102, 119, .25);
}

.palmares-filter[data-palmares-filter="caporales"].is-active {
  background: linear-gradient(135deg, #542171, #8a3da5);
  box-shadow: 0 8px 20px rgba(84, 33, 113, .24);
}

.palmares-filter[data-palmares-filter="infantil"].is-active {
  background: linear-gradient(135deg, #dc7217, #f29c38);
  box-shadow: 0 8px 20px rgba(220, 114, 23, .24);
}

.palmares-filter-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(11, 102, 119, .09);
  font-size: 14px;
}

.palmares-filter.is-active .palmares-filter-icon {
  background: rgba(255, 255, 255, .18);
}

.palmares-panel {
  --palmares-accent: #0b6677;
  position: relative;
  padding: 34px;
  overflow: hidden;
  border: 1px solid rgba(11, 102, 119, .1);
  border-radius: 30px;
  background: linear-gradient(145deg, #fff 55%, rgba(11, 102, 119, .05));
  box-shadow: 0 22px 55px rgba(26, 38, 44, .1);
}

.palmares-panel[data-palmares-theme="caporales"] {
  --palmares-accent: #6d2b86;
  background: linear-gradient(145deg, #fff 55%, rgba(109, 43, 134, .06));
}

.palmares-panel[data-palmares-theme="infantil"] {
  --palmares-accent: #df791e;
  background: linear-gradient(145deg, #fff 55%, rgba(223, 121, 30, .07));
}

.palmares-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--palmares-accent);
}

.palmares-panel-heading {
  margin-bottom: 26px;
  text-align: center;
}

.palmares-panel-kicker {
  display: block;
  margin-bottom: 6px;
  color: #78858c;
  font: 800 11px/1.2 "Montserrat", sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.honors-category.palmares-panel > h3,
.palmares-panel-heading h3 {
  margin: 0;
  color: var(--palmares-accent);
  font-size: clamp(25px, 3vw, 34px);
}

.palmares-panel .honor-column {
  border-top-color: var(--palmares-accent);
}

.palmares-panel .honor-item img {
  border-color: var(--palmares-accent);
}

.palmares-panel .honor-item span {
  color: var(--palmares-accent);
}

.palmares-loading,
.palmares-empty {
  grid-column: 1 / -1;
  padding: 42px 24px;
  border: 1px dashed rgba(11, 102, 119, .22);
  border-radius: 22px;
  color: #68767d;
  background: rgba(255, 255, 255, .72);
  text-align: center;
  line-height: 1.6;
}

.palmares-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--palmares-accent, #0b6677);
  font: 800 19px/1.3 "Montserrat", sans-serif;
}

.historic-table-section {
  background:
    radial-gradient(circle at 90% 5%, rgba(244, 195, 58, .12), transparent 24%),
    #fff;
}

.palmares-filters-compact {
  margin-top: -18px;
  margin-bottom: 28px;
}

.palmares-filters-compact .palmares-filter {
  min-height: 42px;
  padding: 9px 17px;
  font-size: 13px;
}

.palmares-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 24px;
}

.palmares-summary-item {
  padding: 16px 18px;
  border: 1px solid #e9edef;
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  text-align: center;
  box-shadow: 0 8px 22px rgba(26, 38, 44, .06);
}

.palmares-summary-item strong {
  display: block;
  color: #0b6677;
  font: 800 24px/1 "Montserrat", sans-serif;
}

.palmares-summary-item span {
  display: block;
  margin-top: 6px;
  color: #758087;
  font-size: 12px;
  font-weight: 700;
}

.historic-table-wrapper {
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(22, 34, 40, .11);
}

.historic-table {
  box-shadow: none;
}

.historic-table thead th {
  background: linear-gradient(135deg, #095f70, #0d788a);
  white-space: nowrap;
}

.historic-table tbody tr {
  transition: background .2s ease, transform .2s ease;
}

.historic-table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.historic-table tbody tr:hover {
  background: #fff8df;
}

.historic-table td:first-child {
  width: 70px;
}

.palmares-rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #0b6677;
  background: #e8f4f6;
  font: 800 14px/1 "Montserrat", sans-serif;
}

.historic-table tr:nth-child(1) .palmares-rank {
  color: #735900;
  background: #ffe775;
}

.historic-table tr:nth-child(2) .palmares-rank {
  color: #596168;
  background: #e4e8eb;
}

.historic-table tr:nth-child(3) .palmares-rank {
  color: #7b431d;
  background: #efd0b5;
}

.palmares-group-cell {
  display: flex;
  align-items: center;
  min-width: 260px;
  gap: 12px;
}

.palmares-group-cell img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 2px solid #dce9ec;
  border-radius: 50%;
  background: #fff;
}

.palmares-group-cell strong,
.palmares-group-cell small {
  display: block;
}

.palmares-group-cell small {
  margin-top: 3px;
  color: #8a9499;
  font-size: 11px;
  font-weight: 600;
}

.historic-table .palmares-total {
  color: #0b6677;
  font-size: 17px;
  font-weight: 800;
}

.palmares-table-message td {
  padding: 42px 18px;
  color: #68767d !important;
  text-align: center !important;
}

@media (max-width: 760px) {
  .palmares-filters {
    justify-content: flex-start;
    width: calc(100% + 20px);
    margin-left: -10px;
    padding: 6px;
    border-radius: 18px;
  }

  .palmares-filter {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .palmares-filter-icon { display: none; }

  .palmares-panel {
    padding: 27px 18px 24px;
    border-radius: 23px;
  }

  .palmares-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px 1px 8px;
  }

  .palmares-summary-item {
    padding: 13px 10px;
  }

  .palmares-summary-item strong { font-size: 21px; }

  .historic-table-wrapper {
    margin-right: -8px;
    margin-left: -8px;
    border-radius: 18px;
  }

  .historic-table th,
  .historic-table td {
    padding: 12px 10px;
  }

  .table-medal-label { display: none; }
  .palmares-group-cell { min-width: 210px; }
}
