/* 第三关 - 补充缺失字母功能 */

/* 基础颜色变量（如果未在common.css中定义） */
:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --primary-color-dark: #3d8b40;
    --secondary-color: #2196F3;
    --secondary-color-dark: #1976D2;
    --warning-color: #FFC107;
    --warning-color-dark: #FFA000;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --text-primary: #ffffff;
    --text-secondary: #ecf0f1;
    --text-tertiary: #7f8c8d;
    --bg-primary: #000000;
    --border-color: #3d3d3d;
    --border-light: #4a4a4a;
    --border-radius: 8px;
    --border-radius-large: 12px;
    --border-radius-xl: 16px;
}

/* 加载覆盖层样式 */
.level3-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.level3-loading-content {
    text-align: center;
    color: var(--text-primary);
}

.level3-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: level3-spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

@keyframes level3-spin {
    to { transform: rotate(360deg); }
}

.level3-loading-message {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

/* 游戏容器样式 */
.level3-game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-xl);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 游戏屏幕样式 */
.level3-screen {
    display: none;
}

.level3-screen.active {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    justify-content: space-between;
}

/* 统计信息栏 */
.level3-stats-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.01);
    padding: 15px 20px;
    border-radius: var(--border-radius-large);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.level3-level-info h2 {
    margin: 0;
    font-size: 28px;
    color: var(--text-secondary);
    font-weight: 600;
}

.level3-progress-info {
    display: flex;
    gap: 20px;
    font-size: 18px;
    color: var(--text-primary);
}

