/* --- 基礎樣式與主題設定 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #1a1a1a;
    /* 沿用出生點村莊圖片背景與暗色漸層遮罩 */
    background-image: 
        radial-gradient(circle, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.75) 100%),
        url('/bg.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f0f0f0;
    line-height: 1.6;
    padding: 0 20px 40px 20px;
    padding-top: 90px; /* 留出空間給固定式導覽列 */
}

.container {
    max-width: 1000px; /* 地圖頁面稍作寬度放寬以利觀看 */
    margin: 0 auto;
}

.main-content {
    margin-top: 20px;
}

/* --- 頁面頭部卡片 --- */
.map-header-card {
    text-align: center;
    padding: 25px 20px;
}

.server-logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.2rem;
    color: #ffaa00;
    text-shadow: 4px 4px 0px #3f2a00;
    margin-bottom: 5px;
    letter-spacing: 2px;
    word-wrap: break-word;
}

.server-version {
    display: inline-block;
    background-color: #55ff55;
    color: #000;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 4px;
    box-shadow: 2px 2px 0px #00aa00;
}

/* --- 核心資訊卡片（Minecraft 經典容器風） --- */
.card {
    background-color: #2e2e2e;
    border: 4px solid #000;
    box-shadow: 
        inset -4px -4px 0px #1a1a1a, 
        inset 4px 4px 0px #5c5c5c,
        0px 8px 16px rgba(0,0,0,0.6);
    padding: 25px;
    margin-bottom: 25px;
    image-rendering: pixelated;
}

.map-wrapper-card {
    padding: 20px;
}

.card-title {
    font-size: 1.4rem;
    color: #ffff55;
    margin-bottom: 15px;
    border-bottom: 2px dashed #5c5c5c;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title::before {
    content: "■";
    color: #ff5555;
}

/* --- 地圖上方控制列 --- */
.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #151515;
    border: 2px solid #000;
    padding: 10px 15px;
    margin-bottom: 15px;
    box-shadow: inset 2px 2px 0px rgba(0,0,0,0.5);
    flex-wrap: wrap;
    gap: 10px;
}

.map-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.loading-status {
    color: #ffff55;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- 更多地圖下拉選單 --- */
.map-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background-color: #2e2e2e;
    border: 3px solid #000;
    box-shadow: 
        inset -3px -3px 0px #1a1a1a, 
        inset 3px 3px 0px #5c5c5c,
        0px 6px 12px rgba(0,0,0,0.8);
    min-width: 200px;
    z-index: 1000;
    padding: 5px 0;
}

.map-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background-color 0.1s ease;
}

.dropdown-item:hover {
    background-color: #5555ff;
    color: #ffffff;
}

.dropdown-item.active {
    background-color: #55ff55 !important;
    color: #000000 !important;
}

/* --- Leaflet 地圖容器視窗 --- */
#map {
    width: 100%;
    height: 650px;
    background-color: #0c0c0c;
    border: 4px solid #000;
    box-shadow: 
        inset 4px 4px 0px #000000, 
        inset -2px -2px 0px #444444;
    position: relative;
    z-index: 1;
}

/* 改造 Leaflet 縮放按鈕 */
.leaflet-control-zoom a {
    background-color: #4a4a4a !important;
    color: #ffffff !important;
    border: 2px solid #000 !important;
    box-shadow: inset -2px -2px 0px #2e2e2e, inset 2px 2px 0px #8b8b8b !important;
    border-radius: 0 !important;
    font-family: 'Press Start 2P', cursive !important;
    font-size: 14px !important;
}

.leaflet-control-zoom a:hover {
    background-color: #5555ff !important;
}

/* --- Minecraft 經典 3D 按鈕 --- */
.mc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    color: #ffffff;
    background-color: #4a4a4a;
    border: 3px solid #000;
    box-shadow: 
        inset -3px -3px 0px #2e2e2e, 
        inset 3px 3px 0px #8b8b8b;
    padding: 12px 24px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    text-align: center;
    text-decoration: none;
}

.mc-btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-width: 2px;
    box-shadow: 
        inset -2px -2px 0px #2e2e2e, 
        inset 2px 2px 0px #8b8b8b;
}

.mc-btn-sm:hover {
    background-color: #5555ff;
    box-shadow: 
        inset -2px -2px 0px #0000aa, 
        inset 2px 2px 0px #aaaaff;
}

.mc-btn-sm:active {
    box-shadow: 
        inset 2px 2px 0px #1a1a1a, 
        inset -2px -2px 0px #5c5c5c;
    transform: translateY(1px);
}

/* 選取狀態按鈕高亮 */
.mc-btn.active {
    background-color: #55ff55 !important;
    color: #000000 !important;
    box-shadow: 
        inset -2px -2px 0px #00aa00, 
        inset 2px 2px 0px #ffffff !important;
}

/* --- 特色介紹清單 --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.feature-item {
    background-color: #252525;
    border: 2px solid #5c5c5c;
    padding: 15px;
    border-radius: 4px;
}

.feature-title {
    color: #ff55ff;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* RWD 響應式微調 */
@media (max-width: 650px) {
    body {
        padding-top: 130px;
    }
    .server-logo {
        font-size: 1.6rem;
    }
    #map {
        height: 450px;
    }
    .map-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .map-toolbar button, .map-selector a, .toolbar-actions {
        width: 100%;
    }
}