/* =========================
   全局基础
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background: linear-gradient(180deg, #f0f4ff, #f8fafc);
    padding: 12px;
}

/* =========================
   游戏主容器
========================= */
.game-container {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 18px 22px 22px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* =========================
   标题
========================= */
.game-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 14px;
    color: #2d3748;
}

/* =========================
   状态栏
========================= */
.game-status {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    margin-bottom: 10px;
    color: #4a5568;
}

/* =========================
   模式按钮
========================= */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-btn {
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: #edf2f7;
    color: #4a5568;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: linear-gradient(135deg, #63b3ed, #4299e1);
    color: #fff;
    box-shadow: 0 6px 14px rgba(66,153,225,0.35);
    transform: translateY(-1px);
}

.mode-btn:hover {
    transform: translateY(-1px);
}

/* =========================
   道具按钮
========================= */
.tool-area {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tool-btn {
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #fbd38d, #f6ad55);
    color: #7b341e;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(246,173,85,0.35);
    transition: all 0.2s ease;
}

.tool-btn:hover {
    transform: translateY(-1px) scale(1.03);
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================
   地图（核心：1.2 : 1）
========================= */
#mapWrapper {
    width: 100%;
    aspect-ratio: 1.2 / 1;     /* ⭐ 地图比例核心 */
    height: auto;

    min-height: 420px;
    max-height: 520px;

    margin: 10px 0 12px;
    border-radius: 18px;
    overflow: hidden;

    border: 3px solid #e2e8f0;
    box-shadow:
        0 10px 25px rgba(0,0,0,0.12),
        inset 0 0 0 2px rgba(255,255,255,0.4);
}

/* =========================
   控制区
========================= */
.control-area,
.code-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* 输入框 */
.coord-input,
.code-input,
#lonInput,
#latInput,
#secretCodeInput {
    padding: 7px 10px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-size: 13px;
    width: 140px;
}

/* =========================
   通用按钮（确认 / 重置 / 口令）
========================= */
.game-btn,
#confirmBtn,
#resetBtn,
#generateCodeBtn,
#loadCodeBtn {
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #9ae6b4, #48bb78);
    color: #065f46;
    box-shadow: 0 4px 10px rgba(72,187,120,0.35);
    transition: all 0.2s ease;
}

#resetBtn {
    background: linear-gradient(135deg, #feb2b2, #f56565);
    color: #742a2a;
    box-shadow: 0 4px 10px rgba(245,101,101,0.35);
}

#generateCodeBtn,
#loadCodeBtn {
    background: linear-gradient(135deg, #b794f4, #805ad5);
    color: #2a1f5c;
    box-shadow: 0 4px 10px rgba(128,90,213,0.35);
}

.game-btn:hover,
#confirmBtn:hover,
#resetBtn:hover,
#generateCodeBtn:hover,
#loadCodeBtn:hover {
    transform: translateY(-1px) scale(1.03);
}

/* =========================
   提示面板
========================= */
.hint-panel {
    background: #f7fafc;
    border-radius: 14px;
    border: 2px dashed #cbd5e0;
    padding: 10px 14px;
}

#hintText {
    font-size: 14px;
    font-weight: bold;
    color: #2d3748;
}

#directionText {
    margin-top: 4px;
    font-size: 13px;
    color: #3182ce;
}

/* =========================
   小屏幕进一步压缩
========================= */
@media (max-height: 800px) {
    #mapWrapper {
        min-height: 380px;
        max-height: 460px;
    }
}
/* =========================
   手机端适配（不影响电脑）
========================= */
@media (max-width: 768px) {

    body {
        padding: 6px;
    }

    .game-container {
        padding: 12px;
        border-radius: 12px;
    }

    .game-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .game-status {
        flex-wrap: wrap;
        font-size: 13px;
        gap: 8px;
    }

    .mode-selector,
    .tool-area {
        flex-wrap: wrap;
        gap: 6px;
    }

    .mode-btn,
    .tool-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* 地图在手机上更接近正方形 */
    #mapWrapper {
        aspect-ratio: 1 / 1;
        min-height: 300px;
        max-height: 360px;
    }

    .control-area,
    .code-area {
        gap: 6px;
    }

    .coord-input,
    .code-input,
    #lonInput,
    #latInput,
    #secretCodeInput {
        width: 48%;
        font-size: 12px;
        padding: 6px 8px;
    }

    #confirmBtn,
    #resetBtn,
    #generateCodeBtn,
    #loadCodeBtn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .hint-panel {
        padding: 8px 10px;
    }

    #hintText {
        font-size: 13px;
    }

    #directionText {
        font-size: 12px;
    }
}
