/* 基礎重置和字體設定 */
* {
    margin: 0;
    padding-top: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    position: relative;
}

/* 畫面切換 */
.screen {
    display: none;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 標題樣式 */
.title {
    font-size: 3rem;
    font-weight: 900;
    color: #4a5568;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 遊戲資訊 */
.game-info {
    margin-bottom: 30px;
}

.game-info p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

/* 遊戲統計 */
.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.timer {
    font-size: 3rem;
    font-weight: 700;
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    min-width: 100px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer.warning {
    color: #dd6b20;
    background: rgba(221, 107, 32, 0.1);
    animation: flash 0.5s infinite;
}

.timer.danger {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.2);
    animation: flash 0.3s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #38a169;
    background: rgba(56, 161, 105, 0.1);
    padding: 15px 20px;
    border-radius: 15px;
}

/* 遊戲區域 */
.game-area {
    margin-bottom: 30px;
}

.question {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 25px;
    background: rgba(45, 55, 72, 0.05);
    padding: 20px;
    border-radius: 15px;
}

.answer-input {
    font-size: 2rem;
    padding: 15px 20px;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    text-align: center;
    width: 200px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.feedback {
    font-size: 1.3rem;
    font-weight: 700;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.feedback.correct {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
    border: 2px solid rgba(56, 161, 105, 0.3);
}

.feedback.incorrect {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border: 2px solid rgba(229, 62, 62, 0.3);
}

/* 按鈕樣式 */
.btn {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

/* 最終分數 */
.final-score {
    margin-bottom: 30px;
}

.performance-message {
    font-size: 1.2rem;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
}

.performance-message.excellent {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
    border: 2px solid rgba(56, 161, 105, 0.3);
}

.performance-message.good {
    background: rgba(221, 107, 32, 0.1);
    color: #dd6b20;
    border: 2px solid rgba(221, 107, 32, 0.3);
}

.performance-message.normal {
    background: rgba(49, 130, 206, 0.1);
    color: #3182ce;
    border: 2px solid rgba(49, 130, 206, 0.3);
}

/* 指示文字 */
.instructions {
    color: #666;
    font-size: 1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .screen {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 2.2rem;
        margin-bottom: 25px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .timer {
        font-size: 2.5rem;
        padding: 12px 20px;
    }
    
    .score {
        font-size: 1.3rem;
        padding: 12px 16px;
    }
    
    .question {
        font-size: 2rem;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .answer-input {
        font-size: 1.8rem;
        width: 180px;
        padding: 12px 16px;
    }
    
    .btn {
        font-size: 1.1rem;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .timer {
        font-size: 2rem;
    }
    
    .question {
        font-size: 1.6rem;
    }
    
    .answer-input {
        font-size: 1.5rem;
        width: 160px;
    }
}
