/*
 * ████████████████████████████████████████████████████████████
 *  SHADOW NEXUS REALM  — realm.css
 *  Full immersive redesign overlay
 *  Layered on top of the existing styles without breaking
 *  any existing JavaScript / Firebase functionality.
 * ████████████████████████████████████████████████████████████
 */

/* ═══════════════════════════════════════════════════════════
   REALM DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  --realm-bg:         #000508;
  --realm-bg2:        #00080f;
  --realm-blue:       #00AEEF;
  --realm-cyan:       #00f0ff;
  --realm-green:      #39FF14;
  --realm-glow-b:     rgba(0,174,239,0.65);
  --realm-glow-g:     rgba(57,255,20,0.55);
  --realm-glow-c:     rgba(0,240,255,0.50);
  --realm-panel:      rgba(0,15,30,0.88);
  --realm-panel-b:    rgba(0,30,60,0.75);
  --realm-border:     rgba(0,174,239,0.35);
  --realm-border-h:   rgba(0,240,255,0.75);
  --realm-text:       #e8f8ff;
  --realm-text-dim:   #6a9ab8;
  /* Desktop: always expanded at full width */
  --shadow-core-w:      220px;
  --shadow-core-w-open: 220px;
  --nav-anim:         0.30s cubic-bezier(0.4,0,0.2,1);
}

/* ═══════════════════════════════════════════════════════════
   ENTERING ANIMATION — shown once on first load
   ═══════════════════════════════════════════════════════════ */
#snxEnterOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000508;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  pointer-events: all;
  animation: enterFadeOut 0.8s ease 3.2s both;
}
#snxEnterOverlay.done { display: none; }

@keyframes enterFadeOut {
  to { opacity: 0; pointer-events: none; visibility: hidden; }
}

.snx-enter-logo {
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #00AEEF;
  text-shadow:
    0 0 6px  rgba(0,174,239,1.00),
    0 0 20px rgba(0,174,239,0.90),
    0 0 50px rgba(0,174,239,0.65),
    0 0 100px rgba(0,174,239,0.35),
    0 0 130px rgba(57,255,20,0.18),
    0 0 200px rgba(57,255,20,0.08);
  animation: enterLogoIn 1.2s ease both;
}
@keyframes enterLogoGlow {
  0%, 100% {
    text-shadow:
      0 0 6px  rgba(0,174,239,1.00),
      0 0 20px rgba(0,174,239,0.90),
      0 0 50px rgba(0,174,239,0.65),
      0 0 100px rgba(0,174,239,0.35),
      0 0 130px rgba(57,255,20,0.18),
      0 0 200px rgba(57,255,20,0.08);
  }
  50% {
    text-shadow:
      0 0 8px  rgba(0,207,255,1.00),
      0 0 26px rgba(0,174,239,1.00),
      0 0 60px rgba(0,174,239,0.75),
      0 0 110px rgba(0,174,239,0.40),
      0 0 150px rgba(57,255,20,0.32),
      0 0 220px rgba(57,255,20,0.14);
  }
}
.snx-enter-sub {
  font-size: 13px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--realm-cyan);
  opacity: 0;
  animation: enterSubIn 0.7s ease 1.1s both;
}
.snx-enter-bar {
  width: min(340px, 80vw);
  height: 2px;
  background: rgba(0,174,239,0.18);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: enterSubIn 0.4s ease 1.4s both;
}
.snx-enter-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--realm-blue), var(--realm-cyan), var(--realm-green));
  border-radius: 2px;
  animation: enterBarFill 1.5s ease 1.5s both;
  box-shadow: 0 0 12px var(--realm-blue);
}

@keyframes enterLogoIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); letter-spacing: 2px; }
  to   { opacity: 1; transform: scale(1) translateY(0); letter-spacing: 6px; }
}
@keyframes enterSubIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes enterBarFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL BODY OVERRIDE — deep space background
   ═══════════════════════════════════════════════════════════ */
