/* npcs/styles.css — cleaned (view-only NPC list + modal + shop/crafting tooltips) */

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

  --panel: rgba(10, 12, 16, 0.78);
  --panel2: rgba(10, 12, 16, 0.88);
  --line: rgba(255,255,255,0.12);
  --line2: rgba(255,255,255,0.18);
  --txt: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.66);
  --hover: rgba(255,255,255,0.06);

  /* ✅ Dark overlay on the background image */
  --bg-overlay: rgba(0,0,0,0.58);

  /* sticky col must be basically opaque so text behind never bleeds through */
  --stickybg: rgba(8, 10, 13, 0.985);
  --stickybg-hover: rgba(12, 14, 18, 0.985);

  /* ✅ Scrollbar theme (table horizontal scrollbar) */
  --scrollbar-size: 12px;
  --scroll-track: rgba(0,0,0,0.40);
  --scroll-track-border: rgba(255,255,255,0.10);

  --scroll-thumb: rgba(255,255,255,0.16);
  --scroll-thumb-border: rgba(255,255,255,0.14);

  --scroll-thumb-hover: rgba(255,255,255,0.24);
  --scroll-thumb-hover-border: rgba(255,255,255,0.20);

  --scroll-thumb-active: rgba(34,197,94,0.28);
  --scroll-thumb-active-border: rgba(34,197,94,0.38);
}


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;
}

/* Fixed background layer (doesn't scroll) */
.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;

  /* keep image at "true size" relative to initial zoom by compensating with --zoom */
  background-size: calc(4096px / var(--zoom)) calc(3072px / var(--zoom));
  background-position: var(--bg-x) var(--bg-y);
  background-color: #05070a;
  image-rendering: pixelated;
}

/* ✅ Overlay sits on top of the bg image */
.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; /* above background */
}

@keyframes bodyFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* 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);
}

#fo2-npcs-app { width: 100%; }

body.has-npc-modal { overflow: hidden; }

/* -----------------------------
   Frame
----------------------------- */

.app-frame {
  width: 100%;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.16), transparent 55%),
    radial-gradient(circle at top right, rgba(34,197,94,0.14), transparent 55%),
    rgba(15,23,42,0.96);
  border: var(--pixel-border) solid rgba(148,163,184,0.35);
  box-shadow:
    0 0 0 1px rgba(15,23,42,0.8),
    var(--shadow-soft);
  backdrop-filter: blur(22px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  animation: frameIn 420ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes frameIn {
  from { transform: scale(0.985); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.app-frame::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(34,197,94,0.14);
  pointer-events: none;
  opacity: 0.7;
}

.app-inner {
  /* keep your layout bits */
  min-height: 0;
  display: flex;
  flex-direction: column;

  /* ✅ gradient stays “in place” while page scrolls */
  background-image: linear-gradient(135deg, rgba(15,23,42,0.97), rgba(34,197,94,0.12));
  background-repeat: no-repeat;
  background-position: top left;
  background-size: 100% 100vh;
  background-attachment: fixed;
  
  border-radius: 10px;
}


/* -----------------------------
   Toolbar
----------------------------- */

.tool-bar {
  padding: 8px 18px 6px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.tool-left,
.tool-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tool-right {
  font-size: 11px;
  color: var(--text-faint);
}

.tool-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-faint);
}

/* Search */
.search-wrap { position: relative; }

.search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-faint);
}

.search-input {
    background: rgb(255 255 255 / 11%);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    padding: 6px 10px 6px 26px;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    min-width: 200px;
    transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.search-input::placeholder { color: var(--text-faint); }

/* Selects */
.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  background: rgba(15,23,42,0.96);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 5px 26px 5px 10px;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  min-width: 140px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 2px solid var(--text-faint);
  border-top-color: transparent;
  border-left-color: transparent;
  transform: translateY(-1px) rotate(45deg);
  pointer-events: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

/* Shared focus glow */
.search-input:focus,
.select-wrap select:focus {
  border-color: rgba(34,197,94,0.7);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.45),
    0 0 20px rgba(34,197,94,0.3);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.select-wrap:focus-within::after {
  border-color: var(--accent);
  transform: translateY(-1px) rotate(45deg) scale(1.04);
}

/* ✅ Zones + Roles dropdowns: black with a little opacity (only these two filters) */
#npcLocationFilter,
#npcRoleFilter{
  background: rgba(0,0,0,0.62);
}

#npcLocationFilter:focus,
#npcRoleFilter:focus{
  background: rgba(0,0,0,0.72);
}

/* (Helps the opened list on many browsers; some browsers limit styling <option>) */
#npcLocationFilter option,
#npcRoleFilter option{
  background-color: #000;
  color: var(--text-main);
}

/* -----------------------------
   Main
----------------------------- */

.app-main {
  padding: 10px 18px 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* -----------------------------
   NPC list
----------------------------- */

.npc-list-shell {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  position: relative;
  overflow: visible;
}

.npc-list-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(148,163,184,0.04), transparent 70%);
  pointer-events: none;
}

