@font-face {
    font-family: 'PressStart2P';
    src: url('assets/fonts/PressStart2P.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-color: #000;
    --player-color: #0f0;
    --alien-color: #fff;
    --ufo-color: #f00;
    --bunker-color: #0f0;
    --text-color: #fff;
    --scanline-color: rgba(18, 16, 16, 0.1);
}

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

body {
    background-color: var(--bg-color);
    font-family: 'PressStart2P', cursive;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text-color);
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 900px;
    background: #000;
    border: 2px solid #333;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    display: block;
}

/* CRT Screen Effect */
#screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(var(--scanline-color) 50%, rgba(0, 0, 0, 0) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 100% 100%;
    z-index: 10;
    opacity: 0.8;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
    pointer-events: none;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
    text-align: center;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 33%;
}

.stat-box div:first-child {
    font-size: 12px;
}

#controls {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    pointer-events: auto;
}

.control-group {
    display: flex;
    gap: 15px;
}

.game-btn {
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid #555;
    color: white;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.1s;
}

.game-btn:active {
    transform: scale(0.9);
    background: rgba(80, 80, 80, 0.8);
}

.game-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.fire-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(200, 0, 0, 0.4);
    border-color: #a00;
    font-family: inherit;
    font-size: 14px;
}

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

#overlay-menu {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.pixel-text {
    font-size: 24px;
    margin-bottom: 40px;
    text-shadow: 2px 2px #f00, -2px -2px #00f;
    animation: flicker 0.1s infinite;
}

.menu-btn {
    background: none;
    border: 4px solid #fff;
    color: #fff;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
        color: transparent;
    }
}

@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    100% {
        opacity: 1;
    }
}