/* ==========================================================================
   ZOTH CIVILIZATION — HUD & OVERLAYS CONTROLLER ("Clean Sphere & Friendly HUD")
   Provides clean, friendly controls to open, close, and minimize overlays on
   the 3D pixel world. Includes Zen / Cinematic mode and keyboard shortcuts.
   ========================================================================== */

/* ---------- Force respect of [hidden] attribute ---------- */
[hidden] {
  display: none !important;
}

/* ---------- Floating HUD Control Deck on 3D Pixel World ---------- */
.pixel-hud-deck {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 9999px;
  background: rgba(12, 10, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.35));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  pointer-events: auto;
  user-select: none;
  transition: transform 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1)), opacity 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-pill-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--z-gold, #E9C46A);
  padding: 0 4px 0 6px;
  white-space: nowrap;
}

.hud-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--z-text-2, #BDB6CF);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--z-text, #F4F1FA);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.hud-pill-btn:focus-visible {
  outline: 2px solid var(--z-gold, #E9C46A);
  outline-offset: 2px;
}

.hud-pill-btn.is-active {
  background: rgba(233, 196, 106, 0.15);
  border-color: var(--z-gold-line, rgba(233, 196, 106, 0.5));
  color: var(--z-text, #F4F1FA);
}

.hud-pill-btn.is-active .hud-pill-dot {
  background: var(--z-gold, #E9C46A);
  box-shadow: 0 0 8px var(--z-gold, #E9C46A);
}

.hud-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.25s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-pill-icon {
  font-size: 13px;
  line-height: 1;
}

.hud-pill-btn kbd {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  font-family: var(--font-pixel, 'JetBrains Mono', monospace);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--z-text-3, #8C84A3);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 2px;
}

.hud-pill-btn.is-active kbd {
  color: var(--z-gold, #E9C46A);
  border-color: rgba(233, 196, 106, 0.25);
}

.hud-pill-zen {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.15), rgba(157, 123, 255, 0.15));
  border-color: rgba(94, 234, 212, 0.4);
  color: var(--z-cyan, #5EEAD4);
}

.hud-pill-zen:hover {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.25), rgba(157, 123, 255, 0.25));
  border-color: var(--z-cyan, #5EEAD4);
  color: #FFF;
}

.hud-pill-help {
  padding: 0 8px;
}

/* Adjust position of dialogue feed so it docks neatly below the HUD deck */
.floating-dialogue-feed {
  top: 56px !important;
  right: 16px !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Floating dialogue feed header controls */
.feed-header-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed-header-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--z-text-2, #BDB6CF);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feed-header-btn:hover {
  background: rgba(233, 196, 106, 0.2);
  border-color: var(--z-gold, #E9C46A);
  color: var(--z-text, #F4F1FA);
}

/* ---------- Overlay hidden states (zero clutter on command) ---------- */
.floating-dialogue-feed.hud-hidden {
  display: none !important;
}

.quick-dock.hud-hidden {
  display: none !important;
}

.quick-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-dock-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--z-gold, #E9C46A);
}

.dock-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--z-text-3, #8C84A3);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dock-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--z-text, #F4F1FA);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Floating Reopen Pill when Dock is collapsed (Docked Bottom-Right out of the way) */
.hud-dock-restore-pill {
  position: absolute;
  bottom: 14px;
  right: 16px;
  left: auto;
  transform: none;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 9999px;
  background: rgba(12, 10, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.35));
  color: var(--z-text, #F4F1FA);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  transition: all 0.25s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
  animation: hudPopIn 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-dock-restore-pill:hover {
  background: rgba(233, 196, 106, 0.16);
  border-color: var(--z-gold, #E9C46A);
  color: var(--z-gold-hot, #FFD97A);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 14px rgba(233, 196, 106, 0.25);
}

.hud-dock-restore-pill kbd {
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-pixel, monospace);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--z-gold, #E9C46A);
  border: 1px solid rgba(233, 196, 106, 0.25);
}

/* Realm Map hidden state */
.z-realm.hud-hidden {
  display: none !important;
}

/* Globe Top Toolbar hidden state & boundary */
.world-top.hud-hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  .world-top {
    max-width: calc(100% - 480px) !important;
  }
}

.globe-toolbar-collapse-btn {
  margin-left: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--z-text-2, #BDB6CF);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.globe-toolbar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
}

/* Floating Reopen Pill when Toolbar is collapsed */
.hud-toolbar-restore-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(12, 10, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.35));
  color: var(--z-text, #F4F1FA);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.25s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
  animation: hudPopIn 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-toolbar-restore-pill:hover {
  background: rgba(233, 196, 106, 0.16);
  border-color: var(--z-gold, #E9C46A);
  color: var(--z-gold-hot, #FFD97A);
  transform: translateY(2px);
}

/* Side-Docked Quick POV Pill (Docked Bottom-Left above compass, completely out of center!) */
.quick-pov {
  position: absolute !important;
  bottom: 84px !important;
  left: 14px !important;
  right: auto !important;
  transform: none !important;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 31;
}

#quickPovPill {
  padding: 7px 14px !important;
  font-size: 11.5px !important;
  border-width: 1px !important;
  background: rgba(12, 10, 22, 0.88) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65) !important;
}

.quick-pov.hud-hidden {
  display: none !important;
}

.pov-dismiss-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 17, 23, 0.9);
  color: var(--z-text-2, #BDB6CF);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pov-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

/* ==========================================================================
   ZEN / CINEMATIC MODE ("Pure Planet View")
   Completely strips every single HUD overlay, banner, and header so the 3D
   planet can be enjoyed in breathtaking full screen with zero obstructions.
   ========================================================================== */
body.z-zen-mode .header-bar {
  display: none !important;
}

body.z-zen-mode .world-top,
body.z-zen-mode .floating-dialogue-feed,
body.z-zen-mode .quick-dock,
body.z-zen-mode .z-realm,
body.z-zen-mode .walk-compass,
body.z-zen-mode .quick-pov,
body.z-zen-mode .pixel-hud-deck,
body.z-zen-mode .hud-dock-restore-pill,
body.z-zen-mode .hud-toolbar-restore-pill,
body.z-zen-mode .huddle-dock {
  display: none !important;
}

body.z-zen-mode .main-viewport {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10 !important;
}

/* Floating Exit Zen Pill */
.zen-exit-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 9999px;
  background: rgba(12, 10, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--z-cyan, #5EEAD4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(94, 234, 212, 0.25);
  color: var(--z-text, #F4F1FA);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
  animation: hudPopIn 0.4s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

body.z-zen-mode .zen-exit-pill {
  display: inline-flex;
}

.zen-exit-pill:hover {
  background: rgba(94, 234, 212, 0.18);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 28px rgba(94, 234, 212, 0.4);
}

.zen-exit-pill kbd {
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-pixel, monospace);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--z-cyan, #5EEAD4);
  border: 1px solid rgba(94, 234, 212, 0.35);
}

/* ==========================================================================
   COMMANDS & SHORTCUTS MODAL
   ========================================================================== */
.hud-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 4, 8, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hud-modal-card {
  width: min(680px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 14, 26, 0.96), rgba(8, 7, 14, 0.98));
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.35));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(233, 196, 106, 0.08);
  padding: clamp(20px, 3vw, 32px);
  color: var(--z-text, #F4F1FA);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--z-ease, cubic-bezier(.2, .8, .2, 1));
}

.hud-modal-backdrop.is-open .hud-modal-card {
  transform: none;
}

.hud-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-modal-kicker {
  font-family: var(--font-pixel, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--z-gold, #E9C46A);
  margin: 0 0 4px;
}

.hud-modal-title {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.01em;
}

.hud-modal-close-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--z-text-2, #BDB6CF);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-modal-close-btn:hover {
  background: rgba(233, 196, 106, 0.2);
  border-color: var(--z-gold, #E9C46A);
  color: #FFF;
}

.hud-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.hud-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--z-gold, #E9C46A);
  margin: 0 0 12px;
}

.hud-cmd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

.hud-cmd-desc {
  color: var(--z-text-2, #BDB6CF);
}

.hud-cmd-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-cmd-key kbd {
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-pixel, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--z-text, #F4F1FA);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.hud-modal-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.hud-foot-hint {
  font-size: 12px;
  color: var(--z-text-3, #8C84A3);
}

.hud-foot-btn {
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--z-gold, #E9C46A);
  background: linear-gradient(135deg, var(--z-gold, #E9C46A), #D4AF37);
  color: #1A1406;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-foot-btn:hover {
  background: linear-gradient(135deg, var(--z-gold-hot, #FFD97A), var(--z-gold, #E9C46A));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(233, 196, 106, 0.35);
}

@keyframes hudPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .pixel-hud-deck {
    top: 8px;
    right: 8px;
    padding: 4px 6px;
    gap: 4px;
  }
  .hud-pill-btn {
    padding: 0 8px;
    font-size: 11px;
  }
  .hud-pill-btn kbd {
    display: none;
  }
  .floating-dialogue-feed {
    top: 48px !important;
  }
}

@media (max-width: 640px) {
  .pixel-hud-deck {
    max-width: calc(100% - 16px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .hud-pill-label {
    display: none;
  }
  .hud-pill-text {
    display: none;
  }
  .hud-pill-btn {
    padding: 0 8px;
    min-height: 30px;
  }
}

/* ==========================================================================
   WEBGL 2D FALLBACK CARD OVERLAY
   ========================================================================== */
.pixel-world-fallback-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pixel-world-fallback-card {
  width: min(560px, 92vw);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 14, 28, 0.96), rgba(8, 7, 15, 0.98));
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.4));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(233, 196, 106, 0.1);
  padding: 28px;
  color: var(--z-text, #F4F1FA);
}

.pw-fallback-badge {
  font-family: var(--font-pixel, monospace);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--z-gold, #E9C46A);
  margin-bottom: 8px;
}

.pw-fallback-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: #FFF;
}

.pw-fallback-reason {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--z-text-2, #BDB6CF);
  margin-bottom: 20px;
}

.pw-fallback-reason strong {
  color: var(--z-gold, #E9C46A);
  display: block;
  margin-bottom: 4px;
}

.pw-fallback-reason code {
  color: var(--z-cyan, #5EEAD4);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 4px;
  border-radius: 4px;
}

.pw-fallback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pw-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pw-fallback-btn.primary {
  background: linear-gradient(135deg, var(--z-gold, #E9C46A), #D4AF37);
  border: 1px solid var(--z-gold, #E9C46A);
  color: #1A1406;
}

.pw-fallback-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(233, 196, 106, 0.4);
}

.pw-fallback-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--z-text, #F4F1FA);
}

.pw-fallback-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pw-fallback-foot {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--z-text-3, #8C84A3);
}

/* ==========================================================================
   DIALOGUE BOX VOICE MODE BADGE
   ========================================================================== */
.dialogue-voice-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: auto;
  margin-right: 8px;
  cursor: help;
  user-select: none;
}

.dialogue-voice-mode-badge.is-thermal {
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.35);
  color: var(--z-cyan, #5EEAD4);
}

.dialogue-voice-mode-badge.is-live {
  background: rgba(233, 196, 106, 0.15);
  border: 1px solid rgba(233, 196, 106, 0.4);
  color: var(--z-gold, #E9C46A);
}

/* ==========================================================================
   FEEDBACK ACTION TOAST
   ========================================================================== */
.hud-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 99999;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(12, 10, 24, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--z-gold-line, rgba(233, 196, 106, 0.4));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(233, 196, 106, 0.15);
  color: var(--z-text, #F4F1FA);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.25s var(--z-ease, cubic-bezier(.2, .8, .2, 1)), opacity 0.25s ease;
}

.hud-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   LIVING MINDS FALLBACK & EMPTY EXPLANATION STATES
   ========================================================================== */
.lm-fallback-item {
  list-style: none;
  padding: 16px;
}

.lm-fallback-banner {
  background: rgba(233, 196, 106, 0.08);
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 12px;
  padding: 16px;
  color: var(--z-text, #F4F1FA);
}

.lm-fallback-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(233, 196, 106, 0.2);
  color: var(--z-gold, #E9C46A);
  font-family: var(--font-pixel, monospace);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.lm-fallback-msg {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--z-text-2, #BDB6CF);
  margin: 0 0 12px;
}

.lm-fallback-msg code {
  color: var(--z-cyan, #5EEAD4);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 4px;
  border-radius: 3px;
}

.lm-fallback-btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--z-gold, #E9C46A);
  background: rgba(233, 196, 106, 0.15);
  color: var(--z-gold-hot, #FFD97A);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lm-fallback-btn:hover {
  background: rgba(233, 196, 106, 0.25);
}

.lm-empty-state {
  list-style: none;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin: 8px 0;
}

.lm-empty-kicker {
  font-family: var(--font-pixel, monospace);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--z-gold, #E9C46A);
  margin-bottom: 4px;
}

.lm-empty-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--z-text-2, #BDB6CF);
  margin: 0;
}

.lm-empty-desc code {
  color: var(--z-cyan, #5EEAD4);
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 3px;
}

.lm-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--z-gold, #E9C46A);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.4; }
}

/* ==========================================================================
   SIDE-DOCKED & COLLAPSIBLE PIXEL WORLD HUDS, POPUPS, DIRECTIONS & HELP MENUS
   Guarantees 100% unobstructed center viewport for viewing the 3D world and
   walking/engaging as a character in Surface POV.
   ========================================================================== */

/* Shared inline collapse/expand button */
.hud-inline-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  background: rgba(15, 13, 28, 0.85);
  color: var(--z-gold, #E9C46A);
  font-family: var(--font-pixel, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.hud-inline-collapse-btn:hover {
  background: rgba(233, 196, 106, 0.2);
  border-color: var(--z-gold, #E9C46A);
  color: #FFF;
}

/* 1. Top-Right HUD Deck Collapsibility */
.pixel-hud-deck.is-collapsed .hud-pill-label,
.pixel-hud-deck.is-collapsed .hud-pill-btn:not(#btnCollapseHudDeck) {
  display: none !important;
}

.pixel-hud-deck.is-collapsed {
  padding: 4px 6px;
}

/* 2. Top-Left Globe Hint Directions Collapsibility */
#globeHint.is-collapsed {
  display: none !important;
}

#btnToggleGlobeHint {
  margin-top: 4px;
  align-self: flex-start;
}

/* 3. Surface POV Character Controls Banner — Docked Top-Left & Collapsible! */
.avatar-banner {
  position: absolute !important;
  top: 14px !important;
  left: 14px !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: min(360px, calc(100vw - 28px)) !important;
  max-width: min(360px, calc(100vw - 28px)) !important;
  border-radius: 16px !important;
  padding: 9px 12px !important;
  display: flex;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  background: linear-gradient(165deg, rgba(16, 14, 28, 0.92), rgba(9, 8, 18, 0.95)) !important;
  border: 1px solid rgba(233, 196, 106, 0.42) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  z-index: 52 !important;
}

.avatar-banner-info {
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 6px !important;
}

.avatar-banner-collapse-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.avatar-banner-keys {
  flex: 1 1 100%;
  text-align: left !important;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--z-text-2, #BDB6CF);
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: 2px;
}

.avatar-banner.is-keys-collapsed .avatar-banner-keys {
  display: none !important;
}

.avatar-banner.is-minimized {
  width: auto !important;
  max-width: calc(100vw - 28px) !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
}

.avatar-banner.is-minimized .avatar-banner-keys,
.avatar-banner.is-minimized #btnPilotGuide,
.avatar-banner.is-minimized #btnLiveTalk,
.avatar-banner.is-minimized #btnExitAvatarMode,
.avatar-banner.is-minimized #btnCollapseAvatarKeys {
  display: none !important;
}

/* Group the POV action buttons in a tidy row inside the side card */
.avatar-banner #btnPilotGuide,
.avatar-banner #btnLiveTalk,
.avatar-banner #btnExitAvatarMode {
  font-size: 11px !important;
  padding: 5px 10px !important;
  min-height: 30px !important;
  border-radius: 999px !important;
  width: fit-content;
}

/* 4. Proximity Interaction Prompt — Docked Bottom-Right out of the way of character! */
.avatar-proximity-prompt {
  position: absolute !important;
  bottom: 62px !important;
  right: 16px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  max-width: min(340px, calc(100vw - 32px)) !important;
  padding: 9px 16px !important;
  border-radius: 16px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  animation: promptSidePulse 2s infinite ease-in-out !important;
  z-index: 52 !important;
}

@keyframes promptSidePulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.28), 0 8px 24px rgba(0, 0, 0, 0.75);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.55), 0 10px 28px rgba(0, 0, 0, 0.85);
    transform: translateY(-2px);
  }
}

/* 5. In-World Character Dialogue Box — Docked Right Side & Collapsible! */
.avatar-dialogue-box {
  position: absolute !important;
  top: 56px !important;
  right: 16px !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: min(390px, calc(100vw - 32px)) !important;
  max-width: min(390px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 130px) !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  flex-direction: column !important;
  gap: 10px !important;
  z-index: 58 !important;
}

.avatar-dialogue-box .dialogue-box-avatar {
  display: none !important;
}

.avatar-dialogue-box.is-collapsed .dialogue-box-text,
.avatar-dialogue-box.is-collapsed .dialogue-ledger,
.avatar-dialogue-box.is-collapsed .dialogue-compose,
.avatar-dialogue-box.is-collapsed .dialogue-box-footer {
  display: none !important;
}

.avatar-dialogue-box.is-collapsed .dialogue-box-header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

/* 6. World Encounter Card (Left Side) & Civic Hall Panel (Right Side) Collapsibility */
.world-encounter {
  top: 58px !important;
  left: 14px !important;
  width: min(340px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 150px) !important;
}

.world-encounter.is-collapsed #encounterBody,
.world-encounter.is-collapsed #encounterMeta,
.world-encounter.is-collapsed #encounterChips,
.world-encounter.is-collapsed .encounter-actions,
.world-encounter.is-collapsed .encounter-keys {
  display: none !important;
}

.civic-panel {
  top: 58px !important;
  right: 16px !important;
  width: min(360px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 140px) !important;
}

.civic-panel.is-collapsed #civicLead,
.civic-panel.is-collapsed #civicKeeper,
.civic-panel.is-collapsed #civicStatus,
.civic-panel.is-collapsed #civicBody {
  display: none !important;
}

/* 7. Huddle Stage — Docked Left Side (No Fullscreen Backdrop Blocking the 3D World!) */
.huddle-stage {
  position: absolute !important;
  inset: auto auto 92px 14px !important;
  width: min(350px, calc(100vw - 28px)) !important;
  padding: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
  justify-content: flex-start !important;
  align-items: flex-end !important;
  z-index: 54 !important;
}

.huddle-stage-card {
  width: 100% !important;
  pointer-events: auto !important;
}

.huddle-stage.is-collapsed #huddleStageTopic,
.huddle-stage.is-collapsed #huddleStageCast,
.huddle-stage.is-collapsed #huddleTranscript,
.huddle-stage.is-collapsed #huddleVoiceNote {
  display: none !important;
}

/* 7b. Huddle Cards Dock — Strictly Docked Left & Collapsible (Never shifted to center by civ_pass2.css!) */
body .huddle-dock,
body:has(.z-realm:not(.z-collapsed):not(.z-big)) .huddle-dock,
body:has(.z-realm.z-collapsed) .huddle-dock {
  position: absolute !important;
  left: 14px !important;
  bottom: 158px !important;
  right: auto !important;
  width: min(290px, calc(100vw - 28px)) !important;
  max-height: 28vh !important;
  z-index: 38 !important;
}

body .huddle-dock.is-collapsed {
  display: none !important;
}

.huddle-dock-toggle-btn {
  position: absolute !important;
  left: 14px !important;
  bottom: 126px !important;
  z-index: 39 !important;
}

body.z-zen-mode .huddle-dock-toggle-btn {
  display: none !important;
}

/* 8. Walk Compass & Boundary Toast — Docked Bottom-Left / Top-Left & Collapsible */
.walk-compass {
  left: 14px !important;
  bottom: 14px !important;
  pointer-events: auto !important;
  padding: 6px 10px 6px 6px !important;
  gap: 8px !important;
  background: rgba(10, 12, 22, 0.86) !important;
  border: 1px solid rgba(233, 196, 106, 0.35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
}

.walk-compass .compass-bezel {
  width: 48px !important;
  height: 48px !important;
  transition: all 0.25s ease;
}

.walk-compass.is-collapsed .compass-bezel {
  width: 24px !important;
  height: 24px !important;
}

.walk-compass.is-collapsed .compass-dial {
  display: none !important;
}

.walk-compass.is-collapsed .compass-needle {
  top: 3px !important;
  border-bottom-width: 9px !important;
}

.boundary-toast {
  left: 14px !important;
  top: 90px !important;
  right: auto !important;
  transform: none !important;
  max-width: min(340px, calc(100vw - 28px));
}

/* ==========================================================================
   COMPREHENSIVE MULTI-TAB UI ENHANCEMENT PASS ("HERMETIC SOVEREIGN ATELIER")
   Elevates typography, depth, card hierarchy, interactive states, and visual
   rhythm across every tab / page view of Zoth Civilization.
   ========================================================================== */

/* ---------- Global View Section Spacing & Background Atmosphere ---------- */
.view-section:not(#view-pixel-world) {
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(233, 196, 106, 0.065), transparent 65%),
    radial-gradient(900px 480px at 88% 8%, rgba(157, 123, 255, 0.075), transparent 65%),
    radial-gradient(700px 400px at 50% 95%, rgba(94, 234, 212, 0.04), transparent 70%),
    var(--z-void, #05050A);
}

/* ---------- Navigation Tabs Bar Polish ---------- */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px !important;
  padding: 8px 16px !important;
  background: linear-gradient(180deg, rgba(10, 9, 18, 0.78), rgba(6, 5, 12, 0.92)) !important;
  border-top: 1px solid rgba(233, 196, 106, 0.14) !important;
}

.tab-btn {
  padding: 7px 13px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s var(--z-ease, cubic-bezier(.2, .8, .2, 1)) !important;
}

.tab-btn:hover {
  background: rgba(233, 196, 106, 0.08) !important;
  border-color: rgba(233, 196, 106, 0.24) !important;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(233, 196, 106, 0.2), rgba(157, 123, 255, 0.12)) !important;
  border-color: rgba(233, 196, 106, 0.52) !important;
  color: #FFF !important;
  box-shadow: 0 4px 18px rgba(233, 196, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

/* ---------- Glass Cards & Section Headers Across All Tabs ---------- */
.view-section:not(#view-pixel-world) .glass-card,
.scope-editor-card {
  position: relative;
  background: linear-gradient(165deg, rgba(22, 19, 38, 0.84), rgba(11, 10, 20, 0.92)) !important;
  border: 1px solid rgba(233, 196, 106, 0.26) !important;
  border-radius: 16px !important;
  padding: 20px 22px !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  transition: transform 0.25s var(--z-ease), border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.view-section:not(#view-pixel-world) .glass-card:hover,
.scope-editor-card:hover {
  border-color: rgba(233, 196, 106, 0.48) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(233, 196, 106, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.section-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  padding-bottom: 8px;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- KPI Stat Grids (Timeline, Lineage, Conclave) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px !important;
}

.stat-grid .glass-card {
  padding: 18px 16px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, rgba(26, 22, 44, 0.86), rgba(12, 10, 22, 0.94)) !important;
}

.stat-grid .glass-card:hover {
  transform: translateY(-3px);
}

/* ---------- TAB 2: $100K TIMELINE & SYNERGY SQUADS ---------- */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px !important;
}

.milestone-card {
  background: linear-gradient(165deg, rgba(22, 19, 38, 0.88), rgba(10, 9, 20, 0.95)) !important;
  border: 1px solid rgba(233, 196, 106, 0.25) !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.milestone-card.in-progress {
  border-color: rgba(52, 211, 153, 0.55) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6), 0 0 22px rgba(16, 185, 129, 0.16) !important;
}

.squad-card {
  background: linear-gradient(160deg, rgba(24, 20, 42, 0.88), rgba(11, 10, 22, 0.95)) !important;
  border: 1px solid rgba(233, 196, 106, 0.24) !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

.squad-card:hover {
  border-color: var(--z-gold, #E9C46A) !important;
  transform: translateY(-3px);
}

/* ---------- TAB 3: ADYTUM INITIATION CHAMBER ---------- */
.adytum-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px !important;
  gap: 24px !important;
}

.card-showcase-panel {
  width: min(360px, 100%) !important;
  background: linear-gradient(170deg, rgba(26, 20, 46, 0.9), rgba(10, 9, 20, 0.96)) !important;
  border: 1px solid rgba(233, 196, 106, 0.42) !important;
  border-radius: 20px !important;
  padding: 22px !important;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.75), 0 0 32px rgba(233, 196, 106, 0.1) !important;
}

@media (min-width: 980px) {
  .card-showcase-panel {
    position: sticky !important;
    top: 20px;
  }
}

.tarot-image-frame {
  border-radius: 14px !important;
  border: 2px solid var(--z-gold, #E9C46A) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 28px rgba(233, 196, 106, 0.3) !important;
}

.journey-node {
  min-width: 56px !important;
  height: 68px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  transition: all 0.2s var(--z-ease) !important;
}

.journey-node:hover {
  transform: translateY(-3px);
  border-color: var(--z-gold, #E9C46A) !important;
  background: rgba(233, 196, 106, 0.12) !important;
}

.journey-node.active {
  background: linear-gradient(145deg, rgba(233, 196, 106, 0.24), rgba(157, 123, 255, 0.18)) !important;
  border-color: var(--z-gold-hot, #FFD97A) !important;
  box-shadow: 0 0 18px rgba(233, 196, 106, 0.35) !important;
}

.corr-pill {
  background: rgba(10, 9, 20, 0.65) !important;
  border: 1px solid rgba(233, 196, 106, 0.2) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.corr-pill:hover {
  border-color: rgba(233, 196, 106, 0.45) !important;
  transform: translateY(-1px);
}

/* ---------- TAB 4: COCKPIT GRAPH & TELEMETRY MATRIX ---------- */
.cockpit-container {
  gap: 18px !important;
  padding: 18px !important;
}

.graph-canvas-box {
  border-radius: 18px !important;
  border: 1px solid rgba(233, 196, 106, 0.3) !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(28, 22, 54, 0.55) 0%, rgba(7, 6, 14, 0.96) 78%) !important;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 16px 44px rgba(0, 0, 0, 0.65) !important;
  overflow: hidden;
}

.cockpit-sidebar {
  background: linear-gradient(175deg, rgba(20, 17, 36, 0.9), rgba(9, 8, 18, 0.95)) !important;
  border: 1px solid rgba(233, 196, 106, 0.3) !important;
  border-radius: 18px !important;
  padding: 18px !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65) !important;
}

.telemetry-gauge {
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: rgba(8, 7, 16, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.telemetry-gauge:hover {
  border-color: rgba(233, 196, 106, 0.38) !important;
  transform: translateY(-1px);
}

/* ---------- TAB 6: CONCLAVE & $100K TREASURY ---------- */
.mission-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px !important;
  gap: 20px !important;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px !important;
  margin-top: 8px;
}

/* ---------- TAB 7: WISHLIST & CIVIC SKILL SHELF ---------- */
.wishlist-filter-bar {
  border-radius: 14px !important;
  padding: 10px 16px !important;
  background: rgba(14, 12, 26, 0.85) !important;
  border: 1px solid rgba(233, 196, 106, 0.24) !important;
}

.wishlist-filter-btn {
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-size: 11.5px !important;
}

.wishlist-grid,
.shelf-grid,
.halls-grid,
.buildings-grid,
.colony-grid {
  gap: 16px !important;
}

/* ---------- TAB 8 & 9: LINEAGE, MISSION CONTROL & LIBRARY ---------- */
.library-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px !important;
}

.library-card,
.hall-card,
.building-card,
.colony-card,
.wishlist-card {
  border-radius: 14px !important;
  background: linear-gradient(165deg, rgba(22, 19, 38, 0.86), rgba(10, 9, 20, 0.94)) !important;
  border: 1px solid rgba(233, 196, 106, 0.24) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48) !important;
  transition: transform 0.22s var(--z-ease), border-color 0.22s ease, box-shadow 0.22s ease !important;
}

.library-card:hover,
.hall-card:hover,
.building-card:hover,
.colony-card:hover,
.wishlist-card:hover {
  transform: translateY(-3px);
  border-color: rgba(233, 196, 106, 0.5) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(233, 196, 106, 0.1) !important;
}

@media (max-width: 1100px) {
  .stat-grid,
  .milestone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .stat-grid,
  .milestone-grid {
    grid-template-columns: 1fr !important;
  }
  .adytum-container,
  .mission-container,
  .library-wrap {
    padding: 12px !important;
  }
}

/* ==========================================================================
   V4: MINIMAL 3D WORLD HUD — DOCKED TOP BAR & BOTTOM BAR ARCHITECTURE
   Eliminates all floating pills over the 3D world canvas. Every control is
   accessible in the Slim Top World Bar (.world-top) or Slim Bottom Dock Bar
   (#pixelHudDeck.zoth-bottom-hud-bar).
   ========================================================================== */

/* 1. Permanently hide scattered floating pills inside 3D viewport */
#quickPovContainer,
#btnRestoreDock,
#btnRestoreToolbar,
#btnToggleHuddleDock,
#toolShelf {
  display: none !important;
}

/* 2. Compact Page-Level Header & Funnel Banner so 3D Viewport gets max height */
.cross-banner-elements {
  padding: 2px 12px !important;
  min-height: 22px !important;
  font-size: 10px !important;
}
.header-row {
  padding: 5px 12px !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.header-row .brand-section {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.header-row .brand-title {
  font-size: 14px !important;
  white-space: nowrap !important;
}
.header-row .brand-sub {
  display: none !important;
}
.header-row .sovereign-header-ticker {
  position: static !important;
  transform: none !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
}
.header-row #headerCountdownDays {
  display: none !important;
}
.header-stats {
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  margin-left: auto !important;
}
.header-stats .btn-ctrl,
.header-stats .brand-badge,
.header-stats .clock-pill {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 3px 8px !important;
  font-size: 10.5px !important;
}
.z-decree {
  padding: 3px 12px !important;
  min-height: 24px !important;
  font-size: 11px !important;
}
.nav-tabs {
  padding: 4px 12px !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.tab-btn {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
#funnelHeroBanner {
  padding: 5px 12px !important;
  gap: 8px 12px !important;
  flex-wrap: wrap !important;
  overflow-x: visible !important;
}
#funnelHeroBanner > div {
  flex-wrap: wrap !important;
  white-space: normal !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

/* Optional "Max 3D" focus mode toggled from Top Bar */
body.z-compact-chrome .cross-banner-elements,
body.z-compact-chrome .z-decree,
body.z-compact-chrome #funnelHeroBanner {
  display: none !important;
}

/* 3. SLIM TOP WORLD BAR (.world-top) — Docked flush across top edge of 3D world */
.world-top {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px 10px !important;
  background: rgba(8, 7, 16, 0.84) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(233, 196, 106, 0.28) !important;
  border-radius: 0 !important;
  z-index: 48 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.world-top.hud-hidden {
  display: none !important;
}

.world-top .globe-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100% !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

.world-top .globe-toolbar-group {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.world-top .globe-btn {
  padding: 3px 8px !important;
  min-height: 26px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}

.world-top .globe-altitude-badge {
  padding: 2px 7px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}

#worldCensusBadge {
  display: none !important;
}

#btnToggleGlobeHint {
  display: none !important;
}

/* Inline Compass inside Top World Bar */
.world-top .walk-compass {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(233, 196, 106, 0.28) !important;
  box-shadow: none !important;
}
.world-top .walk-compass .compass-bezel {
  width: 18px !important;
  height: 18px !important;
}
.world-top .walk-compass .compass-dial,
.world-top .walk-compass #btnCollapseCompass {
  display: none !important;
}
.world-top .walk-compass .compass-readout {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: #FFD97A !important;
  white-space: nowrap !important;
}

/* Surface Walk POV Banner — Docked inline inside .world-top (Zero floating box on 3D view!) */
.world-top .avatar-banner,
.avatar-banner {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  gap: 6px !important;
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: none !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.avatar-banner-info {
  width: auto !important;
  flex: 0 1 auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

/* Dock In-World Encounter, Civic Hall & Dialogue Panels cleanly at Bottom-Right above Bottom Bar */
.world-encounter,
.civic-panel,
.avatar-dialogue-box {
  top: auto !important;
  bottom: 46px !important;
  right: 12px !important;
  left: auto !important;
  max-height: min(360px, 50vh) !important;
  overflow-y: auto !important;
  z-index: 54 !important;
}

/* 4. SLIM BOTTOM WORLD BAR (#pixelHudDeck.zoth-bottom-hud-bar) */
#pixelHudDeck.zoth-bottom-hud-bar {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 40px !important;
  padding: 4px 12px !important;
  border-radius: 0 !important;
  background: rgba(8, 7, 16, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: none !important;
  border-top: 1px solid rgba(233, 196, 106, 0.32) !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  z-index: 55 !important;
}

#pixelHudDeck.zoth-bottom-hud-bar .hud-bottom-left,
#pixelHudDeck.zoth-bottom-hud-bar .hud-bottom-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

#pixelHudDeck.zoth-bottom-hud-bar .hud-pill-btn {
  min-height: 28px !important;
  padding: 0 9px !important;
  font-size: 11px !important;
  border-radius: 7px !important;
}

/* Live 1-line Pantheon & Vaelor L1 Ticker inside Bottom Bar */
.hud-bottom-ticker {
  flex: 1 1 auto;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  font-family: var(--font-pixel, 'JetBrains Mono', monospace);
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hud-bottom-ticker:hover {
  background: rgba(233, 196, 106, 0.1);
  border-color: rgba(233, 196, 106, 0.38);
}

.hud-ticker-badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6EE7B7;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hud-ticker-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #F4F1FA;
}

#pixelHudDeck.zoth-bottom-hud-bar.is-collapsed {
  width: auto !important;
  left: auto !important;
  right: 10px !important;
  bottom: 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(233, 196, 106, 0.4) !important;
  padding: 3px 8px !important;
  min-height: 28px !important;
}
#pixelHudDeck.zoth-bottom-hud-bar.is-collapsed .hud-bottom-left,
#pixelHudDeck.zoth-bottom-hud-bar.is-collapsed .hud-bottom-ticker,
#pixelHudDeck.zoth-bottom-hud-bar.is-collapsed .hud-bottom-right .hud-pill-btn:not(#btnCollapseHudDeck) {
  display: none !important;
}

/* 5. Pop-up Drawers anchored cleanly above Bottom Bar (Closed by default!) */
.floating-dialogue-feed {
  top: auto !important;
  bottom: 46px !important;
  right: 12px !important;
  max-height: min(360px, 52vh) !important;
  z-index: 54 !important;
}

.quick-dock {
  bottom: 46px !important;
  left: 12px !important;
  right: 12px !important;
  z-index: 54 !important;
}

.z-realm {
  top: auto !important;
  bottom: 46px !important;
  left: 12px !important;
  right: auto !important;
  z-index: 54 !important;
}

body .huddle-dock,
body:has(.z-realm:not(.z-collapsed):not(.z-big)) .huddle-dock,
body:has(.z-realm.z-collapsed) .huddle-dock {
  top: auto !important;
  bottom: 46px !important;
  left: 12px !important;
  z-index: 54 !important;
}

@media (max-width: 900px) {
  .hud-bottom-ticker {
    display: none !important;
  }
  #pixelHudDeck.zoth-bottom-hud-bar {
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
}

/* 6. Monotone Ordered Bayer 4x4 + Scanline CRT World Lens */
.pixel-world-container.dither-crt-world #globeCanvasContainer canvas {
  filter: contrast(1.22) saturate(0.28) drop-shadow(0 0 8px rgba(236, 238, 240, 0.22));
}
.pixel-world-container.dither-crt-world::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 44;
  background-image:
    radial-gradient(rgba(236, 238, 240, 0.12) 1px, transparent 1px),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0px,
      rgba(255, 255, 255, 0) 2px,
      rgba(0, 0, 0, 0.28) 3px,
      rgba(0, 0, 0, 0.28) 4px
    );
  background-size: 8px 8px, 100% 100%;
  mix-blend-mode: screen;
}
.pixel-world-container.dither-crt-world #pixelHudDeck.zoth-bottom-hud-bar,
.pixel-world-container.dither-crt-world .world-top {
  border-color: rgba(236, 238, 240, 0.45) !important;
  box-shadow: 0 0 18px rgba(236, 238, 240, 0.14) !important;
}