.npc-list-header {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.4fr) minmax(0, 2.2fr);
    gap: 8px;
    font-size: 1.2rem;
    color: var(--text-faint);
    padding: 4px 4px 6px;
    border-bottom: 1px solid #ffffff2b;
}

.npc-list-header span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.npc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.npc-row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.4fr) minmax(0, 2.2fr);
  gap: 8px;
  padding: 6px 4px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.npc-row:last-child { border-bottom: none; }

.npc-row:hover {
    background: rgb(255 255 255 / 6%);
    transform: translateY(-1px);
    /* box-shadow: 0 0 0 1px rgba(34,197,94,0.4),
    0 10px 22px rgba(0,0,0,0.8); */
    /* border-color: rgba(15,23,42,1); */
    scale: 1.02;
    transition: 0.2s;
    border-radius: 7px;
}

.npc-main-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.npc-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background-position: center 71%;
  background-repeat: no-repeat;
  background-size: 400%;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.npc-name-wrap { min-width: 0; }

.npc-name {
  font-size: 1.2rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-subline,
.npc-col {
  font-size: 1rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-col { color: var(--text-dim); }

.npc-col.npc-services { overflow: visible; }

/* NPC tags */
.npc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(15,23,42,0.98);
  margin-inline: 2px;
}

.npc-tag-shop   { border-color: rgba(34,197,94,0.8);  color: #bbf7d0; }
.npc-tag-crafter{ border-color: rgba(59,130,246,0.8);  color: #bfdbfe; }
.npc-tag-quest  { border-color: rgba(234,179,8,0.8);   color: #facc15; }

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

/* Responsive list */
@media (max-width: 768px) {
  .npc-list-header { display: none; }

  .npc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
  }

  .npc-main-cell { flex: 1 1 auto; }

  .npc-col.npc-location {
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right;
    max-width: 45%;
  }

  .npc-col.npc-services { display: none; }
}

/* -----------------------------
   Pager
----------------------------- */

.pager-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 6px;
  font-size: 1.2rem;
  color: var(--text-faint);
}

.pager-bottom {
  margin-top: 6px;
  border-top: 1px solid rgba(15,23,42,0.9);
  padding-top: 6px;
}

.pager-count {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pager-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pager-select select { min-width: 80px; }

.pager-btn {
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  font-size: 0.8rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    color var(--transition-fast);
}

.pager-btn:hover:not(.pager-btn-disabled):not(:disabled) {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.9);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.7),
    0 8px 18px rgba(0,0,0,0.8);
  transform: translateY(-1px);
}

.pager-btn-disabled,
.pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

/* -----------------------------
   Modal
----------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
  animation: backdropFade 180ms ease-out;
}

@keyframes backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 640px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(34,197,94,0.18), transparent 65%),
    radial-gradient(circle at bottom right, rgba(59,130,246,0.16), transparent 70%),
    #020617;
  border: var(--pixel-border) solid rgba(148,163,184,0.45);
  box-shadow:
    0 0 0 1px rgba(15,23,42,0.9),
    0 28px 70px rgba(0,0,0,0.9);
  overflow: visible;
  animation: modalIn 200ms cubic-bezier(0.25, 0.9, 0.3, 1.2);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(15,23,42,0.95);
    display: flex;
    align-items: center;
    gap: 10px;
    border-top-right-radius: 16px;
    border-top-left-radius: 16px;
    border-bottom: 1px solid #ffffff14;
    margin-bottom: 10px;
    padding-bottom: 14px;
}

.modal-header{
  /* keep your existing modal-header rules */
  overflow: visible; /* ✅ allow swatch to visually escape */
}

.modal-swatch {
    width: 40px;
    height: 40px;
    background-position: 49% 68%;
    background-repeat: no-repeat;
    background-size: 300%;
    image-rendering: pixelated;
    transform: translateY(-10px) scale(2.0);
    filter: drop-shadow(0 12px 18px rgba(0,0,0,0.75));
}

/* Mobile: slightly less aggressive pop-out */
@media (max-width: 640px){
  .modal-swatch{
    transform: translateY(-8px) scale(1.7);
  }
  
  .tool-left {
    flex: none!important;
    min-width: 0;
}


}


.modal-title-wrap { flex: 1; min-width: 0; margin-left: 25px; }

