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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
}

/* 屏幕容器 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    transform: translateY(20px);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 主菜单样式 */
.game-logo {
    text-align: center;
    margin-bottom: 50px;
    animation: logoFloat 3s ease-in-out infinite;
}

.game-logo h1 {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 10px;
    letter-spacing: 2px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 菜单按钮 */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 250px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

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

/* 屏幕头部 */
.screen-header {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
}

.back-btn {
    position: absolute;
    left: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.screen-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* 模式选择卡片 */
.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin-top: 100px;
    padding: 0 30px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.mode-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.mode-card p {
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.6;
}

.mode-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-features span {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* 难度选择 */
.difficulty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin-top: 100px;
    padding: 0 30px;
}

.difficulty-card {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.difficulty-card.easy {
    border-color: #4ecdc4;
}

.difficulty-card.medium {
    border-color: #feca57;
}

.difficulty-card.hard {
    border-color: #ff6b6b;
}

.difficulty-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.difficulty-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.difficulty-card h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.difficulty-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    opacity: 0.8;
}

.stat-value {
    font-weight: 600;
}

/* 游戏界面 */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    backdrop-filter: blur(10px);
}

.pause-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.game-info {
    display: flex;
    gap: 30px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ecdc4;
}

.game-content {
    display: flex;
    width: 100%;
    height: calc(100% - 80px);
    margin-top: 80px;
    gap: 20px;
    padding: 20px;
}

.game-board-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#gameCanvas {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.game-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.game-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.objectives, .power-ups, .combo-meter {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.objectives h3, .power-ups h3, .combo-meter h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
    color: #4ecdc4;
}

.objective-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.power-up-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.power-up-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.power-up-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.power-up-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.power-up-icon {
    font-size: 1.5rem;
}

.power-up-count {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.combo-bar {
    position: relative;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
}

.combo-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
}

.combo-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(20px);
    max-width: 500px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #4ecdc4;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.modal-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.primary {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-btn.primary:hover {
    background: rgba(78, 205, 196, 0.5);
}

/* 游戏结束界面 */
.game-over-content {
    margin-bottom: 20px;
}

.final-score {
    margin: 20px 0;
}

.score-label {
    display: block;
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 10px;
}

.score-value {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: #feca57;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 2rem;
}

.star {
    color: #feca57;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.5);
}

.star.empty {
    color: rgba(255, 255, 255, 0.3);
}

/* 设置界面 */
.settings-content {
    width: 100%;
    max-width: 600px;
    margin-top: 100px;
    padding: 0 30px;
}

.setting-group {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.setting-group h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #4ecdc4;
    text-align: center;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

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

.setting-item input[type="range"] {
    width: 150px;
    margin: 0 15px;
}

.setting-item select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    margin-left: 10px;
    transform: scale(1.2);
}

.volume-value {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: #4ecdc4;
    min-width: 40px;
}

.setting-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.setting-btn.danger {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.setting-btn.danger:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* 排行榜界面 */
.scores-content {
    width: 100%;
    max-width: 800px;
    margin-top: 100px;
    padding: 0 30px;
}

.score-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.score-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-tab.active {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

.score-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.score-lists {
    position: relative;
    min-height: 400px;
}

.score-list {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.score-list.active {
    opacity: 1;
    visibility: visible;
}

.score-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.score-entry:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.score-rank {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: #4ecdc4;
    min-width: 40px;
}

.score-details {
    flex: 1;
    margin-left: 20px;
}

.score-points {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.3rem;
    color: #feca57;
}

.score-date {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* 帮助界面 */
.help-content {
    width: 100%;
    max-width: 700px;
    margin-top: 100px;
    padding: 0 30px;
}

.help-section {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.help-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #4ecdc4;
}

.help-section p {
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0.9;
}

.help-section ul {
    list-style: none;
    padding-left: 0;
}

.help-section li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
    opacity: 0.9;
}

.help-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #4ecdc4;
    font-weight: bold;
}

/* 动画效果 */
@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes scoreUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.2); opacity: 0; }
}

@keyframes comboFlash {
    0%, 100% { background: linear-gradient(90deg, #4ecdc4, #45b7d1); }
    50% { background: linear-gradient(90deg, #feca57, #ff6b6b); }
}

.sparkle {
    animation: sparkle 0.6s ease-in-out;
}

.score-popup {
    position: absolute;
    color: #feca57;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.8);
    animation: scoreUp 1s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

.combo-flash {
    animation: comboFlash 0.5s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-logo h1 {
        font-size: 3rem;
    }
    
    .mode-cards {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    
    .difficulty-cards {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    
    .game-content {
        flex-direction: column;
        padding: 10px;
    }
    
    .game-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .game-info {
        gap: 15px;
    }
    
    .info-value {
        font-size: 1.2rem;
    }
    
    .menu-btn {
        min-width: 200px;
    }
    
    .settings-content,
    .scores-content,
    .help-content {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .game-logo h1 {
        font-size: 2.5rem;
    }
    
    .screen-header {
        padding: 0 20px;
    }
    
    .back-btn {
        left: 20px;
        width: 40px;
        height: 40px;
    }
    
    .game-header {
        padding: 0 20px;
        height: 70px;
    }
    
    .game-content {
        margin-top: 70px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .score-tabs {
        flex-direction: column;
        gap: 10px;
    }
}
