:root {
  --bg: #070706;
  --panel: rgba(17, 19, 22, .94);
  --panel-2: rgba(27, 29, 34, .92);
  --panel-3: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(219, 166, 42, .42);
  --gold: #dba62a;
  --gold-2: #a66d05;
  --gold-3: #ffe2a1;
  --text: #f6efe0;
  --muted: #aeb2bb;
  --danger: #ff574d;
  --monster: #ff4747;
  --npc: #52b6ff;
  --house: #b989ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .48);
  --premium-shadow: 0 22px 70px rgba(0, 0, 0, .48), 0 0 34px rgba(219, 166, 42, .08);
  --ember: #ff7b1a;
  --steel-blue: #3b77a7;
  --sidebar: 390px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(219, 166, 42, .12), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(130, 45, 18, .16), transparent 34%),
    #070706;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 202, 92, .16), transparent 20%),
    radial-gradient(circle at 92% 92%, rgba(255, 92, 28, .12), transparent 24%),
    linear-gradient(120deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 12px);
  opacity: .55;
  mix-blend-mode: screen;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 34%),
    radial-gradient(circle at 52% 0%, rgba(219, 166, 42, .07), transparent 42%);
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 211, 112, .10), transparent 24%),
    linear-gradient(180deg, rgba(30, 23, 11, .42), transparent 38%),
    linear-gradient(180deg, rgba(16, 18, 22, .98), rgba(12, 13, 16, .96));
  border-right: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sidebar::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .045), transparent 7%, transparent 93%, rgba(219, 166, 42, .08)),
    radial-gradient(circle at 0% 18%, rgba(219, 166, 42, .12), transparent 28%);
  opacity: .8;
}

.sidebar::after {
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 220, 139, .78), transparent);
  box-shadow: 0 0 22px rgba(219, 166, 42, .34);
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 122px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.brand::before {
  content: "";
  position: absolute;
  inset: 12px 18px 14px;
  z-index: -1;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(219, 166, 42, .14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent);
  filter: blur(.2px);
}

.brand-logo {
  display: block;
  width: min(340px, 100%);
  max-height: 118px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .45));
}

.brand .mobile-toggle {
  position: absolute;
  top: 8px;
  right: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}

.mobile-toggle,
.hamburger {
  display: none;
}

.search-card {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 222, 150, .14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .035)),
    radial-gradient(circle at 0 0, rgba(219, 166, 42, .10), transparent 36%);
  box-shadow: var(--premium-shadow);
}

.search-card label,
.task-filter label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.search-box {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 222, 150, .30);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, .28)),
    radial-gradient(circle at 0% 50%, rgba(219, 166, 42, .10), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .16);
}

.search-box span {
  color: var(--gold);
  font-size: 20px;
}

.search-box input,
.delivery-search input,
.task-filter select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder,
.delivery-search input::placeholder {
  color: rgba(246, 239, 224, .48);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.pill,
.tab,
.layer-toggle,
.city-button,
.ghost-action,
.primary-action {
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .045));
  color: var(--text);
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.pill {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.pill:hover,
.tab:hover,
.layer-toggle:hover,
.city-button:hover,
.ghost-action:hover,
.primary-action:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.pill.active,
.tab.active,
.layer-toggle.active,
.city-button.active,
.primary-action {
  border-color: rgba(255, 222, 150, .54);
  background:
    linear-gradient(180deg, rgba(255, 226, 145, .92) 0%, #dba62a 34%, #a66d05 100%);
  color: #160d02;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(166, 109, 5, .30), 0 0 18px rgba(219, 166, 42, .10), inset 0 1px 0 rgba(255, 255, 255, .42);
}

.tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.tab {
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.panel {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.panel.active {
  display: block;
}

.panel::-webkit-scrollbar,
.result-list::-webkit-scrollbar,
.delivery-list::-webkit-scrollbar,
.floor-list::-webkit-scrollbar {
  width: 8px;
}

.panel::-webkit-scrollbar-thumb,
.result-list::-webkit-scrollbar-thumb,
.delivery-list::-webkit-scrollbar-thumb,
.floor-list::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: rgba(219, 166, 42, .36);
}

.selected-card,
.result-card,
.floor-button,
.task-card,
.delivery-row,
.spawn-row,
.back-results,
.mini-filter {
  border: 1px solid rgba(255, 255, 255, .105);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .032)),
    rgba(0, 0, 0, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.selected-card {
  padding: 10px;
  margin-bottom: 8px;
  border-color: rgba(255, 222, 150, .13);
  background:
    radial-gradient(circle at 100% 0%, rgba(219, 166, 42, .08), transparent 34%),
    linear-gradient(180deg, rgba(30, 32, 37, .95), rgba(16, 18, 22, .95));
  box-shadow: 0 16px 42px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.result-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 8px 9px;
  border: 1px solid rgba(219, 166, 42, .20);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 25, 29, .90), rgba(12, 13, 16, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.result-toolbar > span {
  color: var(--gold-3);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.result-sort-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.sort-chip {
  min-width: 38px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.sort-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 166, 42, .58);
  background: rgba(219, 166, 42, .12);
}

.sort-chip.active {
  border-color: rgba(255, 222, 150, .60);
  background: linear-gradient(180deg, #e3ad27 0%, #a66d05 100%);
  color: #160d02;
  box-shadow: 0 8px 22px rgba(166, 109, 5, .24), inset 0 1px 0 rgba(255, 255, 255, .34);
}

.selected-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.selected-title img,
.result-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .75));
}

.selected-title h2 {
  margin: 0;
  font-size: 18px;
}

.type-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(219, 166, 42, .13);
  color: var(--gold-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.selected-title .muted {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.monster-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  min-width: 0;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.stat strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(219, 166, 42, .13);
  color: var(--gold-3);
  font-size: 11px;
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-bottom: 22px;
}

.result-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
  color: var(--text);
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, rgba(219, 166, 42, .68), transparent);
  opacity: 0;
  transition: opacity .14s ease;
}

.result-card:hover {
  border-color: var(--gold);
  background:
    radial-gradient(circle at 0% 50%, rgba(219, 166, 42, .16), transparent 34%),
    linear-gradient(180deg, rgba(43, 38, 25, .94), rgba(18, 20, 24, .98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.result-card:hover::before {
  opacity: 1;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 222, 150, .10), transparent 58%),
    rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 22px rgba(0, 0, 0, .22);
}

.result-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .06), 0 0 18px currentColor;
}

