/* Establecer fondo fijo y que ocupe toda la altura */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  color-scheme: only light;
}

:root {
  color-scheme: only light;
}

main{
  flex: 1;
}
/* Fondo difuminado con imagen fija */
body {
  margin: 0;
  color: #fafafa;
  position: relative; /* Necesario para los pseudo-elementos */
  min-height: 100%; /* Asegura que el fondo cubra todo el contenido */
  background: url('../img/instalaciones.jpg') center/cover no-repeat fixed;
  background-size: cover;
  background-attachment: fixed; /* Hace que la imagen de fondo no se mueva al hacer scroll */
  font-family: "Montserrat", sans-serif;
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }
    
  /* Estilos generales */
  body {
    margin: 0;
    color: #0033a0;
  }
  
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0033a0;
    padding: 10px 20px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  header img {
    height: 80px; /* Ajusta este valor según lo pequeño que quieras el logo */
    width: auto;
    margin-right: 10px;
  }

 
  
footer {
  background-color: #0033a0;
  color: white;
  padding: 20px 5%;
  font-size: 14px;
}

.footer-container {
  display: flex;
  flex-direction: column; /* móvil por defecto */
  align-items: center;
  text-align: center;
  gap: 10px;
}

.footer-container .redes {
  order: -1;
}

.footer-container .autor {
  order: 1;
}

footer .autor a {
  color: #aad4ff;
  text-decoration: none;
}

footer .autor p {
  text-align: center; /*centrado en móvil*/
}

footer .autor a:hover {
  text-decoration: underline;
}

footer .redes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer .redes a img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  transition: transform 0.5s;
}

footer .redes a img:hover {
  transform: scale(1.5);
}

.icono-contacto {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 5px 0 10px;
}

/* Estilo en ordenador */
@media(min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .autor {
    max-width: 60%;
  }

  .autor p {
    text-align: right; /* alineación a la derecha en ordenador */
  }

  .redes {
    justify-content: flex-end;
  }
}


  
  @media (max-width: 768px) {
    .menu-toggle {
      display: flex;
    }
    .nav-menu {
      display: none;
      position: absolute;
      top: 60px;
      right: 20px;
      background-color: #0033a0;
      border: 2px solid white;
      border-radius: 10px;
      width: 200px;
      padding: 10px;
    }
    .nav-menu.active {
      display: block;
    }
    .nav-menu ul {
      flex-direction: column;
      gap: 10px;
    }
  }
  
.equipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 5rem;
  padding: 40px;
  max-width: 1200px;
  margin: 40px auto;
  box-sizing: border-box;
  transform: translateZ(0);
}

.card {
  perspective: 1000px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  transform-style: preserve-3d;
  overflow: visible;
  height: auto;
  display: flex;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  display: flex;
  flex-direction: column;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: white;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  word-wrap: break-word;
  font-size: clamp(0.5rem, 2.5vw, 0.8rem); /* ← Texto que se adapta al tamaño */
  line-height: 1.4;
}

.card-front img {
  max-width: 100%;
  height: auto;
}

.card-back {
  transform: rotateY(180deg);
  text-align: center;
}

.card-back a {
  display: inline-block;
  color: #0056b3;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 12px;
  border: 2px solid #0056b3;
  border-radius: 8px;
  background-color: white;
  transition: all 0.3s ease;
  font-size: clamp(0.5rem, 2vw, 0.8rem); /* Botón también adaptable */
}

.card-back a:hover {
  background-color: #0056b3;
  color: white;
  text-decoration: none;
  transform: scale(1.05);
}

