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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    background: #0a0a2e;
    overflow: hidden;
}

@media (min-width: 768px) and (orientation: landscape) {
    #game-container {
        max-width: 100vh;
        max-height: 100vw;
        width: 100vh;
        height: 100vw;
    }
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
}

#score-display {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-size: 12px;
    text-shadow: 2px 2px 0 #000;
}

.score-item .label {
    font-size: 10px;
    color: #aaa;
    margin-bottom: 2px;
}

.score-item span:last-child {
    font-size: 16px;
    font-weight: bold;
    color: #ffff00;
}

#lives-display {
    position: absolute;
    top: 70px;
    left: 10px;
    font-size: 20px;
    text-shadow: 2px 2px 0 #000;
}

#powerup-status {
    position: absolute;
    top: 70px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.powerup-active {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
    border: 2px solid;
    display: flex;
    align-items: center;
    gap: 5px;
}

.powerup-active.shield {
    border-color: #00ffff;
}

.powerup-active.weapon {
    border-color: #ff00ff;
}

.powerup-active.magnet {
    border-color: #ffff00;
}

.powerup-timer {
    font-size: 10px;
    color: #aaa;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 46, 0.95);
    z-index: 20;
    padding: 20px;
    text-align: center;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 32px;
    color: #00ff00;
    text-shadow: 3px 3px 0 #000, 0 0 20px #00ff00;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 3px 3px 0 #000, 0 0 20px #00ff00;
    }
    to {
        text-shadow: 3px 3px 0 #000, 0 0 30px #00ff00, 0 0 40px #00ff00;
    }
}

.subtitle {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
}

.controls-info {
    margin-bottom: 30px;
}

.controls-info p {
    font-size: 14px;
    color: #888;
    margin: 5px 0;
}

.game-btn {
    background: linear-gradient(to bottom, #00ff00, #00aa00);
    border: 3px solid #00ff00;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 40px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #008800, 0 6px 10px rgba(0,0,0,0.5);
    transition: all 0.1s;
    pointer-events: auto;
}

.game-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #008800, 0 3px 5px rgba(0,0,0,0.5);
}

.game-btn:hover {
    background: linear-gradient(to bottom, #00ff33, #00cc00);
}

.final-score {
    margin: 20px 0;
}

.final-score p:first-child {
    font-size: 14px;
    color: #aaa;
}

.final-score p:last-child {
    font-size: 48px;
    color: #ffff00;
    text-shadow: 3px 3px 0 #000;
    font-weight: bold;
}

.new-record {
    font-size: 20px;
    color: #ff00ff;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

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

@media (max-width: 360px) {
    .screen h1 {
        font-size: 24px;
    }

    .game-btn {
        font-size: 16px;
        padding: 12px 30px;
    }

    #score-display {
        padding: 5px;
    }

    .score-item {
        font-size: 10px;
    }

    .score-item span:last-child {
        font-size: 14px;
    }
}
