* {
  box-sizing: border-box;
}

:root {
  --accent: #4da3ff;
  --accent-soft: rgba(77, 163, 255, 0.18);
  --accent-glow: rgba(77, 163, 255, 0.35);

  --bg: #05070b;
  --panel: rgba(10, 14, 21, 0.88);
  --border: rgba(255, 255, 255, 0.09);
  --text: #edf4ff;
  --muted: #7d8ba0;
}

/* =========================================================
   BASE
   ========================================================= */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(
      circle at 50% 48%,
      rgba(35, 75, 120, 0.10),
      transparent 34%
    ),
    var(--bg);

  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

/* =========================================================
   MAIN HUD
   ========================================================= */

.hud {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 72px;

  padding: 0 30px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  z-index: 20;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-line {
  width: 3px;
  height: 18px;

  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);

  border-radius: 10px;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
}

.system-state {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.state-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
  background: var(--accent);

  box-shadow: 0 0 12px var(--accent-glow);
}

.history-button {
  display: flex;
  align-items: center;
  gap: 7px;

  padding: 8px 12px;
  margin: 0;

  background: transparent;
  color: var(--muted);

  border: 1px solid transparent;
  border-radius: 10px;

  font-size: 11px;
  cursor: pointer;

  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.history-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.history-icon {
  font-size: 16px;
}

/* =========================================================
   SUBJECT NAVIGATION
   ========================================================= */

.subject-nav {
  position: absolute;

  left: 50%;
  bottom: 34px;

  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 18px;

  z-index: 60;
}

.subject-dot {
  position: relative;

  width: 12px;
  height: 12px;

  padding: 0;
  margin: 0;

  border: 0;
  background: transparent;

  cursor: pointer;

  transition:
    width 220ms ease,
    transform 220ms ease;
}

.subject-dot .dot {
  display: block;

  width: 8px;
  height: 8px;

  margin: 2px;

  border-radius: 50%;

  background: #667080;

  transition:
    width 220ms ease,
    height 220ms ease,
    margin 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.subject-dot:hover .dot,
.subject-dot.active .dot {
  width: 12px;
  height: 12px;
  margin: 0;

  background: var(--subject-color, var(--accent));

  box-shadow:
    0 0 8px var(--subject-color, var(--accent)),
    0 0 22px color-mix(
      in srgb,
      var(--subject-color, var(--accent)) 40%,
      transparent
    );
}

.subject-label {
  position: absolute;

  left: 50%;
  bottom: 24px;

  transform:
    translateX(-50%)
    translateY(5px);

  white-space: nowrap;

  opacity: 0;
  pointer-events: none;

  color: var(--text);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;

  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.subject-dot:hover .subject-label,
.subject-dot.active .subject-label {
  opacity: 0.8;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   SUBJECT COLOURS
   ========================================================= */

.subject-dot.general {
  --subject-color: #4da3ff;
}

.subject-dot.chemistry {
  --subject-color: #ffc857;
}

.subject-dot.biology {
  --subject-color: #65d68a;
}

.subject-dot.maths {
  --subject-color: #b58cff;
}

.subject-dot.english {
  --subject-color: #ff6f91;
}

.subject-dot.french {
  --subject-color: #63c7ff;
}

.subject-dot.business {
  --subject-color: #ff9652;
}

.subject-dot.physchem {
  --subject-color: #2de8c4;
}

.subject-dot.brain {
  --subject-color: #b53cff;
}

.subject-dot.brain:hover .dot,
.subject-dot.brain.active .dot {
  animation: brainPulse 2.4s ease-in-out infinite;
}

@keyframes brainPulse {
  0%, 100% {
    background: #b53cff;
    box-shadow: 0 0 8px #b53cff, 0 0 22px rgba(181,60,255,0.4);
  }
  50% {
    background: #3cf0ff;
    box-shadow: 0 0 10px #3cf0ff, 0 0 26px rgba(60,240,255,0.5);
  }
}

.subject-dot.fun {
  --subject-color: #ff2fd4;
}

.subject-dot.fun:hover .dot,
.subject-dot.fun.active .dot {
  animation: funCycle 3s linear infinite;
}

@keyframes funCycle {
  0%   { background: #ff2fd4; box-shadow: 0 0 8px #ff2fd4, 0 0 22px rgba(255,47,212,0.4); }
  25%  { background: #2fd4ff; box-shadow: 0 0 8px #2fd4ff, 0 0 22px rgba(47,212,255,0.4); }
  50%  { background: #d4ff2f; box-shadow: 0 0 8px #d4ff2f, 0 0 22px rgba(212,255,47,0.4); }
  75%  { background: #8c2fff; box-shadow: 0 0 8px #8c2fff, 0 0 22px rgba(140,47,255,0.4); }
  100% { background: #ff2fd4; box-shadow: 0 0 8px #ff2fd4, 0 0 22px rgba(255,47,212,0.4); }
}

/* =========================================================
   SUBJECT HEADER
   ========================================================= */

.subject-header {
  position: absolute;

  top: 92px;
  left: 50%;

  transform: translateX(-50%);

  text-align: center;

  z-index: 10;
}

.subject-line,
.subject-header .eyebrow,
.subject-header p {
  display: none;
}

.subject-header h1 {
  margin: 0;

  font-size: 11px;
  font-weight: 600;

  letter-spacing: 4px;

  color: rgba(237, 244, 255, 0.38);
}

/* =========================================================
   CORE
   ========================================================= */

.core-area {
  position: absolute;
  inset: 72px 0 0 0;

  width: 100vw;
  height: calc(100vh - 72px);

  margin: 0;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: visible;
  z-index: 5;
}

.hud-core {
  display: none !important;
}

.workspace.hidden {
  display: none !important;
}

.workspace.hidden {
  display: none !important;
}

.fun-workspace {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
  background: #05070c;
}

/* =========================================================
   JARVIS HOLOGRAPHIC KNOWLEDGE SPHERE
   ========================================================= */

.core-area {
  position: relative;
  width: min(92vw, 900px);
  height: min(62vh, 650px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.jarvis-sphere {
  position: relative;
  width: min(68vh, 620px);
  height: min(68vh, 620px);
  min-width: 360px;
  min-height: 360px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.jarvis-sphere:active {
  cursor: grabbing;
}

.jarvis-sphere canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.sphere-glow {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(
      circle,
      rgba(70, 170, 255, .12) 0%,
      rgba(40, 130, 255, .06) 35%,
      transparent 70%
    );
  filter: blur(18px);
}

.sphere-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(150, 220, 255, .95);
  box-shadow:
    0 0 8px rgba(120, 210, 255, .95),
    0 0 25px rgba(60, 160, 255, .8),
    0 0 65px rgba(30, 120, 255, .45);
  pointer-events: none;
}

.sphere-label {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(130, 200, 255, .58);
  white-space: nowrap;
  pointer-events: none;
}

.sphere-depth {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(80, 170, 255, .08);
  border-radius: 50%;
  pointer-events: none;
}

@media (max-width: 700px) {
  .core-area {
    height: 55vh;
  }

  .jarvis-sphere {
    width: 90vw;
    height: 90vw;
    min-width: 300px;
    min-height: 300px;
  }
}

/* =========================================================
   BRAIN WORKSPACE
   ========================================================= */

.brain-workspace {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.brain-panel {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  max-width: 380px;
  width: calc(100% - 64px);
  text-align: center;
  color: rgba(237,244,255,0.85);
  background: rgba(8,10,16,0.45);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(181,60,255,0.2);
  border-radius: 20px;
  padding: 22px 26px;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(181,60,255,0.06);
}

.brain-visual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brain-glow-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181,60,255,0.18) 0%, rgba(60,240,255,0.10) 40%, transparent 70%);
  filter: blur(20px);
  animation: brainGlowPulse 3s ease-in-out infinite;
}

@keyframes brainGlowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.brain-svg {
  position: relative;
  width: 100%;
  height: 100%;
}

.brain-outline {
  fill: rgba(181,60,255,0.06);
  stroke: #b53cff;
  stroke-width: 1.4;
  filter: drop-shadow(0 0 6px rgba(181,60,255,0.8));
}

.brain-node {
  fill: #3cf0ff;
  filter: drop-shadow(0 0 4px #3cf0ff);
  animation: nodePulse 2.4s ease-in-out infinite;
}

.brain-link {
  stroke: rgba(181,60,255,0.5);
  stroke-width: 0.6;
}

@keyframes nodePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}



.brain-kicker {
  font-size: 9px;
  letter-spacing: 5px;
  color: #3cf0ff;
  opacity: 0.85;
}

.brain-panel h2 {
  margin: 10px 0 14px;
  font-size: 21px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 12px rgba(181,60,255,0.5);
}

.brain-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(237,244,255,0.55);
  margin-bottom: 18px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.brain-log {
  border: 1px solid rgba(181,60,255,0.18);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(181,60,255,0.03);
}

.brain-log-empty {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(237,244,255,0.35);
  font-style: italic;
}

/* =========================================================
   FUN / RESEARCH WORKSPACE
   ========================================================= */

.fun-workspace {
  padding: 40px;
}

.fun-header {
  text-align: center;
  margin-bottom: 36px;
}

.fun-kicker {
  font-size: 10px;
  letter-spacing: 4px;
  color: #ff2fd4;
}

.fun-header h2 {
  margin: 8px 0 12px;
  font-size: 26px;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 14px rgba(255,47,212,0.6);
}

.fun-desc {
  font-size: 13px;
  color: rgba(237,244,255,0.6);
}

.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.fun-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,47,212,0.25);
  background: linear-gradient(160deg, rgba(255,47,212,0.06), rgba(47,212,255,0.06));
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.fun-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(255,47,212,0.35), 0 0 40px rgba(47,212,255,0.2);
}

.fun-tile-icon {
  font-size: 26px;
  color: #2fd4ff;
  filter: drop-shadow(0 0 6px #2fd4ff);
}

.fun-tile-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  text-align: center;
}

.fun-tile-status {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(237,244,255,0.4);
}


/* =========================================================
   JARVIS SPHERE — CLEAN POSITION RESET
   ONE POSITION SYSTEM ONLY
   ========================================================= */

/*
   The sphere stage owns the viewport.

   No percentage offsets.
   No inherited margins.
   No transforms from previous layouts.
*/

.core-area {
  position: fixed !important;

  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;

  width: 100vw !important;
  height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  transform: none !important;

  overflow: visible !important;

  z-index: 5;
}

/*
   The physical sphere is centred directly inside
   the viewport stage.
*/

.jarvis-sphere {
  position: absolute !important;

  left: 50% !important;
  top: 50% !important;

  width: min(70vh, 700px) !important;
  height: min(70vh, 700px) !important;

  min-width: 360px !important;
  min-height: 360px !important;

  margin: 0 !important;
  padding: 0 !important;

  transform: translate(-50%, -50%) !important;

  overflow: visible !important;

  cursor: grab;
  user-select: none;
  touch-action: none;
}

.jarvis-sphere:active {
  cursor: grabbing;
}

/*
   The renderer itself is fullscreen.
   JavaScript calculates the sphere centre from
   the physical .jarvis-sphere element.
*/

.jarvis-sphere canvas {
  position: fixed !important;

  left: 0 !important;
  top: 0 !important;

  width: 100vw !important;
  height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;

  transform: none !important;

  display: block !important;

  pointer-events: none !important;

  overflow: visible !important;

  z-index: 0 !important;
}

/*
   Keep the holographic visual layers above the renderer.
*/

.sphere-glow,
.sphere-depth,
.sphere-core,
.sphere-label {
  z-index: 2;
}

/*
   The old HUD core must use the exact same centre.
*/

.hud-core {
  position: absolute !important;

  left: 50% !important;
  top: 50% !important;

  width: min(70vh, 700px) !important;
  height: min(70vh, 700px) !important;

  margin: 0 !important;

  transform: translate(-50%, -50%) !important;
}

/* =========================================================
   DEFINITIVE SPHERE CENTRE
   One coordinate system. One centre.
   ========================================================= */

.core-area {
  position: fixed !important;
  left: 0 !important;
  top: 72px !important;
  width: 100vw !important;
  height: calc(100vh - 72px) !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  overflow: visible !important;
}

.jarvis-sphere {
  position: absolute !important;

  left: 50% !important;
  top: 50% !important;

  margin: 0 !important;

  transform: translate(-50%, -50%) !important;
}

.jarvis-sphere canvas {
  position: absolute !important;

  left: 50% !important;
  top: 50% !important;

  width: 100vw !important;
  height: 100vh !important;

  transform: translate(-50%, -50%) !important;

  pointer-events: auto !important;
}


/* =========================================================
   STRONG SUBJECT COLOURS — NO GLOW
   ========================================================= */

.jarvis-sphere canvas {
  filter: none !important;
}

.sphere-glow {
  opacity: 0 !important;
  filter: none !important;
}

.sphere-depth {
  opacity: 0 !important;
}

.sphere-core {
  box-shadow: none !important;
  filter: none !important;
}

/* =========================================================
   SUBJECT-COLOURED CORE
   ========================================================= */

.jarvis-sphere .sphere-core {
  background: rgb(
    var(--core-r, 105),
    var(--core-g, 190),
    var(--core-b, 255)
  ) !important;

  box-shadow: none !important;
}

.jarvis-sphere .sphere-label {
  color: rgb(
    var(--core-r, 105),
    var(--core-g, 190),
    var(--core-b, 255)
  ) !important;

  text-shadow: none !important;
}

body[data-subject="general"] {
  --core-r: 105;
  --core-g: 190;
  --core-b: 255;
}

body[data-subject="chemistry"] {
  --core-r: 255;
  --core-g: 150;
  --core-b: 70;
}

body[data-subject="biology"] {
  --core-r: 90;
  --core-g: 230;
  --core-b: 120;
}

body[data-subject="maths"] {
  --core-r: 170;
  --core-g: 110;
  --core-b: 255;
}

body[data-subject="english"] {
  --core-r: 255;
  --core-g: 110;
  --core-b: 190;
}

body[data-subject="french"] {
  --core-r: 90;
  --core-g: 170;
  --core-b: 255;
}

body[data-subject="business"] {
  --core-r: 255;
  --core-g: 205;
  --core-b: 70;
}

/* =========================================================
   FINAL CORE — SHARP, TIGHT, SUBJECT COLOURED
   ========================================================= */

.jarvis-sphere .sphere-core {
  background: rgb(
    var(--core-r, 105),
    var(--core-g, 190),
    var(--core-b, 255)
  ) !important;

  box-shadow:
    0 0 2px rgb(var(--core-r, 105), var(--core-g, 190), var(--core-b, 255)),
    0 0 6px rgba(var(--core-r, var(--core-g, var(--core-b))), .45) !important;

  filter: none !important;
  opacity: 1 !important;
}

.jarvis-sphere .sphere-label {
  text-shadow: none !important;
}

/* =========================================================
   FINAL CORE — SUBJECT COLOUR + TIGHT GLOW
   ========================================================= */

.jarvis-sphere .sphere-core {
  background: rgb(
    var(--core-r, 105),
    var(--core-g, 190),
    var(--core-b, 255)
  ) !important;

  border-radius: 50% !important;

  box-shadow:
    0 0 4px rgb(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255)
    ),
    0 0 10px rgb(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255)
    ) !important;

  filter: none !important;
  opacity: 1 !important;
}

/* FINAL CORE LOOK */
.jarvis-sphere .sphere-core {
  border-radius: 50% !important;
  box-shadow:
    0 0 3px currentColor,
    0 0 8px currentColor !important;
  filter: none !important;
  opacity: 1 !important;
}

/* FINAL CORE GLOW */
.jarvis-sphere .sphere-core {
  box-shadow:
    0 0 2px rgb(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255)
    ),
    0 0 6px rgba(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255),
      0.75
    ) !important;

  filter: none !important;
}

/* FINAL CORE GLOW */
.jarvis-sphere .sphere-core {
  box-shadow:
    0 0 2px rgb(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255)
    ),
    0 0 6px rgba(
      var(--core-r, 105),
      var(--core-g, 190),
      var(--core-b, 255),
      0.75
    ) !important;

  filter: none !important;
}

/* =========================================================
   JARVIS BOOT INTRO — FULLSCREEN FRAMES
   ========================================================= */

#jarvis-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #02060b;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.5s ease;
}

#jarvis-intro.hidden {
  opacity: 0;
  pointer-events: none;
}

