/* NEURON FAUNA 888 - LIVE ECOSYSTEM UI (Dark Obsidian Glass) */
#lc-fauna-panel {
  position: fixed;
  z-index: 2147482495;
  left: 116px;
  top: 72px;
  width: min(360px, calc(100vw - 132px));
  max-height: calc(100dvh - 166px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(9, 12, 16, 0.96);
  color: #f1f5f9;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
#lc-fauna-panel[hidden] { display: none !important; }
#lc-fauna-panel * { box-sizing: border-box; }
.f888-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0e13;
}
.f888-head strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
}
.f888-close {
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}
.f888-close:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.f888-body {
  overflow-y: auto;
  padding: 11px 13px 14px;
  display: grid;
  gap: 10px;
  scrollbar-width: thin;
}
.f888-sec-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #88b1cc;
  margin: 2px 0 4px;
}
.f888-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.f888-seg.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.f888-seg.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.f888-btn {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #e8eff5;
  font: 600 11.5px/1.2 system-ui, sans-serif;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f888-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.34); }
.f888-btn[aria-pressed="true"], .f888-btn.active {
  background: #124038;
  border-color: #12e8a4;
  color: #d6fff1;
}
.f888-btn.warn {
  background: #3d2416;
  border-color: #e08d47;
  color: #ffe0bd;
}
.f888-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #446078;
  border-radius: 8px;
  background: #070e15;
  color: #fff;
  font: 12.5px system-ui, sans-serif;
}
.f888-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.f888-row input[type="range"] {
  flex: 1;
  accent-color: #4ccbaa;
}
.f888-list {
  display: grid;
  gap: 4px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.f888-sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ffffff16;
  border-radius: 8px;
  background: #0f1c29;
  color: #e6f2fa;
  cursor: pointer;
  text-align: left;
  font: 12px/1.2 system-ui, sans-serif;
}
.f888-sp-item:hover { background: #193045; border-color: #4f7b9e; }
.f888-sp-item.selected { background: #133c35; border-color: #4ccbaa; }
.f888-sp-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffffff33;
  flex: none;
  background: #0a141d;
}
.f888-sp-meta {
  min-width: 0;
  flex: 1;
}
.f888-sp-meta b {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f888-sp-meta small {
  display: block;
  font-size: 10px;
  color: #8fb2c9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f888-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #173042;
  color: #9be2ff;
  flex: none;
}
.f888-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.f888-stat {
  padding: 7px 8px;
  border: 1px solid #ffffff18;
  border-radius: 8px;
  background: #0c1722;
}
.f888-stat b {
  display: block;
  font-size: 15px;
  color: #8bf0cc;
  font-variant-numeric: tabular-nums;
}
.f888-stat small {
  display: block;
  font-size: 10px;
  color: #95b1c5;
}
.f888-note {
  font-size: 10.5px;
  color: #93afc2;
  background: #0c1722;
  border: 1px solid #ffffff14;
  border-radius: 8px;
  padding: 7px 9px;
  margin: 0;
}

/* LOD 5: Interactive Species Atlas Card */
#lc-fauna-card {
  position: fixed;
  z-index: 2147482498;
  right: 16px;
  top: 72px;
  width: min(365px, calc(100vw - 32px));
  max-height: calc(100dvh - 166px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  background: rgba(9, 12, 16, 0.97);
  color: #f1f5f9;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
  font: 12.5px/1.4 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
#lc-fauna-card[hidden] { display: none !important; }
#lc-fauna-card * { box-sizing: border-box; }
.f888-card-hero {
  position: relative;
  height: 168px;
  background: radial-gradient(circle at 50% 40%, #19354a, #09121c);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #ffffff1a;
}
.f888-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.f888-card-hero .f888-close {
  position: absolute;
  top: 9px;
  right: 9px;
  background: rgba(8, 16, 24, 0.82);
}
.f888-card-titlebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 13px 9px;
  background: linear-gradient(transparent, rgba(7, 13, 20, 0.94));
}
.f888-card-titlebar h3 {
  margin: 0;
  font-size: 16px;
  color: #fff;
}
.f888-card-titlebar em {
  display: block;
  font-size: 11.5px;
  color: #9ed7f5;
}
.f888-card-body {
  overflow-y: auto;
  padding: 11px 13px 14px;
  display: grid;
  gap: 9px;
  scrollbar-width: thin;
}
.f888-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.f888-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  padding: 4px 5px;
  border-radius: 7px;
  background: #0b1621;
  border: 1px solid #ffffff16;
}
.f888-chart i {
  flex: 1;
  background: #3bc9a8;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.78;
}
.f888-chart i.now {
  background: #f59e0b;
  opacity: 1;
}
.f888-kv {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 4px 8px;
  font-size: 11.5px;
}
.f888-kv span:nth-child(odd) { color: #8cb0c8; }

/* Live 2D floating labels overlay for nearby / followed animals */
#lc-fauna-labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}
.f888-tag {
  position: absolute;
  transform: translate(-50%, -125%);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(9, 18, 28, 0.88);
  border: 1px solid #63d8ff88;
  color: #eef8ff;
  font: 600 10.5px/1.2 system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.f888-tag.selected {
  background: #103c34;
  border-color: #4ccbaa;
  color: #d6fff1;
}
.f888-tag.future-alt {
  border-color: #f59e0b;
  color: #ffebc7;
}

/* Follow Banner */
#lc-fauna-follow-bar {
  position: fixed;
  z-index: 2147482497;
  left: 50%;
  top: 66px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #4ccbaa;
  background: rgba(11, 35, 33, 0.94);
  color: #d8fff2;
  font: 600 12px system-ui, sans-serif;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
}
#lc-fauna-follow-bar[hidden] { display: none !important; }

@media (max-width: 700px) {
  #lc-fauna-panel {
    left: 62px;
    top: 62px;
    width: calc(100vw - 70px);
    max-height: calc(100dvh - 140px);
  }
  #lc-fauna-card {
    right: 8px;
    left: 8px;
    top: auto;
    bottom: 68px;
    width: auto;
    max-height: 55dvh;
  }
}
