@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Press Start 2P", cursive, sans-serif;
  user-select: none;
}

body {
  font-size: clamp(1rem, 4vw, 2rem);
  background-color: #5c94fc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 10px;
}

.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#heading h1 {
  font-weight: normal;
  color: #f7e018;
  margin-bottom: 20px;
  width: 100%;
  max-width: 800px;
  text-shadow: -4px -4px 0 #fff, 4px -4px 0 #fff, -4px 4px 0 #fff,
    4px 4px 0 #fff, -6px -6px 0 #e52521, 6px -6px 0 #e52521, -6px 6px 0 #e52521,
    6px 6px 0 #e52521, -8px -8px 0 #000, 8px -8px 0 #000, -8px 8px 0 #000,
    8px 8px 0 #000;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 2/1;
  border: 4px solid #000;
  background-color: #87ceeb;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
}

#game-canvas {
  width: 100%;
  height: 100%;
  background-color: #87ceeb;
  display: block;
}

#score-board,
#lives-board {
  position: absolute;
  top: 15px;
  font-size: clamp(12px, 2vw, 16px);
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

#score-board {
  left: 10px;
}

#lives-board {
  right: 10px;
}

#menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#message-board {
  font-size: clamp(24px, 5vw, 48px);
  color: #fff;
  text-shadow: 4px 4px 0 #000;
  margin-bottom: 40px;
}

#menu button {
  font-family: "Press Start 2P", cursive, sans-serif;
  font-size: clamp(12px, 2vw, 16px);
  padding: 10px 20px;
  margin: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #ffcc00;
  color: #000;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.2s;
}

#menu button:hover {
  background-color: #ffd633;
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 #000;
}

#menu button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 #000;
}

#mobile-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  justify-content: space-between;
  padding: 0 30px;
  align-items: center;
}

#left-right {
  display: flex;
  gap: 15px;
}

#jump-btn {
  position: absolute;
  right: 30px;
}

.control-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  border: 2px solid black;
  font-size: 24px;
  color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.control-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

@media (max-width: 768px) and (orientation: portrait) {
  body {
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    height: 100vh;
  }

  #heading,
  #game-container {
    width: 95vw;
  }
  #mobile-controls {
    display: flex;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 8px;
    padding: 0 20px;
    height: 100vh;
    overflow: hidden;
  }

  #game-container {
    flex: 0 0 auto;
    width: 50vw;
    max-height: none;
    aspect-ratio: 2/1;
  }
  #heading {
    display: none;
  }
  #mobile-controls {
    display: flex;
    position: relative;
    flex-direction: row;
    margin-top: 25px;
    width: 100%;

    padding: 0 20px;
    justify-content: space-between;
  }

  #menu {
    font-size: 2vw;
  }

  #menu button {
    font-size: 1em;
    padding: 0 5em 10px;
  }
}
.control-btn {
  width: 30px;
  height: 30px;
}
