body {
      margin: 0;
      overflow: hidden;
    }

    .map {
      width: 5000px;  /* Make the map much wider for scrolling */
      height: 100vh;
      background: linear-gradient(to bottom, skyblue, lightblue);
      position: relative;
      overflow: hidden;
    }

    .ground {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 25vh;
      background: linear-gradient(to bottom, #8B4513, #654321);  /* Erdfarben */
      z-index: 1;
    }

    .viewport {
      width: 100vw;
      height: 100vh;
      position: fixed;
      top: 0;
      left: 0;
      overflow: hidden;
    }

    .castle {
      position: absolute;
      bottom: 25vh;  /* Auf dem Boden platzieren */
      width: 100px;
      height: 100px;
      background-color: gray;
      border-top-left-radius: 10px;
      border-top-right-radius: 10px;
      z-index: 1;
    }

    #castle-left {
      left: 50px;
    }

    #castle-right {
      right: 50px;
    }

    .tower {
      position: absolute;
      bottom: 25vh;  /* Auf dem Boden platzieren */
      background-color: darkgray;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
      z-index: 1;
    }

    .player {
      position: absolute;
      bottom: 145px;
      left: 50px;
      width: 30px;
      height: 50px;
      z-index: 2;
    }

    .player-head {
      width: 30px;
      height: 30px;
      background-color: lightblue;
      border-radius: 50%;
      position: absolute;
      top: 0;
    }

    .player-body {
      width: 20px;
      height: 10px;
      background-color: lightblue;
      position: absolute;
      top: 30px;
      left: 5px;
    }

    .player-legs {
      position: absolute;
      top: 40px;
      display: flex;
      justify-content: space-between;
      width: 100%;
    }

    .player-leg {
      width: 10px;
      height: 20px;
      background-color: lightblue;
    }

    #game-over {
      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: center;
    }

    #game-win {
      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: center;
    }

    .controls {
      position: absolute;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 10px;
    }

    .controls button {
      padding: 10px 20px;
      font-size: 16px;
    }

    .menu-screen {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background-color: rgba(0, 0, 0, 0.8);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: white;
      z-index: 1000;
    }

    .difficulty-buttons {
      display: flex;
      gap: 20px;
      margin-top: 20px;
    }

    .menu-screen button {
      padding: 10px 20px;
      font-size: 18px;
      cursor: pointer;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 5px;
      transition: background-color 0.3s;
    }

    .menu-screen button:hover {
      background-color: #45a049;
    }

    .game-controls {
      display: none; /* Standardmäßig ausgeblendet */
      position: fixed;
      bottom: 20px;
      width: 100%;
      pointer-events: none;
      z-index: 1000;
    }

    /* Nur auf Touch-Geräten anzeigen */
    @media (hover: none) and (pointer: coarse) {
      .game-controls {
        display: flex;
        justify-content: space-between;
        padding: 0 20px;
      }
    }

    .left-controls {
      display: flex;
      gap: 20px;
      pointer-events: auto;
    }

    .right-controls {
      pointer-events: auto;
    }

    .control-btn {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      border: none;
      background: rgba(0, 0, 0, 0.6);
      color: white;
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
      transition: transform 0.1s, background-color 0.2s;
    }

    .control-btn:active {
      transform: scale(0.95);
      background: rgba(0, 0, 0, 0.8);
    }

    .d-pad-left, .d-pad-right {
      background: rgba(50, 50, 50, 0.8);
    }

    .action-btn {
      background: rgba(76, 175, 80, 0.8);
      font-family: Arial, sans-serif;
      font-weight: bold;
    }

    .arrow {
      line-height: 1;
    }

    .jump-text {
      font-size: 28px;
      font-weight: bold;
    }
