:root {
  color-scheme: dark;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Arial, sans-serif;
  background-image: url("/ZvezdNebo.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* Subtle twinkling overlay layers */
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1.4px, transparent 2.4px),
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 1.2px, transparent 2.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.20) 0 1px, transparent 2.0px);
  background-size: 120px 120px, 180px 180px, 260px 260px;
  background-position: 0 0, 60px 90px, 110px 40px;
  opacity: 0.18;
  filter: brightness(1.15);
  animation: starsTwinkleA 5.8s steps(14, end) infinite, starsDriftA 70s linear infinite;
}

body::after {
  /* Light shimmer of the real background image (makes the effect noticeable) */
  background-image: url("/ZvezdNebo.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.02;
  filter: brightness(1.22) contrast(1.08) saturate(1.04);
  animation: bgShimmer 4.8s ease-in-out infinite;
}

@keyframes starsTwinkleA {
  0% {
    opacity: 0.12;
  }
  35% {
    opacity: 0.24;
  }
  70% {
    opacity: 0.15;
  }
  100% {
    opacity: 0.19;
  }
}

@keyframes bgShimmer {
  0% {
    opacity: 0.00;
  }
  45% {
    opacity: 0.08;
  }
  100% {
    opacity: 0.02;
  }
}

@keyframes starsDriftA {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-42px, -18px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    /* Keep a very slow, subtle twinkle even when motion is reduced */
    transform: none !important;
  }

  body::before {
    animation: starsTwinkleA 10s ease-in-out infinite !important;
  }

  body::after {
    animation: bgShimmer 12s ease-in-out infinite !important;
  }
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 920px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.hero p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.reg-btn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.reg-btn:hover {
  background: rgba(0, 0, 0, 0.52);
}

.reg-btn span {
  font-size: 13px;
  font-weight: 650;
}

.agent-overlay {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(920px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.agent-overlay--show {
  opacity: 1;
}

.chat {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  z-index: 35;
  width: min(780px, 50vw);
  min-width: 420px;
  max-width: calc(100vw - 32px);
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
}

.chat-log {
  height: 220px;
  overflow: auto;
  padding: 12px;
  box-sizing: border-box;
}

.chat-row {
  display: flex;
  margin: 8px 0;
}

.chat-row--user {
  justify-content: flex-end;
}

.chat-row--agent,
.chat-row--sys {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.48);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-row--user .chat-bubble {
  background: rgba(46, 160, 255, 0.16);
  border-color: rgba(46, 160, 255, 0.25);
}

.chat-row--sys .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
}

.chat-form {
  display: block;
  padding: 12px;
  box-sizing: border-box;
  border-top: none;
}

.chat-inputWrap {
  position: relative;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  overflow: hidden;
}

.chat-input {
  width: 100%;
  border-radius: 18px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  padding: 16px 56px 62px 16px;
  outline: none;
  box-shadow: none;
  resize: none;
  min-height: 66px;
  line-height: 1.35;
  font-size: 15px;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
  outline: none;
}

.chat-send,
.chat-voice {
  position: absolute;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-voice {
  right: 10px;
  bottom: 48px;
}

.chat-send {
  right: 10px;
  color: rgba(46, 160, 255, 0.98);
}

.chat-send:hover {
  background: rgba(46, 160, 255, 0.14);
}

.chat-voice:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-send:disabled,
.chat-voice:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

