/* 猜鸟游戏 - 专属样式（复用 style.css 的变量与 .stat-btn） */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh; /* 移动端动态视口高度：随浏览器工具栏收起/展开变化，底部不被遮挡 */
}

/* 顶部栏 */
.game-header {
    flex: none; /* 头部高度固定，不参与收缩 */
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.game-header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.back-link {
    margin-left: auto; /* 推到右侧 */
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

.hud {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.hud-item {
    color: rgba(255, 255, 255, 0.9);
}

.hud-item strong {
    font-size: 16px;
    margin-left: 2px;
    display: inline-block;
    min-width: 3ch;
    text-align: right;
}

.hud-item:nth-child(3) strong {
    min-width: 5ch;
}

/* 主体布局 */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* 地图区 */
.map-section {
    flex: 1 1 0%; /* 可收缩：空间不足时地图让位给下方题目区 */
    min-height: 0; /* 允许收缩到任意小，保证题目区（尤其第一个选项）始终可见 */
    background: var(--bg);
    position: relative;
    overflow: hidden; /* 防止 ECharts canvas 溢出遮挡下方题目区 */
}

#gameMap {
    position: absolute;
    inset: 0;
}

/* 市/省级切换 */
.level-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 100;
    display: flex;
    gap: 6px;
}

.level-toggle .stat-btn {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 地图加载提示 toast */
.map-notice {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 13px;
    z-index: 100;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* 题目区 */
.game-question {
    flex: none; /* 内容高度固定，任何情况下不被压缩，选项区完整显示 */
    background: var(--card);
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
}

.question-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

/* 答案按钮 */
.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.answer-btn {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.answer-btn:hover:not(:disabled) {
    background: #e8f5e8;
    border-color: var(--primary-light);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    border-color: transparent;
}

.answer-btn.wrong {
    background: #fce4ec;
    color: #c62828;
    border-color: #ef9a9a;
}

.answer-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

/* 反馈区 */
.feedback {
    margin-top: 8px;
    font-size: 13px;
    min-height: 36px;
    color: var(--text-secondary);
}

.feedback.correct {
    color: #2e7d32;
    font-weight: 600;
}

.feedback.wrong {
    color: #c62828;
    font-weight: 600;
}

.feedback .reveal {
    margin-top: 4px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 操作行 */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    min-height: 36px;
}

.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    padding: 7px 18px;
    min-width: 80px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.action-btn.ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 3px 8px rgba(45,90,39,0.3);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(45,90,39,0.35);
}

/* 响应式 */
@media (max-width: 640px) {
    .game-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 14px;
    }

    .hud {
        gap: 10px;
        font-size: 13px;
    }

    .answer-grid {
        grid-template-columns: 1fr;
    }

    /* 压缩题目区纵向尺寸，给地图留更多空间 */
    .game-question {
        padding: 8px 12px 10px;
    }

    .question-text {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .answer-btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .feedback {
        min-height: 32px;
        margin-top: 6px;
        font-size: 12px;
    }

    .action-row {
        min-height: 32px;
        margin-top: 6px;
    }

    .action-btn {
        padding: 6px 14px;
        min-width: 68px;
        font-size: 12px;
    }

    /* 提示 toast：地图很小时自动换行、贴近底部，不溢出屏幕 */
    .map-notice {
        white-space: normal;
        max-width: calc(100% - 20px);
        bottom: 8px;
    }
}

/* 全屏界面（开始/成绩） */
.screen {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.screen-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 36px;
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.screen-card h2 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 8px;
}

.screen-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.difficulty-btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.difficulty-btn:hover {
    border-color: var(--primary-light);
    background: #e8f5e8;
    transform: translateY(-1px);
}

.difficulty-btn:last-child {
    margin-bottom: 0;
}

.difficulty-btn .difficulty-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.difficulty-btn .difficulty-desc {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.result-score {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0 4px;
}

.result-stats {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 22px;
}
