* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #050508;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 56.25vw; /* Fallback für Aspect Ratio */
    max-height: 100vh;
    max-width: 177.78vh; /* 16:9 bzw. angepasst an 2:1 */
    aspect-ratio: 2 / 1;  /* Erzwingt exakt das 2:1 Verhältnis in allen modernen Browsern */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #050508;
}

canvas {
    background-color: #050508;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* OVERLAYS (Start / Gameover) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    z-index: 10;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: clamp(1.2rem, 5vw, 2rem);
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
    margin-bottom: 10px;
}

.btn {
    background: #ff0055;
    color: #fff;
    border: 2px solid #ff0055;
    padding: 10px 24px;
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px #ff0055;
    border-radius: 4px;
    margin-top: 5px;
}

.btn:active {
    transform: scale(0.95);
    background: #cc0044;
}

/* HUD oben */
#hud {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
    font-size: clamp(0.8rem, 3.5vw, 1rem);
    color: #00ffcc;
    text-shadow: 0 0 5px #00ffcc;
}

.highscore-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(0, 255, 204, 0.3);
}

#fullscreen-btn {
    position: absolute;
    bottom: max(8px, env(safe-area-inset-bottom));
    right: max(8px, env(safe-area-inset-right));
    background: rgba(0, 0, 0, 0.7);
    color: #00ffcc;
    border: 1px solid #00ffcc;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-family: inherit;
    z-index: 20;
    border-radius: 4px;
    cursor: pointer;
}