body {
    font-family: 'Press Start 2P', monospace;
    text-align: center;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
}

.popup {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup.mostrar {
  opacity: 1;
  visibility: visible;
}

html{
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;      
}

#canvas {
  position: fixed;        
  top: 0;
  left: 0;
  width: 100vw;          
  height: 100vh;          
  z-index: -1;             
  pointer-events: none;    
}

.vista-juego {
  position: relative;       
  max-width: 960px;        
  margin: 0 auto;          
  padding: 20px;
  color: #fff;            
  text-align: center;
}
.vida {
    font-size: 24px;
    margin: 10px 0;
}
.vista-cartas {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.carta {
    width: 150px;
    height: 188px;
    background-color: white;
    color: rgba(35, 35, 35, 0.839);
    border-radius: 8px;
    border: 2px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
}
.carta.seleccionada {
    border: 3px solid rgb(0, 213, 255);
    box-shadow: 0 0 15px rgb(0, 191, 255);
    transform: translateY(-30px) scale(1.05);
    box-shadow: 0 0 15px #ff4081;
}

.nombre-carta {
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}
.stats {
    display: flex;
    justify-content: center;
}
.ataque { color: red; }
.defensa { color: blue; }
button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
}
button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#video-fondo {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  filter: brightness(0.5); /* Opcional: oscurece el fondo para mayor contraste */
}

.barra-juego-superior {
  position: center;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 10;
  pointer-events: none; /* permite que no bloquee cosas si hace falta */
}

.botones_acciones{
  position: center;
  top: 30px; /* espacio desde arriba */
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.contenedor-barra {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%; /* no llega a los bordes */
  max-width: 1600px;
  pointer-events: auto; /* vuelve a habilitar interacción solo en esta caja */
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  font-size: 1.5em;
}

.botones-barra {
  display: flex;
  gap: 12px;
  align-items: center;
}

.botones-barra button {
  padding: 10px 20px;
  font-size: 1em;
  border-radius: 12px;
  background-color: #ff4081;
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.3s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
} 

.botones-barra button:hover {
  transform: scale(1.05);
  background-color: #ff5b9f;
}

#boton-reiniciar {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.3s ease;
}

#boton-menu-principal {
  background: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.3s ease;
}

#boton-menu-principal.mostrar {
  display: inline-block !important;
  opacity: 1;
  transform: scale(1);
}

#boton-reiniciar.mostrar {
  display: inline-block !important;
  opacity: 1;
  transform: scale(1);
}

.contenedor-barra .vida,
.contenedor-barra .mazo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contenedor-barra button {
  padding: 10px 20px;
  font-size: 1em;
  border-radius: 12px;
  background-color: #ff4081;
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.contenedor-barra button:hover {
  transform: scale(1.05);
}

.mensaje {
    margin: 20px 0;
    padding: 10px;
    border-radius: 5px;
    min-height: 50px;
}

.carta-rival {
    background-image: url("../img/Carta_Dorso_xl.png");
    border: 2px solid #999;
    position: relative;
}

.carta-rival::after {
    background-image: url(".../img/Carta_Dorso_xl.png");
    font-size: 1.5em;
    font-weight: bold;
    position: center;
    top: 40%;
    left: 45%;
    transform: translate(-50%, -50%);
}

.enemigo.bloqueado {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
}

@keyframes resaltarCarta {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.carta.animada {
  animation: resaltarCarta 0.3s ease;
}


.menu-principal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.95);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.menu-principal h1 {
  font-size: 48px;
  margin-bottom: 30px;
}

.menu-principal button {
  padding: 15px 30px;
  font-size: 20px;
  background-color: #00bfff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.menu-principal.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

.menu-principal input[type="text"] {
  padding: 12px 20px;
  font-size: 20px;
  border: 2px solid #f8b0dc;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  margin-bottom: 30px;
  width: 80%;
  max-width: 300px;
  box-shadow: 0 4px 15px #f8b0dc;
  transition: all 0.3s ease;
}

.menu-principal input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.menu-principal input[type="text"]:focus {
  outline: none;
  border-color: #00e0ff;
  box-shadow: 0 4px 20px #f8b0dc;
  transform: scale(1.02);
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Botones animados y divertidos */
.botones-juego {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 20px;
}

.botones-juego button {
    padding: 12px 24px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(45deg, #ff4081, #ff79b0);
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease-in-out;
    animation: bounceIn 0.6s ease;
}

#boton-jugar{
  background: none !important;
  position: relative;
  z-index: 20 !important;
  display: inline-block !important;
  opacity: 1 !important;
  transform: none !important;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
}

#boton-reiniciar{
  background: none !important;
}

.botones-juego button:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #ff79b0, #ff4081);
}

.botones-juego button:active {
    transform: scale(0.95);
}

/* Vida y mazo con íconos */
.barra-superior {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.barra-superior div {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
}

/* Pequeña animación para los botones al cargar */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.fondo-video-container {
  position: fixed;
  width: 100% !important;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#boton-comenzar
{
  background-color: #f8b0dc;
}