body {
  background: var(--realm-bg) !important;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Stars canvas — absolute background layer */
#snxStarsCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   BLUE RAIN PARTICLES
   ═══════════════════════════════════════════════════════════ */
.rain-drop {
  position: fixed;
  width: 1px;
  top: -20px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, transparent, var(--realm-blue), transparent);
  animation: rainFall linear infinite;
  opacity: 0.35;
}
@keyframes rainFall {
  from { transform: translateY(0); opacity: 0.4; }
  to   { transform: translateY(110vh); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   ENERGY WAVES — full-screen ambient
   ═══════════════════════════════════════════════════════════ */
.realm-energy-wave {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: energyExpand 6s ease-out infinite;
  opacity: 0;
}
@keyframes energyExpand {
  0%   { transform: scale(0.2); opacity: 0.3; }
  80%  { opacity: 0.06; }
  100% { transform: scale(4); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   PORTAL PAGE TRANSITION
   ═══════════════════════════════════════════════════════════ */
#snxPortalTransition {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--realm-cyan), var(--realm-blue), transparent 70%);
  opacity: 0;
  transform: scale(0.1);
  transition: none;
}
#snxPortalTransition.firing {
  animation: portalFlash 0.45s ease-out both;
}
@keyframes portalFlash {
  0%   { opacity: 0; transform: scale(0.1); }
  40%  { opacity: 0.55; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(2.5); }
}

/* ═══════════════════════════════════════════════════════════
   SHADOW CORE — floating crystal navigation (replaces sidebar)
   ═══════════════════════════════════════════════════════════ */

/* Hide the old hamburger — replaced by #snxMobileMenuBtn on mobile */
.menuBtn { display: none !important; }

/* Old sidebar is hidden on desktop — Shadow Core is the nav instead */
/* On mobile (≤1024px) it becomes the slide-out drawer — see @media below */
@media (min-width: 1025px) {
  .sidebar { display: none !important; }
  #sidebarOverlay { display: none !important; }
  #snxMobileMenuBtn { display: none !important; }
}

/* New floating nav — always expanded on desktop */
#shadowCore {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: var(--shadow-core-w);
  transition: width var(--nav-anim);
  /* Full-height sidebar panel */
  background: linear-gradient(180deg, rgba(0,6,16,0.98) 0%, rgba(0,12,28,0.97) 60%, rgba(0,4,12,0.98) 100%);
  border-right: 1px solid rgba(0,174,239,0.18);
  box-shadow: 4px 0 32px rgba(0,0,0,0.5), 2px 0 20px rgba(0,80,180,0.12);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#shadowCore.expanded {
  width: var(--shadow-core-w-open);
  align-items: flex-start;
}

/* Header branding strip at top of the always-open nav */
.sc-orb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px;
  width: 100%;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,174,239,0.15);
  background: linear-gradient(135deg, rgba(0,40,100,0.22) 0%, transparent 100%);
  cursor: default;
  user-select: none;
  font-size: 22px;
  /* Keep the orb glow on the icon element inside */
}
/* Inner icon inside the orb strip */
.sc-orb-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #004488, #000c18);
  border: 2px solid var(--realm-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow:
    0 0 14px var(--realm-blue),
    inset 0 0 8px rgba(0,174,239,0.25);
  animation: orbPulse 3s ease-in-out infinite;
}
/* Brand name text beside the icon */
.sc-orb-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.sc-orb-name {
  font-size: 11px;
  font-weight: 800;
  color: #00d4ff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(0,200,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-orb-sub {
  font-size: 9px;
  color: rgba(0,255,136,0.5);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.sc-orb:hover { /* no-op on desktop */ }
@keyframes orbPulse {
  0%,100% {
    box-shadow: 0 0 14px var(--realm-blue), inset 0 0 8px rgba(0,174,239,0.25);
  }
  50% {
    box-shadow: 0 0 22px var(--realm-cyan), inset 0 0 14px rgba(0,240,255,0.3);
  }
}

/* Nav container panel — scrollable, fills remaining height */
.sc-nav-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,174,239,0.25) transparent;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.sc-nav-panel::-webkit-scrollbar { width: 3px; }
.sc-nav-panel::-webkit-scrollbar-track { background: transparent; }
.sc-nav-panel::-webkit-scrollbar-thumb { background: rgba(0,174,239,0.25); border-radius: 3px; }

/* Individual crystal nav items */
.sc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--realm-text-dim);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-family: inherit;
}
.sc-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: border-color 0.18s;
}
.sc-item:hover {
  background: rgba(0,174,239,0.12);
  color: #fff;
  box-shadow: inset 0 0 14px rgba(0,174,239,0.15), 0 0 10px rgba(0,174,239,0.1);
}
.sc-item:hover::before { border-color: rgba(0,174,239,0.4); }

.sc-item.active-nav {
  background: rgba(0,174,239,0.16);
  color: var(--realm-cyan);
  box-shadow:
    inset 0 0 20px rgba(0,174,239,0.22),
    0 0 14px rgba(0,174,239,0.15);
}
.sc-item.active-nav::before { border-color: rgba(0,240,255,0.5); }

