/* ============================================================
   JARVIS LIVE VOICE v2 — Full-screen dominating visuals
   ============================================================ */

.jarvis-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: hidden;
}
.jarvis-overlay.open { opacity: 1; }

.jarvis-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 20;
  transition: all .3s;
}
.jarvis-close:hover {
  background: rgba(239,68,68,.3);
  color: #fff;
  transform: rotate(90deg);
}

/* Brain takes FULL SCREEN — it IS the background */
.jarvis-fullscreen-brain {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.jarvis-fullscreen-brain canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* HUD floats on top of the brain */
.jarvis-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 30px;
  pointer-events: none;
}
.jarvis-hud > * { pointer-events: auto; }

/* --- Top --- */
.jarvis-hud-top {
  text-align: center;
}
.jarvis-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  padding: 8px 22px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 30px;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(10px);
}
.jarvis-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 16px #22c55e, 0 0 4px #22c55e;
  animation: jdot 2s ease infinite;
}
@keyframes jdot {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.5; transform:scale(.8); }
}
.jarvis-status {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  letter-spacing: 1.5px;
}

/* --- Webcam PIP (picture-in-picture) --- */
.jarvis-webcam-pip {
  position: absolute;
  bottom: 160px;
  right: 30px;
  width: 180px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.6);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s, transform .5s;
  z-index: 15;
}
.jarvis-webcam-pip.active {
  opacity: 1;
  transform: translateY(0);
}
.jarvis-webcam-pip video {
  display: block;
  width: 100%;
  height: auto;
  transform: scaleX(-1); /* Mirror */
}
.jarvis-pip-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,.5);
  background: rgba(0,0,0,.5);
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- Transcript (floating over brain) --- */
.jarvis-transcript {
  width: 100%;
  max-width: 700px;
  max-height: 130px;
  overflow-y: auto;
  padding: 12px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.3);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.04);
  mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
  pointer-events: none;
}
.jarvis-line {
  margin-bottom: 8px;
  animation: jfade .3s ease;
}
@keyframes jfade {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:translateY(0); }
}
.jarvis-who {
  font-weight: 700;
  font-size: .65rem;
  letter-spacing: 2.5px;
  margin-right: 10px;
}
.jarvis-line.user .jarvis-who { color: #38bdf8; }
.jarvis-line.echo .jarvis-who { color: #f97316; }

/* --- Bottom HUD --- */
.jarvis-hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.jarvis-levels {
  display: flex;
  gap: 28px;
  width: 420px;
  max-width: 90vw;
}
.jarvis-level-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.jarvis-level-bar .jarvis-level-label {
  position: absolute;
  top: -16px;
  left: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem;
  letter-spacing: 3px;
  color: rgba(255,255,255,.25);
}
.jarvis-level-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width .06s linear;
  background: linear-gradient(90deg, #38bdf8, #0d9488);
  box-shadow: 0 0 8px rgba(56,189,248,.3);
}
.jarvis-level-bar.echo .jarvis-level-fill {
  background: linear-gradient(90deg, #f97316, #ef4444);
  box-shadow: 0 0 8px rgba(249,115,22,.3);
}

.jarvis-end-btn {
  padding: 10px 32px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.5);
  border-radius: 30px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .3s;
  letter-spacing: 1px;
}
.jarvis-end-btn:hover {
  background: rgba(239,68,68,.2);
  border-color: rgba(239,68,68,.4);
  color: rgba(255,255,255,.8);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .jarvis-transcript { max-height: 90px; font-size: .75rem; }
  .jarvis-levels { width: 260px; }
  .jarvis-webcam-pip { width: 120px; bottom: 140px; right: 16px; }
}
