* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a1e;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    color: #e0e0e0;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

/* === Overlay === */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 20, 0.92);
    backdrop-filter: blur(8px);
    z-index: 10;
    gap: 20px;
    transition: opacity 0.3s;
}

.overlay.hidden {
    display: none;
}

/* === Title === */
.title-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

.game-title {
    font-size: 64px;
    font-weight: bold;
    background: linear-gradient(135deg, #00ffcc, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(0, 255, 204, 0.5));
    animation: titlePulse 2s ease-in-out infinite;
    letter-spacing: 8px;
}

@keyframes titlePulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 255, 204, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(255, 0, 255, 0.7)); }
}

.subtitle {
    font-size: 18px;
    color: #00ffcc;
    letter-spacing: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

.screen-title {
    font-size: 36px;
    color: #00ffcc;
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.gameover-title {
    color: #ff4444;
    text-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
}

/* === Instructions === */
.instructions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 30px;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 8px;
    margin-bottom: 10px;
}

.key-group {
    font-size: 14px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 4px;
    color: #00ffcc;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    min-width: 30px;
    text-align: center;
}

/* === Buttons === */
.neon-btn {
    padding: 12px 40px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    background: transparent;
    color: #00ffcc;
    border: 2px solid #00ffcc;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
    text-transform: uppercase;
    min-width: 200px;
}

.neon-btn:hover {
    background: rgba(0, 255, 204, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3), inset 0 0 20px rgba(0, 255, 204, 0.1);
}

.neon-btn:active {
    transform: scale(0.97);
}

.neon-btn.secondary {
    color: #888;
    border-color: #555;
}

.neon-btn.secondary:hover {
    color: #bbb;
    border-color: #888;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* === Level Cards === */
.level-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.level-card {
    width: 180px;
    min-width: 160px;
    padding: 20px;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.level-card:hover:not(.locked) {
    border-color: #00ffcc;
    background: rgba(0, 255, 204, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    transform: translateY(-4px);
}

.level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.level-num {
    font-size: 32px;
    color: #00ffcc;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.level-name {
    font-size: 16px;
    margin: 8px 0 4px;
    color: #fff;
}

.level-desc {
    font-size: 12px;
    color: #888;
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    opacity: 0.6;
}

/* === Upgrade Cards === */
.upgrade-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.upgrade-card {
    width: 170px;
    padding: 20px 16px;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-card:hover {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
    transform: translateY(-4px);
}

.upgrade-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.upgrade-name {
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
}

.upgrade-desc {
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
}

/* === Stats Panel === */
.stats-panel {
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 8px;
    padding: 16px 30px;
    min-width: 280px;
    margin-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:last-child {
    color: #00ffcc;
    font-weight: bold;
}

/* === Touch Controls === */
#touch-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

#touch-controls.hidden {
    display: none;
}

.touch-left, .touch-right {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.touch-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 255, 204, 0.1);
    border: 2px solid rgba(0, 255, 204, 0.3);
    color: #00ffcc;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.touch-btn:active {
    background: rgba(0, 255, 204, 0.3);
}

.touch-attack {
    border-color: rgba(255, 0, 255, 0.4);
    color: #ff00ff;
    background: rgba(255, 0, 255, 0.1);
}

.touch-shoot {
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

/* === Responsive === */
@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
        letter-spacing: 4px;
    }
    .subtitle {
        font-size: 12px;
        letter-spacing: 6px;
    }
    .level-cards, .upgrade-cards {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    .level-card, .upgrade-card {
        width: 160px;
        min-width: 140px;
    }
    .neon-btn {
        font-size: 15px;
        padding: 10px 30px;
    }
}