.result-dot.monster { color: var(--monster); background: var(--monster); }
.result-dot.npc { color: var(--npc); background: var(--npc); }
.result-dot.house { color: var(--house); background: var(--house); }
.result-dot.task { color: var(--gold); background: var(--gold); }
.result-dot.task { color: var(--gold); background: var(--gold); }

.result-main strong {
  display: block;
  font-size: 14px;
}

.result-main span,
.result-meta {
  color: var(--muted);
  font-size: 12px;
}

.result-meta {
  justify-self: end;
  white-space: nowrap;
}

.spawn-browser {
  display: grid;
  gap: 10px;
}

.spawn-browser-head {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(219, 166, 42, .24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(219, 166, 42, .12), rgba(255, 255, 255, .045));
}

.spawn-browser-head strong,
.spawn-browser-head span {
  display: block;
}

.spawn-browser-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.back-results {
  justify-self: start;
  padding: 8px 11px;
  border-color: rgba(219, 166, 42, .34);
  background: rgba(0, 0, 0, .22);
  color: var(--gold-3);
  font-size: 12px;
  font-weight: 900;
}

.spawn-floor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-filter {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: 11px;
}

.mini-filter:hover {
  border-color: rgba(219, 166, 42, .42);
  color: var(--gold-3);
}

.spawn-table {
  display: grid;
  gap: 6px;
}

.task-monster-list {
  display: grid;
  gap: 8px;
}

.spawn-row {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-color: rgba(255, 255, 255, .10);
  background: linear-gradient(180deg, rgba(32, 35, 41, .96), rgba(18, 20, 24, .98));
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.spawn-row:hover {
  border-color: var(--gold);
  background: rgba(219, 166, 42, .10);
}

.spawn-row:focus-visible,
.result-card:focus-visible,
.back-results:focus-visible,
.city-button:focus-visible,
.mini-filter:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.spawn-row span:first-child {
  color: var(--gold-3);
  font-size: 11px;
  font-weight: 900;
}

.spawn-row strong {
  font-size: 12px;
}

.spawn-row span,
.spawn-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.floor-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-bottom: 28px;
}

.floor-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
}

.floor-button.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(219, 166, 42, .22), rgba(166, 109, 5, .18));
}

.floor-button strong {
  display: block;
  font-size: 13px;
}

.floor-button span {
  color: var(--muted);
  font-size: 11px;
}

.counter {
  align-self: center;
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  color: var(--gold-3);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.task-filter {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.delivery-filter {
  margin-top: 12px;
}

.task-filter select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(219, 166, 42, .32);
  border-radius: 12px;
  background: #111317;
}

.primary-action {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
}

.task-grid {
  display: none;
}

.delivery-search {
  padding: 0 0 8px;
}

.delivery-search input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .42);
  color: var(--text);
}

