* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.game-area {
    margin-bottom: 40px;
}

.track {
    position: relative;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.beat-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4ECDC4, transparent);
    transform: translateY(-50%);
}

.tap-circle {
    position: absolute;
    top: 50%;
    left: -60px;
    width: 60px;
    height: 60px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.1s ease;
}

.inner-circle {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.beat-indicators {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.beat-marker {
    position: absolute;
    top: 50%;
    width: 4px;
    height: 20px;
    background: rgba(78, 205, 196, 0.6);
    transform: translateY(-50%);
    border-radius: 2px;
}

.visualizer {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
    height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
}

.frequency-bar {
    width: 8px;
    background: linear-gradient(to top, #4ECDC4, #FF6B6B);
    border-radius: 4px;
    animation: visualizerPulse 0.5s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.1s);
}

.controls {
    margin-bottom: 30px;
}

.song-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

select {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

select option {
    background: #667eea;
    color: white;
}

.primary-btn {
    padding: 12px 24px;
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.difficulty {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.difficulty-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #4ECDC4;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
}

.feedback {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.feedback-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    min-height: 30px;
}

.timing-indicator {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 40px;
}

.timing-marker {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 16px;
    transform: translateY(-50%);
}

.timing-marker.perfect {
    left: 50%;
    background: #4ECDC4;
    transform: translate(-50%, -50%);
}

.timing-marker.good {
    left: 35%;
    background: #96CEB4;
    transform: translateY(-50%);
}

.timing-marker.ok {
    left: 65%;
    background: #FFEAA7;
    transform: translateY(-50%);
}

.timing-marker.miss {
    left: 20%;
    right: 20%;
    background: rgba(255, 107, 107, 0.3);
    width: auto;
}

.current-timing {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #FF6B6B;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.1s ease;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

.instructions {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
}

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

@keyframes visualizerPulse {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 40px;
    }
}

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

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

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
    }
    50% { 
        box-shadow: 0 8px 35px rgba(78, 205, 196, 0.8);
    }
}

.pulse {
    animation: pulse 0.3s ease;
}

.shake {
    animation: shake 0.3s ease;
}

.glow {
    animation: glow 1s ease-in-out;
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .track {
        height: 150px;
    }
    
    .tap-circle {
        width: 50px;
        height: 50px;
        left: -50px;
    }
    
    .inner-circle {
        width: 25px;
        height: 25px;
    }
}