html, body {
  font-family: 'Bungee' !important;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: transparent !important;
}

.color0 {
    background-color: #000000;
}

.letraR {
    color: #DC3545;
}

.letraRT {
    color: #DC3545;
      text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.letraVT {
    color: #ffffffff;
      text-shadow:
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.borde-rojo {
  color: black;
  text-shadow: 
    -1px -1px 0 #DC3545,
     1px -1px 0 #DC3545,
    -1px  1px 0 #DC3545,
     1px  1px 0 #DC3545;
}

#tablero {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  width: 20%;
  gap: 3px;
  justify-content: center;
  background: url('../Imagenes/Fondo.jpg') no-repeat center center;
  background-size: cover;
  padding: 10px;
  background-color: transparent !important;
  border: 5px solid #000000;
  border-radius: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  margin: 0 auto;
}

.tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  background-image: url('../Imagenes/Reverso.jpg');
  background-size: cover;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  border: 2px solid #ccc;
  border-radius: 12px;
  box-shadow: 
  2px 2px 0px rgb(89, 255, 0),
  6px 6px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  transform: rotateX(10deg) rotateY(10deg);
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.tile:hover {
  transform: rotateX(0deg) rotateY(0deg) scale(1.05);
  box-shadow: 8px 8px 20px rgba(0,0,0,0.4);
}

.tile img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
}

.tile.volteada {
  background-image: none;
}

.tile.volteada img {
  transform: rotateY(0deg);
}

.tile.desaparecer {
  animation: fadeOut 0.6s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

.tile.bloqueada {
  outline: 2px solid #FF073A;
  outline-offset: -1px;
}

.tile.habilitada {
  outline: 2px solid rgb(229, 255, 0);
  outline-offset: -2px;
}

#mensajes {
  font-size: 1.2em;
  margin-top: 15px;
  color: darkgreen;
}

#fallos {
  font-size: 1em;
  margin-top: 10px;
  color: #333;
}

#pantalla-inicio,
#pantalla-juego,
#pantalla-final {
  display: flex;
  flex-direction: column;
  justify-content: center; 
  padding: 10px;
}

.visible {
  display: block !important;
}

@media (min-width: 991px) and (max-width: 1200px) {
  #tablero {
    width: 20%;
  }
}

@media (max-width: 990px) {
  #tablero {
    width: 30%;
  }
}

@media (max-width: 768px) {
  #tablero {
    width: 40%;
  }
}

@media (max-width: 600px) {
  #tablero {
    width: 50%;
  }
}

@media (max-width: 480px) {
  #tablero {
    width: 68%;
  }
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h5 {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

h6 {
  font-size: clamp(0.875rem, 1.5vw, 1.25rem);
}

#alerta-bootstrap {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 70%;
  padding: 1rem 2rem;
  text-align: center;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  border: 5px solid #000000;
  color: black;
  background: #FFFF33;
  text-shadow:
  -1px -1px 0 #fff,  
   1px -1px 0 #fff,
  -1px  1px 0 #fff,
   1px  1px 0 #fff;
}

#alerta-juego {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 70%;
  padding: 1rem 2rem;
  text-align: center;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  border: 5px solid #000000;
  color: black;
  background: #39FF14;
  text-shadow:
  -1px -1px 0 #fff,  
   1px -1px 0 #fff,
  -1px  1px 0 #fff,
   1px  1px 0 #fff;
}

#nombre::placeholder {
  font-size: 0.95rem;
}

#nickname::placeholder {
  font-size: 0.95rem;
}