.delivery-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin-top: 10px;
  padding: 0 2px 12px 0;
}

.delivery-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  color: var(--text);
  text-align: left;
  border-color: rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(34, 37, 43, .98), rgba(17, 19, 23, .98));
}

.delivery-row:hover {
  border-color: var(--gold);
  background: rgba(219, 166, 42, .10);
}

.item-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.item-icon img {
  max-width: 32px;
  max-height: 32px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .75));
}

.item-icon.missing::before {
  content: "ITEM";
  color: var(--gold-3);
  font-size: 9px;
  font-weight: 900;
}

.delivery-row strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.delivery-row > span:not(.item-icon) {
  display: grid;
  gap: 2px;
}

.delivery-row span,
.delivery-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.delivery-row em {
  justify-self: end;
  white-space: nowrap;
}

.map-stage {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #020303;
}

.map-stage::before,
.map-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.map-stage::before {
  inset: 78px 0 82px;
  z-index: 40;
  border-top: 1px solid rgba(255, 221, 147, .30);
  border-bottom: 1px solid rgba(255, 221, 147, .24);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .34),
    inset 0 0 70px rgba(0, 0, 0, .34),
    0 0 34px rgba(219, 166, 42, .10);
}

.map-stage::after {
  inset: 0;
  z-index: 39;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 13%, transparent 84%, rgba(0, 0, 0, .56)),
    radial-gradient(circle at 72% 10%, rgba(219, 166, 42, .08), transparent 28%);
}

#map {
  position: absolute;
  top: 78px;
  right: 0;
  bottom: 82px;
  left: 0;
  z-index: 1;
  background: #020303;
  border-top: 1px solid rgba(219, 166, 42, .16);
  border-bottom: 1px solid rgba(219, 166, 42, .16);
}

.leaflet-container {
  background: #020303;
  font: inherit;
}

.leaflet-control-attribution {
  display: none !important;
}

.app-shell.floor-water #map,
.app-shell.floor-water .leaflet-container {
  background: #336699;
}

.leaflet-tile,
.map-tile {
  image-rendering: pixelated;
}

.map-topbar {
  position: absolute;
  z-index: 1200;
  top: 14px;
  left: 16px;
  right: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: min(760px, calc(100% - 32px));
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 222, 150, .42);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(20, 18, 14, .86), rgba(8, 9, 11, .78)),
    radial-gradient(circle at 0% 0%, rgba(219, 166, 42, .18), transparent 44%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42), 0 0 26px rgba(219, 166, 42, .10), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
  flex: 0 1 420px;
}

.topbar-title strong {
  display: block;
  color: var(--gold-3);
  font-size: 15px;
}

.topbar-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.layer-toggle {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
}

.map-tools {
  position: absolute;
  z-index: 1200;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 36px);
  padding: 9px;
  border: 1px solid rgba(255, 222, 150, .16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(17, 18, 21, .84), rgba(5, 6, 8, .82)),
    radial-gradient(circle at 100% 0%, rgba(219, 166, 42, .10), transparent 38%);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}

.ghost-action {
  padding: 10px 14px;
  background: rgba(10, 11, 13, .84);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.ghost-action.active {
  border-color: rgba(255, 222, 150, .64);
  background: linear-gradient(180deg, #e3ad27 0%, #a66d05 100%);
  color: #160d02;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(166, 109, 5, .28), inset 0 1px 0 rgba(255, 255, 255, .36);
}

.floor-menu {
  position: absolute;
  z-index: 1300;
  right: 18px;
  bottom: 72px;
  width: min(360px, calc(100% - 36px));
  padding: 12px;
  border: 1px solid rgba(219, 166, 42, .42);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 219, 139, .10), transparent 36%),
    linear-gradient(180deg, rgba(33, 28, 19, .96), rgba(11, 12, 14, .96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.floor-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .075), transparent 18%, transparent 82%, rgba(219, 166, 42, .08)),
    linear-gradient(90deg, transparent, rgba(255, 221, 147, .10), transparent);
  opacity: .65;
}

.floor-menu[hidden] {
  display: none !important;
}

.floor-menu-head {
  position: relative;
  margin: 0 0 10px;
  color: var(--gold-3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.floor-menu-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: min(310px, calc(100vh - 220px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.floor-menu-list::-webkit-scrollbar {
  width: 8px;
}

.floor-menu-list::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: rgba(219, 166, 42, .36);
}

.floor-choice {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
  color: var(--text);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.floor-choice::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), transparent 34%);
  opacity: .35;
}

.floor-choice:hover {
  border-color: rgba(219, 166, 42, .62);
  background: rgba(219, 166, 42, .12);
}

.floor-choice.active {
  border-color: rgba(255, 222, 150, .72);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 231, 161, .28), transparent 58%),
    linear-gradient(180deg, rgba(227, 173, 39, .36), rgba(166, 109, 5, .24));
  box-shadow: 0 10px 28px rgba(166, 109, 5, .26), inset 0 1px 0 rgba(255, 255, 255, .20);
}