.sc-item-icon {
  font-size: 20px;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0,174,239,0.5));
  transition: filter 0.18s;
}
.sc-item:hover .sc-item-icon,
.sc-item.active-nav .sc-item-icon {
  filter: drop-shadow(0 0 8px var(--realm-cyan));
}

/* Labels always visible on desktop */
.sc-item-label {
  flex: 1;
  opacity: 1;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: auto;
  transition: opacity var(--nav-anim), max-width var(--nav-anim);
}
#shadowCore.expanded .sc-item-label {
  opacity: 1;
  max-width: 160px;
  pointer-events: auto;
}

.sc-item-badge {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--realm-green), #26cc0f);
  color: #001a00;
  font-size: 9px;
  font-weight: 900;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(57,255,20,0.6);
  animation: badgePop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
.sc-item-badge.visible { display: inline-flex; }
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* Go Live item */
.sc-item-live {
  color: #ff4466 !important;
  background: rgba(255,30,60,0.08) !important;
}
.sc-item-live:hover { background: rgba(255,30,60,0.18) !important; color: #ff2244 !important; }
.sc-item-live .sc-item-icon { filter: drop-shadow(0 0 5px #ff3344); }

/* Divider */
.sc-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,174,239,0.3), transparent);
  margin: 4px 0;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE NEXUS CORE — floating radial menu
   ═══════════════════════════════════════════════════════════ */
#nexusCoreBtn {
  display: none;
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #003366, #000c1a);
  border: 2px solid var(--realm-blue);
  font-size: 26px;
  cursor: pointer;
  box-shadow:
    0 0 24px var(--realm-blue),
    0 0 50px rgba(0,174,239,0.3),
    inset 0 0 14px rgba(0,174,239,0.2);
  animation: nexusBtnPulse 2.5s ease-in-out infinite;
  align-items: center;
  justify-content: center;
  color: #fff;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@keyframes nexusBtnPulse {
  0%,100% { box-shadow: 0 0 24px var(--realm-blue), 0 0 50px rgba(0,174,239,0.3), inset 0 0 14px rgba(0,174,239,0.2); }
  50%      { box-shadow: 0 0 34px var(--realm-cyan), 0 0 70px rgba(0,240,255,0.4), inset 0 0 20px rgba(0,240,255,0.3); }
}

/* Mobile radial menu overlay */
#nexusCoreMenu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4900;
  background: rgba(0,4,12,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  animation: menuBgIn 0.25s ease both;
}
#nexusCoreMenu.open { display: flex; }
@keyframes menuBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ncm-inner {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 16px;
  justify-items: center;
}

.ncm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  animation: ncmItemIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ncm-item:nth-child(1) { animation-delay: 0.03s; }
.ncm-item:nth-child(2) { animation-delay: 0.07s; }
.ncm-item:nth-child(3) { animation-delay: 0.11s; }
.ncm-item:nth-child(4) { animation-delay: 0.15s; }
.ncm-item:nth-child(5) { animation-delay: 0.19s; }
.ncm-item:nth-child(6) { animation-delay: 0.23s; }
.ncm-item:nth-child(7) { animation-delay: 0.27s; }

@keyframes ncmItemIn {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ncm-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(0,20,50,0.92);
  border: 1px solid var(--realm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 0 12px rgba(0,174,239,0.2);
}
.ncm-item:hover .ncm-icon-wrap,
.ncm-item:active .ncm-icon-wrap {
  border-color: var(--realm-cyan);
  box-shadow: 0 0 22px rgba(0,240,255,0.4);
  transform: scale(1.1);
}
.ncm-item.active-nav .ncm-icon-wrap {
  background: rgba(0,60,120,0.6);
  border-color: var(--realm-cyan);
  box-shadow: 0 0 20px rgba(0,240,255,0.45);
}

.ncm-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--realm-text-dim);
  text-align: center;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.ncm-item.active-nav .ncm-label { color: var(--realm-cyan); }

/* ═══════════════════════════════════════════════════════════
   PAGE LAYOUT — full-screen immersive
   ═══════════════════════════════════════════════════════════ */

/* Remap .page to work with new floating nav */
.page {
  padding: 20px 24px 40px calc(var(--shadow-core-w) + 32px) !important;
  max-width: 820px !important;
  margin: 0 auto 0 0 !important;
  position: relative;
  z-index: 10;
}

