/* /zones/styles.css — NPC vibe + FULL viewport map + overlay drawer */

:root{
  --bg-x: 0px;
  --bg-y: 0px;
  --zoom: 1;

  --panel: rgba(10, 12, 16, 0.78);
  --panel2: rgba(10, 12, 16, 0.88);

  --txt: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.66);

  --text-main: rgba(255,255,255,0.92);
  --text-dim: rgba(255,255,255,0.78);
  --text-faint: rgba(255,255,255,0.64);

  --surface: rgba(15,23,42,0.60);
  --surface-soft: rgba(15,23,42,0.76);

  --border-subtle: rgba(148,163,184,0.24);
  --border-strong: rgba(148,163,184,0.46);

  --accent: #22c55e;
  --danger: #f87171;

  --hover: rgba(255,255,255,0.06);

  --radius: 14px;
  --pixel-border: 2px;
  --shadow-soft: 0 18px 45px rgba(0,0,0,0.55);

  --transition-fast: 0.14s ease;

  --bg-overlay: rgba(0,0,0,0.58);

  --mk-scale: 1;

  --mk-frame-w: 32px;
  --mk-frame-h: 48px;
  --mk-sheet-w: 96px;
  --mk-sheet-h: 192px;
  --mk-col: 1;
  --mk-row: 2;

  /* JS measures the nav and fills this */
  --nav-h: 0px;
}

html,body{
  height:100%;
  margin:0;
  background: #05070a;
}

body{
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--txt);
  background: transparent;
  image-rendering: pixelated;
  position: relative;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("https://myfo2.com/zones/noob-island.png");
  background-repeat: no-repeat;
  background-size: calc(4096px / var(--zoom)) calc(3072px / var(--zoom));
  background-position: var(--bg-x) var(--bg-y);
  background-color: #05070a;
  image-rendering: pixelated;
}
.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: var(--bg-overlay);
  pointer-events:none;
}

.wrap {
    margin: 0 auto;
    padding: 14px;
    position: relative;
    z-index: 1;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,0.7) transparent; }
*::-webkit-scrollbar { width: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.7); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.95); }

/* Toggle pills */
.toggle-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.92);
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.toggle-pill:hover{
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.55);
  transform: translateY(-1px);
}
.toggle-pill input{ width: 14px; height: 14px; accent-color: var(--accent); }

/* -----------------------------
   Full map stage
----------------------------- */

.app-inner{ position: relative; z-index: 1; }

.map-viewport{
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--nav-h));
  min-height: 420px;
  overflow: hidden;
}

/* Map must truly fill */
.zone-map{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: none;
  background: #000;
  overflow: hidden;
}

/* Top overlay bar */
.map-topbar{
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 998;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.map-topbar > *{ pointer-events: auto; }

.map-topbar-left{
  max-width: min(520px, 100%);
  border-radius: 14px;
  background: rgba(2,6,23,0.58);
  backdrop-filter: blur(10px);
  padding: 10px 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.55);
}

.zone-title{ font-size: 1.4rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-meta{ font-size: 1rem; color: var(--text-faint); }

.map-topbar-right{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  border-radius: 14px;
  padding: 10px 12px;
}

.map-info-card{
  pointer-events: auto;
  max-width: min(560px, calc(100vw - 20px));
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(2,6,23,0.58);
  backdrop-filter: blur(10px);
  padding: 10px 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.55);
}

.zone-description{
  margin: 0 0 8px 0;
  border-radius: 10px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.22);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.zone-counts{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}

.count-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.92);
  font-size: 0.9rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.count-pill-npc{ border-color: rgba(59,130,246,0.55); }
.count-pill-mob{ border-color: rgba(34,197,94,0.55); }
.count-pill-boss{ border-color: rgba(248,113,113,0.60); }

/* Map overlay message */
.map-overlay{
  position:absolute;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  text-align:center;
  background: rgba(2,6,23,0.72);
  color: var(--text-main);
  font-size: 1rem;
  letter-spacing: 0.04em;
  z-index: 20;
}
.map-overlay-error{ background: rgba(127,29,29,0.42); }

/* Leaflet controls vibe (zoom controls removed, but harmless if kept) */
.zone-map .leaflet-control-zoom a{
  background: rgba(15,23,42,0.92);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,0.35);
}
.zone-map .leaflet-control-zoom a:hover{
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.55);
}
.zone-map .leaflet-image-layer{ image-rendering: pixelated; }

