/* WarDrix 1.6.35 – Emoji Modal Layer Fix */
.wardrix-emoji-anchor-fallback {
  width: min(360px, calc(100vw - 16px));
  height: min(390px, calc(100vh - 16px));
  box-sizing: border-box;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: #111827;
  color: #f3f4f6;
  box-shadow: 0 18px 50px rgba(0,0,0,.48);
  font-family: inherit;
  pointer-events: auto;
}
.wardrix-emoji-anchor-fallback[hidden] { display: none !important; }
.wardrix-emoji-fallback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.wardrix-emoji-fallback-head strong { font-size: 14px; font-weight: 700; }
.wardrix-emoji-fallback-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.wardrix-emoji-fallback-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.wardrix-emoji-fallback-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px;
  padding: 0 10px;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: #0b1220;
}
.wardrix-emoji-fallback-search-wrap .material-symbols-rounded { font-size: 19px; color: #94a3b8; }
.wardrix-emoji-fallback-search {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #f8fafc !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 14px;
}
.wardrix-emoji-fallback-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  padding: 4px 8px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wardrix-emoji-fallback-item {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.wardrix-emoji-fallback-item:hover,
.wardrix-emoji-fallback-item:focus-visible {
  background: rgba(255,255,255,.09);
  outline: none;
}
@media (max-width: 520px) {
  .wardrix-emoji-anchor-fallback {
    width: min(340px, calc(100vw - 12px));
    height: min(360px, calc(100vh - 12px));
  }
  .wardrix-emoji-fallback-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* 1.6.35: Emoji picker/fallback must be above native/custom modal backdrops. */
#wardrixEmojiAnchorFallback:popover-open,
.wardrix-emoji-anchor-fallback:popover-open {
  position: fixed !important;
  margin: 0 !important;
  inset: auto !important;
  z-index: 2147483646 !important;
  pointer-events: auto !important;
}

/* WarDrix native emoji pickers promoted to the browser top layer by JS. */
[data-wardrix-added-popover="true"]:popover-open {
  position: fixed !important;
  margin: 0 !important;
  inset: auto !important;
  z-index: 2147483646 !important;
  pointer-events: auto !important;
}