/* Page fade with portal feel */
.page.active {
  animation: realmPageIn 0.35s cubic-bezier(0.2,0,0,1) both !important;
}
@keyframes realmPageIn {
  from { opacity: 0; transform: translateY(12px) scale(0.99); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ═══════════════════════════════════════════════════════════
   ECLIPSE FEED — holographic post panels
   ═══════════════════════════════════════════════════════════ */

/* Post composer — energy creation panel */
.section-card {
  background: rgba(0,10,25,0.92) !important;
  border: 1px solid rgba(0,174,239,0.28) !important;
  border-radius: 18px !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.6), transparent);
  opacity: 0.7;
}
.section-card:hover {
  border-color: rgba(0,240,255,0.45) !important;
  box-shadow: 0 0 30px rgba(0,174,239,0.18) !important;
}

/* Eclipse title */
.eclipse-title {
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: #fff !important;
  text-shadow:
    0 0 8px #fff,
    0 0 20px var(--realm-blue),
    0 0 50px rgba(0,174,239,0.5) !important;
  animation: nexusGlow 3s ease-in-out infinite alternate !important;
}

/* Holographic post box */
.postBox {
  background: linear-gradient(145deg, rgba(0,12,28,0.94) 0%, rgba(0,20,45,0.90) 100%) !important;
  border: 1px solid rgba(0,174,239,0.30) !important;
  border-radius: 18px !important;
  position: relative !important;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.18s !important;
}
/* Holographic top shimmer */
.postBox::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.55), rgba(57,255,20,0.35), transparent);
  opacity: 0.6;
  pointer-events: none;
}
/* Side energy line */
.postBox::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--realm-blue), rgba(57,255,20,0.5), transparent);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.postBox:hover {
  border-color: rgba(0,240,255,0.55) !important;
  box-shadow:
    0 0 0 1px rgba(0,240,255,0.12),
    0 0 40px rgba(0,174,239,0.22),
    inset 0 0 30px rgba(0,174,239,0.04) !important;
  transform: translateY(-1px);
}
.postBox:hover::after { opacity: 0.6; }

/* Avatar aura glow */
.post-author-avatar {
  border: 2px solid rgba(0,174,239,0.55) !important;
  box-shadow: 0 0 12px rgba(0,174,239,0.4), 0 0 24px rgba(0,174,239,0.2) !important;
  animation: blueFlame 3s ease-in-out infinite;
}

/* Energy reaction buttons */
.react-btn {
  background: rgba(0,15,35,0.85) !important;
  border: 1px solid rgba(0,100,180,0.35) !important;
  border-radius: 22px !important;
  color: #5a9ac0 !important;
  font-size: 12px !important;
  padding: 5px 14px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.18s ease !important;
}
.react-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,174,239,0), rgba(0,174,239,0.08));
  opacity: 0;
  transition: opacity 0.18s;
}
.react-btn:hover {
  border-color: rgba(57,255,20,0.55) !important;
  color: var(--realm-green) !important;
  background: rgba(0,40,80,0.5) !important;
  box-shadow: 0 0 14px rgba(57,255,20,0.25), 0 0 6px rgba(0,174,239,0.2) !important;
  transform: scale(1.04);
}
.react-btn:hover::before { opacity: 1; }

/* Energy pulse on like */
@keyframes energyPulse {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.35); }
  50%  { transform: scale(0.9); }
  75%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.react-btn.energy-pulse {
  animation: energyPulse 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ═══════════════════════════════════════════════════════════
   SHADOW IDENTITY — Character profile
   ═══════════════════════════════════════════════════════════ */

/* Full-screen profile header */
.profile-header {
  background: linear-gradient(165deg, rgba(0,15,40,0.96) 0%, rgba(0,30,65,0.92) 100%) !important;
  border: 1px solid rgba(0,174,239,0.38) !important;
  border-radius: 20px !important;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 40px rgba(0,174,239,0.18),
    0 0 80px rgba(0,174,239,0.08),
    inset 0 0 60px rgba(0,174,239,0.04) !important;
}
.profile-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--realm-blue) 20%,
    var(--realm-cyan) 50%,
    var(--realm-green) 80%,
    transparent
  );
  opacity: 0.8;
  pointer-events: none;
}

/* Floating avatar with energy aura */
.p-avatar {
  border: 3px solid rgba(0,174,239,0.75) !important;
  box-shadow:
    0 0 30px rgba(0,174,239,0.55),
    0 0 60px rgba(0,174,239,0.25),
    0 0 0 6px rgba(0,174,239,0.08),
    inset 0 0 20px rgba(0,174,239,0.15) !important;
  animation: avatarAura 3s ease-in-out infinite;
}
@keyframes avatarAura {
  0%,100% {
    box-shadow:
      0 0 30px rgba(0,174,239,0.55),
      0 0 60px rgba(0,174,239,0.25),
      0 0 0 6px rgba(0,174,239,0.08),
      inset 0 0 20px rgba(0,174,239,0.15);
  }
  50% {
    box-shadow:
      0 0 40px rgba(0,240,255,0.7),
      0 0 80px rgba(0,240,255,0.35),
      0 0 0 8px rgba(0,240,255,0.12),
      inset 0 0 25px rgba(0,240,255,0.2);
  }
}

