* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

#game-container {
    position: relative;
    width: 960px;
    height: 540px;
    max-width: 100vw;
    max-height: 100vh;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(40, 233, 140, 0.15);
}

#name-input {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    padding: 10px 16px;
    font-size: 20px;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    color: #28e98c;
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid #28e98c;
    border-radius: 8px;
    outline: none;
    display: none;
    z-index: 10;
    letter-spacing: 2px;
}

#name-input::placeholder {
    color: rgba(40, 233, 140, 0.4);
}

#name-input:focus {
    box-shadow: 0 0 20px rgba(40, 233, 140, 0.3);
}

/* Touch controls for mobile */
.touch-controls {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    pointer-events: none;
    z-index: 5;
}

.touch-btn {
    position: absolute;
    pointer-events: all;
    background: rgba(40, 233, 140, 0.15);
    border: 2px solid rgba(40, 233, 140, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(40, 233, 140, 0.6);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.touch-btn:active {
    background: rgba(40, 233, 140, 0.3);
}

.touch-btn-left { bottom: 20px; left: 20px; }
.touch-btn-right { bottom: 20px; left: 100px; }
.touch-btn-jump { bottom: 20px; right: 20px; }
.touch-btn-shoot { bottom: 20px; right: 100px; }

@media (pointer: coarse) {
    .touch-controls {
        display: block;
    }
}

/* Fullscreen mode */
#game-container:fullscreen,
#game-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

#game-container:fullscreen #game-canvas,
#game-container:-webkit-full-screen #game-canvas {
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 960px) {
    #game-container {
        width: 100vw;
        height: 56.25vw;
        max-height: 100vh;
    }
}

@media (max-height: 540px) {
    #game-container {
        height: 100vh;
        width: 177.78vh;
        max-width: 100vw;
    }
}
