body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 👈 evita que quede centrado demasiado abajo */
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #ff00ff, #7d00ff, #000428);
  background-size: 400% 400%;
  animation: gradientMove 12s ease infinite;
  color: white;
  text-align: center;
}

/* 🎰 Título */
h1 {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: clamp(2.5rem, 6vw, 6rem); /* responsivo */
  color: #ffea00;
  text-shadow: 
    0 0 0px #fff, 
    0 0 6px #8e8307,
    0 0 10px #ffea00,
    0 0 10px #ffd700,
    0 0 20px #ffd700;
  margin: 10px 0 20px 0; /* menos margen */
}

p {
  font-size: 1.2rem;
  color: #ccc;
}

/* 🇨🇴 Grid de banderas */
.image-grid {
  margin-bottom: 40px; /* 👈 reducido para que la máquina suba */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 20px; /* menos espacio */
  padding: 10px;
  width: 100%;
  max-width: 900px; /* ajustado */
}

.image-grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.image-grid img:hover {
  transform: scale(1.05);
}

/* 🎰 Contenedor principal de la máquina */
.digits-container {
  position: relative;
  margin: 10px auto; /* 👈 menos margen para subirla */
  width: min(90vw, 400px); /* 👈 responsivo */
  height: auto;
  aspect-ratio: 1 / 1; /* mantiene forma cuadrada */
  background: url('img/traga_monedas.jpg') no-repeat center center;
  background-size: contain;
  border-radius: 25px;
  border: 5px solid gold;
  box-shadow: 
    0 0 10px gold,
    0 0 20px gold,
    0 0 40px #ffea00;
  overflow: hidden;
}

/* 📊 Números */
.digits {
  display: flex;
  gap: 8px;
  position: absolute;
  top: 45%;  /* 👈 subido un poco */
  left: 50.5%;
  transform: translate(-50%, -50%);
}

/* 🎲 Cada dígito */
.digit {
  font-size: clamp(2rem, 6vw, 4rem); /* 👈 responsivo */
  font-weight: bold;
  background: black;
  color: #ffea00;
  padding: 10px 15px;
  border-radius: 12px;
  text-align: center;
  min-width: 25px;
  box-shadow: inset 0 0 20px #fff200, 0 0 20px #ffea00;
  border: 2px solid gold;
}

/* 🏆 Ganador */
#winner {
  margin-top: 15px;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: bold;
  color: #ffd700;
  text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.7);
  min-height: 40px;
}

/* Animación de fondo */
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
