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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #F8BBD9 0%, #E91E63 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* 扁平化设计 - 主容器 */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 扁平化设计 - 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.125rem;
    opacity: 0.8;
    font-weight: 400;
}

/* 速度显示区域 */
.tempo-display {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tempo-circle {
    width: 200px;
    height: 200px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin: 0 auto 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.tempo-circle.pulse {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.tempo-value {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.tempo-label {
    font-size: 1rem;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 2px;
}

.tempo-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 4px;
    height: 80px;
    background: linear-gradient(180deg, #FF4081, #E91E63);
    border-radius: 2px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.1s ease;
}

/* 速度控制 */
.tempo-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
}

.tempo-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tempo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tempo-slider {
    flex: 1;
    max-width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.tempo-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tempo-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 速度预设 */
.tempo-presets {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 100px;
    border: 2px solid transparent;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.preset-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.preset-btn span {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.preset-btn div {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.preset-btn small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 拍号设置 */
.time-signature {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.time-signature h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.signature-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.signature-selector {
    text-align: center;
}

.signature-selector label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.signature-selector select {
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    min-width: 120px;
}

.signature-selector option {
    background: #E91E63;
    color: white;
}

.signature-divider {
    font-size: 2rem;
    font-weight: 300;
    opacity: 0.7;
}

.signature-display {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.signature-fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 2rem;
    font-weight: 300;
}

.numerator {
    line-height: 1;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 5px;
}

.denominator {
    line-height: 1;
    padding-top: 5px;
}

.signature-description {
    font-size: 1.125rem;
    opacity: 0.8;
}

/* 节拍显示 */
.beat-display {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.beat-pattern {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.beat-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.beat-circle.strong {
    background: rgba(255, 64, 129, 0.3);
    border-color: #FF4081;
}

.beat-circle.weak {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.beat-circle.active {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.6);
    background: #FF4081;
}

.beat-counter {
    font-size: 1.5rem;
    font-weight: 300;
}

.current-beat {
    font-weight: 600;
    color: #FF4081;
}

.beat-separator {
    margin: 0 10px;
    opacity: 0.5;
}

/* 控制面板 */
.control-panel {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    min-width: 120px;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-btn {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.play-btn:hover {
    background: linear-gradient(135deg, #45a049, #5cb85c);
}

.stop-btn {
    background: linear-gradient(135deg, #F44336, #EF5350);
}

.stop-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #e53935);
}

.tap-btn {
    background: linear-gradient(135deg, #FF9800, #FFB74D);
}

.tap-btn:hover {
    background: linear-gradient(135deg, #f57c00, #ff9800);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 0.9rem;
}

/* 高级控制 */
.advanced-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.volume-control, .sound-selection {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.volume-control label, .sound-selection label {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 60px;
}

.volume-slider {
    flex: 1;
    min-width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sound-selection select {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 140px;
}

.sound-selection option {
    background: #E91E63;
    color: white;
}

/* 练习模式 */
.practice-mode {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.practice-mode h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.practice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.practice-btn {
    padding: 20px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.practice-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.practice-btn span {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.practice-btn div {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.practice-btn small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 统计信息 */
.statistics {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.statistics h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #FF4081;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(255, 64, 129, 0.3);
}

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

/* 底部控制 */
.bottom-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
    padding-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #C2185B;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(194, 24, 91, 0.3);
    min-width: 100px;
}

.btn:hover {
    background: #AD1457;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 24, 91, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

/* 扁平化设计 - 弹窗 */
.practice-popup, .settings-popup, .help-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.practice-popup.show, .settings-popup.show, .help-popup.show {
    display: flex;
}

.popup-content {
    background: linear-gradient(135deg, #F8BBD9 0%, #E91E63 100%);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 练习结果 */
.practice-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.result-chart {
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-stats {
    text-align: left;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    opacity: 0.8;
}

.result-value {
    font-weight: 600;
    color: #FFD700;
}

/* 设置弹窗 */
.settings-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.setting-item label {
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #FF4081;
}

.popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 帮助弹窗特殊样式 */
.help-content {
    text-align: left;
    max-width: 600px;
}

.help-content h2 {
    text-align: center;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 1.125rem;
    font-weight: 600;
}

.help-section ul {
    margin-left: 20px;
    opacity: 0.9;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.help-section strong {
    color: #FFD700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .tempo-circle {
        width: 160px;
        height: 160px;
    }
    
    .tempo-value {
        font-size: 2.5rem;
    }
    
    .tempo-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .tempo-presets {
        gap: 10px;
    }
    
    .preset-btn {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .signature-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .signature-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .beat-pattern {
        gap: 10px;
    }
    
    .beat-circle {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .main-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-btn {
        min-width: 200px;
    }
    
    .advanced-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .practice-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .popup-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .practice-results {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .result-stats {
        text-align: center;
    }
    
    .popup-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tempo-circle {
        width: 140px;
        height: 140px;
    }
    
    .tempo-value {
        font-size: 2rem;
    }
    
    .beat-circle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .preset-btn {
        min-width: 70px;
        padding: 10px 12px;
    }
    
    .preset-btn span {
        font-size: 1.25rem;
    }
    
    .preset-btn div {
        font-size: 0.8rem;
    }
    
    .preset-btn small {
        font-size: 0.7rem;
    }
}