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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(255,255,255,0.3);
    }
    to {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.6), 0 0 30px rgba(255,255,255,0.4);
    }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-style: italic;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
}

.score-board, .high-score-board {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label, .high-score-label {
    color: #666;
}

#score, #high-score {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Canvas styles */
#gameCanvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: #000;
    display: block;
    margin: 0 auto 20px;
    max-width: 100%;
    height: auto;
}

/* Control buttons */
.controls {
    text-align: center;
}

.control-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #FFA726, #FB8C00);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #FF6B6B, #EE5A5A);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile controls */
.mobile-controls {
    display: none;
    margin-top: 20px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #333;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5rem;
}

.instructions p {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .game-container {
        padding: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 350px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .instructions p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .game-container {
        padding: 15px;
    }
    
    #gameCanvas {
        max-width: 300px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* Game over overlay */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.game-over h2 {
    color: #FF6B6B;
    margin-bottom: 15px;
    font-size: 2rem;
}

.game-over p {
    margin: 10px 0;
    font-size: 1.1rem;
    color: #333;
}

.final-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ECDC4;
    margin: 15px 0;
}

/* Animation classes */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

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

.pulse {
    animation: pulse 0.3s ease-in-out;
}