* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.audio-init-overlay {
    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: 9999;
    transition: opacity 0.5s ease;
    pointer-events: auto;
}

.audio-init-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.audio-init-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
    pointer-events: auto;
}

.audio-init-message h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.audio-init-message p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.audio-init-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10000;
}

.audio-init-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.audio-init-btn:active {
    transform: translateY(0);
    background: #f0f0f0;
}

.audio-init-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
        min-height: 100vh;
    }
}

@media (max-width: 375px) {
    .game-container {
        padding: 8px;
        min-height: 100vh;
    }
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.game-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-modes {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mode-btn:hover, .mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.instrument-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.instrument {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

.instrument:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.instrument:active {
    transform: translateY(-2px) scale(0.98);
}

.instrument-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.instrument span {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.rhythm-section, .songs-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.rhythm-section h3, .songs-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.rhythm-pattern {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.beat {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #ddd;
}

.beat:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.beat.active {
    background: #667eea;
    color: white;
    border-color: #5a6fd8;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.rhythm-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.play-rhythm-btn, .new-rhythm-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-rhythm-btn:hover, .new-rhythm-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.new-rhythm-btn {
    background: #764ba2;
}

.new-rhythm-btn:hover {
    background: #6a4190;
}

.song-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.song-btn {
    background: #764ba2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.song-btn:hover {
    background: #6a4190;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.visualizer {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

#audio-visualizer {
    width: 100%;
    height: 100px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.instructions {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    color: #333;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.3rem;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    font-size: 1.1rem;
}

.instructions li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.more-games-section {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.more-games-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.more-games-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.more-games-btn:active {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .game-header p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .instrument-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .instrument {
        padding: 10px 5px;
        border-radius: 12px;
    }
    
    .instrument-icon {
        font-size: 2rem;
        margin-bottom: 5px;
    }
    
    .instrument span {
        font-size: 0.8rem;
    }
    
    .game-modes {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .mode-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .rhythm-section, .songs-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .rhythm-pattern {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .beat {
        padding: 12px;
        font-size: 1.5rem;
    }
    
    .rhythm-controls {
        gap: 10px;
    }
    
    .play-rhythm-btn, .new-rhythm-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .song-buttons {
        gap: 10px;
    }
    
    .song-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .controls {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .control-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .visualizer {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    #audio-visualizer {
        height: 80px;
    }
    
    .instructions {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .instructions h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .instructions li {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .instrument, .beat, .mode-btn, .control-btn, .song-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .instrument {
        padding: 25px 15px;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .game-header h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .game-header p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .instrument-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .instrument {
        padding: 8px 4px;
    }
    
    .instrument-icon {
        font-size: 1.8rem;
        margin-bottom: 4px;
    }
    
    .instrument span {
        font-size: 0.75rem;
    }
    
    .game-modes {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .mode-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .rhythm-section, .songs-section {
        margin: 12px 0;
        padding: 12px;
    }
    
    .rhythm-pattern {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .beat {
        padding: 10px;
        font-size: 1.3rem;
    }
    
    .play-rhythm-btn, .new-rhythm-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .song-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .controls {
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .visualizer {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    #audio-visualizer {
        height: 60px;
    }
    
    .instructions {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .instructions h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .instructions li {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .more-games-section {
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    .more-games-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
} 