/* 字母填空显示样式 */
.level3-word-slots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.word-slot {
    width: 50px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.word-slot.missing {
    border-color: var(--primary-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.word-slot.filled {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: var(--success-color);
}

/* 字母选项按钮样式 */
.level3-letter-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.letter-option {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-option:hover:not(:disabled) {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.letter-option.selected {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: var(--secondary-color);
}

.letter-option.used {
    opacity: 0.5;
    cursor: not-allowed;
}

.letter-option.correct {
    background-color: rgba(76, 175, 80, 0.3);
    border-color: var(--success-color);
}

.letter-option.incorrect {
    background-color: rgba(244, 67, 54, 0.3);
    border-color: var(--error-color);
}

/* 题目容器样式 */
.level3-question-container {
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-large);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 题目头部样式 */
.level3-question-header {
    text-align: center;
    margin-bottom: 30px;
}

.level3-question-prompt {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

.level3-target-word {
    font-size: 35px;
    color: var(--primary-color);
    margin-bottom: 0;
    font-weight: bold;
    padding: 15px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
}

.level3-word-phonetic {
    font-size: 20px;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 0;
}

/* 填空单词容器 */
.level3-cloze-word-container {
    text-align: center;
    margin: 0;
}

.level3-cloze-word {
    display: inline-flex;
    gap: 0; /* 设置间距为0 */
    letter-spacing: -2px; /* 减少字母间的间距 */
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.word-letter {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    background-color: transparent;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    margin: 0; /* 确保没有外边距 */
    padding: 0; /* 确保没有内边距 */
    line-height: 1; /* 重置行高 */
}

.level3-cloze-word .word-letter.blank {
    border-color: rgba(76, 175, 80, 0.5) !important;
    background-color: rgba(76, 175, 80, 0.1) !important;
    color: transparent !important;
}

.level3-cloze-word .word-letter.blank.filled {
    background-color: rgba(76, 175, 80, 0.4) !important;
    border-color: #4CAF50 !important;
    color: #fff !important;
}

/* 字母选项容器 */
.level3-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 20px auto 0;
    max-width: 600px;
}

.option-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-button:hover:not(:disabled) {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.option-button.selected {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: var(--secondary-color);
}

.option-button.correct {
    background-color: rgba(76, 175, 80, 0.3);
    border-color: var(--success-color);
}

.option-button.incorrect {
    background-color: rgba(244, 67, 54, 0.3);
    border-color: var(--error-color);
}

.option-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(255, 255, 255, 0.05);
}

/* 反馈容器样式 */
.level3-feedback-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 0;
    border-radius: var(--border-radius);
    background-color: transparent;
    color: white;
    z-index: 9999;
    min-width: 300px;
    box-shadow: none;
    transition: opacity 0.3s ease;
}

.level3-feedback-correct,
.correct-feedback {
    background-color: rgba(50, 50, 50, 0.95);
    border: 3px solid var(--success-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    text-align: center;
}

.level3-feedback-incorrect,
.incorrect-feedback {
    background-color: rgba(50, 50, 50, 0.95);
    border: 3px solid var(--error-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    text-align: center;
}

.level3-feedback-text {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.level3-correct-word {
    font-size: 24px;
    color: var(--success-color);
    font-weight: bold;
    margin-top: 10px;
}

/* 对勾/叉号单独成行样式 */
.feedback-status {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.feedback-icon {
    font-size: 48px;
    font-weight: bold;
    margin: 0;
    display: inline-block;
}

.correct-feedback .feedback-icon {
    color: var(--success-color);
}

.incorrect-feedback .feedback-icon {
    color: var(--error-color);
}

.feedback-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.correct-feedback .feedback-title {
    color: var(--success-color);
}

.incorrect-feedback .feedback-title {
    color: var(--error-color);
}

/* 音标和意思合并到一行 */
.feedback-item.combined-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.feedback-item.combined-info strong {
    margin-right: 5px;
}

.feedback-item.combined-info > strong:first-child {
    margin-right: 5px;
}

.feedback-item.combined-info > strong:last-child {
    margin-left: 20px;
    margin-right: 5px;
}

/* 已选择字母颜色样式 */
.letter-option.selected {
    font-weight: bold;
}

.feedback-details.order-error {
    color: #ff9800;
    font-weight: bold;
    background-color: rgba(255, 152, 0, 0.1);
    padding: 8px;
    border-radius: 4px;
    border-left: 4px solid #ff9800;
}

/* 导航按钮样式 */
.level3-navigation-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.level3-navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.level3-nav-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background-color: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.level3-nav-btn:hover:not(:disabled) {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.level3-nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.level3-nav-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.level3-nav-btn.back {
    background-color: var(--text-tertiary);
}

.level3-nav-btn.back:hover:not(:disabled) {
    background-color: var(--text-secondary);
}

.level3-nav-btn.primary {
    background-color: var(--primary-color);
}

.level3-nav-btn.primary:hover:not(:disabled) {
    background-color: var(--primary-color-dark);
}

/* 游戏结束覆盖层样式 */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid var(--border-color);
}

.game-over-container h2 {
    color: var(--primary-color);
    font-size: 36px;
    margin-bottom: 30px;
}

.game-over-stats {
    margin-bottom: 30px;
}

.game-over-stats p {
    color: var(--text-primary);
    font-size: 20px;
    margin: 10px 0;
}

.game-over-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.game-over-actions .btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

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

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* 错误消息容器样式 */
.error-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #f44336;
    color: white;
    padding: 16px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    max-width: 300px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .level3-game-container {
        padding: 15px;
        margin: 10px;
    }
    
    .level3-stats-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .level3-level-info h2 {
        font-size: 24px;
        text-align: center;
    }
    
    .level3-target-word {
        font-size: 28px;
    }
    
    .level3-word-phonetic {
        font-size: 18px;
    }
    
    .level3-navigation-buttons {
        flex-direction: column;
    }
    
    .level3-nav-btn {
        width: 100%;
    }
    
    .level3-cloze-word {
        gap: 8px;
    }
    
    .word-letter {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .level3-options-container {
        gap: 8px;
    }
    
    .option-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .game-over-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-over-actions {
        flex-direction: column;
    }
}