/* ✅ DARK MODE POPUPS (click markers) */
.zone-map .leaflet-popup-content-wrapper{
  background: rgb(0 0 0 / 67%);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.75);
}
.zone-map .leaflet-popup-tip{
  background: rgb(0 0 0 / 51%);
  border: 1px solid rgba(148,163,184,0.28);
  box-shadow: none;
}
.zone-map .leaflet-popup-content{
  margin: 10px 12px;
}
.zone-map .leaflet-popup-close-button{
  color: rgba(255,255,255,0.72) !important;
  text-shadow: none !important;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 10px;
  top: 6px;
  right: 6px;
}
.zone-map .leaflet-popup-close-button:hover{
  color: rgba(255,255,255,0.92) !important;
  background: rgba(34,197,94,0.14);
}

/* ✅ HOVER TOOLTIPS (name + type) */
.zone-map .leaflet-tooltip.mf2-tooltip{
  background: rgba(2,6,23,0.92);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.32);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.65);
}
.zone-map .leaflet-tooltip.mf2-tooltip::before{
  border-top-color: rgba(2,6,23,0.92);
}
.zone-map .leaflet-tooltip-top.mf2-tooltip::before{ border-top-color: rgba(2,6,23,0.92); }
.zone-map .leaflet-tooltip-bottom.mf2-tooltip::before{ border-bottom-color: rgba(2,6,23,0.92); }
.zone-map .leaflet-tooltip-left.mf2-tooltip::before{ border-left-color: rgba(2,6,23,0.92); }
.zone-map .leaflet-tooltip-right.mf2-tooltip::before{ border-right-color: rgba(2,6,23,0.92); }

.map-tip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.map-tip-name{
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-tip-pill{
  display:inline-flex;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.34);
  background: rgba(15,23,42,0.90);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.86);
}
.map-tip-pill-npc{ border-color: rgba(59,130,246,0.60); }
.map-tip-pill-mob{ border-color: rgba(34,197,94,0.60); }
.map-tip-pill-boss{ border-color: rgba(248,113,113,0.70); }

/* -----------------------------
   Drawer (zones list) overlay
----------------------------- */

.zone-list-shell{
  border-radius: var(--radius);
  background: rgba(2,6,23,0.62);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,0.28);
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: min(420px, calc(100vw - 20px));
  z-index: 999;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, opacity 200ms ease;
}

.zone-drawer.drawer-collapsed{
  transform: translateX(calc(-100% - 12px));
  opacity: 0.98;
}

.drawer-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.22);
  background: rgba(15,23,42,0.55);
}

.drawer-title{
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
}

.drawer-btn{
  width: 34px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.32);
  background: rgba(2,6,23,0.55);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.drawer-btn:hover{
  transform: translateY(-1px);
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.55);
}

.drawer-scroll{
  /* The drawer itself no longer scrolls; the zones list does */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 10px 12px;
  min-height: 0;
  flex: 1 1 auto;
}




