/* 消消乐游戏样式 */
#match3-game-container {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    color: white;
}

/* 游戏头部 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.game-info div {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

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

#game-mode {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* 游戏目标 */
.game-target {
    text-align: center;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

/* 游戏板容器 */
.game-board-container {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

/* 游戏板 */
.game-board {
    display: grid;
    gap: 2px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 5px;
    margin: 0 auto;
    max-width: 400px;
}

.game-cell {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    user-select: none;
}

.game-cell:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,1);
}

.game-cell.selected {
    background: #ffeb3b;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255,235,59,0.5);
}

.game-cell.matched {
    animation: matchAnimation 0.5s ease;
}

@keyframes matchAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.game-cell.falling {
    animation: fallAnimation 0.3s ease;
}

@keyframes fallAnimation {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 弹窗样式 */
.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;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    color: #333;
}

.modal-stats {
    margin: 20px 0;
    font-size: 18px;
}

.modal-stats p {
    margin: 10px 0;
}

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

.modal-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* 表单样式 */
#score-form input[type="text"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* 排行榜样式 */
#match3-leaderboard {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.leaderboard-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.leaderboard-filters select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.leaderboard-table tr:nth-child(even) {
    background: #f8f9fa;
}

.leaderboard-table tr:hover {
    background: #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #match3-game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .game-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .game-info {
        justify-content: center;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .game-cell {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .modal-actions,
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .game-cell {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .game-info div {
        padding: 6px 12px;
        font-size: 14px;
    }
}