:root {
  --bg: #070b14;
  --bg-deep: #050810;
  --panel: rgba(14, 22, 40, 0.72);
  --panel-solid: #0e1628;
  --panel-hover: rgba(28, 48, 82, 0.55);
  --line: rgba(120, 160, 220, 0.14);
  --line-strong: rgba(212, 175, 106, 0.35);
  --gold: #e0c078;
  --gold-dim: #b8944e;
  --cyan: #3ec7ff;
  --cyan-dim: rgba(62, 199, 255, 0.18);
  --cyan-glow: rgba(62, 199, 255, 0.45);
  --text: #e8eef8;
  --muted: #8b9bb8;
  --ember: #ff6b4a;
  --ok: #3ddea8;
  --danger: #ff5c6c;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Cinzel", Georgia, serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-h: 72px;
  --rail-left: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow: hidden;
}
body.view-home { overflow: auto; }
body.view-browse,
body.view-shop,
body.view-map,
body.view-admin { overflow: hidden; }

/* View visibility */
body.view-home #homeView { display: flex; }
body.view-home #browseView,
body.view-home #shopView,
body.view-home #mapView,
body.view-home #adminView { display: none !important; }
body.view-browse #homeView,
body.view-shop #homeView,
body.view-map #homeView,
body.view-admin #homeView { display: none !important; }
body.view-browse #browseView { display: flex; }
body.view-browse #shopView,
body.view-browse #mapView,
body.view-browse #adminView,
body.view-shop #browseView,
body.view-shop #mapView,
body.view-shop #adminView,
body.view-map #browseView,
body.view-map #shopView,
body.view-map #adminView,
body.view-admin #browseView,
body.view-admin #shopView,
body.view-admin #mapView { display: none !important; }
body.view-shop #shopView { display: flex; }
body.view-map #mapView { display: flex; }
body.view-admin #adminView { display: flex; }
#adminView[hidden],
.admin-shell[hidden] { display: none !important; }

.bg-atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 8% -5%, rgba(62, 199, 255, 0.12), transparent 55%),
    radial-gradient(800px 520px at 92% 0%, rgba(224, 192, 120, 0.1), transparent 50%),
    radial-gradient(700px 500px at 50% 110%, rgba(90, 60, 180, 0.08), transparent 45%),
    linear-gradient(180deg, #0a1020 0%, var(--bg) 45%, #060a12 100%);
  z-index: 0;
}
.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(62, 199, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 199, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 72%);
  opacity: 0.7;
  z-index: 0;
}

/* ── Header ── */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem 0 calc(1.5rem + var(--rail-left));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}
.brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(260px, 48vw);
  object-fit: contain;
}
.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(224, 192, 120, 0.18), rgba(62, 199, 255, 0.08));
  box-shadow: 0 0 24px rgba(224, 192, 120, 0.15);
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  white-space: nowrap;
}
.brand-accent { color: var(--cyan); }
.tagline {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.top-center { justify-self: center; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 222, 168, 0.28);
  background: rgba(61, 222, 168, 0.08);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.meta {
  justify-self: end;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  line-height: 1.35;
}
.meta strong { color: var(--cyan); font-weight: 600; }

/* ── Home dashboard ── */
.home-view {
  position: relative;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem calc(1.5rem + 0.5rem) 3rem calc(1.5rem + var(--rail-left));
}
.home-inner {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}
.home-hero {
  text-align: center;
  animation: homeFadeUp 0.7s ease both;
}
.home-logo {
  display: block;
  width: min(340px, 78vw);
  height: auto;
  margin: 0 auto 0.35rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
  animation: homeMarkIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.home-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(224, 192, 120, 0.22), rgba(62, 199, 255, 0.1));
  box-shadow:
    0 0 40px rgba(224, 192, 120, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.35);
  animation: homeMarkIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.home-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1.15;
}
.home-tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.home-status { margin-top: 1rem; }

