/* ══════════════════════════════════════════════════════════════════════════
   brain.css — Jarvis-style 3D brain UI (HUD + mount)
   ══════════════════════════════════════════════════════════════════════════ */

#brainView {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: radial-gradient(ellipse at center, #0b1024 0%, #040611 70%, #02030a 100%);
  display: none;
  overflow: hidden;
}
#brainView.visible { display: block; }
#brainView canvas { display: block; width: 100%; height: 100%; cursor: grab; }

body.brain-active { overflow: hidden; }

/* Top HUD bar */
#brainHUD {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: 'DM Mono', ui-monospace, monospace;
  color: #cfe2ff;
}
.brain-hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(5,9,20,.85), rgba(5,9,20,0));
  pointer-events: auto;
}
.brain-hud-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
}
.brain-hud-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #5ec1ff;
  box-shadow: 0 0 10px #5ec1ff, 0 0 20px #5ec1ff80;
  animation: brain-pulse 1.6s infinite;
}
@keyframes brain-pulse { 0%,100%{opacity:.4; transform:scale(.85)} 50%{opacity:1; transform:scale(1.15)} }
.brain-hud-cn { opacity: .5; font-size: 11px; letter-spacing: 1px; }
.brain-hud-actions button {
  background: rgba(94,193,255,.1);
  border: 1px solid rgba(94,193,255,.35);
  color: #cfe2ff;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
}
.brain-hud-actions button:hover { background: rgba(94,193,255,.22); }

/* Region labels (projected from 3D) */
.brain-hud-labels { position: absolute; inset: 0; pointer-events: none; }
.brain-region-label {
  position: absolute;
  transform: translate(0,0);
  transition: opacity .4s;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(5,9,20,.72);
  border: 1px solid rgba(127,200,255,.25);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: 1.2px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  user-select: none;
}
.brain-region-label:hover { border-color: rgba(127,200,255,.65); transform: translate(var(--tx,0), var(--ty,0)) scale(1.05); }
.brl-name { font-weight: 700; font-size: 10px; letter-spacing: 1.4px; }
.brl-cn   { font-size: 9px; opacity: .7; letter-spacing: .5px; margin-top: 1px; }
.brl-sub  { font-size: 9px; opacity: .65; margin-top: 2px; }
.brl-fire { color: #ffd166; }

/* Tooltip */
.brain-hud-tooltip {
  position: absolute;
  display: none;
  background: rgba(5,9,20,.92);
  border: 1px solid rgba(127,200,255,.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 10;
}

/* Footer */
.brain-hud-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  font-size: 11px;
  letter-spacing: 1.2px;
  background: linear-gradient(to top, rgba(5,9,20,.85), rgba(5,9,20,0));
  opacity: .85;
}

/* Nav trigger (sidebar button we add in index.html) */
.nav-item.brain-nav {
  position: relative;
}
.nav-item.brain-nav::after {
  content: '';
  position: absolute;
  right: 12px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: #5ec1ff;
  box-shadow: 0 0 8px #5ec1ff;
  transform: translateY(-50%);
  animation: brain-pulse 1.8s infinite;
}