.jarvis-intro-grid {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.jarvis-intro-panel {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  transition: opacity .6s ease;
  background-image: url("/intro-sequence.png");
  background-size: 300% 300%;
  background-repeat: no-repeat;
}

.jarvis-intro-panel.active {
  opacity: 1;
}

.jarvis-intro-panel:nth-child(1) { background-position: 0% 0%; }
.jarvis-intro-panel:nth-child(2) { background-position: 50% 0%; }
.jarvis-intro-panel:nth-child(3) { background-position: 100% 0%; }
.jarvis-intro-panel:nth-child(4) { background-position: 0% 50%; }
.jarvis-intro-panel:nth-child(5) { background-position: 50% 50%; }
.jarvis-intro-panel:nth-child(6) { background-position: 100% 50%; }
.jarvis-intro-panel:nth-child(7) { background-position: 0% 100%; }
.jarvis-intro-panel:nth-child(8) { background-position: 50% 100%; }
.jarvis-intro-panel:nth-child(9) { background-position: 100% 100%; }

.jarvis-download {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: monospace;
  font-size: 24px;
  letter-spacing: 4px;
  color: rgba(150,220,255,.95);
  text-shadow:
    0 0 8px rgba(80,180,255,.8),
    0 0 20px rgba(50,150,255,.5);
}

#jarvis-intro.finalizing {
  opacity: 0;
}


