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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    position: relative;
    background: #f0f0f0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    border-bottom: 3px solid #8B4513;
    max-width: 100%;
    height: auto;
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #333;
    font-weight: bold;
    font-size: 20px;
}

.score {
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

.audio-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.audio-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.audio-btn.disabled {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.3);
    color: #666;
}

.instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    color: #666;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
    min-width: 250px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.instructions p {
    margin-bottom: 5px;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.game-over h2 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 28px;
}

.game-over p {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

#restartBtn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#restartBtn:hover {
    background: #2980b9;
}

.hidden {
    display: none;
}

.ground-text {
    background: #8B4513;
    color: white;
    text-align: center;
    padding: 20px;
    border-top: 3px solid #A0522D;
}

.ground-text h1 {
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.ground-text p {
    font-size: 16px;
    margin: 0;
    font-weight: bold;
    font-family: monospace;
}

/* Mobile responsive design */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .game-container {
        width: 100%;
        max-width: 100vw;
        border-radius: 10px;
    }
    
    #gameCanvas {
        width: 100%;
        height: 50vh;
        min-height: 300px;
    }
    
    .game-ui {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .score {
        font-size: 16px;
    }
    
    .audio-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .audio-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .ground-text {
        padding: 10px;
    }
    
    .ground-text h1 {
        font-size: 18px;
    }
    
    .ground-text p {
        font-size: 12px;
    }
    
    .game-over {
        padding: 20px;
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        height: 40vh;
        min-height: 250px;
    }
    
    .score {
        font-size: 14px;
    }
    
    .audio-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .ground-text h1 {
        font-size: 16px;
    }
    
    .ground-text p {
        font-size: 11px;
    }
}

/* Desktop responsive design */
@media (min-width: 769px) and (max-width: 1300px) {
    #gameCanvas {
        width: 100vw;
        height: 60vh;
    }
    
    .game-container {
        width: 100vw;
        height: 60vh;
    }
}
