/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a2e;
    color: #ffffff;
    overflow: hidden;
}

/* 游戏容器 */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 屏幕管理 */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 封面界面 */
#game-cover {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

#game-cover h1 {
    font-size: 6rem; /* 进一步增大标题字体 */
    margin-bottom: 60px;
    color: #0f3460;
    text-shadow: 0 0 25px #e94560;
    text-align: center;
    line-height: 1.2;
}

.cover-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    max-width: 400px;
}

.cover-buttons button {
    padding: 20px 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background-color: #0f3460;
    color: #ffffff;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* 选曲按钮特殊样式 */
.select-song-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    position: relative;
    text-align: center;
}

.select-song-btn .btn-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffffff;
}

.select-song-btn .current-song-info {
    background-color: rgba(233, 69, 96, 0.2);
    padding: 10px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    border: 1px solid #e94560;
    width: 100%;
    justify-content: center;
}

.select-song-btn .current-song-info .label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.select-song-btn .current-song-info .song-name {
    color: #e94560;
    font-weight: bold;
    font-size: 1.1rem;
}

.cover-buttons button:hover {
    background-color: #e94560;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(233, 69, 96, 0.4);
    border-color: #ffffff;
}

/* 模态窗口 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #16213e;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #e94560;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #e94560;
    font-size: 1.8rem;
    text-align: center;
}

/* 曲目选择模态窗口 */
#song-selection-modal .song-list {
    max-height: 400px;
    overflow-y: auto;
}

/* 设置模态窗口 */
#current-song-display {
    background-color: #0f3460;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 1.1rem;
    color: #ffffff;
    text-align: center;
    border: 2px solid transparent;
}

#current-song-display.selected {
    border-color: #e94560;
    background-color: rgba(15, 52, 96, 0.8);
}

/* 旧的曲目选择界面样式（保持兼容） */
#song-selection {
    justify-content: center;
    align-items: center;
}

#song-selection h1 {
    font-size: 3rem;
    margin-bottom: 40px;
    color: #0f3460;
    text-shadow: 0 0 10px #e94560;
}

.song-list {
    display: flex;
    flex-direction: column;
    gap: 5px; /* 进一步减小曲目之间的间隔 */
    width: 100%;
    max-width: 400px;
}

.song-item {
    background-color: #16213e;
    padding: 10px; /* 进一步减小内边距 */
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.2rem;
    border: 2px solid transparent;
}

.song-item:hover {
    background-color: #0f3460;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: #e94560;
}

/* 游戏主界面 */
#game-screen {
    justify-content: space-between;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #16213e;
    border-radius: 10px;
    margin-bottom: 10px;
}

.song-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e94560;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .label {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.stat-item .value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
}

/* 游戏区域 */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #0f0f23;
    border-radius: 10px;
    margin-bottom: 10px;
}

#falling-area {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 判定线 */
#hit-line {
    position: absolute;
    bottom: 200px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e94560;
    z-index: 10;
    box-shadow: 0 0 10px #e94560;
}

/* 下落带上的可敲击区域 */
#hit-zone {
    position: absolute;
    bottom: 150px;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: rgba(233, 69, 96, 0.1);
    border-top: 2px solid #e94560;
    border-bottom: 2px solid #e94560;
    z-index: 5;
}

/* 下落的字母 */
.falling-letter {
    position: absolute;
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 15;
    transition: all 0.1s ease;
    padding: 10px;
    border-radius: 50%;
    background-color: rgba(15, 52, 96, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
}

/* 字母在可敲击区域内的样式 */
.falling-letter.in-hit-zone {
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
    background-color: rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
}

/* 字母被正确击中的样式 */
.falling-letter.hit {
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
    background-color: rgba(255, 255, 0, 0.3);
    transform: scale(1.5);
    opacity: 0;
    transition: all 0.3s ease;
}

/* 字母被误击的样式 */
.falling-letter.error {
    color: #ff0000;
    text-shadow: 0 0 15px #ff0000;
    background-color: rgba(255, 0, 0, 0.3);
    transform: scale(1.2);
    transition: all 0.2s ease;
}

/* 字母被错过的样式 */
.falling-letter.missed {
    color: #00ff00; /* 保持绿色 */
    text-shadow: 0 0 15px #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
    opacity: 0.7;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}

.game-controls button,
.end-controls button,
.settings-buttons button {
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #0f3460;
    color: #ffffff;
    transition: all 0.3s ease;
}

.game-controls button:hover,
.end-controls button:hover,
.settings-buttons button:hover {
    background-color: #e94560;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

/* 游戏设置界面样式 */
#game-settings {
    justify-content: center;
    align-items: center;
}

.settings-container {
    background-color: #16213e;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 25px; /* 调小项目之间的间距 */
    flex-wrap: wrap;
}

.setting-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 15px; /* 调小项目底部间距 */
}

.setting-group h3 {
    margin-bottom: 10px; /* 调小标题底部间距 */
    color: #e94560;
    font-size: 1.3rem;
    text-align: center;
}

/* 速度选择样式 */
.speed-options {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 掉落位置选择样式 */
.drop-position-options {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.drop-position-option {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
}

.drop-position-option input[type="radio"] {
    accent-color: #e94560;
    transform: scale(1.2);
}

.speed-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.speed-option:hover {
    background-color: #0f3460;
}

.speed-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #e94560;
}

/* 键盘区选择样式 */
.keyboard-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.keyboard-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.keyboard-option:hover {
    background-color: #0f3460;
}

.keyboard-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #e94560;
}

/* 设置按钮样式 */
.settings-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.settings-buttons button {
    min-width: 150px;
}

/* 游戏结束界面 */
#game-over {
    justify-content: center;
    align-items: center;
    text-align: center;
}

#game-over h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #e94560;
}

.game-over-content {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    justify-content: center;
    align-items: flex-start;
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #16213e;
    padding: 30px;
    border-radius: 10px;
    min-width: 300px;
}

.game-settings-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #16213e;
    padding: 30px;
    border-radius: 10px;
    min-width: 300px;
}

.game-settings-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #e94560;
    font-size: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 1.1rem;
}

.setting-item .label {
    font-weight: bold;
    color: #0f3460;
}

.setting-item .value {
    color: #e94560;
    font-weight: bold;
}

.end-controls {
    display: flex;
    gap: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #song-selection h1 {
        font-size: 2rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .game-controls {
        flex-wrap: wrap;
    }
    
    .falling-letter {
        font-size: 2rem;
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    #song-selection h1 {
        font-size: 1.5rem;
    }
    
    .song-item {
        font-size: 1rem;
        padding: 15px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .falling-letter {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }
}