/* Color Merge 游戏页面样式 */
.color-merge-page {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 游戏信息面板 */
.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);
}

/* 画布区域 */
.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 开始覆盖层 */
.start-overlay, .game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    padding: 2rem;
}

.start-overlay h3, .game-over-overlay h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.start-overlay p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.game-over-overlay {
    display: none;
}

.game-over-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.final-score, .best-score-display {
    margin: 1.5rem 0;
}

.final-score p, .best-score-display p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin-top: 1rem;
}

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

/* 游戏说明 */
.game-guide {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.game-guide h4 {
    color: #1565c0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.game-guide ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.game-guide li {
    padding: 0.5rem 0;
    color: #1565c0;
    font-size: 0.95rem;
}

/* 颜色选择器 */
.color-selector {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.color-selector h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.selector-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-selector-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.color-selector-btn:hover {
    transform: scale(1.1);
}

.color-selector-btn.selected {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

.color-selector-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.color-selector-btn span:first-child {
    font-size: 1.5rem;
}

.level-num {
    font-size: 0.8rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.selector-hint {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* 颜色进化树 */
.color-evolution {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
}

.color-evolution h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.evolution-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-dot.rainbow-gradient {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #1dd1a1, #54a0ff, #5f27cd);
    animation: rainbowRotate 2s linear infinite;
}

@keyframes rainbowRotate {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.color-stage span:last-child {
    font-size: 0.8rem;
    color: #666;
}

.color-stage.rainbow span:last-child {
    color: #5f27cd;
    font-weight: 700;
}

.arrow {
    color: #999;
    font-size: 1.2rem;
    margin: 0 0.3rem;
}

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

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

    .game-info {
        padding: 1rem;
    }

    .info-value {
        font-size: 1.5rem;
    }

    .start-overlay h3, .game-over-overlay h3 {
        font-size: 2rem;
    }

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

    .evolution-chain {
        gap: 0.3rem;
    }

    .color-dot {
        width: 24px;
        height: 24px;
    }

    .color-stage span:last-child {
        font-size: 0.7rem;
    }

    .arrow {
        font-size: 1rem;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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