@media screen and (max-width: 600px) {
  .equipos-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}


  
  .grupo {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
    box-sizing: border-box;
  }
  
  .grupo h1 {
    margin: 60px 0 20px;
    font-size: 2rem;
    text-align: center;
    color: #fafafa;
  }
  
  
  /* Contenedor con scroll horizontal si se necesita */
  .table-container {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0;
  }
  
  /* Estilos generales */
  th, td {
    border: 1px solid #dee2e6;
    padding: 8px;
    text-align: center;
    font-size: 14px;
  }
  
  th {
    background-color: #007bff;
    color: white;
    text-transform: uppercase;
    font-size: 13px;
  }
  
  tr:nth-child(even) {
    background-color: #f1f1f1;
  }
  
  tr:hover {
    background-color: #d0e3ff;
  }
  
  /* Responsive para móviles */
  @media (max-width: 600px) {
    th, td {
      padding: 6px;
      font-size: 13px;
    }
  
    table {
      font-size: 13px;
      font-family: "Montserrat", sans-serif;
    }
  }
  
  
  #contenedor-tarjetas {
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* Tarjeta individual */
  .tarjeta {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
  }
  
  /* Sección de los dos equipos */
  .equipos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
  }
  
  /* Cada equipo ocupa el 48% como máximo */
  .equipo {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48%;
    flex-shrink: 1;
    min-width: 0;
  }
  
  /* Nombre del equipo */
  .equipo strong {
    font-size: 1em;
    text-align: center;
    word-break: break-word;
  }
  
  /* Escudos adaptables */
  .equipo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
  }
  
  /* Resultado grande y centrado */
  .resultado {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
  }
  
  /* Información adicional */
  .info-extra {
    text-align: center;
    font-size: 0.9em;
    color: #555;
  }
  
  /* Adaptación para pantallas pequeñas */
  @media (max-width: 500px) {
    #contenedor-tarjetas {
      width: 95%;
    }
  
    .tarjeta {
      padding: 10px;
    }
  
    .equipo strong {
      font-size: 0.9em;
    }
  
    .equipo img {
      width: 45px;
      height: 45px;
    }
  
    .resultado {
      font-size: 1.5em;
    }
  
    .info-extra {
      font-size: 0.8em;
    }
  }
   /* Opacidad ajustable */
}


/* Estilo para los elementos de contenido */
header, footer, .equipos-grid, .card, .grupo, .table-container {
  position: relative;
  z-index: 1; /* Asegura que el contenido se muestra por encima del fondo difuminado */
}

/* Estilos generales */
body {
  margin: 0;
  color: #0033a0;
}

/* Animación de entrada para el header */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Header base */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0033a0;
  padding: 10px 20px;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown 0.5s ease-out;
}

/* Logo */
.logo {
  height: 50px;
}

/* Menú de navegación */
.nav-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100px;
  right: 20px;
  background-color: #0033a0;
  padding: 25px 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Menú desplegado */
.nav-menu.open {
  display: flex;
  margin-top: 10px;
  opacity: 1;
  transform: translateY(0);
}

/* Lista del menú */
.nav-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav-menu a:hover {
  color: #00a2ff;
  transform: scale(1.1);
}

/* Botón menú hamburguesa con imagen */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 35px; /* Igual que la altura del logo */
  height: 35px;
  padding: 0;
  position: relative;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Iconos dentro del botón */
.menu-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
}

/* Mostrar solo un icono según estado */
.menu-toggle .icono-cerrar {
  display: none;
}

.menu-toggle.open .icono-menu {
  display: none;
}

.menu-toggle.open .icono-cerrar {
  display: block;
}

/* Diseño escritorio */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    display: flex !important;
    flex-direction: row;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    transform: none;
  }

  .nav-menu ul {
    flex-direction: row;
    gap: 20px;
  }
}





table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

/* Contenedor con scroll horizontal si se necesita */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0;
}

/* Estilos generales */
.tabla-turnos table {
  width: 100%;
  border-collapse: collapse;
}

.tabla-turnos th, .tabla-turnos td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

/* Estilos de fondo para cada grupo de turno */
.tabla-turnos tbody tr:nth-child(1),
.tabla-turnos tbody tr:nth-child(2) {
  background-color: #e3f2fd; /* Turno 1 - azul claro */
}

.tabla-turnos tbody tr:nth-child(3),
.tabla-turnos tbody tr:nth-child(4) {
  background-color: #fce4ec; /* Turno 2 - rosa claro */
}

.tabla-turnos tbody tr:nth-child(5),
.tabla-turnos tbody tr:nth-child(6),
.tabla-turnos tbody tr:nth-child(7),
.tabla-turnos tbody tr:nth-child(8) {
  background-color: #e8f5e9; /* Turno 3 - verde claro */
}

.tabla-turnos tbody tr:nth-child(9),
.tabla-turnos tbody tr:nth-child(10),
.tabla-turnos tbody tr:nth-child(11),
.tabla-turnos tbody tr:nth-child(12) {
  background-color: #fff8e1; /* Turno 4 - amarillo claro */
}


/* Responsive para móviles */
@media (max-width: 600px) {
  th, td {
    padding: 6px;
    font-size: 13px;
  }

  table {
    font-size: 13px;
  }
}


#contenedor-tarjetas {
  width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tarjeta individual */
