@font-face {
  font-family: F1_Regular;
  src: url("Formula1-Regular.otf");
}

* {
  margin: 0;
  padding: 0;
}


body {
  background-color: rgb(53, 12, 95);
}

#tablero {
  position:relative;
  margin: 0;
  padding: 0;
}


#waiting_for_player{
  position: absolute;
  font-family: F1_Regular;
  font-size: 40px;
  font-weight: bold;
  font-style: italic;
  top: 50%;
  left: 50%;
  width: 100%;
  color: red;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
  animation: fade 2s infinite;
}

#searching_for_opponent{
  position:absolute;
  font-family: F1_Regular;
  font-size: 40px;
  font-weight: bold;
  font-style: italic;
  top: 50%;
  left: 50%;
  width: 100%;
  color: red;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
  animation: fade 2s infinite;
}

.container-tablero {
    display: grid;
    background-color: #8a51e6;
    max-width: 610px;
    grid-template-columns: repeat(4, 150px);
    grid-template-rows: repeat(8 auto);
    grid-gap: 1px;
}

.container-tablero article {
  background-color: white;
  position: relative;
  width: 100%;
  height: 100%;
  justify-content:center;
  align-items: center;
  overflow: hidden;
}

.item {
  text-align: center;
}

#logo_tablero {
  background-color:#8a51e6; 
  top: 50px;
  height: 47.5px;
}

#logo_tablero2 {
  background-color: #8a51e6;;
  top: 20%;
  height: 50%;
  width: 100%;
}

#mensaje_alerta {
  display: none;
  background-color:  rgb(53, 12, 95);
  font-weight: bold;
  color:red;
  width:max-content;
  position: absolute;
  overflow: hidden;
}

.texto {
  display: flex;
  color:black;
  background-color: rgb(174, 157, 235);
  font-family: F1_Regular;
  font-size: 11px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.num_pilotos {
  position: absolute;
  display: none;
  font-size: 10px;
  padding: 3px;
  justify-items: left;
  align-items: start;
}

.num_pilotos[data_color="yellow"] {
  color: yellow;
}

.num_pilotos[data_color="green"] {
  color: rgb(0,255,0);
}

.imagen_piloto {
    background-color:#8a51e6;
    object-fit: cover;
    width:80%;
    height:80%;
    margin: 0 auto;
    text-align: center;
    opacity: 0.1;
  }

.texto_piloto {
    opacity: 0;
    display: flex;
    position:absolute;
    top: 88%;
    font-family: F1_Regular;
    font-size: 12px;
    color: white;
    background: linear-gradient(rgba(255,255,255,0), rgba(0,0,0,1), rgba(255,255,255,0));
    width: 100%;
    height: 40px;
    left: 50%;
    justify-content:center;
    align-items:center;
    transform: translate(-50%, -50%);  
}

/*
.imagen_piloto:hover .texto_piloto {
  opacity: 1;
}
*/

.item img {
  width:100%;
  height:100%;
  transition: .4s linear;
  transition: transform 1s;
  object-fit: fill;
}

.dialog-container {
  position: relative;
  float: left;
}

img:hover {
  transform: scale(1);
}

.container-tablero .item:nth-child(1) {
  height: 150px;
  grid-row: 1 / 3;
}

.container-tablero .item:nth-child(2) {
  height: 125px;
  grid-row: 1 / 2;
}

.container-tablero .item:nth-child(3) {
  height: 125px;
  grid-row: 1 / 2;
}

.container-tablero .item:nth-child(4) {
  height: 125px;
  grid-row: 1 / 2;
}

.container-tablero .item:nth-child(5) {
  height: 25px;
  grid-row: 2 / 3;
}

.container-tablero .item:nth-child(6) {
  height: 25px;
  grid-row: 2 / 3;
}

.container-tablero .item:nth-child(7) {
  height: 25px;
  grid-row: 2 / 3;
}

.container-tablero .item:nth-child(8) {
  height: 125px;
  grid-row: 3 / 4;
}

.container-tablero .item:nth-child(9) {
  height: 150px;
  grid-row: 3 / 5;
  background-color:#a277e7;
}

.container-tablero .item:nth-child(9) .imagen_piloto{
  background-color:#a277e7;
}

.container-tablero .item:nth-child(10) {
  height: 150px;
  grid-row: 3 / 5;
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(10) .imagen_piloto{
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(11) {
  height: 150px;
  grid-row: 3 / 5;
  background-color:#a277e7;
}

.container-tablero .item:nth-child(11) .imagen_piloto{
  background-color:#a277e7;
}

.container-tablero .item:nth-child(12) {
  height: 25px;
  grid-row: 4 / 5;
}

.container-tablero .item:nth-child(13) {
  height: 125px;
  grid-row: 5 / 6;
}

.container-tablero .item:nth-child(14) {
  height: 150px;
  grid-row: 5 / 7;
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(14) .imagen_piloto{
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(15) {
  height: 150px;
  grid-row: 5 / 7;
  background-color:#a277e7;
}

.container-tablero .item:nth-child(15) .imagen_piloto{
  background-color:#a277e7;
}

.container-tablero .item:nth-child(16) {
  height: 150px;
  grid-row: 5 / 7;
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(16) .imagen_piloto{
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(17) {
  height: 25px;
  grid-row: 6 / 7;
}

.container-tablero .item:nth-child(18) {
  height: 125px;
  grid-row: 7 / 8;
}

.container-tablero .item:nth-child(19) {
  height: 150px;
  grid-row: 7 / 9;
  background-color:#a277e7;
}

.container-tablero .item:nth-child(19) .imagen_piloto{
  background-color:#a277e7;
}

.container-tablero .item:nth-child(20) {
  height: 150px;
  grid-row: 7 / 9;
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(20) .imagen_piloto{
  background-color:#8a51e6;
}

.container-tablero .item:nth-child(21) {
  height: 150px;
  grid-row: 7 / 9;
  background-color:#a277e7;
}

.container-tablero .item:nth-child(21) .imagen_piloto{
  background-color:#a277e7;
}

.container-tablero .item:nth-child(22) {
  height: 25px;
  grid-row: 8 / 9;
}

@keyframes cambioDeColor {
  0%, 100% {
      background-color: inherit; /* Color inicial del fondo al principio y al final de la animación */
  }
  50% {
      background-color: black; /* Nuevo color de fondo a la mitad de la animación */
  }
}

@keyframes fade {
  0%, 100% {
      opacity: 1;
  }
  50% {
      opacity: 0.1;
  }
}
