/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.game-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
    position: relative;
}

/* Header styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    letter-spacing: 2px;
}

.score-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.score-label {
    color: #cccccc;
}

.score-value {
    color: #00ff00;
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: left;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

/* Canvas container */
.canvas-container {
    position: relative;
    display: inline-block;
    border: 3px solid #333333;
    border-radius: 8px;
    background: #111111;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    margin-bottom: 20px;
}

#gameCanvas {
    display: block;
    background: #111111;
    border-radius: 5px;
}

/* Controls info */
.controls-info {
    margin-top: 15px;
    opacity: 0.8;
}

.controls-info p {
    font-size: 0.9rem;
    color: #cccccc;
    margin: 5px 0;
}

.controls-info strong {
    color: #00ff00;
}

.mobile-controls {
    display: none;
}

/* Game overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    z-index: 100;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 15px;
    border: 2px solid #333333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    max-width: 300px;
    width: 90%;
}

.game-over-title,
.pause-title {
    color: #ff4444;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.pause-title {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

.final-score {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #cccccc;
}

.final-score span {
    color: #00ff00;
    font-weight: 700;
    font-size: 1.4rem;
}

.pause-instruction {
    font-size: 1rem;
    color: #cccccc;
    margin-bottom: 20px;
}

.restart-button {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000000;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.3);
    background: linear-gradient(45deg, #00cc00, #00aa00);
}

.restart-button:active {
    transform: translateY(0);
}

/* Built with Bolt badge */
.bolt-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bolt-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5b5ff1, #7c3aed);
}

.bolt-badge::before {
    content: "⚡";
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .score-container {
        font-size: 1.1rem;
    }
    
    .score-value {
        font-size: 1.4rem;
    }
    
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .overlay-content {
        padding: 30px 20px;
        max-width: 280px;
    }
    
    .game-over-title,
    .pause-title {
        font-size: 1.7rem;
    }
    
    .restart-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .bolt-badge {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .game-header {
        margin-bottom: 10px;
    }
    
    .controls-info {
        margin-top: 10px;
    }
    
    .controls-info p {
        font-size: 0.8rem;
    }
    
    .overlay-content {
        padding: 25px 15px;
    }
    
    .game-over-title,
    .pause-title {
        font-size: 1.5rem;
    }
    
    .bolt-badge {
        bottom: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Animation for score updates */
@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.score-value.updated {
    animation: scoreUpdate 0.3s ease;
}

/* Smooth transitions */
.game-overlay {
    transition: opacity 0.3s ease;
}

.canvas-container {
    transition: box-shadow 0.3s ease;
}

.canvas-container:hover {
    box-shadow: 
        0 0 25px rgba(0, 0, 0, 0.6),
        inset 0 0 25px rgba(0, 255, 0, 0.15);
}