/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 游戏容器 */
.game-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.game-title {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.game-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* 棋盘 */
.puzzle-board {
    display: grid;
    gap: 5px;
    background: #bbada0;
    border-radius: 8px;
    padding: 10px;
    margin: 20px auto;
    justify-content: center;
}

.puzzle-tile {
    background: #eee4da;
    color: #776e65;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.puzzle-tile:hover:not(.empty) {
    background: #ede0c8;
    transform: scale(1.05);
}

.puzzle-tile.empty {
    background: transparent;
    cursor: default;
}

.puzzle-tile.empty:hover {
    transform: none;
}

/* 控制面板 */
.control-panel {
    margin: 20px 0;
}

.primary-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

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

.control-btn {
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.control-btn.primary {
    background: #8f7a66;
}

.control-btn.secondary {
    background: #a89078;
}

.control-btn.icon-btn {
    padding: 10px 15px;
    font-size: 16px;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.difficulty-display {
    font-weight: bold;
    color: #8f7a66;
    min-width: 50px;
}

/* 统计信息 */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f5f0;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #7d6a55;
    font-size: 14px;
}

.stat-value {
    color: #8f7a66;
    font-weight: bold;
    font-size: 18px;
}

/* 胜利消息 */
.win-message {
    color: #f59563;
    font-weight: bold;
    font-size: 18px;
    display: none;
    margin: 15px 0;
    padding: 15px;
    background: rgba(245, 149, 99, 0.1);
    border-radius: 8px;
    line-height: 1.6;
}

/* 胜利动画 */
@keyframes win-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.puzzle-board.win {
    animation: win-animation 0.5s ease;
}

/* 响应式 */
@media (max-width: 480px) {
    .game-container {
        padding: 20px;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .primary-controls {
        flex-wrap: wrap;
    }
    
    .control-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
}