/* =========================================================
   JARVIS REAL ANIMATED BOOT
   ========================================================= */

#jarvis-intro {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background:
    radial-gradient(
      circle at center,
      #061827 0%,
      #02070d 42%,
      #000207 100%
    );
  color: #bceeff;
  opacity: 1;
}

#jarvisIntroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.jarvis-intro-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: monospace;
  text-align: center;
}

.jarvis-intro-logo {
  font-size: clamp(24px, 3vw, 46px);
  letter-spacing: .7em;
  margin-left: .7em;
  text-shadow:
    0 0 8px rgba(90,210,255,.9),
    0 0 30px rgba(30,140,255,.7);
}

#jarvisIntroStatus {
  margin-top: 20px;
  font-size: clamp(10px, 1vw, 15px);
  letter-spacing: .35em;
  opacity: .8;
}

#jarvisIntroUser {
  min-height: 55px;
  margin-top: 18px;
  font-size: clamp(24px, 3vw, 48px);
  letter-spacing: .3em;
  color: #e8fbff;
  text-shadow:
    0 0 10px #5bd5ff,
    0 0 35px rgba(50,170,255,.8);
}

#jarvisIntroDownload {
  position: absolute;
  bottom: 13%;
  width: min(500px, 60vw);
  opacity: 0;
  transition: opacity .8s ease;
}