/* Profile display name — neon identity */
.profile-display-name {
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  text-shadow: 0 0 12px rgba(0,174,239,0.5) !important;
}

/* Cover banner — energy field */
.cover-banner {
  background: linear-gradient(135deg, #000810 0%, #001228 35%, #000c20 70%, #00081a 100%) !important;
  position: relative;
  overflow: hidden;
}
.cover-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(0,174,239,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 30%, rgba(57,255,20,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Profile tabs — futuristic */
.profile-tabs {
  border-bottom: 1px solid rgba(0,174,239,0.2) !important;
}
.tab-btn {
  color: rgba(106,154,184,0.7) !important;
  font-size: 12px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
}
.tab-btn:hover { color: var(--realm-cyan) !important; }
.tab-btn.active {
  color: var(--realm-green) !important;
  border-bottom: 2px solid var(--realm-green) !important;
  text-shadow: 0 0 10px rgba(57,255,20,0.5) !important;
}

/* Stats — holographic numbers */
.stat-num {
  font-size: 20px !important;
  font-weight: 900 !important;
  color: var(--realm-cyan) !important;
  text-shadow: 0 0 10px rgba(0,240,255,0.5) !important;
}
.stat-label {
  font-size: 10px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: rgba(106,154,184,0.65) !important;
}

/* ═══════════════════════════════════════════════════════════
   SHADOW PORTAL — Communication chambers
   ═══════════════════════════════════════════════════════════ */

/* Inbox split panel */
.inbox-split {
  background: rgba(0,8,20,0.94) !important;
  border: 1px solid rgba(0,174,239,0.25) !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,174,239,0.12) !important;
}

/* Contact list pane */
.inbox-list-pane {
  background: rgba(0,10,25,0.9) !important;
  border-right: 1px solid rgba(0,174,239,0.18) !important;
}
.inbox-list-header {
  border-bottom: 1px solid rgba(0,174,239,0.15) !important;
  background: rgba(0,5,15,0.95) !important;
}
.inbox-list-title { color: var(--realm-cyan) !important; letter-spacing: 1px; font-size: 13px; }

.inbox-conv-item {
  border-bottom: 1px solid rgba(0,60,120,0.12) !important;
  transition: background 0.15s, border-left 0.15s;
}
.inbox-conv-item:hover { background: rgba(0,174,239,0.08) !important; }
.inbox-conv-item.active-conv {
  background: rgba(0,60,120,0.2) !important;
  border-left: 2px solid var(--realm-cyan) !important;
}
.inbox-conv-avatar {
  border: 2px solid rgba(0,174,239,0.45) !important;
  box-shadow: 0 0 8px rgba(0,174,239,0.3) !important;
}

/* Chat pane */
.inbox-chat-pane {
  background: linear-gradient(180deg, rgba(0,10,25,0.97) 0%, rgba(0,5,15,0.98) 100%) !important;
}
.inbox-chat-header {
  background: rgba(0,5,15,0.98) !important;
  border-bottom: 1px solid rgba(0,174,239,0.2) !important;
}

/* Message bubbles — holographic transmissions */
.ipc-modal-bwrap.me .ipc-modal-bubble,
.inbox-chat-messages .ipc-modal-bwrap.me .ipc-modal-bubble {
  background: linear-gradient(135deg, #001244 0%, #002299 100%) !important;
  border: 1px solid rgba(0,174,239,0.45) !important;
  box-shadow: 0 0 16px rgba(0,130,255,0.25) !important;
}
.ipc-modal-bwrap.them .ipc-modal-bubble,
.inbox-chat-messages .ipc-modal-bwrap.them .ipc-modal-bubble {
  background: rgba(0,15,35,0.95) !important;
  border: 1px solid rgba(0,100,180,0.28) !important;
}

/* ipcModal — communication chamber */
#ipcModal { backdrop-filter: blur(12px) !important; background: rgba(0,3,10,0.85) !important; }
.ipc-modal-card {
  background: linear-gradient(180deg, rgba(0,15,35,0.98) 0%, rgba(0,8,20,0.99) 100%) !important;
  border: 1px solid rgba(0,174,239,0.40) !important;
  border-radius: 22px !important;
  box-shadow:
    0 0 60px rgba(0,174,239,0.2),
    0 20px 60px rgba(0,0,0,0.7) !important;
}
.ipc-modal-header {
  background: rgba(0,5,15,0.99) !important;
  border-bottom: 1px solid rgba(0,174,239,0.22) !important;
}

/* ═══════════════════════════════════════════════════════════
   SHADOW SIGNALS — Incoming signal notifications
   ═══════════════════════════════════════════════════════════ */

.notif-item {
  border-bottom: 1px solid rgba(0,60,120,0.2) !important;
  padding: 14px 4px !important;
  border-radius: 12px !important;
  transition: background 0.15s, transform 0.12s !important;
  position: relative;
}
.notif-item:hover {
  background: rgba(0,174,239,0.07) !important;
  transform: translateX(3px);
}
.notif-item.unread {
  background: rgba(0,80,200,0.09) !important;
  border-left: 2px solid rgba(57,255,20,0.6) !important;
  box-shadow: inset 4px 0 12px rgba(57,255,20,0.05) !important;
  animation: signalPulse 2s ease-in-out both;
}
@keyframes signalPulse {
  0%,100% { border-left-color: rgba(57,255,20,0.6); }
  50%     { border-left-color: rgba(57,255,20,1); }
}

.notif-text { color: #d0e8ff !important; }
.notif-time { color: rgba(106,154,184,0.65) !important; letter-spacing: 0.3px; }

/* Notification toast — signal incoming */
#notification-toast {
  background: rgba(0,8,20,0.98) !important;
  border: 1px solid rgba(0,174,239,0.65) !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 30px rgba(0,174,239,0.35),
    0 8px 30px rgba(0,0,0,0.6) !important;
  backdrop-filter: blur(16px) !important;
}

/* ═══════════════════════════════════════════════════════════
   STATUS SYSTEM — Energy presence indicators
   ═══════════════════════════════════════════════════════════ */

/* Active Energy (online) */
.online-dot,
.indicator-dot.online,
.profile-online-dot,
.inbox-conv-online-dot.online,
.ipc-modal-status-dot.online,
.inbox-chat-hdr-status.online {
  background: var(--realm-green) !important;
  box-shadow:
    0 0 6px rgba(57,255,20,0.9),
    0 0 16px rgba(57,255,20,0.5) !important;
  animation: activeEnergy 2s ease-in-out infinite !important;
}
@keyframes activeEnergy {
  0%,100% { box-shadow: 0 0 6px rgba(57,255,20,0.9), 0 0 16px rgba(57,255,20,0.5); }
  50%     { box-shadow: 0 0 10px rgba(57,255,20,1), 0 0 28px rgba(57,255,20,0.7); }
}

/* Shadow Presence — away */
.indicator-dot.away { background: rgba(255,140,0,0.8) !important; box-shadow: 0 0 8px rgba(255,140,0,0.6) !important; }
/* Invisible Mode */
.indicator-dot.invisible { background: rgba(100,120,160,0.4) !important; box-shadow: none !important; }

/* ═══════════════════════════════════════════════════════════
   STORM ROOMS — realm-themed
   ═══════════════════════════════════════════════════════════ */

.storm-card {
  background: rgba(0,12,30,0.9) !important;
  border: 1px solid rgba(0,174,239,0.35) !important;
  box-shadow: 0 0 28px rgba(0,174,239,0.15) !important;
}
.storm-room-header { background: rgba(0,5,15,0.96) !important; }
.storm-messages { background: rgba(0,8,20,0.82) !important; }

/* ═══════════════════════════════════════════════════════════
   SEARCH PAGE — realm search experience
   ═══════════════════════════════════════════════════════════ */
.user-card {
  background: rgba(0,12,30,0.92) !important;
  border: 1px solid rgba(0,174,239,0.22) !important;
  border-radius: 16px !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
}
.user-card:hover {
  border-color: rgba(0,240,255,0.45) !important;
  box-shadow: 0 0 24px rgba(0,174,239,0.18) !important;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS PAGE — control panel
   ═══════════════════════════════════════════════════════════ */
.settings-section h4 {
  color: var(--realm-cyan) !important;
  letter-spacing: 2px !important;
  text-shadow: 0 0 10px rgba(0,240,255,0.4) !important;
}
.settings-row { border-bottom: 1px solid rgba(0,174,239,0.12) !important; }

/* ═══════════════════════════════════════════════════════════
   GLOBAL INPUTS — energy fields
   ═══════════════════════════════════════════════════════════ */
input, textarea, select {
  background: rgba(0,12,30,0.95) !important;
  border: 1px solid rgba(0,174,239,0.38) !important;
  border-radius: 10px !important;
  color: #e8f4ff !important;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(0,240,255,0.7) !important;
  box-shadow: 0 0 12px rgba(0,174,239,0.3), 0 0 4px rgba(57,255,20,0.12) !important;
  outline: none;
}
input::placeholder, textarea::placeholder { color: rgba(0,174,239,0.35) !important; }

/* ═══════════════════════════════════════════════════════════
   GLOBAL BUTTONS — energy controls
   ═══════════════════════════════════════════════════════════ */
button:not(.sc-item):not(.ncm-item) {
  background: rgba(0,15,40,0.90) !important;
  border: 1px solid rgba(0,174,239,0.55) !important;
  color: var(--realm-blue) !important;
  border-radius: 8px !important;
  transition: all 0.18s ease !important;
}
button:not(.sc-item):not(.ncm-item):hover {
  background: rgba(0,174,239,0.18) !important;
  color: var(--realm-green) !important;
  border-color: rgba(57,255,20,0.62) !important;
  box-shadow: 0 0 14px rgba(57,255,20,0.28), 0 0 6px rgba(0,174,239,0.2) !important;
}

/* Send buttons — energy transmitters */
.ipc-modal-send,
.inbox-chat-send,
.support-send-btn,
.storm-send-btn {
  background: linear-gradient(135deg, #003388 0%, #0055cc 100%) !important;
  border: 1px solid rgba(0,174,239,0.7) !important;
  box-shadow: 0 0 16px rgba(0,174,239,0.4) !important;
}
.ipc-modal-send:hover,
.inbox-chat-send:hover {
  background: linear-gradient(135deg, #004422 0%, #007744 100%) !important;
  border-color: rgba(57,255,20,0.7) !important;
  box-shadow: 0 0 22px rgba(57,255,20,0.45) !important;
}

/* ═══════════════════════════════════════════════════════════
   FEED LIVE BANNER — live broadcasts
   ═══════════════════════════════════════════════════════════ */
.feed-live-card {
  background: rgba(0,8,20,0.96) !important;
  border: 1px solid rgba(255,40,70,0.40) !important;
  border-radius: 16px !important;
}
.feed-live-card:hover {
  border-color: rgba(255,40,70,0.78) !important;
  box-shadow: 0 4px 30px rgba(255,30,60,0.28) !important;
}

/* ═══════════════════════════════════════════════════════════
   MEDIA VIEWER
   ═══════════════════════════════════════════════════════════ */
#snxMediaViewer {
  background: rgba(0,3,10,0.97) !important;
}

/* ═══════════════════════════════════════════════════════════
   BADGES — realm-enhanced
   ═══════════════════════════════════════════════════════════ */
.badge-founder {
  animation: legendaryBadgePulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   COMMUNITY HUB
   ═══════════════════════════════════════════════════════════ */
.comm-quote-card,
.comm-challenge-card,
.support-card,
.storm-card {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ═══════════════════════════════════════════════════════════
   MODALS — realm portals
   ═══════════════════════════════════════════════════════════ */
.edit-profile-inner,
.delete-modal-inner,
.badge-tooltip-inner,
.social-list-inner,
.fam-req-inner {
  background: rgba(0,12,30,0.98) !important;
  border: 1px solid rgba(0,174,239,0.42) !important;
  box-shadow: 0 0 60px rgba(0,174,239,0.2), 0 20px 60px rgba(0,0,0,0.7) !important;
  backdrop-filter: blur(20px);
}

/* ═══════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ═══════════════════════════════════════════════════════════ */
#pwa-install-banner {
  background: rgba(0,12,30,0.97) !important;
  border: 1px solid rgba(0,174,239,0.48) !important;
  box-shadow: 0 0 30px rgba(0,174,239,0.25) !important;
  backdrop-filter: blur(16px);
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR — realm style
   ═══════════════════════════════════════════════════════════ */
* {
  scrollbar-color: rgba(0,174,239,0.4) rgba(0,10,25,0.5) !important;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(0,10,25,0.5); }
::-webkit-scrollbar-thumb { background: rgba(0,174,239,0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,240,255,0.65); }

/* ═══════════════════════════════════════════════════════════
   DESKTOP RESPONSIVE PATCH — shadow core visible on desktop
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {
  #nexusCoreBtn     { display: none !important; }
  #nexusCoreMenu    { display: none !important; }
  #snxMobileMenuBtn { display: none !important; }
  #shadowCore       { display: flex !important; }

  /* Orb click-to-expand hidden — nav is always open on desktop */
  .sc-orb {
    cursor: default !important;
    pointer-events: none !important;
  }

  /* Pages shift right to clear the always-open sidebar */
  .page {
    padding-left: calc(var(--shadow-core-w) + 32px) !important;
    max-width: calc(960px + var(--shadow-core-w)) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  #inboxPage {
    padding-left: calc(var(--shadow-core-w) + 0px) !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: var(--shadow-core-w) !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: none !important;
    width: auto !important;
  }
}

/* Mobile toggle button pulse — defined globally for Safari compat */
@keyframes snxMbtnPulse {
  0%,100% { box-shadow: 0 0 18px var(--realm-blue), 0 0 40px rgba(0,174,239,0.25); }
  50%     { box-shadow: 0 0 28px var(--realm-cyan), 0 0 60px rgba(0,240,255,0.35); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE / TABLET RESPONSIVE PATCH  (≤1024px)
   Shadow Core hides; full slide-out sidebar drawer shown instead.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Hide the floating crystal nav — drawer replaces it */
  #shadowCore    { display: none !important; }
  /* Hide old radial menu button / menu */
  #nexusCoreBtn  { display: none !important; }
  #nexusCoreMenu { display: none !important; }

  /* ── Mobile menu toggle button ── */
  #snxMobileMenuBtn {
    display: flex !important;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 5100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #003366, #000c1a);
    border: 2px solid var(--realm-blue);
    color: #fff;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 18px var(--realm-blue), 0 0 40px rgba(0,174,239,0.25);
    transition: box-shadow 0.2s, transform 0.15s, background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    animation: snxMbtnPulse 3s ease-in-out infinite;
  }
  #snxMobileMenuBtn:active { transform: scale(0.92); }
  #snxMobileMenuBtn.menu-open {
    background: radial-gradient(circle at 40% 35%, #005599, #001833);
    box-shadow: 0 0 26px var(--realm-cyan), 0 0 60px rgba(0,240,255,0.35);
    animation: none;
  }

  /* ── Slide-out drawer — universal: identical on Android, iPhone, tablet ── */
  .sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(320px, 85vw) !important;
    height: 100% !important;
    background: linear-gradient(180deg, rgba(0,8,20,0.99) 0%, rgba(0,15,35,0.99) 60%, rgba(0,5,15,0.99) 100%) !important;
    border-right: 1px solid var(--realm-border) !important;
    box-shadow: 4px 0 40px rgba(0,174,239,0.2), 8px 0 80px rgba(0,0,0,0.8) !important;
    z-index: 5000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.30s cubic-bezier(0.4,0,0.2,1) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    will-change: transform !important;
    /* Energy top border */
    border-top: 2px solid transparent !important;
    background-clip: padding-box !important;
  }
  .sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--realm-blue), var(--realm-cyan), var(--realm-green), transparent);
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
  }
  .sidebar.active {
    transform: translateX(0) !important;
  }

  /* Tap-outside overlay */
  #sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,3,12,0.70);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 4999;
  }
  #sidebarOverlay.visible { display: block; }

  /* Page content — full screen, top padding accounts for the toggle button */
  .page {
    padding: 70px 12px 24px 12px !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Inbox — always full screen, never pushed by sidebar */
  #inboxPage {
    padding: 0 !important;
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    z-index: 10;
  }

  .inbox-split {
    border-radius: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .postBox { border-radius: 14px !important; }
  .section-card { border-radius: 14px !important; }
}

/* Bottom padding on pages so content isn't obscured — mobile only */
@media (max-width: 1024px) {
  .page:not(#inboxPage) {
    padding-bottom: 28px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   SAFE AREA INSETS
   ═══════════════════════════════════════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
  .inbox-chat-footer { padding-bottom: calc(8px  + env(safe-area-inset-bottom)) !important; }
  .storm-footer      { padding-bottom: calc(8px  + env(safe-area-inset-bottom)) !important; }
  .support-footer    { padding-bottom: calc(8px  + env(safe-area-inset-bottom)) !important; }
  .sidebar-footer    { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
}

/* ═══════════════════════════════════════════════════════════
   HOLOGRAM SHIMMER — applied to key elements
   ═══════════════════════════════════════════════════════════ */
@keyframes holoShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.holo-text {
  background: linear-gradient(90deg,
    var(--realm-blue) 0%,
    var(--realm-cyan) 30%,
    #fff 50%,
    var(--realm-cyan) 70%,
    var(--realm-blue) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: holoShimmer 3s linear infinite;
}

/* Section headings */
.settings-section h4,
.inbox-list-title,
.mod-section-title,
.adm-section-title {
  letter-spacing: 1.5px !important;
}
