/* 拼字遊戲樣式 */

/* 遊戲標題區 */
.spelling-game-header {
    background: #e59b9d;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.spelling-game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: white;
}

.spelling-game-info p {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
    color: white;
}

/* 遊戲統計 */
.spelling-game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.spelling-stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.spelling-stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.spelling-stat-label {
    font-size: 0.9rem;
    margin-top: 5px;
    color: white;
    opacity: 0.9;
}

/* 遊戲區域 - 使用 Bootstrap row */
.spelling-game-area {
    margin-bottom: 30px;
}

/* 左側圖片區域 */
.spelling-image-section {
    background: #f4eee5;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.spelling-word-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    margin-bottom: 20px;
}

/* 右側答題區域 */
.spelling-answer-section {
    background: #f4eee5;
    border-radius: 20px;
    padding: 20px;
    min-height: 500px;
}

.spelling-section-title {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #385469;
}

/* 答案空格區域 */
.spelling-answer-slots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    min-height: 80px;
}

.spelling-answer-slot {
    width: 50px;
    height: 60px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.spelling-answer-slot.has-letter {
    border-style: solid;
    border-color: #e59b9d;
    background: #fff0f0;
    cursor: pointer;
}

.spelling-answer-slot.has-letter:hover {
    background: #ffe0e0;
    transform: scale(1.05);
}

.spelling-answer-slot.drop-zone {
    background: #e8f5e9;
    border-color: #4caf50;
    transform: scale(1.1);
}

/* 字母池區域 */
.spelling-letter-pool {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    min-height: 100px;
}

.spelling-letter-item {
    width: 50px;
    height: 60px;
    background: #f39f5f;
    border: 2px solid #e58a47;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    cursor: move;
    user-select: none;
    transition: all 0.3s ease;
}

.spelling-letter-item:hover {
    transform: translateY(-5px) scale(1.1);
    background: #e58a47;
}

.spelling-letter-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.1);
}

.spelling-letter-item.used {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 反饋訊息 */
.spelling-feedback {
    text-align: center;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spelling-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.spelling-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 完成遊戲彈窗 */
.spelling-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;
}

.spelling-complete-modal {
    background: white;
    border-radius: 30px;
    padding: 50px;
    max-width: 500px;
    text-align: center;
    animation: slideUp 0.5s ease;
}

.spelling-complete-title {
    font-size: 2.5rem;
    color: #e59b9d;
    margin-bottom: 30px;
    font-weight: bold;
}

.spelling-complete-stats {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.spelling-complete-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #333;
}

.spelling-complete-stats span {
    font-weight: bold;
    color: #e59b9d;
}

.spelling-complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .spelling-game-header {
        padding: 20px;
    }

    .spelling-game-info h1 {
        font-size: 1.8rem;
    }

    .spelling-game-stats {
        gap: 20px;
    }

    .spelling-stat-number {
        font-size: 1.5rem;
    }

    .spelling-image-section,
    .spelling-answer-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .spelling-answer-slot,
    .spelling-letter-item {
        width: 40px;
        height: 50px;
        font-size: 1.5rem;
    }

    .spelling-complete-modal {
        padding: 30px;
        margin: 20px;
    }

    .spelling-complete-title {
        font-size: 2rem;
    }
}