.home-search {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: homeFadeUp 0.7s ease 0.12s both;
  position: relative;
  z-index: 30;
}
.suggest-wrap {
  position: relative;
  width: 100%;
  z-index: 50;
}
.home-search .suggest-wrap > input,
.home-search > input {
  font: inherit;
  font-size: 1.05rem;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(224, 192, 120, 0.28);
  background: rgba(8, 14, 28, 0.82);
  color: var(--text);
  padding: 1.05rem 1.25rem;
  box-shadow:
    0 0 0 1px rgba(62, 199, 255, 0.06),
    0 16px 48px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-search .suggest-wrap > input::placeholder,
.home-search > input::placeholder { color: rgba(139, 155, 184, 0.6); }
.home-search .suggest-wrap > input:focus,
.home-search > input:focus {
  outline: none;
  border-color: rgba(62, 199, 255, 0.55);
  box-shadow: 0 0 0 3px var(--cyan-dim), 0 16px 48px rgba(0, 0, 0, 0.4);
}

.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  max-height: min(360px, 50vh);
  overflow: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 220, 0.35);
  background: #0a1222;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 22px 56px rgba(0, 0, 0, 0.75);
  isolation: isolate;
}
.suggest-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: #0e182c;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.suggest-item + .suggest-item {
  margin-top: 2px;
}
.suggest-item:hover,
.suggest-item.active {
  background: #16304e;
  border-color: rgba(62, 199, 255, 0.35);
}
.suggest-item img,
.suggest-item .icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
}
.suggest-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.12rem;
}
.suggest-id {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.suggest-empty {
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.home-search-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
}
.home-search-filters select,
.home-search-filters button {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.75);
  color: var(--text);
  padding: 0.72rem 0.9rem;
}
.home-search-filters select:focus {
  outline: none;
  border-color: rgba(62, 199, 255, 0.55);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.home-search-filters button[type="submit"] {
  background: linear-gradient(180deg, #ecd089, #b8893a);
  color: #1a1408;
  font-weight: 700;
  cursor: pointer;
  border: none;
  padding-inline: 1.4rem;
  box-shadow: 0 4px 18px rgba(224, 192, 120, 0.25);
}
.home-search-filters button[type="submit"]:hover {
  filter: brightness(1.08);
}

.quest-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.45rem;
}
.quest-filters[hidden] { display: none !important; }
.quest-filters input,
.quest-filters select {
  font: inherit;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.75);
  color: var(--text);
  padding: 0.55rem 0.65rem;
  min-width: 0;
  width: 100%;
}
.quest-filters input:focus,
.quest-filters select:focus {
  outline: none;
  border-color: rgba(62, 199, 255, 0.55);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.quest-filters input[type="number"]::-webkit-outer-spin-button,
.quest-filters input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quest-filters input[type="number"] { -moz-appearance: textfield; }
.search-bar .quest-filters {
  grid-column: 1 / -1;
  margin-top: 0;
}

/* ── Filtros de equipamento (compactos, em linha) ── */
.equip-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.45rem;
  align-items: center;
}
.equip-filters[hidden] { display: none !important; }
.search-bar .equip-filters {
  grid-column: 1 / -1;
  margin-top: 0;
}
.equip-filters select {
  font: inherit;
  font-size: 0.84rem;
  color: var(--text);
  background: rgba(5, 10, 20, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  min-width: 0;
  width: 100%;
}
.equip-filters select[hidden] { display: none !important; }
.equip-filters select:focus {
  outline: none;
  border-color: rgba(62, 199, 255, 0.55);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.equip-filters .btn-ghost {
  justify-self: start;
  white-space: nowrap;
}

.home-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 2.75rem;
  width: 100%;
  padding: 0.35rem 0;
  animation: homeFadeUp 0.7s ease 0.22s both;
}
.home-metric {
  text-align: center;
  min-width: 5.5rem;
}
.home-metric-value {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.home-metric-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-cats-head {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dim);
  animation: homeFadeUp 0.7s ease 0.28s both;
}
.home-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  animation: homeFadeUp 0.7s ease 0.34s both;
}
.home-cat {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(14, 22, 40, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, color 0.15s;
}
.home-cat:hover {
  border-color: rgba(224, 192, 120, 0.45);
  background: rgba(224, 192, 120, 0.08);
  color: var(--gold);
  transform: translateY(-1px);
}
.home-cat em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.home-cat-shop {
  border-color: rgba(224, 192, 120, 0.4);
  background: linear-gradient(135deg, rgba(224, 192, 120, 0.12), rgba(62, 199, 255, 0.08));
  color: var(--gold);
}
.home-cat-shop:hover {
  border-color: rgba(224, 192, 120, 0.65);
  background: linear-gradient(135deg, rgba(224, 192, 120, 0.2), rgba(62, 199, 255, 0.12));
}

@keyframes homeFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes homeMarkIn {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Browse shell ── */
.browse-shell {
  display: none;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 1;
}
.brand-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.brand-btn:hover .brand-mark {
  box-shadow: 0 0 28px rgba(224, 192, 120, 0.28);
}
.brand-btn:hover .brand-logo {
  filter: brightness(1.08);
}
.browse-top-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-nav,
.btn-home {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(14, 22, 40, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.btn-nav:hover,
.btn-home:hover {
  color: var(--text);
  border-color: rgba(62, 199, 255, 0.45);
  background: rgba(62, 199, 255, 0.08);
}
.btn-shop {
  color: var(--gold);
  border-color: rgba(224, 192, 120, 0.4);
  background: linear-gradient(135deg, rgba(224, 192, 120, 0.14), rgba(62, 199, 255, 0.08));
}
.btn-shop:hover {
  color: var(--gold);
  border-color: rgba(224, 192, 120, 0.65);
  background: linear-gradient(135deg, rgba(224, 192, 120, 0.22), rgba(62, 199, 255, 0.12));
  transform: translateY(-1px);
}

.lang-switch {
  position: fixed;
  top: 0.85rem;
  right: calc(1rem + var(--rail-right, 0px));
  z-index: 120;
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.lang-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-width: 2.1rem;
  padding: 0.35rem 0.55rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: color 0.15s, background 0.15s;
}
.lang-btn:hover {
  color: var(--text);
  background: rgba(62, 199, 255, 0.1);
}
.lang-btn.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(62, 199, 255, 0.22), rgba(224, 192, 120, 0.12));
  box-shadow: inset 0 0 0 1px rgba(62, 199, 255, 0.35);
}

/* ── Layout full-bleed ── */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem calc(1.25rem + 0.35rem) 1.25rem calc(1rem + var(--rail-left));
  height: calc(100vh - var(--header-h));
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
}
.browse-view {
  animation: homeFadeUp 0.35s ease both;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem 0.35rem;
  flex-shrink: 0;
}
.panel-title {
  margin: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.search-panel { padding: 0; }
.search-panel .search-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.35rem 0.85rem 0.75rem;
}
.search-panel .search-bar .search-suggest-wrap,
.search-panel .search-bar input {
  grid-column: 1 / -1;
  min-width: 0;
}
.search-panel .search-bar .search-suggest-wrap {
  position: relative;
  z-index: 20;
}
.search-panel .suggest-list {
  z-index: 30;
  background: #0a1222;
}
.search-panel .search-bar select {
  min-width: 0;
  width: 100%;
  padding-inline: 0.55rem;
  font-size: 0.82rem;
  text-overflow: ellipsis;
}
.search-panel .search-bar button[type="submit"],
.search-panel .search-bar .btn-ghost {
  width: 100%;
  padding-inline: 0.55rem;
  font-size: 0.82rem;
}
.results-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 0.65rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(62, 199, 255, 0.35) transparent;
}
.results-wrap::-webkit-scrollbar { width: 8px; }
.results-wrap::-webkit-scrollbar-thumb {
  background: rgba(62, 199, 255, 0.28);
  border-radius: 8px;
}

