.game-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s;
}

.overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.overlay-content img {
  max-width: 80%;
  max-height: 70vh;
}

.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/desert_background/desert.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.start-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

.start-screen img {
  max-width: 80%;
  max-height: 60vh;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.start-button {
  position: relative;
  background-color: #ffb900;
  border: 3px solid #8b4513;
  color: #8b4513;
  font-family: 'nashvill', Arial, sans-serif;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: bold;
  text-shadow: 1px 1px 0 #fff;
  padding: clamp(8px, 2vw, 12px) clamp(24px, 5vw, 36px);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 -4px 0 #d89e00;
  overflow: hidden;
  letter-spacing: 2px;
  transform: rotate(-2deg);
  max-width: 80vw;
  white-space: nowrap;
}

.start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.1) 10px,
    rgba(255, 255, 255, 0) 10px,
    rgba(255, 255, 255, 0) 20px
  );
  z-index: 1;
}

.start-button .button-text {
  position: relative;
  z-index: 2;
}

.start-button:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 -4px 0 #d89e00;
  background-color: #ffc930;
}

.start-button:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.start-button::after {
  content: '🌵';
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 16px;
  z-index: 2;
}

.impressum-button {
  margin-top: 20px;
  background-color: #ffb900;
  border: 3px solid #8b4513;
  color: #8b4513;
  font-family: 'nashvill', Arial, sans-serif;
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: bold;
  padding: clamp(6px, 1.5vw, 8px) clamp(16px, 4vw, 24px);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  max-width: 80vw;
  white-space: nowrap;
  display: inline-block;
}

.impressum-button:hover {
  background-color: #ffc930;
  transform: scale(1.05);
}

.impressum-button:active {
  transform: scale(0.95);
}

.restart-button {
  margin-top: 20px;
  padding: 10px 30px;
  font-size: 24px;
  background-color: #FFAE00;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 150px; 
  padding: 10px 15px;
  font-size: 16px;
  text-align: center;
  margin: 0 10px;
}

.restart-button:hover {
  background-color: #FF8C00;
  transform: scale(1.1);
}

.back-button {
  padding: 10px 30px;
  font-size: 24px;
  background-color: #2E86C1;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 150px; 
  padding: 10px 15px;
  font-size: 16px;
  text-align: center;
  margin: 0 10px;
}

.back-button:hover {
  background-color: #1A5276;
  transform: scale(1.1);
}

.button-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.mute-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.mute-button img {
  width: 24px;
  height: 24px;
}

.mute-button:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.sound-on {
  background-color: transparent;
  color: white;
}

.sound-off {
  background-color: transparent;
  color: white;
}

.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  font-family: Arial, sans-serif;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
}

.close-button:hover {
  color: #000;
}

#impressum-text {
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.game-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 768px) {
  .button-container {
    flex-direction: column;
    align-items: center;
  }
  
  .restart-button, .back-button {
    width: 80%;
    margin-bottom: 10px;
  }
  
  .start-button {
    font-size: clamp(16px, 4vw, 20px);
    padding: clamp(10px, 3vw, 14px) clamp(20px, 6vw, 30px);
    margin-bottom: 15px;
  }
  
  .impressum-button {
    font-size: clamp(12px, 3vw, 16px);
    padding: clamp(8px, 2vw, 10px) clamp(16px, 5vw, 20px);
  }
}

@media screen and (max-width: 480px) {
  .start-button {
    font-size: 16px;
    padding: 10px 20px;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }
  .impressum-button {
    font-size: 14px;
    padding: 8px 16px;
    letter-spacing: 1px;
  }
  .start-screen img {
    max-width: 90%;
    max-height: 50vh;
    margin-bottom: 15px;
  }
}

@media screen and (max-width: 320px) {
  .start-button {
    font-size: 14px;
    padding: 8px 16px;
    transform: rotate(0deg);
  }
  .impressum-button {
    font-size: 12px;
    padding: 6px 12px;
    transform: rotate(0deg);
  }
}

@media (hover: none) and (pointer: coarse) {
  .start-button, .impressum-button {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .start-button:active, .impressum-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}