/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.header {
    padding: 15px;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    flex-shrink: 0;
}

.instructions {
    font-size: clamp(12px, 2.5vw, 16px);
    opacity: 0.9;
}

.instructions p {
    margin: 0;
    font-size: 13px;
}

#mapContainer {
    flex-grow: 1;
    width: 100%;
    min-height: 300px; /* 最小高度保证地图可见 */
}

#modeSelection {
    display: block; /* 确保默认显示 */
    z-index: 1001; /* 确保在最上层 */
}

/*模式选择*/
.mode-btn {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
}

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

.mode-btn[data-mode="easy"] {
    background-color: #4CAF50;
    color: white;
}

.mode-btn[data-mode="normal"] {
    background-color: #2196F3;
    color: white;
}

.mode-btn[data-mode="hard"] {
    background-color: #f44336;
    color: white;
}


/* 状态指示器 */
#stats {
    position: absolute;
    top: 70px;
    left: 10px;
    z-index: 100;
    opacity: 0.7;
}

/* 横屏设备优化 */
@media screen and (orientation: landscape) {
    .header {
        padding: 10px;
    }

    #mapContainer {
        height: calc(100vh - 60px); /* 减去标题栏高度 */
    }

    #stats {
        top:60px;
    }
}

/* 桌面端大屏幕优化 */
@media screen and (min-width: 1024px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        height: 90vh;
        margin-top: 5vh;
    }

    .header {
        padding: 20px;
        border-radius: 8px 8px 0 0;
    }

    #mapContainer {
        border-radius: 0 0 8px 8px;
    }
}

/* 移动设备小屏幕优化 */
@media screen and (max-width: 480px) {
    .header {
        padding: 10px;
    }

    #mapContainer {
        min-height: 250px;
    }
}

#scoreDisplay {
    position: fixed;
    top: 60px; /* 在说明文字下方 */
    left: 20px;
    color: white;
    font-size: 24px;
    font-family: Arial, sans-serif;
    text-shadow: 2px 2px 4px black;
    z-index: 1000;
}

/*高度仪表样式*/
#altimeter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    z-index: 1000;
    text-align: center;
}

.altimeter-title {
    font-size: 14px;
    margin-bottom: 5px;
}

.altimeter-value {
    font-size: 18px;
    font-weight: bold;
}
.altitude-changing {
    transform: scale(1.2);
    transition: transform 0.3s ease, color 0.3s ease;
}

/*状态栏*/
#statusBar {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    z-index: 1000;
    text-align: center;
}

.status-title {
    font-size: 14px;
    margin-bottom: 5px;
}

.status-value {
    font-size: 18px;
    font-weight: bold;
}

/* 不同状态的文字颜色 */
.status-value.normal {
    color: #4CAF50; /* 绿色表示正常 */
}

.status-value.poisoned {
    color: #FFC107; /* 黄色表示中毒 */
    animation: pulse 1s infinite; /* 添加闪烁动画 */
}

.status-value.dead {
    color: #F44336; /* 红色表示死亡 */
}

.status-value.shielded {
    background-color: rgba(0, 191, 255, 0.3);
    animation: pulse 1s infinite;
}


/* 闪烁动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#restartButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    font-size: 18px;
    color: white;
    background-color: #4CAF50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#restartButton:hover {
    background-color: #45a049;
}
