@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@300;400;700;900&family=Rajdhani:wght@300;400;500;600&display=swap');
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body::-webkit-scrollbar {
  width: 5px;
}
body::-webkit-scrollbar-track {
  background: rgba(8, 10, 15, 0.6);
}
body::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #00e5ff;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080a0f;
}
#canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}
/* ── LAYOUT ── */
#shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}
/* ── HEADER ── */
header {
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  backdrop-filter: blur(16px);
  background: rgba(8, 10, 15, 0.7);
  z-index: 20;
  flex-shrink: 0;
}
.wrapper {
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
}
.h-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.h-sphere {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
}
.h-brand {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #00e5ff;
}
.h-brand b {
  color: #00FF00;
  font-size: 1.3rem;
}
.h-tag {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: rgba(160, 240, 232, 0.55);
  text-transform: uppercase;
}
.h-clear {
  cursor: pointer;
  background: none;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 5px;
  padding: 0.35rem 0.75rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.60rem;
  letter-spacing: 0.2em;
  color: #00e5ff;
  text-transform: uppercase;
  transition: all 0.2s;
}
.h-clear:hover {
  border-color: rgba(0, 229, 255, 0.6);
}
/* ── CHAT FEED ── */
#feed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
  min-height: 0;
}
#feed::-webkit-scrollbar {
  width: 5px;
}
#feed::-webkit-scrollbar-track {
  background: transparent;
}
#feed::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(0, 229, 255, 0.3);
}
/* ── WELCOME ── */
#welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
  animation: fadeUp 0.8s cubic-bezier(.22, 1, .36, 1) both;
  min-height: 0;
  padding: 0;
}
#welcome.hidden {
  display: none;
}
.w-sphere {
  width: 200px;
  height: 200px;
  position: relative;
  flex-shrink: 0;
}
#welcomeSphere {
  width: 100%;
  height: 100%;
}
.w-sphere-glow {
  position: absolute;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
}
.w-brand {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.5rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #00e5ff;
  line-height: 1.1;
}
.w-brand b {
  font-size: clamp(2rem, 7vw, 4.5rem);
  animation: colorCycle 1.5s ease-in-out infinite;
}
@keyframes colorCycle {
  0% {
    color: #ff00ff;
  }
  16% {
    color: #00ffff;
  }
  33% {
    color: #ff4400;
  }
  50% {
    color: #00ff88;
  }
  66% {
    color: #ffee00;
  }
  83% {
    color: #aa00ff;
  }
  100% {
    color: #ff00ff;
  }
}
.w-tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.5rem, 1.2vw, 0.65rem);
  letter-spacing: 0.25em;
  color: rgba(160, 240, 232, 0.6);
  text-transform: uppercase;
}
.w-hint {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  color: rgba(199, 210, 228, 0.35);
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}
@media (max-width: 768px) {
  #welcome {
    gap: 0.5rem
  }
  .w-sphere { 
    width: 250px;
    height: 250px;
  }
  .w-brand {
    font-size: clamp(2rem, 7vw, 5rem);
  }
  .w-brand b {
    font-size: clamp(3rem, 9vw, 6rem);
  }
  .w-tagline {
    font-size: 0.6rem;
  }
}
/* ── MESSAGES ── */
.msg {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto;
  width: 100%;
  max-width: 800px;
  animation: fadeUp 0.4s cubic-bezier(.22, 1, .36, 1) both;
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg.bot {
  align-self: flex-start;
}
.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.msg.user .msg-avatar {
  background: rgba(0, 255, 0, 0.15);
  border: 1px solid rgba(0, 255, 0, 0.35);
  color: #00FF00;
}
.msg.bot .msg-avatar {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #00e5ff;
}
.msg-bubble {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.02em;
  max-width: calc(100% - 50px);
}
.msg.user .msg-bubble {
  background: rgba(0, 255, 0, 0.15);
  border: 1px solid rgba(0, 255, 0, 0.35);
  color: #00FF00;
  border-radius: 5px 1px 5px 5px;
}
.msg.bot .msg-bubble {
  background: rgba(0, 229, 255, 0.04);
  border: 1px solid rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border-radius: 1px 5px 5px 5px;
  white-space: pre-wrap;
}
/* typing dots inside bubble */
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.2rem 0;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  background: #00e5ff;
  border-radius: 50%;
  animation: loaderDot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
/* ── INPUT BAR ── */
#bar {
  flex-shrink: 0;
  padding: 0.5rem;
  backdrop-filter: blur(16px);
  background: rgba(8, 10, 15, 0.7);
  border-top: 1px solid rgba(0, 229, 255, 0.1);
}
.bar-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 229, 255, 0.03);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}
.bar-inner:focus-within {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.07), inset 0 0 20px rgba(0, 229, 255, 0.02);
}
.scan-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.12), transparent);
  animation: scanAnim 3s linear infinite;
  pointer-events: none;
}
#prompt {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.7rem 0.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #C7D2E4;
  resize: none;
  min-height: 40px;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.5;
}
#prompt::placeholder {
  color: rgba(199, 210, 228, 0.6);
}
#prompt::-webkit-scrollbar {
  width: 3px;
}
#prompt::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 3px;
}
.btn-run {
  cursor: pointer;
  padding: 0.8rem 0.5rem;
  height: 100%;
  background: none;
  border: none;
  border-left: 1px solid rgba(0, 229, 255, 0.15);
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #00FF00;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.btn-run::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #00FF00;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-run:hover {
  color: #080a0f;
}
.btn-run:hover::after {
  opacity: 1;
}
.btn-run:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-run:disabled:hover::after {
  opacity: 0;
}
.btn-run:disabled:hover {
  color: #00FF00;
}
.btn-run span {
  position: relative;
  z-index: 1;
}
.bar-hint {
  text-align: center;
  margin-top: 0.5rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(160, 240, 232, 0.6);
  border-top: 1px dashed rgba(0, 229, 255, 0.1);
  padding-top: 8px;
}
/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
@keyframes scanAnim {
  0% {
    left: -10%;
  }
  100% {
    left: 110%;
  }
}
@keyframes loaderDot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.3;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}
@media(min-width: 768px) {
  .mobile { display: none; }
}
.banner-container {
  position: relative;
  width: 95%;
  max-width: 468px;
  height: 50px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.3);
  flex-shrink: 0;
  margin: 0.5rem auto;
  border-radius: 5px;
}
.banner {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  border-radius: 5px;
}
.banner.active {
  opacity: 1;
}
.banner-add-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 10;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #00e5ff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s;
}
.banner-add-btn:hover {
  border-color: rgba(0, 229, 255, 0.9);
}
.right-menu {
  position: fixed;
  top: 50px;
  right: -320px;
  width: 300px;
  height: calc(100% - 50px);
  background-color: #080a0f;
  border-top: 1px solid rgba(0,229,255,0.3);
  transition: right 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 99;
  padding: 0 10px;
}
.right-menu.open {
  right: 0;
}
.right-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.3);
  margin-bottom: 10px;
}
.right-menu-title {
  font-size: 12px;
  color: #00e5ff;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.right-menu-close {
  font-size: 15px;
  color: #00e5ff;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.5);
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.right-menu-close:hover {
  border-color: rgba(0, 229, 255, 0.9);
}
.right-menu .messages {
  height: 100%;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  overflow-y: auto;
  padding-bottom: 60px;
}
.right-menu .messages::placeholder { color: rgba(199,210,228,0.35); }
.right-menu .messages::-webkit-scrollbar { width: 5px; }
.right-menu .messages::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.6); border-radius: 3px; }

@media (max-width: 768px) {
  .right-menu {
    right: -110%;
    width: 100%;
  }
}