.tarjeta {
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Sección de los dos equipos */
.equipos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

/* Cada equipo ocupa el 48% como máximo */
.equipo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 48%;
  flex-shrink: 1;
  min-width: 0;
}

/* Nombre del equipo */
.equipo strong {
  font-size: 1em;
  text-align: center;
  word-break: break-word;
}

/* Escudos adaptables */
.equipo img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Resultado grande y centrado */
.resultado {
  font-size: 1.8em;
  font-weight: bold;
  text-align: center;
}

/* Información adicional */
.info-extra {
  text-align: center;
  font-size: 0.9em;
  color: #555;
}
/*Estilos pagina de inicio*/
h1{
  padding: 10px;
  text-align: center;
  color: white;
}

/*Estilos para las cards del inicio*/

.grid-info-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.cardInfo {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.cardInfo:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.cardInfo h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 15px;
  background-color: white;
  font-size: 1.2rem;
}
.arrow {
  font-size: 24px;
  transition: transform 0.3s ease;
  cursor: pointer;
  padding-left: 10px;
}

/* Oculta el contenido inicialmente */
.card-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  padding: 0 15px 0 15px; /* mantiene margen horizontal incluso oculto */
  text-align: center;
  box-sizing: border-box; /* Asegura que padding se respete sin desbordar */
}
.card-content a{
  display: inline-block;        /* permite añadir padding y efectos */
  color: #0056b3;               /* azul fuerte, puedes cambiar por el color del torneo */
  text-decoration: none;        /* quitamos el subrayado por defecto */
  font-weight: bold;            /* para destacar */
  padding: 8px 12px;
  border: 2px solid #0056b3;
  border-radius: 8px;
  background-color: white;
  transition: all 0.3s ease;    /* suaviza los cambios */
}

.card-content a:hover{
  background-color: #0056b3;
  color: white;
  text-decoration: none;
  transform: scale(1.05); 
}

.cardInfo.expanded .card-content {
  max-height: 3000px;
  padding: 15px; /* margen en todos lados cuando está visible */
}
.cardInfo img{
  border-radius: 10px;
}

.cardInfo img, .cardInfo table, .cardInfo p, .cardInfo ul, .cardInfo a, .cardInfo div {
  color: #0056b3;
  margin: 10px auto;
  width: auto;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.cardInfo small{
  color: red;
}

#normas .card-content ul{
  text-align: left;
}


/*BOTON PARA IR ARRIBA*/
#btn-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 50%;
  padding: 10px 14px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  display: none;
  z-index: 1000;
  transition: background-color 0.3s
}

#btn-top:hover {
  background-color: #0056b3
}

/*ESTILOS PARA LOS BOTONES Y EL SELECT*/

/* Contenedor principal de la sección */
.selector-fase {
  display: flex;
  flex-direction: column; /* Apila label, select y nav en columnas */
  align-items: center;     /* Centra horizontalmente el contenido */
  justify-content: center;
  padding: 20px;
  border-radius: 12px;
  max-width: 100%;
  margin: 0 auto; /* Centra la sección en el main */
  text-align: center;
}

.selector-fase.abierto {
  padding-bottom: 60px; /* Espacio extra mientras el select está abierto */
}
/* Etiqueta del select */
.selector-fase label {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  color: white;
  font-weight: bold;
}

/* Estilo del select */
.selector-fase select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: white;
  color: #005aa7;
  border: 2px solid #005aa7;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23005aa7' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Hover para el select */
.selector-fase select:hover {
  border-color: #0072ce;
  box-shadow: 0 0 5px rgba(0, 90, 167, 0.4);
}

/* Estilo del nav con botones (menu-rondas) */
.menu-rondas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
  width: 100%;
}

/* Estilo de botones dentro del nav */
.menu-rondas button {
  background-color: #005aa7;
  font-family: "Montserrat", sans-serif;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: aparecer 0.3s ease-in-out both;
}

.menu-rondas button:hover {
  background-color: #0072ce;
  transform: scale(1.05);
}

.menu-rondas button:active {
  transform: scale(0.97);
}

/* Animación de entrada para botones */
@keyframes aparecer {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Adaptación para móviles */
@media (max-width: 600px) {
  .selector-fase {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .selector-fase label,
  .selector-fase select {
    width: 100%;
  }

  .selector-fase select {
    margin-bottom: 10px;
  }

  .menu-rondas {
    flex-direction: column;
    align-items: center;
  }

  .menu-rondas button {
    width: 90%;
    max-width: 300px;
  }
}




