@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', monospace;
    background: linear-gradient(135deg, #1a4d00, #2d5016);
    color: white;
    overflow: hidden;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a4d00, #2d5016);
    z-index: 10;
}

.screen.hidden {
    display: none;
}

.game-title {
    font-size: 3rem;
    color: #ff6b00;
    text-shadow: 4px 4px 0px #cc4400, 8px 8px 0px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

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

.menu-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    padding: 1rem 2rem;
    margin: 0.5rem;
    background: linear-gradient(45deg, #ff6b00, #ff8c00);
    border: 3px solid #cc4400;
    color: white;
    cursor: pointer;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    box-shadow: 0 4px 0 #aa3300, 0 8px 15px rgba(0,0,0,0.3);
    transition: all 0.1s;
    min-width: 200px;
}

.menu-btn:hover {
    background: linear-gradient(45deg, #ff8c00, #ffaa00);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #aa3300, 0 10px 20px rgba(0,0,0,0.4);
}

.menu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #aa3300, 0 4px 8px rgba(0,0,0,0.3);
}

#game-screen {
    background: transparent;
    justify-content: flex-start;
    align-items: center;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 5;
    border-bottom: 2px solid #ff6b00;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.hud-label {
    font-size: 0.6rem;
    color: #ffaa00;
}

#score, #level, #timer, #lives, #bomb-count {
    font-size: 0.8rem;
    color: white;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
}

#canvas {
    margin-top: 60px;
    border: 3px solid #ff6b00;
    box-shadow: 0 0 20px rgba(255,107,0,0.5);
    background: #2d5016;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.overlay.hidden {
    display: none;
}

.pause-content, .game-over-content {
    background: linear-gradient(135deg, #2d5016, #1a4d00);
    padding: 2rem;
    border: 3px solid #ff6b00;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255,107,0,0.6);
}

.pause-content h2, #game-over-title {
    font-size: 2rem;
    color: #ff6b00;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.instructions-content {
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #cccccc;
    max-width: 500px;
    margin-bottom: 2rem;
}

.instructions-content p {
    margin-bottom: 0.5rem;
}

.instructions-content strong {
    color: #ff6b00;
}

#final-score, #final-level {
    color: #ffaa00;
}

/* Responsive design */
@media (max-width: 900px) {
    .game-title {
        font-size: 2rem;
    }
    
    .menu-btn {
        font-size: 0.8rem;
        padding: 0.8rem 1.5rem;
        min-width: 160px;
    }
    
    #canvas {
        transform: scale(0.8);
        transform-origin: center top;
    }
    
    #hud {
        transform: scale(0.8);
        transform-origin: center top;
    }
}

@media (max-width: 700px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        font-size: 0.7rem;
        padding: 0.7rem 1.2rem;
    }
    
    #canvas {
        transform: scale(0.6);
    }
    
    #hud {
        transform: scale(0.6);
    }
    
    .hud-left, .hud-center, .hud-right {
        gap: 0.5rem;
    }
    
    .instructions-content {
        font-size: 0.6rem;
    }
}

/* Pixel-perfect rendering */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Scanline effect (optional retro feel) */
#canvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.1) 2px,
        rgba(0,0,0,0.1) 4px
    );
    pointer-events: none;
}