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

body {
    background-color: #5c94fc;
    /* Mario Sky Blue */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4/3;
    max-height: 100vh;
    background: #5c94fc;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    /* Crisp pixels */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 20px;
    text-shadow: 2px 2px 0 #000;
    z-index: 10;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

h1 {
    font-size: 40px;
    margin-bottom: 20px;
    color: #ff3333;
    text-shadow: 4px 4px 0 #000;
}

p {
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.5;
}

.controls {
    color: #ffff00;
    font-size: 12px;
    margin-top: 20px;
}

button {
    background: #ff3333;
    border: 4px solid white;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    padding: 15px 30px;
    margin-top: 20px;
    cursor: pointer;
    transition: transform 0.1s;
    pointer-events: auto;
}

button:active {
    transform: scale(0.95);
}

.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 100px;
    display: none;
    /* Hidden on desktop */
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
        pointer-events: auto;
    }

    #gameCanvas {
        height: 100%;
    }

    .game-container {
        aspect-ratio: auto;
        height: 100vh;
    }
}

.mobile-controls button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid white;
    font-size: 24px;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.mobile-controls #jump-btn {
    background: rgba(255, 50, 50, 0.5);
    margin-bottom: 20px;
}