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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

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

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #2d5016;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(45deg, #98fb98, #90ee90);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #228b22;
}

.score-label {
    font-weight: bold;
    color: #2d5016;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    border: 4px solid #228b22;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: #87ceeb;
    max-width: 100%;
    height: auto;
}

.controls {
    text-align: center;
    margin-top: 20px;
}

.control-instructions {
    margin-bottom: 20px;
    color: #2d5016;
    font-size: 1.1em;
}

.control-instructions p {
    margin-bottom: 8px;
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.game-btn {
    background: linear-gradient(45deg, #32cd32, #228b22);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 140px;
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #3cb371, #2e8b57);
}

.game-btn:active:not(:disabled) {
    transform: translateY(0);
}

.game-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.game-over {
    position: fixed;
    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: 1000;
}

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

.game-over-content {
    background: linear-gradient(135deg, #98fb98, #90ee90);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid #228b22;
    max-width: 90%;
}

.game-over-content h2 {
    color: #2d5016;
    margin-bottom: 20px;
    font-size: 2em;
}

.game-over-content p {
    color: #2d5016;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: bold;
}

.app-footer {
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.app-footer a {
    color: #98fb98;
    text-decoration: none;
    font-weight: bold;
}

.app-footer a:hover {
    color: #90ee90;
    text-decoration: underline;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .score-container {
        gap: 15px;
    }
    
    .score-item {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .game-buttons {
        gap: 10px;
    }
    
    .game-btn {
        padding: 10px 20px;
        font-size: 1em;
        min-width: 120px;
    }
    
    .control-instructions {
        font-size: 1em;
    }
    
    .game-over-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .game-over-content h2 {
        font-size: 1.6em;
    }
    
    .game-over-content p {
        font-size: 1.1em;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .game-btn {
        padding: 15px 25px;
        font-size: 1.2em;
    }
    
    #gameCanvas {
        touch-action: none;
    }
}

/* Animations */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.game-header h1 {
    animation: bounce 2s infinite;
}

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

.score-item {
    animation: pulse 2s infinite;
}