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

body {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    padding-top: 90px;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 1280px;
    max-height: 960px;
    padding-bottom: 100px;
}

#gameCanvas {
    background-color: #000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 32px;
    text-shadow: 2px 2px #000;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#ui-overlay > div {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border: 2px solid #fff;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Retro-style UI elements */
#score, #lives, #level {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border: 2px solid #fff;
    border-radius: 4px;
}

#powerups-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 16px;
}

.powerup-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #fff;
    border-radius: 3px;
    animation: pulse 0.5s ease-in-out;
}

.powerup-icon {
    width: 16px;
    height: 16px;
    border: 1px solid #fff;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#version {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-family: 'Press Start 2P', monospace;
    z-index: 2500;
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    #version {
        bottom: 115px;
    }
}

@media (max-width: 480px) {
    #version {
        bottom: 105px;
        font-size: 10px;
    }
}

#title-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    text-align: center;
    font-size: 48px;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    color: #fff;
    background: rgba(34, 34, 34, 0.9);
    padding: 24px 0 16px 0;
    z-index: 1001;
    letter-spacing: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

#start-btn {
    font-size: 36px;
    padding: 24px 64px;
    border: 4px solid #fff;
    background: #222;
    color: #fff;
    border-radius: 12px;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

#start-btn:hover {
    background: #444;
}

/* Touch Controls */
#touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 15px;
    padding-bottom: max(25px, calc(env(safe-area-inset-bottom) + 15px));
    z-index: 2000;
    pointer-events: auto;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.5), transparent);
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    min-height: 140px;
}

.movement-controls,
.action-controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

#touch-controls button {
    width: 70px;
    height: 70px;
    border: 3px solid white;
    border-radius: 50%;
    background: rgba(50, 50, 50, 0.85);
    color: white;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    position: relative;
    z-index: 2001;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

#touch-controls button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

#touch-controls button::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
}

/* Media Queries for different screen sizes */
@media (max-width: 768px) {
    #touch-controls button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .movement-controls,
    .action-controls {
        padding: 8px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    #touch-controls button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .movement-controls,
    .action-controls {
        padding: 6px;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    #ui-overlay {
        font-size: 24px;
        top: 10px;
        left: 10px;
        right: 10px;
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    #ui-overlay > div {
        padding: 6px 12px;
        font-size: 20px;
        background-color: rgba(0, 0, 0, 0.8);
        border-width: 3px;
    }
    
    #title-bar {
        font-size: 32px;
        padding: 16px 0 12px 0;
    }
}

@media (max-width: 480px) {
    #ui-overlay {
        font-size: 18px;
        top: 5px;
        left: 5px;
        right: 5px;
    }
    
    #ui-overlay > div {
        padding: 4px 8px;
        font-size: 16px;
    }
    
    #title-bar {
        font-size: 24px;
        padding: 12px 0 8px 0;
    }
}

/* Restart Button */
#restart-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 24px;
    padding: 20px 40px;
    border: 4px solid #fff;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 12px;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    cursor: pointer;
    z-index: 3000;
    transition: background 0.2s;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    pointer-events: auto;
}

#restart-btn:hover, #restart-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, 0) scale(1.05);
}

@media (max-width: 768px) {
    #restart-btn {
        font-size: 20px;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    #restart-btn {
        font-size: 18px;
        padding: 12px 24px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding-bottom: 200px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding-bottom: 180px;
    }
}

/* Pause Menu */
#pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#pause-content {
    background: rgba(34, 34, 34, 0.95);
    padding: 40px 60px;
    border: 4px solid #fff;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#pause-content h2 {
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    font-size: 48px;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 3px 3px #000;
}

#pause-content button {
    display: block;
    width: 100%;
    font-size: 24px;
    padding: 15px 30px;
    margin: 15px 0;
    border: 3px solid #fff;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 8px;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

#pause-content button:hover,
#pause-content button:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    #pause-content {
        padding: 30px 40px;
    }

    #pause-content h2 {
        font-size: 36px;
    }

    #pause-content button {
        font-size: 20px;
        padding: 12px 24px;
    }
}

@media (max-width: 480px) {
    #pause-content {
        padding: 20px 30px;
    }

    #pause-content h2 {
        font-size: 28px;
    }

    #pause-content button {
        font-size: 16px;
        padding: 10px 20px;
    }
} 