/* The minimap (top-right corner, under the bag and menu buttons) and the region map window (M).
   js/client/maps.js + js/client/region-map.js. Live report #2, 2026-11-16. */

/* ---- minimap ---- */
.minimap { position: fixed; right: calc(12px + env(safe-area-inset-right)); top: calc(66px + env(safe-area-inset-top)); z-index: 4; width: 176px; height: 176px; border-radius: 50%; border: 3px solid #e8b64a; background: #2a1f12; box-shadow: 0 0 0 2px rgba(40, 26, 10, .65), 0 6px 18px rgba(20, 12, 4, .45); }
.minimap[hidden], .mm-open[hidden] { display: none; }
body:not(.in-game) .minimap, body:not(.in-game) .mm-open { display: none; }
.mm-canvas { display: block; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; touch-action: manipulation; }
.mm-b { position: absolute; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 Spectral, Georgia, serif; background: rgba(255, 246, 224, .94); border: 2px solid var(--gold-d); color: var(--ink); }
.mm-b svg { width: 14px; height: 14px; display: block; }
.mm-btns .mm-in { left: -10px; bottom: 34px; }
.mm-btns .mm-out { left: -10px; bottom: 2px; }
.mm-hide { left: -6px; top: -4px; }
.mm-key { position: absolute; right: 2px; bottom: 2px; font: 700 11px Spectral, serif; border: 1px solid #a8761c; border-radius: 4px; padding: 0 5px; background: #fff6e0; color: #6a4a1a; pointer-events: none; }
.mm-key[hidden] { display: none; }
.mm-card, .rm-card { position: absolute; z-index: 6; pointer-events: none; width: max-content; max-width: 220px; background: var(--paper); color: var(--ink); border: 2px solid var(--gold-d); border-radius: 10px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(20, 12, 4, .4); font: 400 13px Spectral, Georgia, serif; line-height: 1.3; }
.mm-card[hidden], .rm-card[hidden] { display: none; }
.mm-card b, .rm-card b { display: block; font: 700 14px Cinzel, Georgia, serif; color: #7a3e10; }
.mm-card small, .rm-card small { display: block; opacity: .8; }
.mm-card span, .rm-card span { display: block; font-weight: 600; }
.mm-open { position: fixed; right: calc(12px + env(safe-area-inset-right)); top: calc(66px + env(safe-area-inset-top)); z-index: 4; width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 246, 224, .94); }
.mm-open svg { width: 28px; height: 28px; display: block; }
/* the quest tracker moves under the minimap (it used to own this corner) */
.quest-track { top: calc(254px + env(safe-area-inset-top)); }
body.mm-off .quest-track { top: calc(122px + env(safe-area-inset-top)); }

/* phones held upright: a smaller map, no zoom buttons (tap it for the big map) — clear of the target frame at 360 px */
@media (max-width: 600px) {
  .minimap { width: 100px; height: 100px; top: calc(66px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
  .mm-btns { display: none; }
  .mm-hide { width: 26px; height: 26px; left: -8px; top: -6px; }
  .mm-open { right: calc(10px + env(safe-area-inset-right)); width: 44px; height: 44px; }
}
/* phones on their side: the skill arc owns the right side, so the map sits LEFT of the bag and menu buttons */
@media (max-height: 500px) and (min-width: 601px) {
  .minimap { width: 96px; height: 96px; top: calc(8px + env(safe-area-inset-top)); right: calc(128px + env(safe-area-inset-right)); }
  .mm-btns { display: none; }
  .mm-open { top: calc(10px + env(safe-area-inset-top)); right: calc(128px + env(safe-area-inset-right)); }
  .quest-track, body.mm-off .quest-track { top: calc(112px + env(safe-area-inset-top)); }
}

/* ---- region map window ---- */
.rmap { padding: 12px; }
.rm-panel { position: relative; width: min(1180px, 100%); height: min(820px, 100%); display: grid; grid-template-rows: auto 1fr; background: var(--paper); border: 3px solid var(--gold-d); border-radius: 16px; box-shadow: 0 14px 50px rgba(0, 0, 0, .45); overflow: hidden; }
.rm-top { display: flex; align-items: center; gap: 14px; padding: 10px 62px 10px 14px; border-bottom: 2px solid #c8a874; background: linear-gradient(#fbf1dc, #f0dfbd); min-width: 0; }
.rm-top h2 { margin: 0 0 0 auto; font: 800 20px Cinzel, serif; color: #7a3e10; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rm-top h2 small { font: 600 14px Spectral, serif; color: #6a4a1a; }
.rm-x { position: absolute; right: 8px; top: 7px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.rm-x svg { width: 22px; height: 22px; }
.rm-tabs { display: flex; gap: 6px; flex: none; }
.rm-tabs button { font: 800 15px Cinzel, serif; padding: 6px 14px; border-radius: 10px 10px 4px 4px; display: flex; align-items: center; gap: 8px; }
.rm-tabs button.on { background: linear-gradient(#f7cf6a, #d99a2b); border-color: #8a5a10; }
.rm-tabs kbd, .map-tabs kbd { font: 700 11px Spectral, serif; border: 1px solid #a8761c; border-radius: 4px; padding: 0 4px; background: #fff6e0; color: #6a4a1a; }
.rm-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; min-height: 0; }
.rm-view { position: relative; min-height: 0; min-width: 0; background: #2a1f12; overflow: hidden; }
.rm-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.rm-view canvas:active { cursor: grabbing; }
.rm-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 6px; }
.rm-zoom button { width: 44px; height: 44px; min-height: 0; padding: 0; display: grid; place-items: center; font: 800 22px/1 Spectral, serif; background: rgba(255, 246, 224, .94); }
.rm-zoom svg { width: 22px; height: 22px; display: block; }
.rm-list { overflow: auto; min-height: 0; overscroll-behavior: contain; padding: 4px 12px 12px; background: #fbf3e2; border-left: 2px solid #c8a874; }
.rm-list h3 { font: 700 14px Cinzel, serif; color: #7a3e10; margin: 12px 0 6px; letter-spacing: .3px; }
.rm-row { width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 6px 10px; margin: 0 0 5px; min-height: 44px; background: #fff8e8; border: 2px solid #d8bc84; }
.rm-row.on { border-color: #e8a42a; background: #fff2b0; }
.rm-row b { display: block; font: 700 14px Spectral, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-row small { display: block; font-size: 12px; opacity: .75; }
.rm-t { min-width: 0; }
.rm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(40, 26, 10, .55); }
.rm-dot.k-waypoint { border-radius: 2px; transform: rotate(45deg) scale(.85); }
.rm-dot.k-entrance { border-radius: 6px 6px 2px 2px; }
.rm-d { font: 600 12px Spectral, serif; font-style: normal; color: #6a4a1a; white-space: nowrap; }
.rm-none { opacity: .7; }
/* the world map (travel-ui.js) wears the same tabs */
.map-tabs { margin: 0 0 10px; }

@media (max-width: 700px) {
  .rmap { padding: 0; }
  .rm-panel { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .rm-top { flex-wrap: wrap; gap: 6px 10px; padding: 8px 58px 8px 10px; }
  .rm-top h2 { margin: 0; order: -1; flex: 1 1 100%; font-size: 18px; }
  .rm-tabs button { font-size: 14px; padding: 5px 10px; }
  .rm-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(130px, 36%); }
  .rm-list { border-left: 0; border-top: 2px solid #c8a874; }
}
