#arena {
    touch-action: none !important;
    user-select: none;
    -webkit-user-select: none;
}
#phoenix-map-open {
    position: fixed;
    z-index: 9;
    border: 0;
    background: transparent;
    color: #fff0b4;
    cursor: pointer;
    text-align: right;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;
    text-shadow: 0 1px 4px #000, 0 0 5px #000;
    font: 700 10.5px system-ui, sans-serif;
}
#phoenix-map-open[hidden] { display: none; }
#phoenix-map-open:focus-visible { outline: 2px solid #ffd270; }

#phoenix-map-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(820px, 95vw);
    max-height: 92dvh;
    overflow: auto;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #b8914f;
    border-radius: 8px;
    background: linear-gradient(180deg, #1d1a12 0%, #11140f 100%);
    color: #f3e3b4;
    font: 13px/1.4 system-ui, sans-serif;
    box-shadow: 0 12px 36px #000c;
}
#phoenix-map-dialog::backdrop { background: rgba(0, 0, 0, 0.74); }
#phoenix-map-dialog header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #594726;
}
#phoenix-map-dialog header strong {
    color: #ffd86b;
    font-size: 16px;
}
.pmap-coords {
    margin-left: 8px;
    color: #9ec8a4;
    font-size: 12px;
    font-weight: 600;
}
.pmap-hdr-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}
#phoenix-map-dialog header button {
    min-height: 34px;
    padding: 0 10px;
    background: linear-gradient(#4c3c1e, #2a2110);
    border: 1px solid #ab874b;
    color: #ffe8a8;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}
.pmap-layout {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 10px;
    align-items: start;
}
.pmap-hint {
    margin: 0 0 6px;
    color: #c8ba94;
    font-size: 12px;
}
#phoenix-map-dialog canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #6b562e;
    border-radius: 5px;
    touch-action: manipulation;
    cursor: crosshair;
    background: #0e150f;
}
.pmap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    font-size: 11.5px;
    color: #cbbfa0;
}
.pmap-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pmap-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid #000;
}
.pmap-legend .lg-hero { background: #fff; }
.pmap-legend .lg-npc { background: #ffd24a; border-radius: 2px; transform: rotate(45deg); }
.pmap-legend .lg-mob { background: #f25444; }
.pmap-legend .lg-peer { background: #5ac8ff; }

#phoenix-map-dialog [role="status"] {
    margin: 6px 0 0;
    color: #ff9c8a;
    font-size: 12px;
}
#phoenix-map-dialog [role="status"]:empty { display: none; }

.pmap-npcs {
    display: flex;
    flex-direction: column;
    background: rgba(20, 22, 16, 0.9);
    border: 1px solid #594726;
    border-radius: 6px;
    overflow: hidden;
}
.pmap-npcs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    background: linear-gradient(90deg, #322815, #1c1f15);
    border-bottom: 1px solid #594726;
    color: #ffd86b;
    font-weight: 700;
    font-size: 12.5px;
}
.pmap-npcs-count {
    font-size: 11px;
    color: #a9d9b0;
    font-weight: 600;
}
.pmap-npc-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px;
    max-height: 325px;
    overflow-y: auto;
}
.pmap-npc-row {
    display: flex;
    align-items: stretch;
    gap: 4px;
}
.pmap-npc-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    background: rgba(39, 34, 21, 0.92);
    border: 1px solid #5e4b28;
    border-radius: 5px;
    color: #f3e4b8;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.pmap-npc-row.has-q .pmap-npc-btn {
    border-color: #d6aa45;
    background: rgba(58, 46, 22, 0.95);
}
.pmap-npc-btn:hover, .pmap-npc-btn:active {
    border-color: #ffd86b;
    background: rgba(70, 56, 28, 0.98);
}
.pmap-npc-ic {
    font-size: 15px;
    flex: none;
}
.pmap-npc-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pmap-npc-meta strong {
    font-size: 12.5px;
    color: #ffe38e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pmap-npc-meta small {
    font-size: 10.5px;
    color: #b7c8aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pmap-mark {
    flex: none;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
}
.pmap-mark.m1, .pmap-mark.m3 { background: #ffd22b; color: #1a1204; }
.pmap-mark.m2 { background: #6c7780; color: #f0f4f8; }

.pmap-npc-warp {
    flex: none;
    width: 30px;
    border: 1px solid #6b562e;
    border-radius: 5px;
    background: #2b2617;
    color: #ffd86b;
    cursor: pointer;
    font-size: 13px;
}
.pmap-npc-warp:hover {
    background: #4e3f20;
    border-color: #ffd86b;
}
.pmap-empty {
    padding: 12px;
    text-align: center;
    color: #9e967e;
    font-size: 12px;
}
.pmap-quick {
    display: flex;
    gap: 6px;
    padding: 7px;
    border-top: 1px solid #4d3e21;
    background: rgba(18, 20, 14, 0.95);
}
.pmap-qbtn {
    flex: 1;
    padding: 7px 6px;
    border: 1px solid #7c6434;
    border-radius: 4px;
    background: #2f2818;
    color: #f3e4b8;
    font: 600 12px system-ui, sans-serif;
    cursor: pointer;
}
.pmap-qbtn.hi {
    background: linear-gradient(#5c461f, #35270f);
    border-color: #d6aa45;
    color: #ffe89e;
}

@media (max-width: 680px) {
    #phoenix-map-dialog {
        width: 96vw;
        padding: 9px;
    }
    .pmap-layout {
        grid-template-columns: 1fr;
    }
    .pmap-npc-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        max-height: 220px;
    }
    .pmap-npc-meta small {
        display: none;
    }
}
