html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  background-image: url('recursos/fondo.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: repeat;
}

.hidden {
  display: none;
}

.header-box {
  border: 1px solid #ccc;
  background-color: #e0e0e0;
  padding: 15px;
  text-align: center;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-box h1 {
  margin: 0;
  font-size: 24px;
  font-weight: normal;
}

#modeSelection {
  text-align: center;
  margin-top: 30px;
}

#modeSelection p {
  font-size: 18px;
  margin-bottom: 15px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.input-group label {
  font-size: 16px;
  white-space: nowrap;
}

.input-group input[type="number"] {
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  width: 100px;
}

#nameInputs,
#elimNameInputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

#nameInputs input,
#elimNameInputs input {
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

#elimNameInputs p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
}

#nextToRounds,
#nextToElimBracket {
  margin-top: 15px;
}

#rondaSetup {
  margin-top: 20px;
}

#rondaSetup label {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  font-weight: 500;
}

#rondaSetup input[type="number"] {
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  width: 100px;
  margin-left: 10px;
}

#matches {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

.round-block {
  width: 48%;
  padding: 15px;
  box-sizing: border-box;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  background-color: #f9f9f9;
}

.round-block h3 {
  text-align: center;
  background-color: #e0e0e0;
  border: 1px solid #ccc;
  padding: 10px;
  margin: 0 0 15px 0;
  border-radius: 6px;
  font-weight: normal;
}

.round-block div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

input[type="number"] {
  width: 60px;
}

input.winner {
  background-color: #d0f0ff;
}

input.loser {
  background-color: #ffd6d6;
}

table {
  border-collapse: collapse;
  width: 60%;
  margin: 20px auto;
  text-align: center;
  font-size: 16px;
}

th, td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

th {
  background-color: #f0f0f0;
}

#tournament h2,
#tournament h3 {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  margin-top: 30px;
  margin-bottom: 10px;
  color: #333;
}

.match-player-name {
  font-weight: normal;
  transition: font-weight 0.2s ease;
}

.match-player-name.highlight {
  font-weight: bold;
}

#tools-tab {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background-color: #ccc;
  padding: 8px 12px;
  border-radius: 0 50% 50% 0;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  user-select: none;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  transition: background-color 0.3s, width 0.3s, height 0.3s;
  width: 30px;
  height: 30px;
}

#tools-tab.expanded {
  width: 170px;
  height: 30px;
  border-radius: 0 10px 0 0;
  text-align: center;
  padding-left: 0;
}

#tools-panel {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(10%);
  width: 150px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 999;
  text-align: center;
  display: none;
}

#tools-tab:hover {
  background-color: #bbb;
}

#timer-display {
  font-family: 'Courier New', monospace;
  font-size: 32px;
  text-align: center;
  margin-bottom: 10px;
}

#tools-panel input[type="number"] {
  width: 60px;
  margin: 5px 0;
  padding: 4px;
}

