/* Estilos generales */
body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 10px;
}

/* Contenedor de imagen - TAMAÑO FIJO */
.imagen-container {
  width: 100%;
  max-width: 600px;
  height: 400px; /* Altura fija para mantener consistencia */
  margin: 0 auto 20px auto;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 15px;
}

/* Imagen dentro del contenedor */
.imagen-container img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Mantiene proporciones sin deformar */
  display: block;
  transition: transform 0.3s ease;
}

/* Emoji final */
.emoji-final {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  pointer-events: none;
  z-index: 10;
  animation: celebracion 1s ease infinite;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
  line-height: 1; /* Asegura que no afecte la altura */
}

@keyframes celebracion {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -50%) scale(1.2) rotate(-10deg);
  }
  75% {
    transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
  }
}

/* Nombre de la persona - CON ALTURA FIJA */
#nombrePersona {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #595855 !important;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem !important;
  font-weight: 500 !important;
  min-height: 70px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 20px auto;
  text-align: center;
  word-wrap: break-word;
  animation: aparecer 0.5s ease;
  font-family: 'Georgia', serif; /* Fuente más elegante */
  font-style: italic;
}

#nombrePersona:empty {
  opacity: 0;
  background: transparent;
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Barra de progreso */
.progress {
  height: 30px !important;
  border-radius: 15px !important;
  background-color: rgba(255,255,255,0.3) !important;
  border: 2px solid white;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%) !important;
  border-radius: 15px !important;
  font-weight: bold;
  font-size: 1rem;
  line-height: 30px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  transition: width 0.5s ease !important;
}

.progress-bar.completado {
  background: linear-gradient(90deg, #28a745, #20c997) !important;
}

/* Botones con estilo dorado/plateado */
.btn {
  border-radius: 50px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.3s ease !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(45deg, #FFD700, #FFA500) !important;
  color: #0f3460 !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
  background: linear-gradient(45deg, #A0A0A0, #B0B0B0) !important;
  color: #16213e !important;
  box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.btn:disabled {
  opacity: 0.5;
  filter: grayscale(50%);
  transform: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .card {
    padding: 1.5rem !important;
    margin: 1rem;
  }
  
  #nombrePersona {
    min-height: 60px;
    font-size: 1.2rem !important;
    padding: 10px 20px;
    max-width: 400px;
  }
  
  .btn {
    padding: 10px 20px !important;
    font-size: 0.8rem !important;
  }
  
  h1.display-4 {
    font-size: 2rem !important;
  }
  
  .imagen-container {
    height: 300px; /* Un poco más pequeño en móviles */
  }
  
  .emoji-final {
    font-size: 5rem !important;
  }
}

@media (max-width: 480px) {
  #nombrePersona {
    min-height: 50px;
    font-size: 1rem !important;
    padding: 8px 16px;
  }

  .imagen-container {
    height: 350px;
  }
}

@media (max-width: 400px) {
  .btn {
    font-size: 0.7rem !important;
    padding: 12px 12px !important;
  }

  .imagen-container {
    height: 330; /* Aún más pequeño en móviles muy pequeños */
  }
  
  .progress {
    height: 30px !important;
  }
  
  .progress-bar {
    font-size: 0.8rem;
    line-height: 25px;
  }
}