#jarvisIntroDownload.visible {
  opacity: 1;
}

#jarvisIntroPercent {
  font-size: 22px;
  letter-spacing: .25em;
  margin-bottom: 14px;
  text-shadow: 0 0 15px #45caff;
}

.jarvis-intro-bar {
  width: 100%;
  height: 2px;
  background: rgba(80,180,255,.15);
  box-shadow: 0 0 10px rgba(50,160,255,.2);
}

#jarvisIntroFill {
  width: 0;
  height: 100%;
  background: #73dcff;
  box-shadow:
    0 0 8px #52cfff,
    0 0 20px rgba(40,170,255,.8);
}

#jarvisIntroData {
  margin-top: 12px;
  font-size: 9px;
  letter-spacing: .4em;
  opacity: .45;
}


/* JARVIS INTRO FINAL HANDOFF */
#jarvis-intro.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#jarvis-intro.finalizing {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* FINAL INTRO HANDOFF */
#jarvis-intro.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#jarvis-intro.finalizing {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* =========================================================
   PHYSICS SUBJECT BUTTON
   ========================================================= */

.subject-dot.physics {
  background: rgba(120, 130, 140, 0.65) !important;
  border-color: rgba(180, 190, 200, 0.8) !important;
  color: #dbefff !important;
}

