* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Press Start 2P', monospace;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #000011 0%, #000033 100%);
}

#gameCanvas {
    display: block;
    background: #000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1vh 2vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

#score-board {
    color: #fff;
    font-size: clamp(8px, 2.5vw, 14px);
    text-shadow: 2px 2px #000;
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
}

#lives {
    font-size: clamp(12px, 4vw, 24px);
    color: #ff0044;
    text-shadow: 0 0 10px #ff0044;
}

.life {
    opacity: 1;
    transition: opacity 0.3s;
}

.life.lost {
    opacity: 0.2;
    text-shadow: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20;
    color: #fff;
    text-align: center;
    padding: 2vh;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: clamp(24px, 8vw, 64px);
    color: #00ff00;
    text-shadow: 4px 4px #004400, 0 0 20px #00ff00;
    line-height: 1.5;
    margin-bottom: 4vh;
}

.screen p {
    font-size: clamp(10px, 3vw, 18px);
    margin: 1vh 0;
    color: #fff;
}

.controls-info {
    margin-top: 4vh;
    color: #888;
    font-size: clamp(8px, 2vw, 12px);
    line-height: 2;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#mobile-controls {
    position: absolute;
    bottom: 2vh;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4vw;
    z-index: 15;
    padding: 0 2vw;
}

.mobile-btn {
    width: clamp(50px, 15vw, 80px);
    height: clamp(50px, 15vw, 80px);
    border: 3px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    font-size: clamp(16px, 5vw, 24px);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-touch-callout: none;
}

.mobile-btn:active, .mobile-btn.pressed {
    background: rgba(0, 255, 0, 0.4);
    transform: scale(0.95);
    box-shadow: 0 0 20px #00ff00;
}

.shoot-btn {
    width: clamp(70px, 20vw, 100px);
    height: clamp(70px, 20vw, 100px);
    border-color: #ff0044;
    color: #ff0044;
    background: rgba(255, 0, 68, 0.1);
    font-size: clamp(20px, 6vw, 32px);
}

.shoot-btn:active, .shoot-btn.pressed {
    background: rgba(255, 0, 68, 0.4);
    box-shadow: 0 0 20px #ff0044;
}

@media (min-width: 768px) {
    #mobile-controls {
        display: none;
    }
}

@media (max-width: 400px) {
    .screen h1 {
        font-size: 28px;
    }
    
    .controls-info {
        display: none;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #mobile-controls {
        bottom: 1vh;
    }
    
    .mobile-btn {
        width: clamp(40px, 10vw, 60px);
        height: clamp(40px, 10vw, 60px);
    }
    
    .shoot-btn {
        width: clamp(50px, 12vw, 70px);
        height: clamp(50px, 12vw, 70px);
    }
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
