/* Global styles */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(
    circle,
    rgba(34, 34, 34, 1) 0%,
    rgba(17, 17, 17, 1) 100%
  );
  color: white;
  font-family: "Press Start 2P", sans-serif;
  overflow: hidden;
  touch-action: none;
}

canvas {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" fill-opacity="0.2"><rect x="50" width="50" height="50"/><rect y="50" width="50" height="50"/></svg>');
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.3);
  border: 4px solid rgba(0, 255, 255, 0.8);
  border-radius: 5px;
  display: block;
  margin: 0 auto;
  margin-top: 20px; /* Add some margin to separate from the header */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

header {
  flex: 0 0 auto;
  height: 50px;
}

footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.header-content,
.hud,
#gameOverScreen,
#levelCompleteScreen,
#titleScreen {
  display: flex;
  align-items: center;
  justify-content: center;
}

#pauseScreen {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

#gameContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 80px); /* Subtract header and footer heights */
}

.header-content {
  justify-content: space-between;
}

.logo img,
.hud span,
button {
  margin: 0 10px;
}

.logo img {
  width: 50px;
  height: 50px;
}

.hud {
  flex-grow: 1;
}

/* Container setup */
#pauseScreen,
#gameOverScreen,
#levelCompleteScreen,
#titleScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  flex-direction: column;
  text-align: center;
  z-index: 10;
}

/* Screen-specific styles */
#titleScreen h1,
#gameOverScreen h1,
#levelCompleteScreen h1 {
  font-size: 6vw;
  margin: 20px 0;
  animation: glowAnimation 10s ease-in-out infinite;
}

/* Add this new class to your styles.css */
#startButton,
#restartButton,
#confirmButton,
#submitButton {
  display: inline-block;
  padding: 15px 30px;
  font-size: 24px;
  font-family: "Press Start 2P", cursive;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-color: #e76f51;
  border: none;
  border-radius: 5px;
  box-shadow: 0 5px 0 #c44032;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: all 0.2s ease;
}

#startButton:hover,
#restartButton:hover,
#confirmButton:hover,
#submitButton:hover {
  background-color: #f4a261;
  box-shadow: 0 4px 0 #e76f51;
  top: 1px;
}

#startButton:active,
#restartButton:active,
#confirmButton:active,
#submitButton:active {
  background-color: #e9c46a;
  box-shadow: none;
  top: 5px;
}

#pauseScreen {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.5s;
}

#pauseScreen.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  display: flex;
}

#levelCompleteScreen.show {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

/* Animations and Effects */
@keyframes glowAnimation {
  0%,
  100% {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff0000,
      0 0 35px #ff0000, 0 0 40px #ff0000, 0 0 50px #ff0000, 0 0 75px #ff0000;
  }
  25% {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #00ff00,
      0 0 35px #00ff00, 0 0 40px #00ff00, 0 0 50px #00ff00, 0 0 75px #00ff00;
  }
  50% {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #0000ff,
      0 0 35px #0000ff, 0 0 40px #0000ff, 0 0 50px #0000ff, 0 0 75px #0000ff;
  }
  75% {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ffff00,
      0 0 35px #ffff00, 0 0 40px #ffff00, 0 0 50px #ffff00, 0 0 75px #ffff00;
  }
}

#titleContent,
#highScoresContent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease-in-out;
}

#titleContent {
  background-color: rgba(0, 0, 0, 0.8);
  transform: translateX(0);
}

#highScoresContent {
  background-color: #0a0a0a;
  color: #ffffff;
  font-family: "Press Start 2P", sans-serif;
  border: 2px solid #009bdd;
  box-sizing: border-box;
  transform: translateX(100%);
}

#highScoresList {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
}

#highScoresList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #009bdd;
}

#highScoresList .initials {
  flex: 1;
}

#highScoresList .score {
  flex: 1;
  text-align: right;
}

#highScoreForm {
  background-color: #000;
  border: 4px solid #fff;
  padding: 20px;
  text-align: center;
  font-family: "Press Start 2P", sans-serif;
  color: #fff;
}

#highScoreForm p {
  margin-bottom: 20px;
}

#initialsInput {
  background-color: #000;
  border: 2px solid #fff;
  color: #fff;
  font-family: "Press Start 2P", sans-serif;
  font-size: 24px;
  text-align: center;
  padding: 10px;
  width: 150px;
  margin-bottom: 20px;
}

.slide-out-left {
  transform: translateX(-100%);
}

.slide-in-right {
  transform: translateX(0);
}

@keyframes slideOutLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}

Landscape @media screen and (orientation: landscape) {
  #gameContainer {
    height: calc(100vh - 80px); /* Subtract header and footer heights */
  }
}

/* Portrait */
@media screen and (orientation: portrait) {
  #gameContainer {
    height: calc(100vh - 80px); /* Subtract header and footer heights */
  }
}

@media screen and (orientation: portrait) {
  #rotateDeviceNotice {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    justify-content: center;
    align-items: center;
    z-index: 100;
    font-size: 4vw;
  }
}
