/* 像素拼图大师 - 8位像素风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 100%);
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 10px;
}

#status-bar {
    display: flex;
    justify-content: space-around;
    background: #333;
    color: #FFD700;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 4px solid #222;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon {
    font-size: 20px;
}

#difficulty-panel {
    background: #222;
    padding: 20px;
    border-radius: 8px;
    border: 4px solid #444;
    text-align: center;
}

#difficulty-panel h2 {
    color: #FFD700;
    margin-bottom: 15px;
}

.diff-btn {
    background: #555;
    color: #FFF;
    border: 2px solid #333;
    padding: 10px 15px;
    margin: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
}

.diff-btn:hover {
    background: #666;
}

.diff-btn.active {
    background: #4CAF50;
    border-color: #388E3C;
}

.start-btn {
    background: #FF5722;
    color: #FFF;
    border: none;
    padding: 15px 30px;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
}

#game-area {
    display: none;
}

#game-area.show {
    display: block;
}

#preview {
    background: #333;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

#preview h3 {
    color: #FFD700;
    margin-bottom: 10px;
}

#preview-image {
    display: grid;
    gap: 2px;
    width: 100px;
    margin: 0 auto;
}

#puzzle-grid {
    display: grid;
    gap: 5px;
    background: #333;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.puzzle-piece {
    background: #444;
    border: 2px solid #222;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    transition: transform 0.1s;
}

.puzzle-piece:hover {
    transform: scale(1.05);
}

.puzzle-piece.selected {
    border: 3px solid #FFD700;
}

#complete-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #EEE;
    padding: 20px;
    border-radius: 8px;
    border: 4px solid #333;
    z-index: 100;
    text-align: center;
}

#complete-modal.hidden {
    display: none;
}

/* 响应式 */
@media (max-width: 400px) {
    .diff-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    .puzzle-piece {
        font-size: 20px;
    }
}