.elim-round {
  margin-top: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.elim-round h3 {
  text-align: center;
  font-weight: normal;
  margin-bottom: 20px;
}

.elim-match {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.elim-match .winner {
  background-color: #d0f0ff !important;
}

.elim-match .loser {
  background-color: #ffd6d6 !important;
}

.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap; 
  padding: 10px 0;
  flex-shrink: 1;
}

.main-nav a img {
  max-height: 40px; 
  height: auto;
  width: auto;
}

.main-nav a.active img {
  filter: drop-shadow(0 0 8px #444); 
  transform: scale(1.05);
}


.main-nav a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.main-nav a:hover {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); 
  transition: all 0.2s ease;
}

.profile-container {
  padding: 20px;
}

.profile-format-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.profile-format-buttons button.active {
  background-color: #d0eaff;
  font-weight: bold;
}

.profile-section {
  margin-top: 30px;
}

.profile-section .format-title {
  margin-top: 40px;
  text-align: center;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  justify-content: center;
}

.profile-card {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.profile-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.profile-card h3 {
  margin-top: 0;
  font-size: 18px;
  color: #333;
}

.profile-card p {
  font-size: 14px;
  color: #555;
}

.deck-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.descargar-link {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #f2f2f2;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s ease;
}

.descargar-link:hover {
  background-color: #e0e0e0;
}

.deck-list {
  margin-top: 10px;
  background-color: #fff;
  border: 1px dashed #aaa;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  color: #333;
}

.deck-list p {
  margin: 0 0 10px 0;
  white-space: pre-line;
}

.miniatura {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  border: 2px solid #ccc;
  transition: transform 0.2s;
}

.miniatura:hover {
  transform: scale(1.03);
}

.imagen-grande-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.imagen-grande-contenedor img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px #000;
}

.deck-imagen-contenedor {
  width: 100%;
  overflow: hidden;
  max-height: 200px;
  transition: max-height 1.3s ease, padding 1.3s ease;
  position: relative;
  padding-bottom: 0;
}

.deck-imagen-contenedor.expandido {
  max-height: 1000px;
  padding-bottom: 10px;
}

.deck-imagen {
  width: 100%;
  display: block;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.4s ease;
  opacity: 1;
}

.deck-imagen.fade-out {
  opacity: 0;
}

.fade-out {
  opacity: 0.4;
}

.footer-box {
  border: 1px solid #ccc;
  background-color: #e0e0e0;
  padding: 15px;
  text-align: center;
  margin-top: 40px;
  border-radius: 6px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.footer-box p {
  margin: 0 0 6px;
  font-size: 15px;
}

.footer-box .social-links {
  font-size: 14px;
}

.footer-box .social-links a {
  color: #333;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s ease;
}

.footer-box .social-links a:hover {
  color: #0077cc;
  text-decoration: underline;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tabla-eventos {
  width: 100%;
  max-width: 1000px;
  margin: 40px auto;
  border-collapse: separate;
  border-spacing: 0 30px;
}

.tabla-eventos td {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 25px;
  vertical-align: top;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tabla-eventos .titulo {
  text-align: center;
  font-size: 20px;
  margin-bottom: 15px;
  color: #333;
}

.tabla-eventos .contenido {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.tabla-eventos .descripcion {
  flex: 1 1 300px;
  font-size: 16px;
  color: #444;
}

.tabla-eventos .banner {
  flex: 1 1 300px;
}

.tabla-eventos .banner img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.tabla-eventos .extra {
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
  color: #555;
}

.mode-button:active {
  background-color: #d0d0d0;
}

.format-title img {
  width: 100%;
  max-width: 600px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.profile-search input {
  padding: 8px 12px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 300px;
}

.tabla-inicio {
  width: 100%;
  max-width: 900px;
  margin: 30px auto;
  border-collapse: separate;
  border-spacing: 0;
}

.tabla-inicio td {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.logo-central {
  display: block;
  margin: 20px auto 10px auto;
  max-width: 240px;
  height: auto;
}

button {
  padding: 6px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  background-color: #f2f2f2;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.main-nav a img {
  height: 40px;
  transition: transform 0.2s ease, filter 0.2s ease;
  user-select: none;
  pointer-events: auto;
}

.main-nav a:hover img {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

#scoreboard table {
  width: 100%;
  border-collapse: collapse;
  background-color: #222; 
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

#scoreboard th,
#scoreboard td {
  padding: 10px;
  text-align: center;
  border: 1px solid #555;
}

#scoreboard th {
  background-color: #333;
  font-weight: bold;
}

#scoreboard tr:nth-child(even) {
  background-color: #2a2a2a;
}

.otros-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 20px;
}

.otros-item {
  flex: 1 1 calc(33.33% - 40px);
  max-width: 400px;
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}

.otros-item iframe,
.otros-item img {
  width: 100%;
  border-radius: 10px;
}

.img-responsiva {
  max-width: 100%;
  height: auto;
}

.qa-card {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.qa-card h3 {
  text-align: center;
  font-size: 18px;
  color: #333;
}

.qa-card p {
  font-size: 14px;
  color: #555;
  text-align: left;
}

.alineado-match {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  width: 100%;
}

.alineado-match .match-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  justify-content: flex-end;
}

.alineado-match .match-side.right {
  justify-content: flex-start;
}

.match-name {
  white-space: nowrap;
  text-align: right;
}

.match-side.right .match-name {
  text-align: left;
}

.alineado-match input[type="number"] {
  width: 40px;
  text-align: center;
}

.vs-label {
  min-width: 30px;
  text-align: center;
}

.round-block button {
  display: block;
  margin: 20px auto 0 auto;
}

#modeSelection {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.modo-torneo {
  flex: 1 1 400px;
  max-width: 420px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#torneos table {
  table-layout: fixed;
  width: 100%;
  word-wrap: break-word;
}

#torneos img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

#tabla1, #tabla2, #tabla3 {
    padding: 20px;
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 10px;
    border-collapse: separate; 
    border: none;
    box-shadow: none;  
}

#tabla1 td, #tabla2 td, #tabla3 td {
    border: none;
}


#tabla1 img, #tabla2 img, #tabla3 img {
    max-width: 100%; 
    max-height: 100%;
    display: block;
    object-fit: contain; 
}

