/* 對話框遮罩 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 對話框基本樣式 */
.dialog {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

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

.dialog::-webkit-scrollbar {
    width: 8px;
}

.dialog::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dialog::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

/* 關閉按鈕 */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

/* 地點簡介對話框 */
.location-dialog h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.location-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 15px;
}

.location-description {
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

/* 任務對話框 */
.task-dialog {
    max-width: 700px;
}

.npc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 20px;
}

.npc-emoji {
    font-size: 48px;
}

.npc-name {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.npc-dialogue {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px;
}

.question-section {
    margin-top: 20px;
}

.question-title {
    color: #667eea;
    margin-bottom: 10px;
}

.question-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.option-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.option-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.option-item.wrong {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    opacity: 0.5;
    cursor: not-allowed;
}

.option-item.wrong::after {
    content: '❌';
    position: absolute;
    right: 15px;
    font-size: 20px;
}

.option-radio {
    margin-right: 10px;
}

.option-text {
    flex: 1;
    font-size: 16px;
}

/* 答錯回覆對話框 */
.wrong-answer-dialog {
    max-width: 500px;
    text-align: center;
}

.wrong-message {
    padding: 30px;
}

.wrong-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

#wrongReplyText {
    font-size: 18px;
    line-height: 1.6;
    color: #666;
}

/* 成就對話框 */
.achievement-dialog {
    max-width: 600px;
    text-align: center;
}

.achievement-dialog .achievement-header {
    margin-bottom: 20px;
}

.achievement-dialog .achievement-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 10px;
    animation: rotate 1s;
}

@keyframes rotate {
    from {
        transform: rotate(0deg) scale(0.5);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

.achievement-dialog h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.achievement-dialog .achievement-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.achievement-dialog .achievement-description {
    line-height: 1.8;
    color: #666;
    text-align: left;
    margin-bottom: 20px;
}

.achievement-reference {
    margin-bottom: 20px;
}

.achievement-reference a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.achievement-reference a:hover {
    text-decoration: underline;
}

/* 遊戲訊息對話框 */
.game-message-dialog {
    max-width: 600px;
    text-align: center;
}

.message-header {
    margin-bottom: 20px;
}

.message-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 10px;
    animation: fadeInScale 0.5s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-header h2 {
    color: #667eea;
    margin-bottom: 0;
}

.message-content {
    line-height: 1.8;
    color: #333;
    text-align: left;
    margin-bottom: 20px;
    white-space: pre-line;
    font-size: 16px;
}

/* 對話框按鈕 */
.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.dialog-buttons .btn {
    flex: 1;
    max-width: 200px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .dialog {
        max-width: 90%;
        padding: 20px;
    }
    
    .npc-emoji {
        font-size: 36px;
    }
    
    .npc-name {
        font-size: 18px;
    }
    
    .question-text {
        font-size: 16px;
    }
}