* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: rgba(10, 10, 20, 1);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Press Start 2P", cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

.gamearea {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background-color: rgba(25, 25, 40, 1);
  border: 3px solid rgba(128, 0, 128, 0.5);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(128, 0, 128, 0.3);
  width: 100%;
  max-width:400px;
  margin:0 auto;
  position: relative;
}

canvas {
  background-color: rgba(0, 0, 0, 1);
  border: 3px solid rgba(128, 0, 128, 0.4);
  border-radius: 8px;
  display: block;
  width: 100%;
  height:auto;
  max-width:400px;
  margin: 0 auto;
} 

#info {
  margin-bottom: 15px;
  width: 100%;
}

h1 {
  font-size: 1.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px rgba(0, 0, 0, 0.4);
}

#scorearea {
  display: flex;
  justify-content: space-around;
  font-size: 0.9em;
}

#instructions {
  font-size: 0.8em;
  margin-bottom: 15px;
  color: #ddd;
}

#game-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
}

#message {
  font-size: 1.5em;
  margin-bottom: 20px;
  text-shadow: 2px 2px rgba(255, 0, 0, 0.6);
}

#final-score {
  font-size: 1.1em;
  line-height: 2;        
  margin-bottom: 20px;
  white-space: pre-line; 
}


#start-button {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  padding: 12px 24px;
  background-color: rgba(34, 139, 34, 1);
  color: rgba(255, 255, 255, 0.9);
  border: 3px solid rgba(0, 100, 0, 1);
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

#start-button:hover {
  background-color: rgba(50, 205, 50, 1);
}

#mobile-controls {
  display: none;
  margin-top: 15px;
  width: 100%;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
}

.mobile-btn {
  width: 60px;
  height: 60px;
  background-color: rgba(85, 85, 85, 0.8);
  color: rgba(255, 255, 255, 0.9);
  border: 3px solid rgba(150, 150, 150, 0.5);
  border-radius: 50%;
  font-size: 1.5em;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin: 5px;
}

.mobile-btn.jump {
  width: 80px;
  height: 80px;
  background-color: rgba(34, 139, 34, 1);
  border-color: rgba(0, 100, 0, 1);
  font-size: 0.9em;
  order: -1;
  flex-basis: 100%;
  margin-bottom: 10px;
}

@media (max-width: 600px) {
  #mobile-controls {
    display: flex;
    justify-content: center;
    gap:10px;
  }

  .gamearea {
    border: none;
    padding: 10px;
    width: 100%;
    max-width: 1;
  }
  
  canvas{
    max-width:100%;
  }
  .mobile-btn {
    width: 40px;
    height: 40px;
    font-size: 1em;
    margin: 3px;
  }

  .mobile-btn.jump {
    width: 55px;
    height: 55px;
    font-size: 0.8em;
  }
}