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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: #fff;
    overflow-y: auto;
    margin: 0;
    padding: 10px;
}

.game-container {
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.3), 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.2);
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 4px;
    color: #00ff88;
    font-weight: bold;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.stats span {
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    white-space: nowrap;
}

#gameCanvas {
    border: 3px solid #00ff88;
    display: block;
    background: #0a0a1a;
    box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.2), 0 0 30px rgba(0, 255, 136, 0.3);
    border-radius: 5px;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.controls {
    text-align: center;
    margin-top: 10px;
    flex-shrink: 0;
}

.controls p {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #aaa;
    letter-spacing: 1px;
}

/* Mobile/Desktop controls visibility */
.mobile-controls {
    display: none;
}

.desktop-controls {
    display: block;
}

/* Show mobile controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: block;
    }
    .desktop-controls {
        display: none;
    }
}

button {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6f 100%);
    color: #0a0a1a;
    border: none;
    padding: 14px 35px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
    font-family: 'Courier New', monospace;
}

button:hover {
    background: linear-gradient(135deg, #00cc6f 0%, #00ff88 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #00ff88;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
    max-width: min(90vw, 700px);
    max-height: 85vh;
    overflow-y: auto;
    width: 100%;
}

.modal-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    letter-spacing: 3px;
}

.intro-content h2 {
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    margin-bottom: 6px;
    font-size: 2em;
}

.intro-text {
    text-align: left;
    margin-bottom: 10px;
}

.intro-text .tagline {
    font-size: 1em;
    color: #ffff00;
    text-align: center;
    margin-bottom: 6px;
    font-weight: bold;
}

.intro-text > p {
    margin-bottom: 8px;
    line-height: 1.3;
    font-size: 0.85em;
}

.enemy-types {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.enemy-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.enemy-info:last-child {
    margin-bottom: 0;
}

.enemy-icon {
    font-size: 2.2em;
    min-width: 70px;
    width: 70px;
    height: 50px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.enemy-info strong {
    color: #00ff88;
    display: block;
    margin-bottom: 2px;
    font-size: 0.85em;
}

.enemy-info p {
    margin: 0;
    color: #aaa;
    font-size: 0.8em;
}

.bonus-tip {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    padding: 6px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.85em;
}

.bonus-tip strong {
    color: #ffff00;
}

.controls-text {
    text-align: center;
    color: #ccc;
    margin-top: 6px;
    font-size: 0.85em;
}

.start-btn {
    font-size: 1.1em;
    padding: 10px 25px;
    animation: pulse 2s ease-in-out infinite;
}

.modulr-link {
    margin-top: 15px;
    font-size: 0.75em;
    color: #888;
}

.modulr-link a {
    color: #00ff88;
    text-decoration: none;
    font-weight: bold;
}

.modulr-link a:hover {
    text-decoration: underline;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(0, 255, 136, 0.6);
    }
}

.modal-content p {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

#finalScore {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8);
}

/* Responsive design */
@media (max-width: 900px) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 8px;
    }

    .header {
        margin-bottom: 5px;
    }

    .header h1 {
        font-size: 1.4em;
        margin-bottom: 3px;
    }

    .stats {
        font-size: 0.9em;
        padding: 6px;
        margin-bottom: 8px;
    }

    #gameCanvas {
        max-height: calc(100vh - 220px);
    }

    .controls {
        margin-top: 5px;
    }

    .controls p {
        margin-bottom: 8px;
        font-size: 0.9em;
    }

    button {
        padding: 10px 20px;
        font-size: 1em;
    }

    .modal-content {
        padding: 12px;
        max-height: 95vh;
    }

    .modal-content h2 {
        font-size: 2em;
    }

    .modal-content p {
        font-size: 1.3em;
    }

    /* Compact intro modal on mobile */
    .intro-content h2 {
        font-size: 1.5em;
        margin-bottom: 4px;
    }

    .intro-text .tagline {
        font-size: 0.85em;
        margin-bottom: 4px;
    }

    .intro-text > p {
        font-size: 0.75em;
        margin-bottom: 6px;
    }

    .enemy-types {
        padding: 6px;
        margin-bottom: 6px;
    }

    .enemy-info {
        gap: 6px;
        margin-bottom: 5px;
    }

    .enemy-icon {
        font-size: 1.6em;
        min-width: 55px;
        width: 55px;
        height: 38px;
    }

    .enemy-info strong {
        font-size: 0.75em;
    }

    .enemy-info p {
        font-size: 0.7em;
    }

    .bonus-tip {
        padding: 5px;
        margin-bottom: 6px;
        font-size: 0.75em;
    }

    .controls-text {
        font-size: 0.75em;
        margin-top: 4px;
    }

    .start-btn {
        font-size: 1em;
        padding: 10px 20px;
    }

    /* Game over modal on mobile */
    #gameOver .modal-content {
        padding: 20px;
        max-height: 50vh;
    }

    #gameOver .modal-content h2 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    #gameOver .modal-content p {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
}

/* Glow animation for title */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 255, 136, 1), 0 0 40px rgba(0, 255, 136, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

.header h1 {
    animation: glow 2s ease-in-out infinite;
}
