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

html, body {
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.game-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(229, 57, 53, 0.3),
        0 0 100px rgba(255, 215, 0, 0.1),
        0 0 0 2px rgba(255,255,255,0.1);
    max-width: 100vw;
    max-height: 60vh;
}

#game {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100vw;
    max-height: 60vh;
    width: auto;
    height: auto;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 100;
    pointer-events: none;
}

.dpad {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.dpad-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}

.dpad-btn:active {
    background: rgba(0,204,255,0.4);
}

.jump-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255,0,0,0.5);
    background: rgba(255,0,0,0.2);
    color: #ff4444;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.1s;
    pointer-events: auto;
}

.jump-btn:active {
    background: rgba(255,0,0,0.5);
    transform: scale(0.95);
}

/* Show mobile controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
    
    .game-container {
        max-height: 55vh;
    }
    
    #game {
        max-height: 55vh;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        max-height: 70vh;
    }
    
    #game {
        max-height: 70vh;
    }
    
    .mobile-controls {
        padding: 10px 20px;
    }
    
    .dpad-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
    
    .jump-btn {
        width: 80px;
        height: 80px;
        font-size: 12px;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .dpad-btn {
        width: 60px;
        height: 60px;
    }
    
    .jump-btn {
        width: 85px;
        height: 85px;
    }
}