.modal-title {
  font-size: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-sub { font-size: 1.2rem; color: var(--text-faint); }

.modal-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Header location pills */
.modal-location-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgb(255 255 255 / 21%);
    font-size: 1rem;
    line-height: 1.2;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

.modal-location-pill:hover {
  border-color: var(--border-strong);
  background: rgba(30, 64, 175, 0.9);
  text-decoration: none;
}

.modal-location-pill:focus-visible { text-decoration: none; }

.modal-location-pill-empty { opacity: 0.6; }

.modal-close {
  border: 0;
  background: rgba(15,23,42,0.95);
  color: var(--text-dim);
  border-radius: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.modal-close:hover {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(248,113,113,0.4);
}

.modal-body {
  padding: 10px 14px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  background: radial-gradient(circle at bottom, rgba(15,23,42,0.6), transparent 60%);
}

@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
}

.modal-section-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.modal-description {
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  padding: 6px 7px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.modal-pills {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-pill {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(15,23,42,0.95);
  color: var(--text-faint);
}

.modal-pill-id { opacity: 0.8; }

.modal-rows { margin-top: 4px; font-size: 11px; }

.modal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(15,23,42,0.95);
}

.modal-row:last-child { border-bottom: none; }

.modal-row-label { color: var(--text-faint); }

.modal-row-value {
  text-align: right;
  color: var(--text-main);
  white-space: nowrap;
}

/* Force NPC modal visible even if /items/styles.css has generic .modal hiding rules */
#npcModalBackdrop .modal{
  display: block;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}


/* Craft icons row in modal */
.modal-row-value-left { text-align: left; }

/* Quests in modal */
.modal-row-quests { align-items: flex-start; }

.modal-row-value-quests {
  text-align: left;
  color: var(--text-main);
  white-space: normal;
  width: 100%;
}

.modal-quests-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* Quest pill (full width) */
.quest-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  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: 100%;
  max-width: 100%;
}

.quest-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(234,179,8,0.9);
  box-shadow:
    0 0 0 1px rgba(234,179,8,0.7),
    0 12px 26px rgba(0,0,0,0.9);
	text-decoration:none;
}

.quest-pill-icon {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.quest-pill-icon img {
  width: 25px;
  height: 25px;
  image-rendering: pixelated;
  display: block;
}

.quest-pill-text {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 1rem;
    margin-left: 10px;
}

.quest-pill-id {
  font-size: 10px;
  color: var(--text-faint);
}

/* Modal footer */
.modal-footer {
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(15,23,42,0.95);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.modal-footer-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Copy link button (kept; used in view-only footer) */
.npc-edit-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.96);
  font-size: 0.8rem;
  color: var(--text-main);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    color var(--transition-fast);
}

.npc-edit-btn:hover {
  border-color: rgba(34,197,94,0.9);
  background: rgba(34,197,94,0.18);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.7),
    0 10px 24px rgba(0,0,0,0.9);
  transform: translateY(-1px);
}

/* -----------------------------
   Shop / Craft item icons + tooltip
----------------------------- */

.npc-items-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.npc-items-wrap-craft { justify-content: flex-start; }

.npc-item-icon {
  position: relative;
  width: 38px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  text-decoration: none;
  z-index: 0;
}

.npc-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: inline;
  position: relative;
  z-index: 2;
  transform: scale(1.2);
}

.npc-item-placeholder {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.9);
  position: relative;
  z-index: 2;
  transform: scale(1.2);
}

/* Tooltip bubble */
.npc-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: 10px;
  background:
    radial-gradient(circle at top left, rgba(34,197,94,0.16), transparent 60%),
    rgba(15,23,42,0.98);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-main);
  box-shadow: 0 16px 40px rgba(0,0,0,0.8);

  z-index: 20;
  transition:
    opacity 0.14s ease-out,
    transform 0.14s ease-out,
    visibility 0s linear 0.14s;
}

.npc-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15,23,42,0.98) transparent transparent transparent;
}

.npc-item-icon:hover .npc-tooltip,
.npc-item-icon:focus-visible .npc-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.npc-tooltip-name {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-tooltip-meta {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed rgba(148,163,184,0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.npc-tooltip-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.npc-tooltip-meta-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.npc-tooltip-meta-value {
  font-size: 1rem;
  color: var(--text-main);
  white-space: nowrap;
}

.npc-tooltip-coin {
  width: 11px!important;
  height: 11px!important;
  image-rendering: pixelated;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

/* -----------------------------
   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);
}

/* -----------------------------
   Mobile toolbar
----------------------------- */

@media (max-width: 640px) {
  .tool-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .tool-right { width: 100%; }
}


/* =============================
   Toolbar: stretch search inline
   ============================= */

/* Keep right side pinned, let left side grow */
.tool-bar{
  justify-content: flex-start; /* instead of space-between */
}

.tool-left{
  flex: 1 1 520px;  /* grows to take remaining space */
  min-width: 220px;
  min-width: 0;     /* important for flex overflow behavior */
}

.search-wrap{
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;     /* important: lets input truly shrink/grow */
}

.search-input{
  width: 90%;
  min-width: 0;     /* override your min-width:200px so it can flex properly */
}

/* Right side stays tight and aligned to the right */
.tool-right{
  margin-left: auto;
  flex: 0 0 auto;
}

/* Mobile: ensure full-width controls when stacked */
@media (max-width: 640px){
  .tool-left{ width: 100%; }
  .search-wrap{ width: 100%; }
  .search-input{ width: 90%; }
}
