@font-face {
  font-family: 'RasterForgeRegular';
  src: url('../assets/fonts/RasterForgeRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* General page style: Dark background and white text */
body {
  background-color: #111;
  color: white;
  font-family: 'RasterForgeRegular', sans-serif;
  font-size: 16px; 
  text-align: center;
  margin: 0;
  padding: 20px;
}

/* Ensure buttons inherit the pixel font */
button {
  font-family: inherit;
}

/* Fullscreen toggle button (Top Right) */
#fullscreenBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  transition: all 0.2s;
  z-index: 1000;
}

#fullscreenBtn:hover {
  background: white;
  color: #111;
}

/* Canvas (game board) style: Centered, black background */
canvas {
  display: block;
  margin: 0 auto;
  background-color: black;
}

/* Direction UI container: Shows direction keys and text aligned */
#directionUI {
  width: 512px;
  margin: 10px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 30px;
}

/* Top (up arrow) and middle (left/down/right) rows of Direction UI */
#ui-up,
#ui-middle {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Size of arrow images in Direction UI */
#directionUI img {
  width: 48px;
  height: 48px;
}

/* Gameplay restart button */
.restart-btn {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background-color: #5d9b5e; 
  color: white;
  border: none;
  border-radius: 5px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.restart-btn:hover {
  background-color: #45a049;
  opacity: 1;
}

/* Main menu style: Vertically aligned buttons and title */
#mainMenu {
  padding-top: 10vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh; 
}

#mainMenu h1 {
  margin-top: 0; 
  font-size: 100px; 
  font-family: 'RasterForgeRegular', sans-serif;
  letter-spacing: 4px;
}

#mainMenu .start-btn {
  margin-top: 50px;
}

/* Main menu buttons: Equal size style */
#mainMenu button {
  width: 190px;
  margin: 10px;
  padding: 15px 20px;
  font-size: 20px;
  cursor: pointer;
  background-color: #4CAF50; 
  color: white;
  border: none;
  border-radius: 5px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

#mainMenu button:hover {
  background-color: #45a049;
  opacity: 1;
}

.fullscreen-tip {
  margin-top: 200px;
  font-size: 18px;
  color: #aaaaaa;
  letter-spacing: 1px;
}

/* Level complete, game over and tutorial screens */
#gameOverScreen, #gameCompleteScreen, #tutorialScreen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: left;
  display: none;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Buttons in screens */
#gameOverScreen button, #gameCompleteScreen button, #tutorialScreen button {
  margin: 10px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#gameOverScreen button:hover, #gameCompleteScreen button:hover, #tutorialScreen button:hover {
  background-color: #45a049;
  opacity: 1;
}

/* Level counter: Above game board, shows level number */
#levelCounter {
  width: 512px;
  margin: 10px auto 0 auto;
  font-family: 'RasterForgeRegular', sans-serif;
  font-size: 36px; 
  font-weight: normal;
  color: #ffffff;
  text-align: center;
  display: none;
  padding: 30px 20px;
}

/* Tutorial screen title */
#tutorialScreen h2 {
  text-align: center;
}

/* Tutorial screen lists */
#tutorialScreen ul {
  margin: 10px 0;
  padding-left: 20px;
}

/* Tutorial screen paragraphs */
#tutorialScreen p {
  margin: 10px 0;
}

.hidden {
  display: none !important;
}

.text-red {
  color: red;
}

/* Gameplay return to menu button */
.return-btn {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background-color: #b33128; /* Red color to distinguish from menu buttons */
  color: white;
  border: none;
  border-radius: 5px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.return-btn:hover {
  background-color: #d32f2f;
  opacity: 1;
}
