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

html, body {
    background: #1A1A1A;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100%;
    width: 100%;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

#game-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ---- Touch Controls ---- */
#touch-controls {
    display: none; /* Hidden on desktop, shown via JS on mobile */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 20;
    pointer-events: none;
    padding: 0 12px 12px;
    justify-content: space-between;
    align-items: flex-end;
}

#touch-controls.visible {
    display: flex;
}

#touch-left-zone {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

#touch-right-zone {
    pointer-events: auto;
}

.touch-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(45, 45, 45, 0.6);
    background: rgba(45, 45, 45, 0.3);
    color: rgba(245, 245, 240, 0.7);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.touch-btn:active, .touch-btn.pressed {
    background: rgba(45, 45, 45, 0.6);
    border-color: rgba(245, 245, 240, 0.5);
}

.touch-btn-jump {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

/* ---- Mobile overrides ---- */
@media (max-width: 850px), (max-height: 650px) {
    body {
        align-items: flex-start;
    }

    #game-container {
        width: 100vw;
        height: 100vh;
        border: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    /* Touch device detected - controls shown via JS */
}
