/* Spawn — unified search dropdowns anchored to each search bar */

.spawn-topbar-search {
  flex: 1;
  min-width: 0;
  max-width: min(440px, 42vw);
  margin: 0 auto;
  position: relative;
}

.spawn-topbar-search__field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--motion), box-shadow var(--motion);
}

.spawn-topbar-search__field:focus-within {
  border-color: rgba(0, 212, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 212, 238, 0.1);
}

.spawn-topbar-search__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  pointer-events: none;
}

.spawn-topbar-search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.spawn-topbar-search__field input::placeholder {
  color: var(--muted);
}

/* Mobile search triggers */
.spawn-mobile-search-trigger {
  display: none;
}

body.view-phone .spawn-mobile-search-trigger {
  display: flex;
}

body.view-phone .spawn-topbar-search {
  display: none !important;
}

/* Search root — scrim + floating dropdown */
.spawn-search-root {
  position: fixed;
  inset: 0;
  z-index: 190;
  pointer-events: none;
}

.spawn-search-root.is-open {
  pointer-events: auto;
}

.spawn-search-scrim {
  position: absolute;
  inset: 0;
  background: transparent;
}

/* Mobile inline search bar (LFG / world when toolbar search hidden) */
.spawn-search-mobile-bar {
  position: fixed;
  z-index: 191;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10, 12, 18, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.spawn-search-mobile-bar__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.spawn-search-mobile-bar__field svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
}

.spawn-search-mobile-bar__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  outline: none;
}

.spawn-search-mobile-bar__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

/* Anchored dropdown menu */
.spawn-search-dropdown {
  position: fixed;
  z-index: 192;
  display: flex;
  flex-direction: column;
  max-height: min(420px, 52vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.98);
  backdrop-filter: blur(20px);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.18),
    0 16px 40px rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scaleY(0.94);
  transform-origin: top center;
  transition:
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.2s;
}

.spawn-search-root.is-open .spawn-search-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scaleY(1);
}

.spawn-search-results {
  overflow: auto;
  padding: 6px 0 10px;
  flex: 1;
  min-height: 0;
}

.spawn-search-section__label {
  margin: 0;
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.spawn-search-section__label--promoted {
  color: #fbbf24;
}

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

.spawn-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.spawn-search-row:hover,
.spawn-search-row.is-active {
  background: rgba(0, 212, 238, 0.1);
}

.spawn-search-row--promoted {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent);
}

.spawn-search-row--promoted:hover {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(0, 212, 238, 0.06));
}

.spawn-search-row__thumb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.spawn-search-row__glyph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  font-size: 16px;
}

.spawn-search-row__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.spawn-search-row__copy strong {
  font-size: 14px;
  line-height: 1.2;
}

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

.spawn-search-row__badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.spawn-search-empty {
  margin: 0;
  padding: 20px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.spawn-search-hint {
  margin: 0;
  padding: 12px 14px 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
}

.spawn-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 14px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.spawn-search-loading__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 212, 238, 0.2);
  border-top-color: var(--accent, #00d4ee);
  border-radius: 50%;
  animation: spawn-search-spin 0.65s linear infinite;
}

@keyframes spawn-search-spin {
  to { transform: rotate(360deg); }
}

/* Zone toolbar searches stay visible */
.discover-search,
.world-toolbar__search {
  display: flex !important;
  position: relative;
}

body.view-desktop .discover-toolbar .discover-search {
  flex: 1 1 220px;
  max-width: 360px;
}

body.view-desktop .world-toolbar__search {
  display: flex !important;
}

.world-toolbar__search {
  flex: 1;
  min-width: 120px;
  max-width: 280px;
}

.world-toolbar__search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.world-toolbar__search-field svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

.world-toolbar__search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
  color: var(--text);
}

body.view-phone .world-toolbar__search {
  display: none;
}
