body {
  background: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

/* Contenedor del juego */
#game {
  position: relative;
  width: 1600px;
  height: 600px;
  background: white;
  overflow: hidden;
  border: 2px solid black;
}

/* Fondo */
#background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("sprites/fondo.png");
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 0;
  z-index: 0;
}

/* Suelo */
#ground {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  z-index: 2;
}

/* Jugador */
#player {
  position: absolute;
  left: 160px;
  width: 120px;
  height: 140px;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Contador */
#score {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  font-family: Arial, sans-serif;
  color: gold;
  z-index: 5;
}

/* Monedas */
.coin {
  position: absolute;
  width: 50px;
  height: 50px;
  background-image: url("sprites/euros.png"); /* tu sprite de moneda */
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
  animation: girar 0.5s infinite;
}

/* Animaciones jugador */
.corriendo {
  animation: correr 0.3s infinite;
}
.rodando {
  animation: rodar 0.25s infinite;
  height: 80px;
}





/* Animaciones sprite */
@keyframes correr {
  0% { background-image: url("sprites/correr1.png"); }
  50% { background-image: url("sprites/correr2.png"); }
  100% { background-image: url("sprites/correr1.png"); }
}

@keyframes rodar {
  0% { background-image: url("sprites/rodar1.png"); }
  50% { background-image: url("sprites/rodar2.png"); }
  100% { background-image: url("sprites/rodar1.png"); }
}

/* Animación girar moneda */
@keyframes girar {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

.enemy {
  position: absolute;
  width: 120px;
  height: 140px;
  background-image: url("sprites/pig.gif");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
  transform: scaleX(-1); /* gira hacia la izquierda */
}

.pop {
  position: absolute;
  width: 100px; /* mucho más grande */
  height: 100px;
  background-image: url("sprites/pop.png");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

.modal {
  position: absolute;
  top: 0; left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.8); /* fondo oscuro semitransparente */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  display: none; /* oculto por defecto */
}

.modal-content {
  background: linear-gradient(135deg, #6a11cb, #2575fc); /* bonito gradiente */
  padding: 50px 60px;
  text-align: center;
  border-radius: 25px;
  width: 80%;        /* ocupa buena parte de la pantalla */
  max-width: 700px;  /* pero no demasiado grande */
  box-shadow: 0 20px 40px rgba(0,0,0,0.4); /* sombra elegante */
  color: white;      /* texto blanco sobre fondo azul morado */
  font-family: 'Arial', sans-serif;
  animation: modalShow 0.5s ease;
}

.modal-content h2 {
  font-size: 40px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.modal-content p {
  font-size: 20px;
  line-height: 1.6;
}

.modal-content button {
  margin-top: 30px;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: 15px;
  background: #ffce00; /* color llamativo */
  color: #222;
  transition: transform 0.2s, background 0.3s;
}

.modal-content button:hover {
  transform: scale(1.1);
  background: #ffd633;
}

/* Animación de entrada */
@keyframes modalShow {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}