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

html, body {
    background: #000;
    font-family: 'Courier New', monospace;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    position: fixed;
}

#gameContainer {
    position: fixed;
    border: 2px solid #0f0;
    background: #000;
    overflow: hidden;
    transform-origin: top left;
    transition: transform 0.3s ease;
}

/* Ensure UI elements are properly positioned */
#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 16px;
    color: #0f0;
    pointer-events: none;
}

/* Ensure start screen and game over screens are centered */
#startScreen, #gameOver {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
}

/* Mobile viewport fixes */
@media screen and (max-width: 768px) {
    html, body {
        height: 100%;
        width: 100%;
        overflow: hidden;
    }
}

/* Prevent mobile zoom and scrolling */
@media screen and (max-width: 768px) {
    #gameContainer {
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

#gameCanvas {
    display: block;
    background: #000;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 16px;
    color: #0f0;
}

#score {
    margin-bottom: 5px;
}

#lives {
    margin-bottom: 5px;
}

#level {
    margin-bottom: 5px;
}

#gameOver {
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border: 2px solid #f00;
    border-radius: 10px;
    text-align: center;
    display: none;
}

#gameOver h2 {
    color: #f00;
    margin-bottom: 20px;
    font-size: 32px;
}

#gameOver p {
    margin-bottom: 15px;
    font-size: 18px;
}

#emailInput {
    width: 300px;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #0f0;
    background: #000;
    color: #0f0;
    border-radius: 5px;
    margin-bottom: 15px;
}

#submitScore {
    background: #0f0;
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#submitScore:hover {
    background: #00ff00;
}

#startScreen {
    text-align: center;
}

#startScreen h1 {
    color: #0f0;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #0f0;
}

#startScreen p {
    color: #fff;
    font-size: 18px;
    margin-bottom: 30px;
}

#startButton {
    background: #0f0;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#startButton:hover {
    background: #00ff00;
}

.instructions {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}

.error {
    color: #f00;
    font-size: 14px;
    margin-top: 5px;
}
