/* Estilo básico del cuerpo */
body {
  padding: 0;
  margin: 0;
  overflow: hidden;
  background-color: #1a1a1a; /* Fondo gris oscuro */
  font-family: 'Arial', sans-serif; /* Fuente profesional */
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Contenedor principal */
#unity-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw; /* Ancho completo de la ventana */
  height: 100vh; /* Altura completa de la ventana */
  background-color: black;
  overflow: hidden;
}

/* Canvas del juego con proporción 16:9 */
#unity-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* Mantiene proporción 16:9 */
  max-height: 100%;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.6);
  background: black; /* Fondo negro */
}

/* Ajustes para pantallas móviles */
@media (orientation: portrait) {
  #unity-container {
    flex-direction: column;
  }
  #unity-canvas {
    width: auto;
    height: 100%; /* Para dispositivos en modo retrato */
    aspect-ratio: 16 / 9;
  }
}

/* Barra de carga */
#unity-loading-bar {
  position: absolute;
  bottom: 10%; /* Ajuste dinámico */
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  max-width: 600px;
  height: 15px; /* Más alto para mejor visibilidad */
  background-color: #2c2c2c;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

#unity-progress-bar-full {
  height: 100%;
  background: linear-gradient(90deg, #ff8800, #ffaa00);
  width: 0%;
  transition: width 0.2s ease-in-out;
}

/* Texto de carga */
#unity-loading-text {
  position: absolute;
  bottom: 15%; /* Ajuste dinámico */
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Botón de pantalla completa */
#unity-fullscreen-button {
  cursor: pointer;
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: #007BFF;
  border: none;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#unity-fullscreen-button:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

#unity-fullscreen-button:active {
  background-color: #003f7f;
  transform: scale(1);
}

#unity-fullscreen-button::before {
  font-size: 18px;
  color: #ffffff;
}

/* Mensajes de advertencia */
#unity-warning {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 5px;
  display: none;
  font-size: 14px;
}

/* Animación al redimensionar */
@keyframes resize-animation {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

#unity-canvas {
  animation: resize-animation 0.5s ease-in-out;
}
