html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    background: #222;
    /* Add support for iOS safe areas */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Wir nutzen nun ein Fullscreen-Canvas */
#gameContainer {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Overlay für Restart-Button, zunächst versteckt */
#restartOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#restartButton {
    padding: 15px 30px;
    font-size: 1.5rem;
    background-color: #ff4500;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#restartButton:hover {
   background-color: #ff2d00;
}

/* Update the level and speed display positions to respect safe areas */
#levelDisplay, .level-display {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    color: white;
    font-size: 24px;
    font-family: Arial, sans-serif;
    z-index: 1000;
}

.speed-display {
    position: absolute;
    top: max(60px, env(safe-area-inset-top) + 40px);
    left: max(20px, env(safe-area-inset-left));
    color: white;
    font-size: 24px;
    z-index: 1000;
}

/* Update control buttons container */
#controlsOverlay {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
    box-sizing: border-box;
    z-index: 1000;
}

.control-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Remove margin-bottom since we're handling positioning in the container */
}

.control-button:active {
    background-color: rgba(255, 255, 255, 0.5);
}