.subject-dot.physics:hover {
  background: rgba(90, 170, 220, 0.75) !important;
  border-color: rgba(150, 220, 255, 1) !important;
  box-shadow: 0 0 12px rgba(80, 180, 255, 0.65) !important;
}

.subject-dot.physics.active {
  background: rgba(70, 160, 220, 0.85) !important;
  border-color: rgba(160, 225, 255, 1) !important;
  box-shadow:
    0 0 8px rgba(80, 180, 255, 0.8),
    0 0 18px rgba(50, 150, 255, 0.45) !important;
}

/* PHYSICS BUTTON — MATCH SUBJECT DOT SHAPE */
.subject-dot.physics {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

/* PHYSICS BUTTON — EXACT SAME SIZE AS OTHER SUBJECT DOTS */
.subject-dot.physics {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.subject-dot.physics .dot {
  width: 8px !important;
  height: 8px !important;
  margin: 2px !important;
  border-radius: 50% !important;
}

/* PHYSICS — REMOVE SQUARE BUTTON OVERRIDES */
.subject-dot.physics {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.subject-dot.physics .dot {
  display: block !important;
  width: 8px !important;
  height: 8px !important;
  margin: 2px !important;
  border-radius: 50% !important;
}

/* =========================================================
   JARVIS VOICE CONTROLS
   ========================================================= */

.control-panel {
  position: fixed !important;
  left: 50% !important;
  bottom: 24px !important;
  transform: translateX(-50%) !important;
  z-index: 1000 !important;
  display: block !important;
}

.voice-controls {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.voice-controls button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ============================================================
   JARVIS PERMISSION MODAL — holographic / neon
   ============================================================ */

#jarvis-permission-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#jarvis-permission-modal {
  width: min(420px, 90vw);
  padding: 28px 30px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(10, 16, 28, 0.95), rgba(5, 7, 11, 0.98));
  border: 1px solid rgba(77, 163, 255, 0.55);
  box-shadow:
    0 0 18px rgba(77, 163, 255, 0.45),
    0 0 60px rgba(77, 163, 255, 0.15),
    inset 0 0 30px rgba(77, 163, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  text-align: center;
  animation: jarvis-modal-in 220ms ease;
}

@keyframes jarvis-modal-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

#jarvis-permission-modal h3 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7fd4ff;
  text-shadow: 0 0 10px rgba(127, 212, 255, 0.7);
}

#jarvis-permission-modal p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  font-family: monospace;
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.25);
  border-radius: 8px;
  padding: 12px;
}

#jarvis-permission-modal input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(77, 163, 255, 0.4);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.08em;
}

#jarvis-permission-modal input:focus {
  outline: none;
  border-color: #7fd4ff;
  box-shadow: 0 0 10px rgba(127, 212, 255, 0.5);
}

.jarvis-modal-buttons {
  display: flex;
  gap: 12px;
}

.jarvis-modal-buttons button {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 150ms ease;
}

#jarvis-modal-confirm {
  background: rgba(77, 163, 255, 0.15);
  border-color: rgba(77, 163, 255, 0.6);
  color: #7fd4ff;
  text-shadow: 0 0 8px rgba(127, 212, 255, 0.6);
}

#jarvis-modal-confirm:hover {
  background: rgba(77, 163, 255, 0.3);
  box-shadow: 0 0 14px rgba(77, 163, 255, 0.5);
}

#jarvis-modal-cancel {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--muted);
}

#jarvis-modal-cancel:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}