.detail-panel {
  padding: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(224, 192, 120, 0.35) transparent;
}
.detail-panel::-webkit-scrollbar { width: 8px; }
.detail-panel::-webkit-scrollbar-thumb {
  background: rgba(224, 192, 120, 0.28);
  border-radius: 8px;
}
.detail-panel > .detail-empty,
.detail-panel > .detail-body {
  padding: 1.15rem 1.25rem 1.5rem;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 1rem;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.detail-tab {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.detail-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.detail-tab.active {
  color: #1a1408;
  background: linear-gradient(180deg, #ecd089, #b8893a);
  border-color: transparent;
}
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; animation: fadeUp 0.22s ease both; }
.chip-quality {
  background: rgba(0, 0, 0, 0.25) !important;
}
.raw-box-open {
  display: block !important;
  max-height: min(60vh, 520px);
  margin: 0;
}

/* ── Search ── */
.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: start;
}
.search-bar .search-suggest-wrap {
  grid-column: 1 / -1;
}
.search-bar .suggest-wrap > input,
.search-bar input,
.search-bar select,
.search-bar button {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.75);
  color: var(--text);
  padding: 0.72rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
  min-width: 0;
}
.search-bar .suggest-wrap > input::placeholder,
.search-bar input::placeholder { color: rgba(139, 155, 184, 0.65); }
.search-bar .suggest-wrap > input:focus,
.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  border-color: rgba(62, 199, 255, 0.55);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.search-bar button[type="submit"] {
  background: linear-gradient(180deg, #ecd089, #b8893a);
  color: #1a1408;
  font-weight: 700;
  cursor: pointer;
  border: none;
  padding-inline: 1.25rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 18px rgba(224, 192, 120, 0.25);
}
.search-bar button[type="submit"]:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.search-bar .btn-ghost {
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--line);
  padding-inline: 0.95rem;
  font-weight: 600;
}
.search-bar .btn-ghost:hover {
  color: var(--text);
  border-color: rgba(62, 199, 255, 0.45);
  background: rgba(62, 199, 255, 0.08);
}

.results-meta {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── Results tiles ── */
.results { display: flex; flex-direction: column; gap: 0.4rem; }
.item-tile,
.item-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--qcolor, transparent) 55%, transparent);
  background: rgba(0, 0, 0, 0.18);
}
.item-tile:hover,
.item-row:hover {
  background: var(--panel-hover);
  border-color: var(--line);
  transform: translateX(2px);
}
.item-tile.active,
.item-row.active {
  background: linear-gradient(90deg, rgba(62, 199, 255, 0.14), rgba(62, 199, 255, 0.03));
  border-color: rgba(62, 199, 255, 0.4);
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 20px rgba(62, 199, 255, 0.08);
}
.item-tile img,
.item-row img,
.icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200, 214, 235, 0.72);
  flex-shrink: 0;
  box-sizing: border-box;
  object-fit: contain;
}
.item-tile .map-pin-badge,
.item-row .map-pin-badge,
.suggest-item .map-pin-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
}
.item-tile .map-pin-badge svg,
.item-row .map-pin-badge svg,
.suggest-item .map-pin-badge svg {
  width: 26px;
  height: 26px;
}
select[data-mine-filter][hidden] { display: none !important; }
.icon-fallback svg {
  width: 70%;
  height: 70%;
  display: block;
}
.icon-sm {
  width: 28px !important;
  height: 28px !important;
}
.icon-monster { color: rgba(255, 140, 120, 0.85); }
.icon-npc { color: rgba(120, 200, 255, 0.9); }
.icon-mine { color: rgba(220, 190, 120, 0.9); }
.item-tile .name,
.item-row .name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.item-tile .sub,
.item-row .sub {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.2rem;
  line-height: 1.35;
}
.item-tile .tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.item-tile .tile-meta span,
.item-row .badges span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}
.item-row .badges {
  display: none;
}
.qdot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.pager {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}
.pager button {
  background: rgba(5, 10, 20, 0.7);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.pager button:hover:not(:disabled) {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}
.pager button:disabled { opacity: 0.35; cursor: default; }

/* ── Detail ── */
.detail-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.85rem;
  min-height: 60%;
  color: var(--muted);
  text-align: center;
  padding: 2rem !important;
}
.empty-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-family: var(--display);
  font-size: 1.8rem;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(224, 192, 120, 0.12), rgba(62, 199, 255, 0.06));
  opacity: 0.85;
}
.detail-empty p { margin: 0; max-width: 280px; line-height: 1.5; }

.detail-head {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1.15rem;
  padding: 0.25rem 0 1.15rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
}
.detail-head img,
.detail-head .icon {
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.detail-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.detail-head .idline {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.detail-head .idline .chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: rgba(62, 199, 255, 0.1);
  border: 1px solid rgba(62, 199, 255, 0.22);
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 600;
}
button.chip-copy-link {
  cursor: pointer;
  font-family: inherit;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.38);
  color: var(--gold, #ffd166);
}
button.chip-copy-link:hover {
  filter: brightness(1.12);
}
.item-desc {
  line-height: 1.45;
}
.item-ext-desc {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #d7d2c6;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 42rem;
}
.item-ext-desc span { font-weight: 500; }

.section {
  margin-top: 1.25rem;
  animation: fadeUp 0.28s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.section h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 0.88rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  opacity: 0.7;
}
.section-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.section-card.loot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: transparent;
  padding: 4px;
}
.section-card.loot-grid .loot-row {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.45rem 0.55rem;
  min-width: 0;
}
.section-card.loot-grid .loot-row > div:nth-child(2) {
  min-width: 0;
}
.section-card.loot-grid .loot-row > div:nth-child(2) > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .section-card.loot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .section-card.loot-grid {
    grid-template-columns: 1fr;
  }
}