.top-bar {
  position: fixed;
  top: 0;
  right: 0;
  padding: 10px;
  background-color: #333;
  color: white;
  font-size: 16px;
  z-index: 1000;
}

.nav-link {
  color: white;
  text-decoration: none;
  margin: 0 10px;
}

.nav-link:hover {
  text-decoration: underline;
}

.thumbnail {
    max-width: 100px;
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
  }

  .card {
    text-align: center;
  }

  .card p {
    display: none; 
  }

@keyframes shake {
  0% { transform: translate(0px, 0px) rotate(0deg); }
  20% { transform: translate(-2px, 1px) rotate(-1deg); }
  40% { transform: translate(-1px, -2px) rotate(1deg); }
  60% { transform: translate(2px, 1px) rotate(0deg); }
  80% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

.thumbnail {
  transition: transform 0.2s ease;
}

.thumbnail:hover {
  animation: shake 0.4s; 
}

.sobre-thumbnail {
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.sobre-thumbnail:hover {
  animation: shake 0.4s;
}

#modalDescription {
  font-size: 18px;
  line-height: 1.6;
  color: #000; 
  font-family: Arial, sans-serif;
}

#modalExtraText {
  font-size: 18px;
  line-height: 1.6;
  color: #000;
  font-family: Arial, sans-serif;
}

.tablas-banlist {
  width: 100% !important;
  max-width: 900px !important;
  box-sizing: border-box;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin: 20px auto;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 20px;
}

.floating-image-container {
      position: fixed;
      top: 50%;
      right: 0;
      transform: translateY(-50%) rotate(-10deg);
      transform-origin: center;
      perspective: 1000px;
      z-index: 9999;
      pointer-events: none;
    }

    .image-wrapper {
      width: 200px;
      height: auto;
      cursor: pointer;
      transform-style: preserve-3d;
      transition: transform 0.8s ease;
      pointer-events: auto;
      position: relative;
    }

    .image-wrapper.flipped {
      transform: rotateY(180deg) rotate(0deg);
    }

    .image-face {
      position: absolute;
      width: 100%;
      backface-visibility: hidden;
      pointer-events: auto;
    }

    .image-front, .image-back {
      width: 100%;
    }

    .image-back {
      transform: rotateY(180deg);
    }

.sobres-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  justify-content: center;
}

.starters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  justify-content: center;
}

.structures-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  justify-content: center;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  #nameInputs,
  #elimNameInputs {
    grid-template-columns: 1fr;
  }

  .round-block {
    width: 100%;
  }

  .main-nav {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  #modeSelection {
    flex-direction: column;
    align-items: center;
  }

  .modo-torneo {
    width: 90%;
    max-width: 500px;
  }

  #torneos .modo-torneo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto 10px;
  }

  #myModal > div {
    flex-direction: column;
    max-width: 95%;
  }

  #modalDescription {
    padding-left: 0;
    font-size: 16px;
  }

  #modalImage {
    display: block;
    margin: 0 auto;
    width: 60%;
  }

  #prevPageBtn, #nextPageBtn {
    bottom: -50px;
  }

  .banlist1,
  .banlist2 {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  #modalExtraText {
    font-size: 16px;
  }

  .sobres-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .floating-image-container {
    transform: rotate(-12deg) scale(0.6);
    right: -60px;
    top: 600px;
  }

  .starters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .structures-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reprints-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabla-inicio {
    width: 100% !important;
    display: block;
  }

  .tabla-inicio td {
    display: block;
    padding: 0 10px;
  }

  .tabla-inicio iframe {
    height: 200px;
  }

  #testModal > div {
    flex-direction: column !important;
    max-width: 90% !important;
    padding: 15px !important;
  }

  #testModalImage {
    width: 100% !important;
    max-height: 300px !important;
    margin-bottom: 15px;
    align-self: center !important;
  }

  #testModalDescription {
    padding-left: 0 !important;
  }

  #testModalGallery img {
    width: 35px !important; /* más pequeñas en celular */
  }

  #testModalGallery > div {
    justify-content: center !important;
  }
}

/*.contenido-tab {
  margin-top: 15px;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  display: none;           
  overflow: hidden;         
} */

.bloque-expansiones {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  background-color: white;
  margin-top: 20px;
}

.banlist-box {
  display: flex;
  align-items: center;
  gap: 20px;
}

.banlist-img {
  width: 150px;
  height: auto;
  border-radius: 10px;
}

.banlist-texto {
  flex: 1;
  text-align: left;
}

.boton-ver-mas {
  display: block;
  margin-top: 10px;
  text-align: left;
}

.centrar-boton {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

img {
  user-select: none;
  -webkit-user-drag: none;
}
