* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    max-height: 100vh;
    padding: 10px;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    height: calc(100vh - 20px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* 標題區 */
header {
    text-align: center;
    color: white;
    margin-bottom: 10px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* 遊戲資訊列 */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.95);
    padding: 10px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label {
    font-weight: 600;
    color: #555;
}

.value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
}

.btn-reset {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 遊戲區域 */
.game-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

/* 題目區域 */
.question-area {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.question-area h3 {
    text-align: center;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.county-display {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 0;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 15px;
}

#question-svg {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    max-width: 100%;
    max-height: 100%;
}

/* 選項按鈕 */
.options-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.option-btn {
    padding: 12px 16px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.option-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.option-btn.correct {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    border-color: #44a08d;
    animation: correctPulse 0.5s;
}

.option-btn.wrong {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border-color: #ee5a6f;
    animation: shake 0.5s;
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 進度區域 */
.progress-area {
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.progress-area h3 {
    text-align: center;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

#mini-map {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.mini-county {
    transition: fill 0.5s, stroke 0.5s;
}

.mini-county.completed {
    animation: fillIn 0.5s;
}

@keyframes fillIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* 勝利彈窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.5s;
}

.modal-content h2 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.time-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: #764ba2;
}

.btn-primary {
    margin-top: 20px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
}

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

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

/* 反饋訊息 */
.feedback-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    pointer-events: none;
}

.feedback-correct {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.feedback-wrong {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.feedback-message.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .options-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header h1 {
        font-size: 2rem;
    }
}
