body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  touch-action: manipulation;
  -webkit-touch-callout: none; /* iOS Safari */
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.instructions {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 8px;
  font-size: 18px;
  color: #fff;
  z-index: 100;
  max-width: 400px;
  text-align: center;
}

.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background-color: white;
}

.crosshair::before {
  top: 9px;
  left: 0;
  width: 20px;
  height: 2px;
}

.crosshair::after {
  top: 0;
  left: 9px;
  width: 2px;
  height: 20px;
}

#joystick-container {
  position: fixed;
  bottom: 50px;
  left: 20px;
  width: 120px;
  height: 120px;
  z-index: 1000;
  display: none; 
  touch-action: none;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

#jump-button {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: none; 
  z-index: 1000;
  touch-action: none;
  text-align: center;
  line-height: 80px;
  font-weight: bold;
  color: #333;
  user-select: none;
}

.message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  font-size: 24px;
  z-index: 2000;
  transition: opacity 1s;
}

#moon-glow {
  position: fixed;
  width: 0;
  height: 0;
  box-shadow: 0 0 150px 75px rgba(200, 225, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

#flashlight-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1000;
  font-size: 14px;
  user-select: none;
}

#flashlight-toggle.active {
  background-color: rgba(255, 186, 0, 0.7);
  box-shadow: 0 0 10px rgba(255, 186, 0, 0.5);
}

.inventory-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 20px;
  border-radius: 8px;
  z-index: 3000;
  display: none; 
  width: 300px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.inventory-menu h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

.inventory-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.inventory-menu li {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-menu li:last-child {
  border-bottom: none;
}

.inventory-menu.active {
  display: block; 
}

/* Start Menu Styles */
.start-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: blue;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Creepster', cursive; 
    z-index: 5000; 
    animation: fadeIn 2s ease-in-out forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.start-menu p {
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px #000;
    animation: slideIn 1s ease-out 0.5s backwards;
}

.start-menu h1 {
    font-size: 5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px #000;
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.start-menu button {
    padding: 15px 30px;
    font-size: 1.5em;
    margin: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Creepster', cursive;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.start-menu button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.start-menu .early-access {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 1.2em;
    color: #ddd;
    text-shadow: 1px 1px 2px #000;
    animation: fadeIn 2s ease-in-out 1s backwards;
}

/* "You Can't Quit" Screen Styles */
.quit-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: none; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5001; 
    text-align: center;
}

.quit-screen h1 {
    font-size: 4em;
    color: #000;
    margin-bottom: 20px;
}

.quit-screen button {
    padding: 15px 30px;
    font-size: 1.5em;
    background-color: #ddd;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.quit-screen button:hover {
    background-color: #eee;
}

@media (max-width: 768px) {
  #joystick-container {
    display: block;
  }
  
  #jump-button {
    display: block;
  }
  
  .instructions {
    display: none !important; 
  }
  
  #flashlight-toggle {
    top: 10px;
    right: 10px;
    font-size: 12px;
  }
}

/* Death Screen Styles */
.death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    text-align: center;
}

.death-screen h1 {
    font-size: 4em;
    margin-bottom: 20px;
}

.death-screen button {
    padding: 15px 30px;
    font-size: 1.5em;
    margin: 10px;
    background-color: rgba(255, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.death-screen button:hover {
    background-color: rgba(255, 0, 0, 0.9);
}

/* Win Screen Styles */
.win-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 0, 0.8);
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    text-align: center;
}

.win-screen h1 {
    font-size: 4em;
    margin-bottom: 20px;
}

.win-screen button {
    padding: 15px 30px;
    font-size: 1.5em;
    margin: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.win-screen button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}