/* 拖曳配對遊戲樣式 */

/* 遊戲標題區 */
.matching-game-header {
    background: #f4eee5;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    color: #333;
}

.matching-game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

.matching-game-info p {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.8;
    margin: 0;
    color: #666;
}

/* 遊戲統計 */
.matching-game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.matching-stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.matching-stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #F39F5F;
}

.matching-stat-label {
    font-size: 0.9rem;
    margin-top: 5px;
    color: #666;
}

/* 遊戲區域 - 使用 Bootstrap row */
.matching-game-area {
    margin-bottom: 30px;
}

.matching-word-column {
    background: #f4eee5;
    border-radius: 20px;
    padding: 20px;
    min-height: 500px;
}

.matching-column-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #fff;
    color: #385469;
}

.matching-words-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 單字卡片 */
.matching-word-item {
    padding: 20px;
    background: #f8f9fa;
    
    border-radius: 15px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: move;
    transition: all 0.3s ease;
    user-select: none;
}

.matching-word-item:hover:not(.matched) {
    transform: translateY(-3px);
}

.matching-english-word {
    background: #f39f5f;
    color: white;
    border-color: #667eea;
}

.matching-chinese-word {
    background: white;
    color: #333;
}

    .matching-chinese-word.drop-zone {
        background: #c2d8e2;
        border-color: #a6c0cc;
        border-style: dashed;
        transform: scale(1.05);
    }

.matching-chinese-word.drop-invalid {
    background: #ffebee;
    border-color: #f44336;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.matching-word-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.1);
}

.matching-word-item.matched {
    background: #70a6b1;
    color: white;
    border-color: #84fab0;
    cursor: default;
    animation: matchSuccess 0.6s ease;
}

@keyframes matchSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 配對成功的合併元素 - 單行顯示 */
.matching-matched-pair {
    padding: 20px;
    background: #70a6b1;
    border: 1px solid #70a6b1;
    border-radius: 15px;
    text-align: center;
    font-size: 12pt;
    font-weight: 600;
    color: white;
    animation: matchSuccess 0.6s ease;
}

.matching-pair-content {
    display: inline;
    white-space: nowrap;
}

/* 完成遊戲彈窗 */
.matching-game-complete {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.matching-complete-modal {
    background: white;
    border-radius: 30px;
    padding: 50px;
    max-width: 500px;
    text-align: center;
    animation: slideUp 0.5s ease;
}

.matching-complete-title {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 30px;
    font-weight: bold;
}

.matching-complete-stats {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.matching-complete-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #333;
}

.matching-complete-stats span {
    font-weight: bold;
    color: #667eea;
}

.matching-complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 響應式設計 - 手機版也保持左右兩列 */
@media (max-width: 768px) {
    .matching-game-header {
        padding: 20px;
    }

    .matching-game-info h1 {
        font-size: 1.8rem;
    }

    .matching-game-stats {
        gap: 20px;
    }

    .matching-stat-number {
        font-size: 1.5rem;
    }

    .matching-word-column {
        padding: 15px;
        min-height: 400px;
    }

    .matching-column-title {
        font-size: 1.2rem;
    }

    .matching-word-item {
        padding: 15px;
        font-size: 1rem;
    }

    .matching-complete-modal {
        padding: 30px;
        margin: 20px;
    }

    .matching-complete-title {
        font-size: 2rem;
    }
}