.source-row,
.loot-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.12s;
}
.source-row:first-child,
.loot-row:first-child { border-top: none; }
.source-row:hover,
.loot-row:hover { background: rgba(62, 199, 255, 0.06); }
.source-row img,
.loot-row img,
.source-row .icon,
.loot-row .icon {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  border-radius: 6px;
}
.affix-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.affix-row:first-child { border-top: none; }

.gift-receive {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 192, 120, 0.28);
  background: linear-gradient(90deg, rgba(224, 192, 120, 0.12), rgba(224, 192, 120, 0.03));
  color: var(--text);
  font-size: 0.9rem;
}
.gift-receive strong {
  color: var(--gold);
  font-weight: 700;
}
.merge-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.merge-row:first-child { border-top: none; }
.merge-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.rune-pool-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.4rem 0.15rem;
}
.rune-affix {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.rune-affix:first-child { border-top: none; }
.rune-affix-skill {
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.rune-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 0.72rem;
  letter-spacing: -0.05em;
  line-height: 1;
  min-width: 4.2em;
}
.rune-stars .on { color: var(--gold); text-shadow: 0 0 8px rgba(224, 192, 120, 0.35); }
.rune-stars .off { color: rgba(255, 255, 255, 0.12); }
.rune-stars[data-stars="1"] .on { color: #8b9bb8; text-shadow: none; }
.rune-stars[data-stars="2"] .on { color: #5ecf7a; text-shadow: 0 0 6px rgba(94, 207, 122, 0.35); }
.rune-stars[data-stars="3"] .on { color: #4eb3ff; text-shadow: 0 0 6px rgba(78, 179, 255, 0.35); }
.rune-stars[data-stars="4"] .on { color: #d074ff; text-shadow: 0 0 8px rgba(208, 116, 255, 0.4); }
.rune-stars[data-stars="5"] .on { color: #ffd54f; text-shadow: 0 0 10px rgba(255, 213, 79, 0.45); }
.pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
  font-size: 0.9rem;
}
.pct-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.pct-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(62, 199, 255, 0.35);
}
.note { color: var(--muted); font-size: 0.78rem; margin-top: 0.18rem; line-height: 1.4; }
.trade-costs {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.45;
}
.trade-costs div + div { margin-top: 0.12rem; }

/* Listas longas de fontes */
.source-more[hidden] { display: none !important; }
.btn-expand-list {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(62, 199, 255, 0.06);
  border: 1px dashed rgba(62, 199, 255, 0.28);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-expand-list:hover {
  color: var(--text);
  background: rgba(62, 199, 255, 0.12);
  border-color: rgba(62, 199, 255, 0.45);
}
.btn-expand-list.is-open {
  color: var(--muted);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

/* Cash Shop */
.gshop-hidden-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #e8b3b3;
  background: rgba(180, 60, 60, 0.18);
  border: 1px solid rgba(180, 60, 60, 0.4);
  border-radius: 999px;
  vertical-align: middle;
}

/* ── Map viewer ── */
.map-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem calc(1.25rem + 0.35rem) 1.1rem calc(1rem + var(--rail-left));
  height: calc(100vh - var(--header-h));
  min-height: 0;
  flex: 1;
}
.map-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.map-side-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.65rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.map-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-field select,
.map-search input {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
}
.map-field select {
  max-width: 100%;
}
.map-field select optgroup {
  font-weight: 700;
  font-style: normal;
  color: var(--gold);
  background: #1a1408;
}
.map-field select option {
  color: var(--text);
  background: #16120a;
}
.map-search { margin: 0; flex-shrink: 0; }
.map-filter-head,
.map-list-head {
  margin-top: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.map-list-head {
  flex-shrink: 0;
  margin-top: 0.25rem;
}
.map-list-head em {
  font-style: normal;
  color: var(--muted);
  margin-left: 0.35rem;
}
.map-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  max-height: 28vh;
  overflow: auto;
}
.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
}
.map-filter-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.65rem;
}
.map-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  line-height: 1.2;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.map-check input { accent-color: #3a8fd4; flex-shrink: 0; }
.map-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0;
}
.map-list-item {
  text-align: left;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.map-list-item:hover,
.map-list-item.active {
  border-color: rgba(62, 199, 255, 0.35);
  background: rgba(62, 199, 255, 0.08);
}
.map-list-item .note { color: var(--muted); font-size: 0.72rem; }
.map-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.map-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-canvas {
  position: relative;
  width: min(100%, calc(100vh - var(--header-h) - 9.5rem));
  max-width: 920px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(180, 150, 80, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: #1a1408;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.map-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}
.map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  z-index: 2;
}
.map-pin img {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}
.map-pin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.map-pin-badge svg {
  width: 13px;
  height: 13px;
  display: block;
  color: #1a1208;
}
.map-pin-badge.is-mining { background: linear-gradient(160deg, #e0b060, #a06a28); }
.map-pin-badge.is-forage { background: linear-gradient(160deg, #8fd48a, #3d8f3a); }
.map-pin-badge.is-fish { background: linear-gradient(160deg, #7ec8ff, #2a6fad); }
.map-pin-badge.is-lockpick { background: linear-gradient(160deg, #c0c0c8, #6a6a78); }
.map-pin-badge.is-quest,
.map-pin-badge.is-event,
.map-pin-badge.is-other { background: linear-gradient(160deg, #d4a574, #8a5a32); }
.map-gather-kinds {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.map-gather-kinds[hidden] { display: none !important; }
.map-check-sub {
  font-size: 0.72rem;
  opacity: 0.95;
}
.map-leg {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.map-leg.is-mining { background: #c48a35; }
.map-leg.is-forage { background: #4ea34a; }
.map-leg.is-fish { background: #3a8fd4; }
.map-leg.is-quest { background: #a06a3a; }
.map-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.map-pin-dot.is-npc { background: #4fc3f7; }
.map-pin-dot.is-monster { background: #ef5350; }
.map-pin.is-focus {
  z-index: 5;
}
.map-pin.is-focus .map-pin-dot,
.map-pin.is-focus img,
.map-pin.is-focus .map-pin-badge {
  outline: 2px solid #ffd54f;
  outline-offset: 2px;
}
.map-pin-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  color: #1a1408;
  background: #ecd089;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.map-pin:hover .map-pin-tip,
.map-pin.is-focus .map-pin-tip { opacity: 1; }
.npc-loc-map-btn {
  margin-top: 0.35rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a1408;
  background: linear-gradient(180deg, #7ec8ff, #3a8fd4);
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}
.chip-boss {
  background: rgba(220, 80, 60, 0.25);
  border-color: rgba(239, 83, 80, 0.55);
  color: #ffab91;
}
.mon-combat-grid .stat b { color: var(--gold-dim); }

@media (max-width: 960px) {
  .map-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - var(--header-h));
  }
  .map-side { max-height: 38vh; }
  .map-toolbar { max-height: none; }
}

/* Cash Shop legacy badge kept above */
.gshop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.gshop-tab {
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

/* ── Cash Shop page (layout estilo Boutique de Eyrda) ── */
.shop-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem calc(1.25rem + 0.35rem) 1.1rem calc(1rem + var(--rail-left));
  height: calc(100vh - var(--header-h));
  min-height: 0;
  flex: 1;
}
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.55rem 0.75rem;
  background: rgba(10, 16, 30, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.shop-search {
  display: flex;
  gap: 0.4rem;
  flex: 1 1 220px;
  min-width: 0;
  padding: 0;
  border: 0;
}
.shop-search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
.shop-search input:focus {
  outline: none;
  border-color: rgba(224, 192, 120, 0.5);
  box-shadow: 0 0 0 2px rgba(224, 192, 120, 0.12);
}
.shop-search button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1408;
  background: linear-gradient(180deg, #ecd089, #b8893a);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
}
.shop-currency {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}
.shop-curr-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.shop-curr-check input {
  accent-color: #c9a24a;
  width: 1rem;
  height: 1rem;
}
.shop-curr-leaf {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50% 0 50% 50%;
  transform: rotate(-35deg);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.2);
}
.shop-curr-eyrda {
  background: linear-gradient(145deg, #7dff9a, #1f9a45);
}
.shop-curr-alma {
  background: linear-gradient(145deg, #d4a0ff, #7a3ec8);
}
.shop-hidden-toggle {
  margin-left: auto;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.shop-hidden-toggle.active,
.shop-hidden-toggle:hover {
  color: #e8b3b3;
  border-color: rgba(180, 60, 60, 0.45);
  background: rgba(180, 60, 60, 0.12);
}

.shop-main-tabs,
.shop-sub-tabs,
.shop-leaf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.shop-main-tabs {
  gap: 0.4rem;
}
.shop-mtab {
  font: inherit;
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(14, 22, 40, 0.65);
  border: 1px solid var(--line);
  border-radius: 10px 10px 4px 4px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.shop-mtab:hover {
  color: var(--text);
  border-color: rgba(224, 192, 120, 0.35);
}
.shop-mtab.active {
  color: #1a1408;
  background: linear-gradient(180deg, #7ec8ff, #3a8fd4);
  border-color: rgba(126, 200, 255, 0.8);
  box-shadow: 0 4px 14px rgba(62, 199, 255, 0.25);
}
.shop-stab {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.shop-stab:hover { color: var(--text); }
.shop-stab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.shop-leaf-tabs {
  padding: 0.2rem 0 0.1rem;
}
.shop-leaf-tabs[hidden] { display: none !important; }
.shop-ltab {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}
.shop-ltab em {
  font-style: normal;
  margin-left: 0.3rem;
  color: var(--muted);
  opacity: 0.8;
}
.shop-ltab.active {
  color: var(--cyan);
  border-color: rgba(62, 199, 255, 0.4);
  background: rgba(62, 199, 255, 0.1);
}

.shop-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shop-head { flex-shrink: 0; }
.shop-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.85rem 1rem;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.shop-card {
  position: relative;
  display: block;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(18, 32, 48, 0.9), rgba(8, 14, 26, 0.92));
  border: 1px solid rgba(120, 160, 120, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  min-height: 0;
}
.shop-card:hover {
  border-color: rgba(224, 192, 120, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
.shop-card.is-hidden { opacity: 0.72; }
.shop-card-top {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}
.shop-card-icon {
  position: relative;
  width: 56px;
  height: 56px;
}
.shop-card-icon img,
.shop-card-icon .icon-fallback {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}
.shop-new-ribbon {
  position: absolute;
  top: -4px;
  left: -6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #102010;
  background: linear-gradient(180deg, #b6f08a, #5aaa3a);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.shop-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}
.shop-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-card-price {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}
.shop-price-old {
  color: var(--muted);
  font-weight: 500;
  text-decoration: line-through;
  font-size: 0.78rem;
}
.shop-price-new { color: var(--gold); }
.shop-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.shop-card-desc {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #b9b3a6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-card-desc span { font-weight: 500; }
.shop-card-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  margin-left: 0;
}

/* legado sidebar (não usado) */
.shop-view { grid-template-columns: 1fr; }

.soul-reborn + .soul-reborn,
.soul-milestone + .soul-milestone,
.soul-recast-seg + .soul-recast-seg {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.soul-reborn-title {
  font-weight: 600;
  color: var(--text);
}
.soul-recast-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.soul-range {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}
.soul-range em {
  font-style: normal;
  color: var(--cyan);
  margin-left: 0.2rem;
}

.note code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  color: var(--cyan);
  background: rgba(62, 199, 255, 0.08);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.stat {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  transition: border-color 0.15s;
}
.stat:hover { border-color: rgba(62, 199, 255, 0.28); }
.stat b {
  color: var(--muted);
  font-weight: 500;
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}
.range-minmax {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.range-min { color: var(--text); }
.range-max { color: var(--cyan); }
.range-sep {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: lowercase;
}

.refine-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.raw-toggle {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gold-dim);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.4rem 0;
  font-family: inherit;
}
.raw-toggle:hover { color: var(--gold); }
.raw-box {
  margin-top: 0.5rem;
  max-height: 280px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  color: #a8b4c8;
}

.empty-inline {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0.5rem;
  text-align: center;
}

/* ── NPC Trocar (estilo cliente) ── */
.trade-window {
  margin: 0.25rem 0 0.75rem;
  border: 1px solid rgba(212, 175, 106, 0.35);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 28, 48, 0.95), rgba(10, 16, 30, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(224, 192, 120, 0.12),
    0 12px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.trade-window-title {
  text-align: center;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0e6d0;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(212, 175, 106, 0.28);
  background: linear-gradient(180deg, rgba(40, 52, 78, 0.9), rgba(18, 26, 44, 0.5));
}
.trade-window-body {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) minmax(200px, 240px);
  gap: 0;
  min-height: 320px;
}
.trade-pages {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.45rem;
  border-right: 1px solid rgba(120, 160, 220, 0.12);
  background: rgba(0, 0, 0, 0.22);
  overflow: visible;
}
.trade-page-tab {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  color: #7eb6e8;
  background: rgba(20, 32, 56, 0.85);
  border: 1px solid rgba(80, 120, 180, 0.25);
  border-radius: 4px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.trade-page-tab:hover {
  color: #cfe6ff;
  border-color: rgba(120, 170, 230, 0.45);
}
.trade-page-tab.active {
  color: #ffe08a;
  border-color: rgba(224, 192, 120, 0.75);
  background: linear-gradient(180deg, rgba(70, 55, 28, 0.65), rgba(35, 28, 14, 0.85));
  box-shadow: 0 0 12px rgba(224, 192, 120, 0.18);
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(8, 36px);
  grid-template-rows: repeat(9, 36px);
  gap: 3px;
  padding: 0.65rem;
  align-content: start;
  justify-content: start;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(120, 160, 220, 0.1);
  overflow: visible;
  min-height: calc(9 * 36px + 8 * 3px + 1.3rem);
}
.trade-slot {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 1px;
  border-radius: 2px;
  border: 1px solid rgba(90, 120, 160, 0.28);
  background:
    linear-gradient(145deg, rgba(30, 42, 68, 0.9), rgba(12, 18, 32, 0.95));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.trade-slot.empty {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}
.trade-slot:not(.empty):hover {
  border-color: rgba(120, 190, 255, 0.55);
}
.trade-slot.selected {
  border-color: color-mix(in srgb, var(--qcolor, #4caf50) 85%, #fff);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--qcolor, #4caf50) 70%, transparent),
    0 0 8px color-mix(in srgb, var(--qcolor, #4caf50) 45%, transparent);
}
.trade-slot img,
.trade-slot .icon {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px;
  max-height: 32px;
  border: none !important;
  background: transparent !important;
  border-radius: 2px !important;
  object-fit: contain;
}

.trade-side {
  padding: 0.75rem 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(8, 14, 26, 0.65);
  overflow: visible;
}
.trade-side-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 0.5rem;
}
.trade-selected {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.65rem;
  align-items: center;
  cursor: pointer;
}
.trade-selected-ico img,
.trade-selected-ico .icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 6px !important;
}
.trade-selected-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
}
.trade-selected-id {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}
.trade-qty-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.trade-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.trade-qty-controls input {
  width: 3rem;
  text-align: center;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.3rem;
}
.trade-qty-btn,
.trade-qty-max {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9fd0ff;
  background: rgba(30, 60, 100, 0.5);
  border: 1px solid rgba(100, 160, 220, 0.35);
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  cursor: default;
  opacity: 0.55;
}
.trade-qty-max { color: var(--gold); border-color: rgba(224, 192, 120, 0.35); }

.trade-req-box {
  border: 1px solid rgba(120, 160, 220, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.55rem 0.6rem;
}
.trade-req-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-dim);
  margin-bottom: 0.45rem;
  letter-spacing: 0.04em;
}
.trade-req-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0;
}
.trade-req-ico {
  position: relative;
  width: 36px;
  height: 36px;
}
.trade-req-ico img,
.trade-req-ico .icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 4px !important;
}
.trade-req-qty {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.2;
}
.trade-req-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.trade-req-id {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
}
.trade-req-plain {
  font-size: 0.78rem;
  color: var(--text);
  padding: 0.2rem 0;
}

.trade-price-box {
  border-top: 1px solid rgba(120, 160, 220, 0.12);
  padding-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.trade-price-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.trade-price-currencies {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}
.trade-price-currencies.is-soul {
  grid-template-columns: 1fr;
}
.trade-currency {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(120, 160, 220, 0.12);
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--text);
}
.trade-currency-ico {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.trade-cur-d .trade-currency-ico { background: linear-gradient(135deg, #5ec8ff, #2a7fd4); }
.trade-cur-g .trade-currency-ico { background: linear-gradient(135deg, #ffe08a, #c9a227); }
.trade-cur-p .trade-currency-ico { background: linear-gradient(135deg, #e8eef8, #9aa7bc); }
.trade-cur-b .trade-currency-ico { background: linear-gradient(135deg, #d4a574, #8a5a2b); }
.trade-cur-soul .trade-currency-ico {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0c8ff, #9b4dca 55%, #5a2080);
  box-shadow: 0 0 6px rgba(180, 100, 255, 0.45);
}
.trade-cur-soul .trade-currency-val {
  color: #e8c4ff;
  font-weight: 700;
}

.trade-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
}
.trade-btn-primary,
.trade-btn-ghost {
  flex: 1;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
}
.trade-btn-primary {
  color: #1a1408;
  border: 1px solid rgba(224, 192, 120, 0.55);
  background: linear-gradient(180deg, #ecd089, #b8893a);
}
.trade-btn-primary:hover { filter: brightness(1.06); }
.trade-btn-ghost {
  color: var(--gold);
  border: 1px solid rgba(224, 192, 120, 0.35);
  background: rgba(224, 192, 120, 0.08);
}
.trade-btn-ghost:hover {
  background: rgba(224, 192, 120, 0.14);
}

@media (max-width: 1100px) {
  .trade-window-body {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .trade-side {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(120, 160, 220, 0.12);
    max-height: none;
  }
  .trade-grid {
    grid-template-columns: repeat(8, 34px);
    grid-template-rows: repeat(9, 34px);
    min-height: calc(9 * 34px + 8 * 3px + 1.3rem);
  }
  .trade-slot { width: 34px; height: 34px; }
  .trade-slot img,
  .trade-slot .icon {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px;
    max-height: 30px;
  }
}
@media (max-width: 640px) {
  .trade-window-body { grid-template-columns: 1fr; }
  .trade-pages {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgba(120, 160, 220, 0.12);
  }
  .trade-grid {
    grid-template-columns: repeat(8, 32px);
    grid-template-rows: repeat(9, 32px);
    min-height: calc(9 * 32px + 8 * 3px + 1.3rem);
  }
  .trade-slot { width: 32px; height: 32px; }
  .trade-slot img,
  .trade-slot .icon {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px;
    max-height: 28px;
  }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .refine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  body.view-browse,
  body.view-shop { overflow: auto; }
  .top {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 0.85rem 1rem 0.85rem calc(1rem + var(--rail-left));
    row-gap: 0.5rem;
  }
  .top-center { display: none; }
  .browse-top-right {
    grid-column: 2;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }
  .meta { font-size: 0.75rem; }
  .browse-shell { height: auto; min-height: 100vh; }
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - var(--header-h));
    padding-left: calc(1rem + var(--rail-left));
  }
  .search-panel { min-height: 42vh; max-height: 52vh; }
  .detail-panel { min-height: 50vh; }
  .shop-shell {
    height: auto;
    min-height: calc(100vh - var(--header-h));
  }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-hidden-toggle { margin-left: 0; align-self: flex-start; }
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .search-bar { grid-template-columns: 1fr 1fr; }
  .search-bar input { grid-column: 1 / -1; }
  .search-bar button[type="submit"],
  .search-bar .btn-ghost { grid-column: span 1; }
  .home-search-filters { grid-template-columns: 1fr 1fr; }
  .home-search-filters button[type="submit"] { grid-column: 1 / -1; }
  .quest-filters { grid-template-columns: 1fr 1fr; }
  .equip-filters { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .refine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand h1 { font-size: 1rem; }
}
/* ── CTAs wiki (redes + jogue agora) ── */
.social-rail {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translate(-34px, -50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.35rem 0.35rem 0.35rem 0;
  transition: transform 0.22s ease;
}
.social-rail:hover,
.social-rail:focus-within {
  transform: translate(0, -50%);
}
.social-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: width 0.2s ease, filter 0.15s, opacity 0.2s;
  opacity: 0.55;
}
.social-rail:hover .social-btn,
.social-rail:focus-within .social-btn {
  opacity: 1;
}
.social-btn:hover {
  width: 58px;
  filter: brightness(1.08);
}
.social-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.social-discord { background: #5865F2; }
.social-discord:hover { background: #4752c4; }
.social-instagram {
  background: linear-gradient(135deg, #f09433, #e6683c 40%, #dc2743 65%, #bc1888);
}
.social-facebook { background: #1877F2; }
.social-facebook:hover { background: #166fe5; }
.social-tiktok { background: #111; }
.social-tiktok:hover { background: #222; }
.social-wiki {
  background: linear-gradient(180deg, #3a4560, #1c2436);
  color: #e0c078;
}
.social-wiki:hover { color: #fff; }

.play-now-btn {
  position: fixed;
  right: 1.35rem;
  bottom: 1.5rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(90deg, #7c3aed, #6d6afe);
  box-shadow:
    0 0 22px rgba(109, 106, 254, 0.45),
    0 12px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.play-now-btn:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 32px rgba(109, 106, 254, 0.7),
    0 14px 36px rgba(0, 0, 0, 0.45);
}

@media (max-width: 720px) {
  :root { --rail-left: 0px; }
  .social-rail {
    top: auto;
    bottom: 5.5rem;
    transform: translate(-34px, 0);
    padding: 0.25rem 0.25rem 0.25rem 0;
  }
  .social-rail:hover,
  .social-rail:focus-within {
    transform: translate(0, 0);
  }
  .social-btn {
    width: 40px;
    height: 40px;
  }
  .social-btn:hover { width: 48px; }
  .social-btn svg { width: 18px; height: 18px; }
  .play-now-btn {
    right: 0.85rem;
    bottom: 0.9rem;
    padding: 0.8rem 1.2rem;
    font-size: 0.82rem;
  }
  .top { padding-left: 1rem; }
  .home-view { padding-left: 1.25rem; }
  .layout { padding-left: 1rem; }
}

@media (min-width: 1600px) {
  .layout {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    padding: 1.15rem 1.75rem 1.5rem;
    gap: 1.15rem;
  }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .refine-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .npc-quest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .npc-svc-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

/* ── NPC detail ── */
.npc-summary {
  padding: 0.75rem 0.9rem;
}
.npc-summary-line {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.npc-summary-line + .npc-summary-line { margin-top: 0.35rem; }
.npc-summary-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.npc-loc-pin-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
  align-items: center;
}
.npc-loc-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.npc-loc-map-btn {
  margin-top: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a1408;
  background: linear-gradient(180deg, #7ec8ff, #3a8fd4);
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}
.npc-loc-map-btn:hover {
  filter: brightness(1.08);
}
.npc-loc-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  background: rgba(214, 178, 94, 0.08);
  border: 1px solid rgba(214, 178, 94, 0.35);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--gold);
  min-width: 0;
  font: inherit;
  line-height: 1.2;
}
.npc-loc-pin-btn {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.npc-loc-pin-btn:hover {
  background: rgba(214, 178, 94, 0.18);
  border-color: rgba(214, 178, 94, 0.65);
}
.npc-loc-pin svg { flex: none; opacity: 0.85; }
.npc-loc-pin-map { font-weight: 600; color: var(--text); white-space: nowrap; }
.npc-loc-pin-zone { color: var(--gold); white-space: nowrap; }
.npc-loc-pin-zone::before { content: '·'; margin-right: 0.35rem; color: var(--muted); }
.npc-loc-pin-xyz {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.npc-loc-pin-xyz::before { content: '·'; margin-right: 0.35rem; }
.npc-loc-pin-more { color: var(--muted); border-style: dashed; }
.npc-svc-card-wide { grid-column: 1 / -1; }
.npc-svc-dests {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.25rem 0.6rem;
}
.npc-svc-dest {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  min-width: 0;
}
.npc-svc-dest > span:first-child {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quest-prem-lines { margin: 0.3rem 0 0.45rem; padding-left: 1.1rem; }
.quest-prem-lines li { margin: 0.12rem 0; }
.quest-prem-sub {
  margin: 0.6rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.quest-mon-drop { color: var(--gold); cursor: pointer; }
.quest-mon-drop:hover { text-decoration: underline; }

.npc-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem;
}
.npc-svc-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  min-width: 0;
}
.npc-svc-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.npc-svc-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npc-svc-meta {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--cyan);
  opacity: 0.9;
}

.npc-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.npc-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(224, 192, 120, 0.22);
  background: rgba(224, 192, 120, 0.08);
  color: var(--gold);
  font-size: 0.78rem;
  line-height: 1.2;
}

.npc-quest-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.npc-quest-block {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  min-width: 0;
}
.npc-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  padding: 0 0.15rem;
}
.npc-quest-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.npc-quest-badge.tone-out { color: var(--cyan); }
.npc-quest-badge.tone-in { color: var(--ok); }
.npc-quest-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.npc-quest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  max-height: 22rem;
  overflow: auto;
  padding-right: 0.15rem;
}
.npc-quest-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(120, 160, 220, 0.12);
  background: rgba(14, 22, 40, 0.65);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.npc-quest-chip:hover {
  border-color: rgba(62, 199, 255, 0.35);
  background: rgba(62, 199, 255, 0.08);
}
.npc-quest-chip-name {
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.npc-quest-chip-meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .npc-quest-panels { grid-template-columns: 1fr; }
  .npc-quest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .npc-quest-grid { grid-template-columns: 1fr; }
  .npc-svc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .npc-svc-grid { grid-template-columns: 1fr; }
}

.npc-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.4rem;
}
.npc-loc-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  min-width: 0;
}
.npc-loc-map {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npc-loc-xyz {
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  color: var(--text);
}
.npc-loc-zone {
  margin-top: 0.12rem;
  font-size: 0.78rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npc-loc-inst {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.3;
}

/* ── Admin (oculto #admin) ── */
.admin-shell {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  flex-direction: column;
}
body.view-admin .admin-shell {
  display: flex;
}
.admin-main {
  flex: 1;
  padding: 1rem calc(1.25rem + 0.35rem) 2rem calc(1rem + var(--rail-left, 0px));
  max-width: 920px;
}
.admin-panel { margin-bottom: 1rem; }
.admin-panel[hidden],
#adminLoginPanel[hidden],
#adminDashPanel[hidden],
#btnAdminLogout[hidden] {
  display: none !important;
}
.admin-login,
.admin-hide-form {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1rem 1.1rem;
}
.admin-login label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-login input,
.admin-hide-form input,
.admin-hide-form select {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}
.admin-login button,
.admin-hide-form button {
  justify-self: start;
  font: inherit;
  font-weight: 700;
  color: #1a1408;
  background: linear-gradient(180deg, #ecd089, #c9a227);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.admin-hide-form {
  grid-template-columns: auto 7rem 1fr auto;
  align-items: center;
}
.admin-hint {
  margin: 0;
  padding: 0 1rem 0.85rem;
  color: #ffab91;
  font-size: 0.85rem;
}
.admin-hint[hidden] { display: none !important; }
.admin-login button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.admin-hidden-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 1rem 1rem;
  max-height: 55vh;
  overflow: auto;
}
.admin-hidden-row {
  display: grid;
  grid-template-columns: 4.5rem 5rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 0.84rem;
}
.admin-hidden-row .kind {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.admin-hidden-row .note { color: var(--muted); font-size: 0.78rem; }
.admin-hidden-row button {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffcdd2;
  background: rgba(220, 80, 60, 0.2);
  border: 1px solid rgba(239, 83, 80, 0.45);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
@media (max-width: 720px) {
  .admin-hide-form { grid-template-columns: 1fr; }
  .admin-hidden-row { grid-template-columns: 1fr 1fr; }
}
