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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1a1a1a;
    font-family: Arial, sans-serif;
}

#game-container {
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    background-color: #00b4ff;
    width: 100%;
    height: auto;
    max-width: 1080px;
    max-height: 720px;
}

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

#score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Touch Controls */
#touch-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    pointer-events: all;
    display: none; /* Hidden by default, shown on touch devices */
}

.touch-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: background 0.1s;
}

.touch-btn:active {
    background: rgba(255, 255, 255, 0.5);
}

.touch-btn-left {
    bottom: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
}

.touch-btn-right {
    bottom: 20px;
    left: 120px;
    width: 80px;
    height: 80px;
}

.touch-btn-jump {
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 80px;
}

/* Show touch controls on touch-enabled devices */
@media (hover: none) and (pointer: coarse) {
    #touch-controls {
        display: block;
    }
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    body {
        padding: 10px;
    }

    #game-container {
        width: 100%;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }
}

/* Portrait orientation tweaks */
@media (max-width: 900px) and (orientation: portrait) {
    body {
        padding: 10px;
    }

    #game-container {
        width: 100%;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    #touch-controls {
        display: block;
        height: 200px;
    }

    .touch-btn-left,
    .touch-btn-right {
        width: 90px;
        height: 90px;
    }

    .touch-btn-jump {
        width: 140px;
        height: 90px;
    }
}