/* ✅ Zones-only scroll region */
.zone-list-scroll{
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1 1 auto;

  /* ✅ Mobile/iOS scroll fixes */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* optional flag class for the JS loop mode */
.zone-list-scroll.zone-loop{
  scroll-behavior: auto;
}



/* -----------------------------
   Zone list (inside drawer)
----------------------------- */



.zone-list{ list-style:none; margin:0; padding: 6px 5px 0 5px; }

.zone-row{
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 8px;
  padding: 6px 4px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 7px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.zone-row:hover{
  background: rgb(255 255 255 / 6%);
  transform: translateY(-1px);
  scale: 1.02;
  transition: 0.2s;
}
.zone-row-active{
  background: rgba(34,197,94,0.12) !important;
  border: 1px solid rgba(34,197,94,0.35);
}

.zone-main-cell{ display:flex; align-items:center; gap: 8px; min-width:0; }
.zone-name-wrap{ min-width:0; }
.zone-name{
  font-size: 1rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zone-col{
  font-size: 1rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zone-levels{ text-align: right; }

.empty-state{
  padding: 16px 4px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

/* Peek button (only visible when collapsed) */
.drawer-peek{
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.32);
  background: rgba(2,6,23,0.58);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  display: none; /* JS toggles display */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0,0,0,0.55);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.drawer-peek:hover{
  transform: translateY(-50%) translateY(-1px);
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.55);
}

/* Keep overlays from covering everything on tiny screens */
@media (max-width: 520px){
  .map-topbar{ left: 8px; right: 8px; top: 8px; }
  .zone-list-shell{ top: 8px; left: 8px; bottom: 8px; width: calc(100vw - 46px); }
  .drawer-peek{ left: 8px; }
}

/* -----------------------------
   Marker icons (unchanged)
----------------------------- */

.leaflet-marker-icon,
.leaflet-marker-shadow{ overflow: visible !important; }
.leaflet-marker-shadow{ display: none !important; }

.map-icon-wrap{ background: transparent !important; border: none !important; box-shadow: none !important; }

.map-icon-inner{
  width: var(--mk-frame-w);
  height: var(--mk-frame-h);
  border: none !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  filter: none !important;

  background-repeat: no-repeat;
  background-size: var(--mk-sheet-w) var(--mk-sheet-h);
  background-position:
    calc(var(--mk-col) * -1 * var(--mk-frame-w))
    calc(var(--mk-row) * -1 * var(--mk-frame-h));

  image-rendering: pixelated;

  transform: translateZ(0) scale(var(--mk-scale));
  transform-origin: 50% 100%;
  will-change: transform;
}

.map-popup{ min-width: 220px; }
.map-popup-title{ font-size: 13px; font-weight: 600; color: #f9fafb; margin-bottom: 2px; }
.map-popup-sub{ font-size: 11px; color: rgba(226,232,240,0.75); margin-bottom: 6px; }
.map-popup-notes{
  font-size: 11px;
  color: rgba(226,232,240,0.85);
  background: rgba(2,6,23,0.45);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 8px;
  line-height: 1.35;
}
.map-popup-actions{ display:flex; gap: 8px; align-items:center; }
.map-popup-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgb(255 255 255 / 16%);
    color: #ffffff!important;
    font-size: 11px;
    text-decoration: none;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.map-popup-link:hover{
  transform: translateY(-1px);
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.55);
  text-decoration: none;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: radial-gradient(circle at top left, rgba(34,197,94,0.25), transparent 60%), rgba(15,23,42,0.98);
  color: #f9fafb;
  font-size: 1rem;
  line-height: 1.3;
  box-shadow: 0 18px 45px rgba(0,0,0,0.85);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 80;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.toast-visible{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -----------------------------
   Global search (NPCs + enemies)
----------------------------- */

.map-topbar-mid{
  flex: 1 1 auto;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  pointer-events: auto;
}

.search-shell{
  position: relative;
  width: min(640px, calc(100vw - 20px));
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(2,6,23,0.58);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.55);
  overflow: visible;
}

.search-input-wrap{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
}

.search-ico{
  width: 22px;
  height: 22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,0.72);
  font-size: 18px;
  line-height: 1;
  user-select:none;
}

#globalSearchInput{
  flex: 1 1 auto;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  letter-spacing: 0.02em;
}

#globalSearchInput::placeholder{
  color: rgba(255,255,255,0.55);
}

.search-clear{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.32);
  background: rgba(2,6,23,0.55);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.search-clear:hover{
  transform: translateY(-1px);
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.55);
}

.search-dropdown{
  position:absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(2,6,23,0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 55px rgba(0,0,0,0.65);
  overflow:hidden;
  z-index: 1200;
}

.search-status{
  padding: 10px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.66);
  border-bottom: 1px solid rgba(148,163,184,0.18);
}

.search-results{
  list-style:none;
  margin:0;
  padding: 6px;
  max-height: min(62vh, 520px);
  overflow:auto;
}

