/* World map page (map.html) */
.map-page { overflow: hidden; }
.wm { flex: none; display: flex; height: calc(100vh - 61px); height: calc(100dvh - 61px); }
.wm-side { width: 300px; flex: none; background: var(--ink-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.wm-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 0; flex: 1; }
.wm-panel h1 { margin: 0; font: 600 1.5rem/1.1 var(--title); color: var(--gold-hi); letter-spacing: .04em; }
.wm-panel input[type=search], .wm-panel select {
  width: 100%; padding: 8px 10px; font: 500 1.05rem var(--serif); color: var(--text);
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius);
}
.wm-panel input[type=search]:focus, .wm-panel select:focus { outline: none; border-color: var(--gold); }
.wm-chk { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 1rem; cursor: pointer; margin-right: 14px; }
.wm-count { color: var(--muted); font-size: .92rem; }
.wm-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.wm-list li { padding: 6px 4px; border-bottom: 1px solid rgba(58, 47, 31, .5); cursor: pointer; line-height: 1.2; }
.wm-list li:hover, .wm-list li.on { background: rgba(216, 178, 90, .1); color: var(--gold-hi); }
.wm-list small { display: block; color: var(--muted); font-size: .85rem; }
.wm-toggle { display: none; }

.wm-view { position: relative; flex: 1; min-width: 0; background: #025582; overflow: hidden; touch-action: none; }
#wm-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
#wm-canvas.drag { cursor: grabbing; }
.wm-zoom { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.wm-zoom button, .wm-toggle, .wm-close {
  width: 38px; height: 38px; font: 600 1.4rem/1 var(--serif); color: var(--gold-hi);
  background: rgba(20, 17, 13, .85); border: 1px solid rgba(216, 178, 90, .55); border-radius: var(--radius); cursor: pointer;
}
.wm-zoom button:hover { background: rgba(216, 178, 90, .18); }
.wm-coords {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; font: 600 1rem var(--serif); color: var(--text);
  background: rgba(11, 10, 9, .8); border: 1px solid var(--line); border-radius: var(--radius); pointer-events: none;
}
.wm-info {
  position: absolute; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); padding: 14px 16px;
  color: var(--parch-ink); background: var(--parch); border: 1px solid #b89a5c; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.wm-info h3 { margin: 0 30px 2px 0; font: 600 1.35rem/1.15 var(--title); }
.wm-info-f { font-style: italic; color: #6b5330; }
.wm-info p { margin: 8px 0; line-height: 1.35; }
.wm-info-c { font-weight: 600; }
.wm-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; font-size: 1.2rem; }

@media (max-width: 720px) {
  .wm { flex-direction: column-reverse; }
  .wm-side { width: auto; overflow: hidden; border-right: 0; border-top: 1px solid var(--line); max-height: 48px; transition: max-height .2s; }
  .wm-side.open { max-height: 55%; }
  .wm-toggle { display: block; width: 100%; height: 47px; flex: none; border: 0; border-radius: 0; font-size: 1.1rem; }
  .wm-panel { padding: 10px 12px; }
  .wm-panel h1 { display: none; }
  .wm-coords { font-size: .9rem; }
  .wm-info { bottom: 52px; left: 12px; right: 12px; width: auto; }
}
