body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle, #123b60, #06111f 75%);
  color: #62dfff;
  font-family: Arial, sans-serif;
  display: grid;
  place-items: center;
  text-align: center;
}

h1 {
  font-size: 5rem;
  letter-spacing: 8px;
  text-shadow: 0 0 30px #009dff;
}

p {
  color: #a9c7d9;
  letter-spacing: 3px;
}

.core-area{display:grid;place-items:center;gap:20px}.core{position:relative;width:280px;height:280px;display:grid;place-items:center}.ring{position:absolute;border:3px solid #35d8ff;border-radius:50%;box-shadow:0 0 20px #00aaff88}.ring-one{width:90%;height:90%;border-left-color:transparent;animation:spin 10s linear infinite}.ring-two{width:70%;height:70%;border-top-color:transparent;animation:spin 7s linear infinite reverse}.ring-three{width:100%;height:100%;border-style:dashed;opacity:.4;animation:spin 20s linear infinite}.energy-orb{width:45%;height:45%;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#65eaff 25%,#0079df 60%,#031a4d);box-shadow:0 0 35px #00cfff,0 0 90px #008cff88;animation:breathe 3s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}@keyframes breathe{50%{transform:scale(1.12);opacity:.8}}@media(prefers-reduced-motion:reduce){.ring,.energy-orb{animation:none}}
#core-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:20px auto}
#core-controls button{background:#071d32;color:#72dcff;border:1px solid #258bc0;border-radius:8px;padding:12px 18px;cursor:pointer}
#core-controls button:hover,#core-controls button.active{background:#12547c;box-shadow:0 0 15px #00aaff66}
.core[data-state="thinking"] .ring{animation-duration:2s}
.core[data-state="listening"] .energy-orb{animation-duration:1s}
.core[data-state="speaking"] .energy-orb{animation-duration:.5s}
.core[data-state="alert"] .ring{border-color:#ff6633;box-shadow:0 0 25px #ff3300}
.core[data-state="alert"] .energy-orb{filter:hue-rotate(145deg)}
#dashboard-nav{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:20px auto}
#dashboard-nav button{background:#071d32;color:#72dcff;border:1px solid #258bc0;border-radius:8px;padding:12px 18px;cursor:pointer}
#dashboard-nav button.active,#dashboard-nav button:hover{background:#12547c;box-shadow:0 0 15px #00aaff66}
.module-open .core-area{position:fixed;right:20px;bottom:20px;z-index:10;transform:scale(.38);transform-origin:bottom right}
#module-panel:not([hidden]){width:min(90vw,850px);min-height:260px;padding:30px;margin:20px auto;border:1px solid #258bc0;border-radius:16px;background:#071d32;color:#a9dfff}

/* DOBBY Command Center - JARVIS Personality Panel */
#personality-panel {
  box-sizing: border-box;
  width: min(92%, 760px);
  margin: 28px auto;
  padding: 28px;
  border: 1px solid rgba(60, 210, 255, 0.55);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(7, 30, 55, 0.96),
    rgba(3, 13, 28, 0.96)
  );
  box-shadow:
    0 0 25px rgba(0, 180, 255, 0.16),
    inset 0 0 25px rgba(0, 180, 255, 0.05);
}

#personality-panel[hidden] {
  display: none !important;
}

#personality-panel h2 {
  color: #60dcff;
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(0, 200, 255, 0.5);
}

#personality-panel select {
  padding: 10px 14px;
  color: #a8efff;
  background: #071b30;
  border: 1px solid #29bfff;
  border-radius: 8px;
}

#personality-panel input[type="range"] {
  accent-color: #27caff;
  cursor: pointer;
}

#personality-panel label {
  color: #8be5ff;
}

@media (max-width: 600px) {
  #personality-panel {
    width: 96%;
    padding: 18px 12px;
  }
}

/* DOBBY Personality Panel - Layout Refinement */
#personality-panel {
  max-width: 680px;
  line-height: 1.8;
}

#personality-panel label[for="professionalism-slider"],
#personality-panel label[for="humor-slider"] {
  display: block;
  margin: 18px auto 4px;
  font-weight: 600;
}

#personality-panel input[type="range"] {
  display: block;
  width: min(100%, 420px);
  margin: 4px auto 16px;
}

#personality-panel select {
  margin: 8px auto 12px;
  font-size: 15px;
}

#personality-description {
  margin: 12px auto 22px;
  max-width: 480px;
}


/* DOBBY Holographic AI Core v2 */
.core {
  filter: drop-shadow(0 0 18px rgba(0, 200, 255, 0.35));
  transition: transform 0.5s ease, filter 0.5s ease;
}

