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

html, body {
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Press Start 2P', monospace;
    color: #00ff41;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a1a 0%, #000 100%);
    padding: 10px;
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 10px;
    border-bottom: 2px solid #00ff41;
    margin-bottom: 10px;
}

#header .score-section,
#header .hiscore-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#header .label {
    font-size: 8px;
    color: #00aa30;
}

#header #score,
#header #hiscore {
    font-size: 14px;
    text-shadow: 0 0 10px #00ff41;
}

#header .title-section h1 {
    font-size: 12px;
    text-shadow: 0 0 20px #00ff41, 0 0 40px #00ff41;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41; }
    50% { text-shadow: 0 0 20px #00ff41, 0 0 40px #00ff41, 0 0 60px #00ff41; }
}

/* Settings */
#settings-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s;
}

#settings-toggle:hover {
    transform: rotate(90deg);
}

#settings-panel {
    position: absolute;
    top: 50px;
    right: 10px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff41;
    padding: 20px;
    z-index: 200;
    max-width: 280px;
}

#settings-panel.hidden {
    display: none;
}

#settings-panel h3 {
    font-size: 12px;
    margin-bottom: 10px;
}

#settings-panel .seed-info {
    font-size: 8px;
    color: #00aa30;
    margin-bottom: 15px;
    line-height: 1.5;
}

#seed-input {
    width: 100%;
    padding: 10px;
    background: #111;
    border: 2px solid #00ff41;
    color: #00ff41;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

#regenerate-btn {
    width: 100%;
    padding: 12px;
    background: #00ff41;
    color: #000;
    border: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

#regenerate-btn:hover {
    background: #00cc33;
    transform: scale(1.02);
}

#close-settings {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: #ff4444;
    font-size: 16px;
    cursor: pointer;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loading-screen.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-content h2 {
    font-size: 14px;
    margin-bottom: 30px;
    animation: blink 1s infinite;
}

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

.loading-bar {
    width: 200px;
    height: 20px;
    border: 2px solid #00ff41;
    margin: 0 auto 20px;
    position: relative;
}

#loading-progress {
    height: 100%;
    background: #00ff41;
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 20px #00ff41;
}

#loading-status {
    font-size: 10px;
    color: #00aa30;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    cursor: pointer;
}

#start-screen.hidden {
    display: none;
}

.start-content {
    text-align: center;
}

.glow-title {
    font-size: 24px;
    margin-bottom: 40px;
    text-shadow: 0 0 20px #00ff41, 0 0 40px #00ff41, 0 0 60px #00ff41;
    animation: titlePulse 1.5s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#alien-preview {
    margin-bottom: 40px;
}

.start-prompt {
    font-size: 14px;
    animation: blink 1s infinite;
    margin-bottom: 20px;
}

.seed-display {
    font-size: 10px;
    color: #00aa30;
}

/* Game Over Screen */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

#game-over-screen.hidden {
    display: none;
}

.game-over-title {
    font-size: 32px;
    color: #ff4444;
    text-shadow: 0 0 20px #ff4444;
    margin-bottom: 40px;
    animation: gameOverFlash 0.5s ease-in-out 3;
}

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

#final-score-display {
    text-align: center;
    margin-bottom: 20px;
}

#final-score-display p {
    font-size: 12px;
    color: #00aa30;
    margin-bottom: 10px;
}

#final-score {
    font-size: 32px;
    text-shadow: 0 0 20px #00ff41;
}

#new-hiscore {
    font-size: 14px;
    color: #ffff00;
    text-shadow: 0 0 20px #ffff00;
    margin-bottom: 30px;
    animation: celebratePulse 0.5s ease-in-out infinite;
}

#new-hiscore.hidden {
    display: none;
}

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

#play-again-btn {
    padding: 15px 30px;
    background: #00ff41;
    color: #000;
    border: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

#play-again-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px #00ff41;
}

/* Canvas */
#canvas {
    border: 2px solid #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    background: #0a0a0a;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Game UI */
#game-ui {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

#game-ui.hidden {
    display: none;
}

#lives-display {
    display: flex;
    gap: 5px;
}

.life-icon {
    font-size: 16px;
    color: #00ff41;
}

#wave-display {
    font-size: 10px;
    color: #00aa30;
}

#pause-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    cursor: pointer;
    pointer-events: all;
}

/* Paused Overlay */
#paused-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 400;
    cursor: pointer;
}

#paused-overlay.hidden {
    display: none;
}

#paused-overlay h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

#paused-overlay p {
    font-size: 12px;
    animation: blink 1s infinite;
}

/* Touch Controls */
#touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 10px 20px;
    margin-top: 10px;
}

#touch-controls.hidden {
    display: none;
}

.control-btn {
    background: rgba(0, 255, 65, 0.2);
    border: 2px solid #00ff41;
    color: #00ff41;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    padding: 15px 25px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: all 0.1s;
}

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

#fire-btn {
    font-size: 12px;
    padding: 15px 30px;
    background: rgba(255, 0, 100, 0.3);
    border-color: #ff0066;
    color: #ff0066;
}

#fire-btn:active {
    background: rgba(255, 0, 100, 0.6);
}

/* Footer */
#footer {
    margin-top: auto;
    padding: 10px;
    font-size: 8px;
    color: #444;
}

#footer a {
    color: #00aa30;
    text-decoration: none;
}

#footer a:hover {
    text-shadow: 0 0 10px #00ff41;
}

/* Responsive */
@media (max-width: 480px) {
    #header .title-section h1 {
        font-size: 10px;
    }
    
    .glow-title {
        font-size: 18px;
    }
    
    .game-over-title {
        font-size: 24px;
    }
    
    #final-score {
        font-size: 24px;
    }
}

@media (min-height: 800px) {
    #game-container {
        justify-content: center;
    }
}