/* Pixel Match 游戏页面样式 */
.pixel-match-page {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    min-height: 100vh;
}

/* 关卡选择界面 */
.level-select {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.level-select h3 {
    text-align: center;
    color: var(--secondary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.level-btn {
    aspect-ratio: 1;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.level-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.level-btn.locked {
    background: #e0e0e0;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-btn .lock-icon {
    font-size: 2rem;
}

.level-btn .stars-earned {
    font-size: 1rem;
}

/* 游戏容器 */
.game-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 关卡信息 */
.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    color: var(--secondary-color);
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.level-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* 区域标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title .icon {
    font-size: 1.3rem;
}

/* 目标图案区域 */
.target-section {
    margin-bottom: 2rem;
    text-align: center;
}

.target-board-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #2c3e50;
    border-radius: 12px;
}

.target-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #34495e;
    padding: 4px;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
}

.target-cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    aspect-ratio: 1;
}

.target-cell.filled {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

/* 游戏信息面板 */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

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

.info-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.info-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 游戏棋盘区域 */
.game-board-container {
    margin-bottom: 2rem;
    text-align: center;
}

.play-board-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #2c3e50;
    border-radius: 12px;
}

.play-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #34495e;
    padding: 4px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

.cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}

.cell.filled {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.cell.highlight {
    background: rgba(255, 255, 255, 0.3);
    animation: pulse 0.5s ease-in-out;
}

.cell.correct {
    animation: correctFlash 0.4s ease-out;
}

.cell.wrong {
    animation: wrongShake 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes correctFlash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
        filter: brightness(1.3);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* 方块选择区域 */
.blocks-section {
    margin-bottom: 2rem;
    text-align: center;
}

.blocks-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 100px;
}

.block-preview {
    display: grid;
    gap: 2px;
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.block-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.block-preview.dragging {
    opacity: 0.3;
    transform: scale(1);
    pointer-events: none;
}

.block-preview.drag-clone {
    cursor: grabbing;
    opacity: 0.95;
    transform: scale(1.15);
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.block-cell {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    color: var(--secondary-color);
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 关卡完成弹窗 */
.level-complete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.level-complete-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease;
}

.modal-content h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.star {
    font-size: 3rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.star.earned {
    opacity: 1;
    animation: starPop 0.5s ease-out;
}

@keyframes starPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.score-display, .bonus-display {
    margin-bottom: 1.5rem;
}

.score-display p, .bonus-display p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bonus-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f39c12;
}

.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.4);
}

.btn-secondary {
    display: inline-block;
    background: #f8f9fa;
    color: var(--secondary-color);
    padding: 12px 30px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 100%;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pixel-match-page {
        padding: 80px 0 40px;
    }

    .game-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .target-board {
        max-width: 250px;
    }

    .play-board {
        max-width: 320px;
    }

    .block-cell {
        width: 16px;
        height: 16px;
    }

    .game-controls {
        flex-wrap: wrap;
    }

    .btn-control {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-content h3 {
        font-size: 1.5rem;
    }

    .star {
        font-size: 2.5rem;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}

/* 方块颜色 */
.block-color-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.block-color-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.block-color-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.block-color-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.block-color-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.block-color-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.block-color-7 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.block-color-8 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.block-color-9 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.block-color-10 { background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); }