.search-row{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 8px 8px;
  border-radius: 12px;
  cursor:pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.search-row:hover{
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.search-row-active{
  background: rgba(34,197,94,0.14) !important;
  border: 1px solid rgba(34,197,94,0.35);
}

.search-left{
  flex: 0 0 auto;
  width: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.search-sprite{
  width: 32px;
  height: 48px;
  background-repeat: no-repeat;
  background-size: var(--mk-sheet-w) var(--mk-sheet-h);
  background-position:
    calc(var(--mk-col) * -1 * var(--mk-frame-w))
    calc(var(--mk-row) * -1 * var(--mk-frame-h));
  image-rendering: pixelated;
  filter: none;
}

.search-mid{
  flex: 1 1 auto;
  min-width: 0;
}

.search-name{
  font-size: 12px;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-sub{
  font-size: 11px;
  color: rgba(255,255,255,0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-right{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.search-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.30);
  background: rgba(15,23,42,0.92);
  font-size: 10px;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.search-pill-npc{ border-color: rgba(59,130,246,0.55); }
.search-pill-mob{ border-color: rgba(34,197,94,0.55); }

.search-hit{
  background: rgba(34,197,94,0.22);
  border-radius: 6px;
  padding: 0 3px;
}

/* Small screens: keep search usable */
@media (max-width: 860px){
  .map-topbar{
    flex-wrap: wrap;
  }
  .map-topbar-left{
    flex: 1 1 100%;
  }
  .map-topbar-mid{
    flex: 1 1 100%;
    justify-content: stretch;
  }
  .search-shell{
    width: 100%;
  }
  .map-topbar-right { justify-content: flex-start; }
  
.map-topbar-left { background: none; backdrop-filter:none; }
}


/* -----------------------------
   Quest pills in map popups
----------------------------- */

.quest-pill-stack{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 8px 0;
}

.quest-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at top left, rgb(194 197 34 / 20%), rgba(15, 23, 42, 0.96));
  font-size: 11px;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 10px 22px rgba(15,23,42,0.75),
    0 0 0 1px rgba(15,23,42,0.8);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
  width: 90%;
}

.quest-pill:hover{
  transform: translateY(-1px);
  border-color: rgba(194,197,34,0.55);
  text-decoration: none;
}

.quest-pill-icon{
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}

.quest-pill-text{
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.quest-pill-title{
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-pill-sub{
  font-size: 10px;
  line-height: 1.1;
  color: var(--text-faint);
  opacity: 0.9;
}

/* ✅ Allow popover tooltips inside popup to escape */
.zone-map .leaflet-popup-content-wrapper,
.zone-map .leaflet-popup-content{
  overflow: visible;
}

/* -----------------------------
   NPC Shop section in popups
----------------------------- */

.npc-shop{
  margin: 8px 0 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(15,23,42,0.55);
}

.npc-shop-head{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 8px;
}

.npc-shop-ico{
  width: 18px;
  height: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}

.npc-shop-title{
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.86);
}

.npc-shop-grid{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-item{
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(2,6,23,0.72);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.shop-item:hover{
  transform: translateY(-1px);
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.55);
  text-decoration: none;
}

.shop-item-fallback{
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  user-select:none;
}

.shop-item-hasicon .shop-item-fallback{
  display:none;
}

/* Tooltip (uses data-tip="Item Name") */
.shop-item::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  white-space: nowrap;

  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.32);
  background: rgba(2,6,23,0.94);
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.65);

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 9999;
}

.shop-item::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(2,6,23,0.94);
  opacity: 0;
  pointer-events:none;
  transition: opacity 120ms ease;
  z-index: 9999;
}

.shop-item:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(-1px);
}

.shop-item:hover::before{
  opacity: 1;
}

.map-popup-btn{
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}



/* -----------------------------
   NPC Craft section in popups
----------------------------- */

.npc-craft{
  margin: 8px 0 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.22);
  background:
    radial-gradient(circle at top left, rgba(168,85,247,0.18), transparent 55%),
    rgba(15,23,42,0.55);
}

.npc-craft-head{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 8px;
}

.npc-craft-title{
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
}


/* ✅ Mobile sidebar stack slot (holds moved topbar-left + topbar-right) */
.drawer-mobile-stack{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px 10px;
  margin-bottom: 10px;

  /* stays visible while scrolling the zone list */
  top: 0;
  z-index: 5;

  border-bottom: 1px solid rgba(148,163,184,0.18);
}

/* When those topbar cards are moved into the drawer */
.map-topbar-left.in-drawer,
.map-topbar-right.in-drawer{
  max-width: 100%;
  width: 100%;
  box-shadow: none;
  border-radius: 12px;
  padding: 10px 10px;
}

/* Slightly tighter text inside sidebar */
.map-topbar-left.in-drawer .zone-title{
  font-size: 1.15rem;
}
.map-topbar-left.in-drawer .zone-meta{
  font-size: 0.95rem;
}


/* ✅ NEW: Topbar mid row (Zones button + Search inline) */
.map-topbar-mid{
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

/* let search take remaining space */
.map-topbar-mid .search-shell{
  flex: 1 1 auto;
  min-width: 0;
}

/* ✅ NEW: Mobile inline Zones button */
.zones-inline-btn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.32);
  background: rgba(2,6,23,0.58);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  display: none; /* shown on mobile */
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 18px 45px rgba(0,0,0,0.55);
}
.zones-inline-btn:hover{
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.55);
  transform: translateY(-1px);
}


@media (max-width: 820px){
  .zones-inline-btn{ display: inline-flex; }

  /* we use the inline button on mobile, so never show the left-edge peek */
  .drawer-peek{ display: none !important; }
}


