:root {
  --bg: #07060f;
  --bg-alt: rgba(10, 10, 20, 0.55);

  --panel: rgba(255,255,255,0.04);
  --panel-2: rgba(40, 22, 70, 0.35);

  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.14);

  --text: #f3f2ff;
  --muted: rgba(243,242,255,0.62);

  --accent: #8b5cff;
  --accent2: #31d7ff;
  --accent-dim: rgba(139, 92, 255, 0.18);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(49,215,255,0.35) rgba(255,255,255,0.04);
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }


::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(49,215,255,0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(49,215,255,0.45); }


.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/static/skybackground.png") center/cover no-repeat fixed;
  transform: scale(1.02);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(139,92,255,0.22), transparent 55%),
    radial-gradient(circle at 78% 42%, rgba(49,215,255,0.16), transparent 52%),
    linear-gradient(180deg, rgba(0,0,0,0.52), rgba(0,0,0,0.78));
  pointer-events: none;
}

.hero-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,0.55) 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,0.55) 0%, transparent 100%);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent2);
  opacity: 0;
  animation: particleFloat linear infinite;
}
.particle:nth-child(1) { left: 10%; animation-duration: 18s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 22s; animation-delay: 2s; }
.particle:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-duration: 20s; animation-delay: 1s; }
.particle:nth-child(5) { left: 70%; animation-duration: 24s; animation-delay: 3s; }
.particle:nth-child(6) { left: 85%; animation-duration: 17s; animation-delay: 5s; }
.particle:nth-child(7) { left: 15%; animation-duration: 21s; animation-delay: 6s; }
.particle:nth-child(8) { left: 60%; animation-duration: 19s; animation-delay: 7s; }

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.42; }
  50% { opacity: 0.16; transform: translateY(55vh) scale(1); }
  90% { opacity: 0.28; }
  100% { transform: translateY(-10vh) scale(0.6); opacity: 0; }
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
}
.glass-card:hover {
  border-color: rgba(49,215,255,0.22);
  box-shadow: 0 22px 80px rgba(0,0,0,0.52), 0 0 38px rgba(49,215,255,0.08), 0 0 30px rgba(139,92,255,0.06);
  transform: translateY(-2px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent2);
  box-shadow: 0 0 10px rgba(49,215,255,0.55);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: transparent;
  color: var(--text);
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #07060f;
  border-color: transparent;
}
.btn--primary:hover {
  box-shadow: 0 0 34px rgba(49,215,255,0.24), 0 0 34px rgba(139,92,255,0.18);
  transform: translateY(-1px);
}
.btn--ghost:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.05);
}

.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,20,0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 16px rgba(139,92,255,0.40);
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent2), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.x-button {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  color: #07060f;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 26px rgba(139,92,255,0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.x-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(49,215,255,0.26), 0 0 36px rgba(139,92,255,0.18);
}

.main-layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 45% 55%;
  height: 100vh;
  padding-top: 72px;
}

.lobster-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 26px;
}

.lobster-container {
  text-align: center;
  padding: 18px 18px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 65px rgba(0,0,0,0.45);
}

#lobster-img {
  width: 460px;
  max-width: 92%;
  filter: drop-shadow(0 28px 70px rgba(0,0,0,0.62));
  animation: float 4.2s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0px); }
  50% { transform: translateY(-22px); }
}

.lobster-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.lobster-status.thinking {
  color: rgba(243,242,255,0.80);
  text-shadow: 0 0 18px rgba(49,215,255,0.18);
  animation: statusPulse 1.2s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.chat-panel {
  margin: 40px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px - 80px);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
  margin-bottom: 14px;
}

.message {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  max-width: 82%;
  line-height: 1.45;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.user {
  margin-left: auto;
  background: rgba(49,215,255,0.12);
  border-color: rgba(49,215,255,0.20);
}

.bot {
  margin-right: auto;
  background: rgba(139,92,255,0.10);
  border-color: rgba(139,92,255,0.20);
}

.chat-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

input {
  flex: 1;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: rgba(243,242,255,0.46); }
input:focus {
  border-color: rgba(49,215,255,0.38);
  box-shadow: 0 0 0 4px rgba(49,215,255,0.10);
}

@media (max-width: 980px) {
  .top-header { padding: 0 18px; }
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: auto;
    height: 100vh;
  }
  .chat-panel { margin: 18px; }
  #lobster-img { width: 380px; }
}

.volume-widget {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 55px rgba(0,0,0,0.45);
}

.vol-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.vol-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(49,215,255,0.28);
  background: rgba(255,255,255,0.05);
}

#volIcon {
  font-size: 16px;
  line-height: 1;
  color: var(--text);
  opacity: 0.9;
}

.vol-label {
  width: 44px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.vol-slider {
  --p: 85%; 
  width: 170px;
  height: 18px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.vol-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(49,215,255,0.95) 0%,
      rgba(139,92,255,0.85) var(--p),
      rgba(255,255,255,0.14) var(--p),
      rgba(255,255,255,0.14) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10);
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 999px;
  background: #f3f2ff;
  border: 2px solid rgba(49,215,255,0.65);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.vol-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.14);
}

.vol-slider::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(49,215,255,0.95), rgba(139,92,255,0.85));
}

.vol-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f3f2ff;
  border: 2px solid rgba(49,215,255,0.65);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

@media (max-width: 980px) {
  .volume-widget {
    left: 14px;
    bottom: 14px;
    padding: 10px 12px;
  }
  .vol-slider { width: 140px; }
}

.mic-btn {
  width: 46px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#mic-icon {
  font-size: 16px;
  line-height: 1;
}

.mic-btn.listening {
  border-color: rgba(49,215,255,0.35);
  box-shadow: 0 0 0 4px rgba(49,215,255,0.10);
  background: rgba(49,215,255,0.08);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.chat-header {
  flex: 0 0 auto;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.chat-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.chat-input-container {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (min-width: 981px) {
  .main-layout { overflow: hidden; }

  .chat-panel {
    height: calc(100vh - 72px - 60px);
  }
}

@media (max-width: 980px) {

  .volume-widget { display: none !important; }

  html, body {
    height: 100%;
    overflow: hidden !important;
  }

  .main-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: 26% 74%;
    height: calc(100svh - 72px) !important;
    margin-top: 72px;
    padding: 0;
    overflow: hidden !important;
  }

  .lobster-panel {
    padding: 6px 10px 2px;
    align-items: center;
    justify-content: center;
  }

  .lobster-container {
    padding: 6px;
  }

  #lobster-img {
    width: min(190px, 60vw);
  }

  .lobster-status {
    font-size: 11px;
    margin-top: 4px;
  }

  .chat-panel {
    margin: 6px 10px 10px;
    padding: 10px;
    height: 100%;
  }

  .chat-header {
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .chat-box {
    padding-right: 2px;
  }

  .chat-input-container {
    margin-top: 6px;
    padding-top: 6px;
  }

  input {
    height: 42px;
    font-size: 16px;
  }

  .btn {
    height: 42px;
  }

  .mic-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 420px) {

  .main-layout {
    grid-template-rows: 22% 78%;
  }

  #lobster-img {
    width: min(170px, 58vw);
  }

  .chat-panel {
    margin: 6px 8px 8px;
    padding: 8px;
  }

  .message {
    font-size: 13px;
  }
}