.mobile-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
}

@media screen and (max-width: 1024px) {
  .mobile-controls {
    display: block;
  }
}

.mobile-buttons-left {
  position: absolute;
  left: 20px;
  bottom: 0;
  display: flex;
  gap: 50px;
  pointer-events: auto;
}

.mobile-buttons-right {
  position: absolute;
  right: 20px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: auto;
}

.mobile-btn {
  width: clamp(40px, 6vw, 50px);
  height: clamp(40px, 6vw, 50px);
  border: none;
  border-radius: 50%;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.1s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0.7;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.touch-controls-toggle {
  position: absolute;
  top: 60px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(102, 126, 234, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 100;
  opacity: 0.95;
  -webkit-tap-highlight-color: transparent;
  display: none; /* Standardmäßig versteckt */
  visibility: visible !important;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

@media screen and (max-width: 1024px) {
  .touch-controls-toggle {
    display: block !important;
  }
}

.touch-controls-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 25px rgba(102, 126, 234, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.15);
  opacity: 1;
}

.touch-controls-toggle:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

.touch-controls-toggle.active {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  box-shadow: 
    0 4px 15px rgba(255, 107, 107, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

.touch-controls-toggle.active:hover {
  box-shadow: 
    0 8px 25px rgba(255, 107, 107, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.15);
}

@keyframes pulse {
  0% {
    box-shadow: 
      0 4px 15px rgba(255, 107, 107, 0.4),
      0 2px 4px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(255, 107, 107, 0.6),
      0 2px 4px rgba(0, 0, 0, 0.1);
  }
  100% {
    box-shadow: 
      0 4px 15px rgba(255, 107, 107, 0.4),
      0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

.touch-controls-toggle:hover {
  opacity: 1;
  transform: scale(1.05);
}

.touch-controls-toggle:active {
  transform: scale(0.95);
}

.touch-controls-toggle.active {
  background: linear-gradient(145deg, rgba(255, 107, 107, 0.9), rgba(229, 90, 90, 0.9));
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.direction-btn {
  background: linear-gradient(145deg, rgba(74, 144, 226, 0.8), rgba(53, 122, 189, 0.8));
  color: white;
  font-size: clamp(16px, 3vw, 20px);
}

.action-btn {
  background: linear-gradient(145deg, rgba(255, 107, 107, 0.8), rgba(229, 90, 90, 0.8));
  color: white;
  font-size: clamp(8px, 1.5vw, 10px);
  width: clamp(50px, 8vw, 60px);
  height: clamp(35px, 5vw, 40px);
  border-radius: 20px;
}

.mobile-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-btn.pressed {
  background: linear-gradient(145deg, #357abd, #2863a0);
  transform: scale(0.95);
}

.action-btn.pressed {
  background: linear-gradient(145deg, #e55a5a, #d14545);
}

.rotate-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.rotate-content {
  padding: 40px;
}

.rotate-icon {
  font-size: 80px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-icon {
  display: inline-block;
  animation: rotatePhone 2s infinite ease-in-out;
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(90deg); }
  75% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate-content h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: #FFAE00;
}

.rotate-content p {
  font-size: 16px;
  color: #ccc;
}

@media screen and (max-width: 850px) {
  .mobile-controls {
    display: block;
  }
  
  .touch-controls-toggle {
    display: block !important;
  }
  
  .controls-box {
    display: none;
  }
  
  .start-button, .impressum-button {
    min-height: 44px;
    min-width: 44px;
  }
}

@media screen and (max-width: 650px) {
  .touch-controls-toggle {
    right: 60px;
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .start-button {
    font-size: clamp(14px, 4vw, 18px);
    padding: clamp(8px, 2.5vw, 12px) clamp(16px, 5vw, 24px);
  }
  
  .impressum-button {
    font-size: clamp(12px, 3.5vw, 16px);
    padding: clamp(6px, 2vw, 10px) clamp(12px, 4vw, 20px);
  }
  
  .mobile-btn {
    width: clamp(35px, 5vw, 45px);
    height: clamp(35px, 5vw, 45px);
    opacity: 0.6;
  }
  
  .action-btn {
    width: clamp(45px, 7vw, 55px);
    height: clamp(30px, 4vw, 35px);
    font-size: clamp(7px, 1.2vw, 9px);
  }
}

@media screen and (max-width: 850px) and (orientation: portrait) {
  .rotate-message {
    display: flex;
  }
  
  .mobile-controls {
    display: none;
  }
  
  canvas {
    filter: blur(3px);
  }
  
  .controls-box {
    display: none;
  }
}

@media screen and (max-width: 850px) and (max-height: 850px) {
  .rotate-message {
    display: flex;
  }
  
  .mobile-controls {
    display: none;
  }
  
  canvas {
    filter: blur(3px);
  }
}