.core .ring {
  box-shadow:
    0 0 12px rgba(0, 210, 255, 0.45),
    inset 0 0 12px rgba(0, 210, 255, 0.25);
}

.core .energy-orb {
  box-shadow:
    0 0 24px rgba(0, 210, 255, 0.6),
    0 0 55px rgba(0, 150, 255, 0.25),
    inset 0 0 25px rgba(180, 245, 255, 0.3);
}

@keyframes dobby-core-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
}

.core .energy-orb {
  animation: dobby-core-glow 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .core .energy-orb {
    animation: none;
  }
}

/* DOBBY AI Core - Distinct Listening and Speaking States */

@keyframes dobby-listening {
  0%, 100% {
    transform: scale(0.90);
    filter: brightness(0.85);
  }
  50% {
    transform: scale(1.12);
    filter: brightness(1.65);
  }
}

@keyframes dobby-speaking {
  0%, 100% {
    transform: scale(0.90);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.18);
    filter: brightness(1.7);
  }
  50% {
    transform: scale(0.96);
    filter: brightness(1.1);
  }
  75% {
    transform: scale(1.10);
    filter: brightness(1.5);
  }
}

.core[data-state="listening"] .energy-orb {
  animation: dobby-listening 1.6s ease-in-out infinite;
}

.core[data-state="speaking"] .energy-orb {
  animation: dobby-speaking 0.85s ease-in-out infinite;
}

.core[data-state="listening"] .ring {
  border-color: #70f5ff;
}

.core[data-state="speaking"] .ring {
  border-color: #a1dcff;
}

@media (prefers-reduced-motion: reduce) {
  .core[data-state="listening"] .energy-orb,
  .core[data-state="speaking"] .energy-orb {
    animation: none;
  }
}

/* DOBBY mobile layout v1 */
@media (max-width: 600px) {
  body { box-sizing: border-box; width: 100%; padding: 12px; overflow-x: hidden; }
  h1 { font-size: clamp(2rem, 10vw, 3rem); letter-spacing: 3px; }
  .core { width: min(68vw, 250px); height: auto; aspect-ratio: 1 / 1; }
  .core-area { width: 100%; gap: 12px; }
  #core-controls, #dashboard-nav { width: 100%; gap: 8px; }
  #core-controls button, #dashboard-nav button { flex: 1 1 105px; padding: 12px 8px; }
  #module-panel:not([hidden]) { box-sizing: border-box; width: 100%; min-width: 0; padding: 16px; }
  .module-open .core-area { right: 8px; bottom: 8px; transform: scale(.25); }
}

/* DOBBY holographic D - v1 */
.core {
  position: relative;
  transform-style: preserve-3d;
  perspective: 800px;
}

.core::after {
  content: "D";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: clamp(90px, 15vw, 145px);
  font-weight: bold;
  color: #d8faff;
  -webkit-text-stroke: 2px #39cfff;
  text-shadow:
    0 0 8px #ffffff,
    0 0 22px #00cfff,
    0 0 50px #007bff;
  transform: translateZ(35px);
  pointer-events: none;
}

/* DOBBY rotating holographic Earth - v1 */
.core .energy-orb {
  position: absolute;
  width: 66%;
  height: 66%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(100,235,255,.45), transparent 45%),
    linear-gradient(90deg, rgba(0,15,40,.75), transparent 30%, transparent 65%, rgba(0,15,40,.85)),
    url("earth.jpg") 0% center / auto 100% repeat-x;
  box-shadow:
    inset -18px -8px 35px rgba(0,5,30,.85),
    inset 8px 5px 25px rgba(100,230,255,.35),
    0 0 25px #00cfff,
    0 0 65px rgba(0,150,255,.5);
  animation: dobby-earth-rotate 60s linear infinite;
}

@keyframes dobby-earth-rotate {
  from { background-position: center, center, 0% center; }
  to { background-position: center, center, 200% center; }
}

@media (prefers-reduced-motion: reduce) {
  .core .energy-orb { animation: none; }
}

/* DOBBY transparent holographic globe v2 */
.core .energy-orb {
  background:
    radial-gradient(circle at 30% 25%, rgba(100,235,255,.16), transparent 55%),
    linear-gradient(90deg, rgba(0,15,40,.2), transparent 35%, rgba(0,15,40,.35)),
    url("earth.jpg") 0% center / auto 100% repeat-x;
  opacity: .48;
  border: 1px solid rgba(90,225,255,.7);
  box-shadow:
    inset -12px -8px 24px rgba(0,15,40,.35),
    inset 8px 5px 18px rgba(100,230,255,.2),
    0 0 22px rgba(0,210,255,.65),
    0 0 55px rgba(0,150,255,.25);
  animation: dobby-earth-rotate 60s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .core .energy-orb { animation: none; }
}