.floor-choice strong {
  color: var(--gold-3);
  font-size: 18px;
  line-height: 1;
}

.floor-choice span {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floor-choice em {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.city-button {
  min-height: 32px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.city-select {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  grid-template-columns: auto minmax(160px, 220px);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 9px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 11, 13, .84);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}

@media (min-width: 981px) {
  .city-select {
    display: none !important;
    visibility: hidden;
    position: absolute;
    pointer-events: none;
  }
}

.city-select span {
  color: var(--gold-3);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.city-select select {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(219, 166, 42, .32);
  border-radius: 999px;
  background: #111317;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.status-toast {
  display: none !important;
}

.status-toast.show {
  display: none !important;
}

.marker-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08), 0 0 16px currentColor;
}

.marker-dot.monster { color: var(--monster); background: var(--monster); }
.marker-dot.npc { color: var(--npc); background: var(--npc); }
.marker-dot.house { color: var(--house); background: var(--house); }

.monster-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .28);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .38);
}

.monster-icon img {
  max-width: 38px;
  max-height: 38px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .9));
}

.marker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .36);
}

.marker-label.npc { color: #d8f0ff; border-color: rgba(82, 182, 255, .45); }
.marker-label.house { color: #eadbff; border-color: rgba(185, 137, 255, .45); }

.highlight-pulse {
  animation: pulse-ring 1s ease-out infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 225, 135, .95), 0 0 18px rgba(255, 225, 135, .8); }
  70% { box-shadow: 0 0 0 18px rgba(255, 225, 135, 0), 0 0 18px rgba(255, 225, 135, .55); }
  100% { box-shadow: 0 0 0 0 rgba(255, 225, 135, 0), 0 0 18px rgba(255, 225, 135, .45); }
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #111317;
  color: var(--text);
  border: 1px solid rgba(219, 166, 42, .24);
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.leaflet-popup-content {
  min-width: 210px;
  margin: 12px;
}

.popup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.popup-title img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.popup-title strong {
  display: block;
}

.popup-title span,
.popup-meta {
  color: var(--muted);
  font-size: 12px;
}

.popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.popup-actions button {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid rgba(219, 166, 42, .32);
  border-radius: 10px;
  background: rgba(219, 166, 42, .14);
  color: var(--gold-3);
  font-weight: 900;
}

.leaflet-control-zoom a {
  background: #111317 !important;
  color: var(--gold-3) !important;
  border-color: rgba(219, 166, 42, .28) !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  #map {
    top: 72px;
    bottom: 118px;
  }

  .map-stage::before {
    inset: 72px 0 118px;
  }

  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(var(--sidebar), calc(100% - 42px));
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-toggle,
  .hamburger {
    display: inline-grid;
  }

  .map-topbar {
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
    max-width: none;
    border-radius: 16px;
  }

  .topbar-actions {
    display: none;
  }

  .map-tools {
    left: 10px;
    right: 10px;
    bottom: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    gap: 8px;
    border-radius: 20px;
  }

  .floor-menu {
    left: 10px;
    right: 10px;
    bottom: 126px;
    width: auto;
    border-radius: 18px;
  }

  .floor-menu-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: min(300px, calc(100vh - 235px));
  }

  .city-buttons {
    display: none;
  }

  .city-select {
    display: grid !important;
    visibility: visible;
    pointer-events: auto;
    position: static;
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: auto minmax(0, 1fr);
    border-radius: 16px;
  }

  .map-tools .ghost-action {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  #map {
    top: 96px;
    bottom: 136px;
  }

  .map-stage::before {
    inset: 96px 0 136px;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    min-height: 96px;
  }

  .brand-logo {
    width: min(286px, calc(100% - 54px));
    max-height: 90px;
  }

  .result-list {
    max-height: calc(100vh - 350px);
  }

  .result-toolbar {
    grid-template-columns: 1fr;
  }

  .result-sort-buttons {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .map-topbar {
    align-items: flex-start;
  }

  .topbar-title span {
    white-space: normal;
  }

  .map-tools {
    grid-template-columns: 1fr;
  }

  .floor-menu {
    bottom: 148px;
  }

  .floor-menu-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .city-select {
    grid-column: auto;
  }
}
