/* 世界地圖與地圖圖鑑（2026-10-25，src/map-atlas-window.js）：M 開啟的地圖視窗改成左邊地圖、右邊圖鑑的寬版面，沿用原本 .map-dialog 的深綠底、金色框線與襯線標題。
   data-view="world"：原版世界地圖（#world-map）；data-view="map"：單張地圖（#large-map）。index.html 預設 map，main.js 開啟時切到 world。 */
/* 地圖視窗不用背景模糊（2026-10-27，世界地圖拖曳卡頓）：後面的 3D 畫面每幀都在變，.modal 與 .panel 的 backdrop-filter 每幀都要把整個畫面重新模糊一次；改用不透明的底色。 */
#map-modal{backdrop-filter:none;background:#08140fdb}
.map-dialog.panel{backdrop-filter:none;background:linear-gradient(125deg,#20392f,#112820)}
.map-dialog{width:min(96vw,1240px);max-width:none;height:min(92vh,860px);padding:14px 18px 10px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;text-align:left;box-sizing:border-box}
.map-dialog .map-head{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:"eyebrow eyebrow eyebrow" "tabs title coords";align-items:end;gap:2px 14px;padding:0 44px 0 4px}
.map-dialog .map-head .eyebrow{grid-area:eyebrow;text-align:center}
.map-dialog .map-head h2{grid-area:title;margin:2px 0 0;font-size:24px;letter-spacing:4px;text-align:center;white-space:nowrap}
.map-dialog .map-tabs{grid-area:tabs;display:flex;gap:6px;align-self:end;flex-wrap:wrap}
.map-dialog .map-tabs button{min-height:28px;padding:3px 12px;border:1px solid #a48e5a77;border-radius:14px;background:#1e352ada;color:#cdbf98;font:13px "Microsoft JhengHei",sans-serif;letter-spacing:1px;cursor:pointer;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.map-dialog .map-tabs button:hover{border-color:#d9c08299;color:#f3e7c4}
.map-dialog .map-tabs button[hidden]{display:none}
.map-dialog .map-tabs button.active{background:linear-gradient(180deg,#c9ad6c,#9c7f43);border-color:#e5cf96;color:#1d2a20;font-weight:bold}
.map-dialog #large-map-coordinates{grid-area:coords;justify-self:end;margin:0;font-size:12px}
.map-dialog .map-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,340px);gap:12px;min-height:0}
.map-dialog .map-stage{position:relative;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
.map-dialog .map-stage #large-map{width:auto;height:100%;max-width:100%;max-height:100%;aspect-ratio:1}
.map-dialog .map-stage #large-map[hidden]{display:none}
.map-dialog .world-stage{position:absolute;inset:0;border:1px solid #c2ab6870;background:#0b2733;overflow:hidden}
.map-dialog .world-stage[hidden]{display:none}
.map-dialog .world-stage canvas{width:100%;height:100%;aspect-ratio:auto;border:0;cursor:grab;touch-action:none}
.map-dialog .world-stage canvas:active{cursor:grabbing}
.world-zoom{position:absolute;right:8px;top:8px;display:flex;flex-direction:column;gap:4px}
.world-zoom button{min-width:30px;height:28px;padding:0 8px;border:1px solid #a48e5a99;border-radius:4px;background:#132a20e6;color:#e6d6a8;font:13px "Microsoft JhengHei",sans-serif;cursor:pointer}
.world-zoom button:hover{background:#28463ae6;color:#fff3cf}
.world-tip{position:absolute;z-index:2;pointer-events:none;max-width:260px;padding:6px 9px;border:1px solid #c9b07a99;border-radius:4px;background:#0e1f17ee;color:#ede5ce;font:12px/1.5 "Microsoft JhengHei",sans-serif;box-shadow:0 3px 10px #0008}
.world-tip b{color:#ffe7a6;font-weight:normal;margin-right:4px}
.world-tip .more{color:#9cac96}
/* 右側圖鑑 */
.atlas-panel{min-height:0;display:flex;flex-direction:column;gap:8px;padding:10px 12px;border:1px solid #c2ab6855;background:#0f2219cc;color:#e4dcc2;font:13px/1.45 "Microsoft JhengHei",sans-serif;overflow:hidden}
.atlas-head h3{margin:2px 0 2px;font:21px var(--serif);letter-spacing:2px;color:#f1e6c6}
.atlas-sub{margin:0;color:#a9b89f;font-size:12px}
.atlas-flags{margin:4px 0 0}
.atlas-link{align-self:flex-start;padding:0;border:0;background:none;color:#e0c47e;font:12px "Microsoft JhengHei",sans-serif;text-align:left;cursor:pointer}
.atlas-link:hover{color:#fff0c2;text-decoration:underline}
.atlas-search{width:100%;box-sizing:border-box;height:30px;padding:4px 9px;border:1px solid #a48e5a88;border-radius:4px;background:#0a1912;color:#f0e8cf;font:13px "Microsoft JhengHei",sans-serif}
.atlas-search:focus{outline:1px solid #e0c47e;border-color:#e0c47e}
.atlas-list{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:3px;padding-right:2px;scrollbar-width:thin;scrollbar-color:#8d7a4c #0a1912}
.atlas-list h4,.atlas-detail h5{display:flex;align-items:baseline;gap:6px;margin:8px 0 3px;padding-bottom:3px;border-bottom:1px solid #c2ab6844;color:#d8c187;font:bold 13px "Microsoft JhengHei",sans-serif;letter-spacing:1px}
.atlas-list h4 small,.atlas-detail h5 small{color:#8fa68f;font-weight:normal}
.atlas-list h4:first-child{margin-top:0}
.atlas-map,.atlas-npc,.atlas-monster{display:flex;align-items:center;gap:7px;width:100%;min-height:30px;padding:4px 7px;border:1px solid transparent;border-radius:3px;background:#ffffff08;color:#ece4cb;font:13px "Microsoft JhengHei",sans-serif;text-align:left;cursor:pointer}
.atlas-map:hover,.atlas-npc:hover,.atlas-monster:hover,.atlas-npc.active{border-color:#c9b07a88;background:#ffffff14}
.atlas-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.atlas-meta{display:flex;align-items:center;gap:5px;flex-shrink:0;color:#a9b89f;font-size:12px;white-space:nowrap}
.atlas-quest{display:inline-flex;align-items:center;gap:3px;color:#9fd8ad}
.atlas-quest i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#3fe36b80;border:1px solid #0b2414}
.atlas-quest.hot i{background:#3fe36b;border-color:#fff}
.atlas-flag,.atlas-tag{display:inline-block;padding:0 5px;border-radius:3px;font-style:normal;font-size:11px;line-height:17px;background:#ffffff14;color:#d8d0b4}
.atlas-flag.here{background:#ffe60033;color:#fff19a}
.atlas-flag.closed{background:#8a3a2a55;color:#ffc2b3}
.atlas-tag.aggressive{background:#9b2d2255;color:#ffb3a3}
.atlas-tag.passive{background:#2e6b4255;color:#b2f0c4}
.atlas-tag.boss{background:#7d5a1a77;color:#ffd98a;font-weight:bold}
.atlas-tag.gear{background:#3a4f7a66;color:#c4d5ff}
.atlas-mark{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#3fe36b44;color:#0b2414;font:bold 12px sans-serif;flex-shrink:0}
.atlas-mark.accept{background:#3fe36b}
.atlas-mark.ready{background:#ffd34d}
.atlas-element{width:18px;height:18px;flex-shrink:0;object-fit:contain}
.atlas-hint,.atlas-empty{margin:4px 2px;color:#9cac96;font-size:12px}
.atlas-detail{display:flex;flex-direction:column;gap:4px}
.atlas-detail-title{display:flex;align-items:center;gap:6px;margin:4px 0 0;color:#f6e7bd;font:bold 16px "Microsoft JhengHei",sans-serif}
.atlas-detail-title small{color:#cdbf98;font-weight:normal;font-size:12px}
.atlas-tags{display:flex;flex-wrap:wrap;gap:4px;margin:0}
.atlas-stats{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;gap:2px 6px;margin:4px 0 0;padding:6px 8px;border:1px solid #c2ab6833;border-radius:3px;background:#00000026;font-size:12px}
.atlas-stats dt{color:#a9b89f;line-height:1.3;overflow-wrap:anywhere}
.atlas-stats dd{margin:0;color:#f3ead0;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.atlas-stats dd:nth-of-type(odd){padding-right:10px}
.atlas-drops{width:100%;border-collapse:collapse;font-size:12px}
.atlas-drops th{padding:3px 4px;border-bottom:1px solid #c2ab6855;color:#c9b07a;font-weight:normal;text-align:left}
.atlas-drops th:not(:first-child),.atlas-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.atlas-drops td{padding:3px 4px;border-bottom:1px solid #ffffff10}
.atlas-item{display:flex;align-items:center;gap:5px;min-width:0}
.atlas-item img{width:22px;height:22px;flex-shrink:0;object-fit:contain}
.atlas-item span{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* 世界地圖搜尋的兩行列（2026-11-06，掉落物品與 NPC）：第一行道具圖示或任務標記、名稱、機率，第二行怪物與地圖（NPC 是所在的地圖），對齊名稱。
   清單是直向 flex，.atlas-map 的 min-height 會讓列被壓成一行高、第二行疊到下一列，所以兩行列不縮（flex-shrink:0）。 */
.atlas-two{flex-wrap:wrap;row-gap:1px;flex-shrink:0}
.atlas-two .atlas-via{flex-basis:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#a9b89f;font-size:12px}
.atlas-drop-icon{display:inline-flex;flex-shrink:0;width:22px;height:22px}
.atlas-drop-icon img{width:22px;height:22px;object-fit:contain}
.atlas-drop-icon~.atlas-via{padding-left:29px}
.atlas-two .atlas-mark~.atlas-via{padding-left:25px}
.atlas-note{margin:4px 0 0;color:#8fa68f;font-size:11px;line-height:1.5}
/* 頁尾：圖例與說明依畫面切換 */
.map-dialog .map-foot{display:flex;align-items:center;justify-content:space-between;gap:6px 16px;flex-wrap:wrap}
.map-dialog .map-foot .map-legend{margin:0;flex-wrap:wrap;gap:6px 14px}
.map-dialog .map-foot p{margin:0;text-align:right}
.map-dialog[data-view=world] [data-for=map],.map-dialog[data-view=map] [data-for=world]{display:none}
.map-legend i.npc{background:#3fe36b;box-shadow:0 0 0 1px #fff}
.map-legend i.npc.dim{background:#3fe36b80;box-shadow:0 0 0 1px #0b2414}
.map-legend i.exit{background:#ff8a24}
/* BOSS 皇冠（2026-10-27）：和地圖上的皇冠同一個形狀與金色（src/map-view.js drawBossCrown()） */
.map-legend i.boss{width:10px;height:7px;border-radius:0;background:#ffd23f;clip-path:polygon(0 100%,0 28.6%,25% 60.7%,50% 0,75% 60.7%,100% 28.6%,100% 100%)}
@media (max-width:820px){
 .map-dialog{height:auto;max-height:none}
 .map-dialog .map-head{grid-template-columns:1fr;grid-template-areas:"eyebrow" "title" "tabs" "coords";justify-items:center}
 .map-dialog .map-body{grid-template-columns:minmax(0,1fr)}
 .map-dialog .map-stage{height:min(70vw,520px)}
 .atlas-panel{max-height:60vh}
 .map-dialog #large-map-coordinates{justify-self:center}
}
