
html > body > main {
    max-width: 1920px;
    margin-top: 100px;
}
 
 .tournaments-header{
     width: 100%;
    text-align: center;
 }

 .tournaments-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(200px, 25%), 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tournament-card,
.tournament-card-body {
  border-radius: var(--lumo-border-radius-xl);
  background-color: #363636;
}

.tournament-card-body {
   padding: 0 1rem;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: space-between;
}

.tournament-card-body h3 {
  margin: 0;
  text-align:center;
  font-size:1.125rem;
}

.tournament-card-body p {
  text-align: center;
}

.tournament-card img {
  width: 100%;
  border-radius: var(--lumo-border-radius-xl) var(--lumo-border-radius-xl) 0 0;
  margin-bottom: 0.5rem;
}

.end-date {
  font-size: 1rem;
  color: yellow;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 0;
}


.tournament-card {
  box-shadow: var(--lumo-box-shadow-xs);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.tournament-card.hidden {
  display: none;
}

.tournament-card:hover {
  box-shadow: var(--lumo-box-shadow-s);
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.plus-icon {
  width: 24px !important;
  height: 24px;
  position: absolute;
  right: 0.5rem;
  bottom: 0;
}

.tournaments-filter-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tournaments-filter-buttons button {
  background-color: #363636;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  border-radius: var(--lumo-border-radius-s);
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.tournaments-filter-buttons button:hover,
.tournaments-filter-buttons button.active {
  background-color: #ed2828;
}

/* ── tournaments content ── */
.tournaments-content {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #363636;
  border-radius: var(--lumo-border-radius-xl);
  color: #fff;
}

.tournaments-content h2 {
  font-size: 1.1rem;
  text-align: left;
  margin: 1.5rem 0 0.75rem;
  color: #fff;
}

.tournaments-content h2:first-of-type {
  margin-top: 0;
}

.tournaments-content p {
  margin: 0 0 1rem !important;
  padding: 0 !important;
  line-height: 1.6;
  font-size: 1rem;
}

.tournaments-content a {
  color: #ed2828;
  text-decoration: none;
}

.tournaments-content a:hover {
  text-decoration: underline;
}

.tournaments-list {
  padding-left: 1.25rem;
  margin: 0.75rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tournaments-list li {
  line-height: 1.6;
  font-size: 1rem;
}

.tournaments-tyc{
    width: 100%;
    text-align: center;
    margin: 20px;
}
/* ── Button  winners table  ── */

.tournament-position-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 20%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.4rem;
  transition: background-color 0.2s ease;
}

.tournament-position-btn:hover {
  background: #333;;
}

.tournament-position-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: latido 2s ease-in-out infinite;
}


/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay[aria-hidden="true"] {
  display: none;
}
.modal-overlay .modal-container {
  animation: modal-main 0.4s ease forwards;
}
/* ── Modal box ── */
.modal-container {
  background-color: #363636;
  border-radius: var(--lumo-border-radius-xl);
  box-shadow: var(--lumo-box-shadow-s);
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Close button ── */
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding-top: .3em;
  background: #1f1f1f;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 1;
}

.modal-close:hover {
  background-color: #ed2828;
}

/* ── Scrollable content ── */
.modal-content {
  overflow-y: auto;
  padding: 2rem 1.5rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: #ed2828 #1f1f1f;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: #1f1f1f;
  border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: #ed2828;
  border-radius: 3px;
}

/* ── Title ── */
.modal-content h2 {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  color: #fff;
  text-align: center;
  padding-right: 1.5rem; /* evita solaparse con el botón X */
  margin-top:20px;
}

/* ── Table ── */
.tyc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  color: #fff;
}

.tyc-table tr {
  border-bottom: 1px solid #1f1f1f;
}

.tyc-table tr:last-child {
  border-bottom: none;
}
.tyc-table tr:nth-child(odd) {
  background-color: #f3f3f3c2;
}
.tyc-table th {
  font-weight: 600;
  white-space: nowrap;
  width: 35%;
}
.tyc-table tr:nth-child(odd) th {
  color: #060606;
}
.tyc-table tr:nth-child(even) th {
  color: #ffffff;
}
.tyc-table td {
  line-height: 1.5;
  text-align:justify;
}

.tyc-table td p {
  margin: 0 0 0.5rem;
}
.tyc-table td p:last-child {
  margin-bottom: 0;
}


.bannerTorneos {
   width: 100%;
  max-width: 1100px;
  margin: 0 auto 20px;
  border-radius: 12px;
  overflow: hidden;
  height: 300px;
}

/* ── Banner ── */
.bannerTorneos picture,
.bannerTorneos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ── Mobile ── */

@media (max-width: 920px) {
    .tournaments-container{
        grid-template-columns: repeat(2,1fr);
    }
}
@media (max-width: 720px) {
   .bannerTorneos {
      height:auto;
   }
  /* Reset herencia del CMS */
  .tyc-table,
  .tyc-table tbody,
  .tyc-table tr,
  .tyc-table th,
  .tyc-table td {
    display: revert;
    width: revert;
    text-align: revert;
    float: none;
  }

  .tyc-table tbody tr td::before {
    content: none;
    display: none;
    width: auto;
  }

  /* th centrado, ancho completo */
  .tyc-table th {
    display: block;
    width: 100%;
    text-align: center;
    white-space: normal;
    padding: 1em 0.75em 0.25em;
  }

  /* td centrado debajo */
  .tyc-table td {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.25em 0.75em 0.75em;
  }
}

@media all and (max-width: 480px) {
  .tournaments-container {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .tournaments-filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 20px;
  }

}



@keyframes modal-main {
  0% {
    opacity: 0;
    transform: translateY(100px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}