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

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

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    max-width: 100vw;
    max-height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    border: 3px solid #00ff00;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    font-size: 16px;
    color: #00ff00;
    text-shadow:
        0 0 10px rgba(0, 255, 0, 0.8),
        0 0 20px rgba(0, 255, 0, 0.4);
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-center {
    align-items: center;
}

.hud-right {
    align-items: flex-end;
}

#hud > div > div {
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border: 2px solid #00ff00;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    white-space: nowrap;
}

#combo {
    color: #ffff00;
    text-shadow:
        0 0 10px rgba(255, 255, 0, 0.8),
        0 0 20px rgba(255, 255, 0, 0.4);
    border-color: #ffff00 !important;
    animation: pulse 0.5s ease-in-out infinite;
}

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

#weapon-info {
    color: #00aaff;
    border-color: #00aaff !important;
    font-size: 14px;
}

/* Screens */
#loading-screen,
#start-screen,
#game-over-screen,
#pause-screen {
    position: absolute;
    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: 100;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none !important;
}

/* Typography */
h1 {
    font-size: 48px;
    color: #00ff00;
    text-shadow:
        0 0 20px rgba(0, 255, 0, 0.8),
        0 0 40px rgba(0, 255, 0, 0.4);
    margin-bottom: 20px;
    letter-spacing: 8px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(0, 255, 0, 0.8),
            0 0 40px rgba(0, 255, 0, 0.4);
    }
    50% {
        text-shadow:
            0 0 30px rgba(0, 255, 0, 1),
            0 0 60px rgba(0, 255, 0, 0.6);
    }
}

.subtitle {
    font-size: 16px;
    color: #0f0;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

/* Loading Bar */
.loading-bar {
    width: 400px;
    height: 30px;
    border: 2px solid #00ff00;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

#loading-text {
    color: #0f0;
    font-size: 14px;
    margin-top: 10px;
}

/* Controls Box */
.controls {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid #00ff00;
    padding: 20px 40px;
    margin: 20px 0;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.controls p {
    margin: 10px 0;
    font-size: 16px;
    color: #fff;
    line-height: 1.6;
}

.controls strong {
    color: #00ff00;
    font-size: 18px;
    letter-spacing: 2px;
}

/* Features Box */
.features {
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid #00ffff;
    padding: 15px 30px;
    margin: 20px 0;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.features p {
    margin: 8px 0;
    font-size: 14px;
    color: #fff;
    line-height: 1.8;
}

.features strong {
    color: #00ffff;
    font-size: 16px;
    letter-spacing: 2px;
}

/* Buttons */
button {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    padding: 15px 40px;
    margin: 10px;
    border: 3px solid #00ff00;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.btn-primary:hover {
    background: #00cc00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

.btn-secondary {
    background: transparent;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.btn-secondary:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

/* Game Over Stats */
#final-score,
#final-wave,
#max-combo {
    font-size: 24px;
    color: #fff;
    margin: 10px 0;
    padding: 10px 20px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-radius: 5px;
}

#max-combo {
    background: rgba(255, 255, 0, 0.1);
    border-color: #ffff00;
    color: #ffff00;
}

#high-score-rank {
    font-size: 20px;
    color: #ffff00;
    margin: 15px 0;
    padding: 10px 20px;
    background: rgba(255, 255, 0, 0.2);
    border: 2px solid #ffff00;
    border-radius: 5px;
    animation: pulse 1s ease-in-out infinite;
}

/* High Scores Screen */
#highscores-screen {
    position: absolute;
    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: 100;
    backdrop-filter: blur(5px);
}

#highscores-list {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid #00ff00;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    min-width: 400px;
    max-height: 400px;
    overflow-y: auto;
}

.highscore-entry {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid #00ff00;
    font-size: 16px;
}

.highscore-entry:nth-child(1) {
    border-left-color: #ffff00;
    background: rgba(255, 255, 0, 0.1);
}

.highscore-entry:nth-child(2) {
    border-left-color: #cccccc;
}

.highscore-entry:nth-child(3) {
    border-left-color: #ff9900;
}

.highscore-rank {
    color: #00ff00;
    font-weight: bold;
    min-width: 40px;
}

.highscore-score {
    color: #fff;
    font-weight: bold;
    min-width: 100px;
    text-align: right;
}

.highscore-details {
    color: #888;
    font-size: 14px;
}

.no-scores {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 40px;
}

/* Credits */
.credits {
    position: absolute;
    bottom: 20px;
    font-size: 12px;
    color: #666;
}

.credits p {
    margin: 5px 0;
}

/* Pause Screen */
#pause-screen h1 {
    margin-bottom: 30px;
}

#pause-screen p {
    font-size: 18px;
    color: #0f0;
    margin-bottom: 30px;
}

/* Scanline effect */
#gameCanvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* Wave Complete Notification */
#wave-complete,
#boss-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #00ff00;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    z-index: 90;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
}

#wave-complete {
    animation: fadeInOut 2s ease-in-out;
}

#boss-warning {
    border-color: #ff0000;
    box-shadow: 0 0 60px rgba(255, 0, 0, 0.8);
    animation: pulse-warning 0.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 60px rgba(255, 0, 0, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 80px rgba(255, 0, 0, 1);
    }
}

.warning-text {
    color: #ff0000 !important;
    font-size: 56px !important;
    animation: glow-red 0.5s ease-in-out infinite;
}

@keyframes glow-red {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 0 40px rgba(255, 0, 0, 0.4);
    }
    50% {
        text-shadow: 0 0 40px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 0.8);
    }
}

#boss-warning h2 {
    color: #ffff00;
    font-size: 32px;
    margin: 15px 0;
}

#boss-warning p {
    color: #fff;
    font-size: 18px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

#wave-complete h2 {
    font-size: 36px;
    color: #00ff00;
    margin-bottom: 15px;
}

#wave-bonus {
    font-size: 24px;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

/* Responsive */
@media (max-width: 850px) {
    #game-container {
        width: 100vw;
        height: 75vh;
    }

    h1 {
        font-size: 36px;
    }

    .controls, .features {
        padding: 15px 25px;
    }

    button {
        font-size: 16px;
        padding: 12px 30px;
    }
}
