@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: #0a0a0f;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    border: 4px solid #00d4ff;
    background: #0a0a0f;
    box-shadow: 8px 8px 0px #00d4ff, inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #00d4ff;
    text-shadow: 4px 4px 0px #7c3aed;
    line-height: 1.5;
    animation: titlePulse 2s ease-in-out infinite;
}

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

.game-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.menu-stats {
    margin-top: 3rem;
    font-size: 0.8rem;
    color: #00d4ff;
    line-height: 1.8;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.btn {
    padding: 1rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 4px solid;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 280px;
    position: relative;
    image-rendering: pixelated;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.btn-primary {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #000;
}

.btn-primary:hover {
    background: #00e5ff;
    border-color: #00e5ff;
}

.btn-secondary {
    background: #0a0a0f;
    border-color: #7c3aed;
    color: #7c3aed;
}

.btn-secondary:hover {
    background: #1a1a2e;
    border-color: #9d4edd;
    color: #9d4edd;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.hud {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 900px;
    padding: 1rem;
    background: #0a0a0f;
    border: 4px solid #7c3aed;
    margin-bottom: 1rem;
    box-shadow: 4px 4px 0px #7c3aed;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 0.6rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.hud-value {
    font-size: 1.2rem;
    color: #00d4ff;
    text-shadow: 2px 2px 0px #7c3aed;
}

.health-bar {
    width: 120px;
    height: 16px;
    background: #1a1a2e;
    border: 2px solid #7c3aed;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: #00ff88;
    transition: width 0.2s ease;
}

#gameCanvas {
    border: 4px solid #00d4ff;
    box-shadow: 8px 8px 0px #7c3aed;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    background: #0a0a0f;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.controls-list {
    text-align: left;
    margin: 2rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.control-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #0a0a0f;
    border: 2px solid #7c3aed;
    transition: all 0.1s ease;
}

.control-item:hover {
    background: #1a1a2e;
    transform: translateX(4px);
}

.key {
    background: #00d4ff;
    padding: 0.5rem 1rem;
    border: 2px solid #00d4ff;
    font-weight: 600;
    font-size: 0.7rem;
    min-width: 80px;
    text-align: center;
    color: #000;
    box-shadow: 2px 2px 0px #7c3aed;
}

.game-over-title {
    font-size: 2rem;
    color: #ff4757;
    margin-bottom: 2rem;
    text-shadow: 4px 4px 0px #7c3aed;
    line-height: 1.5;
}

.game-stats {
    margin: 2rem 0;
    font-size: 0.8rem;
}

.game-stats p {
    margin: 1rem 0;
    color: #888;
    line-height: 1.8;
}

.game-stats span {
    color: #00d4ff;
    font-size: 1rem;
}

.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 20px;
}

.mobile-dpad {
    position: absolute;
    left: 20px;
    bottom: 0;
    width: 150px;
    height: 150px;
}

.mobile-btn {
    width: 50px;
    height: 50px;
    background: #0a0a0f;
    border: 3px solid #00d4ff;
    color: #00d4ff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 3px 3px 0px #7c3aed;
    image-rendering: pixelated;
}

.mobile-btn:active {
    background: #00d4ff;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #7c3aed;
}

.mobile-btn-up {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-btn-down {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-btn-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-btn-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-btn-fire {
    position: absolute;
    right: 20px;
    bottom: 0;
    width: 80px;
    height: 80px;
    background: #0a0a0f;
    border-color: #ff4757;
    color: #ff4757;
    font-size: 0.8rem;
    font-weight: 600;
}

.mobile-btn-fire:active {
    background: #ff4757;
    color: #000;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-container {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
        min-width: 200px;
    }
    
    .hud {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .hud-item {
        min-width: 80px;
    }
    
    .hud-value {
        font-size: 1.2rem;
    }
    
    .mobile-controls {
        display: block;
    }
    
    #gameCanvas {
        max-height: calc(100vh - 200px);
    }
}
