body{
    padding: 4%;
    display: flex;
    justify-content: center;
    background-color: rgb(248, 244, 239);
}

.contenedor {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
    width: 100%;
}

.barranav{
    display: flex;
    justify-content: space-between;
    background-color: rgb(170, 170, 245);
    border: 3px solid rgb(3, 59, 68);
    padding: 1% 4%;
    border-radius: 6.7px;
    align-items: center;
}

.torneodat,
.puntaje{
    width: 20%;
    display: flex;
    justify-content: space-between;
    background-color: rgb(134, 158, 255);
    align-items: center;
    padding: 4px;
    border: 2px solid rgb(45, 45, 79);
    border-radius: 7px;
}

.ar{
    color: rgb(0, 0, 255);
    font-size: 21px;
}
.cc{
    color: white;
    font-size: 21px;
}

.filtro{
    display: flex;
    justify-content: space-between;
    background-color: rgb(67, 104, 255);
    border: 3px solid rgb(3, 59, 68);
    padding: 1% 4%;
    border-radius: 6.7px;
    align-items: center;
}

.dificultad{
    display: flex;
    justify-content: stretch;
}

.ez{
    background-color: greenyellow;
    border-radius: 10px 0 0 10px;
    padding: 3px;
    border: 2px solid rgb(0, 166, 0);
}
.mid{
    background-color: orange;
    padding: 3px;
    border: 2px solid rgb(172, 113, 3);
}
.hrd{
    background-color: red;
    border-radius: 0 10px 10px 0;
    padding: 3px;
    border: 2px solid rgb(130, 2, 2);
}
.todas{
    padding: 3px;
    color: rgb(245, 245, 247);
    background-color: rgb(130, 130, 203);
    border-radius: 10px;
    border: 2px solid rgb(2, 15, 130);
}
.ejercicios{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.tarjeta {
  background-color: rgb(46, 46, 112);
  padding: 3%;
  border-radius: 20px;
  gap: 8px;
  border: 3px solid rgb(7, 7, 37);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  grid-template-areas:
    "img img img img img img"
    "titulo titulo titulo titulo titulo titulo"
    "dificultad-tarjeta dificultad-tarjeta dificultad-tarjeta puntos-tar puntos-tar puntos-tar"
    "desc desc desc desc desc desc"
    "chip1 chip1 chip2 chip2 chip3 chip3"
    "respuesta respuesta respuesta favoritos favoritos favoritos";
}

.tarjeta:hover{
  transform: scale(0.95);
  transition: 0.2s;
}
img {
  height: 200px;
  width: 100%;
  border-radius: 30px 30px 0 0;
  border: 4px solid rgb(0, 0, 32);
}

h1 {
  text-align: center;
  color: white;
}

.img {
  grid-area: img;
}

.titulo {
  grid-area: titulo;
}

.dificultad-tarjeta {
  grid-area: dificultad-tarjeta;
}

.puntos-tar {
  background-color: rgb(117, 141, 133);
  padding: 5px;
  border-radius: 8px;
  grid-area: puntos-tar;
}

.desc {
  background-color: rgb(90, 90, 245);
  padding: 5px;
  border-radius: 6px;
  grid-area: desc;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chip1,
.chip2,
.chip3 {
  background-color: rgb(188, 199, 195);
  border-radius: 10px;
  padding: 5px;
  text-align: center;
}

.chip1 { grid-area: chip1; }
.chip2 { grid-area: chip2; }
.chip3 { grid-area: chip3; }

.respuesta {
  background-color: rgb(71, 71, 101);
  grid-area: respuesta;
}

.favoritos {
  width: 40px;
  border-radius: 20px;
  padding: 4px;
  background-color: red;
  grid-area: favoritos;
}

#Facil {
  background-color: greenyellow;
  padding: 5px;
  border-radius: 8px;
  text-align: center;
}

#Medio {
  background-color: orange;
  padding: 5px;
  border-radius: 8px;
  text-align: center;
}

#Dificil {
  background-color: red;
  padding: 5px;
  border-radius: 8px;
  text-align: center;
}

.tarjeta.resuelta {
  background-color: rgb(28, 236, 0);
  transition: 4s;
}

.tarjeta.resuelta .respuesta {
  background-color: rgb(90, 239, 95);
  transition: 8s;
}

.tarjeta.animar {
    animation: aparecer 0.4s ease;
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#cargando {
    position: fixed;
    inset: 0;
    background: #171717;
    color: white;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #555;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

.spinrice {
    width: 200px;
    height: auto;
    border: none;
    border-radius: 0;
    animation: girar 1s linear infinite;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

.barin{
    display: none;
    position: fixed;
}

@media (max-width: 850px) {
  .ejercicios{
    grid-template-columns: 1fr 1fr;
  }
  .desc{
    font-size: 12px;
  }
  img{
    height: 130px;
    width: 92%;
  }
  .titulo{
    font-size: 16px;
  }
  .chip1,.chip2,.chip3{
    font-size: 12px;
  }
  .desa, .clas{
    display: none;
  }
  .torneodat{
    width: 13%;
    font-size: 12px;
  }
  .puntaje{
    width: 35%;
    font-size: 12px;
  }
  .torneodat .ar {
      font-size: 12px;
  }
  .filtro{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-areas: 
    "filtit filtit filtit filtit"
    "tod alg wb dt"
    "dificultad dificultad dificultad dificultad"
    ;
    gap: 8px;
  }
  .filtit{
    grid-area: filtit;
  }
  .tod{
    grid-area: tod;
  }
  .alg{
    grid-area: alg;
  }
  .wb{
    grid-area: wb;    
  }
  .dt{
    grid-area: dt;
  }
  .dificultad{
    grid-area: dificultad;
  }
  .barin{
      display: block;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: rgb(194, 246, 255);
      height: 35px;
      width: 47%;
      padding: 2% 15%;
      border: 2px solid rgb(9, 2, 36);
      border-radius: 5px;
      bottom: 2%;
      left: 11%;
  }

}