* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微軟正黑體", "Microsoft JhengHei", Arial, sans-serif;
}

body {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

body.home-page {
    background-image: url('Theme.jpg');
}

body.prologue-page {
    background-image: url('palace.jpg');
}

body.spring-page {
    background-image: url('guadian.jpg');
}

.game-container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    margin: 20px;
}

.game-title {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 
                 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(0, 150, 255, 0.5);
    margin-bottom: 50px;
    letter-spacing: 3px;
}

.menu-container {
    background-color: rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.menu-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.menu-btn:hover {
    background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
}

/* 彈窗樣式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    margin: 10% auto;
    padding: 20px;
    border: 2px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); /* 橘色光暈 */
    animation: modalFadeIn 0.5s;
}

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

.close-btn, .close-welcome-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover, .close-welcome-btn:hover {
    color: white;
}

.modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
    color: rgba(255, 165, 0, 0.9); /* 橘色標題 */
}

#player-id {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

#confirm-id, #start-adventure, .action-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

#confirm-id:hover, #start-adventure:hover, .action-btn:hover {
    background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
}

.error-message {
    color: #ff6b6b;
    margin-top: 10px;
    text-align: center;
    display: none;
}

/* 歡迎訊息樣式 */
.welcome-content {
    max-width: 600px;
    text-align: center;
}

#welcome-message {
    margin: 20px 0;
    line-height: 1.8;
    font-size: 1.1rem;
}

#welcome-message p {
    margin-bottom: 15px;
}

#welcome-message .highlight {
    color: #ffcc00;
    font-weight: bold;
    font-size: 1.3rem;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

/* 序章頁面樣式 */
.prologue-container {
    background-color: rgba(0, 0, 0, 0.7);
    border: 3px solid rgba(255, 140, 0, 0.7); /* 橘色邊框 */
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    color: white;
}

.prologue-title {
    color: rgba(255, 165, 0, 0.9); /* 橘色標題 */
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.prologue-content {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-align: justify;
}

.prologue-content p {
    margin-bottom: 15px;
}

.map-image {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); /* 橘色光暈 */
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.nav-btn {
    padding: 10px 20px;
    background-color: rgba(255, 140, 0, 0.8); /* 橘色按鈕 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 165, 0, 0.9); /* 橘色按鈕懸停效果 */
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); /* 橘色光暈 */
}

/* 平方之泉頁面樣式 */
.spring-container {
    background-color: rgba(0, 0, 0, 0.7);
    border: 3px solid rgba(255, 140, 0, 0.7);
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    color: white;
}

.spring-title {
    color: rgba(255, 165, 0, 0.9);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.spring-content {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-align: justify;
}

.spring-content p {
    margin-bottom: 15px;
}

.start-challenge-container {
    text-align: center;
    margin-top: 30px;
}

/* 問答區域樣式 */
.quiz-container {
    padding: 20px;
    margin-bottom: 30px;
}

#question-container {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: rgba(255, 165, 0, 0.9);
    text-align: center;
}

#options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 15px;
    background-color: rgba(255, 140, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 165, 0, 0.8);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.option-btn:hover {
    background-color: rgba(255, 165, 0, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
}

.option-btn.correct {
    background-color: rgba(0, 200, 0, 0.8);
    border-color: rgba(0, 255, 0, 0.8);
}

.option-btn.incorrect {
    background-color: rgba(200, 0, 0, 0.8);
    border-color: rgba(255, 0, 0, 0.8);
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 進度條樣式 */
.progress-container {
    margin-top: 20px;
}

.progress-text {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.progress-bar {
    height: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background-color: rgba(255, 165, 0, 0.8);
    width: 0%;
    transition: width 0.5s ease;
}

/* 完成訊息樣式 */
.completion-message {
    text-align: center;
    padding: 20px;
}

.completion-message h2 {
    color: rgba(255, 215, 0, 0.9);
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.completion-message p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.feedback-container {
    text-align: center;
    margin: 20px 0;
    font-size: 1.2rem;
    min-height: 30px;
}

/* 音樂來源註記 */
.music-credit {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.music-credit a {
    color: rgba(255, 165, 0, 0.9);
    text-decoration: none;
}

.music-credit a:hover {
    text-decoration: underline;
}

.small-btn {
    padding: 5px 10px;
    background-color: rgba(255, 140, 0, 0.6);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 5px;
}

.small-btn:hover {
    background-color: rgba(255, 165, 0, 0.8);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
        padding: 15px;
    }
    
    .prologue-container, .spring-container {
        padding: 20px;
    }
    
    .prologue-title, .spring-title {
        font-size: 1.8rem;
    }
    
    .prologue-content, .spring-content {
        font-size: 1rem;
    }
    
    #options-container {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        padding: 12px;
    }
    
    #question-text {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .menu-container {
        padding: 15px;
    }
    
    .menu-btn {
        padding: 10px;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 30% auto;
        padding: 15px;
    }
    
    .prologue-title, .spring-title {
        font-size: 1.5rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .completion-message h2 {
        font-size: 1.5rem;
    }
}
